feat(protocol): reconcile SDK protocol with factory-mono-alpha (add commands/crons, retire loop RPCs)#60
Merged
Conversation
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>
0f4fa52 to
b512c80
Compare
factory-davidgu
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.0→1.66.0, SDK version0.5.0→0.6.0.Changes
Additions (commit
82c7230)droid.list_commands/daemon.list_commands): addedCustomCommandInfoSchema,ListCommandsRequestSchema,ListCommandsResponseSchematosrc/protocol/client.tsand newsrc/protocol/daemon/commands.ts.daemon.{list,create,update,delete}_cron,daemon.{hold,resume}_session_crons,daemon.cron.state_changed): newsrc/protocol/daemon/crons.ts(26 exports), plus tool-input schemas in new top-levelsrc/protocol/crons.ts.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.MissionSessionTagMetadatatype added tosrc/protocol/session.ts.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)DaemonLoopRPC family fromsrc/protocol/daemon/droid.tsandDaemonDroidMethod(START_LOOP,STOP_LOOP,GET_LOOP_STATUS,RUN_LOOP_NOW) — never reached release upstream.src/protocol/loop.tsto the current shape: onlyLoopStateSchema(marked@deprecated) with the inlined deprecated interval bounds.Constants alignment (commit
82c7230)FACTORY_PROTOCOL_VERSIONbumped1.62.0→1.66.0.LOOP_INTERVAL_POLICY.minMsfixed fromseconds(5)tominutes(1)(matches upstream1m–24h).Subpath export (commit
ef8bb8b)./protocolsubpath export so consumers can import wire-protocol schemas directly without pulling the full SDK surface:dist/protocol/index.{js,cjs,d.ts,d.cts}viatsup.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 newModelIDentries.general-settings.ts:McpAutonomyUrlOverrideSchema+mcpAutonomyUrlOverridesonManagedSettingsBaseSchema, anddismissedNewModelsonGeneralSettingsSchema.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:WorkerFailureReasonandMissionPauseReason(the enum members are unchanged; only the descriptive comments around them are scrubbed).Deprecated/Extra Usage (overage) billing tiercomments fromLLMModelTiermembers.backend-v0-sessions, replay bug#974,MissionRunner/MissionFileServiceclass names) from JSDoc and inline comments.*.tgzto.gitignoreso 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)
tests/protocol-commands.test.ts,tests/protocol-crons.test.ts.tests/protocol-daemon-droid.test.tsto assert acceptance of the 7 new methods and rejection of the 4 retired loop methods.tests/protocol-dir.test.tsfor the top-level crons exports.Version
package.json0.5.0→0.6.0(breaking removal of the loop daemon RPCs from theprotocol.daemon.*namespace, even though they were never wired into the public API barrel).Validation
npm run lint— cleannpm run typecheck— cleannpm run format:check— cleannpm test— 1075 / 1075 passingnpm run build— greendist/**Refs: FAC-19606