@aria-cli/tools 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -5
- package/src/__tests__/web-fetch-download.test.ts +0 -433
- package/src/__tests__/web-tools.test.ts +0 -619
- package/src/ask-user-interaction.ts +0 -33
- package/src/cache/web-cache.ts +0 -110
- package/src/definitions/arion.ts +0 -118
- package/src/definitions/browser/browser.ts +0 -502
- package/src/definitions/browser/index.ts +0 -5
- package/src/definitions/browser/pw-downloads.ts +0 -142
- package/src/definitions/browser/pw-interactions.ts +0 -282
- package/src/definitions/browser/pw-responses.ts +0 -98
- package/src/definitions/browser/pw-session.ts +0 -405
- package/src/definitions/browser/pw-shared.ts +0 -85
- package/src/definitions/browser/pw-snapshot.ts +0 -383
- package/src/definitions/browser/pw-state.ts +0 -101
- package/src/definitions/browser/types.ts +0 -203
- package/src/definitions/code-intelligence.ts +0 -526
- package/src/definitions/core.ts +0 -118
- package/src/definitions/delegation.ts +0 -567
- package/src/definitions/deploy.ts +0 -73
- package/src/definitions/filesystem.ts +0 -217
- package/src/definitions/frg.ts +0 -67
- package/src/definitions/index.ts +0 -28
- package/src/definitions/memory.ts +0 -150
- package/src/definitions/messaging.ts +0 -734
- package/src/definitions/meta.ts +0 -392
- package/src/definitions/network.ts +0 -179
- package/src/definitions/outlook.ts +0 -318
- package/src/definitions/patch/apply-patch.ts +0 -235
- package/src/definitions/patch/fuzzy-match.ts +0 -217
- package/src/definitions/patch/index.ts +0 -1
- package/src/definitions/patch/patch-parser.ts +0 -297
- package/src/definitions/patch/sandbox-paths.ts +0 -129
- package/src/definitions/process/index.ts +0 -5
- package/src/definitions/process/process-registry.ts +0 -303
- package/src/definitions/process/process.ts +0 -456
- package/src/definitions/process/pty-keys.ts +0 -298
- package/src/definitions/process/session-slug.ts +0 -147
- package/src/definitions/quip.ts +0 -225
- package/src/definitions/search.ts +0 -67
- package/src/definitions/session-history.ts +0 -79
- package/src/definitions/shell.ts +0 -202
- package/src/definitions/slack.ts +0 -211
- package/src/definitions/web.ts +0 -119
- package/src/executors/apply-patch.ts +0 -1035
- package/src/executors/arion.ts +0 -199
- package/src/executors/code-intelligence.ts +0 -1179
- package/src/executors/deploy.ts +0 -1066
- package/src/executors/filesystem.ts +0 -1428
- package/src/executors/frg-freshness.ts +0 -743
- package/src/executors/frg.ts +0 -394
- package/src/executors/index.ts +0 -280
- package/src/executors/learning-meta.ts +0 -1367
- package/src/executors/lsp-client.ts +0 -355
- package/src/executors/memory.ts +0 -978
- package/src/executors/meta.ts +0 -293
- package/src/executors/process-registry.ts +0 -570
- package/src/executors/pty-session-store.ts +0 -43
- package/src/executors/pty.ts +0 -342
- package/src/executors/restart.ts +0 -133
- package/src/executors/search-freshness.ts +0 -249
- package/src/executors/search-types.ts +0 -98
- package/src/executors/search.ts +0 -89
- package/src/executors/self-diagnose.ts +0 -552
- package/src/executors/session-history.ts +0 -435
- package/src/executors/shell-safety.ts +0 -519
- package/src/executors/shell.ts +0 -1243
- package/src/executors/utils.ts +0 -40
- package/src/executors/web.ts +0 -786
- package/src/extraction/content-extraction.ts +0 -281
- package/src/extraction/index.ts +0 -5
- package/src/headless-control-contract.ts +0 -1149
- package/src/index.ts +0 -788
- package/src/local-control-http-auth.ts +0 -2
- package/src/mcp/client.ts +0 -218
- package/src/mcp/connection.ts +0 -568
- package/src/mcp/index.ts +0 -11
- package/src/mcp/jsonrpc.ts +0 -195
- package/src/mcp/types.ts +0 -199
- package/src/network-control-adapter.ts +0 -88
- package/src/network-runtime/address-types.ts +0 -218
- package/src/network-runtime/db-owner-fencing.ts +0 -91
- package/src/network-runtime/delivery-receipts.ts +0 -372
- package/src/network-runtime/direct-endpoint-authority.ts +0 -35
- package/src/network-runtime/index.ts +0 -316
- package/src/network-runtime/local-control-contract.ts +0 -784
- package/src/network-runtime/node-store-contract.ts +0 -46
- package/src/network-runtime/pair-route-contract.ts +0 -97
- package/src/network-runtime/peer-capabilities.ts +0 -48
- package/src/network-runtime/peer-principal-ref.ts +0 -20
- package/src/network-runtime/peer-state-machine.ts +0 -160
- package/src/network-runtime/protocol-schemas.ts +0 -265
- package/src/network-runtime/runtime-bootstrap-contract.ts +0 -83
- package/src/outlook/desktop-session.ts +0 -409
- package/src/policy.ts +0 -171
- package/src/providers/brave.ts +0 -80
- package/src/providers/duckduckgo.ts +0 -199
- package/src/providers/exa.ts +0 -85
- package/src/providers/firecrawl.ts +0 -77
- package/src/providers/index.ts +0 -8
- package/src/providers/jina.ts +0 -70
- package/src/providers/router.ts +0 -121
- package/src/providers/search-provider.ts +0 -74
- package/src/providers/tavily.ts +0 -74
- package/src/quip/desktop-session.ts +0 -435
- package/src/registry/index.ts +0 -1
- package/src/registry/registry.ts +0 -905
- package/src/runtime-socket-local-control-client.ts +0 -632
- package/src/security/dns-normalization.ts +0 -34
- package/src/security/dns-pinning.ts +0 -138
- package/src/security/external-content.ts +0 -129
- package/src/security/ssrf.ts +0 -207
- package/src/slack/desktop-session.ts +0 -493
- package/src/tool-factory.ts +0 -91
- package/src/types.ts +0 -1341
- package/src/utils/retry.ts +0 -163
- package/src/utils/safe-parse-json.ts +0 -176
- package/src/utils/url.ts +0 -20
- package/tests/benchmarks/registry.bench.ts +0 -57
- package/tests/cache/web-cache.test.ts +0 -147
- package/tests/critical-integration.test.ts +0 -1465
- package/tests/definitions/apply-patch.test.ts +0 -586
- package/tests/definitions/browser.test.ts +0 -495
- package/tests/definitions/delegation-pause-resume.test.ts +0 -758
- package/tests/definitions/execution.test.ts +0 -671
- package/tests/definitions/messaging-inbox-scope.test.ts +0 -229
- package/tests/definitions/messaging.test.ts +0 -1468
- package/tests/definitions/outlook.test.ts +0 -30
- package/tests/definitions/process.test.ts +0 -469
- package/tests/definitions/slack.test.ts +0 -28
- package/tests/definitions/tool-inventory.test.ts +0 -218
- package/tests/e2e/delegation-quest-orchestration.e2e.test.ts +0 -433
- package/tests/e2e/memory-tool-discovery-contract.e2e.test.ts +0 -81
- package/tests/executors/apply-patch.test.ts +0 -538
- package/tests/executors/arion.test.ts +0 -309
- package/tests/executors/conversation-primitives.test.ts +0 -250
- package/tests/executors/deploy.test.ts +0 -746
- package/tests/executors/filesystem-tools.test.ts +0 -357
- package/tests/executors/filesystem.test.ts +0 -959
- package/tests/executors/frg-freshness.test.ts +0 -136
- package/tests/executors/frg-merge.test.ts +0 -70
- package/tests/executors/frg-session-content.test.ts +0 -40
- package/tests/executors/frg.test.ts +0 -56
- package/tests/executors/memory-bugfixes.test.ts +0 -257
- package/tests/executors/memory-real-memoria.integration.test.ts +0 -316
- package/tests/executors/memory.test.ts +0 -853
- package/tests/executors/meta-tools.test.ts +0 -411
- package/tests/executors/meta.test.ts +0 -683
- package/tests/executors/path-containment.test.ts +0 -51
- package/tests/executors/process-registry.test.ts +0 -505
- package/tests/executors/pty.test.ts +0 -664
- package/tests/executors/quest-security.test.ts +0 -249
- package/tests/executors/read-file-media.test.ts +0 -230
- package/tests/executors/recall-knowledge-schema.test.ts +0 -209
- package/tests/executors/recall-tags.test.ts +0 -278
- package/tests/executors/remember-null-safety.contract.test.ts +0 -41
- package/tests/executors/restart.test.ts +0 -67
- package/tests/executors/search-unified.test.ts +0 -381
- package/tests/executors/session-history.test.ts +0 -340
- package/tests/executors/session-transcript.test.ts +0 -561
- package/tests/executors/shell-abort.test.ts +0 -416
- package/tests/executors/shell-env-blocklist.test.ts +0 -648
- package/tests/executors/shell-env-process.test.ts +0 -245
- package/tests/executors/shell-process-registry.test.ts +0 -334
- package/tests/executors/shell-tools.test.ts +0 -393
- package/tests/executors/shell.test.ts +0 -690
- package/tests/executors/web-abort-vs-timeout.test.ts +0 -213
- package/tests/executors/web-integration.test.ts +0 -633
- package/tests/executors/web-symlink.test.ts +0 -18
- package/tests/executors/web.test.ts +0 -1400
- package/tests/executors/write-stdin.test.ts +0 -145
- package/tests/extraction/content-extraction.test.ts +0 -153
- package/tests/guards/tools-default-test-lane.integration.test.ts +0 -21
- package/tests/guards/tools-package-test-commands.e2e.test.ts +0 -43
- package/tests/guards/tools-test-lane-manifest.contract.test.ts +0 -76
- package/tests/guards/tools-vitest-workspace-alias.contract.test.ts +0 -63
- package/tests/helpers/async-waits.ts +0 -53
- package/tests/integration/headless-control-contract.integration.test.ts +0 -153
- package/tests/integration/memory-tool-schema-parity.integration.test.ts +0 -67
- package/tests/integration/meta-tools-round-trip.integration.test.ts +0 -506
- package/tests/integration/quest-round-trip.test.ts +0 -303
- package/tests/integration/registry-executor-flow.test.ts +0 -85
- package/tests/integration.test.ts +0 -177
- package/tests/loading-tier.test.ts +0 -126
- package/tests/mcp/client-reconnect.test.ts +0 -267
- package/tests/mcp/connection.test.ts +0 -846
- package/tests/mcp/injectable-logger.test.ts +0 -83
- package/tests/mcp/jsonrpc.test.ts +0 -109
- package/tests/mcp/lifecycle.test.ts +0 -879
- package/tests/network-runtime/address-types.contract.test.ts +0 -143
- package/tests/network-runtime/continuity-bind-schema.contract.test.ts +0 -203
- package/tests/network-runtime/local-control-contract.test.ts +0 -869
- package/tests/network-runtime/local-control-invite-token.contract.test.ts +0 -146
- package/tests/network-runtime/node-store-contract.test.ts +0 -11
- package/tests/network-runtime/pair-protocol-nodeid.contract.test.ts +0 -15
- package/tests/network-runtime/peer-state-machine.contract.test.ts +0 -148
- package/tests/network-runtime/protocol-schemas.contract.test.ts +0 -512
- package/tests/network-runtime/relay-pending-nodeid.contract.test.ts +0 -62
- package/tests/network-runtime/runtime-bootstrap-contract.test.ts +0 -227
- package/tests/network-runtime/runtime-socket-local-control-client.test.ts +0 -621
- package/tests/network-runtime/wait-for-message-script.test.ts +0 -288
- package/tests/parallel.test.ts +0 -71
- package/tests/policy.test.ts +0 -184
- package/tests/print-default-test-lane.ts +0 -14
- package/tests/print-test-lane-manifest.ts +0 -22
- package/tests/providers/brave.test.ts +0 -159
- package/tests/providers/duckduckgo.test.ts +0 -207
- package/tests/providers/exa.test.ts +0 -175
- package/tests/providers/firecrawl.test.ts +0 -168
- package/tests/providers/jina.test.ts +0 -144
- package/tests/providers/router.test.ts +0 -328
- package/tests/providers/tavily.test.ts +0 -165
- package/tests/registry/discovery.test.ts +0 -154
- package/tests/registry/injectable-logger.test.ts +0 -230
- package/tests/registry/input-validation.test.ts +0 -361
- package/tests/registry/interface-completeness.test.ts +0 -85
- package/tests/registry/mcp-integration.test.ts +0 -103
- package/tests/registry/mcp-read-only-hint.test.ts +0 -60
- package/tests/registry/memoria-discovery.test.ts +0 -390
- package/tests/registry/nested-validation.test.ts +0 -283
- package/tests/registry/pseudo-tool-filtering.test.ts +0 -258
- package/tests/registry/registration-lifecycle.test.ts +0 -133
- package/tests/registry-validation.test.ts +0 -424
- package/tests/registry.test.ts +0 -460
- package/tests/security/dns-pinning.test.ts +0 -162
- package/tests/security/external-content.test.ts +0 -144
- package/tests/security/ssrf.test.ts +0 -118
- package/tests/shell-safety-integration.test.ts +0 -32
- package/tests/shell-safety.test.ts +0 -365
- package/tests/slack/desktop-session.test.ts +0 -50
- package/tests/test-lane-manifest.ts +0 -440
- package/tests/test-utils.ts +0 -27
- package/tests/tool-factory.test.ts +0 -188
- package/tests/utils/retry.test.ts +0 -231
- package/tests/utils/url.test.ts +0 -63
- package/tsconfig.cjs.json +0 -24
- package/tsconfig.json +0 -12
- package/vitest.config.ts +0 -55
- package/vitest.e2e.config.ts +0 -24
- package/vitest.integration.config.ts +0 -24
- package/vitest.native.config.ts +0 -24
|
@@ -1,1149 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
AcceptInviteTokenRequestSchema,
|
|
4
|
-
AcceptInviteTokenResponseSchema,
|
|
5
|
-
AttachedClientViewSchema,
|
|
6
|
-
CreateInviteRequestSchema,
|
|
7
|
-
CreateInviteResponseSchema,
|
|
8
|
-
DirectPairRequestSchema,
|
|
9
|
-
DirectPairResponseSchema,
|
|
10
|
-
InboxListRequestSchema,
|
|
11
|
-
InvitePeerRequestSchema,
|
|
12
|
-
InvitePeerResultSchema,
|
|
13
|
-
NearbyPeerViewSchema,
|
|
14
|
-
OutboundMessageSchema,
|
|
15
|
-
PairRequestDecisionSchema,
|
|
16
|
-
PairRequestResponseSchema,
|
|
17
|
-
PendingPairRequestViewSchema,
|
|
18
|
-
PersistedInboxEventSchema,
|
|
19
|
-
PeerViewEventSchema,
|
|
20
|
-
RepairPeerRequestSchema,
|
|
21
|
-
RepairPeerResponseSchema,
|
|
22
|
-
RevokePeerRequestSchema,
|
|
23
|
-
RevokePeerResponseSchema,
|
|
24
|
-
ResumeRunRequestSchema,
|
|
25
|
-
RuntimeDeliveryReceiptSchema,
|
|
26
|
-
RuntimeQueuedReceiptSchema,
|
|
27
|
-
RuntimeRunEventSchema,
|
|
28
|
-
RuntimeStatusSchema,
|
|
29
|
-
RunRequestSchema,
|
|
30
|
-
RunResultSchema,
|
|
31
|
-
} from "./network-runtime/local-control-contract.js";
|
|
32
|
-
|
|
33
|
-
const NonEmptyStringSchema = z.string().trim().min(1);
|
|
34
|
-
const PositiveIntSchema = z.number().int().positive();
|
|
35
|
-
const NonNegativeIntSchema = z.number().int().nonnegative();
|
|
36
|
-
const LooseObjectSchema = z.object({}).catchall(z.unknown());
|
|
37
|
-
const EmptyObjectSchema = z.object({}).strict();
|
|
38
|
-
const IsoDatetimeSchema = z.string().datetime({ offset: true }).or(z.string().min(1));
|
|
39
|
-
const AutonomySchema = z.enum(["minimal", "balanced", "high", "full"]);
|
|
40
|
-
|
|
41
|
-
export const HEADLESS_OPERATION_NAMES = [
|
|
42
|
-
"run.start",
|
|
43
|
-
"run.resume",
|
|
44
|
-
"run.abort",
|
|
45
|
-
"interaction.respond",
|
|
46
|
-
"session.list",
|
|
47
|
-
"session.read",
|
|
48
|
-
"session.load",
|
|
49
|
-
"session.fork",
|
|
50
|
-
"memory.remember",
|
|
51
|
-
"memory.recall",
|
|
52
|
-
"memory.list",
|
|
53
|
-
"memory.forget",
|
|
54
|
-
"memory.recall_knowledge",
|
|
55
|
-
"arion.list",
|
|
56
|
-
"arion.hatch",
|
|
57
|
-
"arion.become",
|
|
58
|
-
"arion.rest",
|
|
59
|
-
"arion.wake",
|
|
60
|
-
"arion.create",
|
|
61
|
-
"model.list",
|
|
62
|
-
"model.set",
|
|
63
|
-
"model.refresh",
|
|
64
|
-
"auth.status",
|
|
65
|
-
"auth.login",
|
|
66
|
-
"auth.logout",
|
|
67
|
-
"peer.list",
|
|
68
|
-
"peer.list_nearby",
|
|
69
|
-
"peer.pending.list",
|
|
70
|
-
"peer.pending.respond",
|
|
71
|
-
"peer.invite",
|
|
72
|
-
"peer.connect",
|
|
73
|
-
"peer.accept_invite",
|
|
74
|
-
"peer.direct_pair",
|
|
75
|
-
"peer.repair",
|
|
76
|
-
"peer.revoke",
|
|
77
|
-
"client.list",
|
|
78
|
-
"client.inbox.list",
|
|
79
|
-
"message.send",
|
|
80
|
-
"message.inbox.list",
|
|
81
|
-
"config.theme.get",
|
|
82
|
-
"config.theme.set",
|
|
83
|
-
"config.autonomy.get",
|
|
84
|
-
"config.autonomy.set",
|
|
85
|
-
"system.restart",
|
|
86
|
-
"system.terminal_setup",
|
|
87
|
-
"daemon.start",
|
|
88
|
-
"daemon.status",
|
|
89
|
-
"daemon.stop",
|
|
90
|
-
"hook.extract",
|
|
91
|
-
"hook.reflect",
|
|
92
|
-
"hook.consolidate",
|
|
93
|
-
"hook.ingest",
|
|
94
|
-
"hook.harvest",
|
|
95
|
-
] as const;
|
|
96
|
-
|
|
97
|
-
export const HeadlessOperationNameSchema = z.enum(HEADLESS_OPERATION_NAMES);
|
|
98
|
-
export type HeadlessOperationName = z.infer<typeof HeadlessOperationNameSchema>;
|
|
99
|
-
|
|
100
|
-
export const HeadlessRequestIdSchema = NonEmptyStringSchema;
|
|
101
|
-
export type HeadlessRequestId = z.infer<typeof HeadlessRequestIdSchema>;
|
|
102
|
-
|
|
103
|
-
export const HeadlessInteractionIdSchema = NonEmptyStringSchema;
|
|
104
|
-
export type HeadlessInteractionId = z.infer<typeof HeadlessInteractionIdSchema>;
|
|
105
|
-
|
|
106
|
-
export const HeadlessInteractionSourceSchema = z.enum(["run", "auth", "system", "peer"]);
|
|
107
|
-
export type HeadlessInteractionSource = z.infer<typeof HeadlessInteractionSourceSchema>;
|
|
108
|
-
|
|
109
|
-
export const HeadlessInteractionQuestionSchema = z
|
|
110
|
-
.object({
|
|
111
|
-
question: NonEmptyStringSchema,
|
|
112
|
-
options: z.array(NonEmptyStringSchema).optional(),
|
|
113
|
-
})
|
|
114
|
-
.strict();
|
|
115
|
-
export type HeadlessInteractionQuestion = z.infer<typeof HeadlessInteractionQuestionSchema>;
|
|
116
|
-
|
|
117
|
-
export const HeadlessSelectionOptionSchema = z
|
|
118
|
-
.object({
|
|
119
|
-
id: NonEmptyStringSchema,
|
|
120
|
-
label: NonEmptyStringSchema,
|
|
121
|
-
description: z.string().optional(),
|
|
122
|
-
})
|
|
123
|
-
.strict();
|
|
124
|
-
export type HeadlessSelectionOption = z.infer<typeof HeadlessSelectionOptionSchema>;
|
|
125
|
-
|
|
126
|
-
export const HeadlessCredentialFieldSchema = z
|
|
127
|
-
.object({
|
|
128
|
-
key: NonEmptyStringSchema,
|
|
129
|
-
label: NonEmptyStringSchema,
|
|
130
|
-
placeholder: z.string().optional(),
|
|
131
|
-
secret: z.boolean().optional(),
|
|
132
|
-
})
|
|
133
|
-
.strict();
|
|
134
|
-
export type HeadlessCredentialField = z.infer<typeof HeadlessCredentialFieldSchema>;
|
|
135
|
-
|
|
136
|
-
export const HeadlessToolApprovalPayloadSchema = z
|
|
137
|
-
.object({
|
|
138
|
-
kind: z.literal("tool_approval"),
|
|
139
|
-
prompt: z.string().optional(),
|
|
140
|
-
toolName: NonEmptyStringSchema,
|
|
141
|
-
toolInput: z.unknown().optional(),
|
|
142
|
-
riskLevel: z.string().optional(),
|
|
143
|
-
issues: z.array(z.string()).optional(),
|
|
144
|
-
})
|
|
145
|
-
.strict();
|
|
146
|
-
|
|
147
|
-
export const HeadlessQuestionnairePayloadSchema = z
|
|
148
|
-
.object({
|
|
149
|
-
kind: z.literal("questionnaire"),
|
|
150
|
-
prompt: z.string().optional(),
|
|
151
|
-
questions: z.array(HeadlessInteractionQuestionSchema).min(1),
|
|
152
|
-
})
|
|
153
|
-
.strict();
|
|
154
|
-
|
|
155
|
-
export const HeadlessSelectionPayloadSchema = z
|
|
156
|
-
.object({
|
|
157
|
-
kind: z.literal("selection"),
|
|
158
|
-
prompt: NonEmptyStringSchema,
|
|
159
|
-
options: z.array(HeadlessSelectionOptionSchema).min(1),
|
|
160
|
-
})
|
|
161
|
-
.strict();
|
|
162
|
-
|
|
163
|
-
export const HeadlessCredentialInputPayloadSchema = z
|
|
164
|
-
.object({
|
|
165
|
-
kind: z.literal("credential_input"),
|
|
166
|
-
prompt: NonEmptyStringSchema,
|
|
167
|
-
provider: NonEmptyStringSchema.optional(),
|
|
168
|
-
mode: z.enum(["generic", "oauth_authorization_code"]).optional(),
|
|
169
|
-
authorizeUrl: NonEmptyStringSchema.optional(),
|
|
170
|
-
callbackMode: z.enum(["manual_code", "local_callback"]).optional(),
|
|
171
|
-
expectedState: NonEmptyStringSchema.optional(),
|
|
172
|
-
fields: z.array(HeadlessCredentialFieldSchema).min(1),
|
|
173
|
-
})
|
|
174
|
-
.strict();
|
|
175
|
-
|
|
176
|
-
export const HeadlessOauthDevicePayloadSchema = z
|
|
177
|
-
.object({
|
|
178
|
-
kind: z.literal("oauth_device"),
|
|
179
|
-
prompt: NonEmptyStringSchema,
|
|
180
|
-
provider: NonEmptyStringSchema.optional(),
|
|
181
|
-
profileLabel: NonEmptyStringSchema.optional(),
|
|
182
|
-
verificationUri: NonEmptyStringSchema,
|
|
183
|
-
userCode: NonEmptyStringSchema,
|
|
184
|
-
expiresAt: IsoDatetimeSchema.optional(),
|
|
185
|
-
intervalSeconds: PositiveIntSchema.optional(),
|
|
186
|
-
})
|
|
187
|
-
.strict();
|
|
188
|
-
|
|
189
|
-
export const HeadlessConfirmPayloadSchema = z
|
|
190
|
-
.object({
|
|
191
|
-
kind: z.literal("confirm"),
|
|
192
|
-
prompt: NonEmptyStringSchema,
|
|
193
|
-
detail: z.string().optional(),
|
|
194
|
-
confirmLabel: z.string().optional(),
|
|
195
|
-
denyLabel: z.string().optional(),
|
|
196
|
-
defaultApproved: z.boolean().optional(),
|
|
197
|
-
})
|
|
198
|
-
.strict();
|
|
199
|
-
|
|
200
|
-
export const HeadlessInteractionPayloadSchema = z.discriminatedUnion("kind", [
|
|
201
|
-
HeadlessToolApprovalPayloadSchema,
|
|
202
|
-
HeadlessQuestionnairePayloadSchema,
|
|
203
|
-
HeadlessSelectionPayloadSchema,
|
|
204
|
-
HeadlessCredentialInputPayloadSchema,
|
|
205
|
-
HeadlessOauthDevicePayloadSchema,
|
|
206
|
-
HeadlessConfirmPayloadSchema,
|
|
207
|
-
]);
|
|
208
|
-
export type HeadlessInteractionPayload = z.infer<typeof HeadlessInteractionPayloadSchema>;
|
|
209
|
-
|
|
210
|
-
export const HeadlessConfirmResponsePayloadSchema = z
|
|
211
|
-
.object({
|
|
212
|
-
kind: z.literal("confirm"),
|
|
213
|
-
approved: z.boolean(),
|
|
214
|
-
})
|
|
215
|
-
.strict();
|
|
216
|
-
|
|
217
|
-
export const HeadlessQuestionnaireResponsePayloadSchema = z
|
|
218
|
-
.object({
|
|
219
|
-
kind: z.literal("questionnaire"),
|
|
220
|
-
answers: z.array(z.string()),
|
|
221
|
-
})
|
|
222
|
-
.strict();
|
|
223
|
-
|
|
224
|
-
export const HeadlessSelectionResponsePayloadSchema = z
|
|
225
|
-
.object({
|
|
226
|
-
kind: z.literal("selection"),
|
|
227
|
-
selected: NonEmptyStringSchema,
|
|
228
|
-
})
|
|
229
|
-
.strict();
|
|
230
|
-
|
|
231
|
-
export const HeadlessCredentialInputResponsePayloadSchema = z
|
|
232
|
-
.object({
|
|
233
|
-
kind: z.literal("credential_input"),
|
|
234
|
-
values: z.record(z.string(), z.string()),
|
|
235
|
-
})
|
|
236
|
-
.strict();
|
|
237
|
-
|
|
238
|
-
export const HeadlessOauthDeviceResponsePayloadSchema = z
|
|
239
|
-
.object({
|
|
240
|
-
kind: z.literal("oauth_device"),
|
|
241
|
-
acknowledged: z.boolean().optional(),
|
|
242
|
-
verificationCode: z.string().optional(),
|
|
243
|
-
})
|
|
244
|
-
.strict();
|
|
245
|
-
|
|
246
|
-
export const HeadlessCancelResponsePayloadSchema = z
|
|
247
|
-
.object({
|
|
248
|
-
kind: z.literal("cancel"),
|
|
249
|
-
})
|
|
250
|
-
.strict();
|
|
251
|
-
|
|
252
|
-
export const HeadlessInteractionResponsePayloadSchema = z.discriminatedUnion("kind", [
|
|
253
|
-
HeadlessConfirmResponsePayloadSchema,
|
|
254
|
-
HeadlessQuestionnaireResponsePayloadSchema,
|
|
255
|
-
HeadlessSelectionResponsePayloadSchema,
|
|
256
|
-
HeadlessCredentialInputResponsePayloadSchema,
|
|
257
|
-
HeadlessOauthDeviceResponsePayloadSchema,
|
|
258
|
-
HeadlessCancelResponsePayloadSchema,
|
|
259
|
-
]);
|
|
260
|
-
export type HeadlessInteractionResponsePayload = z.infer<
|
|
261
|
-
typeof HeadlessInteractionResponsePayloadSchema
|
|
262
|
-
>;
|
|
263
|
-
|
|
264
|
-
export const HeadlessInteractionRequestSchema = z
|
|
265
|
-
.object({
|
|
266
|
-
kind: z.literal("interaction.required"),
|
|
267
|
-
requestId: HeadlessRequestIdSchema,
|
|
268
|
-
interactionId: HeadlessInteractionIdSchema,
|
|
269
|
-
source: HeadlessInteractionSourceSchema,
|
|
270
|
-
interaction: HeadlessInteractionPayloadSchema,
|
|
271
|
-
})
|
|
272
|
-
.strict();
|
|
273
|
-
export type HeadlessInteractionRequest = z.infer<typeof HeadlessInteractionRequestSchema>;
|
|
274
|
-
|
|
275
|
-
export const HeadlessInteractionResponseSchema = z
|
|
276
|
-
.object({
|
|
277
|
-
kind: z.literal("interaction.respond"),
|
|
278
|
-
requestId: HeadlessRequestIdSchema,
|
|
279
|
-
interactionId: HeadlessInteractionIdSchema,
|
|
280
|
-
response: HeadlessInteractionResponsePayloadSchema,
|
|
281
|
-
})
|
|
282
|
-
.strict();
|
|
283
|
-
export type HeadlessInteractionResponse = z.infer<typeof HeadlessInteractionResponseSchema>;
|
|
284
|
-
|
|
285
|
-
export const HeadlessErrorSchema = z
|
|
286
|
-
.object({
|
|
287
|
-
code: NonEmptyStringSchema,
|
|
288
|
-
message: NonEmptyStringSchema,
|
|
289
|
-
retryable: z.boolean().optional(),
|
|
290
|
-
details: z.record(z.string(), z.unknown()).optional(),
|
|
291
|
-
})
|
|
292
|
-
.strict();
|
|
293
|
-
export type HeadlessError = z.infer<typeof HeadlessErrorSchema>;
|
|
294
|
-
|
|
295
|
-
export const HeadlessSessionSummarySchema = z
|
|
296
|
-
.object({
|
|
297
|
-
id: NonEmptyStringSchema,
|
|
298
|
-
createdAt: IsoDatetimeSchema,
|
|
299
|
-
updatedAt: IsoDatetimeSchema,
|
|
300
|
-
completedAt: IsoDatetimeSchema.optional(),
|
|
301
|
-
title: z.string().nullable(),
|
|
302
|
-
arion: NonEmptyStringSchema,
|
|
303
|
-
model: NonEmptyStringSchema,
|
|
304
|
-
messageCount: NonNegativeIntSchema,
|
|
305
|
-
preview: z.string(),
|
|
306
|
-
})
|
|
307
|
-
.strict();
|
|
308
|
-
|
|
309
|
-
export const HeadlessLoadedSessionSchema = z
|
|
310
|
-
.object({
|
|
311
|
-
id: NonEmptyStringSchema,
|
|
312
|
-
arion: NonEmptyStringSchema,
|
|
313
|
-
model: NonEmptyStringSchema,
|
|
314
|
-
messages: z.array(z.unknown()),
|
|
315
|
-
})
|
|
316
|
-
.strict();
|
|
317
|
-
|
|
318
|
-
export const HeadlessSessionListInputSchema = z
|
|
319
|
-
.object({
|
|
320
|
-
query: z.string().optional(),
|
|
321
|
-
limit: PositiveIntSchema.max(200).optional(),
|
|
322
|
-
offset: NonNegativeIntSchema.optional(),
|
|
323
|
-
})
|
|
324
|
-
.strict();
|
|
325
|
-
|
|
326
|
-
export const HeadlessSessionReferenceInputSchema = z
|
|
327
|
-
.object({
|
|
328
|
-
sessionId: NonEmptyStringSchema,
|
|
329
|
-
})
|
|
330
|
-
.strict();
|
|
331
|
-
|
|
332
|
-
export const HeadlessSessionListResultSchema = z
|
|
333
|
-
.object({
|
|
334
|
-
sessions: z.array(HeadlessSessionSummarySchema),
|
|
335
|
-
})
|
|
336
|
-
.strict();
|
|
337
|
-
|
|
338
|
-
export const HeadlessSessionReadResultSchema = z
|
|
339
|
-
.object({
|
|
340
|
-
session: HeadlessLoadedSessionSchema,
|
|
341
|
-
})
|
|
342
|
-
.strict();
|
|
343
|
-
|
|
344
|
-
export const HeadlessSessionLoadResultSchema = z
|
|
345
|
-
.object({
|
|
346
|
-
session: HeadlessLoadedSessionSchema,
|
|
347
|
-
loaded: z.literal(true),
|
|
348
|
-
runtimeState: z
|
|
349
|
-
.object({
|
|
350
|
-
sessionId: NonEmptyStringSchema,
|
|
351
|
-
stateStatus: z.enum(["idle", "running", "paused", "completed"]),
|
|
352
|
-
activeRunId: z.string().nullable(),
|
|
353
|
-
pausedState: z.unknown().nullable(),
|
|
354
|
-
policySnapshot: z.record(z.string(), z.unknown()).nullable(),
|
|
355
|
-
lastEventSeq: NonNegativeIntSchema,
|
|
356
|
-
revision: NonNegativeIntSchema,
|
|
357
|
-
leaseOwner: z.string().nullable(),
|
|
358
|
-
leaseExpiresAt: IsoDatetimeSchema.nullable(),
|
|
359
|
-
updatedAt: IsoDatetimeSchema,
|
|
360
|
-
})
|
|
361
|
-
.strict()
|
|
362
|
-
.nullable()
|
|
363
|
-
.optional(),
|
|
364
|
-
pendingInteraction: z
|
|
365
|
-
.object({
|
|
366
|
-
interactionId: NonEmptyStringSchema,
|
|
367
|
-
sessionId: NonEmptyStringSchema,
|
|
368
|
-
requestId: NonEmptyStringSchema,
|
|
369
|
-
source: HeadlessInteractionSourceSchema,
|
|
370
|
-
kind: NonEmptyStringSchema,
|
|
371
|
-
status: z.enum(["pending", "answered", "applied", "expired", "canceled"]),
|
|
372
|
-
prompt: z.record(z.string(), z.unknown()),
|
|
373
|
-
response: z.record(z.string(), z.unknown()).nullable(),
|
|
374
|
-
createdAt: IsoDatetimeSchema,
|
|
375
|
-
answeredAt: IsoDatetimeSchema.nullable(),
|
|
376
|
-
appliedAt: IsoDatetimeSchema.nullable(),
|
|
377
|
-
})
|
|
378
|
-
.strict()
|
|
379
|
-
.nullable()
|
|
380
|
-
.optional(),
|
|
381
|
-
})
|
|
382
|
-
.strict();
|
|
383
|
-
|
|
384
|
-
export const HeadlessSessionForkInputSchema = z
|
|
385
|
-
.object({
|
|
386
|
-
sessionId: NonEmptyStringSchema,
|
|
387
|
-
messageLimit: z.number().int().nonnegative().optional(),
|
|
388
|
-
})
|
|
389
|
-
.strict();
|
|
390
|
-
|
|
391
|
-
export const HeadlessSessionForkResultSchema = z
|
|
392
|
-
.object({
|
|
393
|
-
newSessionId: NonEmptyStringSchema,
|
|
394
|
-
sourceSessionId: NonEmptyStringSchema,
|
|
395
|
-
messagesCopied: NonNegativeIntSchema,
|
|
396
|
-
title: z.string().nullable(),
|
|
397
|
-
})
|
|
398
|
-
.strict();
|
|
399
|
-
|
|
400
|
-
export const HeadlessPendingPairRespondResultSchema = z
|
|
401
|
-
.object({
|
|
402
|
-
response: PairRequestResponseSchema,
|
|
403
|
-
})
|
|
404
|
-
.strict();
|
|
405
|
-
|
|
406
|
-
export const HeadlessPeerInviteResultSchema = z
|
|
407
|
-
.object({
|
|
408
|
-
invite: CreateInviteResponseSchema,
|
|
409
|
-
})
|
|
410
|
-
.strict();
|
|
411
|
-
|
|
412
|
-
export const HeadlessPeerConnectResultSchema = z
|
|
413
|
-
.object({
|
|
414
|
-
invite: InvitePeerResultSchema,
|
|
415
|
-
})
|
|
416
|
-
.strict();
|
|
417
|
-
|
|
418
|
-
export const HeadlessAcceptInviteTokenResultSchema = z
|
|
419
|
-
.object({
|
|
420
|
-
accepted: AcceptInviteTokenResponseSchema,
|
|
421
|
-
})
|
|
422
|
-
.strict();
|
|
423
|
-
|
|
424
|
-
export const HeadlessDirectPairResultSchema = z
|
|
425
|
-
.object({
|
|
426
|
-
pair: DirectPairResponseSchema,
|
|
427
|
-
})
|
|
428
|
-
.strict();
|
|
429
|
-
|
|
430
|
-
export const HeadlessRepairPeerResultSchema = z
|
|
431
|
-
.object({
|
|
432
|
-
repair: RepairPeerResponseSchema,
|
|
433
|
-
})
|
|
434
|
-
.strict();
|
|
435
|
-
|
|
436
|
-
export const HeadlessRevokePeerResultSchema = z
|
|
437
|
-
.object({
|
|
438
|
-
revoke: RevokePeerResponseSchema,
|
|
439
|
-
})
|
|
440
|
-
.strict();
|
|
441
|
-
|
|
442
|
-
export const HeadlessMemoryRememberInputSchema = z
|
|
443
|
-
.object({
|
|
444
|
-
text: NonEmptyStringSchema,
|
|
445
|
-
})
|
|
446
|
-
.strict();
|
|
447
|
-
|
|
448
|
-
export const HeadlessMemoryRecallInputSchema = z
|
|
449
|
-
.object({
|
|
450
|
-
query: NonEmptyStringSchema,
|
|
451
|
-
limit: PositiveIntSchema.max(200).optional(),
|
|
452
|
-
})
|
|
453
|
-
.strict();
|
|
454
|
-
|
|
455
|
-
export const HeadlessMemoryListInputSchema = z
|
|
456
|
-
.object({
|
|
457
|
-
query: z.string().optional(),
|
|
458
|
-
limit: PositiveIntSchema.max(200).optional(),
|
|
459
|
-
offset: NonNegativeIntSchema.optional(),
|
|
460
|
-
})
|
|
461
|
-
.strict();
|
|
462
|
-
|
|
463
|
-
export const HeadlessMemoryForgetInputSchema = z
|
|
464
|
-
.object({
|
|
465
|
-
id: NonEmptyStringSchema,
|
|
466
|
-
})
|
|
467
|
-
.strict();
|
|
468
|
-
|
|
469
|
-
export const HeadlessMemoryRecallKnowledgeInputSchema = z
|
|
470
|
-
.object({
|
|
471
|
-
topic: NonEmptyStringSchema,
|
|
472
|
-
kind: z.enum(["skills", "procedures", "tools", "all"]).optional(),
|
|
473
|
-
limit: PositiveIntSchema.max(200).optional(),
|
|
474
|
-
})
|
|
475
|
-
.strict();
|
|
476
|
-
|
|
477
|
-
export const HeadlessArionNameInputSchema = z
|
|
478
|
-
.object({
|
|
479
|
-
name: NonEmptyStringSchema,
|
|
480
|
-
})
|
|
481
|
-
.strict();
|
|
482
|
-
|
|
483
|
-
export const HeadlessArionHatchInputSchema = z
|
|
484
|
-
.object({
|
|
485
|
-
name: NonEmptyStringSchema,
|
|
486
|
-
description: z.string().optional(),
|
|
487
|
-
})
|
|
488
|
-
.strict();
|
|
489
|
-
|
|
490
|
-
export const HeadlessArionCreateInputSchema = z
|
|
491
|
-
.object({
|
|
492
|
-
name: NonEmptyStringSchema,
|
|
493
|
-
description: z.string().optional(),
|
|
494
|
-
emoji: z.string().optional(),
|
|
495
|
-
profile: z.string().optional(),
|
|
496
|
-
})
|
|
497
|
-
.strict();
|
|
498
|
-
|
|
499
|
-
export const HeadlessModelSetInputSchema = z
|
|
500
|
-
.object({
|
|
501
|
-
model: NonEmptyStringSchema,
|
|
502
|
-
})
|
|
503
|
-
.strict();
|
|
504
|
-
|
|
505
|
-
export const HeadlessAuthLoginInputSchema = z
|
|
506
|
-
.object({
|
|
507
|
-
args: z.string().optional(),
|
|
508
|
-
provider: NonEmptyStringSchema.optional(),
|
|
509
|
-
credential: z.string().optional(),
|
|
510
|
-
method: NonEmptyStringSchema.optional(),
|
|
511
|
-
profileLabel: NonEmptyStringSchema.optional(),
|
|
512
|
-
source: NonEmptyStringSchema.optional(),
|
|
513
|
-
})
|
|
514
|
-
.strict();
|
|
515
|
-
|
|
516
|
-
export const HeadlessAuthLogoutInputSchema = z
|
|
517
|
-
.object({
|
|
518
|
-
args: z.string().optional(),
|
|
519
|
-
provider: NonEmptyStringSchema.optional(),
|
|
520
|
-
})
|
|
521
|
-
.strict();
|
|
522
|
-
|
|
523
|
-
export const HeadlessClientInboxListInputSchema = InboxListRequestSchema;
|
|
524
|
-
export const HeadlessMessageInboxListInputSchema = InboxListRequestSchema;
|
|
525
|
-
export const HeadlessStructuredMessageSendInputSchema = z
|
|
526
|
-
.object({
|
|
527
|
-
args: z.string().optional(),
|
|
528
|
-
recipient: NonEmptyStringSchema.optional(),
|
|
529
|
-
content: z.string().trim().min(1).optional(),
|
|
530
|
-
senderName: NonEmptyStringSchema.optional(),
|
|
531
|
-
})
|
|
532
|
-
.strict()
|
|
533
|
-
.refine((value) => Boolean(value.args || (value.recipient && value.content)), {
|
|
534
|
-
message: "message.send requires args or recipient/content",
|
|
535
|
-
});
|
|
536
|
-
export const HeadlessMessageSendInputSchema = z.union([
|
|
537
|
-
OutboundMessageSchema,
|
|
538
|
-
HeadlessStructuredMessageSendInputSchema,
|
|
539
|
-
]);
|
|
540
|
-
|
|
541
|
-
export const HeadlessConfigThemeSetInputSchema = z
|
|
542
|
-
.object({
|
|
543
|
-
theme: NonEmptyStringSchema,
|
|
544
|
-
})
|
|
545
|
-
.strict();
|
|
546
|
-
|
|
547
|
-
export const HeadlessConfigAutonomySetInputSchema = z
|
|
548
|
-
.object({
|
|
549
|
-
autonomy: AutonomySchema,
|
|
550
|
-
})
|
|
551
|
-
.strict();
|
|
552
|
-
|
|
553
|
-
export const HeadlessSystemRestartInputSchema = z
|
|
554
|
-
.object({
|
|
555
|
-
reason: z.string().optional(),
|
|
556
|
-
})
|
|
557
|
-
.strict();
|
|
558
|
-
|
|
559
|
-
export const HeadlessRunAbortInputSchema = z
|
|
560
|
-
.object({
|
|
561
|
-
runId: NonEmptyStringSchema.optional(),
|
|
562
|
-
sessionId: NonEmptyStringSchema.optional(),
|
|
563
|
-
})
|
|
564
|
-
.strict()
|
|
565
|
-
.refine((value) => Boolean(value.runId || value.sessionId), {
|
|
566
|
-
message: "run.abort requires runId or sessionId",
|
|
567
|
-
});
|
|
568
|
-
|
|
569
|
-
export const HeadlessDaemonCommandInputSchema = z
|
|
570
|
-
.object({
|
|
571
|
-
arion: NonEmptyStringSchema.optional(),
|
|
572
|
-
port: PositiveIntSchema.optional(),
|
|
573
|
-
intervalMs: PositiveIntSchema.optional(),
|
|
574
|
-
allowedToolCategories: z.array(NonEmptyStringSchema).optional(),
|
|
575
|
-
allowedShellCommands: z.array(NonEmptyStringSchema).optional(),
|
|
576
|
-
maxWriteOpsPerMinute: PositiveIntSchema.optional(),
|
|
577
|
-
maxGitPushesPerHour: PositiveIntSchema.optional(),
|
|
578
|
-
})
|
|
579
|
-
.strict();
|
|
580
|
-
|
|
581
|
-
export const HeadlessHookExtractPairSchema = z
|
|
582
|
-
.object({
|
|
583
|
-
user: z.string(),
|
|
584
|
-
assistant: z.string(),
|
|
585
|
-
})
|
|
586
|
-
.strict();
|
|
587
|
-
|
|
588
|
-
export const HeadlessHookExtractInputSchema = z
|
|
589
|
-
.object({
|
|
590
|
-
pairs: z.array(HeadlessHookExtractPairSchema),
|
|
591
|
-
})
|
|
592
|
-
.strict();
|
|
593
|
-
|
|
594
|
-
export const HeadlessHookReflectMessageSchema = z
|
|
595
|
-
.object({
|
|
596
|
-
role: NonEmptyStringSchema,
|
|
597
|
-
content: z.unknown(),
|
|
598
|
-
})
|
|
599
|
-
.strict();
|
|
600
|
-
|
|
601
|
-
export const HeadlessHookReflectInputSchema = z
|
|
602
|
-
.object({
|
|
603
|
-
messages: z.array(HeadlessHookReflectMessageSchema).optional(),
|
|
604
|
-
conversation: z.string().optional(),
|
|
605
|
-
})
|
|
606
|
-
.strict()
|
|
607
|
-
.refine((value) => Boolean(value.messages || value.conversation), {
|
|
608
|
-
message: "hook.reflect requires messages or conversation",
|
|
609
|
-
});
|
|
610
|
-
|
|
611
|
-
export const HeadlessHookIngestInputSchema = z
|
|
612
|
-
.object({
|
|
613
|
-
source: z.enum(["claude", "codex", "all"]).optional(),
|
|
614
|
-
limit: PositiveIntSchema.optional(),
|
|
615
|
-
})
|
|
616
|
-
.strict();
|
|
617
|
-
|
|
618
|
-
export const HeadlessHookHarvestInputSchema = z
|
|
619
|
-
.object({
|
|
620
|
-
preHarvest: z.boolean().optional(),
|
|
621
|
-
feedback: z.boolean().optional(),
|
|
622
|
-
extract: z.boolean().optional(),
|
|
623
|
-
stats: z.boolean().optional(),
|
|
624
|
-
cleanup: z.boolean().optional(),
|
|
625
|
-
cost: z.boolean().optional(),
|
|
626
|
-
all: z.boolean().optional(),
|
|
627
|
-
limit: PositiveIntSchema.optional(),
|
|
628
|
-
})
|
|
629
|
-
.strict();
|
|
630
|
-
|
|
631
|
-
export const HeadlessMessageSendResultSchema = z
|
|
632
|
-
.object({
|
|
633
|
-
receipt: z.union([RuntimeQueuedReceiptSchema, RuntimeDeliveryReceiptSchema]),
|
|
634
|
-
message: z.string().optional(),
|
|
635
|
-
})
|
|
636
|
-
.strict();
|
|
637
|
-
|
|
638
|
-
export const HeadlessInboxListResultSchema = z
|
|
639
|
-
.object({
|
|
640
|
-
events: z.array(PersistedInboxEventSchema),
|
|
641
|
-
})
|
|
642
|
-
.strict();
|
|
643
|
-
|
|
644
|
-
export const HeadlessPeerListResultSchema = z
|
|
645
|
-
.object({
|
|
646
|
-
peers: z.array(PeerViewEventSchema),
|
|
647
|
-
})
|
|
648
|
-
.strict();
|
|
649
|
-
|
|
650
|
-
export const HeadlessNearbyPeerListResultSchema = z
|
|
651
|
-
.object({
|
|
652
|
-
peers: z.array(NearbyPeerViewSchema),
|
|
653
|
-
})
|
|
654
|
-
.strict();
|
|
655
|
-
|
|
656
|
-
export const HeadlessPendingPairListResultSchema = z
|
|
657
|
-
.object({
|
|
658
|
-
requests: z.array(PendingPairRequestViewSchema),
|
|
659
|
-
})
|
|
660
|
-
.strict();
|
|
661
|
-
|
|
662
|
-
export const HeadlessClientListResultSchema = z
|
|
663
|
-
.object({
|
|
664
|
-
clients: z.array(AttachedClientViewSchema),
|
|
665
|
-
})
|
|
666
|
-
.strict();
|
|
667
|
-
|
|
668
|
-
export const HeadlessHookExtractResultSchema = z
|
|
669
|
-
.object({
|
|
670
|
-
extracted: z.array(
|
|
671
|
-
z
|
|
672
|
-
.object({
|
|
673
|
-
user: z.string(),
|
|
674
|
-
extracted: NonNegativeIntSchema,
|
|
675
|
-
error: z.string().optional(),
|
|
676
|
-
})
|
|
677
|
-
.strict(),
|
|
678
|
-
),
|
|
679
|
-
})
|
|
680
|
-
.strict();
|
|
681
|
-
|
|
682
|
-
// ---------------------------------------------------------------------------
|
|
683
|
-
// Typed result schemas for operations that previously used LooseObjectSchema
|
|
684
|
-
// ---------------------------------------------------------------------------
|
|
685
|
-
|
|
686
|
-
export const HeadlessRunAbortResultSchema = z
|
|
687
|
-
.object({
|
|
688
|
-
aborted: z.literal(true),
|
|
689
|
-
runId: NonEmptyStringSchema.optional(),
|
|
690
|
-
sessionId: NonEmptyStringSchema.optional(),
|
|
691
|
-
})
|
|
692
|
-
.strict();
|
|
693
|
-
|
|
694
|
-
export const HeadlessInteractionRespondResultSchema = z.object({}).catchall(z.unknown());
|
|
695
|
-
|
|
696
|
-
export const HeadlessMemoryRememberResultSchema = z
|
|
697
|
-
.object({
|
|
698
|
-
success: z.literal(true),
|
|
699
|
-
message: z.string(),
|
|
700
|
-
data: z.object({ id: z.string(), count: z.number() }),
|
|
701
|
-
})
|
|
702
|
-
.strict();
|
|
703
|
-
|
|
704
|
-
export const HeadlessMemoryRecallResultSchema = z
|
|
705
|
-
.object({
|
|
706
|
-
success: z.literal(true),
|
|
707
|
-
message: z.string(),
|
|
708
|
-
count: NonNegativeIntSchema,
|
|
709
|
-
memories: z.array(z.unknown()),
|
|
710
|
-
})
|
|
711
|
-
.strict();
|
|
712
|
-
|
|
713
|
-
export const HeadlessMemoryListResultSchema = z
|
|
714
|
-
.object({
|
|
715
|
-
memories: z.array(z.unknown()),
|
|
716
|
-
count: NonNegativeIntSchema,
|
|
717
|
-
})
|
|
718
|
-
.strict();
|
|
719
|
-
|
|
720
|
-
export const HeadlessMemoryForgetResultSchema = z
|
|
721
|
-
.object({
|
|
722
|
-
success: z.literal(true),
|
|
723
|
-
message: z.string(),
|
|
724
|
-
deleted: z.boolean(),
|
|
725
|
-
})
|
|
726
|
-
.strict();
|
|
727
|
-
|
|
728
|
-
export const HeadlessMemoryRecallKnowledgeResultSchema = z
|
|
729
|
-
.object({
|
|
730
|
-
tools: z.array(z.unknown()),
|
|
731
|
-
count: NonNegativeIntSchema,
|
|
732
|
-
})
|
|
733
|
-
.strict();
|
|
734
|
-
|
|
735
|
-
export const HeadlessArionListResultSchema = z
|
|
736
|
-
.object({
|
|
737
|
-
arions: z.array(z.unknown()),
|
|
738
|
-
})
|
|
739
|
-
.strict();
|
|
740
|
-
|
|
741
|
-
export const HeadlessArionHatchResultSchema = z
|
|
742
|
-
.object({
|
|
743
|
-
mode: z.string(),
|
|
744
|
-
prompt: z.string(),
|
|
745
|
-
name: NonEmptyStringSchema,
|
|
746
|
-
description: z.string().optional(),
|
|
747
|
-
})
|
|
748
|
-
.strict();
|
|
749
|
-
|
|
750
|
-
export const HeadlessArionBecomeResultSchema = z
|
|
751
|
-
.object({
|
|
752
|
-
arion: z.unknown(),
|
|
753
|
-
activeArion: z.string(),
|
|
754
|
-
})
|
|
755
|
-
.strict();
|
|
756
|
-
|
|
757
|
-
export const HeadlessArionMutateResultSchema = z
|
|
758
|
-
.object({
|
|
759
|
-
success: z.literal(true),
|
|
760
|
-
name: NonEmptyStringSchema,
|
|
761
|
-
})
|
|
762
|
-
.strict();
|
|
763
|
-
|
|
764
|
-
export const HeadlessArionCreateResultSchema = z
|
|
765
|
-
.object({
|
|
766
|
-
arion: z.unknown(),
|
|
767
|
-
})
|
|
768
|
-
.strict();
|
|
769
|
-
|
|
770
|
-
export const HeadlessModelListResultSchema = z
|
|
771
|
-
.object({
|
|
772
|
-
models: z.array(z.unknown()),
|
|
773
|
-
currentModel: z.unknown().optional(),
|
|
774
|
-
})
|
|
775
|
-
.strict();
|
|
776
|
-
|
|
777
|
-
export const HeadlessModelSetResultSchema = z
|
|
778
|
-
.object({
|
|
779
|
-
currentModel: NonEmptyStringSchema,
|
|
780
|
-
})
|
|
781
|
-
.catchall(z.unknown());
|
|
782
|
-
|
|
783
|
-
export const HeadlessModelRefreshResultSchema = z
|
|
784
|
-
.object({
|
|
785
|
-
models: z.array(z.unknown()),
|
|
786
|
-
})
|
|
787
|
-
.strict();
|
|
788
|
-
|
|
789
|
-
export const HeadlessAuthStatusResultSchema = z.object({}).catchall(z.unknown());
|
|
790
|
-
|
|
791
|
-
export const HeadlessAuthLoginResultSchema = z.object({}).catchall(z.unknown());
|
|
792
|
-
|
|
793
|
-
export const HeadlessAuthLogoutResultSchema = z.object({}).catchall(z.unknown());
|
|
794
|
-
|
|
795
|
-
export const HeadlessConfigThemeGetResultSchema = z
|
|
796
|
-
.object({
|
|
797
|
-
theme: z.unknown(),
|
|
798
|
-
})
|
|
799
|
-
.strict();
|
|
800
|
-
|
|
801
|
-
export const HeadlessConfigThemeSetResultSchema = z
|
|
802
|
-
.object({
|
|
803
|
-
theme: z.string(),
|
|
804
|
-
})
|
|
805
|
-
.catchall(z.unknown());
|
|
806
|
-
|
|
807
|
-
export const HeadlessConfigAutonomyGetResultSchema = z
|
|
808
|
-
.object({
|
|
809
|
-
autonomy: z.unknown(),
|
|
810
|
-
})
|
|
811
|
-
.strict();
|
|
812
|
-
|
|
813
|
-
export const HeadlessConfigAutonomySetResultSchema = z
|
|
814
|
-
.object({
|
|
815
|
-
autonomy: z.string(),
|
|
816
|
-
})
|
|
817
|
-
.catchall(z.unknown());
|
|
818
|
-
|
|
819
|
-
export const HeadlessSystemRestartResultSchema = z.object({}).catchall(z.unknown());
|
|
820
|
-
|
|
821
|
-
export const HeadlessSystemTerminalSetupResultSchema = z.object({}).catchall(z.unknown());
|
|
822
|
-
|
|
823
|
-
export const HeadlessHookReflectResultSchema = z.object({}).catchall(z.unknown());
|
|
824
|
-
|
|
825
|
-
export const HeadlessHookConsolidateResultSchema = z.object({}).catchall(z.unknown());
|
|
826
|
-
|
|
827
|
-
export const HeadlessHookIngestResultSchema = z.object({}).catchall(z.unknown());
|
|
828
|
-
|
|
829
|
-
export const HeadlessHookHarvestResultSchema = z.object({}).catchall(z.unknown());
|
|
830
|
-
|
|
831
|
-
export const HeadlessOperationSuccessResultSchema = z.union([
|
|
832
|
-
RunResultSchema,
|
|
833
|
-
HeadlessSessionListResultSchema,
|
|
834
|
-
HeadlessSessionReadResultSchema,
|
|
835
|
-
HeadlessSessionLoadResultSchema,
|
|
836
|
-
HeadlessSessionForkResultSchema,
|
|
837
|
-
HeadlessPeerListResultSchema,
|
|
838
|
-
HeadlessNearbyPeerListResultSchema,
|
|
839
|
-
HeadlessPendingPairListResultSchema,
|
|
840
|
-
HeadlessClientListResultSchema,
|
|
841
|
-
HeadlessInboxListResultSchema,
|
|
842
|
-
HeadlessMessageSendResultSchema,
|
|
843
|
-
RuntimeStatusSchema,
|
|
844
|
-
HeadlessPeerInviteResultSchema,
|
|
845
|
-
HeadlessAcceptInviteTokenResultSchema,
|
|
846
|
-
HeadlessPendingPairRespondResultSchema,
|
|
847
|
-
HeadlessPeerConnectResultSchema,
|
|
848
|
-
HeadlessDirectPairResultSchema,
|
|
849
|
-
HeadlessRepairPeerResultSchema,
|
|
850
|
-
HeadlessRevokePeerResultSchema,
|
|
851
|
-
HeadlessHookExtractResultSchema,
|
|
852
|
-
HeadlessRunAbortResultSchema,
|
|
853
|
-
HeadlessInteractionRespondResultSchema,
|
|
854
|
-
HeadlessMemoryRememberResultSchema,
|
|
855
|
-
HeadlessMemoryRecallResultSchema,
|
|
856
|
-
HeadlessMemoryListResultSchema,
|
|
857
|
-
HeadlessMemoryForgetResultSchema,
|
|
858
|
-
HeadlessMemoryRecallKnowledgeResultSchema,
|
|
859
|
-
HeadlessArionListResultSchema,
|
|
860
|
-
HeadlessArionHatchResultSchema,
|
|
861
|
-
HeadlessArionBecomeResultSchema,
|
|
862
|
-
HeadlessArionMutateResultSchema,
|
|
863
|
-
HeadlessArionCreateResultSchema,
|
|
864
|
-
HeadlessModelListResultSchema,
|
|
865
|
-
HeadlessModelSetResultSchema,
|
|
866
|
-
HeadlessModelRefreshResultSchema,
|
|
867
|
-
HeadlessAuthStatusResultSchema,
|
|
868
|
-
HeadlessAuthLoginResultSchema,
|
|
869
|
-
HeadlessAuthLogoutResultSchema,
|
|
870
|
-
HeadlessConfigThemeGetResultSchema,
|
|
871
|
-
HeadlessConfigThemeSetResultSchema,
|
|
872
|
-
HeadlessConfigAutonomyGetResultSchema,
|
|
873
|
-
HeadlessConfigAutonomySetResultSchema,
|
|
874
|
-
HeadlessSystemRestartResultSchema,
|
|
875
|
-
HeadlessSystemTerminalSetupResultSchema,
|
|
876
|
-
HeadlessHookReflectResultSchema,
|
|
877
|
-
HeadlessHookConsolidateResultSchema,
|
|
878
|
-
HeadlessHookIngestResultSchema,
|
|
879
|
-
HeadlessHookHarvestResultSchema,
|
|
880
|
-
]);
|
|
881
|
-
|
|
882
|
-
export const HeadlessRunStartInputSchema = RunRequestSchema.extend({
|
|
883
|
-
sessionId: NonEmptyStringSchema.optional(),
|
|
884
|
-
});
|
|
885
|
-
export type HeadlessRunStartInput = z.infer<typeof HeadlessRunStartInputSchema>;
|
|
886
|
-
|
|
887
|
-
export const HeadlessRunResumeInputSchema = ResumeRunRequestSchema.extend({
|
|
888
|
-
sessionId: NonEmptyStringSchema.optional(),
|
|
889
|
-
});
|
|
890
|
-
export type HeadlessRunResumeInput = z.infer<typeof HeadlessRunResumeInputSchema>;
|
|
891
|
-
|
|
892
|
-
export interface HeadlessOperationSchemaDefinition {
|
|
893
|
-
input: z.ZodTypeAny;
|
|
894
|
-
result: z.ZodTypeAny;
|
|
895
|
-
event?: z.ZodTypeAny;
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
export const HEADLESS_OPERATION_SCHEMAS = {
|
|
899
|
-
"run.start": {
|
|
900
|
-
input: HeadlessRunStartInputSchema,
|
|
901
|
-
result: RunResultSchema,
|
|
902
|
-
event: RuntimeRunEventSchema,
|
|
903
|
-
},
|
|
904
|
-
"run.resume": {
|
|
905
|
-
input: HeadlessRunResumeInputSchema,
|
|
906
|
-
result: RunResultSchema,
|
|
907
|
-
},
|
|
908
|
-
"run.abort": { input: HeadlessRunAbortInputSchema, result: HeadlessRunAbortResultSchema },
|
|
909
|
-
"interaction.respond": {
|
|
910
|
-
input: z
|
|
911
|
-
.object({
|
|
912
|
-
interactionId: HeadlessInteractionIdSchema,
|
|
913
|
-
response: HeadlessInteractionResponsePayloadSchema,
|
|
914
|
-
})
|
|
915
|
-
.strict(),
|
|
916
|
-
result: HeadlessInteractionRespondResultSchema,
|
|
917
|
-
},
|
|
918
|
-
"session.list": {
|
|
919
|
-
input: HeadlessSessionListInputSchema,
|
|
920
|
-
result: HeadlessSessionListResultSchema,
|
|
921
|
-
},
|
|
922
|
-
"session.read": {
|
|
923
|
-
input: HeadlessSessionReferenceInputSchema,
|
|
924
|
-
result: HeadlessSessionReadResultSchema,
|
|
925
|
-
},
|
|
926
|
-
"session.load": {
|
|
927
|
-
input: HeadlessSessionReferenceInputSchema,
|
|
928
|
-
result: HeadlessSessionLoadResultSchema,
|
|
929
|
-
},
|
|
930
|
-
"session.fork": {
|
|
931
|
-
input: HeadlessSessionForkInputSchema,
|
|
932
|
-
result: HeadlessSessionForkResultSchema,
|
|
933
|
-
},
|
|
934
|
-
"memory.remember": {
|
|
935
|
-
input: HeadlessMemoryRememberInputSchema,
|
|
936
|
-
result: HeadlessMemoryRememberResultSchema,
|
|
937
|
-
},
|
|
938
|
-
"memory.recall": {
|
|
939
|
-
input: HeadlessMemoryRecallInputSchema,
|
|
940
|
-
result: HeadlessMemoryRecallResultSchema,
|
|
941
|
-
},
|
|
942
|
-
"memory.list": { input: HeadlessMemoryListInputSchema, result: HeadlessMemoryListResultSchema },
|
|
943
|
-
"memory.forget": {
|
|
944
|
-
input: HeadlessMemoryForgetInputSchema,
|
|
945
|
-
result: HeadlessMemoryForgetResultSchema,
|
|
946
|
-
},
|
|
947
|
-
"memory.recall_knowledge": {
|
|
948
|
-
input: HeadlessMemoryRecallKnowledgeInputSchema,
|
|
949
|
-
result: HeadlessMemoryRecallKnowledgeResultSchema,
|
|
950
|
-
},
|
|
951
|
-
"arion.list": { input: EmptyObjectSchema, result: HeadlessArionListResultSchema },
|
|
952
|
-
"arion.hatch": { input: HeadlessArionHatchInputSchema, result: HeadlessArionHatchResultSchema },
|
|
953
|
-
"arion.become": { input: HeadlessArionNameInputSchema, result: HeadlessArionBecomeResultSchema },
|
|
954
|
-
"arion.rest": { input: HeadlessArionNameInputSchema, result: HeadlessArionMutateResultSchema },
|
|
955
|
-
"arion.wake": { input: HeadlessArionNameInputSchema, result: HeadlessArionMutateResultSchema },
|
|
956
|
-
"arion.create": {
|
|
957
|
-
input: HeadlessArionCreateInputSchema,
|
|
958
|
-
result: HeadlessArionCreateResultSchema,
|
|
959
|
-
},
|
|
960
|
-
"model.list": { input: EmptyObjectSchema, result: HeadlessModelListResultSchema },
|
|
961
|
-
"model.set": { input: HeadlessModelSetInputSchema, result: HeadlessModelSetResultSchema },
|
|
962
|
-
"model.refresh": { input: EmptyObjectSchema, result: HeadlessModelRefreshResultSchema },
|
|
963
|
-
"auth.status": { input: EmptyObjectSchema, result: HeadlessAuthStatusResultSchema },
|
|
964
|
-
"auth.login": { input: HeadlessAuthLoginInputSchema, result: HeadlessAuthLoginResultSchema },
|
|
965
|
-
"auth.logout": { input: HeadlessAuthLogoutInputSchema, result: HeadlessAuthLogoutResultSchema },
|
|
966
|
-
"peer.list": { input: EmptyObjectSchema, result: HeadlessPeerListResultSchema },
|
|
967
|
-
"peer.list_nearby": { input: EmptyObjectSchema, result: HeadlessNearbyPeerListResultSchema },
|
|
968
|
-
"peer.pending.list": {
|
|
969
|
-
input: EmptyObjectSchema,
|
|
970
|
-
result: HeadlessPendingPairListResultSchema,
|
|
971
|
-
},
|
|
972
|
-
"peer.pending.respond": {
|
|
973
|
-
input: PairRequestDecisionSchema,
|
|
974
|
-
result: HeadlessPendingPairRespondResultSchema,
|
|
975
|
-
},
|
|
976
|
-
"peer.invite": { input: CreateInviteRequestSchema, result: HeadlessPeerInviteResultSchema },
|
|
977
|
-
"peer.connect": { input: InvitePeerRequestSchema, result: HeadlessPeerConnectResultSchema },
|
|
978
|
-
"peer.accept_invite": {
|
|
979
|
-
input: AcceptInviteTokenRequestSchema,
|
|
980
|
-
result: HeadlessAcceptInviteTokenResultSchema,
|
|
981
|
-
},
|
|
982
|
-
"peer.direct_pair": { input: DirectPairRequestSchema, result: HeadlessDirectPairResultSchema },
|
|
983
|
-
"peer.repair": { input: RepairPeerRequestSchema, result: HeadlessRepairPeerResultSchema },
|
|
984
|
-
"peer.revoke": { input: RevokePeerRequestSchema, result: HeadlessRevokePeerResultSchema },
|
|
985
|
-
"client.list": { input: EmptyObjectSchema, result: HeadlessClientListResultSchema },
|
|
986
|
-
"client.inbox.list": {
|
|
987
|
-
input: HeadlessClientInboxListInputSchema,
|
|
988
|
-
result: HeadlessInboxListResultSchema,
|
|
989
|
-
},
|
|
990
|
-
"message.send": {
|
|
991
|
-
input: HeadlessMessageSendInputSchema,
|
|
992
|
-
result: HeadlessMessageSendResultSchema,
|
|
993
|
-
},
|
|
994
|
-
"message.inbox.list": {
|
|
995
|
-
input: HeadlessMessageInboxListInputSchema,
|
|
996
|
-
result: HeadlessInboxListResultSchema,
|
|
997
|
-
},
|
|
998
|
-
"config.theme.get": { input: EmptyObjectSchema, result: HeadlessConfigThemeGetResultSchema },
|
|
999
|
-
"config.theme.set": {
|
|
1000
|
-
input: HeadlessConfigThemeSetInputSchema,
|
|
1001
|
-
result: HeadlessConfigThemeSetResultSchema,
|
|
1002
|
-
},
|
|
1003
|
-
"config.autonomy.get": {
|
|
1004
|
-
input: EmptyObjectSchema,
|
|
1005
|
-
result: HeadlessConfigAutonomyGetResultSchema,
|
|
1006
|
-
},
|
|
1007
|
-
"config.autonomy.set": {
|
|
1008
|
-
input: HeadlessConfigAutonomySetInputSchema,
|
|
1009
|
-
result: HeadlessConfigAutonomySetResultSchema,
|
|
1010
|
-
},
|
|
1011
|
-
"system.restart": {
|
|
1012
|
-
input: HeadlessSystemRestartInputSchema,
|
|
1013
|
-
result: HeadlessSystemRestartResultSchema,
|
|
1014
|
-
},
|
|
1015
|
-
"system.terminal_setup": {
|
|
1016
|
-
input: EmptyObjectSchema,
|
|
1017
|
-
result: HeadlessSystemTerminalSetupResultSchema,
|
|
1018
|
-
},
|
|
1019
|
-
"daemon.start": { input: HeadlessDaemonCommandInputSchema, result: RuntimeStatusSchema },
|
|
1020
|
-
"daemon.status": { input: HeadlessDaemonCommandInputSchema, result: RuntimeStatusSchema },
|
|
1021
|
-
"daemon.stop": { input: HeadlessDaemonCommandInputSchema, result: RuntimeStatusSchema },
|
|
1022
|
-
"hook.extract": {
|
|
1023
|
-
input: HeadlessHookExtractInputSchema,
|
|
1024
|
-
result: HeadlessHookExtractResultSchema,
|
|
1025
|
-
},
|
|
1026
|
-
"hook.reflect": {
|
|
1027
|
-
input: HeadlessHookReflectInputSchema,
|
|
1028
|
-
result: HeadlessHookReflectResultSchema,
|
|
1029
|
-
},
|
|
1030
|
-
"hook.consolidate": { input: EmptyObjectSchema, result: HeadlessHookConsolidateResultSchema },
|
|
1031
|
-
"hook.ingest": { input: HeadlessHookIngestInputSchema, result: HeadlessHookIngestResultSchema },
|
|
1032
|
-
"hook.harvest": {
|
|
1033
|
-
input: HeadlessHookHarvestInputSchema,
|
|
1034
|
-
result: HeadlessHookHarvestResultSchema,
|
|
1035
|
-
},
|
|
1036
|
-
} satisfies Record<HeadlessOperationName, HeadlessOperationSchemaDefinition>;
|
|
1037
|
-
|
|
1038
|
-
export const HEADLESS_STREAMING_OPERATION_NAMES = ["run.start"] as const;
|
|
1039
|
-
export const HEADLESS_CONNECTION_OWNED_OPERATION_NAMES = [
|
|
1040
|
-
"run.start",
|
|
1041
|
-
"run.resume",
|
|
1042
|
-
"interaction.respond",
|
|
1043
|
-
] as const;
|
|
1044
|
-
const HeadlessStreamingOperationNameSchema = z.enum(HEADLESS_STREAMING_OPERATION_NAMES);
|
|
1045
|
-
|
|
1046
|
-
function validateOperationPayload(
|
|
1047
|
-
op: HeadlessOperationName,
|
|
1048
|
-
kind: "input" | "result" | "event",
|
|
1049
|
-
value: unknown,
|
|
1050
|
-
ctx: z.RefinementCtx,
|
|
1051
|
-
): void {
|
|
1052
|
-
const definition = HEADLESS_OPERATION_SCHEMAS[op];
|
|
1053
|
-
const schema =
|
|
1054
|
-
kind === "input"
|
|
1055
|
-
? definition.input
|
|
1056
|
-
: kind === "result"
|
|
1057
|
-
? definition.result
|
|
1058
|
-
: "event" in definition
|
|
1059
|
-
? definition.event
|
|
1060
|
-
: undefined;
|
|
1061
|
-
|
|
1062
|
-
if (!schema) {
|
|
1063
|
-
ctx.addIssue({
|
|
1064
|
-
code: z.ZodIssueCode.custom,
|
|
1065
|
-
message: `Operation ${op} does not define a ${kind} payload`,
|
|
1066
|
-
path: [kind],
|
|
1067
|
-
});
|
|
1068
|
-
return;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
if (!schema.safeParse(value).success) {
|
|
1072
|
-
ctx.addIssue({
|
|
1073
|
-
code: z.ZodIssueCode.custom,
|
|
1074
|
-
message: `Invalid ${kind} payload for operation ${op}`,
|
|
1075
|
-
path: [kind],
|
|
1076
|
-
});
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
export const HeadlessRequestSchema = z
|
|
1081
|
-
.object({
|
|
1082
|
-
kind: z.literal("request"),
|
|
1083
|
-
requestId: HeadlessRequestIdSchema,
|
|
1084
|
-
op: HeadlessOperationNameSchema,
|
|
1085
|
-
input: z.unknown(),
|
|
1086
|
-
})
|
|
1087
|
-
.strict()
|
|
1088
|
-
.superRefine((value, ctx) => {
|
|
1089
|
-
validateOperationPayload(value.op, "input", value.input, ctx);
|
|
1090
|
-
});
|
|
1091
|
-
export type HeadlessRequest = z.infer<typeof HeadlessRequestSchema>;
|
|
1092
|
-
|
|
1093
|
-
export const HeadlessEventSchema = z
|
|
1094
|
-
.object({
|
|
1095
|
-
kind: z.literal("event"),
|
|
1096
|
-
requestId: HeadlessRequestIdSchema,
|
|
1097
|
-
seq: NonNegativeIntSchema,
|
|
1098
|
-
op: HeadlessStreamingOperationNameSchema,
|
|
1099
|
-
event: z.unknown(),
|
|
1100
|
-
})
|
|
1101
|
-
.strict()
|
|
1102
|
-
.superRefine((value, ctx) => {
|
|
1103
|
-
validateOperationPayload(value.op, "event", value.event, ctx);
|
|
1104
|
-
});
|
|
1105
|
-
export type HeadlessEvent = z.infer<typeof HeadlessEventSchema>;
|
|
1106
|
-
|
|
1107
|
-
export const HeadlessSuccessResultSchema = z
|
|
1108
|
-
.object({
|
|
1109
|
-
kind: z.literal("result"),
|
|
1110
|
-
requestId: HeadlessRequestIdSchema,
|
|
1111
|
-
op: HeadlessOperationNameSchema,
|
|
1112
|
-
ok: z.literal(true),
|
|
1113
|
-
result: z.unknown(),
|
|
1114
|
-
})
|
|
1115
|
-
.strict()
|
|
1116
|
-
.superRefine((value, ctx) => {
|
|
1117
|
-
validateOperationPayload(value.op, "result", value.result, ctx);
|
|
1118
|
-
});
|
|
1119
|
-
|
|
1120
|
-
export const HeadlessFailureResultSchema = z
|
|
1121
|
-
.object({
|
|
1122
|
-
kind: z.literal("result"),
|
|
1123
|
-
requestId: HeadlessRequestIdSchema,
|
|
1124
|
-
op: z.union([HeadlessOperationNameSchema, z.literal("unknown")]),
|
|
1125
|
-
ok: z.literal(false),
|
|
1126
|
-
error: HeadlessErrorSchema,
|
|
1127
|
-
})
|
|
1128
|
-
.strict();
|
|
1129
|
-
|
|
1130
|
-
export const HeadlessResultSchema = z.union([
|
|
1131
|
-
HeadlessSuccessResultSchema,
|
|
1132
|
-
HeadlessFailureResultSchema,
|
|
1133
|
-
]);
|
|
1134
|
-
export type HeadlessResult = z.infer<typeof HeadlessResultSchema>;
|
|
1135
|
-
|
|
1136
|
-
export const HeadlessClientFrameSchema = z.union([
|
|
1137
|
-
HeadlessRequestSchema,
|
|
1138
|
-
HeadlessInteractionResponseSchema,
|
|
1139
|
-
]);
|
|
1140
|
-
export type HeadlessClientFrame = z.infer<typeof HeadlessClientFrameSchema>;
|
|
1141
|
-
|
|
1142
|
-
export const HeadlessServerFrameSchema = z.union([
|
|
1143
|
-
HeadlessEventSchema,
|
|
1144
|
-
HeadlessResultSchema,
|
|
1145
|
-
HeadlessInteractionRequestSchema,
|
|
1146
|
-
]);
|
|
1147
|
-
export type HeadlessServerFrame = z.infer<typeof HeadlessServerFrameSchema>;
|
|
1148
|
-
|
|
1149
|
-
export type HeadlessOperationSuccessResult = z.infer<typeof HeadlessOperationSuccessResultSchema>;
|