Skip to content

feat(protocol): reconcile SDK protocol with factory-mono-alpha (add commands/crons, retire loop RPCs)#60

Merged
varin-nair-factory merged 4 commits into
mainfrom
vn/protocol-reconcile-1.66
Jun 2, 2026
Merged

feat(protocol): reconcile SDK protocol with factory-mono-alpha (add commands/crons, retire loop RPCs)#60
varin-nair-factory merged 4 commits into
mainfrom
vn/protocol-reconcile-1.66

Conversation

@varin-nair-factory
Copy link
Copy Markdown
Contributor

@varin-nair-factory varin-nair-factory commented Jun 2, 2026

Summary

Reconciliation of src/protocol/ against the canonical wire-protocol definitions so downstream consumers can import schemas from this SDK as the source of truth. Also scrubs internal-architecture references from the public-facing source so they don't leak into shipped bundles and source-maps.

Bumps protocol version 1.62.01.66.0, SDK version 0.5.00.6.0.

Changes

Additions (commit 82c7230)

  • Slash-command schemas (droid.list_commands / daemon.list_commands): added CustomCommandInfoSchema, ListCommandsRequestSchema, ListCommandsResponseSchema to src/protocol/client.ts and new src/protocol/daemon/commands.ts.
  • Cron schemas (daemon.{list,create,update,delete}_cron, daemon.{hold,resume}_session_crons, daemon.cron.state_changed): new src/protocol/daemon/crons.ts (26 exports), plus tool-input schemas in new top-level src/protocol/crons.ts.
  • Wire-level constants in src/protocol/constants.ts: FACTORY_CLIENT_HEADER, FACTORY_CLIENT_VERSION, ACTIVE_ORGANIZATION_HEADER, SYSTEM_REMINDER_*, SYSTEM_NOTIFICATION_*, EXIT_SPEC_MODE_REJECTED_MESSAGE, DROID_IN_PROGRESS_STATES.
  • MissionSessionTagMetadata type added to src/protocol/session.ts.
  • Enums: DroidServerMethod.LIST_COMMANDS, DaemonDroidMethod.{LIST_COMMANDS, LIST_CRONS, CREATE_CRON, UPDATE_CRON, DELETE_CRON, HOLD_SESSION_CRONS, RESUME_SESSION_CRONS}, DaemonCronEvent.

Retired (FAC-19606, commit 82c7230)

  • Removed the DaemonLoop RPC family from src/protocol/daemon/droid.ts and DaemonDroidMethod (START_LOOP, STOP_LOOP, GET_LOOP_STATUS, RUN_LOOP_NOW) — never reached release upstream.
  • Trimmed src/protocol/loop.ts to the current shape: only LoopStateSchema (marked @deprecated) with the inlined deprecated interval bounds.

Constants alignment (commit 82c7230)

  • FACTORY_PROTOCOL_VERSION bumped 1.62.01.66.0.
  • LOOP_INTERVAL_POLICY.minMs fixed from seconds(5) to minutes(1) (matches upstream 1m–24h).

Subpath export (commit ef8bb8b)

  • Adds a dedicated ./protocol subpath export so consumers can import wire-protocol schemas directly without pulling the full SDK surface:
    import { daemon } from '@factory/droid-sdk/protocol';
  • Builds a separate dist/protocol/index.{js,cjs,d.ts,d.cts} via tsup.

Drift-closing schema additions (commit 79d67c6)

Closes residual schema drift detected by the downstream parity audit. All additions are new optional fields — no breaking changes:

  • enums.ts: 4 new ModelID entries.
  • general-settings.ts: McpAutonomyUrlOverrideSchema + mcpAutonomyUrlOverrides on ManagedSettingsBaseSchema, and dismissedNewModels on GeneralSettingsSchema.
  • daemon/droid.ts:
    • DaemonGetGitDiffDataSchema: committedDiff, committedFiles, committedTotalAdditions, committedTotalDeletions.
    • DaemonGetGitDiffRequestParamsSchema: statsOnly.
    • DaemonGetWorkspaceFileContentRequestParamsSchema: encoding (utf8|base64).
    • DaemonGetWorkspaceFileContentResultSchema: encoding, mimeType, isBinary.

After this commit downstream parity is 265/265 MATCH, 0 MISMATCH.

Internal-reference scrub (commit b512c80)

Strips internal-architecture references from src/protocol/** so they no longer leak into the published bundles and source-maps:

  • Remove file headers referencing internal monorepo / verbatim-port provenance from ~30 protocol files; replace with neutral one-line descriptions where useful.
  • Tighten billing/architecture JSDoc on WorkerFailureReason and MissionPauseReason (the enum members are unchanged; only the descriptive comments around them are scrubbed).
  • Drop editorial Deprecated / Extra Usage (overage) billing tier comments from LLMModelTier members.
  • Drop incidental references to internal infra (Vercel migration plans, Firestore sync, EAP cleanup, backend-v0-sessions, replay bug #974, MissionRunner / MissionFileService class names) from JSDoc and inline comments.
  • Add *.tgz to .gitignore so packed build artifacts aren't accidentally committed.

No schema, enum value, or exported symbol shape changes; bundle parity is unaffected (still 265/265 MATCH). Verified via grep of dist/protocol/index.{js,cjs} and *.map — zero hits for the scrubbed phrases.

Tests (across commits)

  • New: tests/protocol-commands.test.ts, tests/protocol-crons.test.ts.
  • Updated tests/protocol-daemon-droid.test.ts to assert acceptance of the 7 new methods and rejection of the 4 retired loop methods.
  • Extended tests/protocol-dir.test.ts for the top-level crons exports.

Version

  • package.json 0.5.00.6.0 (breaking removal of the loop daemon RPCs from the protocol.daemon.* namespace, even though they were never wired into the public API barrel).

Validation

  • npm run lint — clean
  • npm run typecheck — clean
  • npm run format:check — clean
  • npm test — 1075 / 1075 passing
  • npm run build — green
  • Downstream protocol parity audit — 265/265 MATCH, 0 MISMATCH
  • Bundle leak scan (post-scrub) — zero hits for sensitive phrases in dist/**

Refs: FAC-19606

varin-nair-factory and others added 4 commits June 2, 2026 12:28
Adds slash-command + cron schemas, retires the DaemonLoop RPC family
per FAC-19606, bumps FACTORY_PROTOCOL_VERSION to 1.66.0, and aligns
wire-level constants with mono. Version bumped 0.5.0 -> 0.6.0.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Adds a dedicated './protocol' subpath export so consumers can import
the wire-protocol schemas directly without pulling the full SDK
surface:

  import { daemon } from '@factory/droid-sdk/protocol';

Builds a separate dist/protocol/index.{js,cjs,d.ts,d.cts} via tsup.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…ruth

Adds missing fields/enum members detected by mono's verify-sdk-parity
audit so the SDK is bit-equivalent to mono's wire schemas:

- enums.ts: add ModelID entries ORIEL_0601, OXIDE_0601, OXBOW_0601,
  OCELOT_0601 (Olympus families released after the previous port).
- general-settings.ts: add McpAutonomyUrlOverrideSchema +
  mcpAutonomyUrlOverrides on ManagedSettingsBaseSchema, and
  dismissedNewModels on GeneralSettingsSchema.
- daemon/droid.ts:
  - DaemonGetGitDiffDataSchema: add committedDiff / committedFiles /
    committedTotalAdditions / committedTotalDeletions for the
    committed-only diff section the frontend renders.
  - DaemonGetGitDiffRequestParamsSchema: add statsOnly.
  - DaemonGetWorkspaceFileContentRequestParamsSchema: add encoding
    (utf8|base64) for binary file previews.
  - DaemonGetWorkspaceFileContentResultSchema: add encoding, mimeType,
    isBinary so the frontend can guard binary content properly.

After this change factory-mono-alpha reports 265/265 schema MATCH and
0 MISMATCH against @factory/droid-sdk/protocol.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Strips internal-architecture references from src/protocol/** so they
no longer leak into the published bundles and source-maps:

- Remove file headers referencing the internal monorepo and verbatim
  port provenance from ~30 protocol files; replace with neutral
  one-line descriptions where useful.
- Scrub billing/architecture JSDoc on WorkerFailureReason and
  MissionPauseReason (the enum members are unchanged; only the
  descriptive comments around them are tightened).
- Drop the editorial 'Deprecated' / 'Extra Usage (overage) billing
  tier' comments from LLMModelTier members.
- Drop incidental references to internal infra (Vercel, Firestore
  sync, EAP cleanup, backend-v0-sessions, replay bug #974,
  MissionRunner / MissionFileService class names) from JSDoc and
  inline comments.
- Add *.tgz to .gitignore so packed builds aren't accidentally
  committed.

No schema, enum value, or exported symbol shape changes; bundle
parity against mono is unaffected (still 265/265 MATCH).

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@varin-nair-factory varin-nair-factory merged commit 655254a into main Jun 2, 2026
4 checks passed
@varin-nair-factory varin-nair-factory deleted the vn/protocol-reconcile-1.66 branch June 2, 2026 22:10
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