@aria-cli/tools 1.0.12 → 1.0.14
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/dist/index.js +378 -70
- package/dist/network-runtime/index.js +8 -12
- package/dist-cjs/index.js +400 -435
- package/dist-cjs/network-runtime/index.js +8 -172
- package/package.json +8 -6
- package/dist/.tsbuildinfo +0 -1
- package/dist/ask-user-interaction.js +0 -22
- package/dist/cache/web-cache.js +0 -66
- package/dist/definitions/arion.js +0 -104
- package/dist/definitions/browser/browser.js +0 -418
- package/dist/definitions/browser/index.js +0 -4
- package/dist/definitions/browser/pw-downloads.js +0 -114
- package/dist/definitions/browser/pw-interactions.js +0 -199
- package/dist/definitions/browser/pw-responses.js +0 -76
- package/dist/definitions/browser/pw-session.js +0 -310
- package/dist/definitions/browser/pw-shared.js +0 -66
- package/dist/definitions/browser/pw-snapshot.js +0 -301
- package/dist/definitions/browser/pw-state.js +0 -62
- package/dist/definitions/browser/types.js +0 -4
- package/dist/definitions/code-intelligence.js +0 -470
- package/dist/definitions/core.js +0 -109
- package/dist/definitions/delegation.js +0 -512
- package/dist/definitions/deploy.js +0 -65
- package/dist/definitions/filesystem.js +0 -196
- package/dist/definitions/frg.js +0 -63
- package/dist/definitions/index.js +0 -20
- package/dist/definitions/memory.js +0 -123
- package/dist/definitions/messaging.js +0 -625
- package/dist/definitions/meta.js +0 -349
- package/dist/definitions/network.js +0 -159
- package/dist/definitions/outlook.js +0 -277
- package/dist/definitions/patch/apply-patch.js +0 -184
- package/dist/definitions/patch/fuzzy-match.js +0 -166
- package/dist/definitions/patch/index.js +0 -1
- package/dist/definitions/patch/patch-parser.js +0 -207
- package/dist/definitions/patch/sandbox-paths.js +0 -105
- package/dist/definitions/process/index.js +0 -4
- package/dist/definitions/process/process-registry.js +0 -213
- package/dist/definitions/process/process.js +0 -386
- package/dist/definitions/process/pty-keys.js +0 -254
- package/dist/definitions/process/session-slug.js +0 -142
- package/dist/definitions/quip.js +0 -195
- package/dist/definitions/search.js +0 -60
- package/dist/definitions/session-history.js +0 -69
- package/dist/definitions/shell.js +0 -181
- package/dist/definitions/slack.js +0 -180
- package/dist/definitions/web.js +0 -109
- package/dist/executors/apply-patch.js +0 -901
- package/dist/executors/arion.js +0 -119
- package/dist/executors/code-intelligence.js +0 -882
- package/dist/executors/deploy.js +0 -848
- package/dist/executors/filesystem.js +0 -1122
- package/dist/executors/frg-freshness.js +0 -576
- package/dist/executors/frg.js +0 -298
- package/dist/executors/index.js +0 -46
- package/dist/executors/learning-meta.js +0 -1146
- package/dist/executors/lsp-client.js +0 -296
- package/dist/executors/memory.js +0 -750
- package/dist/executors/meta.js +0 -220
- package/dist/executors/process-registry.js +0 -465
- package/dist/executors/pty-session-store.js +0 -30
- package/dist/executors/pty.js +0 -271
- package/dist/executors/restart.js +0 -119
- package/dist/executors/search-freshness.js +0 -195
- package/dist/executors/search-types.js +0 -52
- package/dist/executors/search.js +0 -66
- package/dist/executors/self-diagnose.js +0 -398
- package/dist/executors/session-history.js +0 -283
- package/dist/executors/shell-safety.js +0 -473
- package/dist/executors/shell.js +0 -954
- package/dist/executors/utils.js +0 -33
- package/dist/executors/web.js +0 -542
- package/dist/extraction/content-extraction.js +0 -235
- package/dist/extraction/index.js +0 -4
- package/dist/headless-control-contract.js +0 -967
- package/dist/local-control-http-auth.js +0 -2
- package/dist/mcp/client.js +0 -181
- package/dist/mcp/connection.js +0 -480
- package/dist/mcp/index.js +0 -10
- package/dist/mcp/jsonrpc.js +0 -144
- package/dist/mcp/types.js +0 -7
- package/dist/network-control-adapter.js +0 -72
- package/dist/network-runtime/address-types.js +0 -165
- package/dist/network-runtime/db-owner-fencing.js +0 -69
- package/dist/network-runtime/delivery-receipts.js +0 -267
- package/dist/network-runtime/direct-endpoint-authority.js +0 -25
- package/dist/network-runtime/local-control-contract.js +0 -627
- package/dist/network-runtime/node-store-contract.js +0 -34
- package/dist/network-runtime/pair-route-contract.js +0 -77
- package/dist/network-runtime/peer-capabilities.js +0 -28
- package/dist/network-runtime/peer-principal-ref.js +0 -12
- package/dist/network-runtime/peer-state-machine.js +0 -121
- package/dist/network-runtime/protocol-schemas.js +0 -205
- package/dist/network-runtime/runtime-bootstrap-contract.js +0 -60
- package/dist/outlook/desktop-session.js +0 -279
- package/dist/policy.js +0 -149
- package/dist/providers/brave.js +0 -62
- package/dist/providers/duckduckgo.js +0 -176
- package/dist/providers/exa.js +0 -63
- package/dist/providers/firecrawl.js +0 -55
- package/dist/providers/index.js +0 -7
- package/dist/providers/jina.js +0 -49
- package/dist/providers/router.js +0 -96
- package/dist/providers/search-provider.js +0 -32
- package/dist/providers/tavily.js +0 -54
- package/dist/quip/desktop-session.js +0 -317
- package/dist/registry/index.js +0 -1
- package/dist/registry/registry.js +0 -756
- package/dist/runtime-socket-local-control-client.js +0 -330
- package/dist/security/dns-normalization.js +0 -19
- package/dist/security/dns-pinning.js +0 -123
- package/dist/security/external-content.js +0 -91
- package/dist/security/ssrf.js +0 -181
- package/dist/slack/desktop-session.js +0 -324
- package/dist/tool-factory.js +0 -47
- package/dist/types.js +0 -7
- package/dist/utils/retry.js +0 -132
- package/dist/utils/safe-parse-json.js +0 -160
- package/dist/utils/url.js +0 -19
- package/dist-cjs/.tsbuildinfo +0 -1
- package/dist-cjs/ask-user-interaction.js +0 -27
- package/dist-cjs/cache/web-cache.js +0 -70
- package/dist-cjs/definitions/arion.js +0 -107
- package/dist-cjs/definitions/browser/browser.js +0 -421
- package/dist-cjs/definitions/browser/index.js +0 -8
- package/dist-cjs/definitions/browser/pw-downloads.js +0 -117
- package/dist-cjs/definitions/browser/pw-interactions.js +0 -213
- package/dist-cjs/definitions/browser/pw-responses.js +0 -84
- package/dist-cjs/definitions/browser/pw-session.js +0 -326
- package/dist-cjs/definitions/browser/pw-shared.js +0 -72
- package/dist-cjs/definitions/browser/pw-snapshot.js +0 -307
- package/dist-cjs/definitions/browser/pw-state.js +0 -70
- package/dist-cjs/definitions/browser/types.js +0 -5
- package/dist-cjs/definitions/code-intelligence.js +0 -473
- package/dist-cjs/definitions/core.js +0 -133
- package/dist-cjs/definitions/delegation.js +0 -515
- package/dist-cjs/definitions/deploy.js +0 -68
- package/dist-cjs/definitions/filesystem.js +0 -199
- package/dist-cjs/definitions/frg.js +0 -66
- package/dist-cjs/definitions/index.js +0 -43
- package/dist-cjs/definitions/memory.js +0 -126
- package/dist-cjs/definitions/messaging.js +0 -631
- package/dist-cjs/definitions/meta.js +0 -352
- package/dist-cjs/definitions/network.js +0 -162
- package/dist-cjs/definitions/outlook.js +0 -280
- package/dist-cjs/definitions/patch/apply-patch.js +0 -191
- package/dist-cjs/definitions/patch/fuzzy-match.js +0 -172
- package/dist-cjs/definitions/patch/index.js +0 -5
- package/dist-cjs/definitions/patch/patch-parser.js +0 -215
- package/dist-cjs/definitions/patch/sandbox-paths.js +0 -113
- package/dist-cjs/definitions/process/index.js +0 -8
- package/dist-cjs/definitions/process/process-registry.js +0 -231
- package/dist-cjs/definitions/process/process.js +0 -389
- package/dist-cjs/definitions/process/pty-keys.js +0 -259
- package/dist-cjs/definitions/process/session-slug.js +0 -145
- package/dist-cjs/definitions/quip.js +0 -198
- package/dist-cjs/definitions/search.js +0 -63
- package/dist-cjs/definitions/session-history.js +0 -72
- package/dist-cjs/definitions/shell.js +0 -184
- package/dist-cjs/definitions/slack.js +0 -183
- package/dist-cjs/definitions/web.js +0 -112
- package/dist-cjs/executors/apply-patch.js +0 -938
- package/dist-cjs/executors/arion.js +0 -125
- package/dist-cjs/executors/code-intelligence.js +0 -925
- package/dist-cjs/executors/deploy.js +0 -869
- package/dist-cjs/executors/filesystem.js +0 -1167
- package/dist-cjs/executors/frg-freshness.js +0 -627
- package/dist-cjs/executors/frg.js +0 -334
- package/dist-cjs/executors/index.js +0 -143
- package/dist-cjs/executors/learning-meta.js +0 -1165
- package/dist-cjs/executors/lsp-client.js +0 -310
- package/dist-cjs/executors/memory.js +0 -796
- package/dist-cjs/executors/meta.js +0 -226
- package/dist-cjs/executors/process-registry.js +0 -469
- package/dist-cjs/executors/pty-session-store.js +0 -34
- package/dist-cjs/executors/pty.js +0 -312
- package/dist-cjs/executors/restart.js +0 -155
- package/dist-cjs/executors/search-freshness.js +0 -234
- package/dist-cjs/executors/search-types.js +0 -56
- package/dist-cjs/executors/search.js +0 -102
- package/dist-cjs/executors/self-diagnose.js +0 -434
- package/dist-cjs/executors/session-history.js +0 -320
- package/dist-cjs/executors/shell-safety.js +0 -478
- package/dist-cjs/executors/shell.js +0 -1001
- package/dist-cjs/executors/utils.js +0 -73
- package/dist-cjs/executors/web.js +0 -547
- package/dist-cjs/extraction/content-extraction.js +0 -243
- package/dist-cjs/extraction/index.js +0 -8
- package/dist-cjs/headless-control-contract.js +0 -972
- package/dist-cjs/local-control-http-auth.js +0 -5
- package/dist-cjs/mcp/client.js +0 -185
- package/dist-cjs/mcp/connection.js +0 -484
- package/dist-cjs/mcp/index.js +0 -30
- package/dist-cjs/mcp/jsonrpc.js +0 -148
- package/dist-cjs/mcp/types.js +0 -8
- package/dist-cjs/network-control-adapter.js +0 -77
- package/dist-cjs/network-runtime/address-types.js +0 -168
- package/dist-cjs/network-runtime/db-owner-fencing.js +0 -76
- package/dist-cjs/network-runtime/delivery-receipts.js +0 -276
- package/dist-cjs/network-runtime/direct-endpoint-authority.js +0 -29
- package/dist-cjs/network-runtime/local-control-contract.js +0 -633
- package/dist-cjs/network-runtime/node-store-contract.js +0 -38
- package/dist-cjs/network-runtime/pair-route-contract.js +0 -80
- package/dist-cjs/network-runtime/peer-capabilities.js +0 -37
- package/dist-cjs/network-runtime/peer-principal-ref.js +0 -15
- package/dist-cjs/network-runtime/peer-state-machine.js +0 -129
- package/dist-cjs/network-runtime/protocol-schemas.js +0 -212
- package/dist-cjs/network-runtime/runtime-bootstrap-contract.js +0 -63
- package/dist-cjs/outlook/desktop-session.js +0 -318
- package/dist-cjs/policy.js +0 -155
- package/dist-cjs/providers/brave.js +0 -66
- package/dist-cjs/providers/duckduckgo.js +0 -180
- package/dist-cjs/providers/exa.js +0 -67
- package/dist-cjs/providers/firecrawl.js +0 -59
- package/dist-cjs/providers/index.js +0 -17
- package/dist-cjs/providers/jina.js +0 -53
- package/dist-cjs/providers/router.js +0 -100
- package/dist-cjs/providers/search-provider.js +0 -36
- package/dist-cjs/providers/tavily.js +0 -58
- package/dist-cjs/quip/desktop-session.js +0 -353
- package/dist-cjs/registry/index.js +0 -6
- package/dist-cjs/registry/registry.js +0 -761
- package/dist-cjs/runtime-socket-local-control-client.js +0 -367
- package/dist-cjs/security/dns-normalization.js +0 -22
- package/dist-cjs/security/dns-pinning.js +0 -160
- package/dist-cjs/security/external-content.js +0 -95
- package/dist-cjs/security/ssrf.js +0 -221
- package/dist-cjs/slack/desktop-session.js +0 -366
- package/dist-cjs/tool-factory.js +0 -50
- package/dist-cjs/types.js +0 -8
- package/dist-cjs/utils/retry.js +0 -169
- package/dist-cjs/utils/safe-parse-json.js +0 -164
- package/dist-cjs/utils/url.js +0 -23
|
@@ -1,627 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { ClientIdSchema, ControlEndpointAdvertisementSchema, EndpointRevisionSchema, InboxAddressSchema, NodeIdSchema, PrincipalFingerprintSchema, PeerTransportIdSchema, RuntimeIdSchema, TlsCaFingerprintSchema, TransportEndpointAdvertisementSchema, } from "./address-types.js";
|
|
3
|
-
import { canonicalizeDeliveryReceipt, DeliveryReceiptInputSchema, RuntimeTransportSchema, DeliveryStateSchema, SessionStateSchema, DeliveryReadinessSchema, QueuedReasonSchema, } from "./delivery-receipts.js";
|
|
4
|
-
import { AcceptInviteRequestSchema } from "./pair-route-contract.js";
|
|
5
|
-
import { PeerIdentityStateSchema, PeerTransportStateSchema } from "./peer-state-machine.js";
|
|
6
|
-
const NonEmptyStringSchema = z.string().trim().min(1);
|
|
7
|
-
const AutonomySchema = z.enum(["minimal", "balanced", "high", "full"]);
|
|
8
|
-
const ToolNameListSchema = z.array(z.string()).optional();
|
|
9
|
-
const MessageHistorySchema = z.array(z.custom()).optional();
|
|
10
|
-
function toFastifyBodyJsonSchema(schema) {
|
|
11
|
-
const jsonSchema = z.toJSONSchema(schema);
|
|
12
|
-
delete jsonSchema.$schema;
|
|
13
|
-
return jsonSchema;
|
|
14
|
-
}
|
|
15
|
-
export { AcceptInviteRequestSchema };
|
|
16
|
-
export const RunRequestSchema = z
|
|
17
|
-
.object({
|
|
18
|
-
task: NonEmptyStringSchema,
|
|
19
|
-
arion: NonEmptyStringSchema.optional(),
|
|
20
|
-
cwd: NonEmptyStringSchema.optional(),
|
|
21
|
-
history: MessageHistorySchema,
|
|
22
|
-
requestedModel: NonEmptyStringSchema.optional(),
|
|
23
|
-
preferredTier: z.enum(["fast", "balanced", "powerful", "ensemble"]).optional(),
|
|
24
|
-
budget: z.number().positive().optional(),
|
|
25
|
-
maxTurns: z.number().int().positive().optional(),
|
|
26
|
-
autonomy: AutonomySchema.optional(),
|
|
27
|
-
allowedTools: ToolNameListSchema,
|
|
28
|
-
deniedTools: ToolNameListSchema,
|
|
29
|
-
noMemory: z.boolean().optional(),
|
|
30
|
-
systemPrompt: z.string().optional(),
|
|
31
|
-
approvalMode: z.enum(["pause", "approve", "deny"]).optional(),
|
|
32
|
-
askUserAnswers: z.array(z.string()).optional(),
|
|
33
|
-
})
|
|
34
|
-
.strict();
|
|
35
|
-
export const RuntimeErrorDiagnosticSchema = z.lazy(() => z
|
|
36
|
-
.object({
|
|
37
|
-
message: z.string(),
|
|
38
|
-
name: z.string().optional(),
|
|
39
|
-
stack: z.string().optional(),
|
|
40
|
-
cause: RuntimeErrorDiagnosticSchema.optional(),
|
|
41
|
-
})
|
|
42
|
-
.catchall(z.unknown()));
|
|
43
|
-
function extractRuntimeDiagnosticMessage(diagnostic) {
|
|
44
|
-
if (!diagnostic || typeof diagnostic !== "object") {
|
|
45
|
-
return undefined;
|
|
46
|
-
}
|
|
47
|
-
const message = diagnostic.message;
|
|
48
|
-
if (typeof message !== "string") {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
const trimmed = message.trim();
|
|
52
|
-
return trimmed.length > 0 ? trimmed : undefined;
|
|
53
|
-
}
|
|
54
|
-
function isGenericTrustedRuntimeMessage(message) {
|
|
55
|
-
const normalized = message.trim().toLowerCase();
|
|
56
|
-
return (normalized === "internal server error" ||
|
|
57
|
-
normalized.startsWith("internal server error:") ||
|
|
58
|
-
normalized.startsWith("http 500"));
|
|
59
|
-
}
|
|
60
|
-
export function resolveTrustedRuntimeErrorMessage(message, diagnostic) {
|
|
61
|
-
const fallback = typeof message === "string" && message.trim().length > 0 ? message : undefined;
|
|
62
|
-
const diagnosticMessage = extractRuntimeDiagnosticMessage(diagnostic);
|
|
63
|
-
if (!diagnosticMessage) {
|
|
64
|
-
return fallback;
|
|
65
|
-
}
|
|
66
|
-
if (!fallback || isGenericTrustedRuntimeMessage(fallback)) {
|
|
67
|
-
return diagnosticMessage;
|
|
68
|
-
}
|
|
69
|
-
return fallback;
|
|
70
|
-
}
|
|
71
|
-
export function createTrustedRuntimeError(message, diagnostic) {
|
|
72
|
-
const resolvedMessage = resolveTrustedRuntimeErrorMessage(message, diagnostic) ?? "Trusted runtime error";
|
|
73
|
-
return Object.assign(new Error(resolvedMessage), {
|
|
74
|
-
...(diagnostic === undefined ? {} : { diagnostic }),
|
|
75
|
-
...(typeof message === "string" && message.trim().length > 0 && message !== resolvedMessage
|
|
76
|
-
? { publicMessage: message }
|
|
77
|
-
: {}),
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
export const RunResultSchema = z
|
|
81
|
-
.object({
|
|
82
|
-
success: z.boolean(),
|
|
83
|
-
output: z.string().optional(),
|
|
84
|
-
messages: z.array(z.unknown()).optional(),
|
|
85
|
-
toolCalls: z.array(z.unknown()).optional(),
|
|
86
|
-
usage: z.unknown().optional(),
|
|
87
|
-
turnCount: z.number().int().nonnegative().optional(),
|
|
88
|
-
thinking: z.array(z.unknown()).optional(),
|
|
89
|
-
nativeToolResults: z.array(z.unknown()).optional(),
|
|
90
|
-
traces: z.array(z.unknown()).optional(),
|
|
91
|
-
pipelineTiming: z.unknown().optional(),
|
|
92
|
-
guardrailEvents: z.array(z.unknown()).optional(),
|
|
93
|
-
handoffs: z.array(z.unknown()).optional(),
|
|
94
|
-
state: z.unknown().optional(),
|
|
95
|
-
error: z.string().optional(),
|
|
96
|
-
diagnostic: RuntimeErrorDiagnosticSchema.optional(),
|
|
97
|
-
})
|
|
98
|
-
.strict();
|
|
99
|
-
export const ResumeRunRequestSchema = z
|
|
100
|
-
.object({
|
|
101
|
-
state: z.unknown(),
|
|
102
|
-
arion: NonEmptyStringSchema.optional(),
|
|
103
|
-
cwd: NonEmptyStringSchema.optional(),
|
|
104
|
-
requestedModel: NonEmptyStringSchema.optional(),
|
|
105
|
-
preferredTier: z.enum(["fast", "balanced", "powerful", "ensemble"]).optional(),
|
|
106
|
-
budget: z.number().positive().optional(),
|
|
107
|
-
maxTurns: z.number().int().positive().optional(),
|
|
108
|
-
autonomy: AutonomySchema.optional(),
|
|
109
|
-
allowedTools: ToolNameListSchema,
|
|
110
|
-
deniedTools: ToolNameListSchema,
|
|
111
|
-
noMemory: z.boolean().optional(),
|
|
112
|
-
systemPrompt: z.string().optional(),
|
|
113
|
-
approvalMode: z.enum(["pause", "approve", "deny"]).optional(),
|
|
114
|
-
askUserAnswers: z.array(z.string()).optional(),
|
|
115
|
-
})
|
|
116
|
-
.strict();
|
|
117
|
-
export const RuntimeRunEventSchema = z.discriminatedUnion("type", [
|
|
118
|
-
z.object({
|
|
119
|
-
type: z.literal("text_delta"),
|
|
120
|
-
content: z.string(),
|
|
121
|
-
}),
|
|
122
|
-
z.object({
|
|
123
|
-
type: z.literal("tool_start"),
|
|
124
|
-
id: NonEmptyStringSchema,
|
|
125
|
-
name: NonEmptyStringSchema,
|
|
126
|
-
input: z.unknown().optional(),
|
|
127
|
-
}),
|
|
128
|
-
z.object({
|
|
129
|
-
type: z.literal("approval_needed"),
|
|
130
|
-
toolName: NonEmptyStringSchema,
|
|
131
|
-
toolInput: z.unknown().optional(),
|
|
132
|
-
riskLevel: z.string().optional(),
|
|
133
|
-
issues: z.array(z.string()).optional(),
|
|
134
|
-
}),
|
|
135
|
-
z.object({
|
|
136
|
-
type: z.literal("tool_result"),
|
|
137
|
-
id: NonEmptyStringSchema,
|
|
138
|
-
name: NonEmptyStringSchema,
|
|
139
|
-
durationMs: z.number().nonnegative(),
|
|
140
|
-
result: z.unknown(),
|
|
141
|
-
input: z.unknown().optional(),
|
|
142
|
-
}),
|
|
143
|
-
z.object({
|
|
144
|
-
type: z.literal("usage_update"),
|
|
145
|
-
usage: z.unknown(),
|
|
146
|
-
}),
|
|
147
|
-
z.object({
|
|
148
|
-
type: z.literal("turn_complete"),
|
|
149
|
-
turnNumber: z.number().int().nonnegative(),
|
|
150
|
-
}),
|
|
151
|
-
z.object({
|
|
152
|
-
type: z.literal("guardrail_rejected"),
|
|
153
|
-
stage: z.enum(["input", "output"]),
|
|
154
|
-
message: z.string(),
|
|
155
|
-
}),
|
|
156
|
-
z.object({
|
|
157
|
-
type: z.literal("pipeline_timing"),
|
|
158
|
-
report: z.unknown(),
|
|
159
|
-
}),
|
|
160
|
-
z.object({
|
|
161
|
-
type: z.literal("messages_snapshot"),
|
|
162
|
-
messages: z.array(z.unknown()),
|
|
163
|
-
}),
|
|
164
|
-
z.object({
|
|
165
|
-
type: z.literal("error"),
|
|
166
|
-
error: z.object({
|
|
167
|
-
message: z.string(),
|
|
168
|
-
diagnostic: RuntimeErrorDiagnosticSchema.optional(),
|
|
169
|
-
}),
|
|
170
|
-
}),
|
|
171
|
-
z.object({
|
|
172
|
-
type: z.literal("native_tool_result"),
|
|
173
|
-
metadata: z.unknown(),
|
|
174
|
-
}),
|
|
175
|
-
z.object({
|
|
176
|
-
type: z.literal("thinking_start"),
|
|
177
|
-
}),
|
|
178
|
-
z.object({
|
|
179
|
-
type: z.literal("thinking_delta"),
|
|
180
|
-
content: z.string(),
|
|
181
|
-
}),
|
|
182
|
-
z.object({
|
|
183
|
-
type: z.literal("thinking_end"),
|
|
184
|
-
blocks: z.array(z.unknown()),
|
|
185
|
-
durationMs: z.number().nonnegative(),
|
|
186
|
-
}),
|
|
187
|
-
z.object({
|
|
188
|
-
type: z.literal("tool_args_delta"),
|
|
189
|
-
id: NonEmptyStringSchema,
|
|
190
|
-
args: z.string(),
|
|
191
|
-
}),
|
|
192
|
-
z.object({
|
|
193
|
-
type: z.literal("span_start"),
|
|
194
|
-
spanId: NonEmptyStringSchema,
|
|
195
|
-
spanType: NonEmptyStringSchema,
|
|
196
|
-
name: NonEmptyStringSchema,
|
|
197
|
-
}),
|
|
198
|
-
z.object({
|
|
199
|
-
type: z.literal("span_end"),
|
|
200
|
-
spanId: NonEmptyStringSchema,
|
|
201
|
-
durationMs: z.number().nonnegative(),
|
|
202
|
-
}),
|
|
203
|
-
z.object({
|
|
204
|
-
type: z.literal("handoff_start"),
|
|
205
|
-
target: NonEmptyStringSchema,
|
|
206
|
-
id: NonEmptyStringSchema,
|
|
207
|
-
}),
|
|
208
|
-
z.object({
|
|
209
|
-
type: z.literal("handoff_result"),
|
|
210
|
-
target: NonEmptyStringSchema,
|
|
211
|
-
result: z.string(),
|
|
212
|
-
id: NonEmptyStringSchema,
|
|
213
|
-
}),
|
|
214
|
-
z.object({
|
|
215
|
-
type: z.literal("paused"),
|
|
216
|
-
state: z.unknown(),
|
|
217
|
-
}),
|
|
218
|
-
]);
|
|
219
|
-
export const RuntimeQueuedReceiptSchema = z
|
|
220
|
-
.object(DeliveryReceiptInputSchema.shape)
|
|
221
|
-
.strict()
|
|
222
|
-
.transform((receipt) => canonicalizeDeliveryReceipt(receipt));
|
|
223
|
-
export const RuntimeDeliveryReceiptSchema = z
|
|
224
|
-
.object({
|
|
225
|
-
transport: RuntimeTransportSchema,
|
|
226
|
-
delivered: z.boolean(),
|
|
227
|
-
queued: z.boolean(),
|
|
228
|
-
accepted: z.boolean().optional(),
|
|
229
|
-
deliveryState: DeliveryStateSchema.optional(),
|
|
230
|
-
sessionState: SessionStateSchema.optional(),
|
|
231
|
-
deliveryReadiness: DeliveryReadinessSchema.optional(),
|
|
232
|
-
queuedReason: QueuedReasonSchema.optional(),
|
|
233
|
-
storedAt: z.number().int().nonnegative().optional(),
|
|
234
|
-
})
|
|
235
|
-
.strict()
|
|
236
|
-
.transform(({ storedAt, ...receipt }) => ({
|
|
237
|
-
...canonicalizeDeliveryReceipt(receipt),
|
|
238
|
-
...(storedAt !== undefined ? { storedAt } : {}),
|
|
239
|
-
}));
|
|
240
|
-
export const OutboundMessageSchema = z
|
|
241
|
-
.object({
|
|
242
|
-
rawMessage: z.record(z.string(), z.unknown()),
|
|
243
|
-
recipientInbox: InboxAddressSchema.optional(),
|
|
244
|
-
to: NonEmptyStringSchema.optional(),
|
|
245
|
-
content: z.string().optional(),
|
|
246
|
-
type: NonEmptyStringSchema.optional(),
|
|
247
|
-
priority: z.number().int().optional(),
|
|
248
|
-
correlationId: z.string().optional(),
|
|
249
|
-
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
250
|
-
})
|
|
251
|
-
.strict()
|
|
252
|
-
.superRefine((message, ctx) => {
|
|
253
|
-
if (!message.recipientInbox || message.to === undefined) {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
if (message.recipientInbox.kind === "client") {
|
|
257
|
-
ctx.addIssue({
|
|
258
|
-
code: z.ZodIssueCode.custom,
|
|
259
|
-
message: 'OutboundMessage.to is a compatibility alias for node recipients only; omit it for recipientInbox.kind === "client"',
|
|
260
|
-
path: ["to"],
|
|
261
|
-
});
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
if (message.recipientInbox.nodeId !== message.to) {
|
|
265
|
-
ctx.addIssue({
|
|
266
|
-
code: z.ZodIssueCode.custom,
|
|
267
|
-
message: "OutboundMessage.recipientInbox.nodeId must match OutboundMessage.to when both are provided",
|
|
268
|
-
path: ["to"],
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
export const RuntimeEventCursorSchema = z
|
|
273
|
-
.object({
|
|
274
|
-
afterRevision: z.number().int().nonnegative().optional(),
|
|
275
|
-
})
|
|
276
|
-
.strict();
|
|
277
|
-
export const InboxCursorSchema = z
|
|
278
|
-
.object({
|
|
279
|
-
afterCreatedAt: z.number().int().nonnegative().optional(),
|
|
280
|
-
})
|
|
281
|
-
.strict();
|
|
282
|
-
export const InboxListRequestSchema = z
|
|
283
|
-
.object({
|
|
284
|
-
cursor: InboxCursorSchema.optional(),
|
|
285
|
-
limit: z.number().int().positive().max(1000).optional(),
|
|
286
|
-
unreadOnly: z.boolean().optional(),
|
|
287
|
-
})
|
|
288
|
-
.strict();
|
|
289
|
-
export const PersistedInboxEventSchema = z
|
|
290
|
-
.object({
|
|
291
|
-
id: NonEmptyStringSchema,
|
|
292
|
-
senderNodeId: NodeIdSchema,
|
|
293
|
-
senderDisplayNameSnapshot: NonEmptyStringSchema.optional(),
|
|
294
|
-
senderType: NonEmptyStringSchema.optional(),
|
|
295
|
-
senderClientId: z.string().nullable().optional(),
|
|
296
|
-
recipientClientId: z.string().nullable().optional(),
|
|
297
|
-
inboxAddress: InboxAddressSchema,
|
|
298
|
-
type: NonEmptyStringSchema,
|
|
299
|
-
content: z.string(),
|
|
300
|
-
priority: z.number().int(),
|
|
301
|
-
createdAt: z.number().int().nonnegative(),
|
|
302
|
-
correlationId: z.string().nullable().optional(),
|
|
303
|
-
replyTo: z.string().nullable().optional(),
|
|
304
|
-
})
|
|
305
|
-
.strict();
|
|
306
|
-
export const PeerViewEventSchema = z
|
|
307
|
-
.object({
|
|
308
|
-
nodeId: NodeIdSchema,
|
|
309
|
-
transportPublicKey: PeerTransportIdSchema,
|
|
310
|
-
displayNameSnapshot: NonEmptyStringSchema.optional(),
|
|
311
|
-
identityState: PeerIdentityStateSchema,
|
|
312
|
-
transportState: PeerTransportStateSchema,
|
|
313
|
-
endpointRevision: EndpointRevisionSchema,
|
|
314
|
-
updatedAt: z.string(),
|
|
315
|
-
lastSeenAt: z.string().optional(),
|
|
316
|
-
})
|
|
317
|
-
.strict();
|
|
318
|
-
export const NearbyPeerViewSchema = z
|
|
319
|
-
.object({
|
|
320
|
-
displayNameSnapshot: NonEmptyStringSchema,
|
|
321
|
-
nodeId: NodeIdSchema,
|
|
322
|
-
host: NonEmptyStringSchema,
|
|
323
|
-
port: z.number().int().min(1).max(65535),
|
|
324
|
-
principalFingerprint: PrincipalFingerprintSchema,
|
|
325
|
-
version: NonEmptyStringSchema,
|
|
326
|
-
tlsCaFingerprint: TlsCaFingerprintSchema.optional(),
|
|
327
|
-
transport: z.enum(["lan", "wan"]).optional(),
|
|
328
|
-
status: z.enum(["discovered", "connected"]).optional(),
|
|
329
|
-
})
|
|
330
|
-
.strict();
|
|
331
|
-
export const RuntimeAutonomousLoopSafetyPolicySummarySchema = z
|
|
332
|
-
.object({
|
|
333
|
-
allowedToolCategories: z.array(NonEmptyStringSchema).optional(),
|
|
334
|
-
allowedShellCommands: z.array(NonEmptyStringSchema).optional(),
|
|
335
|
-
maxWriteOpsPerMinute: z.number().int().positive().optional(),
|
|
336
|
-
maxGitPushesPerHour: z.number().int().positive().optional(),
|
|
337
|
-
})
|
|
338
|
-
.strict();
|
|
339
|
-
export const RuntimeAutonomousLoopStatusSchema = z
|
|
340
|
-
.object({
|
|
341
|
-
status: z.enum(["running", "stopped"]),
|
|
342
|
-
intervalMs: z.number().int().positive().nullable(),
|
|
343
|
-
lastWakeTickAt: z.string().nullable(),
|
|
344
|
-
lastCheckpointResult: z.enum(["success", "error", "never"]),
|
|
345
|
-
safetyPolicySummary: RuntimeAutonomousLoopSafetyPolicySummarySchema,
|
|
346
|
-
ownerClientKind: NonEmptyStringSchema.nullable(),
|
|
347
|
-
})
|
|
348
|
-
.strict();
|
|
349
|
-
function createDefaultRuntimeAutonomousLoopStatus() {
|
|
350
|
-
return {
|
|
351
|
-
status: "stopped",
|
|
352
|
-
intervalMs: null,
|
|
353
|
-
lastWakeTickAt: null,
|
|
354
|
-
lastCheckpointResult: "never",
|
|
355
|
-
safetyPolicySummary: {},
|
|
356
|
-
ownerClientKind: null,
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
export const RuntimeStatusSchema = z
|
|
360
|
-
.object({
|
|
361
|
-
nodeId: NodeIdSchema,
|
|
362
|
-
runtimeId: RuntimeIdSchema,
|
|
363
|
-
port: z.number().int().min(1).max(65535),
|
|
364
|
-
attachedClients: z.number().int().nonnegative().optional(),
|
|
365
|
-
autonomousLoop: RuntimeAutonomousLoopStatusSchema.optional().default(createDefaultRuntimeAutonomousLoopStatus()),
|
|
366
|
-
})
|
|
367
|
-
.strict();
|
|
368
|
-
export const RuntimeAutonomousLoopCommandSchema = z
|
|
369
|
-
.object({
|
|
370
|
-
intervalMs: z.number().int().positive().optional(),
|
|
371
|
-
safetyPolicy: RuntimeAutonomousLoopSafetyPolicySummarySchema.optional(),
|
|
372
|
-
})
|
|
373
|
-
.strict();
|
|
374
|
-
export const PendingPairRequestViewSchema = z
|
|
375
|
-
.object({
|
|
376
|
-
id: NonEmptyStringSchema,
|
|
377
|
-
nodeId: NodeIdSchema,
|
|
378
|
-
displayNameSnapshot: NonEmptyStringSchema.optional(),
|
|
379
|
-
principalFingerprint: PrincipalFingerprintSchema,
|
|
380
|
-
})
|
|
381
|
-
.strict();
|
|
382
|
-
export const PendingInviteViewSchema = z
|
|
383
|
-
.object({
|
|
384
|
-
inviteId: NonEmptyStringSchema,
|
|
385
|
-
inviteLabel: NonEmptyStringSchema.optional(),
|
|
386
|
-
createdAt: NonEmptyStringSchema,
|
|
387
|
-
expiresAt: NonEmptyStringSchema.nullable().optional(),
|
|
388
|
-
})
|
|
389
|
-
.strict();
|
|
390
|
-
export const PairRequestDecisionSchema = z
|
|
391
|
-
.object({
|
|
392
|
-
requestId: NonEmptyStringSchema,
|
|
393
|
-
accepted: z.boolean(),
|
|
394
|
-
})
|
|
395
|
-
.strict();
|
|
396
|
-
export const PairRequestResponseSchema = z
|
|
397
|
-
.object({
|
|
398
|
-
accepted: z.boolean().optional(),
|
|
399
|
-
inviteToken: z.string().optional(),
|
|
400
|
-
error: z.string().optional(),
|
|
401
|
-
})
|
|
402
|
-
.strict();
|
|
403
|
-
export const CreateInviteRequestSchema = z
|
|
404
|
-
.object({
|
|
405
|
-
inviteLabel: NonEmptyStringSchema.optional(),
|
|
406
|
-
durationMs: z.number().int().min(0).optional(),
|
|
407
|
-
})
|
|
408
|
-
.strict();
|
|
409
|
-
export const CreateInviteResponseSchema = z
|
|
410
|
-
.object({
|
|
411
|
-
inviteToken: NonEmptyStringSchema,
|
|
412
|
-
pendingInvite: PendingInviteViewSchema,
|
|
413
|
-
})
|
|
414
|
-
.strict();
|
|
415
|
-
export const InvitePeerRequestSchema = z
|
|
416
|
-
.object({
|
|
417
|
-
nodeId: NodeIdSchema,
|
|
418
|
-
displayName: NonEmptyStringSchema,
|
|
419
|
-
principalFingerprint: PrincipalFingerprintSchema.optional(),
|
|
420
|
-
controlEndpoint: ControlEndpointAdvertisementSchema,
|
|
421
|
-
transportEndpoint: TransportEndpointAdvertisementSchema.optional(),
|
|
422
|
-
transport: z.enum(["lan", "wan"]).optional(),
|
|
423
|
-
})
|
|
424
|
-
.strict();
|
|
425
|
-
export const PairingProofStateSchema = z.enum(["pending_verification"]);
|
|
426
|
-
export const InvitePeerResultSchema = z.discriminatedUnion("mode", [
|
|
427
|
-
z
|
|
428
|
-
.object({
|
|
429
|
-
nodeId: NodeIdSchema,
|
|
430
|
-
displayNameSnapshot: NonEmptyStringSchema.optional(),
|
|
431
|
-
mode: z.literal("lan_direct"),
|
|
432
|
-
pairingProofState: z.literal("pending_verification"),
|
|
433
|
-
})
|
|
434
|
-
.strict(),
|
|
435
|
-
z
|
|
436
|
-
.object({
|
|
437
|
-
nodeId: NodeIdSchema,
|
|
438
|
-
displayNameSnapshot: NonEmptyStringSchema.optional(),
|
|
439
|
-
mode: z.literal("wan_pair"),
|
|
440
|
-
pairingProofState: z.literal("pending_verification"),
|
|
441
|
-
})
|
|
442
|
-
.strict(),
|
|
443
|
-
]);
|
|
444
|
-
export const AcceptInviteResponseSchema = z
|
|
445
|
-
.object({
|
|
446
|
-
success: z.boolean(),
|
|
447
|
-
nodeId: NodeIdSchema,
|
|
448
|
-
displayNameSnapshot: NonEmptyStringSchema.optional(),
|
|
449
|
-
})
|
|
450
|
-
.strict();
|
|
451
|
-
export const AcceptInviteTokenRequestSchema = z
|
|
452
|
-
.object({
|
|
453
|
-
inviteToken: NonEmptyStringSchema,
|
|
454
|
-
})
|
|
455
|
-
.strict();
|
|
456
|
-
export const AcceptInviteTokenResponseSchema = AcceptInviteResponseSchema;
|
|
457
|
-
export const CancelInviteRequestSchema = z
|
|
458
|
-
.object({
|
|
459
|
-
inviteId: NonEmptyStringSchema,
|
|
460
|
-
})
|
|
461
|
-
.strict();
|
|
462
|
-
export const CancelInviteResponseSchema = z
|
|
463
|
-
.object({
|
|
464
|
-
cancelled: z.boolean(),
|
|
465
|
-
inviteId: NonEmptyStringSchema,
|
|
466
|
-
})
|
|
467
|
-
.strict();
|
|
468
|
-
export const DirectPairRequestSchema = z
|
|
469
|
-
.object({
|
|
470
|
-
peerNodeId: NodeIdSchema,
|
|
471
|
-
principalFingerprint: PrincipalFingerprintSchema,
|
|
472
|
-
peerDisplayName: NonEmptyStringSchema.optional(),
|
|
473
|
-
peerWgPubkey: PeerTransportIdSchema,
|
|
474
|
-
peerSigningPubkey: NonEmptyStringSchema,
|
|
475
|
-
transportEndpoint: TransportEndpointAdvertisementSchema,
|
|
476
|
-
controlEndpoint: ControlEndpointAdvertisementSchema,
|
|
477
|
-
psk: NonEmptyStringSchema,
|
|
478
|
-
})
|
|
479
|
-
.strict();
|
|
480
|
-
export const DirectPairRequestJsonSchema = toFastifyBodyJsonSchema(DirectPairRequestSchema);
|
|
481
|
-
export const DirectPairResponseSchema = z
|
|
482
|
-
.object({
|
|
483
|
-
received: z.literal(true),
|
|
484
|
-
pairingProofState: z.literal("pending_verification"),
|
|
485
|
-
})
|
|
486
|
-
.strict();
|
|
487
|
-
export const RevokePeerRequestSchema = z
|
|
488
|
-
.object({
|
|
489
|
-
nodeId: NodeIdSchema,
|
|
490
|
-
envelope: z.record(z.string(), z.unknown()).optional(),
|
|
491
|
-
})
|
|
492
|
-
.strict();
|
|
493
|
-
export const RevokePeerResponseSchema = z
|
|
494
|
-
.object({
|
|
495
|
-
revoked: z.boolean(),
|
|
496
|
-
nodeId: NodeIdSchema,
|
|
497
|
-
displayNameSnapshot: NonEmptyStringSchema.optional(),
|
|
498
|
-
})
|
|
499
|
-
.strict();
|
|
500
|
-
export const RepairPeerRequestSchema = z
|
|
501
|
-
.object({
|
|
502
|
-
nodeId: NodeIdSchema,
|
|
503
|
-
endpointHost: NonEmptyStringSchema,
|
|
504
|
-
endpointPort: z.number().int().min(1).max(65535),
|
|
505
|
-
endpointRevision: EndpointRevisionSchema,
|
|
506
|
-
})
|
|
507
|
-
.strict();
|
|
508
|
-
export const RepairPeerResponseSchema = z
|
|
509
|
-
.object({
|
|
510
|
-
repaired: z.boolean(),
|
|
511
|
-
nodeId: NodeIdSchema,
|
|
512
|
-
endpointHost: NonEmptyStringSchema,
|
|
513
|
-
endpointPort: z.number().int().min(1).max(65535),
|
|
514
|
-
endpointRevision: EndpointRevisionSchema,
|
|
515
|
-
})
|
|
516
|
-
.strict();
|
|
517
|
-
export const LocalControlClientKindSchema = z.enum(["tui", "daemon-launcher", "pipe", "local-api"]);
|
|
518
|
-
export const AttachedClientViewSchema = z
|
|
519
|
-
.object({
|
|
520
|
-
clientId: ClientIdSchema,
|
|
521
|
-
clientKind: LocalControlClientKindSchema,
|
|
522
|
-
displayLabel: NonEmptyStringSchema,
|
|
523
|
-
self: z.boolean(),
|
|
524
|
-
attachedAt: NonEmptyStringSchema,
|
|
525
|
-
lastSeenAt: NonEmptyStringSchema,
|
|
526
|
-
})
|
|
527
|
-
.strict();
|
|
528
|
-
export const AttachedClientLeaseGrantSchema = z
|
|
529
|
-
.object({
|
|
530
|
-
clientId: ClientIdSchema,
|
|
531
|
-
clientAuthToken: NonEmptyStringSchema,
|
|
532
|
-
})
|
|
533
|
-
.strict();
|
|
534
|
-
export const AttachedClientAuthSchema = AttachedClientLeaseGrantSchema;
|
|
535
|
-
export const LocalControlSocketAttachClientRequestSchema = z
|
|
536
|
-
.object({
|
|
537
|
-
clientKind: LocalControlClientKindSchema,
|
|
538
|
-
lease: z.boolean().optional(),
|
|
539
|
-
pid: z.number().optional(),
|
|
540
|
-
displayName: z.string().optional(),
|
|
541
|
-
})
|
|
542
|
-
.strict();
|
|
543
|
-
export const LocalControlSocketAttachClientResponseSchema = AttachedClientLeaseGrantSchema;
|
|
544
|
-
export const LocalControlSocketDetachClientRequestSchema = z
|
|
545
|
-
.object({
|
|
546
|
-
clientId: ClientIdSchema,
|
|
547
|
-
})
|
|
548
|
-
.strict();
|
|
549
|
-
export const LocalControlSocketDetachClientResponseSchema = z
|
|
550
|
-
.object({
|
|
551
|
-
detached: z.boolean(),
|
|
552
|
-
})
|
|
553
|
-
.strict();
|
|
554
|
-
export const LocalControlSocketMethodSchema = z.enum([
|
|
555
|
-
"submitRun",
|
|
556
|
-
"resumeRun",
|
|
557
|
-
"streamRun",
|
|
558
|
-
"subscribeRuntimeEvents",
|
|
559
|
-
"sendBestEffort",
|
|
560
|
-
"sendDurable",
|
|
561
|
-
"listInbox",
|
|
562
|
-
"listDirectClientInbox",
|
|
563
|
-
"listPeers",
|
|
564
|
-
"listNearbyPeers",
|
|
565
|
-
"listAttachedClients",
|
|
566
|
-
"subscribeDirectClientInbox",
|
|
567
|
-
"getRuntimeStatus",
|
|
568
|
-
"startAutonomousLoop",
|
|
569
|
-
"stopAutonomousLoop",
|
|
570
|
-
"getRuntimeBootstrap",
|
|
571
|
-
"listPendingPairRequests",
|
|
572
|
-
"respondToPairRequest",
|
|
573
|
-
"createInvite",
|
|
574
|
-
"listPendingInvites",
|
|
575
|
-
"acceptInviteToken",
|
|
576
|
-
"cancelInvite",
|
|
577
|
-
"invitePeer",
|
|
578
|
-
"acceptInvite",
|
|
579
|
-
"directPair",
|
|
580
|
-
"revokePeer",
|
|
581
|
-
"repairPeer",
|
|
582
|
-
"attachClient",
|
|
583
|
-
"detachClient",
|
|
584
|
-
"watchInbox",
|
|
585
|
-
]);
|
|
586
|
-
const AttachedClientAuthRequiredSocketMethods = new Set([
|
|
587
|
-
"listAttachedClients",
|
|
588
|
-
"listDirectClientInbox",
|
|
589
|
-
"subscribeDirectClientInbox",
|
|
590
|
-
]);
|
|
591
|
-
export const LocalControlSocketRequestSchema = z
|
|
592
|
-
.object({
|
|
593
|
-
id: NonEmptyStringSchema,
|
|
594
|
-
method: LocalControlSocketMethodSchema,
|
|
595
|
-
payload: z.unknown().optional(),
|
|
596
|
-
auth: AttachedClientAuthSchema.optional(),
|
|
597
|
-
})
|
|
598
|
-
.strict()
|
|
599
|
-
.superRefine((request, ctx) => {
|
|
600
|
-
if (AttachedClientAuthRequiredSocketMethods.has(request.method) && request.auth === undefined) {
|
|
601
|
-
ctx.addIssue({
|
|
602
|
-
code: z.ZodIssueCode.custom,
|
|
603
|
-
message: `Local control socket method ${request.method} requires attached-client auth`,
|
|
604
|
-
path: ["auth"],
|
|
605
|
-
});
|
|
606
|
-
}
|
|
607
|
-
});
|
|
608
|
-
export const LocalControlSocketSuccessResponseSchema = z
|
|
609
|
-
.object({
|
|
610
|
-
id: NonEmptyStringSchema,
|
|
611
|
-
ok: z.literal(true),
|
|
612
|
-
payload: z.unknown().optional(),
|
|
613
|
-
})
|
|
614
|
-
.strict();
|
|
615
|
-
export const LocalControlSocketErrorResponseSchema = z
|
|
616
|
-
.object({
|
|
617
|
-
id: NonEmptyStringSchema,
|
|
618
|
-
ok: z.literal(false),
|
|
619
|
-
error: NonEmptyStringSchema,
|
|
620
|
-
reason: z.string().optional(),
|
|
621
|
-
diagnostic: RuntimeErrorDiagnosticSchema.optional(),
|
|
622
|
-
})
|
|
623
|
-
.strict();
|
|
624
|
-
export const LocalControlSocketResponseSchema = z.discriminatedUnion("ok", [
|
|
625
|
-
LocalControlSocketSuccessResponseSchema,
|
|
626
|
-
LocalControlSocketErrorResponseSchema,
|
|
627
|
-
]);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { NodeIdSchema, RuntimeIdSchema, } from "./address-types.js";
|
|
3
|
-
const NonEmptyStringSchema = z.string().trim().min(1);
|
|
4
|
-
const RecordSchema = z.record(z.string(), z.unknown());
|
|
5
|
-
export { RuntimeOwnerRecordSchema } from "./address-types.js";
|
|
6
|
-
export const RuntimeEventKindSchema = z.enum([
|
|
7
|
-
"client_attached",
|
|
8
|
-
"client_detached",
|
|
9
|
-
"runtime_started",
|
|
10
|
-
"runtime_stopped",
|
|
11
|
-
"runtime_stale",
|
|
12
|
-
"runtime_restarted",
|
|
13
|
-
"pair_proposed",
|
|
14
|
-
"proof_committed",
|
|
15
|
-
"continuity_bound",
|
|
16
|
-
"revocation_committed",
|
|
17
|
-
"ingress_accepted",
|
|
18
|
-
"ingress_rejected",
|
|
19
|
-
"durable_send_queued",
|
|
20
|
-
"durable_send_dispatching",
|
|
21
|
-
"durable_send_acked",
|
|
22
|
-
"durable_send_expired",
|
|
23
|
-
]);
|
|
24
|
-
export const RuntimeEventSchema = z
|
|
25
|
-
.object({
|
|
26
|
-
eventId: NonEmptyStringSchema,
|
|
27
|
-
nodeId: NodeIdSchema,
|
|
28
|
-
runtimeId: RuntimeIdSchema,
|
|
29
|
-
kind: RuntimeEventKindSchema,
|
|
30
|
-
revision: z.number().int().nonnegative().optional(),
|
|
31
|
-
recordedAt: NonEmptyStringSchema,
|
|
32
|
-
payload: RecordSchema,
|
|
33
|
-
})
|
|
34
|
-
.strict();
|