diff --git a/config/max-lines-baseline.txt b/config/max-lines-baseline.txt index c9548a6cce13..f366c245842f 100644 --- a/config/max-lines-baseline.txt +++ b/config/max-lines-baseline.txt @@ -332,7 +332,6 @@ packages/ai/src/transports/anthropic-transport-stream.ts packages/ai/src/transports/openai-completions-transport.ts packages/gateway-client/src/client.ts packages/gateway-protocol/src/schema/agents-models-skills.ts -packages/gateway-protocol/src/schema/protocol-schemas.ts packages/markdown-core/src/ir.ts packages/memory-host-sdk/src/host/session-files.ts packages/sdk/src/client.ts diff --git a/docs/concepts/typebox.md b/docs/concepts/typebox.md index f5bfbaedb286..fb5227e6e334 100644 --- a/docs/concepts/typebox.md +++ b/docs/concepts/typebox.md @@ -46,7 +46,8 @@ The authoritative advertised **discovery** inventory lives in `src/gateway/serve ## Where the schemas live -- Source barrel: `packages/gateway-protocol/src/schema.ts` re-exports domain modules under `packages/gateway-protocol/src/schema/*.ts` (`frames.ts` for the top-level envelopes and handshake, `agent.ts`, `sessions.ts`, `cron.ts`, etc. per feature area). `protocol-schemas.ts` is the central `ProtocolSchemas` registry mapping schema names to their TypeBox definitions. +- Source barrels: `packages/gateway-protocol/src/schema-modules.ts` owns the canonical domain-module list, while the public `schema.ts` wrapper also exposes `ProtocolSchemas`. +- Generator registry: ordered `protocol-schema-fragment-*.ts` files map stable names to the canonical TypeBox objects from their owner modules. `protocol-schemas.ts` composes those fragments in a fixed order and rejects duplicate keys. - Runtime validators (AJV): `packages/gateway-protocol/src/index.ts` - Advertised feature/discovery registry: `src/gateway/server-methods-list.ts` - Server handshake and method dispatch: `src/gateway/server.impl.ts` @@ -58,7 +59,8 @@ The authoritative advertised **discovery** inventory lives in `src/gateway/serve - `pnpm protocol:gen` writes JSON Schema (draft-07) to `dist/protocol.schema.json`. - `pnpm protocol:gen:swift` generates the Swift gateway models. -- `pnpm protocol:check` runs both generators and verifies the Swift output is committed (the JSON Schema output is a gitignored build artifact). +- `pnpm protocol:gen:kotlin` generates the Android protocol models and constants. +- `pnpm protocol:check` checks the registry structure, runs all three generators, and verifies the committed Swift and Kotlin output (the JSON Schema output is a gitignored build artifact). ## How the schemas are used at runtime @@ -193,13 +195,21 @@ export const SystemEchoResultSchema = Type.Object( ); ``` -Import both into `packages/gateway-protocol/src/schema/protocol-schemas.ts`, add them to the `ProtocolSchemas` registry, and export the derived types: +Add both entries to the closest semantic `packages/gateway-protocol/src/schema/protocol-schema-fragment-*.ts` file. Import the owner module as a namespace when that fragment does not already use it, then map the stable registry names to the canonical schema objects: ```ts - SystemEchoParams: SystemEchoParamsSchema, - SystemEchoResult: SystemEchoResultSchema, +import * as system from "./system.js"; + +export const OperationsProtocolSchemas = { + // Existing entries stay in their current order. + // ... + SystemEchoParams: system.SystemEchoParamsSchema, + SystemEchoResult: system.SystemEchoResultSchema, +} as const; ``` +Do not sort fragment keys or move existing entries: native code generation follows registry insertion order. `protocol-schemas.ts` owns the deliberate fragment order and should change only when introducing a new semantic fragment. + ```ts export type SystemEchoParams = Static; export type SystemEchoResult = Static; @@ -272,7 +282,7 @@ Generated JSON Schema is a build artifact, not committed to the repo. During the ## When you change schemas -1. Update the TypeBox schemas in the owning `packages/gateway-protocol/src/schema/*.ts` module and register them in `protocol-schemas.ts`. +1. Update the TypeBox schemas in the owning `packages/gateway-protocol/src/schema/*.ts` module and register them in the closest `protocol-schema-fragment-*.ts` file without reordering existing keys. 2. Register the method/event in `src/gateway/server-methods-list.ts`. 3. Update `src/gateway/method-scopes.ts` when the new RPC needs operator or node scope classification. 4. Run `pnpm protocol:check`. diff --git a/package.json b/package.json index b53a9e546ebf..d3f41b5cb356 100644 --- a/package.json +++ b/package.json @@ -1633,11 +1633,12 @@ "prompt:snapshots:check": "node --import tsx scripts/generate-prompt-snapshots.ts --check", "prompt:snapshots:gen": "node --import tsx scripts/generate-prompt-snapshots.ts --write", "prompt:snapshots:sync-codex-model": "node --import tsx scripts/sync-codex-model-prompt-fixture.ts", - "protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && pnpm protocol:gen:kotlin && node scripts/check-protocol-since.mjs && git diff --exit-code -- dist/protocol.schema.json apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayProtocol.kt apps/android/app/src/main/java/ai/openclaw/app/protocol/OpenClawProtocolConstants.kt", + "protocol:check": "pnpm protocol-registry:check && pnpm protocol:gen && pnpm protocol:gen:swift && pnpm protocol:gen:kotlin && node scripts/check-protocol-since.mjs && git diff --exit-code -- dist/protocol.schema.json apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayProtocol.kt apps/android/app/src/main/java/ai/openclaw/app/protocol/OpenClawProtocolConstants.kt", "protocol:check:kotlin": "pnpm protocol:gen:kotlin && git diff --exit-code -- apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayProtocol.kt apps/android/app/src/main/java/ai/openclaw/app/protocol/OpenClawProtocolConstants.kt", "protocol:gen": "node --import tsx scripts/protocol-gen.ts", "protocol:gen:kotlin": "node --import tsx scripts/protocol-gen-kotlin.ts", "protocol:gen:swift": "node --import tsx scripts/protocol-gen-swift.ts", + "protocol-registry:check": "node --import tsx scripts/check-protocol-registry.mjs", "proxy:coverage": "node scripts/run-node.mjs proxy coverage", "proxy:gateway": "node scripts/run-node.mjs proxy run -- node scripts/run-node.mjs gateway", "proxy:install-ca": "node --import tsx scripts/proxy-install-ca.mjs", diff --git a/packages/gateway-protocol/src/schema-export-registry.ts b/packages/gateway-protocol/src/schema-export-registry.ts index d90a63a08786..99cf98cf78c9 100644 --- a/packages/gateway-protocol/src/schema-export-registry.ts +++ b/packages/gateway-protocol/src/schema-export-registry.ts @@ -555,13 +555,15 @@ export { FsDirEntrySchema, FsListDirParamsSchema, FsListDirResultSchema, - MIN_CLIENT_PROTOCOL_VERSION, - MIN_NODE_PROTOCOL_VERSION, - MIN_PROBE_PROTOCOL_VERSION, - PROTOCOL_VERSION, ErrorCodes, buildMissingScopeErrorDetails, GatewayErrorDetailCodes, errorShape, missingScopeErrorShape, -} from "./schema.js"; +} from "./schema-modules.js"; +export { + MIN_CLIENT_PROTOCOL_VERSION, + MIN_NODE_PROTOCOL_VERSION, + MIN_PROBE_PROTOCOL_VERSION, + PROTOCOL_VERSION, +} from "./version.js"; diff --git a/packages/gateway-protocol/src/schema-modules.ts b/packages/gateway-protocol/src/schema-modules.ts new file mode 100644 index 000000000000..8dcb7d411aeb --- /dev/null +++ b/packages/gateway-protocol/src/schema-modules.ts @@ -0,0 +1,52 @@ +/** Canonical owner-module barrel for gateway protocol schemas. */ +export * from "./schema/primitives.js"; +export * from "./schema/agent.js"; +export * from "./schema/agents-models-skills.js"; +export * from "./schema/agents-workspace.js"; +export * from "./schema/artifacts.js"; +export * from "./schema/approvals.js"; +export * from "./schema/audit-activity.js"; +export * from "./schema/audit.js"; +export * from "./schema/board.js"; +export * from "./schema/users.js"; +export * from "./schema/channels.js"; +export * from "./schema/channel-pairing.js"; +export * from "./schema/talk-marks.js"; +export * from "./schema/commands.js"; +export * from "./schema/config.js"; +export * from "./schema/openclaw.js"; +export * from "./schema/cron.js"; +export * from "./schema/cron.types.js"; +export * from "./schema/error-codes.js"; +export * from "./schema/environments.js"; +export * from "./schema/exec-approvals.js"; +export * from "./schema/devices.js"; +export * from "./schema/frames.js"; +export * from "./schema/fs.js"; +export * from "./schema/gateway-suspend.js"; +export * from "./schema/logs-chat.js"; +export * from "./schema/migrations.js"; +export * from "./schema/nodes.js"; +export * from "./schema/push.js"; +export * from "./schema/questions.js"; +export * from "./schema/secrets.js"; +export * from "./schema/session-placement.js"; +export * from "./schema/session-discussion.js"; +export * from "./schema/sessions.js"; +export * from "./schema/sessions-sharing.js"; +export * from "./schema/sessions-suggestions.js"; +export * from "./schema/sessions-catalog.js"; +export * from "./schema/skill-history.js"; +export * from "./schema/snapshot.js"; +export * from "./schema/system-info.js"; +export * from "./schema/system-event.js"; +export * from "./schema/task-suggestions.js"; +export * from "./schema/tasks.js"; +export * from "./schema/terminal.js"; +export * from "./schema/ui-command.js"; +export * from "./schema/plugin-approvals.js"; +export * from "./schema/plugins.js"; +export * from "./schema/wizard.js"; +export * from "./schema/worker-admission.js"; +export * from "./schema/worker-inference.js"; +export * from "./schema/worktrees.js"; diff --git a/packages/gateway-protocol/src/schema-types.ts b/packages/gateway-protocol/src/schema-types.ts index 303247a73e0e..d2f54a4ce852 100644 --- a/packages/gateway-protocol/src/schema-types.ts +++ b/packages/gateway-protocol/src/schema-types.ts @@ -1,58 +1,7 @@ /** * Type-only schema barrel for the package root. * - * Keep this module list aligned with `schema.ts`, except for the runtime-only - * `protocol-schemas` registry. Routing root type exports through that registry - * retains the full registry in downstream declaration bundles. + * Routing root type exports through the runtime-only `protocol-schemas` + * registry retains the full registry in downstream declaration bundles. */ -export type * from "./schema/primitives.js"; -export type * from "./schema/agent.js"; -export type * from "./schema/agents-models-skills.js"; -export type * from "./schema/agents-workspace.js"; -export type * from "./schema/artifacts.js"; -export type * from "./schema/approvals.js"; -export type * from "./schema/audit-activity.js"; -export type * from "./schema/audit.js"; -export type * from "./schema/board.js"; -export type * from "./schema/users.js"; -export type * from "./schema/channels.js"; -export type * from "./schema/channel-pairing.js"; -export type * from "./schema/talk-marks.js"; -export type * from "./schema/commands.js"; -export type * from "./schema/config.js"; -export type * from "./schema/openclaw.js"; -export type * from "./schema/cron.js"; -export type * from "./schema/cron.types.js"; -export type * from "./schema/error-codes.js"; -export type * from "./schema/environments.js"; -export type * from "./schema/exec-approvals.js"; -export type * from "./schema/devices.js"; -export type * from "./schema/frames.js"; -export type * from "./schema/fs.js"; -export type * from "./schema/gateway-suspend.js"; -export type * from "./schema/logs-chat.js"; -export type * from "./schema/migrations.js"; -export type * from "./schema/nodes.js"; -export type * from "./schema/push.js"; -export type * from "./schema/questions.js"; -export type * from "./schema/secrets.js"; -export type * from "./schema/session-placement.js"; -export type * from "./schema/session-discussion.js"; -export type * from "./schema/sessions.js"; -export type * from "./schema/sessions-sharing.js"; -export type * from "./schema/sessions-suggestions.js"; -export type * from "./schema/sessions-catalog.js"; -export type * from "./schema/skill-history.js"; -export type * from "./schema/snapshot.js"; -export type * from "./schema/system-info.js"; -export type * from "./schema/system-event.js"; -export type * from "./schema/task-suggestions.js"; -export type * from "./schema/tasks.js"; -export type * from "./schema/terminal.js"; -export type * from "./schema/ui-command.js"; -export type * from "./schema/plugin-approvals.js"; -export type * from "./schema/plugins.js"; -export type * from "./schema/wizard.js"; -export type * from "./schema/worker-admission.js"; -export type * from "./schema/worker-inference.js"; -export type * from "./schema/worktrees.js"; +export type * from "./schema-modules.js"; diff --git a/packages/gateway-protocol/src/schema.ts b/packages/gateway-protocol/src/schema.ts index 2a2664c56b14..68b28dd05d1a 100644 --- a/packages/gateway-protocol/src/schema.ts +++ b/packages/gateway-protocol/src/schema.ts @@ -4,55 +4,5 @@ * Runtime validators import canonical TypeBox schemas from their owning modules; * this barrel gives package consumers one stable path for schema-level imports. */ -export * from "./schema/primitives.js"; -export * from "./schema/agent.js"; -export * from "./schema/agents-models-skills.js"; -export * from "./schema/agents-workspace.js"; -export * from "./schema/artifacts.js"; -export * from "./schema/approvals.js"; -export * from "./schema/audit-activity.js"; -export * from "./schema/audit.js"; -export * from "./schema/board.js"; -export * from "./schema/users.js"; -export * from "./schema/channels.js"; -export * from "./schema/channel-pairing.js"; -export * from "./schema/talk-marks.js"; -export * from "./schema/commands.js"; -export * from "./schema/config.js"; -export * from "./schema/openclaw.js"; -export * from "./schema/cron.js"; -export * from "./schema/cron.types.js"; -export * from "./schema/error-codes.js"; -export * from "./schema/environments.js"; -export * from "./schema/exec-approvals.js"; -export * from "./schema/devices.js"; -export * from "./schema/frames.js"; -export * from "./schema/fs.js"; -export * from "./schema/gateway-suspend.js"; -export * from "./schema/logs-chat.js"; -export * from "./schema/migrations.js"; -export * from "./schema/nodes.js"; +export * from "./schema-modules.js"; export * from "./schema/protocol-schemas.js"; -export * from "./schema/push.js"; -export * from "./schema/questions.js"; -export * from "./schema/secrets.js"; -export * from "./schema/session-placement.js"; -export * from "./schema/session-discussion.js"; -export * from "./schema/sessions.js"; -export * from "./schema/sessions-sharing.js"; -export * from "./schema/sessions-suggestions.js"; -export * from "./schema/sessions-catalog.js"; -export * from "./schema/skill-history.js"; -export * from "./schema/snapshot.js"; -export * from "./schema/system-info.js"; -export * from "./schema/system-event.js"; -export * from "./schema/task-suggestions.js"; -export * from "./schema/tasks.js"; -export * from "./schema/terminal.js"; -export * from "./schema/ui-command.js"; -export * from "./schema/plugin-approvals.js"; -export * from "./schema/plugins.js"; -export * from "./schema/wizard.js"; -export * from "./schema/worker-admission.js"; -export * from "./schema/worker-inference.js"; -export * from "./schema/worktrees.js"; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-composer.test.ts b/packages/gateway-protocol/src/schema/protocol-schema-composer.test.ts new file mode 100644 index 000000000000..b0e3c64a8acd --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-composer.test.ts @@ -0,0 +1,28 @@ +import type { TSchema } from "typebox"; +import { describe, expect, it } from "vitest"; +import { composeProtocolSchemaFragments } from "./protocol-schema-composer.js"; + +describe("composeProtocolSchemaFragments", () => { + it("preserves fragment and key order without replacing schema objects", () => { + const first = {} as TSchema; + const second = {} as TSchema; + const registry = composeProtocolSchemaFragments([{ First: first }, { Second: second }]); + + expect(Object.keys(registry)).toEqual(["First", "Second"]); + expect(Object.is(registry.First, first)).toBe(true); + expect(Object.is(registry.Second, second)).toBe(true); + }); + + it("rejects duplicate owner keys", () => { + const schema = {} as TSchema; + expect(() => composeProtocolSchemaFragments([{ Shared: schema }, { Shared: schema }])).toThrow( + "Duplicate protocol schema key: Shared", + ); + }); + + it("retains literal registry keys", () => { + const registry = composeProtocolSchemaFragments([{ RequestFrame: {} as TSchema }]); + const key: keyof typeof registry = "RequestFrame"; + expect(key).toBe("RequestFrame"); + }); +}); diff --git a/packages/gateway-protocol/src/schema/protocol-schema-composer.ts b/packages/gateway-protocol/src/schema/protocol-schema-composer.ts new file mode 100644 index 000000000000..bd944d565b0a --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-composer.ts @@ -0,0 +1,24 @@ +import type { TSchema } from "typebox"; + +type ProtocolSchemaFragment = Readonly>; +type UnionToIntersection = (Value extends unknown ? (value: Value) => void : never) extends ( + value: infer Intersection, +) => void + ? Intersection + : never; + +/** Compose explicitly ordered owner fragments without replacing their schema objects. */ +export function composeProtocolSchemaFragments< + const Fragments extends readonly ProtocolSchemaFragment[], +>(fragments: Fragments): UnionToIntersection { + const registry: Record = {}; + for (const fragment of fragments) { + for (const [key, schema] of Object.entries(fragment)) { + if (Object.hasOwn(registry, key)) { + throw new Error(`Duplicate protocol schema key: ${key}`); + } + registry[key] = schema; + } + } + return registry as UnionToIntersection; +} diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-agent-control.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-agent-control.ts new file mode 100644 index 000000000000..38ef08b4adda --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-agent-control.ts @@ -0,0 +1,58 @@ +import * as agent from "./agent.js"; +import * as environments from "./environments.js"; +import * as fsSchemas from "./fs.js"; +import * as systemInfo from "./system-info.js"; +import * as worktrees from "./worktrees.js"; + +export const AgentControlProtocolSchemas = { + EnvironmentStatus: environments.EnvironmentStatusSchema, + WorkerEnvironmentState: environments.WorkerEnvironmentStateSchema, + WorkerTunnelStatus: environments.WorkerTunnelStatusSchema, + WorkerEnvironmentMetadata: environments.WorkerEnvironmentMetadataSchema, + EnvironmentSummary: environments.EnvironmentSummarySchema, + EnvironmentsCreateParams: environments.EnvironmentsCreateParamsSchema, + EnvironmentsCreateResult: environments.EnvironmentsCreateResultSchema, + EnvironmentsDestroyParams: environments.EnvironmentsDestroyParamsSchema, + EnvironmentsDestroyResult: environments.EnvironmentsDestroyResultSchema, + EnvironmentsListParams: environments.EnvironmentsListParamsSchema, + EnvironmentsListResult: environments.EnvironmentsListResultSchema, + EnvironmentsStatusParams: environments.EnvironmentsStatusParamsSchema, + EnvironmentsStatusResult: environments.EnvironmentsStatusResultSchema, + SystemInfoParams: systemInfo.SystemInfoParamsSchema, + SystemInfoResult: systemInfo.SystemInfoResultSchema, + AgentEvent: agent.AgentEventSchema, + ConversationSendParams: agent.ConversationSendParamsSchema, + ConversationSendResult: agent.ConversationSendResultSchema, + ConversationListItem: agent.ConversationListItemSchema, + ConversationListParams: agent.ConversationListParamsSchema, + ConversationListResult: agent.ConversationListResultSchema, + ConversationTurnCancelParams: agent.ConversationTurnCancelParamsSchema, + ConversationTurnCancelResult: agent.ConversationTurnCancelResultSchema, + ConversationTurnParams: agent.ConversationTurnParamsSchema, + ConversationTurnReply: agent.ConversationTurnReplySchema, + ConversationTurnResult: agent.ConversationTurnResultSchema, + MessageActionParams: agent.MessageActionParamsSchema, + SendParams: agent.SendParamsSchema, + PollParams: agent.PollParamsSchema, + AgentParams: agent.AgentParamsSchema, + AgentIdentityParams: agent.AgentIdentityParamsSchema, + AgentIdentityResult: agent.AgentIdentityResultSchema, + AgentWaitParams: agent.AgentWaitParamsSchema, + WakeParams: agent.WakeParamsSchema, + WorktreeRecord: worktrees.WorktreeRecordSchema, + WorktreesListParams: worktrees.WorktreesListParamsSchema, + WorktreesListResult: worktrees.WorktreesListResultSchema, + WorktreesCreateParams: worktrees.WorktreesCreateParamsSchema, + WorktreesRemoveParams: worktrees.WorktreesRemoveParamsSchema, + WorktreesRemoveResult: worktrees.WorktreesRemoveResultSchema, + WorktreesRestoreParams: worktrees.WorktreesRestoreParamsSchema, + WorktreesGcParams: worktrees.WorktreesGcParamsSchema, + WorktreesGcResult: worktrees.WorktreesGcResultSchema, + WorktreeBranch: worktrees.WorktreeBranchSchema, + WorktreeRepositoryStatus: worktrees.WorktreeRepositoryStatusSchema, + WorktreesBranchesParams: worktrees.WorktreesBranchesParamsSchema, + WorktreesBranchesResult: worktrees.WorktreesBranchesResultSchema, + FsDirEntry: fsSchemas.FsDirEntrySchema, + FsListDirParams: fsSchemas.FsListDirParamsSchema, + FsListDirResult: fsSchemas.FsListDirResultSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-agents-skills.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-agents-skills.ts new file mode 100644 index 000000000000..cd03e33868e4 --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-agents-skills.ts @@ -0,0 +1,93 @@ +import * as agentsModelsSkills from "./agents-models-skills.js"; +import * as agentsWorkspace from "./agents-workspace.js"; +import * as artifacts from "./artifacts.js"; +import * as commands from "./commands.js"; +import * as skillWorkshop from "./skill-protocol-schemas.js"; + +export const AgentSkillProtocolSchemas = { + AgentKind: agentsModelsSkills.AgentKindSchema, + AgentSummary: agentsModelsSkills.AgentSummarySchema, + AgentsCreateParams: agentsModelsSkills.AgentsCreateParamsSchema, + AgentsCreateResult: agentsModelsSkills.AgentsCreateResultSchema, + AgentsUpdateParams: agentsModelsSkills.AgentsUpdateParamsSchema, + AgentsUpdateResult: agentsModelsSkills.AgentsUpdateResultSchema, + AgentsDeleteParams: agentsModelsSkills.AgentsDeleteParamsSchema, + AgentsDeleteResult: agentsModelsSkills.AgentsDeleteResultSchema, + AgentsFileEntry: agentsModelsSkills.AgentsFileEntrySchema, + AgentsFilesListParams: agentsModelsSkills.AgentsFilesListParamsSchema, + AgentsFilesListResult: agentsModelsSkills.AgentsFilesListResultSchema, + AgentsFilesGetParams: agentsModelsSkills.AgentsFilesGetParamsSchema, + AgentsFilesGetResult: agentsModelsSkills.AgentsFilesGetResultSchema, + AgentsFilesSetParams: agentsModelsSkills.AgentsFilesSetParamsSchema, + AgentsFilesSetResult: agentsModelsSkills.AgentsFilesSetResultSchema, + AgentsWorkspaceEntry: agentsWorkspace.AgentsWorkspaceEntrySchema, + AgentsWorkspaceFile: agentsWorkspace.AgentsWorkspaceFileSchema, + AgentsWorkspaceListParams: agentsWorkspace.AgentsWorkspaceListParamsSchema, + AgentsWorkspaceListResult: agentsWorkspace.AgentsWorkspaceListResultSchema, + AgentsWorkspaceGetParams: agentsWorkspace.AgentsWorkspaceGetParamsSchema, + AgentsWorkspaceGetResult: agentsWorkspace.AgentsWorkspaceGetResultSchema, + ArtifactSummary: artifacts.ArtifactSummarySchema, + ArtifactsListParams: artifacts.ArtifactsListParamsSchema, + ArtifactsListResult: artifacts.ArtifactsListResultSchema, + ArtifactsGetParams: artifacts.ArtifactsGetParamsSchema, + ArtifactsGetResult: artifacts.ArtifactsGetResultSchema, + ArtifactsDownloadParams: artifacts.ArtifactsDownloadParamsSchema, + ArtifactsDownloadResult: artifacts.ArtifactsDownloadResultSchema, + AgentsListParams: agentsModelsSkills.AgentsListParamsSchema, + AgentsListResult: agentsModelsSkills.AgentsListResultSchema, + ModelChoice: agentsModelsSkills.ModelChoiceSchema, + ModelsAuthLogoutParams: agentsModelsSkills.ModelsAuthLogoutParamsSchema, + ModelsAuthStatusParams: agentsModelsSkills.ModelsAuthStatusParamsSchema, + ModelsListParams: agentsModelsSkills.ModelsListParamsSchema, + ModelsListResult: agentsModelsSkills.ModelsListResultSchema, + ModelsProbeParams: agentsModelsSkills.ModelsProbeParamsSchema, + ModelsProbeTargetResult: agentsModelsSkills.ModelsProbeTargetResultSchema, + ModelsProbeResult: agentsModelsSkills.ModelsProbeResultSchema, + CommandEntry: commands.CommandEntrySchema, + CommandsListParams: commands.CommandsListParamsSchema, + CommandsListResult: commands.CommandsListResultSchema, + SkillsStatusParams: agentsModelsSkills.SkillsStatusParamsSchema, + ToolsCatalogParams: agentsModelsSkills.ToolsCatalogParamsSchema, + ToolCatalogProfile: agentsModelsSkills.ToolCatalogProfileSchema, + ToolCatalogEntry: agentsModelsSkills.ToolCatalogEntrySchema, + ToolCatalogGroup: agentsModelsSkills.ToolCatalogGroupSchema, + ToolsCatalogResult: agentsModelsSkills.ToolsCatalogResultSchema, + ToolsEffectiveParams: agentsModelsSkills.ToolsEffectiveParamsSchema, + ToolsEffectiveEntry: agentsModelsSkills.ToolsEffectiveEntrySchema, + ToolsEffectiveGroup: agentsModelsSkills.ToolsEffectiveGroupSchema, + ToolsEffectiveNotice: agentsModelsSkills.ToolsEffectiveNoticeSchema, + ToolsEffectiveResult: agentsModelsSkills.ToolsEffectiveResultSchema, + ToolsInvokeParams: agentsModelsSkills.ToolsInvokeParamsSchema, + ToolsInvokeError: agentsModelsSkills.ToolsInvokeErrorSchema, + ToolsInvokeResult: agentsModelsSkills.ToolsInvokeResultSchema, + SkillsBinsParams: agentsModelsSkills.SkillsBinsParamsSchema, + SkillsBinsResult: agentsModelsSkills.SkillsBinsResultSchema, + SkillsSearchParams: agentsModelsSkills.SkillsSearchParamsSchema, + SkillsSearchResult: agentsModelsSkills.SkillsSearchResultSchema, + SkillsDetailParams: agentsModelsSkills.SkillsDetailParamsSchema, + SkillsDetailResult: agentsModelsSkills.SkillsDetailResultSchema, + SkillsCuratorActionParams: agentsModelsSkills.SkillsCuratorActionParamsSchema, + SkillsCuratorActionResult: agentsModelsSkills.SkillsCuratorActionResultSchema, + SkillsCuratorStatusParams: agentsModelsSkills.SkillsCuratorStatusParamsSchema, + SkillsCuratorStatusResult: agentsModelsSkills.SkillsCuratorStatusResultSchema, + ...skillWorkshop.SkillWorkshopProtocolSchemas, + SkillsProposalInspectParams: agentsModelsSkills.SkillsProposalInspectParamsSchema, + SkillsProposalInspectResult: agentsModelsSkills.SkillsProposalInspectResultSchema, + SkillsProposalCreateParams: agentsModelsSkills.SkillsProposalCreateParamsSchema, + SkillsProposalUpdateParams: agentsModelsSkills.SkillsProposalUpdateParamsSchema, + SkillsProposalReviseParams: agentsModelsSkills.SkillsProposalReviseParamsSchema, + SkillsProposalRequestRevisionParams: agentsModelsSkills.SkillsProposalRequestRevisionParamsSchema, + SkillsProposalRequestRevisionResult: agentsModelsSkills.SkillsProposalRequestRevisionResultSchema, + SkillsProposalActionParams: agentsModelsSkills.SkillsProposalActionParamsSchema, + SkillsProposalApplyResult: agentsModelsSkills.SkillsProposalApplyResultSchema, + SkillsProposalRecordResult: agentsModelsSkills.SkillsProposalRecordResultSchema, + SkillsSecurityVerdictsParams: agentsModelsSkills.SkillsSecurityVerdictsParamsSchema, + SkillsSecurityVerdictsResult: agentsModelsSkills.SkillsSecurityVerdictsResultSchema, + SkillsSkillCardParams: agentsModelsSkills.SkillsSkillCardParamsSchema, + SkillsSkillCardResult: agentsModelsSkills.SkillsSkillCardResultSchema, + SkillsUploadBeginParams: agentsModelsSkills.SkillsUploadBeginParamsSchema, + SkillsUploadChunkParams: agentsModelsSkills.SkillsUploadChunkParamsSchema, + SkillsUploadCommitParams: agentsModelsSkills.SkillsUploadCommitParamsSchema, + SkillsInstallParams: agentsModelsSkills.SkillsInstallParamsSchema, + SkillsUpdateParams: agentsModelsSkills.SkillsUpdateParamsSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-approvals.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-approvals.ts new file mode 100644 index 000000000000..069bd9740442 --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-approvals.ts @@ -0,0 +1,64 @@ +import * as approvals from "./approvals.js"; +import * as execApprovals from "./exec-approvals.js"; +import * as questions from "./questions.js"; + +export const ApprovalProtocolSchemas = { + ApprovalKind: approvals.ApprovalKindSchema, + ApprovalDecision: approvals.ApprovalDecisionSchema, + ApprovalAllowDecision: approvals.ApprovalAllowDecisionSchema, + ApprovalAllowedReason: approvals.ApprovalAllowedReasonSchema, + ApprovalDeniedReason: approvals.ApprovalDeniedReasonSchema, + ApprovalExpiredReason: approvals.ApprovalExpiredReasonSchema, + ApprovalCancelledReason: approvals.ApprovalCancelledReasonSchema, + PluginApprovalSeverity: approvals.PluginApprovalSeveritySchema, + ExecApprovalPresentation: approvals.ExecApprovalPresentationSchema, + PluginApprovalPresentation: approvals.PluginApprovalPresentationSchema, + SystemAgentApprovalPresentation: approvals.SystemAgentApprovalPresentationSchema, + ApprovalPresentation: approvals.ApprovalPresentationSchema, + PendingApprovalSnapshot: approvals.PendingApprovalSnapshotSchema, + AllowedApprovalSnapshot: approvals.AllowedApprovalSnapshotSchema, + DeniedApprovalSnapshot: approvals.DeniedApprovalSnapshotSchema, + ExpiredApprovalSnapshot: approvals.ExpiredApprovalSnapshotSchema, + CancelledApprovalSnapshot: approvals.CancelledApprovalSnapshotSchema, + ApprovalSnapshot: approvals.ApprovalSnapshotSchema, + ApprovalTerminalReason: approvals.ApprovalTerminalReasonSchema, + TerminalApprovalSnapshot: approvals.TerminalApprovalSnapshotSchema, + ApprovalGetParams: approvals.ApprovalGetParamsSchema, + ApprovalGetResult: approvals.ApprovalGetResultSchema, + ApprovalHistoryParams: approvals.ApprovalHistoryParamsSchema, + ApprovalHistoryResult: approvals.ApprovalHistoryResultSchema, + ApprovalResolveParams: approvals.ApprovalResolveParamsSchema, + ApprovalResolveResult: approvals.ApprovalResolveResultSchema, + PendingSessionApprovalEvent: approvals.PendingSessionApprovalEventSchema, + TerminalSessionApprovalEvent: approvals.TerminalSessionApprovalEventSchema, + SessionApprovalEvent: approvals.SessionApprovalEventSchema, + SessionApprovalReplay: approvals.SessionApprovalReplaySchema, + ExecApprovalsGetParams: execApprovals.ExecApprovalsGetParamsSchema, + ExecApprovalsSetParams: execApprovals.ExecApprovalsSetParamsSchema, + ExecApprovalsNodeGetParams: execApprovals.ExecApprovalsNodeGetParamsSchema, + ExecApprovalsNodeSnapshot: execApprovals.ExecApprovalsNodeSnapshotSchema, + ExecApprovalsNodeSetParams: execApprovals.ExecApprovalsNodeSetParamsSchema, + ExecApprovalsSnapshot: execApprovals.ExecApprovalsSnapshotSchema, + ExecApprovalGetParams: execApprovals.ExecApprovalGetParamsSchema, + ExecApprovalRequestParams: execApprovals.ExecApprovalRequestParamsSchema, + ExecApprovalResolveParams: execApprovals.ExecApprovalResolveParamsSchema, + QuestionOption: questions.QuestionOptionSchema, + Question: questions.QuestionSchema, + QuestionRequestQuestion: questions.QuestionRequestQuestionSchema, + QuestionAnswers: questions.QuestionAnswersSchema, + QuestionStatus: questions.QuestionStatusSchema, + QuestionRecord: questions.QuestionRecordSchema, + QuestionRequestParams: questions.QuestionRequestParamsSchema, + QuestionRequestResult: questions.QuestionRequestResultSchema, + QuestionWaitAnswerParams: questions.QuestionWaitAnswerParamsSchema, + QuestionWaitAnswerResult: questions.QuestionWaitAnswerResultSchema, + QuestionResolveParams: questions.QuestionResolveParamsSchema, + QuestionResolveResult: questions.QuestionResolveResultSchema, + QuestionGetParams: questions.QuestionGetParamsSchema, + QuestionGetResult: questions.QuestionGetResultSchema, + QuestionListParams: questions.QuestionListParamsSchema, + QuestionListResult: questions.QuestionListResultSchema, + // QuestionRequestedEvent is a TS-only alias of QuestionRecord; registering both + // names makes native codegen reference a type it never emits. + QuestionResolvedEvent: questions.QuestionResolvedEventSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-board.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-board.ts new file mode 100644 index 000000000000..b6a6f51698ce --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-board.ts @@ -0,0 +1,41 @@ +import * as agentsModelsSkills from "./agents-models-skills.js"; +import * as board from "./board.js"; + +export const BoardProtocolSchemas = { + BoardTab: board.BoardTabSchema, + BoardWidget: board.BoardWidgetSchema, + BoardWidgetDeclared: board.BoardWidgetDeclaredSchema, + BoardSnapshot: board.BoardSnapshotSchema, + BoardTabCreateOp: board.BoardTabCreateOpSchema, + BoardTabUpdateOp: board.BoardTabUpdateOpSchema, + BoardTabDeleteOp: board.BoardTabDeleteOpSchema, + BoardTabsReorderOp: board.BoardTabsReorderOpSchema, + BoardWidgetMoveOp: board.BoardWidgetMoveOpSchema, + BoardWidgetResizeOp: board.BoardWidgetResizeOpSchema, + BoardWidgetRemoveOp: board.BoardWidgetRemoveOpSchema, + BoardOp: board.BoardOpSchema, + BoardMcpAppDescriptor: board.BoardMcpAppDescriptorSchema, + BoardWidgetHtmlContent: board.BoardWidgetHtmlContentSchema, + BoardWidgetMcpAppContent: board.BoardWidgetMcpAppContentSchema, + BoardWidgetMcpAppPutContent: board.BoardWidgetMcpAppPutContentSchema, + BoardWidgetPluginContent: board.BoardWidgetPluginContentSchema, + BoardCanvasDocumentSource: board.BoardCanvasDocumentSourceSchema, + BoardWidgetContent: board.BoardWidgetContentSchema, + BoardWidgetPutContent: board.BoardWidgetPutContentSchema, + BoardGetParams: board.BoardGetParamsSchema, + BoardUpdateParams: board.BoardUpdateParamsSchema, + BoardWidgetPutParams: board.BoardWidgetPutParamsSchema, + BoardWidgetGrantParams: board.BoardWidgetGrantParamsSchema, + BoardWidgetAppViewParams: board.BoardWidgetAppViewParamsSchema, + BoardWidgetAppViewResult: board.BoardWidgetAppViewResultSchema, + BoardEventParams: board.BoardEventParamsSchema, + BoardPromptAuthorizeParams: board.BoardPromptAuthorizeParamsSchema, + BoardDataReadParams: board.BoardDataReadParamsSchema, + BoardActionParams: board.BoardActionParamsSchema, + BoardChangedEvent: board.BoardChangedEventSchema, + BoardFocusTabCommand: board.BoardFocusTabCommandSchema, + BoardSetChatDockCommand: board.BoardSetChatDockCommandSchema, + BoardCommand: board.BoardCommandSchema, + BoardCommandEvent: board.BoardCommandEventSchema, + AuthProbeStatus: agentsModelsSkills.AuthProbeStatusSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-channels.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-channels.ts new file mode 100644 index 000000000000..220d698c527e --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-channels.ts @@ -0,0 +1,52 @@ +import * as channelPairing from "./channel-pairing.js"; +import * as channels from "./channels.js"; +import * as talkMarks from "./talk-marks.js"; + +export const ChannelProtocolSchemas = { + TalkModeParams: channels.TalkModeParamsSchema, + TalkEvent: channels.TalkEventSchema, + TalkCatalogParams: channels.TalkCatalogParamsSchema, + TalkCatalogResult: channels.TalkCatalogResultSchema, + TalkClientCreateParams: channels.TalkClientCreateParamsSchema, + TalkClientCreateResult: channels.TalkClientCreateResultSchema, + TalkClientCloseParams: channels.TalkClientCloseParamsSchema, + TalkClientMutationResult: channels.TalkClientMutationResultSchema, + TalkClientSteerParams: channels.TalkClientSteerParamsSchema, + TalkAgentControlResult: channels.TalkAgentControlResultSchema, + TalkClientToolCallParams: channels.TalkClientToolCallParamsSchema, + TalkClientToolCallResult: channels.TalkClientToolCallResultSchema, + TalkClientTranscriptParams: channels.TalkClientTranscriptParamsSchema, + TalkConfigParams: channels.TalkConfigParamsSchema, + TalkConfigResult: channels.TalkConfigResultSchema, + TalkSessionAppendAudioParams: channels.TalkSessionAppendAudioParamsSchema, + TalkSessionAcknowledgeMarkParams: talkMarks.TalkSessionAcknowledgeMarkParamsSchema, + TalkSessionCancelOutputParams: channels.TalkSessionCancelOutputParamsSchema, + TalkSessionCancelTurnParams: channels.TalkSessionCancelTurnParamsSchema, + TalkSessionCreateParams: channels.TalkSessionCreateParamsSchema, + TalkSessionCreateResult: channels.TalkSessionCreateResultSchema, + TalkSessionJoinParams: channels.TalkSessionJoinParamsSchema, + TalkSessionJoinResult: channels.TalkSessionJoinResultSchema, + TalkSessionTurnParams: channels.TalkSessionTurnParamsSchema, + TalkSessionTurnResult: channels.TalkSessionTurnResultSchema, + TalkSessionSteerParams: channels.TalkSessionSteerParamsSchema, + TalkSessionSubmitToolResultParams: channels.TalkSessionSubmitToolResultParamsSchema, + TalkSessionCloseParams: channels.TalkSessionCloseParamsSchema, + TalkSessionOkResult: channels.TalkSessionOkResultSchema, + TalkSpeakParams: channels.TalkSpeakParamsSchema, + TalkSpeakResult: channels.TalkSpeakResultSchema, + TtsSpeakParams: channels.TtsSpeakParamsSchema, + TtsSpeakResult: channels.TtsSpeakResultSchema, + ChannelsStatusParams: channels.ChannelsStatusParamsSchema, + ChannelsStatusResult: channels.ChannelsStatusResultSchema, + ChannelsPairingListParams: channelPairing.ChannelsPairingListParamsSchema, + ChannelsPairingListResult: channelPairing.ChannelsPairingListResultSchema, + ChannelsPairingApproveParams: channelPairing.ChannelsPairingApproveParamsSchema, + ChannelsPairingApproveResult: channelPairing.ChannelsPairingApproveResultSchema, + ChannelsPairingDismissParams: channelPairing.ChannelsPairingDismissParamsSchema, + ChannelsPairingDismissResult: channelPairing.ChannelsPairingDismissResultSchema, + ChannelsStartParams: channels.ChannelsStartParamsSchema, + ChannelsStopParams: channels.ChannelsStopParamsSchema, + ChannelsLogoutParams: channels.ChannelsLogoutParamsSchema, + WebLoginStartParams: channels.WebLoginStartParamsSchema, + WebLoginWaitParams: channels.WebLoginWaitParamsSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-integrations.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-integrations.ts new file mode 100644 index 000000000000..98fd40778f08 --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-integrations.ts @@ -0,0 +1,21 @@ +import * as push from "./push.js"; +import * as secrets from "./secrets.js"; +import * as uiCommand from "./ui-command.js"; + +export const IntegrationProtocolSchemas = { + PushTestParams: push.PushTestParamsSchema, + PushTestResult: push.PushTestResultSchema, + UiSplitCommand: uiCommand.UiSplitCommandSchema, + UiClosePaneCommand: uiCommand.UiClosePaneCommandSchema, + UiFocusCommand: uiCommand.UiFocusCommandSchema, + UiSidebarCommand: uiCommand.UiSidebarCommandSchema, + UiPanelCommand: uiCommand.UiPanelCommandSchema, + UiNavigateCommand: uiCommand.UiNavigateCommandSchema, + UiCommand: uiCommand.UiCommandSchema, + UiCommandParams: uiCommand.UiCommandParamsSchema, + UiCommandResult: uiCommand.UiCommandResultSchema, + SecretsReloadParams: secrets.SecretsReloadParamsSchema, + SecretsResolveParams: secrets.SecretsResolveParamsSchema, + SecretsResolveAssignment: secrets.SecretsResolveAssignmentSchema, + SecretsResolveResult: secrets.SecretsResolveResultSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-nodes.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-nodes.ts new file mode 100644 index 000000000000..733d23454fad --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-nodes.ts @@ -0,0 +1,27 @@ +import * as nodes from "./nodes.js"; +import * as nodeInvoke from "./protocol-schemas-node-invoke.js"; +import * as nodePresence from "./protocol-schemas-node-presence.js"; + +export const NodeProtocolSchemas = { + NodePairListParams: nodes.NodePairListParamsSchema, + NodePairApproveParams: nodes.NodePairApproveParamsSchema, + NodePairRejectParams: nodes.NodePairRejectParamsSchema, + NodePairRemoveParams: nodes.NodePairRemoveParamsSchema, + NodeRenameParams: nodes.NodeRenameParamsSchema, + NodeListParams: nodes.NodeListParamsSchema, + NodePluginToolDescriptor: nodes.NodePluginToolDescriptorSchema, + NodePluginToolsUpdateParams: nodes.NodePluginToolsUpdateParamsSchema, + NodeSkillDescriptor: nodes.NodeSkillDescriptorSchema, + NodeSkillsUpdateParams: nodes.NodeSkillsUpdateParamsSchema, + NodePendingAckParams: nodes.NodePendingAckParamsSchema, + NodeDescribeParams: nodes.NodeDescribeParamsSchema, + ...nodeInvoke.NodeInvokeProtocolSchemas, + NodeEventParams: nodes.NodeEventParamsSchema, + NodeEventResult: nodes.NodeEventResultSchema, + NodePresenceAlivePayload: nodes.NodePresenceAlivePayloadSchema, + ...nodePresence.NodePresenceProtocolSchemas, + NodePendingDrainParams: nodes.NodePendingDrainParamsSchema, + NodePendingDrainResult: nodes.NodePendingDrainResultSchema, + NodePendingEnqueueParams: nodes.NodePendingEnqueueParamsSchema, + NodePendingEnqueueResult: nodes.NodePendingEnqueueResultSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-operations.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-operations.ts new file mode 100644 index 000000000000..106eef98993e --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-operations.ts @@ -0,0 +1,72 @@ +import * as auditActivity from "./audit-activity.js"; +import * as audit from "./audit.js"; +import * as config from "./config.js"; +import * as openclaw from "./openclaw.js"; +import * as taskSuggestions from "./task-suggestions.js"; +import * as tasks from "./tasks.js"; +import * as wizard from "./wizard.js"; + +export const OperationsProtocolSchemas = { + AuditActivityAgentRunV1: auditActivity.AuditActivityAgentRunV1Schema, + AuditActivityToolActionV1: auditActivity.AuditActivityToolActionV1Schema, + AuditActivityInboundMessageV1: auditActivity.AuditActivityInboundMessageV1Schema, + AuditActivityOutboundMessageV1: auditActivity.AuditActivityOutboundMessageV1Schema, + AuditActivityEventV1: auditActivity.AuditActivityEventV1Schema, + AuditActivityListParams: auditActivity.AuditActivityListParamsSchema, + AuditActivityListResult: auditActivity.AuditActivityListResultSchema, + AuditEvent: audit.AuditEventSchema, + AuditListParams: audit.AuditListParamsSchema, + AuditListResult: audit.AuditListResultSchema, + TaskSuggestion: taskSuggestions.TaskSuggestionSchema, + TaskSuggestionEvent: taskSuggestions.TaskSuggestionEventSchema, + TaskSuggestionResolution: taskSuggestions.TaskSuggestionResolutionSchema, + TaskSuggestionsAcceptParams: taskSuggestions.TaskSuggestionsAcceptParamsSchema, + TaskSuggestionsAcceptResult: taskSuggestions.TaskSuggestionsAcceptResultSchema, + TaskSuggestionsCreateParams: taskSuggestions.TaskSuggestionsCreateParamsSchema, + TaskSuggestionsCreateResult: taskSuggestions.TaskSuggestionsCreateResultSchema, + TaskSuggestionsDismissParams: taskSuggestions.TaskSuggestionsDismissParamsSchema, + TaskSuggestionsDismissResult: taskSuggestions.TaskSuggestionsDismissResultSchema, + TaskSuggestionsListParams: taskSuggestions.TaskSuggestionsListParamsSchema, + TaskSuggestionsListResult: taskSuggestions.TaskSuggestionsListResultSchema, + TaskSummary: tasks.TaskSummarySchema, + TasksListParams: tasks.TasksListParamsSchema, + TasksListResult: tasks.TasksListResultSchema, + TasksGetParams: tasks.TasksGetParamsSchema, + TasksGetResult: tasks.TasksGetResultSchema, + TasksCancelParams: tasks.TasksCancelParamsSchema, + TasksCancelResult: tasks.TasksCancelResultSchema, + ConfigGetParams: config.ConfigGetParamsSchema, + ConfigSetParams: config.ConfigSetParamsSchema, + ConfigApplyParams: config.ConfigApplyParamsSchema, + ConfigPatchParams: config.ConfigPatchParamsSchema, + ConfigSchemaParams: config.ConfigSchemaParamsSchema, + ConfigSchemaLookupParams: config.ConfigSchemaLookupParamsSchema, + ConfigSchemaResponse: config.ConfigSchemaResponseSchema, + ConfigSchemaLookupResult: config.ConfigSchemaLookupResultSchema, + SystemAgentChatParams: openclaw.SystemAgentChatParamsSchema, + SystemAgentChatResult: openclaw.SystemAgentChatResultSchema, + SystemAgentChatHistoryParams: openclaw.SystemAgentChatHistoryParamsSchema, + SystemAgentChatHistoryTurn: openclaw.SystemAgentChatHistoryTurnSchema, + SystemAgentChatHistoryResult: openclaw.SystemAgentChatHistoryResultSchema, + SystemChangeEntry: openclaw.SystemChangeEntrySchema, + SystemChangeKind: openclaw.SystemChangeKindSchema, + SystemChangeSource: openclaw.SystemChangeSourceSchema, + SystemChangesListParams: openclaw.SystemChangesListParamsSchema, + SystemChangesListResult: openclaw.SystemChangesListResultSchema, + SystemAgentSetupDetectParams: openclaw.SystemAgentSetupDetectParamsSchema, + SystemAgentSetupDetectResult: openclaw.SystemAgentSetupDetectResultSchema, + SystemAgentSetupVerifyParams: openclaw.SystemAgentSetupVerifyParamsSchema, + SystemAgentSetupVerifyResult: openclaw.SystemAgentSetupVerifyResultSchema, + SystemAgentSetupActivateParams: openclaw.SystemAgentSetupActivateParamsSchema, + SystemAgentSetupActivateResult: openclaw.SystemAgentSetupActivateResultSchema, + SystemAgentSetupAuthStartParams: openclaw.SystemAgentSetupAuthStartParamsSchema, + SystemAgentSetupAuthStartResult: openclaw.SystemAgentSetupAuthStartResultSchema, + WizardStartParams: wizard.WizardStartParamsSchema, + WizardNextParams: wizard.WizardNextParamsSchema, + WizardCancelParams: wizard.WizardCancelParamsSchema, + WizardStatusParams: wizard.WizardStatusParamsSchema, + WizardStep: wizard.WizardStepSchema, + WizardNextResult: wizard.WizardNextResultSchema, + WizardStartResult: wizard.WizardStartResultSchema, + WizardStatusResult: wizard.WizardStatusResultSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-plugins-lifecycle.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-plugins-lifecycle.ts new file mode 100644 index 000000000000..bfbd687a52ee --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-plugins-lifecycle.ts @@ -0,0 +1,67 @@ +import * as config from "./config.js"; +import * as devices from "./devices.js"; +import * as frames from "./frames.js"; +import * as logsChat from "./logs-chat.js"; +import * as pluginApprovals from "./plugin-approvals.js"; +import * as plugins from "./plugins.js"; + +export const PluginLifecycleProtocolSchemas = { + PluginApprovalRequestParams: pluginApprovals.PluginApprovalRequestParamsSchema, + PluginApprovalResolveParams: pluginApprovals.PluginApprovalResolveParamsSchema, + PluginCatalogClawHubInstall: plugins.PluginCatalogClawHubInstallSchema, + PluginCatalogEntry: plugins.PluginCatalogEntrySchema, + PluginCatalogInstallAction: plugins.PluginCatalogInstallActionSchema, + PluginCatalogOfficialInstall: plugins.PluginCatalogOfficialInstallSchema, + PluginControlUiDescriptor: plugins.PluginControlUiDescriptorSchema, + PluginSearchPackage: plugins.PluginSearchPackageSchema, + PluginSearchResultEntry: plugins.PluginSearchResultEntrySchema, + PluginsInstallParams: plugins.PluginsInstallParamsSchema, + PluginsInstallResult: plugins.PluginsInstallResultSchema, + PluginsListParams: plugins.PluginsListParamsSchema, + PluginsListResult: plugins.PluginsListResultSchema, + PluginsRefreshParams: plugins.PluginsRefreshParamsSchema, + PluginsRefreshResult: plugins.PluginsRefreshResultSchema, + PluginsSearchParams: plugins.PluginsSearchParamsSchema, + PluginsSearchResult: plugins.PluginsSearchResultSchema, + PluginsSessionActionFailureResult: plugins.PluginsSessionActionFailureResultSchema, + PluginsSessionActionParams: plugins.PluginsSessionActionParamsSchema, + PluginsSessionActionResult: plugins.PluginsSessionActionResultSchema, + PluginsSessionActionSuccessResult: plugins.PluginsSessionActionSuccessResultSchema, + PluginsSetEnabledParams: plugins.PluginsSetEnabledParamsSchema, + PluginsSetEnabledResult: plugins.PluginsSetEnabledResultSchema, + PluginsUiDescriptorsParams: plugins.PluginsUiDescriptorsParamsSchema, + PluginsUiDescriptorsResult: plugins.PluginsUiDescriptorsResultSchema, + PluginsUninstallParams: plugins.PluginsUninstallParamsSchema, + PluginsUninstallResult: plugins.PluginsUninstallResultSchema, + DevicePairListParams: devices.DevicePairListParamsSchema, + DevicePairApproveParams: devices.DevicePairApproveParamsSchema, + DevicePairRejectParams: devices.DevicePairRejectParamsSchema, + DevicePairRemoveParams: devices.DevicePairRemoveParamsSchema, + DevicePairSetupCodeParams: devices.DevicePairSetupCodeParamsSchema, + DevicePairSetupCodeResult: devices.DevicePairSetupCodeResultSchema, + DevicePairRenameParams: devices.DevicePairRenameParamsSchema, + DeviceTokenRotateParams: devices.DeviceTokenRotateParamsSchema, + DeviceTokenRevokeParams: devices.DeviceTokenRevokeParamsSchema, + DevicePairRequestedEvent: devices.DevicePairRequestedEventSchema, + DevicePairResolvedEvent: devices.DevicePairResolvedEventSchema, + ChatHistoryParams: logsChat.ChatHistoryParamsSchema, + ChatMetadataParams: logsChat.ChatMetadataParamsSchema, + ChatMessageGetParams: logsChat.ChatMessageGetParamsSchema, + ChatMessageGetResult: logsChat.ChatMessageGetResultSchema, + ChatToolTitlesParams: logsChat.ChatToolTitlesParamsSchema, + ChatToolTitlesResult: logsChat.ChatToolTitlesResultSchema, + ChatSendParams: logsChat.ChatSendParamsSchema, + ChatAbortParams: logsChat.ChatAbortParamsSchema, + ChatInjectParams: logsChat.ChatInjectParamsSchema, + ChatRunStartupPhase: logsChat.ChatRunStartupPhaseSchema, + ChatStatusEvent: logsChat.ChatStatusEventSchema, + ChatDeltaEvent: logsChat.ChatDeltaEventSchema, + ChatFinalEvent: logsChat.ChatFinalEventSchema, + ChatAbortedEvent: logsChat.ChatAbortedEventSchema, + ChatErrorEvent: logsChat.ChatErrorEventSchema, + ChatEvent: logsChat.ChatEventSchema, + UpdateStatusParams: config.UpdateStatusParamsSchema, + UpdateRunParams: config.UpdateRunParamsSchema, + TickEvent: frames.TickEventSchema, + ShutdownEvent: frames.ShutdownEventSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-scheduler.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-scheduler.ts new file mode 100644 index 000000000000..32beba0fa52d --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-scheduler.ts @@ -0,0 +1,24 @@ +import * as cron from "./cron.js"; +import * as logMigrations from "./log-migration-protocol-schemas.js"; +import * as terminal from "./terminal-protocol-schemas.js"; + +export const SchedulerProtocolSchemas = { + CronJob: cron.CronJobSchema, + CronListParams: cron.CronListParamsSchema, + CronStatusParams: cron.CronStatusParamsSchema, + CronGetParams: cron.CronGetParamsSchema, + CronAddParams: cron.CronAddParamsSchema, + CronAddResult: cron.CronAddResultSchema, + CronDeclarativeAddResult: cron.CronDeclarativeAddResultSchema, + CronUpdateParams: cron.CronUpdateParamsSchema, + CronRemoveParams: cron.CronRemoveParamsSchema, + CronRunParams: cron.CronRunParamsSchema, + CronRunsParams: cron.CronRunsParamsSchema, + CronScratchGetParams: cron.CronScratchGetParamsSchema, + CronScratchGetResult: cron.CronScratchGetResultSchema, + CronScratchSetParams: cron.CronScratchSetParamsSchema, + CronScratchSetResult: cron.CronScratchSetResultSchema, + CronRunLogEntry: cron.CronRunLogEntrySchema, + ...logMigrations.LogMigrationProtocolSchemas, + ...terminal.TerminalProtocolSchemas, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-sessions-collaboration.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-sessions-collaboration.ts new file mode 100644 index 000000000000..c3dbe1e4cea8 --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-sessions-collaboration.ts @@ -0,0 +1,41 @@ +import * as sessionDiscussion from "./session-discussion.js"; +import * as sessionPlacement from "./session-placement.js"; +import * as sessionsSharing from "./sessions-sharing.js"; +import * as sessionsSuggestions from "./sessions-suggestions.js"; + +export const SessionCollaborationProtocolSchemas = { + SessionVisibility: sessionsSharing.SessionVisibilitySchema, + SessionSharingIdentity: sessionsSharing.SessionSharingIdentitySchema, + SessionSharingRole: sessionsSharing.SessionSharingRoleSchema, + SessionVisibilitySetParams: sessionsSharing.SessionVisibilitySetParamsSchema, + SessionVisibilitySetResult: sessionsSharing.SessionVisibilitySetResultSchema, + SessionMembersListParams: sessionsSharing.SessionMembersListParamsSchema, + SessionMember: sessionsSharing.SessionMemberSchema, + SessionMembersListResult: sessionsSharing.SessionMembersListResultSchema, + SessionMemberAddParams: sessionsSharing.SessionMemberAddParamsSchema, + SessionMemberRemoveParams: sessionsSharing.SessionMemberRemoveParamsSchema, + SessionMemberMutationResult: sessionsSharing.SessionMemberMutationResultSchema, + SessionSharingAction: sessionsSharing.SessionSharingActionSchema, + SessionSharingEvent: sessionsSharing.SessionSharingEventSchema, + SessionSuggestionState: sessionsSuggestions.SessionSuggestionStateSchema, + SessionSuggestionAction: sessionsSuggestions.SessionSuggestionActionSchema, + SessionSuggestionResolution: sessionsSuggestions.SessionSuggestionResolutionSchema, + SessionSuggestion: sessionsSuggestions.SessionSuggestionSchema, + SessionSuggestionsAddParams: sessionsSuggestions.SessionSuggestionsAddParamsSchema, + SessionSuggestionsAddResult: sessionsSuggestions.SessionSuggestionsAddResultSchema, + SessionSuggestionsListParams: sessionsSuggestions.SessionSuggestionsListParamsSchema, + SessionSuggestionsListResult: sessionsSuggestions.SessionSuggestionsListResultSchema, + SessionSuggestionsResolveParams: sessionsSuggestions.SessionSuggestionsResolveParamsSchema, + SessionSuggestionsResolveResult: sessionsSuggestions.SessionSuggestionsResolveResultSchema, + SessionSuggestionEvent: sessionsSuggestions.SessionSuggestionEventSchema, + SessionTypingParams: sessionsSuggestions.SessionTypingParamsSchema, + SessionTypingResult: sessionsSuggestions.SessionTypingResultSchema, + SessionTypingEvent: sessionsSuggestions.SessionTypingEventSchema, + ...sessionPlacement.SessionPlacementProtocolSchemas, + SessionDiscussionState: sessionDiscussion.SessionDiscussionStateSchema, + SessionDiscussionInfo: sessionDiscussion.SessionDiscussionInfoSchema, + SessionDiscussionInfoParams: sessionDiscussion.SessionDiscussionInfoParamsSchema, + SessionDiscussionInfoResult: sessionDiscussion.SessionDiscussionInfoResultSchema, + SessionDiscussionOpenParams: sessionDiscussion.SessionDiscussionOpenParamsSchema, + SessionDiscussionOpenResult: sessionDiscussion.SessionDiscussionOpenResultSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-sessions-core.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-sessions-core.ts new file mode 100644 index 000000000000..c306a49800e4 --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-sessions-core.ts @@ -0,0 +1,44 @@ +import * as sessionsCatalog from "./sessions-catalog.js"; +import * as sessions from "./sessions.js"; + +export const SessionCoreProtocolSchemas = { + SessionsListParams: sessions.SessionsListParamsSchema, + SessionCatalogCapabilities: sessionsCatalog.SessionCatalogCapabilitiesSchema, + SessionCatalogDescriptor: sessionsCatalog.SessionCatalogDescriptorSchema, + SessionCatalogPullRequestSummary: sessionsCatalog.SessionCatalogPullRequestSummarySchema, + SessionCatalogSession: sessionsCatalog.SessionCatalogSessionSchema, + SessionCatalogHost: sessionsCatalog.SessionCatalogHostSchema, + SessionCatalog: sessionsCatalog.SessionCatalogSchema, + SessionCatalogTranscriptItem: sessionsCatalog.SessionCatalogTranscriptItemSchema, + SessionsCatalogListParams: sessionsCatalog.SessionsCatalogListParamsSchema, + SessionsCatalogListResult: sessionsCatalog.SessionsCatalogListResultSchema, + SessionsCatalogReadParams: sessionsCatalog.SessionsCatalogReadParamsSchema, + SessionsCatalogReadResult: sessionsCatalog.SessionsCatalogReadResultSchema, + SessionsCatalogContinueParams: sessionsCatalog.SessionsCatalogContinueParamsSchema, + SessionsCatalogContinueResult: sessionsCatalog.SessionsCatalogContinueResultSchema, + SessionsCatalogArchiveParams: sessionsCatalog.SessionsCatalogArchiveParamsSchema, + SessionsCatalogArchiveResult: sessionsCatalog.SessionsCatalogArchiveResultSchema, + SessionsCleanupParams: sessions.SessionsCleanupParamsSchema, + SessionsPreviewParams: sessions.SessionsPreviewParamsSchema, + SessionsDescribeParams: sessions.SessionsDescribeParamsSchema, + SessionsResolveParams: sessions.SessionsResolveParamsSchema, + SessionsSearchHit: sessions.SessionsSearchHitSchema, + SessionsSearchParams: sessions.SessionsSearchParamsSchema, + SessionsSearchResult: sessions.SessionsSearchResultSchema, + SessionCompactionCheckpoint: sessions.SessionCompactionCheckpointSchema, + SessionOperationEvent: sessions.SessionOperationEventSchema, + SessionCreatedActor: sessions.SessionCreatedActorSchema, + SessionObserverHealth: sessions.SessionObserverHealthSchema, + SessionObserverPlanProgress: sessions.SessionObserverPlanProgressSchema, + SessionObserverDigest: sessions.SessionObserverDigestSchema, + SessionCompanionExchange: sessions.SessionCompanionExchangeSchema, + SessionRow: sessions.SessionRowSchema, + SessionsCompanionAskParams: sessions.SessionsCompanionAskParamsSchema, + SessionsCompanionAskResult: sessions.SessionsCompanionAskResultSchema, + SessionsCompanionResetParams: sessions.SessionsCompanionResetParamsSchema, + SessionsCompanionResetResult: sessions.SessionsCompanionResetResultSchema, + SessionsCompanionStateParams: sessions.SessionsCompanionStateParamsSchema, + SessionsCompanionStateResult: sessions.SessionsCompanionStateResultSchema, + SessionsObserverVisibilityParams: sessions.SessionsObserverVisibilityParamsSchema, + SessionsObserverVisibilityResult: sessions.SessionsObserverVisibilityResultSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-sessions-lifecycle.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-sessions-lifecycle.ts new file mode 100644 index 000000000000..751b20c280c2 --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-sessions-lifecycle.ts @@ -0,0 +1,59 @@ +import * as sessions from "./sessions.js"; + +export const SessionLifecycleProtocolSchemas = { + SessionsCompactionListParams: sessions.SessionsCompactionListParamsSchema, + SessionsCompactionGetParams: sessions.SessionsCompactionGetParamsSchema, + SessionsCompactionBranchParams: sessions.SessionsCompactionBranchParamsSchema, + SessionsCompactionRestoreParams: sessions.SessionsCompactionRestoreParamsSchema, + SessionsCompactionListResult: sessions.SessionsCompactionListResultSchema, + SessionsCompactionGetResult: sessions.SessionsCompactionGetResultSchema, + SessionsCompactionBranchResult: sessions.SessionsCompactionBranchResultSchema, + SessionsCompactionRestoreResult: sessions.SessionsCompactionRestoreResultSchema, + SessionsRewindParams: sessions.SessionsRewindParamsSchema, + SessionsRewindResult: sessions.SessionsRewindResultSchema, + SessionsForkParams: sessions.SessionsForkParamsSchema, + SessionsForkResult: sessions.SessionsForkResultSchema, + SessionBranch: sessions.SessionBranchSchema, + SessionsBranchesListParams: sessions.SessionsBranchesListParamsSchema, + SessionsBranchesListResult: sessions.SessionsBranchesListResultSchema, + SessionsBranchesSwitchParams: sessions.SessionsBranchesSwitchParamsSchema, + SessionsBranchesSwitchResult: sessions.SessionsBranchesSwitchResultSchema, + SessionFileBrowserEntry: sessions.SessionFileBrowserEntrySchema, + SessionFileBrowserResult: sessions.SessionFileBrowserResultSchema, + SessionFileKind: sessions.SessionFileKindSchema, + SessionFileEntry: sessions.SessionFileEntrySchema, + SessionFileRelevance: sessions.SessionFileRelevanceSchema, + SessionsFilesListParams: sessions.SessionsFilesListParamsSchema, + SessionsFilesListResult: sessions.SessionsFilesListResultSchema, + SessionsFilesGetParams: sessions.SessionsFilesGetParamsSchema, + SessionsFilesGetResult: sessions.SessionsFilesGetResultSchema, + SessionsFilesRevealParams: sessions.SessionsFilesRevealParamsSchema, + SessionsFilesRevealResult: sessions.SessionsFilesRevealResultSchema, + SessionsFilesSetParams: sessions.SessionsFilesSetParamsSchema, + SessionsFilesSetResult: sessions.SessionsFilesSetResultSchema, + SessionDiffFileStatus: sessions.SessionDiffFileStatusSchema, + SessionDiffFile: sessions.SessionDiffFileSchema, + SessionsDiffParams: sessions.SessionsDiffParamsSchema, + SessionsDiffResult: sessions.SessionsDiffResultSchema, + SessionWorktreeInfo: sessions.SessionWorktreeInfoSchema, + SessionsCreateParams: sessions.SessionsCreateParamsSchema, + SessionsCreateResult: sessions.SessionsCreateResultSchema, + SessionsSendParams: sessions.SessionsSendParamsSchema, + SessionsMessagesSubscribeParams: sessions.SessionsMessagesSubscribeParamsSchema, + SessionsMessagesUnsubscribeParams: sessions.SessionsMessagesUnsubscribeParamsSchema, + SessionsAbortParams: sessions.SessionsAbortParamsSchema, + SessionsPatchParams: sessions.SessionsPatchParamsSchema, + SessionsPluginPatchParams: sessions.SessionsPluginPatchParamsSchema, + SessionsPluginPatchResult: sessions.SessionsPluginPatchResultSchema, + SessionsResetParams: sessions.SessionsResetParamsSchema, + SessionsDeleteParams: sessions.SessionsDeleteParamsSchema, + SessionGroup: sessions.SessionGroupSchema, + SessionsGroupsListParams: sessions.SessionsGroupsListParamsSchema, + SessionsGroupsListResult: sessions.SessionsGroupsListResultSchema, + SessionsGroupsPutParams: sessions.SessionsGroupsPutParamsSchema, + SessionsGroupsRenameParams: sessions.SessionsGroupsRenameParamsSchema, + SessionsGroupsDeleteParams: sessions.SessionsGroupsDeleteParamsSchema, + SessionsGroupsMutationResult: sessions.SessionsGroupsMutationResultSchema, + SessionsCompactParams: sessions.SessionsCompactParamsSchema, + SessionsUsageParams: sessions.SessionsUsageParamsSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schema-fragment-transport.ts b/packages/gateway-protocol/src/schema/protocol-schema-fragment-transport.ts new file mode 100644 index 000000000000..b464983adbbd --- /dev/null +++ b/packages/gateway-protocol/src/schema/protocol-schema-fragment-transport.ts @@ -0,0 +1,36 @@ +import * as errorCodes from "./error-codes.js"; +import * as frames from "./frames.js"; +import * as gatewaySuspend from "./gateway-suspend.js"; +import * as snapshot from "./snapshot.js"; +import * as workerAdmission from "./worker-admission.js"; + +export const TransportProtocolSchemas = { + ConnectParams: frames.ConnectParamsSchema, + WorkerAdmissionHandshake: workerAdmission.WorkerAdmissionHandshakeSchema, + HelloOk: frames.HelloOkSchema, + RequestFrame: frames.RequestFrameSchema, + ResponseFrame: frames.ResponseFrameSchema, + EventFrame: frames.EventFrameSchema, + GatewayFrame: frames.GatewayFrameSchema, + PresenceEntry: snapshot.PresenceEntrySchema, + StateVersion: snapshot.StateVersionSchema, + Snapshot: snapshot.SnapshotSchema, + ErrorShape: frames.ErrorShapeSchema, + MissingScopeErrorDetails: errorCodes.MissingScopeErrorDetailsSchema, + McpAppViewExpiredErrorDetails: errorCodes.McpAppViewExpiredErrorDetailsSchema, + UnknownAgentIdErrorDetails: errorCodes.UnknownAgentIdErrorDetailsSchema, + WizardNotFoundErrorDetails: errorCodes.WizardNotFoundErrorDetailsSchema, + GatewayErrorDetails: errorCodes.GatewayErrorDetailsSchema, + GatewaySuspendTaskBlocker: gatewaySuspend.GatewaySuspendTaskBlockerSchema, + GatewaySuspendBlocker: gatewaySuspend.GatewaySuspendBlockerSchema, + GatewaySuspendPrepareParams: gatewaySuspend.GatewaySuspendPrepareParamsSchema, + GatewaySuspendPrepareBusyResult: gatewaySuspend.GatewaySuspendPrepareBusyResultSchema, + GatewaySuspendPrepareReadyResult: gatewaySuspend.GatewaySuspendPrepareReadyResultSchema, + GatewaySuspendPrepareResult: gatewaySuspend.GatewaySuspendPrepareResultSchema, + GatewaySuspendStatusParams: gatewaySuspend.GatewaySuspendStatusParamsSchema, + GatewaySuspendStatusRunningResult: gatewaySuspend.GatewaySuspendStatusRunningResultSchema, + GatewaySuspendStatusReadyResult: gatewaySuspend.GatewaySuspendStatusReadyResultSchema, + GatewaySuspendStatusResult: gatewaySuspend.GatewaySuspendStatusResultSchema, + GatewaySuspendResumeParams: gatewaySuspend.GatewaySuspendResumeParamsSchema, + GatewaySuspendResumeResult: gatewaySuspend.GatewaySuspendResumeResultSchema, +} as const; diff --git a/packages/gateway-protocol/src/schema/protocol-schemas.ts b/packages/gateway-protocol/src/schema/protocol-schemas.ts index 6ed903f54bdf..4cdced0389f9 100644 --- a/packages/gateway-protocol/src/schema/protocol-schemas.ts +++ b/packages/gateway-protocol/src/schema/protocol-schemas.ts @@ -1,1302 +1,40 @@ -/** - * Central public registry for canonical gateway schemas used by validators, - * generated static types, and protocol tooling. - */ -import type { TSchema } from "typebox"; -import { - AgentEventSchema, - AgentIdentityParamsSchema, - AgentIdentityResultSchema, - AgentParamsSchema, - AgentWaitParamsSchema, - ConversationListItemSchema, - ConversationListParamsSchema, - ConversationListResultSchema, - ConversationSendParamsSchema, - ConversationSendResultSchema, - ConversationTurnCancelParamsSchema, - ConversationTurnCancelResultSchema, - ConversationTurnParamsSchema, - ConversationTurnReplySchema, - ConversationTurnResultSchema, - MessageActionParamsSchema, - PollParamsSchema, - SendParamsSchema, - WakeParamsSchema, -} from "./agent.js"; -import { - AuthProbeStatusSchema, - AgentKindSchema, - AgentSummarySchema, - AgentsCreateParamsSchema, - AgentsCreateResultSchema, - AgentsDeleteParamsSchema, - AgentsDeleteResultSchema, - AgentsFileEntrySchema, - AgentsFilesGetParamsSchema, - AgentsFilesGetResultSchema, - AgentsFilesListParamsSchema, - AgentsFilesListResultSchema, - AgentsFilesSetParamsSchema, - AgentsFilesSetResultSchema, - AgentsListParamsSchema, - AgentsListResultSchema, - AgentsUpdateParamsSchema, - AgentsUpdateResultSchema, - ModelChoiceSchema, - ModelsAuthLogoutParamsSchema, - ModelsAuthStatusParamsSchema, - ModelsListParamsSchema, - ModelsListResultSchema, - ModelsProbeParamsSchema, - ModelsProbeResultSchema, - ModelsProbeTargetResultSchema, - SkillsBinsParamsSchema, - SkillsBinsResultSchema, - SkillsDetailParamsSchema, - SkillsDetailResultSchema, - SkillsInstallParamsSchema, - SkillsCuratorActionParamsSchema, - SkillsCuratorActionResultSchema, - SkillsCuratorStatusParamsSchema, - SkillsCuratorStatusResultSchema, - SkillsProposalActionParamsSchema, - SkillsProposalApplyResultSchema, - SkillsProposalCreateParamsSchema, - SkillsProposalInspectParamsSchema, - SkillsProposalInspectResultSchema, - SkillsProposalRecordResultSchema, - SkillsProposalRequestRevisionParamsSchema, - SkillsProposalRequestRevisionResultSchema, - SkillsProposalReviseParamsSchema, - SkillsProposalUpdateParamsSchema, - SkillsSearchParamsSchema, - SkillsSearchResultSchema, - SkillsSecurityVerdictsParamsSchema, - SkillsSecurityVerdictsResultSchema, - SkillsSkillCardParamsSchema, - SkillsSkillCardResultSchema, - SkillsStatusParamsSchema, - SkillsUploadBeginParamsSchema, - SkillsUploadChunkParamsSchema, - SkillsUploadCommitParamsSchema, - SkillsUpdateParamsSchema, - ToolCatalogEntrySchema, - ToolCatalogGroupSchema, - ToolCatalogProfileSchema, - ToolsCatalogParamsSchema, - ToolsCatalogResultSchema, - ToolsEffectiveEntrySchema, - ToolsEffectiveGroupSchema, - ToolsEffectiveNoticeSchema, - ToolsEffectiveParamsSchema, - ToolsEffectiveResultSchema, - ToolsInvokeErrorSchema, - ToolsInvokeParamsSchema, - ToolsInvokeResultSchema, -} from "./agents-models-skills.js"; -import { - AgentsWorkspaceEntrySchema, - AgentsWorkspaceFileSchema, - AgentsWorkspaceGetParamsSchema, - AgentsWorkspaceGetResultSchema, - AgentsWorkspaceListParamsSchema, - AgentsWorkspaceListResultSchema, -} from "./agents-workspace.js"; -import { - AllowedApprovalSnapshotSchema, - ApprovalAllowDecisionSchema, - ApprovalAllowedReasonSchema, - ApprovalCancelledReasonSchema, - ApprovalDecisionSchema, - ApprovalDeniedReasonSchema, - ApprovalExpiredReasonSchema, - ApprovalGetParamsSchema, - ApprovalGetResultSchema, - ApprovalHistoryParamsSchema, - ApprovalHistoryResultSchema, - ApprovalKindSchema, - ApprovalPresentationSchema, - ApprovalResolveParamsSchema, - ApprovalResolveResultSchema, - SessionApprovalEventSchema, - SessionApprovalReplaySchema, - ApprovalSnapshotSchema, - ApprovalTerminalReasonSchema, - CancelledApprovalSnapshotSchema, - DeniedApprovalSnapshotSchema, - ExecApprovalPresentationSchema, - ExpiredApprovalSnapshotSchema, - PendingApprovalSnapshotSchema, - PendingSessionApprovalEventSchema, - PluginApprovalPresentationSchema, - PluginApprovalSeveritySchema, - SystemAgentApprovalPresentationSchema, - TerminalApprovalSnapshotSchema, - TerminalSessionApprovalEventSchema, -} from "./approvals.js"; -import { - ArtifactSummarySchema, - ArtifactsDownloadParamsSchema, - ArtifactsDownloadResultSchema, - ArtifactsGetParamsSchema, - ArtifactsGetResultSchema, - ArtifactsListParamsSchema, - ArtifactsListResultSchema, -} from "./artifacts.js"; -import { - AuditActivityAgentRunV1Schema, - AuditActivityEventV1Schema, - AuditActivityInboundMessageV1Schema, - AuditActivityListParamsSchema, - AuditActivityListResultSchema, - AuditActivityOutboundMessageV1Schema, - AuditActivityToolActionV1Schema, -} from "./audit-activity.js"; -import { AuditEventSchema, AuditListParamsSchema, AuditListResultSchema } from "./audit.js"; -import { - BoardActionParamsSchema, - BoardCanvasDocumentSourceSchema, - BoardChangedEventSchema, - BoardCommandEventSchema, - BoardCommandSchema, - BoardDataReadParamsSchema, - BoardEventParamsSchema, - BoardFocusTabCommandSchema, - BoardGetParamsSchema, - BoardMcpAppDescriptorSchema, - BoardOpSchema, - BoardPromptAuthorizeParamsSchema, - BoardSetChatDockCommandSchema, - BoardSnapshotSchema, - BoardTabCreateOpSchema, - BoardTabDeleteOpSchema, - BoardTabSchema, - BoardTabsReorderOpSchema, - BoardTabUpdateOpSchema, - BoardUpdateParamsSchema, - BoardWidgetContentSchema, - BoardWidgetAppViewParamsSchema, - BoardWidgetAppViewResultSchema, - BoardWidgetGrantParamsSchema, - BoardWidgetHtmlContentSchema, - BoardWidgetMcpAppContentSchema, - BoardWidgetMcpAppPutContentSchema, - BoardWidgetPluginContentSchema, - BoardWidgetMoveOpSchema, - BoardWidgetPutContentSchema, - BoardWidgetPutParamsSchema, - BoardWidgetRemoveOpSchema, - BoardWidgetResizeOpSchema, - BoardWidgetDeclaredSchema, - BoardWidgetSchema, -} from "./board.js"; -import { - ChannelsPairingApproveParamsSchema, - ChannelsPairingApproveResultSchema, - ChannelsPairingDismissParamsSchema, - ChannelsPairingDismissResultSchema, - ChannelsPairingListParamsSchema, - ChannelsPairingListResultSchema, -} from "./channel-pairing.js"; -import { - ChannelsStartParamsSchema, - ChannelsStopParamsSchema, - ChannelsLogoutParamsSchema, - TalkEventSchema, - TalkCatalogParamsSchema, - TalkCatalogResultSchema, - TalkClientCreateParamsSchema, - TalkClientCreateResultSchema, - TalkClientCloseParamsSchema, - TalkClientMutationResultSchema, - TalkAgentControlResultSchema, - TalkClientSteerParamsSchema, - TalkClientToolCallParamsSchema, - TalkClientToolCallResultSchema, - TalkClientTranscriptParamsSchema, - TalkConfigParamsSchema, - TalkConfigResultSchema, - TalkSessionAppendAudioParamsSchema, - TalkSessionCancelOutputParamsSchema, - TalkSessionCancelTurnParamsSchema, - TalkSessionCloseParamsSchema, - TalkSessionCreateParamsSchema, - TalkSessionCreateResultSchema, - TalkSessionJoinParamsSchema, - TalkSessionJoinResultSchema, - TalkSessionOkResultSchema, - TalkSessionSteerParamsSchema, - TalkSessionSubmitToolResultParamsSchema, - TalkSessionTurnResultSchema, - TalkSessionTurnParamsSchema, - TalkSpeakParamsSchema, - TalkSpeakResultSchema, - TtsSpeakParamsSchema, - TtsSpeakResultSchema, - ChannelsStatusParamsSchema, - ChannelsStatusResultSchema, - TalkModeParamsSchema, - WebLoginStartParamsSchema, - WebLoginWaitParamsSchema, -} from "./channels.js"; -import { - CommandEntrySchema, - CommandsListParamsSchema, - CommandsListResultSchema, -} from "./commands.js"; -import { - ConfigApplyParamsSchema, - ConfigGetParamsSchema, - ConfigPatchParamsSchema, - ConfigSchemaLookupParamsSchema, - ConfigSchemaLookupResultSchema, - ConfigSchemaParamsSchema, - ConfigSchemaResponseSchema, - ConfigSetParamsSchema, - UpdateStatusParamsSchema, - UpdateRunParamsSchema, -} from "./config.js"; -import { - CronAddParamsSchema, - CronAddResultSchema, - CronDeclarativeAddResultSchema, - CronGetParamsSchema, - CronJobSchema, - CronListParamsSchema, - CronRemoveParamsSchema, - CronRunLogEntrySchema, - CronRunParamsSchema, - CronRunsParamsSchema, - CronScratchGetParamsSchema, - CronScratchGetResultSchema, - CronScratchSetParamsSchema, - CronScratchSetResultSchema, - CronStatusParamsSchema, - CronUpdateParamsSchema, -} from "./cron.js"; -import { - DevicePairApproveParamsSchema, - DevicePairListParamsSchema, - DevicePairRenameParamsSchema, - DevicePairRemoveParamsSchema, - DevicePairRejectParamsSchema, - DevicePairRequestedEventSchema, - DevicePairResolvedEventSchema, - DevicePairSetupCodeParamsSchema, - DevicePairSetupCodeResultSchema, - DeviceTokenRevokeParamsSchema, - DeviceTokenRotateParamsSchema, -} from "./devices.js"; -import { - EnvironmentSummarySchema, - EnvironmentsCreateParamsSchema, - EnvironmentsCreateResultSchema, - EnvironmentsDestroyParamsSchema, - EnvironmentsDestroyResultSchema, - EnvironmentsListParamsSchema, - EnvironmentsListResultSchema, - EnvironmentsStatusParamsSchema, - EnvironmentsStatusResultSchema, - EnvironmentStatusSchema, - WorkerEnvironmentMetadataSchema, - WorkerEnvironmentStateSchema, - WorkerTunnelStatusSchema, -} from "./environments.js"; -import { - GatewayErrorDetailsSchema, - McpAppViewExpiredErrorDetailsSchema, - MissingScopeErrorDetailsSchema, - UnknownAgentIdErrorDetailsSchema, - WizardNotFoundErrorDetailsSchema, -} from "./error-codes.js"; -import { - ExecApprovalsGetParamsSchema, - ExecApprovalsNodeGetParamsSchema, - ExecApprovalsNodeSnapshotSchema, - ExecApprovalsNodeSetParamsSchema, - ExecApprovalsSetParamsSchema, - ExecApprovalsSnapshotSchema, - ExecApprovalGetParamsSchema, - ExecApprovalRequestParamsSchema, - ExecApprovalResolveParamsSchema, -} from "./exec-approvals.js"; -import { - ConnectParamsSchema, - ErrorShapeSchema, - EventFrameSchema, - GatewayFrameSchema, - HelloOkSchema, - RequestFrameSchema, - ResponseFrameSchema, - ShutdownEventSchema, - TickEventSchema, -} from "./frames.js"; -import { FsDirEntrySchema, FsListDirParamsSchema, FsListDirResultSchema } from "./fs.js"; -import { - GatewaySuspendBlockerSchema, - GatewaySuspendPrepareBusyResultSchema, - GatewaySuspendPrepareParamsSchema, - GatewaySuspendPrepareReadyResultSchema, - GatewaySuspendPrepareResultSchema, - GatewaySuspendResumeParamsSchema, - GatewaySuspendResumeResultSchema, - GatewaySuspendStatusReadyResultSchema, - GatewaySuspendStatusRunningResultSchema, - GatewaySuspendStatusParamsSchema, - GatewaySuspendStatusResultSchema, - GatewaySuspendTaskBlockerSchema, -} from "./gateway-suspend.js"; -import { LogMigrationProtocolSchemas } from "./log-migration-protocol-schemas.js"; -import { - ChatAbortedEventSchema, - ChatAbortParamsSchema, - ChatDeltaEventSchema, - ChatErrorEventSchema, - ChatEventSchema, - ChatFinalEventSchema, - ChatRunStartupPhaseSchema, - ChatStatusEventSchema, - ChatHistoryParamsSchema, - ChatMetadataParamsSchema, - ChatMessageGetParamsSchema, - ChatMessageGetResultSchema, - ChatInjectParamsSchema, - ChatSendParamsSchema, - ChatToolTitlesParamsSchema, - ChatToolTitlesResultSchema, -} from "./logs-chat.js"; -import { - NodeDescribeParamsSchema, - NodeEventParamsSchema, - NodeEventResultSchema, - NodePendingDrainParamsSchema, - NodePendingDrainResultSchema, - NodePendingEnqueueParamsSchema, - NodePendingEnqueueResultSchema, - NodePresenceAlivePayloadSchema, - NodeListParamsSchema, - NodePendingAckParamsSchema, - NodePairApproveParamsSchema, - NodePairListParamsSchema, - NodePairRemoveParamsSchema, - NodePairRejectParamsSchema, - NodePluginToolDescriptorSchema, - NodePluginToolsUpdateParamsSchema, - NodeSkillDescriptorSchema, - NodeSkillsUpdateParamsSchema, - NodeRenameParamsSchema, -} from "./nodes.js"; -import { - SystemChangeEntrySchema, - SystemChangeKindSchema, - SystemChangeSourceSchema, - SystemChangesListParamsSchema, - SystemChangesListResultSchema, - SystemAgentChatHistoryParamsSchema, - SystemAgentChatHistoryResultSchema, - SystemAgentChatHistoryTurnSchema, - SystemAgentChatParamsSchema, - SystemAgentChatResultSchema, - SystemAgentSetupActivateParamsSchema, - SystemAgentSetupActivateResultSchema, - SystemAgentSetupAuthStartParamsSchema, - SystemAgentSetupAuthStartResultSchema, - SystemAgentSetupDetectParamsSchema, - SystemAgentSetupDetectResultSchema, - SystemAgentSetupVerifyParamsSchema, - SystemAgentSetupVerifyResultSchema, -} from "./openclaw.js"; -import { - PluginApprovalRequestParamsSchema, - PluginApprovalResolveParamsSchema, -} from "./plugin-approvals.js"; -import { - PluginCatalogClawHubInstallSchema, - PluginCatalogEntrySchema, - PluginCatalogInstallActionSchema, - PluginCatalogOfficialInstallSchema, - PluginControlUiDescriptorSchema, - PluginSearchPackageSchema, - PluginSearchResultEntrySchema, - PluginsInstallParamsSchema, - PluginsInstallResultSchema, - PluginsListParamsSchema, - PluginsListResultSchema, - PluginsRefreshParamsSchema, - PluginsRefreshResultSchema, - PluginsSearchParamsSchema, - PluginsSearchResultSchema, - PluginsSessionActionFailureResultSchema, - PluginsSessionActionParamsSchema, - PluginsSessionActionResultSchema, - PluginsSessionActionSuccessResultSchema, - PluginsSetEnabledParamsSchema, - PluginsSetEnabledResultSchema, - PluginsUiDescriptorsParamsSchema, - PluginsUiDescriptorsResultSchema, - PluginsUninstallParamsSchema, - PluginsUninstallResultSchema, -} from "./plugins.js"; -import { NodeInvokeProtocolSchemas } from "./protocol-schemas-node-invoke.js"; -import { NodePresenceProtocolSchemas } from "./protocol-schemas-node-presence.js"; -import { PushTestParamsSchema, PushTestResultSchema } from "./push.js"; -import { - QuestionAnswersSchema, - QuestionGetParamsSchema, - QuestionGetResultSchema, - QuestionListParamsSchema, - QuestionListResultSchema, - QuestionOptionSchema, - QuestionRecordSchema, - QuestionRequestParamsSchema, - QuestionRequestQuestionSchema, - QuestionRequestResultSchema, - QuestionResolvedEventSchema, - QuestionResolveParamsSchema, - QuestionResolveResultSchema, - QuestionSchema, - QuestionStatusSchema, - QuestionWaitAnswerParamsSchema, - QuestionWaitAnswerResultSchema, -} from "./questions.js"; -import { - SecretsReloadParamsSchema, - SecretsResolveAssignmentSchema, - SecretsResolveParamsSchema, - SecretsResolveResultSchema, -} from "./secrets.js"; -import { - SessionDiscussionInfoParamsSchema, - SessionDiscussionInfoResultSchema, - SessionDiscussionInfoSchema, - SessionDiscussionOpenParamsSchema, - SessionDiscussionOpenResultSchema, - SessionDiscussionStateSchema, -} from "./session-discussion.js"; -import { SessionPlacementProtocolSchemas } from "./session-placement.js"; -import { - SessionCatalogCapabilitiesSchema, - SessionCatalogDescriptorSchema, - SessionCatalogHostSchema, - SessionCatalogPullRequestSummarySchema, - SessionCatalogSchema, - SessionCatalogSessionSchema, - SessionCatalogTranscriptItemSchema, - SessionsCatalogArchiveParamsSchema, - SessionsCatalogArchiveResultSchema, - SessionsCatalogContinueParamsSchema, - SessionsCatalogContinueResultSchema, - SessionsCatalogListParamsSchema, - SessionsCatalogListResultSchema, - SessionsCatalogReadParamsSchema, - SessionsCatalogReadResultSchema, -} from "./sessions-catalog.js"; -import { - SessionMemberAddParamsSchema, - SessionMemberMutationResultSchema, - SessionMemberRemoveParamsSchema, - SessionMemberSchema, - SessionMembersListParamsSchema, - SessionMembersListResultSchema, - SessionSharingActionSchema, - SessionSharingEventSchema, - SessionSharingIdentitySchema, - SessionSharingRoleSchema, - SessionVisibilitySchema, - SessionVisibilitySetParamsSchema, - SessionVisibilitySetResultSchema, -} from "./sessions-sharing.js"; -import { - SessionSuggestionEventSchema, - SessionSuggestionActionSchema, - SessionSuggestionResolutionSchema, - SessionSuggestionSchema, - SessionSuggestionStateSchema, - SessionSuggestionsAddParamsSchema, - SessionSuggestionsAddResultSchema, - SessionSuggestionsListParamsSchema, - SessionSuggestionsListResultSchema, - SessionSuggestionsResolveParamsSchema, - SessionSuggestionsResolveResultSchema, - SessionTypingEventSchema, - SessionTypingParamsSchema, - SessionTypingResultSchema, -} from "./sessions-suggestions.js"; -import { - SessionBranchSchema, - SessionsAbortParamsSchema, - SessionsBranchesListParamsSchema, - SessionsBranchesListResultSchema, - SessionsBranchesSwitchParamsSchema, - SessionsBranchesSwitchResultSchema, - SessionsCompactParamsSchema, - SessionsCompactionBranchParamsSchema, - SessionsCompactionBranchResultSchema, - SessionsCompactionGetParamsSchema, - SessionsCompactionGetResultSchema, - SessionsCompactionListParamsSchema, - SessionsCompactionListResultSchema, - SessionsCompactionRestoreParamsSchema, - SessionsCompactionRestoreResultSchema, - SessionsForkParamsSchema, - SessionsForkResultSchema, - SessionsRewindParamsSchema, - SessionsRewindResultSchema, - SessionFileBrowserEntrySchema, - SessionFileBrowserResultSchema, - SessionCompactionCheckpointSchema, - SessionFileEntrySchema, - SessionFileKindSchema, - SessionFileRelevanceSchema, - SessionOperationEventSchema, - SessionCreatedActorSchema, - SessionObserverDigestSchema, - SessionObserverHealthSchema, - SessionObserverPlanProgressSchema, - SessionCompanionExchangeSchema, - SessionRowSchema, - SessionsCompanionAskParamsSchema, - SessionsCompanionAskResultSchema, - SessionsCompanionResetParamsSchema, - SessionsCompanionResetResultSchema, - SessionsCompanionStateParamsSchema, - SessionsCompanionStateResultSchema, - SessionsObserverVisibilityParamsSchema, - SessionsObserverVisibilityResultSchema, - SessionWorktreeInfoSchema, - SessionsCleanupParamsSchema, - SessionsCreateParamsSchema, - SessionsCreateResultSchema, - SessionsDeleteParamsSchema, - SessionsDescribeParamsSchema, - SessionGroupSchema, - SessionsGroupsDeleteParamsSchema, - SessionsGroupsListParamsSchema, - SessionsGroupsListResultSchema, - SessionsGroupsMutationResultSchema, - SessionsGroupsPutParamsSchema, - SessionsGroupsRenameParamsSchema, - SessionDiffFileSchema, - SessionDiffFileStatusSchema, - SessionsDiffParamsSchema, - SessionsDiffResultSchema, - SessionsFilesGetParamsSchema, - SessionsFilesGetResultSchema, - SessionsFilesListParamsSchema, - SessionsFilesListResultSchema, - SessionsFilesRevealParamsSchema, - SessionsFilesRevealResultSchema, - SessionsFilesSetParamsSchema, - SessionsFilesSetResultSchema, - SessionsListParamsSchema, - SessionsMessagesSubscribeParamsSchema, - SessionsMessagesUnsubscribeParamsSchema, - SessionsPatchParamsSchema, - SessionsPluginPatchParamsSchema, - SessionsPluginPatchResultSchema, - SessionsPreviewParamsSchema, - SessionsResetParamsSchema, - SessionsResolveParamsSchema, - SessionsSearchHitSchema, - SessionsSearchParamsSchema, - SessionsSearchResultSchema, - SessionsSendParamsSchema, - SessionsUsageParamsSchema, -} from "./sessions.js"; -import { SkillWorkshopProtocolSchemas } from "./skill-protocol-schemas.js"; -import { PresenceEntrySchema, SnapshotSchema, StateVersionSchema } from "./snapshot.js"; -import { SystemInfoParamsSchema, SystemInfoResultSchema } from "./system-info.js"; -import { TalkSessionAcknowledgeMarkParamsSchema } from "./talk-marks.js"; -import { - TaskSuggestionEventSchema, - TaskSuggestionResolutionSchema, - TaskSuggestionSchema, - TaskSuggestionsAcceptParamsSchema, - TaskSuggestionsAcceptResultSchema, - TaskSuggestionsCreateParamsSchema, - TaskSuggestionsCreateResultSchema, - TaskSuggestionsDismissParamsSchema, - TaskSuggestionsDismissResultSchema, - TaskSuggestionsListParamsSchema, - TaskSuggestionsListResultSchema, -} from "./task-suggestions.js"; -import { - TasksCancelParamsSchema, - TasksCancelResultSchema, - TasksGetParamsSchema, - TasksGetResultSchema, - TasksListParamsSchema, - TasksListResultSchema, - TaskSummarySchema, -} from "./tasks.js"; -import { TerminalProtocolSchemas } from "./terminal-protocol-schemas.js"; -import { - UiClosePaneCommandSchema, - UiCommandParamsSchema, - UiCommandResultSchema, - UiCommandSchema, - UiFocusCommandSchema, - UiNavigateCommandSchema, - UiPanelCommandSchema, - UiSidebarCommandSchema, - UiSplitCommandSchema, -} from "./ui-command.js"; -import { - WizardCancelParamsSchema, - WizardNextParamsSchema, - WizardNextResultSchema, - WizardStartParamsSchema, - WizardStartResultSchema, - WizardStatusParamsSchema, - WizardStatusResultSchema, - WizardStepSchema, -} from "./wizard.js"; -import { WorkerAdmissionHandshakeSchema } from "./worker-admission.js"; -import { - WorktreeRecordSchema, - WorktreesCreateParamsSchema, - WorktreesGcParamsSchema, - WorktreesGcResultSchema, - WorktreesListParamsSchema, - WorktreesListResultSchema, - WorktreeBranchSchema, - WorktreeRepositoryStatusSchema, - WorktreesBranchesParamsSchema, - WorktreesBranchesResultSchema, - WorktreesRemoveParamsSchema, - WorktreesRemoveResultSchema, - WorktreesRestoreParamsSchema, -} from "./worktrees.js"; +import { composeProtocolSchemaFragments } from "./protocol-schema-composer.js"; +import { AgentControlProtocolSchemas } from "./protocol-schema-fragment-agent-control.js"; +import { AgentSkillProtocolSchemas } from "./protocol-schema-fragment-agents-skills.js"; +import { ApprovalProtocolSchemas } from "./protocol-schema-fragment-approvals.js"; +import { BoardProtocolSchemas } from "./protocol-schema-fragment-board.js"; +import { ChannelProtocolSchemas } from "./protocol-schema-fragment-channels.js"; +import { IntegrationProtocolSchemas } from "./protocol-schema-fragment-integrations.js"; +import { NodeProtocolSchemas } from "./protocol-schema-fragment-nodes.js"; +import { OperationsProtocolSchemas } from "./protocol-schema-fragment-operations.js"; +import { PluginLifecycleProtocolSchemas } from "./protocol-schema-fragment-plugins-lifecycle.js"; +import { SchedulerProtocolSchemas } from "./protocol-schema-fragment-scheduler.js"; +import { SessionCollaborationProtocolSchemas } from "./protocol-schema-fragment-sessions-collaboration.js"; +import { SessionCoreProtocolSchemas } from "./protocol-schema-fragment-sessions-core.js"; +import { SessionLifecycleProtocolSchemas } from "./protocol-schema-fragment-sessions-lifecycle.js"; +import { TransportProtocolSchemas } from "./protocol-schema-fragment-transport.js"; /** Public schema registry keyed by stable protocol schema name. */ -export const ProtocolSchemas = { - BoardTab: BoardTabSchema, - BoardWidget: BoardWidgetSchema, - BoardWidgetDeclared: BoardWidgetDeclaredSchema, - BoardSnapshot: BoardSnapshotSchema, - BoardTabCreateOp: BoardTabCreateOpSchema, - BoardTabUpdateOp: BoardTabUpdateOpSchema, - BoardTabDeleteOp: BoardTabDeleteOpSchema, - BoardTabsReorderOp: BoardTabsReorderOpSchema, - BoardWidgetMoveOp: BoardWidgetMoveOpSchema, - BoardWidgetResizeOp: BoardWidgetResizeOpSchema, - BoardWidgetRemoveOp: BoardWidgetRemoveOpSchema, - BoardOp: BoardOpSchema, - BoardMcpAppDescriptor: BoardMcpAppDescriptorSchema, - BoardWidgetHtmlContent: BoardWidgetHtmlContentSchema, - BoardWidgetMcpAppContent: BoardWidgetMcpAppContentSchema, - BoardWidgetMcpAppPutContent: BoardWidgetMcpAppPutContentSchema, - BoardWidgetPluginContent: BoardWidgetPluginContentSchema, - BoardCanvasDocumentSource: BoardCanvasDocumentSourceSchema, - BoardWidgetContent: BoardWidgetContentSchema, - BoardWidgetPutContent: BoardWidgetPutContentSchema, - BoardGetParams: BoardGetParamsSchema, - BoardUpdateParams: BoardUpdateParamsSchema, - BoardWidgetPutParams: BoardWidgetPutParamsSchema, - BoardWidgetGrantParams: BoardWidgetGrantParamsSchema, - BoardWidgetAppViewParams: BoardWidgetAppViewParamsSchema, - BoardWidgetAppViewResult: BoardWidgetAppViewResultSchema, - BoardEventParams: BoardEventParamsSchema, - BoardPromptAuthorizeParams: BoardPromptAuthorizeParamsSchema, - BoardDataReadParams: BoardDataReadParamsSchema, - BoardActionParams: BoardActionParamsSchema, - BoardChangedEvent: BoardChangedEventSchema, - BoardFocusTabCommand: BoardFocusTabCommandSchema, - BoardSetChatDockCommand: BoardSetChatDockCommandSchema, - BoardCommand: BoardCommandSchema, - BoardCommandEvent: BoardCommandEventSchema, - AuthProbeStatus: AuthProbeStatusSchema, - // Handshake, transport frames, state snapshots, and shared error envelopes. - ConnectParams: ConnectParamsSchema, - WorkerAdmissionHandshake: WorkerAdmissionHandshakeSchema, - HelloOk: HelloOkSchema, - RequestFrame: RequestFrameSchema, - ResponseFrame: ResponseFrameSchema, - EventFrame: EventFrameSchema, - GatewayFrame: GatewayFrameSchema, - PresenceEntry: PresenceEntrySchema, - StateVersion: StateVersionSchema, - Snapshot: SnapshotSchema, - ErrorShape: ErrorShapeSchema, - MissingScopeErrorDetails: MissingScopeErrorDetailsSchema, - McpAppViewExpiredErrorDetails: McpAppViewExpiredErrorDetailsSchema, - UnknownAgentIdErrorDetails: UnknownAgentIdErrorDetailsSchema, - WizardNotFoundErrorDetails: WizardNotFoundErrorDetailsSchema, - GatewayErrorDetails: GatewayErrorDetailsSchema, - GatewaySuspendTaskBlocker: GatewaySuspendTaskBlockerSchema, - GatewaySuspendBlocker: GatewaySuspendBlockerSchema, - GatewaySuspendPrepareParams: GatewaySuspendPrepareParamsSchema, - GatewaySuspendPrepareBusyResult: GatewaySuspendPrepareBusyResultSchema, - GatewaySuspendPrepareReadyResult: GatewaySuspendPrepareReadyResultSchema, - GatewaySuspendPrepareResult: GatewaySuspendPrepareResultSchema, - GatewaySuspendStatusParams: GatewaySuspendStatusParamsSchema, - GatewaySuspendStatusRunningResult: GatewaySuspendStatusRunningResultSchema, - GatewaySuspendStatusReadyResult: GatewaySuspendStatusReadyResultSchema, - GatewaySuspendStatusResult: GatewaySuspendStatusResultSchema, - GatewaySuspendResumeParams: GatewaySuspendResumeParamsSchema, - GatewaySuspendResumeResult: GatewaySuspendResumeResultSchema, +export const ProtocolSchemas = composeProtocolSchemaFragments([ + BoardProtocolSchemas, + TransportProtocolSchemas, + AgentControlProtocolSchemas, + NodeProtocolSchemas, + IntegrationProtocolSchemas, + SessionCoreProtocolSchemas, + SessionCollaborationProtocolSchemas, + SessionLifecycleProtocolSchemas, + OperationsProtocolSchemas, + ChannelProtocolSchemas, + AgentSkillProtocolSchemas, + SchedulerProtocolSchemas, + ApprovalProtocolSchemas, + PluginLifecycleProtocolSchemas, +] as const); - // Environment and agent-facing control RPC payloads. - EnvironmentStatus: EnvironmentStatusSchema, - WorkerEnvironmentState: WorkerEnvironmentStateSchema, - WorkerTunnelStatus: WorkerTunnelStatusSchema, - WorkerEnvironmentMetadata: WorkerEnvironmentMetadataSchema, - EnvironmentSummary: EnvironmentSummarySchema, - EnvironmentsCreateParams: EnvironmentsCreateParamsSchema, - EnvironmentsCreateResult: EnvironmentsCreateResultSchema, - EnvironmentsDestroyParams: EnvironmentsDestroyParamsSchema, - EnvironmentsDestroyResult: EnvironmentsDestroyResultSchema, - EnvironmentsListParams: EnvironmentsListParamsSchema, - EnvironmentsListResult: EnvironmentsListResultSchema, - EnvironmentsStatusParams: EnvironmentsStatusParamsSchema, - EnvironmentsStatusResult: EnvironmentsStatusResultSchema, - SystemInfoParams: SystemInfoParamsSchema, - SystemInfoResult: SystemInfoResultSchema, - AgentEvent: AgentEventSchema, - ConversationSendParams: ConversationSendParamsSchema, - ConversationSendResult: ConversationSendResultSchema, - ConversationListItem: ConversationListItemSchema, - ConversationListParams: ConversationListParamsSchema, - ConversationListResult: ConversationListResultSchema, - ConversationTurnCancelParams: ConversationTurnCancelParamsSchema, - ConversationTurnCancelResult: ConversationTurnCancelResultSchema, - ConversationTurnParams: ConversationTurnParamsSchema, - ConversationTurnReply: ConversationTurnReplySchema, - ConversationTurnResult: ConversationTurnResultSchema, - MessageActionParams: MessageActionParamsSchema, - SendParams: SendParamsSchema, - PollParams: PollParamsSchema, - AgentParams: AgentParamsSchema, - AgentIdentityParams: AgentIdentityParamsSchema, - AgentIdentityResult: AgentIdentityResultSchema, - AgentWaitParams: AgentWaitParamsSchema, - WakeParams: WakeParamsSchema, - WorktreeRecord: WorktreeRecordSchema, - WorktreesListParams: WorktreesListParamsSchema, - WorktreesListResult: WorktreesListResultSchema, - WorktreesCreateParams: WorktreesCreateParamsSchema, - WorktreesRemoveParams: WorktreesRemoveParamsSchema, - WorktreesRemoveResult: WorktreesRemoveResultSchema, - WorktreesRestoreParams: WorktreesRestoreParamsSchema, - WorktreesGcParams: WorktreesGcParamsSchema, - WorktreesGcResult: WorktreesGcResultSchema, - WorktreeBranch: WorktreeBranchSchema, - WorktreeRepositoryStatus: WorktreeRepositoryStatusSchema, - WorktreesBranchesParams: WorktreesBranchesParamsSchema, - WorktreesBranchesResult: WorktreesBranchesResultSchema, - FsDirEntry: FsDirEntrySchema, - FsListDirParams: FsListDirParamsSchema, - FsListDirResult: FsListDirResultSchema, - - // Node pairing, invocation, presence, and pending-queue payloads. - NodePairListParams: NodePairListParamsSchema, - NodePairApproveParams: NodePairApproveParamsSchema, - NodePairRejectParams: NodePairRejectParamsSchema, - NodePairRemoveParams: NodePairRemoveParamsSchema, - NodeRenameParams: NodeRenameParamsSchema, - NodeListParams: NodeListParamsSchema, - NodePluginToolDescriptor: NodePluginToolDescriptorSchema, - NodePluginToolsUpdateParams: NodePluginToolsUpdateParamsSchema, - NodeSkillDescriptor: NodeSkillDescriptorSchema, - NodeSkillsUpdateParams: NodeSkillsUpdateParamsSchema, - NodePendingAckParams: NodePendingAckParamsSchema, - NodeDescribeParams: NodeDescribeParamsSchema, - ...NodeInvokeProtocolSchemas, - NodeEventParams: NodeEventParamsSchema, - NodeEventResult: NodeEventResultSchema, - NodePresenceAlivePayload: NodePresenceAlivePayloadSchema, - ...NodePresenceProtocolSchemas, - NodePendingDrainParams: NodePendingDrainParamsSchema, - NodePendingDrainResult: NodePendingDrainResultSchema, - NodePendingEnqueueParams: NodePendingEnqueueParamsSchema, - NodePendingEnqueueResult: NodePendingEnqueueResultSchema, - - // Push and secret-resolution payloads used by mobile/control integrations. - PushTestParams: PushTestParamsSchema, - PushTestResult: PushTestResultSchema, - UiSplitCommand: UiSplitCommandSchema, - UiClosePaneCommand: UiClosePaneCommandSchema, - UiFocusCommand: UiFocusCommandSchema, - UiSidebarCommand: UiSidebarCommandSchema, - UiPanelCommand: UiPanelCommandSchema, - UiNavigateCommand: UiNavigateCommandSchema, - UiCommand: UiCommandSchema, - UiCommandParams: UiCommandParamsSchema, - UiCommandResult: UiCommandResultSchema, - SecretsReloadParams: SecretsReloadParamsSchema, - SecretsResolveParams: SecretsResolveParamsSchema, - SecretsResolveAssignment: SecretsResolveAssignmentSchema, - SecretsResolveResult: SecretsResolveResultSchema, - - // Session lifecycle, message routing, compaction, and usage accounting. - SessionsListParams: SessionsListParamsSchema, - SessionCatalogCapabilities: SessionCatalogCapabilitiesSchema, - SessionCatalogDescriptor: SessionCatalogDescriptorSchema, - SessionCatalogPullRequestSummary: SessionCatalogPullRequestSummarySchema, - SessionCatalogSession: SessionCatalogSessionSchema, - SessionCatalogHost: SessionCatalogHostSchema, - SessionCatalog: SessionCatalogSchema, - SessionCatalogTranscriptItem: SessionCatalogTranscriptItemSchema, - SessionsCatalogListParams: SessionsCatalogListParamsSchema, - SessionsCatalogListResult: SessionsCatalogListResultSchema, - SessionsCatalogReadParams: SessionsCatalogReadParamsSchema, - SessionsCatalogReadResult: SessionsCatalogReadResultSchema, - SessionsCatalogContinueParams: SessionsCatalogContinueParamsSchema, - SessionsCatalogContinueResult: SessionsCatalogContinueResultSchema, - SessionsCatalogArchiveParams: SessionsCatalogArchiveParamsSchema, - SessionsCatalogArchiveResult: SessionsCatalogArchiveResultSchema, - SessionsCleanupParams: SessionsCleanupParamsSchema, - SessionsPreviewParams: SessionsPreviewParamsSchema, - SessionsDescribeParams: SessionsDescribeParamsSchema, - SessionsResolveParams: SessionsResolveParamsSchema, - SessionsSearchHit: SessionsSearchHitSchema, - SessionsSearchParams: SessionsSearchParamsSchema, - SessionsSearchResult: SessionsSearchResultSchema, - SessionCompactionCheckpoint: SessionCompactionCheckpointSchema, - SessionOperationEvent: SessionOperationEventSchema, - SessionCreatedActor: SessionCreatedActorSchema, - SessionObserverHealth: SessionObserverHealthSchema, - SessionObserverPlanProgress: SessionObserverPlanProgressSchema, - SessionObserverDigest: SessionObserverDigestSchema, - SessionCompanionExchange: SessionCompanionExchangeSchema, - SessionRow: SessionRowSchema, - SessionsCompanionAskParams: SessionsCompanionAskParamsSchema, - SessionsCompanionAskResult: SessionsCompanionAskResultSchema, - SessionsCompanionResetParams: SessionsCompanionResetParamsSchema, - SessionsCompanionResetResult: SessionsCompanionResetResultSchema, - SessionsCompanionStateParams: SessionsCompanionStateParamsSchema, - SessionsCompanionStateResult: SessionsCompanionStateResultSchema, - SessionsObserverVisibilityParams: SessionsObserverVisibilityParamsSchema, - SessionsObserverVisibilityResult: SessionsObserverVisibilityResultSchema, - SessionVisibility: SessionVisibilitySchema, - SessionSharingIdentity: SessionSharingIdentitySchema, - SessionSharingRole: SessionSharingRoleSchema, - SessionVisibilitySetParams: SessionVisibilitySetParamsSchema, - SessionVisibilitySetResult: SessionVisibilitySetResultSchema, - SessionMembersListParams: SessionMembersListParamsSchema, - SessionMember: SessionMemberSchema, - SessionMembersListResult: SessionMembersListResultSchema, - SessionMemberAddParams: SessionMemberAddParamsSchema, - SessionMemberRemoveParams: SessionMemberRemoveParamsSchema, - SessionMemberMutationResult: SessionMemberMutationResultSchema, - SessionSharingAction: SessionSharingActionSchema, - SessionSharingEvent: SessionSharingEventSchema, - SessionSuggestionState: SessionSuggestionStateSchema, - SessionSuggestionAction: SessionSuggestionActionSchema, - SessionSuggestionResolution: SessionSuggestionResolutionSchema, - SessionSuggestion: SessionSuggestionSchema, - SessionSuggestionsAddParams: SessionSuggestionsAddParamsSchema, - SessionSuggestionsAddResult: SessionSuggestionsAddResultSchema, - SessionSuggestionsListParams: SessionSuggestionsListParamsSchema, - SessionSuggestionsListResult: SessionSuggestionsListResultSchema, - SessionSuggestionsResolveParams: SessionSuggestionsResolveParamsSchema, - SessionSuggestionsResolveResult: SessionSuggestionsResolveResultSchema, - SessionSuggestionEvent: SessionSuggestionEventSchema, - SessionTypingParams: SessionTypingParamsSchema, - SessionTypingResult: SessionTypingResultSchema, - SessionTypingEvent: SessionTypingEventSchema, - ...SessionPlacementProtocolSchemas, - SessionDiscussionState: SessionDiscussionStateSchema, - SessionDiscussionInfo: SessionDiscussionInfoSchema, - SessionDiscussionInfoParams: SessionDiscussionInfoParamsSchema, - SessionDiscussionInfoResult: SessionDiscussionInfoResultSchema, - SessionDiscussionOpenParams: SessionDiscussionOpenParamsSchema, - SessionDiscussionOpenResult: SessionDiscussionOpenResultSchema, - SessionsCompactionListParams: SessionsCompactionListParamsSchema, - SessionsCompactionGetParams: SessionsCompactionGetParamsSchema, - SessionsCompactionBranchParams: SessionsCompactionBranchParamsSchema, - SessionsCompactionRestoreParams: SessionsCompactionRestoreParamsSchema, - SessionsCompactionListResult: SessionsCompactionListResultSchema, - SessionsCompactionGetResult: SessionsCompactionGetResultSchema, - SessionsCompactionBranchResult: SessionsCompactionBranchResultSchema, - SessionsCompactionRestoreResult: SessionsCompactionRestoreResultSchema, - SessionsRewindParams: SessionsRewindParamsSchema, - SessionsRewindResult: SessionsRewindResultSchema, - SessionsForkParams: SessionsForkParamsSchema, - SessionsForkResult: SessionsForkResultSchema, - SessionBranch: SessionBranchSchema, - SessionsBranchesListParams: SessionsBranchesListParamsSchema, - SessionsBranchesListResult: SessionsBranchesListResultSchema, - SessionsBranchesSwitchParams: SessionsBranchesSwitchParamsSchema, - SessionsBranchesSwitchResult: SessionsBranchesSwitchResultSchema, - SessionFileBrowserEntry: SessionFileBrowserEntrySchema, - SessionFileBrowserResult: SessionFileBrowserResultSchema, - SessionFileKind: SessionFileKindSchema, - SessionFileEntry: SessionFileEntrySchema, - SessionFileRelevance: SessionFileRelevanceSchema, - SessionsFilesListParams: SessionsFilesListParamsSchema, - SessionsFilesListResult: SessionsFilesListResultSchema, - SessionsFilesGetParams: SessionsFilesGetParamsSchema, - SessionsFilesGetResult: SessionsFilesGetResultSchema, - SessionsFilesRevealParams: SessionsFilesRevealParamsSchema, - SessionsFilesRevealResult: SessionsFilesRevealResultSchema, - SessionsFilesSetParams: SessionsFilesSetParamsSchema, - SessionsFilesSetResult: SessionsFilesSetResultSchema, - SessionDiffFileStatus: SessionDiffFileStatusSchema, - SessionDiffFile: SessionDiffFileSchema, - SessionsDiffParams: SessionsDiffParamsSchema, - SessionsDiffResult: SessionsDiffResultSchema, - SessionWorktreeInfo: SessionWorktreeInfoSchema, - SessionsCreateParams: SessionsCreateParamsSchema, - SessionsCreateResult: SessionsCreateResultSchema, - SessionsSendParams: SessionsSendParamsSchema, - SessionsMessagesSubscribeParams: SessionsMessagesSubscribeParamsSchema, - SessionsMessagesUnsubscribeParams: SessionsMessagesUnsubscribeParamsSchema, - SessionsAbortParams: SessionsAbortParamsSchema, - SessionsPatchParams: SessionsPatchParamsSchema, - SessionsPluginPatchParams: SessionsPluginPatchParamsSchema, - SessionsPluginPatchResult: SessionsPluginPatchResultSchema, - SessionsResetParams: SessionsResetParamsSchema, - SessionsDeleteParams: SessionsDeleteParamsSchema, - SessionGroup: SessionGroupSchema, - SessionsGroupsListParams: SessionsGroupsListParamsSchema, - SessionsGroupsListResult: SessionsGroupsListResultSchema, - SessionsGroupsPutParams: SessionsGroupsPutParamsSchema, - SessionsGroupsRenameParams: SessionsGroupsRenameParamsSchema, - SessionsGroupsDeleteParams: SessionsGroupsDeleteParamsSchema, - SessionsGroupsMutationResult: SessionsGroupsMutationResultSchema, - SessionsCompactParams: SessionsCompactParamsSchema, - SessionsUsageParams: SessionsUsageParamsSchema, - - // Audit/task ledgers and config/wizard setup payloads. - AuditActivityAgentRunV1: AuditActivityAgentRunV1Schema, - AuditActivityToolActionV1: AuditActivityToolActionV1Schema, - AuditActivityInboundMessageV1: AuditActivityInboundMessageV1Schema, - AuditActivityOutboundMessageV1: AuditActivityOutboundMessageV1Schema, - AuditActivityEventV1: AuditActivityEventV1Schema, - AuditActivityListParams: AuditActivityListParamsSchema, - AuditActivityListResult: AuditActivityListResultSchema, - AuditEvent: AuditEventSchema, - AuditListParams: AuditListParamsSchema, - AuditListResult: AuditListResultSchema, - TaskSuggestion: TaskSuggestionSchema, - TaskSuggestionEvent: TaskSuggestionEventSchema, - TaskSuggestionResolution: TaskSuggestionResolutionSchema, - TaskSuggestionsAcceptParams: TaskSuggestionsAcceptParamsSchema, - TaskSuggestionsAcceptResult: TaskSuggestionsAcceptResultSchema, - TaskSuggestionsCreateParams: TaskSuggestionsCreateParamsSchema, - TaskSuggestionsCreateResult: TaskSuggestionsCreateResultSchema, - TaskSuggestionsDismissParams: TaskSuggestionsDismissParamsSchema, - TaskSuggestionsDismissResult: TaskSuggestionsDismissResultSchema, - TaskSuggestionsListParams: TaskSuggestionsListParamsSchema, - TaskSuggestionsListResult: TaskSuggestionsListResultSchema, - TaskSummary: TaskSummarySchema, - TasksListParams: TasksListParamsSchema, - TasksListResult: TasksListResultSchema, - TasksGetParams: TasksGetParamsSchema, - TasksGetResult: TasksGetResultSchema, - TasksCancelParams: TasksCancelParamsSchema, - TasksCancelResult: TasksCancelResultSchema, - ConfigGetParams: ConfigGetParamsSchema, - ConfigSetParams: ConfigSetParamsSchema, - ConfigApplyParams: ConfigApplyParamsSchema, - ConfigPatchParams: ConfigPatchParamsSchema, - ConfigSchemaParams: ConfigSchemaParamsSchema, - ConfigSchemaLookupParams: ConfigSchemaLookupParamsSchema, - ConfigSchemaResponse: ConfigSchemaResponseSchema, - ConfigSchemaLookupResult: ConfigSchemaLookupResultSchema, - SystemAgentChatParams: SystemAgentChatParamsSchema, - SystemAgentChatResult: SystemAgentChatResultSchema, - SystemAgentChatHistoryParams: SystemAgentChatHistoryParamsSchema, - SystemAgentChatHistoryTurn: SystemAgentChatHistoryTurnSchema, - SystemAgentChatHistoryResult: SystemAgentChatHistoryResultSchema, - SystemChangeEntry: SystemChangeEntrySchema, - SystemChangeKind: SystemChangeKindSchema, - SystemChangeSource: SystemChangeSourceSchema, - SystemChangesListParams: SystemChangesListParamsSchema, - SystemChangesListResult: SystemChangesListResultSchema, - SystemAgentSetupDetectParams: SystemAgentSetupDetectParamsSchema, - SystemAgentSetupDetectResult: SystemAgentSetupDetectResultSchema, - SystemAgentSetupVerifyParams: SystemAgentSetupVerifyParamsSchema, - SystemAgentSetupVerifyResult: SystemAgentSetupVerifyResultSchema, - SystemAgentSetupActivateParams: SystemAgentSetupActivateParamsSchema, - SystemAgentSetupActivateResult: SystemAgentSetupActivateResultSchema, - SystemAgentSetupAuthStartParams: SystemAgentSetupAuthStartParamsSchema, - SystemAgentSetupAuthStartResult: SystemAgentSetupAuthStartResultSchema, - WizardStartParams: WizardStartParamsSchema, - WizardNextParams: WizardNextParamsSchema, - WizardCancelParams: WizardCancelParamsSchema, - WizardStatusParams: WizardStatusParamsSchema, - WizardStep: WizardStepSchema, - WizardNextResult: WizardNextResultSchema, - WizardStartResult: WizardStartResultSchema, - WizardStatusResult: WizardStatusResultSchema, - - // Realtime Talk client/session events and channel control payloads. - TalkModeParams: TalkModeParamsSchema, - TalkEvent: TalkEventSchema, - TalkCatalogParams: TalkCatalogParamsSchema, - TalkCatalogResult: TalkCatalogResultSchema, - TalkClientCreateParams: TalkClientCreateParamsSchema, - TalkClientCreateResult: TalkClientCreateResultSchema, - TalkClientCloseParams: TalkClientCloseParamsSchema, - TalkClientMutationResult: TalkClientMutationResultSchema, - TalkClientSteerParams: TalkClientSteerParamsSchema, - TalkAgentControlResult: TalkAgentControlResultSchema, - TalkClientToolCallParams: TalkClientToolCallParamsSchema, - TalkClientToolCallResult: TalkClientToolCallResultSchema, - TalkClientTranscriptParams: TalkClientTranscriptParamsSchema, - TalkConfigParams: TalkConfigParamsSchema, - TalkConfigResult: TalkConfigResultSchema, - TalkSessionAppendAudioParams: TalkSessionAppendAudioParamsSchema, - TalkSessionAcknowledgeMarkParams: TalkSessionAcknowledgeMarkParamsSchema, - TalkSessionCancelOutputParams: TalkSessionCancelOutputParamsSchema, - TalkSessionCancelTurnParams: TalkSessionCancelTurnParamsSchema, - TalkSessionCreateParams: TalkSessionCreateParamsSchema, - TalkSessionCreateResult: TalkSessionCreateResultSchema, - TalkSessionJoinParams: TalkSessionJoinParamsSchema, - TalkSessionJoinResult: TalkSessionJoinResultSchema, - TalkSessionTurnParams: TalkSessionTurnParamsSchema, - TalkSessionTurnResult: TalkSessionTurnResultSchema, - TalkSessionSteerParams: TalkSessionSteerParamsSchema, - TalkSessionSubmitToolResultParams: TalkSessionSubmitToolResultParamsSchema, - TalkSessionCloseParams: TalkSessionCloseParamsSchema, - TalkSessionOkResult: TalkSessionOkResultSchema, - TalkSpeakParams: TalkSpeakParamsSchema, - TalkSpeakResult: TalkSpeakResultSchema, - TtsSpeakParams: TtsSpeakParamsSchema, - TtsSpeakResult: TtsSpeakResultSchema, - ChannelsStatusParams: ChannelsStatusParamsSchema, - ChannelsStatusResult: ChannelsStatusResultSchema, - ChannelsPairingListParams: ChannelsPairingListParamsSchema, - ChannelsPairingListResult: ChannelsPairingListResultSchema, - ChannelsPairingApproveParams: ChannelsPairingApproveParamsSchema, - ChannelsPairingApproveResult: ChannelsPairingApproveResultSchema, - ChannelsPairingDismissParams: ChannelsPairingDismissParamsSchema, - ChannelsPairingDismissResult: ChannelsPairingDismissResultSchema, - ChannelsStartParams: ChannelsStartParamsSchema, - ChannelsStopParams: ChannelsStopParamsSchema, - ChannelsLogoutParams: ChannelsLogoutParamsSchema, - WebLoginStartParams: WebLoginStartParamsSchema, - WebLoginWaitParams: WebLoginWaitParamsSchema, - - // Agent files, artifacts, model catalogs, commands, tools, and skill workshop. - AgentKind: AgentKindSchema, - AgentSummary: AgentSummarySchema, - AgentsCreateParams: AgentsCreateParamsSchema, - AgentsCreateResult: AgentsCreateResultSchema, - AgentsUpdateParams: AgentsUpdateParamsSchema, - AgentsUpdateResult: AgentsUpdateResultSchema, - AgentsDeleteParams: AgentsDeleteParamsSchema, - AgentsDeleteResult: AgentsDeleteResultSchema, - AgentsFileEntry: AgentsFileEntrySchema, - AgentsFilesListParams: AgentsFilesListParamsSchema, - AgentsFilesListResult: AgentsFilesListResultSchema, - AgentsFilesGetParams: AgentsFilesGetParamsSchema, - AgentsFilesGetResult: AgentsFilesGetResultSchema, - AgentsFilesSetParams: AgentsFilesSetParamsSchema, - AgentsFilesSetResult: AgentsFilesSetResultSchema, - AgentsWorkspaceEntry: AgentsWorkspaceEntrySchema, - AgentsWorkspaceFile: AgentsWorkspaceFileSchema, - AgentsWorkspaceListParams: AgentsWorkspaceListParamsSchema, - AgentsWorkspaceListResult: AgentsWorkspaceListResultSchema, - AgentsWorkspaceGetParams: AgentsWorkspaceGetParamsSchema, - AgentsWorkspaceGetResult: AgentsWorkspaceGetResultSchema, - ArtifactSummary: ArtifactSummarySchema, - ArtifactsListParams: ArtifactsListParamsSchema, - ArtifactsListResult: ArtifactsListResultSchema, - ArtifactsGetParams: ArtifactsGetParamsSchema, - ArtifactsGetResult: ArtifactsGetResultSchema, - ArtifactsDownloadParams: ArtifactsDownloadParamsSchema, - ArtifactsDownloadResult: ArtifactsDownloadResultSchema, - AgentsListParams: AgentsListParamsSchema, - AgentsListResult: AgentsListResultSchema, - ModelChoice: ModelChoiceSchema, - ModelsAuthLogoutParams: ModelsAuthLogoutParamsSchema, - ModelsAuthStatusParams: ModelsAuthStatusParamsSchema, - ModelsListParams: ModelsListParamsSchema, - ModelsListResult: ModelsListResultSchema, - ModelsProbeParams: ModelsProbeParamsSchema, - ModelsProbeTargetResult: ModelsProbeTargetResultSchema, - ModelsProbeResult: ModelsProbeResultSchema, - CommandEntry: CommandEntrySchema, - CommandsListParams: CommandsListParamsSchema, - CommandsListResult: CommandsListResultSchema, - SkillsStatusParams: SkillsStatusParamsSchema, - ToolsCatalogParams: ToolsCatalogParamsSchema, - ToolCatalogProfile: ToolCatalogProfileSchema, - ToolCatalogEntry: ToolCatalogEntrySchema, - ToolCatalogGroup: ToolCatalogGroupSchema, - ToolsCatalogResult: ToolsCatalogResultSchema, - ToolsEffectiveParams: ToolsEffectiveParamsSchema, - ToolsEffectiveEntry: ToolsEffectiveEntrySchema, - ToolsEffectiveGroup: ToolsEffectiveGroupSchema, - ToolsEffectiveNotice: ToolsEffectiveNoticeSchema, - ToolsEffectiveResult: ToolsEffectiveResultSchema, - ToolsInvokeParams: ToolsInvokeParamsSchema, - ToolsInvokeError: ToolsInvokeErrorSchema, - ToolsInvokeResult: ToolsInvokeResultSchema, - SkillsBinsParams: SkillsBinsParamsSchema, - SkillsBinsResult: SkillsBinsResultSchema, - SkillsSearchParams: SkillsSearchParamsSchema, - SkillsSearchResult: SkillsSearchResultSchema, - SkillsDetailParams: SkillsDetailParamsSchema, - SkillsDetailResult: SkillsDetailResultSchema, - SkillsCuratorActionParams: SkillsCuratorActionParamsSchema, - SkillsCuratorActionResult: SkillsCuratorActionResultSchema, - SkillsCuratorStatusParams: SkillsCuratorStatusParamsSchema, - SkillsCuratorStatusResult: SkillsCuratorStatusResultSchema, - ...SkillWorkshopProtocolSchemas, - SkillsProposalInspectParams: SkillsProposalInspectParamsSchema, - SkillsProposalInspectResult: SkillsProposalInspectResultSchema, - SkillsProposalCreateParams: SkillsProposalCreateParamsSchema, - SkillsProposalUpdateParams: SkillsProposalUpdateParamsSchema, - SkillsProposalReviseParams: SkillsProposalReviseParamsSchema, - SkillsProposalRequestRevisionParams: SkillsProposalRequestRevisionParamsSchema, - SkillsProposalRequestRevisionResult: SkillsProposalRequestRevisionResultSchema, - SkillsProposalActionParams: SkillsProposalActionParamsSchema, - SkillsProposalApplyResult: SkillsProposalApplyResultSchema, - SkillsProposalRecordResult: SkillsProposalRecordResultSchema, - SkillsSecurityVerdictsParams: SkillsSecurityVerdictsParamsSchema, - SkillsSecurityVerdictsResult: SkillsSecurityVerdictsResultSchema, - SkillsSkillCardParams: SkillsSkillCardParamsSchema, - SkillsSkillCardResult: SkillsSkillCardResultSchema, - SkillsUploadBeginParams: SkillsUploadBeginParamsSchema, - SkillsUploadChunkParams: SkillsUploadChunkParamsSchema, - SkillsUploadCommitParams: SkillsUploadCommitParamsSchema, - SkillsInstallParams: SkillsInstallParamsSchema, - SkillsUpdateParams: SkillsUpdateParamsSchema, - // Scheduler, logs, approval, plugin control, device, chat, and lifecycle events. - CronJob: CronJobSchema, - CronListParams: CronListParamsSchema, - CronStatusParams: CronStatusParamsSchema, - CronGetParams: CronGetParamsSchema, - CronAddParams: CronAddParamsSchema, - CronAddResult: CronAddResultSchema, - CronDeclarativeAddResult: CronDeclarativeAddResultSchema, - CronUpdateParams: CronUpdateParamsSchema, - CronRemoveParams: CronRemoveParamsSchema, - CronRunParams: CronRunParamsSchema, - CronRunsParams: CronRunsParamsSchema, - CronScratchGetParams: CronScratchGetParamsSchema, - CronScratchGetResult: CronScratchGetResultSchema, - CronScratchSetParams: CronScratchSetParamsSchema, - CronScratchSetResult: CronScratchSetResultSchema, - CronRunLogEntry: CronRunLogEntrySchema, - ...LogMigrationProtocolSchemas, - ...TerminalProtocolSchemas, - ApprovalKind: ApprovalKindSchema, - ApprovalDecision: ApprovalDecisionSchema, - ApprovalAllowDecision: ApprovalAllowDecisionSchema, - ApprovalAllowedReason: ApprovalAllowedReasonSchema, - ApprovalDeniedReason: ApprovalDeniedReasonSchema, - ApprovalExpiredReason: ApprovalExpiredReasonSchema, - ApprovalCancelledReason: ApprovalCancelledReasonSchema, - PluginApprovalSeverity: PluginApprovalSeveritySchema, - ExecApprovalPresentation: ExecApprovalPresentationSchema, - PluginApprovalPresentation: PluginApprovalPresentationSchema, - SystemAgentApprovalPresentation: SystemAgentApprovalPresentationSchema, - ApprovalPresentation: ApprovalPresentationSchema, - PendingApprovalSnapshot: PendingApprovalSnapshotSchema, - AllowedApprovalSnapshot: AllowedApprovalSnapshotSchema, - DeniedApprovalSnapshot: DeniedApprovalSnapshotSchema, - ExpiredApprovalSnapshot: ExpiredApprovalSnapshotSchema, - CancelledApprovalSnapshot: CancelledApprovalSnapshotSchema, - ApprovalSnapshot: ApprovalSnapshotSchema, - ApprovalTerminalReason: ApprovalTerminalReasonSchema, - TerminalApprovalSnapshot: TerminalApprovalSnapshotSchema, - ApprovalGetParams: ApprovalGetParamsSchema, - ApprovalGetResult: ApprovalGetResultSchema, - ApprovalHistoryParams: ApprovalHistoryParamsSchema, - ApprovalHistoryResult: ApprovalHistoryResultSchema, - ApprovalResolveParams: ApprovalResolveParamsSchema, - ApprovalResolveResult: ApprovalResolveResultSchema, - PendingSessionApprovalEvent: PendingSessionApprovalEventSchema, - TerminalSessionApprovalEvent: TerminalSessionApprovalEventSchema, - SessionApprovalEvent: SessionApprovalEventSchema, - SessionApprovalReplay: SessionApprovalReplaySchema, - ExecApprovalsGetParams: ExecApprovalsGetParamsSchema, - ExecApprovalsSetParams: ExecApprovalsSetParamsSchema, - ExecApprovalsNodeGetParams: ExecApprovalsNodeGetParamsSchema, - ExecApprovalsNodeSnapshot: ExecApprovalsNodeSnapshotSchema, - ExecApprovalsNodeSetParams: ExecApprovalsNodeSetParamsSchema, - ExecApprovalsSnapshot: ExecApprovalsSnapshotSchema, - ExecApprovalGetParams: ExecApprovalGetParamsSchema, - ExecApprovalRequestParams: ExecApprovalRequestParamsSchema, - ExecApprovalResolveParams: ExecApprovalResolveParamsSchema, - QuestionOption: QuestionOptionSchema, - Question: QuestionSchema, - QuestionRequestQuestion: QuestionRequestQuestionSchema, - QuestionAnswers: QuestionAnswersSchema, - QuestionStatus: QuestionStatusSchema, - QuestionRecord: QuestionRecordSchema, - QuestionRequestParams: QuestionRequestParamsSchema, - QuestionRequestResult: QuestionRequestResultSchema, - QuestionWaitAnswerParams: QuestionWaitAnswerParamsSchema, - QuestionWaitAnswerResult: QuestionWaitAnswerResultSchema, - QuestionResolveParams: QuestionResolveParamsSchema, - QuestionResolveResult: QuestionResolveResultSchema, - QuestionGetParams: QuestionGetParamsSchema, - QuestionGetResult: QuestionGetResultSchema, - QuestionListParams: QuestionListParamsSchema, - QuestionListResult: QuestionListResultSchema, - // QuestionRequestedEvent is a TS-only alias of QuestionRecord; registering both - // names makes native codegen reference a type it never emits. - QuestionResolvedEvent: QuestionResolvedEventSchema, - PluginApprovalRequestParams: PluginApprovalRequestParamsSchema, - PluginApprovalResolveParams: PluginApprovalResolveParamsSchema, - PluginCatalogClawHubInstall: PluginCatalogClawHubInstallSchema, - PluginCatalogEntry: PluginCatalogEntrySchema, - PluginCatalogInstallAction: PluginCatalogInstallActionSchema, - PluginCatalogOfficialInstall: PluginCatalogOfficialInstallSchema, - PluginControlUiDescriptor: PluginControlUiDescriptorSchema, - PluginSearchPackage: PluginSearchPackageSchema, - PluginSearchResultEntry: PluginSearchResultEntrySchema, - PluginsInstallParams: PluginsInstallParamsSchema, - PluginsInstallResult: PluginsInstallResultSchema, - PluginsListParams: PluginsListParamsSchema, - PluginsListResult: PluginsListResultSchema, - PluginsRefreshParams: PluginsRefreshParamsSchema, - PluginsRefreshResult: PluginsRefreshResultSchema, - PluginsSearchParams: PluginsSearchParamsSchema, - PluginsSearchResult: PluginsSearchResultSchema, - PluginsSessionActionFailureResult: PluginsSessionActionFailureResultSchema, - PluginsSessionActionParams: PluginsSessionActionParamsSchema, - PluginsSessionActionResult: PluginsSessionActionResultSchema, - PluginsSessionActionSuccessResult: PluginsSessionActionSuccessResultSchema, - PluginsSetEnabledParams: PluginsSetEnabledParamsSchema, - PluginsSetEnabledResult: PluginsSetEnabledResultSchema, - PluginsUiDescriptorsParams: PluginsUiDescriptorsParamsSchema, - PluginsUiDescriptorsResult: PluginsUiDescriptorsResultSchema, - PluginsUninstallParams: PluginsUninstallParamsSchema, - PluginsUninstallResult: PluginsUninstallResultSchema, - DevicePairListParams: DevicePairListParamsSchema, - DevicePairApproveParams: DevicePairApproveParamsSchema, - DevicePairRejectParams: DevicePairRejectParamsSchema, - DevicePairRemoveParams: DevicePairRemoveParamsSchema, - DevicePairSetupCodeParams: DevicePairSetupCodeParamsSchema, - DevicePairSetupCodeResult: DevicePairSetupCodeResultSchema, - DevicePairRenameParams: DevicePairRenameParamsSchema, - DeviceTokenRotateParams: DeviceTokenRotateParamsSchema, - DeviceTokenRevokeParams: DeviceTokenRevokeParamsSchema, - DevicePairRequestedEvent: DevicePairRequestedEventSchema, - DevicePairResolvedEvent: DevicePairResolvedEventSchema, - ChatHistoryParams: ChatHistoryParamsSchema, - ChatMetadataParams: ChatMetadataParamsSchema, - ChatMessageGetParams: ChatMessageGetParamsSchema, - ChatMessageGetResult: ChatMessageGetResultSchema, - ChatToolTitlesParams: ChatToolTitlesParamsSchema, - ChatToolTitlesResult: ChatToolTitlesResultSchema, - ChatSendParams: ChatSendParamsSchema, - ChatAbortParams: ChatAbortParamsSchema, - ChatInjectParams: ChatInjectParamsSchema, - ChatRunStartupPhase: ChatRunStartupPhaseSchema, - ChatStatusEvent: ChatStatusEventSchema, - ChatDeltaEvent: ChatDeltaEventSchema, - ChatFinalEvent: ChatFinalEventSchema, - ChatAbortedEvent: ChatAbortedEventSchema, - ChatErrorEvent: ChatErrorEventSchema, - ChatEvent: ChatEventSchema, - UpdateStatusParams: UpdateStatusParamsSchema, - UpdateRunParams: UpdateRunParamsSchema, - TickEvent: TickEventSchema, - ShutdownEvent: ShutdownEventSchema, -} satisfies Record; export { MIN_CLIENT_PROTOCOL_VERSION, MIN_NODE_PROTOCOL_VERSION, MIN_PROBE_PROTOCOL_VERSION, PROTOCOL_VERSION, } from "../version.js"; -/* oxlint-disable max-lines -- TODO: split this grandfathered oversized file. */ diff --git a/packages/gateway-protocol/src/validator-registry.ts b/packages/gateway-protocol/src/validator-registry.ts index fc9352705673..7ce367c1ad60 100644 --- a/packages/gateway-protocol/src/validator-registry.ts +++ b/packages/gateway-protocol/src/validator-registry.ts @@ -300,7 +300,7 @@ import { UiCommandParamsSchema, WebLoginStartParamsSchema, WebLoginWaitParamsSchema, -} from "./schema.js"; +} from "./schema-modules.js"; import type { ValidationError } from "./validation-errors.js"; // Validator names mirror schemas so callers can pair them with wire contracts. diff --git a/scripts/check-protocol-registry.mjs b/scripts/check-protocol-registry.mjs new file mode 100644 index 000000000000..c478320944ed --- /dev/null +++ b/scripts/check-protocol-registry.mjs @@ -0,0 +1,154 @@ +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath, pathToFileURL } from "node:url"; + +const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); +const schemaDir = path.join(repoRoot, "packages/gateway-protocol/src/schema"); +const failures = []; +const read = (relativePath) => fs.readFileSync(path.join(repoRoot, relativePath), "utf8"); +const check = (condition, message) => { + if (!condition) { + failures.push(message); + } +}; + +const registryPath = "packages/gateway-protocol/src/schema/protocol-schemas.ts"; +const registrySource = read(registryPath); +const fragmentImports = [ + ...registrySource.matchAll( + /^import \{ ([A-Za-z0-9_]+) \} from "(\.\/protocol-schema-fragment-[^"]+\.js)";$/gmu, + ), +].map((match) => ({ binding: match[1], specifier: match[2] })); +const importSpecifiers = [...registrySource.matchAll(/^import .* from "([^"]+)";$/gmu)].map( + (match) => match[1], +); +check( + importSpecifiers.every( + (specifier) => + specifier === "./protocol-schema-composer.js" || + specifier.startsWith("./protocol-schema-fragment-"), + ), + `${registryPath} may import only the composer and schema fragments`, +); +check( + !/\b[A-Z][A-Za-z0-9]*Schema\b/u.test(registrySource), + `${registryPath} contains a direct *Schema inventory`, +); + +const composition = registrySource.match( + /export const ProtocolSchemas = composeProtocolSchemaFragments\(\[([\s\S]*?)\]\s+as const\);/u, +); +const composedBindings = (composition?.[1] ?? "") + .split("\n") + .map((line) => line.trim().replace(/,$/u, "")) + .filter(Boolean); +const importedBindings = fragmentImports.map(({ binding }) => binding); +check(Boolean(composition), `${registryPath} must explicitly compose an ordered fragment array`); +check( + composedBindings.length === importedBindings.length && + new Set(composedBindings).size === composedBindings.length && + importedBindings.every((binding) => composedBindings.includes(binding)), + `${registryPath} must compose every imported fragment exactly once`, +); + +const fragmentFiles = fs + .readdirSync(schemaDir) + .filter((name) => /^protocol-schema-fragment-.+\.ts$/u.test(name)); +const importedFiles = fragmentImports.map(({ specifier }) => `${specifier.slice(2, -3)}.ts`); +check( + fragmentFiles.length === importedFiles.length && + fragmentFiles.every((name) => importedFiles.includes(name)), + `${registryPath} must explicitly import every protocol schema fragment`, +); + +const importsByBinding = new Map( + fragmentImports.map((fragmentImport) => [fragmentImport.binding, fragmentImport]), +); +const seenKeys = new Set(); +const orderedKeys = []; +for (const binding of composedBindings) { + const { specifier } = importsByBinding.get(binding) ?? {}; + if (!specifier) { + continue; + } + const moduleUrl = new URL(specifier.replace(/\.js$/u, ".ts"), pathToFileURL(registryPath)); + const fragment = (await import(moduleUrl.href))[binding]; + check(fragment && typeof fragment === "object", `${specifier} must export object ${binding}`); + if (!fragment || typeof fragment !== "object") { + continue; + } + for (const key of Object.keys(fragment)) { + check(!seenKeys.has(key), `duplicate protocol schema key ${key}`); + seenKeys.add(key); + orderedKeys.push(key); + } +} +const { ProtocolSchemas } = await import( + pathToFileURL(path.join(schemaDir, "protocol-schemas.ts")) +); +check( + JSON.stringify(Object.keys(ProtocolSchemas)) === JSON.stringify(orderedKeys), + "ProtocolSchemas must preserve explicit fragment/key order", +); + +const composerSource = read("packages/gateway-protocol/src/schema/protocol-schema-composer.ts"); +check(!/\.(?:sort|toSorted)\s*\(/u.test(composerSource), "schema composer must not sort"); +check( + composerSource.includes("Object.hasOwn(registry, key)"), + "schema composer must reject duplicate fragment keys", +); + +const withoutComments = (source) => + source + .replace(/\r\n?/gu, "\n") + .replace(/\/\*[\s\S]*?\*\//gu, "") + .replace(/^\s*\/\/.*$/gmu, "") + .trim(); +const schemaModulesSource = withoutComments( + read("packages/gateway-protocol/src/schema-modules.ts"), +); +const ownerModules = [ + ...schemaModulesSource.matchAll(/^export \* from "\.\/schema\/([^"]+)\.js";$/gmu), +].map((match) => match[1]); +check( + ownerModules.length === 51 && new Set(ownerModules).size === ownerModules.length, + "schema-modules.ts must contain one unique 51-module owner list", +); +check( + schemaModulesSource.split("\n").filter(Boolean).length === ownerModules.length, + "schema-modules.ts may contain only owner-module exports", +); +check( + withoutComments(read("packages/gateway-protocol/src/schema.ts")) === + 'export * from "./schema-modules.js";\nexport * from "./schema/protocol-schemas.js";', + "schema.ts must remain a schema-modules/protocol-schemas wrapper", +); +check( + withoutComments(read("packages/gateway-protocol/src/schema-types.ts")) === + 'export type * from "./schema-modules.js";', + "schema-types.ts must remain a registry-free schema-modules wrapper", +); + +for (const relativePath of [ + "packages/gateway-protocol/src/index.ts", + "packages/gateway-protocol/src/schema-export-registry.ts", + "packages/gateway-protocol/src/validator-registry.ts", +]) { + check( + !read(relativePath).includes('from "./schema.js"'), + `${relativePath} must not cross the registry through schema.ts`, + ); +} +const pluginSdkGuard = read("scripts/check-plugin-sdk-exports.mjs"); +check( + pluginSdkGuard.includes("FORBIDDEN_PUBLIC_PROTOCOL_REGISTRY_RE") && + pluginSdkGuard.includes("FORBIDDEN PUBLIC DTS REGISTRY"), + "plugin SDK declaration checks must reject leaked ProtocolSchemas declarations", +); + +if (failures.length) { + throw new Error( + failures.map((failure) => `protocol registry check failed: ${failure}`).join("\n"), + ); +} +console.log("protocol registry check passed"); diff --git a/scripts/protocol-gen-kotlin.ts b/scripts/protocol-gen-kotlin.ts index b94202a5d06a..bf446512ac40 100644 --- a/scripts/protocol-gen-kotlin.ts +++ b/scripts/protocol-gen-kotlin.ts @@ -2,11 +2,11 @@ import { promises as fs } from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; +import { ProtocolSchemas } from "../packages/gateway-protocol/src/schema/protocol-schemas.js"; import { MIN_NODE_PROTOCOL_VERSION, PROTOCOL_VERSION, - ProtocolSchemas, -} from "../packages/gateway-protocol/src/schema.js"; +} from "../packages/gateway-protocol/src/version.js"; import { listCoreGatewayMethodNames } from "../src/gateway/methods/core-descriptors.js"; import { extractGatewayEventNames } from "./check-protocol-event-coverage.mjs"; diff --git a/scripts/protocol-gen-swift.ts b/scripts/protocol-gen-swift.ts index aa0698b72c8c..9105529ae35a 100644 --- a/scripts/protocol-gen-swift.ts +++ b/scripts/protocol-gen-swift.ts @@ -2,13 +2,13 @@ import { promises as fs } from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; +import { ErrorCodes } from "../packages/gateway-protocol/src/schema/error-codes.js"; +import { ProtocolSchemas } from "../packages/gateway-protocol/src/schema/protocol-schemas.js"; import { - ErrorCodes, MIN_CLIENT_PROTOCOL_VERSION, MIN_NODE_PROTOCOL_VERSION, PROTOCOL_VERSION, - ProtocolSchemas, -} from "../packages/gateway-protocol/src/schema.js"; +} from "../packages/gateway-protocol/src/version.js"; type JsonSchema = { type?: string | string[]; diff --git a/scripts/protocol-gen.ts b/scripts/protocol-gen.ts index a9b228fec892..3bcbc91e6039 100644 --- a/scripts/protocol-gen.ts +++ b/scripts/protocol-gen.ts @@ -2,7 +2,7 @@ import { promises as fs } from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; -import { ProtocolSchemas } from "../packages/gateway-protocol/src/schema.js"; +import { ProtocolSchemas } from "../packages/gateway-protocol/src/schema/protocol-schemas.js"; import { listCoreGatewayMethodMetadata } from "../src/gateway/methods/core-descriptors.js"; const scriptDir = path.dirname(fileURLToPath(import.meta.url));