mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
refactor(gateway-protocol): derive schema registries from owner fragments (#114817)
* refactor(protocol): share schema owner barrel * refactor(protocol): extract ordered schema fragments * refactor(protocol): compose public schema registry * docs(protocol): document schema fragments * ci(protocol): guard schema registry structure * style(protocol): satisfy registry guard lint
This commit is contained in:
committed by
GitHub
parent
b2f137797b
commit
d5e46646f2
@@ -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
|
||||
|
||||
@@ -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<typeof SystemEchoParamsSchema>;
|
||||
export type SystemEchoResult = Static<typeof SystemEchoResultSchema>;
|
||||
@@ -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`.
|
||||
|
||||
+2
-1
@@ -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",
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
import type { TSchema } from "typebox";
|
||||
|
||||
type ProtocolSchemaFragment = Readonly<Record<string, TSchema>>;
|
||||
type UnionToIntersection<Value> = (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<Fragments[number]> {
|
||||
const registry: Record<string, TSchema> = {};
|
||||
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<Fragments[number]>;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
+41
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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.
|
||||
|
||||
@@ -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");
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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[];
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user