Skip to content

[factory] p3: publishable build + bin rename (factory-sdk → @agent-relay/factory)#370

Merged
khaliqgant merged 1 commit into
mainfrom
ricky/factory-p3-publish-prep
Jun 16, 2026
Merged

[factory] p3: publishable build + bin rename (factory-sdk → @agent-relay/factory)#370
khaliqgant merged 1 commit into
mainfrom
ricky/factory-p3-publish-prep

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jun 16, 2026

Copy link
Copy Markdown
Member

Factory build-out p3 (publish-prep): tsc dist build, exports → dist, drop private, public access, bin rename. Spec: factory/planning/linear-issue-factory-extract-p3-publish-prep.md.

Built by the factory relayflows squad (commit 69101c6); the run wedged at the open-pr step on the relayflows broker-robustness bug (AgentWorkforce/relayflows issue below), so opening the PR manually. Branch was already committed + pushed.

🤖 Generated with Claude Code

Review in cubic

@khaliqgant khaliqgant added the no-agent-relay-review Disable agent-relay automated PR review/fixes label Jun 16, 2026
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 39b865c8-4c32-4e8e-925e-139e6bab1ac2

📥 Commits

Reviewing files that changed from the base of the PR and between 3a80b03 and 69101c6.

📒 Files selected for processing (5)
  • .workflow-artifacts/factory-p3-publish-prep/self-reflection.md
  • packages/factory-sdk/bin/factory.mjs
  • packages/factory-sdk/bin/fleet.mjs
  • packages/factory-sdk/package.json
  • packages/factory-sdk/tsconfig.build.json

📝 Walkthrough

Walkthrough

Renames packages/factory-sdk from @pear/factory-sdk (private, CommonJS) to @agent-relay/factory (public, ESM). Adds tsconfig.build.json for compiling src into dist with declarations. Introduces bin/factory.mjs as the publish-facing CLI launcher pointing to dist/cli/fleet.js. Annotates the legacy bin/fleet.mjs. Adds a workflow self-reflection document.

Changes

factory-sdk Publish Preparation

Layer / File(s) Summary
Package identity, exports, and build config
packages/factory-sdk/package.json, packages/factory-sdk/tsconfig.build.json
package.json renames to @agent-relay/factory, removes private, switches type to module, sets main/types to ./dist/index.*, replaces bin.fleet with bin.factory, rewrites exports map from ./src/** with default to ./dist/** with import/types, and adds build/test scripts. tsconfig.build.json is added to emit declarations and source maps from ./src into ./dist using ESNext module + Bundler resolution.
CLI bin entrypoints
packages/factory-sdk/bin/factory.mjs, packages/factory-sdk/bin/fleet.mjs
factory.mjs is added as the publish-facing launcher: resolves ../dist/cli/fleet.js, imports it dynamically, and calls mod.main(process.argv.slice(2)). fleet.mjs gains a comment noting it runs raw TS sources until p4 builds the dist CLI.
Workflow self-reflection
.workflow-artifacts/factory-p3-publish-prep/self-reflection.md
Adds a markdown artifact documenting p3 scope, commands run (tsc, vitest, CLI --help, npm pack dry-run), repo-rule alignment, and remaining p4 risks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • AgentWorkforce/pear#229: Directly scaffolded @pear/factory-sdk with src/* exports and fleet bin — this PR is the continuation that renames and re-targets everything to dist/* under @agent-relay/factory.

Poem

🐇 Hop hop, the package is free at last,
From @pear/factory-sdk locked in the past!
Now @agent-relay/factory takes the stage,
ESM dist exports fill every page.
A factory.mjs bin to lead the way,
The rabbit ships it public today! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ricky/factory-p3-publish-prep

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 and usage tips.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@khaliqgant khaliqgant marked this pull request as ready for review June 16, 2026 18:38
@khaliqgant khaliqgant merged commit 168f668 into main Jun 16, 2026
4 checks passed
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@khaliqgant khaliqgant deleted the ricky/factory-p3-publish-prep branch June 16, 2026 18:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 69101c6f7d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"declarationMap": true,
"sourceMap": true,
"module": "ESNext",
"moduleResolution": "Bundler",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make the dist CLI Node-runnable

With moduleResolution: "Bundler" and plain tsc, the emitted ESM preserves extensionless relative imports from the sources, e.g. dist/cli/fleet.js imports ../mount/local-mount-preflight. The new bin/factory.mjs loads that file directly under Node ESM, which does not resolve extensionless relative specifiers, so the published factory command fails before parsing any args with ERR_MODULE_NOT_FOUND; use a Node-compatible emit or bundle/rewrite extensions before pointing the bin at dist.

Useful? React with 👍 / 👎.

"./writeback": { "types": "./dist/writeback/index.d.ts", "import": "./dist/writeback/index.js" }
},
"scripts": { "build": "tsc -p tsconfig.build.json", "test": "vitest run" },
"devDependencies": { "esbuild": "^0.24.2" }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Declare the package's runtime dependencies

Because this commit makes the package public and points exports/bin at dist, installs of @agent-relay/factory will only get dependencies declared in this manifest, but there is no dependencies section. The emitted entry points import runtime modules such as zod (src/config/schema.ts), @agent-relay/harness-driver (src/fleet/internal-fleet-client.ts), and @agent-relay/cloud/@relayfile/sdk (src/mount/relayfile-cloud-mount-client.ts), so the package only works inside the Pear repo where root dependencies are present and fails for npm consumers once those imports load.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-agent-relay-review Disable agent-relay automated PR review/fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant