Skip to content

installer: flip from @armoriq/sdk-dev to @armoriq/sdk (production)#10

Merged
Harihara04sudhan merged 2 commits into
mainfrom
chore/installer-flip-to-prod-sdk
Jun 10, 2026
Merged

installer: flip from @armoriq/sdk-dev to @armoriq/sdk (production)#10
Harihara04sudhan merged 2 commits into
mainfrom
chore/installer-flip-to-prod-sdk

Conversation

@Harihara04sudhan

Copy link
Copy Markdown
Contributor

Summary

Everything ArmorCopilot-related has landed on each repo's main:

Repo Confirmation
armoriq-sdk-customer-ts main @armoriq/sdk@0.3.8 published with --product flag + branded callback page (commits 651bf9b, 842484a)
conmap-auto main ProductSlug union + parseProduct() allowlist include 'armorcopilot' (PR #260 merged 2026-06-05)
armorIQ-Frontend main DeviceApproval.tsx PRODUCT_DISPLAY has armorcopilot entry

So the installer can now point at production artifacts.

Changes

Concern Before After
npm package install @armoriq/sdk-dev@latest @armoriq/sdk@latest
CLI bin preference order armoriq-devarmoriq → npx armoriq (prod) → armoriq-dev (legacy fallback) → npx
npx fallback npx @armoriq/sdk-dev login npx @armoriq/sdk login
DASHBOARD_URL https://dev.armoriq.ai https://platform.armoriq.ai
Header comment + Learn-more banner @armoriq/sdk-dev @armoriq/sdk
Success-banner SDK label @armoriq/sdk-dev (latest) @armoriq/sdk (latest)

Bonus: fixed the double browser-tab bug (rolled in)

Long-standing bug: pressing Y at the connect prompt opened two browser tabs with two unrelated device codes. Root cause was a login --help | grep '--product' probe that accidentally ran the full device-code flow as a side effect (the SDK's login subcommand has no per-subcommand --help handler — it parses --help as an unknown flag and proceeds). The grep then failed, the script fell into the env-var fallback branch, and ran login a second time.

Fix: dropped the probe, always pass --product as a flag, also export ARMORIQ_PRODUCT as a belt-and-braces fallback. One CLI call, one device code, one browser tab.

This is the same fix that was in PR #9. PR #9 stayed open while we were still on dev refs; this PR consolidates both changes into one merge.

Legacy fallbacks kept

Users who still have @armoriq/sdk-dev globally installed (no armoriq bin on PATH) keep working:

  • node_modules/@armoriq/sdk-dev is still accepted as "deps already present"
  • armoriq-dev CLI is checked as a second-priority fallback after armoriq

After merge

  1. Sync to armoriq-landing/public/install_armorcopilot.sh so https://armoriq.ai/install_armorcopilot.sh serves the new behavior.
  2. Close PR fix(installer): stop double-opening browser at the connect prompt #9 as superseded.

Test plan

  • Clean state: rm -rf ~/.armoriq/armorCopilot ~/.copilot/armorcopilot ~/.armoriq/credentials.json
  • npm uninstall -g @armoriq/sdk-dev @armoriq/sdk (start from scratch)
  • Run the installer. Confirm it installs @armoriq/sdk@latest globally.
  • Press Y at the connect prompt → exactly one browser tab opens at platform.armoriq.ai/auth/device?...&product=armorcopilot.
  • Complete login → audit logs land in platform.armoriq.ai (not dev.armoriq.ai).
  • Re-run installer with credentials present → update path fires, banner reads "SDK: @armoriq/sdk (latest)".

🤖 Generated with Claude Code

Harihara04sudhan and others added 2 commits June 9, 2026 10:32
Everything dev → main promotion has landed:
- conmap-auto main: ProductSlug + parseProduct allowlist include
  'armorcopilot' (PR #260 merged 2026-06-05)
- armorIQ-Frontend main: DeviceApproval.tsx PRODUCT_DISPLAY has
  armorcopilot entry
- armoriq-sdk-customer-ts main: @armoriq/sdk@0.3.8 published with
  --product flag + branded callback page

Flip the installer to point at production artifacts:
- @armoriq/sdk-dev → @armoriq/sdk (npm install -g, npx fallback,
  node_modules existence check, success banner, header comment)
- armoriq-dev CLI → armoriq CLI (header comment, install_armoriq_cli
  output label)
- DASHBOARD_URL: dev.armoriq.ai → platform.armoriq.ai
- connect_to_armoriq priority: armoriq (prod) first, then armoriq-dev
  (legacy), then npx @armoriq/sdk

Also fixes a long-standing double-browser-tab bug in connect_to_armoriq:
the previous `login --help | grep '--product'` probe accidentally ran
the full device-code flow as a side effect (SDK has no per-subcommand
--help handler), so pressing Y at the connect prompt opened two browser
tabs with two unrelated device codes. Dropped the probe, now always
passes --product as a flag AND exports ARMORIQ_PRODUCT as a fallback.
Single CLI call, single browser tab. (Same fix as PR #9, applied
directly to this consolidated PR.)

Legacy fallback paths to armoriq-dev / @armoriq/sdk-dev are kept so
users with the dev SDK still globally installed don't break.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ion)

Issue: users with the Python armoriq-sdk PyPI package installed (e.g. in
a conda env) have an `armoriq` binary that PATH-shadows the npm-installed
@armoriq/sdk's binary. The installer's `command -v armoriq` check
resolved to the Python armoriq, which has its own older un-branded
device-auth callback page. Result: even with @armoriq/sdk@0.3.8
installed globally, the user saw the bare pre-rebrand "Authorized" card.

Fix: route the login call through `npx -p @armoriq/sdk armoriq login`.
The -p flag pins the package source and uses its bin path for the
invocation, regardless of what's on the shell's PATH. We always run the
SDK we just installed.

Legacy fallback to armoriq-dev kept for users still on @armoriq/sdk-dev.

Detection signature on user's machine that triggered this:
  $ which armoriq
  /opt/homebrew/anaconda3/bin/armoriq    <-- Python SDK from conda
  $ npm ls -g
  @armoriq/sdk@0.3.8                     <-- our npm SDK, never invoked

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Harihara04sudhan Harihara04sudhan merged commit 5d05453 into main Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants