Commit 71ab8d8
feat: TIER-4 daemon protocol port + settings/ModelID fill + aux leaves + public API wiring (#57)
* feat: add daemon protocol enums (TIER-4a)
Mirror daemon/schemas/enums.ts from the private monorepo as the first
wave of TIER-4 daemon protocol port. Adds 16 enums covering daemon
methods, events, notification types, terminal, MCP config source,
session search/load state, and connection state.
Internal barrel at src/protocol/daemon/index.ts; not yet wired into
the public API (src/index.ts).
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* feat: add daemon protocol leaves (TIER-4b)
Mirror 10 daemon leaf schemas from the private monorepo as the second
wave of TIER-4 daemon protocol port:
- bug-report, management, skills, relay, terminal
- connection (token, apiKey)
- automations (+ AutomationPrivacyLevel)
- plugins (preserves RedactedMarketplaceSourceSchema separation)
- mcp (clientSecret, OAuth)
- settings (daemon-side defaults)
Bundled into the TIER-4a branch (PR #57).
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* feat: add daemon protocol root droid.ts (TIER-4c)
Mirror daemon/schemas/droid.ts from the private monorepo as the third
and final wave of TIER-4 daemon protocol port. Adds ~155 schemas plus
the master DaemonRequestSchema discriminated union covering session
lifecycle, file ops, search, git/PR, semantic diff, rewind, auth,
permissions/askUser, and session notifications.
Secrets carried: session init/load tokens, proxy token (verbatim).
Private helpers (createResponseSchema, createAckCompatibleResponseSchema)
mirrored as non-exported.
Bundled into TIER-4a+4b branch (PR #57).
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* feat: fill Settings/ModelID gap; replace TIER-4b inlined schemas
Port settings/schema.ts and ModelID enum from the private monorepo so
src/protocol/daemon/plugins.ts and src/protocol/daemon/settings.ts can
import MarketplaceSourceSchema, GeneralSettingsSchema, SessionDefault-
SettingsSchema, SettingsResolutionEventSchema, and ModelID instead of
inlining or string-fallback approximations.
RedactedMarketplaceSourceSchema remains intentionally distinct from
MarketplaceSourceSchema to preserve the credential-leak guard.
Bundled into PR #57.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* feat: add 8 aux protocol leaves (TIER-4d)
Mirror auxiliary protocol schemas not part of the daemon RPC surface
but useful for SDK consumers parsing on-disk artifacts and policy:
- automations (HEARTBEAT.md frontmatter) + AutomationPrivacyLevel
consolidated to top-level
- session-summary (.jsonl session_start event)
- session-tools (generic tool execution output)
- session-settings-types (z.infer wrappers)
- policy (UserModelPolicySchema)
- tools (built-in tool input/result schemas + RiskLevel)
- updater (BinaryDownloadPlanSchema)
- usage (TokenUsageSchema)
Bundled into PR #57.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* feat: expose src/protocol/ as public `protocol` namespace
Wire src/protocol/ into the public API via:
export * as protocol from './protocol/index.js';
Consumers can now access the daemon protocol schemas as:
import { protocol } from '@factory/droid-sdk';
protocol.daemon.DaemonRequestSchema
protocol.daemon.DaemonInitializeSessionRequestSchema
protocol.usage.TokenUsageSchema
protocol.FactoryDroidMessageSchema
Namespace export deliberately avoids collisions with the legacy
flat `src/protocol.ts` exports. Deprecating those is out of scope
for this PR.
Bundled into PR #57.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* refactor: drop narrowed GeneralSettingsSchema from public surface
The monorepo's GeneralSettingsSchema extends ManagedSettingsBaseSchema
with ~70 total fields and pulls a large transitive chain of CLI/UI/
policy schemas (CustomModelsSchema, ModelPolicySchema, McpPolicySchema,
MissionPolicySchema, NetworkPolicySchema, SandboxSettingsSchema,
FactoryRouterRuleSchema, plus a dozen UI enums) that are not part of
the daemon wire protocol.
The TIER-4d Settings/ModelID gap fill exposed a 7-field subset under
the same name. Exporting a misnamed subset is misleading: callers
parsing real settings.json blobs would silently lose 63 fields.
Remove GeneralSettingsSchema and the GeneralSettings type from the
public surface. The daemon settings RPCs that needed specific field
shapes now inline them directly from the monorepo source verbatim.
Bundled into PR #57.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* fix: port GeneralSettingsSchema and ManagedSettingsBaseSchema verbatim
Reverses the previous unacceptable narrowing/inlining. The full
GeneralSettingsSchema (extends ManagedSettingsBaseSchema, ~70 fields
total) is now mirrored verbatim from the monorepo source into a new
src/protocol/general-settings.ts module, along with every transitive
dependency the closure requires:
- 6 new enums (DiffMode, SoundFocusMode, TodoDisplayMode,
SubagentSoundMode, LogoAnimationMode, ToolResultDisplay) added
verbatim to src/protocol/enums.ts
- 4 router-rule constants added verbatim to src/protocol/constants.ts
- ModelPolicy, McpPolicy, MissionPolicy, Network/Sandbox/Marketplace/
FactoryRouterRule/StatusLine helper schemas ported verbatim
- ManagedSettingsBaseSchema exported (upstream declares it `const`;
visibility raised to allow `.extend(...)` across module boundaries —
documented in-file)
src/protocol/daemon/settings.ts restored to use
GeneralSettingsSchema.shape.X exactly as upstream daemon/schemas/
settings.ts does. The previous private GeneralSettingsShape const
workaround is removed.
Bundled into PR #57.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
---------
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>1 parent ff53ac3 commit 71ab8d8
38 files changed
Lines changed: 5658 additions & 0 deletions
File tree
- src
- protocol
- daemon
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
18 | 40 | | |
19 | 41 | | |
20 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments