Skip to content

docs: accept npx distribution spec - #10

Open
CharlesYWL wants to merge 4 commits into
mainfrom
dev/charlesyin/accept-npx-distribution-spec-c456
Open

docs: accept npx distribution spec#10
CharlesYWL wants to merge 4 commits into
mainfrom
dev/charlesyin/accept-npx-distribution-spec-c456

Conversation

@CharlesYWL

@CharlesYWL CharlesYWL commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Marks the npx distribution design as Accepted, approved by Charles on 2026-08-27, with the npm scope locked as @copilot-fleet (packages @copilot-fleet/protocol, @copilot-fleet/host, @copilot-fleet/node). The spec's git update path is aligned with the current apps/node/src/updater.ts: git fetch --prune followed by git reset --hard onto @{u}, replacing every stale git pull --ff-only mention; the npm path stays npm install @copilot-fleet/node@latest in the persistent prefix.

Follow-up commits fold in Copilot's three blockers as locked decisions, then the ESM-alias correction (@fleet/protocol keys stay; specs become npm:@copilot-fleet/protocol@<version>), then a third pass from local npm pack / install:

  • There is no bin/ directory. Packed bins are ./supervisor.mjs (Node) and ./host.mjs (Host) at the package root.
  • Packed files is mandatory. Root .gitignore has dist/, so an unrewritten protocol pack after tsc ships 0 dist files; pointing Node's bin at the supervisor without files drops Node dist from 69 files to 0.
  • npm: aliases only work for registry deps. Local smoke file:-installs protocol under the @fleet/protocol key (or overrides) and launches the bin. Publish protocol first.

Spec-only change; no runtime code is touched.

Verified locally (Node 22.14.0 / npm 10.9.7): protocol pack dist=0 src=8; node pack dist=69 src=45 bin/=0 supervisor.mjs present; rewriting the dep key to @copilot-fleet/protocol throws ERR_MODULE_NOT_FOUND; keeping the @fleet/protocol key imports; overrides + packed node bin launches.

Open in Web Open in Cursor 

Status moves to Accepted (2026-08-27, Charles). npm scope locked as
@copilot-fleet. Stale git-pull assumptions replaced with the current
updater.ts behavior: git fetch --prune, then git reset --hard onto @{u},
untracked files (.env included) surviving. Hello version noted as
already landed: packageVersion() reads package.json and packages ship
0.3.0. No runtime changes.

Co-authored-by: CharlesYWL <CharlesYWL@users.noreply.github.com>
@CharlesYWL
CharlesYWL marked this pull request as ready for review August 28, 2026 06:36
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c3fff78-75ef-48c6-a350-e21bd43367b2


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@CharlesYWL

Copy link
Copy Markdown
Owner Author

@copilot Please review this design

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

@copilot Please review this design

Review found three blockers before implementation:

  1. publishConfig.name does not rename a package (npm publish --dry-run still publishes the manifest’s name), and Host/Node would still depend on unpublished @fleet/protocol. The release design needs publish-ready manifests that rewrite both package names and internal dependencies (or permanent workspace renames), remove private, and set scoped packages to public access.
  2. The proposed Node tarball omits agents/ and public/, but runtime code reads both (agent-catalog.ts and config-assets.ts). They must be included and covered by a packed-tarball smoke test.
  3. Reusing the current unbounded repoRoot() walk for install-kind/revision detection can escape an npm prefix into an ancestor workspace or git repo. That can misclassify the Node as git, report the wrong SHA, and potentially hard-reset an unrelated checkout. Detection must be bounded to the running package/runtime prefix.

The fetch/reset and packageVersion() updates in this PR accurately describe the current implementation. I did not alter the accepted spec because the packaging and detection choices need to be resolved first.

Publish manifests: publishConfig.name does not rename under npm, so the
pack step rewrites packed manifests (@fleet/* -> @copilot-fleet/*, drop
private, access public); npm publish --dry-run on unrewritten @fleet/host
is the failing test. Node tarball must ship agents/ and public/, which
the runtime reads via packageRoot(), with a packed-tarball smoke test.
Install-kind detection is bounded to the running package's root so an
npm prefix can never adopt an ancestor checkout, misreport its SHA, or
reset --hard it. Spec-only; no runtime changes.

Co-authored-by: CharlesYWL <CharlesYWL@users.noreply.github.com>
github-actions Bot and others added 2 commits August 28, 2026 07:43
Local npm pack after tsc: protocol ships 0 dist files (gitignore),
node ships dist only because bin points at dist/main.js, and there
is no bin/ directory. Packed files must include dist and the
package-root shebang wrappers. npm: aliases are registry-only, so
the smoke test file:-installs protocol under the @fleet/protocol
key. Publish protocol first. Spec-only; no runtime changes.

Co-authored-by: CharlesYWL <CharlesYWL@users.noreply.github.com>
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.

3 participants