@agentdock/wire 0.0.92 → 0.0.94
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/accountLanguage.d.ts +32 -0
- package/dist/accountLanguage.js +1 -0
- package/dist/agentCapabilities.d.ts +26 -0
- package/dist/agentCapabilities.js +1 -1
- package/dist/agentRuntimeSettings.d.ts +140 -0
- package/dist/agentRuntimeSettings.js +1 -0
- package/dist/enterpriseGateway.d.ts +215 -0
- package/dist/enterpriseGateway.js +1 -0
- package/dist/envelope.d.ts +45 -30
- package/dist/events.d.ts +24 -12
- package/dist/events.js +1 -1
- package/dist/features.d.ts +7 -3
- package/dist/features.js +1 -1
- package/dist/feedback.d.ts +18 -18
- package/dist/gateway.d.ts +386 -0
- package/dist/gateway.js +1 -0
- package/dist/handoffBrief.d.ts +14 -0
- package/dist/handoffBrief.js +52 -0
- package/dist/inboundEvents.d.ts +70 -0
- package/dist/inboundEvents.js +1 -1
- package/dist/index.d.ts +20 -12
- package/dist/index.js +1 -1
- package/dist/interactionEvents.d.ts +2 -2
- package/dist/legacyProtocol.d.ts +36 -36
- package/dist/machine.d.ts +9 -0
- package/dist/machine.js +1 -1
- package/dist/messageMeta.d.ts +6 -4
- package/dist/messageMeta.js +1 -1
- package/dist/messages.d.ts +338 -216
- package/dist/messages.js +1 -1
- package/dist/notification.d.ts +1 -1
- package/dist/notification.js +1 -1
- package/dist/rpc.d.ts +884 -84
- package/dist/rpc.js +1 -1
- package/dist/scheduledTasks.d.ts +50 -50
- package/dist/sessionBtw.d.ts +153 -0
- package/dist/sessionBtw.js +1 -0
- package/dist/sessionTitle.d.ts +16 -0
- package/dist/sessionTitle.js +1 -0
- package/dist/socketEvents.d.ts +9 -0
- package/dist/socketEvents.js +1 -1
- package/dist/sourceMetadata.d.ts +2 -2
- package/dist/stats.d.ts +87 -49
- package/dist/stats.js +1 -1
- package/dist/sync.d.ts +315 -0
- package/dist/sync.js +1 -1
- package/dist/workItems.d.ts +345 -0
- package/dist/workItems.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GatewayRouteStatusSchema: z.ZodEnum<["draft", "validating", "active", "disabled", "error"]>;
|
|
3
|
+
export type GatewayRouteStatus = z.infer<typeof GatewayRouteStatusSchema>;
|
|
4
|
+
export declare const GatewayProtocolSchema: z.ZodEnum<["anthropic_messages", "openai_responses", "openai_chat"]>;
|
|
5
|
+
export type GatewayProtocol = z.infer<typeof GatewayProtocolSchema>;
|
|
6
|
+
export declare const GatewayErrorCodeSchema: z.ZodEnum<["unauthorized", "route-not-found", "route-disabled", "connection-disabled", "protocol-not-supported", "request-too-large", "upstream-timeout", "upstream-unavailable", "client-aborted", "model-not-allowed", "invalid-request"]>;
|
|
7
|
+
export type GatewayErrorCode = z.infer<typeof GatewayErrorCodeSchema>;
|
|
8
|
+
/** Internal server-side route shape. It is never returned by a REST endpoint. */
|
|
9
|
+
export declare const GatewayRouteSchema: z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
alias: z.ZodString;
|
|
12
|
+
enterpriseId: z.ZodString;
|
|
13
|
+
agent: z.ZodEnum<["claude", "codex", "opencode"]>;
|
|
14
|
+
provider: z.ZodDefault<z.ZodString>;
|
|
15
|
+
model: z.ZodString;
|
|
16
|
+
requestProtocol: z.ZodEnum<["anthropic_messages", "openai_responses", "openai_chat"]>;
|
|
17
|
+
upstreamProtocol: z.ZodEnum<["anthropic_messages", "openai_responses", "openai_chat"]>;
|
|
18
|
+
status: z.ZodEnum<["draft", "validating", "active", "disabled", "error"]>;
|
|
19
|
+
tokenGeneration: z.ZodNumber;
|
|
20
|
+
connection: z.ZodObject<{
|
|
21
|
+
status: z.ZodEnum<["active", "disabled"]>;
|
|
22
|
+
messagesUrl: z.ZodString;
|
|
23
|
+
apiKey: z.ZodString;
|
|
24
|
+
authScheme: z.ZodEnum<["x-api-key", "bearer"]>;
|
|
25
|
+
}, "strict", z.ZodTypeAny, {
|
|
26
|
+
status: "active" | "disabled";
|
|
27
|
+
apiKey: string;
|
|
28
|
+
messagesUrl: string;
|
|
29
|
+
authScheme: "x-api-key" | "bearer";
|
|
30
|
+
}, {
|
|
31
|
+
status: "active" | "disabled";
|
|
32
|
+
apiKey: string;
|
|
33
|
+
messagesUrl: string;
|
|
34
|
+
authScheme: "x-api-key" | "bearer";
|
|
35
|
+
}>;
|
|
36
|
+
}, "strict", z.ZodTypeAny, {
|
|
37
|
+
status: "error" | "active" | "draft" | "validating" | "disabled";
|
|
38
|
+
model: string;
|
|
39
|
+
agent: "codex" | "claude" | "opencode";
|
|
40
|
+
id: string;
|
|
41
|
+
provider: string;
|
|
42
|
+
alias: string;
|
|
43
|
+
enterpriseId: string;
|
|
44
|
+
requestProtocol: "anthropic_messages" | "openai_responses" | "openai_chat";
|
|
45
|
+
upstreamProtocol: "anthropic_messages" | "openai_responses" | "openai_chat";
|
|
46
|
+
tokenGeneration: number;
|
|
47
|
+
connection: {
|
|
48
|
+
status: "active" | "disabled";
|
|
49
|
+
apiKey: string;
|
|
50
|
+
messagesUrl: string;
|
|
51
|
+
authScheme: "x-api-key" | "bearer";
|
|
52
|
+
};
|
|
53
|
+
}, {
|
|
54
|
+
status: "error" | "active" | "draft" | "validating" | "disabled";
|
|
55
|
+
model: string;
|
|
56
|
+
agent: "codex" | "claude" | "opencode";
|
|
57
|
+
id: string;
|
|
58
|
+
alias: string;
|
|
59
|
+
enterpriseId: string;
|
|
60
|
+
requestProtocol: "anthropic_messages" | "openai_responses" | "openai_chat";
|
|
61
|
+
upstreamProtocol: "anthropic_messages" | "openai_responses" | "openai_chat";
|
|
62
|
+
tokenGeneration: number;
|
|
63
|
+
connection: {
|
|
64
|
+
status: "active" | "disabled";
|
|
65
|
+
apiKey: string;
|
|
66
|
+
messagesUrl: string;
|
|
67
|
+
authScheme: "x-api-key" | "bearer";
|
|
68
|
+
};
|
|
69
|
+
provider?: string | undefined;
|
|
70
|
+
}>;
|
|
71
|
+
export type GatewayRoute = z.infer<typeof GatewayRouteSchema>;
|
|
72
|
+
export declare const GatewayTokenClaimsSchema: z.ZodObject<{
|
|
73
|
+
enterpriseId: z.ZodString;
|
|
74
|
+
userId: z.ZodString;
|
|
75
|
+
machineId: z.ZodString;
|
|
76
|
+
routeAlias: z.ZodString;
|
|
77
|
+
tokenGeneration: z.ZodNumber;
|
|
78
|
+
}, "strict", z.ZodTypeAny, {
|
|
79
|
+
machineId: string;
|
|
80
|
+
enterpriseId: string;
|
|
81
|
+
tokenGeneration: number;
|
|
82
|
+
userId: string;
|
|
83
|
+
routeAlias: string;
|
|
84
|
+
}, {
|
|
85
|
+
machineId: string;
|
|
86
|
+
enterpriseId: string;
|
|
87
|
+
tokenGeneration: number;
|
|
88
|
+
userId: string;
|
|
89
|
+
routeAlias: string;
|
|
90
|
+
}>;
|
|
91
|
+
export type GatewayTokenClaims = z.infer<typeof GatewayTokenClaimsSchema>;
|
|
92
|
+
export declare const GatewayConnectionCreateSchema: z.ZodObject<{
|
|
93
|
+
name: z.ZodString;
|
|
94
|
+
baseUrl: z.ZodEffects<z.ZodString, string, string>;
|
|
95
|
+
credentialRef: z.ZodString;
|
|
96
|
+
}, "strict", z.ZodTypeAny, {
|
|
97
|
+
name: string;
|
|
98
|
+
baseUrl: string;
|
|
99
|
+
credentialRef: string;
|
|
100
|
+
}, {
|
|
101
|
+
name: string;
|
|
102
|
+
baseUrl: string;
|
|
103
|
+
credentialRef: string;
|
|
104
|
+
}>;
|
|
105
|
+
export type GatewayConnectionCreate = z.infer<typeof GatewayConnectionCreateSchema>;
|
|
106
|
+
export declare const GatewayConnectionUpdateSchema: z.ZodObject<{
|
|
107
|
+
name: z.ZodOptional<z.ZodString>;
|
|
108
|
+
baseUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
109
|
+
credentialRef: z.ZodOptional<z.ZodString>;
|
|
110
|
+
status: z.ZodOptional<z.ZodEnum<["active", "disabled"]>>;
|
|
111
|
+
}, "strict", z.ZodTypeAny, {
|
|
112
|
+
status?: "active" | "disabled" | undefined;
|
|
113
|
+
name?: string | undefined;
|
|
114
|
+
baseUrl?: string | undefined;
|
|
115
|
+
credentialRef?: string | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
status?: "active" | "disabled" | undefined;
|
|
118
|
+
name?: string | undefined;
|
|
119
|
+
baseUrl?: string | undefined;
|
|
120
|
+
credentialRef?: string | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
export type GatewayConnectionUpdate = z.infer<typeof GatewayConnectionUpdateSchema>;
|
|
123
|
+
export declare const GatewayRouteCreateSchema: z.ZodDiscriminatedUnion<"agent", [z.ZodObject<{
|
|
124
|
+
connectionId: z.ZodString;
|
|
125
|
+
userId: z.ZodString;
|
|
126
|
+
machineId: z.ZodString;
|
|
127
|
+
agent: z.ZodLiteral<"claude">;
|
|
128
|
+
model: z.ZodString;
|
|
129
|
+
requestProtocol: z.ZodLiteral<"anthropic_messages">;
|
|
130
|
+
upstreamProtocol: z.ZodLiteral<"anthropic_messages">;
|
|
131
|
+
provider: z.ZodString;
|
|
132
|
+
alias: z.ZodString;
|
|
133
|
+
}, "strict", z.ZodTypeAny, {
|
|
134
|
+
model: string;
|
|
135
|
+
agent: "claude";
|
|
136
|
+
machineId: string;
|
|
137
|
+
provider: string;
|
|
138
|
+
alias: string;
|
|
139
|
+
requestProtocol: "anthropic_messages";
|
|
140
|
+
upstreamProtocol: "anthropic_messages";
|
|
141
|
+
userId: string;
|
|
142
|
+
connectionId: string;
|
|
143
|
+
}, {
|
|
144
|
+
model: string;
|
|
145
|
+
agent: "claude";
|
|
146
|
+
machineId: string;
|
|
147
|
+
provider: string;
|
|
148
|
+
alias: string;
|
|
149
|
+
requestProtocol: "anthropic_messages";
|
|
150
|
+
upstreamProtocol: "anthropic_messages";
|
|
151
|
+
userId: string;
|
|
152
|
+
connectionId: string;
|
|
153
|
+
}>, z.ZodObject<{
|
|
154
|
+
connectionId: z.ZodString;
|
|
155
|
+
userId: z.ZodString;
|
|
156
|
+
machineId: z.ZodString;
|
|
157
|
+
agent: z.ZodLiteral<"codex">;
|
|
158
|
+
model: z.ZodString;
|
|
159
|
+
requestProtocol: z.ZodLiteral<"openai_responses">;
|
|
160
|
+
upstreamProtocol: z.ZodLiteral<"openai_responses">;
|
|
161
|
+
provider: z.ZodString;
|
|
162
|
+
alias: z.ZodString;
|
|
163
|
+
}, "strict", z.ZodTypeAny, {
|
|
164
|
+
model: string;
|
|
165
|
+
agent: "codex";
|
|
166
|
+
machineId: string;
|
|
167
|
+
provider: string;
|
|
168
|
+
alias: string;
|
|
169
|
+
requestProtocol: "openai_responses";
|
|
170
|
+
upstreamProtocol: "openai_responses";
|
|
171
|
+
userId: string;
|
|
172
|
+
connectionId: string;
|
|
173
|
+
}, {
|
|
174
|
+
model: string;
|
|
175
|
+
agent: "codex";
|
|
176
|
+
machineId: string;
|
|
177
|
+
provider: string;
|
|
178
|
+
alias: string;
|
|
179
|
+
requestProtocol: "openai_responses";
|
|
180
|
+
upstreamProtocol: "openai_responses";
|
|
181
|
+
userId: string;
|
|
182
|
+
connectionId: string;
|
|
183
|
+
}>]>;
|
|
184
|
+
export type GatewayRouteCreate = z.infer<typeof GatewayRouteCreateSchema>;
|
|
185
|
+
export declare const GatewayRouteUpdateSchema: z.ZodObject<{
|
|
186
|
+
model: z.ZodOptional<z.ZodString>;
|
|
187
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
188
|
+
status: z.ZodOptional<z.ZodEnum<["disabled", "error"]>>;
|
|
189
|
+
}, "strict", z.ZodTypeAny, {
|
|
190
|
+
status?: "error" | "disabled" | undefined;
|
|
191
|
+
model?: string | undefined;
|
|
192
|
+
provider?: string | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
status?: "error" | "disabled" | undefined;
|
|
195
|
+
model?: string | undefined;
|
|
196
|
+
provider?: string | undefined;
|
|
197
|
+
}>;
|
|
198
|
+
export type GatewayRouteUpdate = z.infer<typeof GatewayRouteUpdateSchema>;
|
|
199
|
+
export declare const GatewayRequestListQuerySchema: z.ZodObject<{
|
|
200
|
+
from: z.ZodOptional<z.ZodString>;
|
|
201
|
+
to: z.ZodOptional<z.ZodString>;
|
|
202
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
203
|
+
machineId: z.ZodOptional<z.ZodString>;
|
|
204
|
+
routeId: z.ZodOptional<z.ZodString>;
|
|
205
|
+
agent: z.ZodOptional<z.ZodString>;
|
|
206
|
+
model: z.ZodOptional<z.ZodString>;
|
|
207
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
208
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
209
|
+
limit: z.ZodNumber;
|
|
210
|
+
offset: z.ZodNumber;
|
|
211
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
212
|
+
}, "strict", z.ZodTypeAny, {
|
|
213
|
+
limit: number;
|
|
214
|
+
offset: number;
|
|
215
|
+
model?: string | undefined;
|
|
216
|
+
agent?: string | undefined;
|
|
217
|
+
machineId?: string | undefined;
|
|
218
|
+
provider?: string | undefined;
|
|
219
|
+
userId?: string | undefined;
|
|
220
|
+
from?: string | undefined;
|
|
221
|
+
to?: string | undefined;
|
|
222
|
+
routeId?: string | undefined;
|
|
223
|
+
outcome?: string | undefined;
|
|
224
|
+
cursor?: string | undefined;
|
|
225
|
+
}, {
|
|
226
|
+
limit: number;
|
|
227
|
+
offset: number;
|
|
228
|
+
model?: string | undefined;
|
|
229
|
+
agent?: string | undefined;
|
|
230
|
+
machineId?: string | undefined;
|
|
231
|
+
provider?: string | undefined;
|
|
232
|
+
userId?: string | undefined;
|
|
233
|
+
from?: string | undefined;
|
|
234
|
+
to?: string | undefined;
|
|
235
|
+
routeId?: string | undefined;
|
|
236
|
+
outcome?: string | undefined;
|
|
237
|
+
cursor?: string | undefined;
|
|
238
|
+
}>;
|
|
239
|
+
export declare const GatewayUsageSummarySchema: z.ZodObject<{
|
|
240
|
+
requestCount: z.ZodNumber;
|
|
241
|
+
inputTokens: z.ZodNumber;
|
|
242
|
+
outputTokens: z.ZodNumber;
|
|
243
|
+
cacheReadTokens: z.ZodNumber;
|
|
244
|
+
cacheWriteTokens: z.ZodNumber;
|
|
245
|
+
reasoningTokens: z.ZodNumber;
|
|
246
|
+
totalTokens: z.ZodNumber;
|
|
247
|
+
costMicros: z.ZodNullable<z.ZodNumber>;
|
|
248
|
+
pricedCount: z.ZodNumber;
|
|
249
|
+
unpricedCount: z.ZodNumber;
|
|
250
|
+
errorCount: z.ZodNumber;
|
|
251
|
+
errorRate: z.ZodNumber;
|
|
252
|
+
latencyMs: z.ZodObject<{
|
|
253
|
+
p50: z.ZodNullable<z.ZodNumber>;
|
|
254
|
+
p95: z.ZodNullable<z.ZodNumber>;
|
|
255
|
+
}, "strict", z.ZodTypeAny, {
|
|
256
|
+
p50: number | null;
|
|
257
|
+
p95: number | null;
|
|
258
|
+
}, {
|
|
259
|
+
p50: number | null;
|
|
260
|
+
p95: number | null;
|
|
261
|
+
}>;
|
|
262
|
+
breakdown: z.ZodArray<z.ZodObject<{
|
|
263
|
+
agent: z.ZodNullable<z.ZodString>;
|
|
264
|
+
model: z.ZodNullable<z.ZodString>;
|
|
265
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
266
|
+
requestCount: z.ZodNumber;
|
|
267
|
+
inputTokens: z.ZodNumber;
|
|
268
|
+
outputTokens: z.ZodNumber;
|
|
269
|
+
totalTokens: z.ZodNumber;
|
|
270
|
+
costMicros: z.ZodNullable<z.ZodNumber>;
|
|
271
|
+
}, "strict", z.ZodTypeAny, {
|
|
272
|
+
model: string | null;
|
|
273
|
+
inputTokens: number;
|
|
274
|
+
outputTokens: number;
|
|
275
|
+
totalTokens: number;
|
|
276
|
+
agent: string | null;
|
|
277
|
+
provider: string | null;
|
|
278
|
+
requestCount: number;
|
|
279
|
+
costMicros: number | null;
|
|
280
|
+
}, {
|
|
281
|
+
model: string | null;
|
|
282
|
+
inputTokens: number;
|
|
283
|
+
outputTokens: number;
|
|
284
|
+
totalTokens: number;
|
|
285
|
+
agent: string | null;
|
|
286
|
+
provider: string | null;
|
|
287
|
+
requestCount: number;
|
|
288
|
+
costMicros: number | null;
|
|
289
|
+
}>, "many">;
|
|
290
|
+
}, "strict", z.ZodTypeAny, {
|
|
291
|
+
inputTokens: number;
|
|
292
|
+
outputTokens: number;
|
|
293
|
+
cacheReadTokens: number;
|
|
294
|
+
cacheWriteTokens: number;
|
|
295
|
+
totalTokens: number;
|
|
296
|
+
requestCount: number;
|
|
297
|
+
reasoningTokens: number;
|
|
298
|
+
costMicros: number | null;
|
|
299
|
+
pricedCount: number;
|
|
300
|
+
unpricedCount: number;
|
|
301
|
+
errorCount: number;
|
|
302
|
+
errorRate: number;
|
|
303
|
+
latencyMs: {
|
|
304
|
+
p50: number | null;
|
|
305
|
+
p95: number | null;
|
|
306
|
+
};
|
|
307
|
+
breakdown: {
|
|
308
|
+
model: string | null;
|
|
309
|
+
inputTokens: number;
|
|
310
|
+
outputTokens: number;
|
|
311
|
+
totalTokens: number;
|
|
312
|
+
agent: string | null;
|
|
313
|
+
provider: string | null;
|
|
314
|
+
requestCount: number;
|
|
315
|
+
costMicros: number | null;
|
|
316
|
+
}[];
|
|
317
|
+
}, {
|
|
318
|
+
inputTokens: number;
|
|
319
|
+
outputTokens: number;
|
|
320
|
+
cacheReadTokens: number;
|
|
321
|
+
cacheWriteTokens: number;
|
|
322
|
+
totalTokens: number;
|
|
323
|
+
requestCount: number;
|
|
324
|
+
reasoningTokens: number;
|
|
325
|
+
costMicros: number | null;
|
|
326
|
+
pricedCount: number;
|
|
327
|
+
unpricedCount: number;
|
|
328
|
+
errorCount: number;
|
|
329
|
+
errorRate: number;
|
|
330
|
+
latencyMs: {
|
|
331
|
+
p50: number | null;
|
|
332
|
+
p95: number | null;
|
|
333
|
+
};
|
|
334
|
+
breakdown: {
|
|
335
|
+
model: string | null;
|
|
336
|
+
inputTokens: number;
|
|
337
|
+
outputTokens: number;
|
|
338
|
+
totalTokens: number;
|
|
339
|
+
agent: string | null;
|
|
340
|
+
provider: string | null;
|
|
341
|
+
requestCount: number;
|
|
342
|
+
costMicros: number | null;
|
|
343
|
+
}[];
|
|
344
|
+
}>;
|
|
345
|
+
export type GatewayUsageSummary = z.infer<typeof GatewayUsageSummarySchema>;
|
|
346
|
+
export declare const GatewayDailyUsageSchema: z.ZodObject<{
|
|
347
|
+
day: z.ZodString;
|
|
348
|
+
agent: z.ZodNullable<z.ZodString>;
|
|
349
|
+
model: z.ZodNullable<z.ZodString>;
|
|
350
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
351
|
+
requestCount: z.ZodNumber;
|
|
352
|
+
inputTokens: z.ZodNumber;
|
|
353
|
+
outputTokens: z.ZodNumber;
|
|
354
|
+
cacheReadTokens: z.ZodNumber;
|
|
355
|
+
cacheWriteTokens: z.ZodNumber;
|
|
356
|
+
totalTokens: z.ZodNumber;
|
|
357
|
+
costMicros: z.ZodNullable<z.ZodNumber>;
|
|
358
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
359
|
+
}, "strict", z.ZodTypeAny, {
|
|
360
|
+
model: string | null;
|
|
361
|
+
inputTokens: number;
|
|
362
|
+
outputTokens: number;
|
|
363
|
+
cacheReadTokens: number;
|
|
364
|
+
cacheWriteTokens: number;
|
|
365
|
+
totalTokens: number;
|
|
366
|
+
agent: string | null;
|
|
367
|
+
provider: string | null;
|
|
368
|
+
requestCount: number;
|
|
369
|
+
costMicros: number | null;
|
|
370
|
+
day: string;
|
|
371
|
+
currency: string | null;
|
|
372
|
+
}, {
|
|
373
|
+
model: string | null;
|
|
374
|
+
inputTokens: number;
|
|
375
|
+
outputTokens: number;
|
|
376
|
+
cacheReadTokens: number;
|
|
377
|
+
cacheWriteTokens: number;
|
|
378
|
+
totalTokens: number;
|
|
379
|
+
agent: string | null;
|
|
380
|
+
provider: string | null;
|
|
381
|
+
requestCount: number;
|
|
382
|
+
costMicros: number | null;
|
|
383
|
+
day: string;
|
|
384
|
+
currency: string | null;
|
|
385
|
+
}>;
|
|
386
|
+
//# sourceMappingURL=gateway.d.ts.map
|
package/dist/gateway.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{z as e}from"zod";const a=e.string().url().refine(r=>{const t=r.replace(/^[a-z][a-z\d+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??"",o=t.indexOf("]"),n=(t.startsWith("[")&&o>0?t.slice(1,o):t.split(":",1)[0]??"").toLowerCase();return n!=="localhost"&&n!=="::1"&&!n.startsWith("127.")&&!n.startsWith("10.")&&!n.startsWith("192.168.")&&!n.startsWith("169.254.")&&!/^172\.(1[6-9]|2\d|3[0-1])\./.test(n)},"gateway upstream must not target a local or private address");export const GatewayRouteStatusSchema=e.enum(["draft","validating","active","disabled","error"]),GatewayProtocolSchema=e.enum(["anthropic_messages","openai_responses","openai_chat"]),GatewayErrorCodeSchema=e.enum(["unauthorized","route-not-found","route-disabled","connection-disabled","protocol-not-supported","request-too-large","upstream-timeout","upstream-unavailable","client-aborted","model-not-allowed","invalid-request"]);const i=e.object({status:e.enum(["active","disabled"]),messagesUrl:e.string().url(),apiKey:e.string().min(1),authScheme:e.enum(["x-api-key","bearer"])}).strict();export const GatewayRouteSchema=e.object({id:e.string().min(1),alias:e.string().min(1),enterpriseId:e.string().min(1),agent:e.enum(["claude","codex","opencode"]),provider:e.string().min(1).default("unknown"),model:e.string().min(1),requestProtocol:GatewayProtocolSchema,upstreamProtocol:GatewayProtocolSchema,status:GatewayRouteStatusSchema,tokenGeneration:e.number().int().nonnegative(),connection:i}).strict(),GatewayTokenClaimsSchema=e.object({enterpriseId:e.string().min(1),userId:e.string().min(1),machineId:e.string().min(1),routeAlias:e.string().min(1),tokenGeneration:e.number().int().nonnegative()}).strict(),GatewayConnectionCreateSchema=e.object({name:e.string().min(1).max(100),baseUrl:a,credentialRef:e.string().min(1).max(200)}).strict(),GatewayConnectionUpdateSchema=e.object({name:e.string().min(1).max(100).optional(),baseUrl:a.optional(),credentialRef:e.string().min(1).max(200).optional(),status:e.enum(["active","disabled"]).optional()}).strict();const s=e.object({connectionId:e.string().min(1),userId:e.string().min(1),machineId:e.string().min(1),agent:e.literal("claude"),model:e.string().min(1).max(200),requestProtocol:e.literal("anthropic_messages"),upstreamProtocol:e.literal("anthropic_messages"),provider:e.string().min(1).max(100),alias:e.string().min(1).max(100).regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/)}).strict(),m=e.object({connectionId:e.string().min(1),userId:e.string().min(1),machineId:e.string().min(1),agent:e.literal("codex"),model:e.string().min(1).max(200),requestProtocol:e.literal("openai_responses"),upstreamProtocol:e.literal("openai_responses"),provider:e.string().min(1).max(100),alias:e.string().min(1).max(100).regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/)}).strict();export const GatewayRouteCreateSchema=e.discriminatedUnion("agent",[s,m]),GatewayRouteUpdateSchema=e.object({model:e.string().min(1).max(200).optional(),provider:e.string().min(1).max(100).optional(),status:e.enum(["disabled","error"]).optional()}).strict(),GatewayRequestListQuerySchema=e.object({from:e.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),to:e.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),userId:e.string().optional(),machineId:e.string().optional(),routeId:e.string().optional(),agent:e.string().optional(),model:e.string().optional(),provider:e.string().optional(),outcome:e.string().optional(),limit:e.number().int().min(1).max(200),offset:e.number().int().min(0),cursor:e.string().optional()}).strict(),GatewayUsageSummarySchema=e.object({requestCount:e.number().int().nonnegative(),inputTokens:e.number().nonnegative(),outputTokens:e.number().nonnegative(),cacheReadTokens:e.number().nonnegative(),cacheWriteTokens:e.number().nonnegative(),reasoningTokens:e.number().nonnegative(),totalTokens:e.number().nonnegative(),costMicros:e.number().nullable(),pricedCount:e.number().int().nonnegative(),unpricedCount:e.number().int().nonnegative(),errorCount:e.number().int().nonnegative(),errorRate:e.number().min(0).max(1),latencyMs:e.object({p50:e.number().nullable(),p95:e.number().nullable()}).strict(),breakdown:e.array(e.object({agent:e.string().nullable(),model:e.string().nullable(),provider:e.string().nullable(),requestCount:e.number().int().nonnegative(),inputTokens:e.number().nonnegative(),outputTokens:e.number().nonnegative(),totalTokens:e.number().nonnegative(),costMicros:e.number().nullable()}).strict())}).strict(),GatewayDailyUsageSchema=e.object({day:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),agent:e.string().nullable(),model:e.string().nullable(),provider:e.string().nullable(),requestCount:e.number().int().nonnegative(),inputTokens:e.number().nonnegative(),outputTokens:e.number().nonnegative(),cacheReadTokens:e.number().nonnegative(),cacheWriteTokens:e.number().nonnegative(),totalTokens:e.number().nonnegative(),costMicros:e.number().nullable(),currency:e.string().nullable()}).strict();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { AccountLanguage } from './accountLanguage.js';
|
|
3
|
+
export declare const HANDOFF_BRIEF_TEMPLATE = "## Current status\nDescribe what is true now and what the next Agent should understand first.\n\n## Completed\n- List work that is actually done.\n\n## Verification\n- List checks, tests, or observations and their results.\n\n## Open issues and risks\n- List unfinished work, uncertainty, or say \"None known\".\n\n## Next steps\n- List the next concrete actions, including any user decision needed.";
|
|
4
|
+
/** Simplified-Chinese brief template. Section headings must match the SECTION_ALIASES aliases below. */
|
|
5
|
+
export declare const HANDOFF_BRIEF_TEMPLATE_ZH = "## \u5F53\u524D\u72B6\u6001\n\u63CF\u8FF0\u73B0\u5728\u7684\u60C5\u51B5\uFF0C\u4EE5\u53CA\u4E0B\u4E00\u4F4D Agent \u9996\u5148\u9700\u8981\u7406\u89E3\u7684\u5185\u5BB9\u3002\n\n## \u5DF2\u5B8C\u6210\n- \u5217\u51FA\u5B9E\u9645\u5DF2\u5B8C\u6210\u7684\u5DE5\u4F5C\u3002\n\n## \u9A8C\u8BC1\u7ED3\u679C\n- \u5217\u51FA\u68C0\u67E5\u3001\u6D4B\u8BD5\u6216\u89C2\u5BDF\u53CA\u5176\u7ED3\u679C\u3002\n\n## \u672A\u5B8C\u6210\u4E0E\u98CE\u9669\n- \u5217\u51FA\u672A\u5B8C\u6210\u7684\u5DE5\u4F5C\u3001\u4E0D\u786E\u5B9A\u6027\uFF0C\u6216\u5199\u300C\u6682\u65E0\u300D\u3002\n\n## \u4E0B\u4E00\u6B65\n- \u5217\u51FA\u63A5\u4E0B\u6765\u8981\u91C7\u53D6\u7684\u5177\u4F53\u884C\u52A8\uFF0C\u5305\u62EC\u9700\u8981\u7528\u6237\u51B3\u5B9A\u7684\u4E8B\u9879\u3002";
|
|
6
|
+
export declare const HANDOFF_BRIEF_REQUIREMENTS = "The brief must contain non-empty sections for Current status, Completed, Verification, Open issues and risks, and Next steps. Markdown inside each section is unrestricted.";
|
|
7
|
+
export declare const HANDOFF_SOURCE_REFERENCE_GUIDANCE = "Source reference rules:\n- Include at least one file path or resource identifier directly relevant to this handoff.\n- Prefer files actually changed, tests or configuration used for verification, and the relevant design document.\n- Each reference must let the next Agent locate context; do not use project names, directories, \"source code\", or \"tests\" as stand-ins.\n- References are navigation pointers, not proof of a claim or an acceptance result. Put commands and their results in Verification.\n- Do not include unrelated files just to make the list longer.\n\nGood: [\"packages/web/src/pages/SessionDetailPage.tsx\", \"packages/web/test/SessionDetailPage.test.tsx\"]\nBad: [\"packages/web\", \"source code\", \"tests\"]";
|
|
8
|
+
export declare const SESSION_DELIVERY_TEMPLATE = "## This session delivered\n\n## Files, outputs and evidence\n\n## Verification performed\n\n## Open questions or risks\n\n## Suggested follow-up";
|
|
9
|
+
export declare const SESSION_DELIVERY_TEMPLATE_ZH = "## \u672C\u6B21\u4F1A\u8BDD\u4EA4\u4ED8\n\n## \u6587\u4EF6\u3001\u4EA7\u51FA\u4E0E\u8BC1\u636E\n\n## \u5DF2\u6267\u884C\u7684\u9A8C\u8BC1\n\n## \u672A\u51B3\u95EE\u9898\u6216\u98CE\u9669\n\n## \u5EFA\u8BAE\u540E\u7EED\u52A8\u4F5C";
|
|
10
|
+
export declare function sessionDeliveryTemplate(language: AccountLanguage): string;
|
|
11
|
+
export declare const SESSION_DELIVERY_REQUIREMENTS = "The delivery must contain all five session delivery sections.";
|
|
12
|
+
export declare function getMissingHandoffBriefSections(brief: string): readonly string[];
|
|
13
|
+
export declare const HandoffBriefSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
14
|
+
//# sourceMappingURL=handoffBrief.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";import{z as l}from"zod";export const HANDOFF_BRIEF_TEMPLATE=`## Current status
|
|
2
|
+
Describe what is true now and what the next Agent should understand first.
|
|
3
|
+
|
|
4
|
+
## Completed
|
|
5
|
+
- List work that is actually done.
|
|
6
|
+
|
|
7
|
+
## Verification
|
|
8
|
+
- List checks, tests, or observations and their results.
|
|
9
|
+
|
|
10
|
+
## Open issues and risks
|
|
11
|
+
- List unfinished work, uncertainty, or say "None known".
|
|
12
|
+
|
|
13
|
+
## Next steps
|
|
14
|
+
- List the next concrete actions, including any user decision needed.`,HANDOFF_BRIEF_TEMPLATE_ZH=`## \u5F53\u524D\u72B6\u6001
|
|
15
|
+
\u63CF\u8FF0\u73B0\u5728\u7684\u60C5\u51B5\uFF0C\u4EE5\u53CA\u4E0B\u4E00\u4F4D Agent \u9996\u5148\u9700\u8981\u7406\u89E3\u7684\u5185\u5BB9\u3002
|
|
16
|
+
|
|
17
|
+
## \u5DF2\u5B8C\u6210
|
|
18
|
+
- \u5217\u51FA\u5B9E\u9645\u5DF2\u5B8C\u6210\u7684\u5DE5\u4F5C\u3002
|
|
19
|
+
|
|
20
|
+
## \u9A8C\u8BC1\u7ED3\u679C
|
|
21
|
+
- \u5217\u51FA\u68C0\u67E5\u3001\u6D4B\u8BD5\u6216\u89C2\u5BDF\u53CA\u5176\u7ED3\u679C\u3002
|
|
22
|
+
|
|
23
|
+
## \u672A\u5B8C\u6210\u4E0E\u98CE\u9669
|
|
24
|
+
- \u5217\u51FA\u672A\u5B8C\u6210\u7684\u5DE5\u4F5C\u3001\u4E0D\u786E\u5B9A\u6027\uFF0C\u6216\u5199\u300C\u6682\u65E0\u300D\u3002
|
|
25
|
+
|
|
26
|
+
## \u4E0B\u4E00\u6B65
|
|
27
|
+
- \u5217\u51FA\u63A5\u4E0B\u6765\u8981\u91C7\u53D6\u7684\u5177\u4F53\u884C\u52A8\uFF0C\u5305\u62EC\u9700\u8981\u7528\u6237\u51B3\u5B9A\u7684\u4E8B\u9879\u3002`,HANDOFF_BRIEF_REQUIREMENTS="The brief must contain non-empty sections for Current status, Completed, Verification, Open issues and risks, and Next steps. Markdown inside each section is unrestricted.",HANDOFF_SOURCE_REFERENCE_GUIDANCE=`Source reference rules:
|
|
28
|
+
- Include at least one file path or resource identifier directly relevant to this handoff.
|
|
29
|
+
- Prefer files actually changed, tests or configuration used for verification, and the relevant design document.
|
|
30
|
+
- Each reference must let the next Agent locate context; do not use project names, directories, "source code", or "tests" as stand-ins.
|
|
31
|
+
- References are navigation pointers, not proof of a claim or an acceptance result. Put commands and their results in Verification.
|
|
32
|
+
- Do not include unrelated files just to make the list longer.
|
|
33
|
+
|
|
34
|
+
Good: ["packages/web/src/pages/SessionDetailPage.tsx", "packages/web/test/SessionDetailPage.test.tsx"]
|
|
35
|
+
Bad: ["packages/web", "source code", "tests"]`,SESSION_DELIVERY_TEMPLATE=`## This session delivered
|
|
36
|
+
|
|
37
|
+
## Files, outputs and evidence
|
|
38
|
+
|
|
39
|
+
## Verification performed
|
|
40
|
+
|
|
41
|
+
## Open questions or risks
|
|
42
|
+
|
|
43
|
+
## Suggested follow-up`,SESSION_DELIVERY_TEMPLATE_ZH=`## \u672C\u6B21\u4F1A\u8BDD\u4EA4\u4ED8
|
|
44
|
+
|
|
45
|
+
## \u6587\u4EF6\u3001\u4EA7\u51FA\u4E0E\u8BC1\u636E
|
|
46
|
+
|
|
47
|
+
## \u5DF2\u6267\u884C\u7684\u9A8C\u8BC1
|
|
48
|
+
|
|
49
|
+
## \u672A\u51B3\u95EE\u9898\u6216\u98CE\u9669
|
|
50
|
+
|
|
51
|
+
## \u5EFA\u8BAE\u540E\u7EED\u52A8\u4F5C`;export function sessionDeliveryTemplate(e){return e==="zh-Hans"?SESSION_DELIVERY_TEMPLATE_ZH:SESSION_DELIVERY_TEMPLATE}export const SESSION_DELIVERY_REQUIREMENTS="The delivery must contain all five session delivery sections.";const f={currentStatus:["current status","\u5F53\u524D\u72B6\u6001"],completed:["completed","\u5DF2\u5B8C\u6210"],verification:["verification","verification results","\u9A8C\u8BC1\u7ED3\u679C"],openIssues:["open issues and risks","open issues","risks","\u672A\u5B8C\u6210\u4E0E\u98CE\u9669","\u9057\u7559\u95EE\u9898"],nextSteps:["next steps","\u4E0B\u4E00\u6B65"]};function o(e){return e.trim().replace(/\s+/g," ").toLocaleLowerCase()}function m(e,s){const t=e.split(/\r?\n/),i=new Set(s.map(o)),p=new Set(Object.values(f).flatMap(n=>n.map(o)));for(let n=0;n<t.length;n++){const E=t[n]??"",a=/^(?:#{1,6})\s+(.+?)\s*$/.exec(E);if(!a||!i.has(o(a[1]??"")))continue;const c=[];for(let r=n+1;r<t.length;r++){const d=t[r]??"",u=/^(?:#{1,6})\s+(.+?)\s*$/.exec(d);if(u&&p.has(o(u[1]??"")))break;c.push(d)}return c.join(`
|
|
52
|
+
`).trim()}return null}export function getMissingHandoffBriefSections(e){const s=[];for(const[t,i]of Object.entries(f))m(e,i)||s.push(t);return s}export const HandoffBriefSchema=l.string().trim().min(1).max(6e4).superRefine((e,s)=>{const t=getMissingHandoffBriefSections(e);t.length>0&&s.addIssue({code:l.ZodIssueCode.custom,message:`missing required sections: ${t.join(", ")}`})});
|
package/dist/inboundEvents.d.ts
CHANGED
|
@@ -28,6 +28,12 @@ export declare const SessionCreatePayloadSchema: z.ZodObject<{
|
|
|
28
28
|
source: z.ZodOptional<z.ZodString>;
|
|
29
29
|
claudeSessionId: z.ZodOptional<z.ZodString>;
|
|
30
30
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
31
|
+
/** RFC-075: identifies one currently-running CLI process. */
|
|
32
|
+
ownerInstanceId: z.ZodOptional<z.ZodString>;
|
|
33
|
+
/** RFC-084: session-level handoff switch (persisted for resume). */
|
|
34
|
+
handoffEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
/** RFC-084: delivery (proposal) IDs this session inherited from. */
|
|
36
|
+
inheritedFrom: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
31
37
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
32
38
|
tag: z.ZodString;
|
|
33
39
|
metadata: z.ZodOptional<z.ZodString>;
|
|
@@ -35,6 +41,12 @@ export declare const SessionCreatePayloadSchema: z.ZodObject<{
|
|
|
35
41
|
source: z.ZodOptional<z.ZodString>;
|
|
36
42
|
claudeSessionId: z.ZodOptional<z.ZodString>;
|
|
37
43
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
44
|
+
/** RFC-075: identifies one currently-running CLI process. */
|
|
45
|
+
ownerInstanceId: z.ZodOptional<z.ZodString>;
|
|
46
|
+
/** RFC-084: session-level handoff switch (persisted for resume). */
|
|
47
|
+
handoffEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
/** RFC-084: delivery (proposal) IDs this session inherited from. */
|
|
49
|
+
inheritedFrom: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
38
50
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
39
51
|
tag: z.ZodString;
|
|
40
52
|
metadata: z.ZodOptional<z.ZodString>;
|
|
@@ -42,6 +54,12 @@ export declare const SessionCreatePayloadSchema: z.ZodObject<{
|
|
|
42
54
|
source: z.ZodOptional<z.ZodString>;
|
|
43
55
|
claudeSessionId: z.ZodOptional<z.ZodString>;
|
|
44
56
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
57
|
+
/** RFC-075: identifies one currently-running CLI process. */
|
|
58
|
+
ownerInstanceId: z.ZodOptional<z.ZodString>;
|
|
59
|
+
/** RFC-084: session-level handoff switch (persisted for resume). */
|
|
60
|
+
handoffEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
/** RFC-084: delivery (proposal) IDs this session inherited from. */
|
|
62
|
+
inheritedFrom: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
45
63
|
}, z.ZodTypeAny, "passthrough">>;
|
|
46
64
|
export type SessionCreatePayload = z.infer<typeof SessionCreatePayloadSchema>;
|
|
47
65
|
/** update-metadata — optimistic-concurrency metadata write. */
|
|
@@ -90,14 +108,29 @@ export type UpdateStatePayload = z.infer<typeof UpdateStatePayloadSchema>;
|
|
|
90
108
|
export declare const SessionAlivePayloadSchema: z.ZodObject<{
|
|
91
109
|
sessionId: z.ZodString;
|
|
92
110
|
takeoverToken: z.ZodOptional<z.ZodString>;
|
|
111
|
+
/** RFC-075 proof for same-CLI Socket.IO reconnects. */
|
|
112
|
+
ownerInstanceId: z.ZodOptional<z.ZodString>;
|
|
113
|
+
reconnectKey: z.ZodOptional<z.ZodString>;
|
|
114
|
+
ownerEpoch: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
115
|
+
connectionGeneration: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
93
116
|
runtimeStatus: z.ZodOptional<z.ZodEnum<["idle", "thinking", "tool_running", "permission_required", "disconnected"]>>;
|
|
94
117
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
95
118
|
sessionId: z.ZodString;
|
|
96
119
|
takeoverToken: z.ZodOptional<z.ZodString>;
|
|
120
|
+
/** RFC-075 proof for same-CLI Socket.IO reconnects. */
|
|
121
|
+
ownerInstanceId: z.ZodOptional<z.ZodString>;
|
|
122
|
+
reconnectKey: z.ZodOptional<z.ZodString>;
|
|
123
|
+
ownerEpoch: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
124
|
+
connectionGeneration: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
97
125
|
runtimeStatus: z.ZodOptional<z.ZodEnum<["idle", "thinking", "tool_running", "permission_required", "disconnected"]>>;
|
|
98
126
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
99
127
|
sessionId: z.ZodString;
|
|
100
128
|
takeoverToken: z.ZodOptional<z.ZodString>;
|
|
129
|
+
/** RFC-075 proof for same-CLI Socket.IO reconnects. */
|
|
130
|
+
ownerInstanceId: z.ZodOptional<z.ZodString>;
|
|
131
|
+
reconnectKey: z.ZodOptional<z.ZodString>;
|
|
132
|
+
ownerEpoch: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
133
|
+
connectionGeneration: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
101
134
|
runtimeStatus: z.ZodOptional<z.ZodEnum<["idle", "thinking", "tool_running", "permission_required", "disconnected"]>>;
|
|
102
135
|
}, z.ZodTypeAny, "passthrough">>;
|
|
103
136
|
export type SessionAlivePayload = z.infer<typeof SessionAlivePayloadSchema>;
|
|
@@ -130,6 +163,15 @@ export declare const SessionEndPayloadSchema: z.ZodObject<{
|
|
|
130
163
|
summary: z.ZodOptional<z.ZodString>;
|
|
131
164
|
}, z.ZodTypeAny, "passthrough">>;
|
|
132
165
|
export type SessionEndPayload = z.infer<typeof SessionEndPayloadSchema>;
|
|
166
|
+
/** User-scoped, explicit terminal action for an unrecoverable managed session. */
|
|
167
|
+
export declare const SessionTerminatePayloadSchema: z.ZodObject<{
|
|
168
|
+
sessionId: z.ZodString;
|
|
169
|
+
}, "strict", z.ZodTypeAny, {
|
|
170
|
+
sessionId: string;
|
|
171
|
+
}, {
|
|
172
|
+
sessionId: string;
|
|
173
|
+
}>;
|
|
174
|
+
export type SessionTerminatePayload = z.infer<typeof SessionTerminatePayloadSchema>;
|
|
133
175
|
/** rename-session. */
|
|
134
176
|
export declare const RenameSessionPayloadSchema: z.ZodObject<{
|
|
135
177
|
sessionId: z.ZodString;
|
|
@@ -142,6 +184,22 @@ export declare const RenameSessionPayloadSchema: z.ZodObject<{
|
|
|
142
184
|
displayName: z.ZodEffects<z.ZodString, string, string>;
|
|
143
185
|
}, z.ZodTypeAny, "passthrough">>;
|
|
144
186
|
export type RenameSessionPayload = z.infer<typeof RenameSessionPayloadSchema>;
|
|
187
|
+
export declare const SessionContextResetPayloadSchema: z.ZodObject<{
|
|
188
|
+
sessionId: z.ZodString;
|
|
189
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
190
|
+
sessionId: z.ZodString;
|
|
191
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
192
|
+
sessionId: z.ZodString;
|
|
193
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
194
|
+
export type SessionContextResetPayload = z.infer<typeof SessionContextResetPayloadSchema>;
|
|
195
|
+
export declare const ClaimAutoSessionTitlePayloadSchema: z.ZodObject<{
|
|
196
|
+
sessionId: z.ZodString;
|
|
197
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
198
|
+
sessionId: z.ZodString;
|
|
199
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
200
|
+
sessionId: z.ZodString;
|
|
201
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
202
|
+
export type ClaimAutoSessionTitlePayload = z.infer<typeof ClaimAutoSessionTitlePayloadSchema>;
|
|
145
203
|
/** message — single message insert. `content` shape validated downstream. */
|
|
146
204
|
export declare const MessagePayloadSchema: z.ZodEffects<z.ZodObject<{
|
|
147
205
|
sessionId: z.ZodString;
|
|
@@ -241,18 +299,24 @@ export declare const GetMessagesPayloadSchema: z.ZodObject<{
|
|
|
241
299
|
beforeSeq: z.ZodOptional<z.ZodNumber>;
|
|
242
300
|
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
243
301
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
302
|
+
/** Use the latest projected clear/compact boundary as the query floor. */
|
|
303
|
+
contextCycle: z.ZodOptional<z.ZodLiteral<"latest">>;
|
|
244
304
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
245
305
|
sessionId: z.ZodString;
|
|
246
306
|
fromSeq: z.ZodOptional<z.ZodNumber>;
|
|
247
307
|
beforeSeq: z.ZodOptional<z.ZodNumber>;
|
|
248
308
|
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
249
309
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
310
|
+
/** Use the latest projected clear/compact boundary as the query floor. */
|
|
311
|
+
contextCycle: z.ZodOptional<z.ZodLiteral<"latest">>;
|
|
250
312
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
251
313
|
sessionId: z.ZodString;
|
|
252
314
|
fromSeq: z.ZodOptional<z.ZodNumber>;
|
|
253
315
|
beforeSeq: z.ZodOptional<z.ZodNumber>;
|
|
254
316
|
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
255
317
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
318
|
+
/** Use the latest projected clear/compact boundary as the query floor. */
|
|
319
|
+
contextCycle: z.ZodOptional<z.ZodLiteral<"latest">>;
|
|
256
320
|
}, z.ZodTypeAny, "passthrough">>;
|
|
257
321
|
export type GetMessagesPayload = z.infer<typeof GetMessagesPayloadSchema>;
|
|
258
322
|
/**
|
|
@@ -333,6 +397,8 @@ export declare const MachineRegisterPayloadSchema: z.ZodObject<{
|
|
|
333
397
|
id: z.ZodString;
|
|
334
398
|
label: z.ZodString;
|
|
335
399
|
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
400
|
+
/** Daemon feature flags (RFC-081 `account-language`, etc.). Additive — server gates feature injection on these. */
|
|
401
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
336
402
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
337
403
|
hostname: z.ZodString;
|
|
338
404
|
platform: z.ZodString;
|
|
@@ -376,6 +442,8 @@ export declare const MachineRegisterPayloadSchema: z.ZodObject<{
|
|
|
376
442
|
id: z.ZodString;
|
|
377
443
|
label: z.ZodString;
|
|
378
444
|
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
445
|
+
/** Daemon feature flags (RFC-081 `account-language`, etc.). Additive — server gates feature injection on these. */
|
|
446
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
379
447
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
380
448
|
hostname: z.ZodString;
|
|
381
449
|
platform: z.ZodString;
|
|
@@ -419,6 +487,8 @@ export declare const MachineRegisterPayloadSchema: z.ZodObject<{
|
|
|
419
487
|
id: z.ZodString;
|
|
420
488
|
label: z.ZodString;
|
|
421
489
|
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
490
|
+
/** Daemon feature flags (RFC-081 `account-language`, etc.). Additive — server gates feature injection on these. */
|
|
491
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
422
492
|
}, z.ZodTypeAny, "passthrough">>;
|
|
423
493
|
export type MachineRegisterPayload = z.infer<typeof MachineRegisterPayloadSchema>;
|
|
424
494
|
/** register-history-sessions — RFC-016 history sync batch. */
|
package/dist/inboundEvents.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{z as o}from"zod";const t=o.string().min(1);export const SessionCreatePayloadSchema=o.object({tag:t,metadata:o.string().optional(),dataEncryptionKey:o.string().optional(),source:o.string().optional(),claudeSessionId:o.string().optional(),projectPath:o.string().optional()}).passthrough(),UpdateMetadataPayloadSchema=o.object({sessionId:t,metadata:o.string(),expectedVersion:o.number().int().min(0)}).passthrough(),ContextUsageUpdatePayloadSchema=o.object({sessionId:t,contextUsage:o.record(o.unknown())}).passthrough(),UpdateStatePayloadSchema=o.object({sessionId:t,agentState:o.string(),expectedVersion:o.number().int().min(0)}).passthrough(),SessionAlivePayloadSchema=o.object({sessionId:t,takeoverToken:t.optional(),runtimeStatus:o.enum(["idle","thinking","tool_running","permission_required","disconnected"]).optional()}).passthrough(),GetSessionRuntimeStatusPayloadSchema=o.object({sessionId:t}).strict(),SessionDeletePayloadSchema=o.object({sessionId:t}).passthrough(),SessionEndPayloadSchema=o.object({sessionId:t,summary:o.string().optional()}).passthrough(),RenameSessionPayloadSchema=o.object({sessionId:t,displayName:o.string().refine(e=>e.trim()!=="","displayName must not be blank")}).passthrough(),MessagePayloadSchema=o.object({sessionId:t,localId:t,content:o.unknown(),skipBroadcast:o.boolean().optional(),ephemeral:o.boolean().optional()}).passthrough().refine(e=>"content"in e,{message:"content is required",path:["content"]});const
|
|
1
|
+
"use strict";import{z as o}from"zod";const t=o.string().min(1),a=9223372036854775807n,n=o.string().refine(e=>/^(0|[1-9]\d*)$/.test(e)?BigInt(e)<=a:!1,"expected canonical non-negative int64");export const SessionCreatePayloadSchema=o.object({tag:t,metadata:o.string().optional(),dataEncryptionKey:o.string().optional(),source:o.string().optional(),claudeSessionId:o.string().optional(),projectPath:o.string().optional(),ownerInstanceId:t.optional(),handoffEnabled:o.boolean().optional(),inheritedFrom:o.array(o.string().uuid()).max(5).optional()}).passthrough(),UpdateMetadataPayloadSchema=o.object({sessionId:t,metadata:o.string(),expectedVersion:o.number().int().min(0)}).passthrough(),ContextUsageUpdatePayloadSchema=o.object({sessionId:t,contextUsage:o.record(o.unknown())}).passthrough(),UpdateStatePayloadSchema=o.object({sessionId:t,agentState:o.string(),expectedVersion:o.number().int().min(0)}).passthrough(),SessionAlivePayloadSchema=o.object({sessionId:t,takeoverToken:t.optional(),ownerInstanceId:t.optional(),reconnectKey:t.optional(),ownerEpoch:n.optional(),connectionGeneration:n.optional(),runtimeStatus:o.enum(["idle","thinking","tool_running","permission_required","disconnected"]).optional()}).passthrough(),GetSessionRuntimeStatusPayloadSchema=o.object({sessionId:t}).strict(),SessionDeletePayloadSchema=o.object({sessionId:t}).passthrough(),SessionEndPayloadSchema=o.object({sessionId:t,summary:o.string().optional()}).passthrough(),SessionTerminatePayloadSchema=o.object({sessionId:t}).strict(),RenameSessionPayloadSchema=o.object({sessionId:t,displayName:o.string().refine(e=>e.trim()!=="","displayName must not be blank")}).passthrough(),SessionContextResetPayloadSchema=o.object({sessionId:t}).passthrough(),ClaimAutoSessionTitlePayloadSchema=o.object({sessionId:t}).passthrough(),MessagePayloadSchema=o.object({sessionId:t,localId:t,content:o.unknown(),skipBroadcast:o.boolean().optional(),ephemeral:o.boolean().optional()}).passthrough().refine(e=>"content"in e,{message:"content is required",path:["content"]});const s=o.object({localId:t,content:o.unknown()}).passthrough().refine(e=>"content"in e,{message:"content is required",path:["content"]});export const BatchMessagePayloadSchema=o.object({sessionId:t,messages:o.array(s).min(1).max(100),skipBroadcast:o.boolean().optional()}).passthrough(),GetMessagesPayloadSchema=o.object({sessionId:t,fromSeq:o.number().int().min(0).optional(),beforeSeq:o.number().int().min(1).optional(),order:o.enum(["asc","desc"]).optional(),limit:o.number().int().min(1).optional(),contextCycle:o.literal("latest").optional()}).passthrough(),INBOUND_SESSION_STATUSES=["idle","thinking","tool_running","permission_required","disconnected","turn-completed"],SessionStatusPayloadSchema=o.object({sessionId:t,status:o.enum(INBOUND_SESSION_STATUSES)}).strict(),MachineRegisterPayloadSchema=o.object({hostname:t,platform:t,arch:o.string().optional(),displayName:o.string().optional(),daemonVersion:o.string().optional(),availableAgents:o.array(o.string()).optional(),agentVersions:o.record(o.string()).optional(),terminalHost:o.string().optional(),terminalPort:o.number().optional(),upgradeStatus:o.string().optional(),upgradeError:o.string().optional(),lastUpgradeError:o.string().optional(),derivationVersion:o.number().optional(),autoUpgradeDaemon:o.boolean().optional(),notifyFeishu:o.boolean().optional(),notifyDingtalk:o.boolean().optional(),agentModels:o.record(o.array(o.object({id:o.string(),displayName:o.string(),isDefault:o.boolean(),hidden:o.boolean()}).passthrough())).optional(),agentModes:o.record(o.array(o.object({id:o.string(),label:o.string()}).passthrough())).optional(),capabilities:o.array(o.string()).optional()}).passthrough(),HistorySessionEntrySchema=o.object({claudeSessionId:t,projectPath:o.string(),title:o.string().nullable().optional(),messageCount:o.number(),createdAt:o.string(),agentType:o.string(),isSubagent:o.boolean().optional()}).passthrough(),RegisterHistorySessionsPayloadSchema=o.object({entries:o.array(HistorySessionEntrySchema)}).passthrough();
|