@spencerboucher/switchyard-client 0.0.0-stage → 0.16.0
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/LICENSE +21 -0
- package/README.md +24 -2
- package/dist/index.js +4007 -0
- package/dist/types/api.d.ts +28 -0
- package/dist/types/client.d.ts +56 -0
- package/dist/types/connection.d.ts +66 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/protocol/adapter-preview.d.ts +455 -0
- package/dist/types/protocol/adapters.d.ts +113 -0
- package/dist/types/protocol/agent-wire.d.ts +269 -0
- package/dist/types/protocol/api.d.ts +1501 -0
- package/dist/types/protocol/backoff.d.ts +5 -0
- package/dist/types/protocol/client-wire.d.ts +1806 -0
- package/dist/types/protocol/contributions.d.ts +62 -0
- package/dist/types/protocol/entities.d.ts +1389 -0
- package/dist/types/protocol/errors.d.ts +115 -0
- package/dist/types/protocol/events.d.ts +1136 -0
- package/dist/types/protocol/github.d.ts +510 -0
- package/dist/types/protocol/host-wire.d.ts +1517 -0
- package/dist/types/protocol/ids.d.ts +7 -0
- package/dist/types/protocol/index.d.ts +29 -0
- package/dist/types/protocol/policies.d.ts +576 -0
- package/dist/types/protocol/terminal-wire.d.ts +45 -0
- package/dist/types/protocol/titles.d.ts +9 -0
- package/dist/types/protocol/trackers.d.ts +244 -0
- package/dist/types/protocol/ui.d.ts +164 -0
- package/dist/types/protocol/views.d.ts +14 -0
- package/dist/types/protocol/web-bridge.d.ts +30 -0
- package/dist/types/store.d.ts +59 -0
- package/dist/types/wait.d.ts +20 -0
- package/package.json +32 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const ID_PREFIXES: readonly ["prj", "chk", "wsp", "ses", "tsk", "run", "aut", "occ", "int", "att", "dev", "hst", "enr", "cmd", "trm", "evt", "prf", "itm", "viw", "trk"];
|
|
2
|
+
export type IdPrefix = (typeof ID_PREFIXES)[number];
|
|
3
|
+
/** Stable, sortable, prefixed identifier, e.g. `ses_01J...`. */
|
|
4
|
+
export declare function newId(prefix: IdPrefix): string;
|
|
5
|
+
/** Branch name to the directory slug used under `<repo>/.worktrees/`. */
|
|
6
|
+
export declare function branchSlug(branch: string): string;
|
|
7
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from "./adapter-preview.js";
|
|
2
|
+
export * from "./adapters.js";
|
|
3
|
+
export * from "./agent-wire.js";
|
|
4
|
+
export * from "./api.js";
|
|
5
|
+
export * from "./backoff.js";
|
|
6
|
+
export * from "./client-wire.js";
|
|
7
|
+
export * from "./contributions.js";
|
|
8
|
+
export * from "./entities.js";
|
|
9
|
+
export * from "./errors.js";
|
|
10
|
+
export * from "./events.js";
|
|
11
|
+
export * from "./github.js";
|
|
12
|
+
export * from "./host-wire.js";
|
|
13
|
+
export * from "./ids.js";
|
|
14
|
+
export * from "./policies.js";
|
|
15
|
+
export * from "./terminal-wire.js";
|
|
16
|
+
export * from "./titles.js";
|
|
17
|
+
export * from "./trackers.js";
|
|
18
|
+
export * from "./ui.js";
|
|
19
|
+
export * from "./views.js";
|
|
20
|
+
export * from "./web-bridge.js";
|
|
21
|
+
export declare const PROTOCOL_VERSION = 1;
|
|
22
|
+
export declare const PI_SUPPORTED_RANGE = ">=1.4.0 <1.6.0";
|
|
23
|
+
export declare const DEFAULT_PORT = 7400;
|
|
24
|
+
export declare const MARKERS: {
|
|
25
|
+
readonly done: "SWITCHYARD: DONE";
|
|
26
|
+
readonly blocked: "SWITCHYARD: BLOCKED";
|
|
27
|
+
readonly noChange: "SWITCHYARD: NO_CHANGE";
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
3
|
+
[key: string]: JsonValue;
|
|
4
|
+
};
|
|
5
|
+
/** Shared hash input: no coercion, toJSON hooks, array reordering or tool-argument truncation. */
|
|
6
|
+
export declare function canonicalPolicyJson(value: JsonValue): string;
|
|
7
|
+
export declare const CompletedUsageWatermark: z.ZodObject<{
|
|
8
|
+
runtimeId: z.ZodString;
|
|
9
|
+
settleSeq: z.ZodNumber;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
export declare const POLICY_CAPABILITY_EXPLANATION = "Pre-provider policies are unavailable with this Pi integration. Budgets are checked before automated continuations, not during a running turn.";
|
|
12
|
+
export declare const PolicyPhase: z.ZodEnum<{
|
|
13
|
+
request: "request";
|
|
14
|
+
tool_call: "tool_call";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const PolicyVerdict: z.ZodEnum<{
|
|
17
|
+
ALLOW: "ALLOW";
|
|
18
|
+
ASK: "ASK";
|
|
19
|
+
DENY: "DENY";
|
|
20
|
+
}>;
|
|
21
|
+
export declare const PolicyRequestAction: z.ZodEnum<{
|
|
22
|
+
"inbox.read": "inbox.read";
|
|
23
|
+
"message.send": "message.send";
|
|
24
|
+
"run.continue": "run.continue";
|
|
25
|
+
"task.create": "task.create";
|
|
26
|
+
}>;
|
|
27
|
+
export declare const PolicyScope: z.ZodEnum<{
|
|
28
|
+
profile: "profile";
|
|
29
|
+
server: "server";
|
|
30
|
+
session: "session";
|
|
31
|
+
}>;
|
|
32
|
+
export declare const PolicyCounterMap: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
33
|
+
export declare const PolicyRule: z.ZodObject<{
|
|
34
|
+
scope: z.ZodEnum<{
|
|
35
|
+
profile: "profile";
|
|
36
|
+
server: "server";
|
|
37
|
+
session: "session";
|
|
38
|
+
}>;
|
|
39
|
+
scopeId: z.ZodNullable<z.ZodString>;
|
|
40
|
+
priority: z.ZodNumber;
|
|
41
|
+
enabled: z.ZodBoolean;
|
|
42
|
+
phases: z.ZodArray<z.ZodEnum<{
|
|
43
|
+
request: "request";
|
|
44
|
+
tool_call: "tool_call";
|
|
45
|
+
}>>;
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
expression: z.ZodString;
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
revision: z.ZodNumber;
|
|
50
|
+
builtIn: z.ZodBoolean;
|
|
51
|
+
createdAt: z.ZodString;
|
|
52
|
+
updatedAt: z.ZodString;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
export declare const PolicyToolSafety: z.ZodObject<{
|
|
55
|
+
destructiveDelete: z.ZodBoolean;
|
|
56
|
+
forcePush: z.ZodBoolean;
|
|
57
|
+
defaultBranchPush: z.ZodBoolean;
|
|
58
|
+
uncertain: z.ZodBoolean;
|
|
59
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
export declare const HostPolicyBoundary: z.ZodObject<{
|
|
62
|
+
cwd: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
63
|
+
workspaceRoot: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
64
|
+
cwdReal: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
65
|
+
workspaceRootReal: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
export declare const HostToolPolicyContext: z.ZodObject<{
|
|
68
|
+
version: z.ZodLiteral<1>;
|
|
69
|
+
toolCallId: z.ZodString;
|
|
70
|
+
toolHash: z.ZodString;
|
|
71
|
+
boundary: z.ZodObject<{
|
|
72
|
+
cwd: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
73
|
+
workspaceRoot: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
74
|
+
cwdReal: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
75
|
+
workspaceRootReal: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
defaultBranch: z.ZodNullable<z.ZodString>;
|
|
78
|
+
safety: z.ZodObject<{
|
|
79
|
+
destructiveDelete: z.ZodBoolean;
|
|
80
|
+
forcePush: z.ZodBoolean;
|
|
81
|
+
defaultBranchPush: z.ZodBoolean;
|
|
82
|
+
uncertain: z.ZodBoolean;
|
|
83
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
84
|
+
}, z.core.$strict>;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
export declare const PolicyToolContext: z.ZodObject<{
|
|
87
|
+
name: z.ZodString;
|
|
88
|
+
args: z.ZodCustom<Record<string, JsonValue>, Record<string, JsonValue>>;
|
|
89
|
+
safety: z.ZodObject<{
|
|
90
|
+
destructiveDelete: z.ZodBoolean;
|
|
91
|
+
forcePush: z.ZodBoolean;
|
|
92
|
+
defaultBranchPush: z.ZodBoolean;
|
|
93
|
+
uncertain: z.ZodBoolean;
|
|
94
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
export declare const PolicyRequestContext: z.ZodObject<{
|
|
98
|
+
method: z.ZodEnum<{
|
|
99
|
+
"inbox.read": "inbox.read";
|
|
100
|
+
"message.send": "message.send";
|
|
101
|
+
"run.continue": "run.continue";
|
|
102
|
+
"task.create": "task.create";
|
|
103
|
+
}>;
|
|
104
|
+
args: z.ZodCustom<Record<string, JsonValue>, Record<string, JsonValue>>;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
export declare const PolicySessionContext: z.ZodObject<{
|
|
107
|
+
id: z.ZodString;
|
|
108
|
+
hostId: z.ZodString;
|
|
109
|
+
nativeSessionId: z.ZodNullable<z.ZodString>;
|
|
110
|
+
runtimeId: z.ZodNullable<z.ZodString>;
|
|
111
|
+
profileId: z.ZodString;
|
|
112
|
+
projectId: z.ZodNullable<z.ZodString>;
|
|
113
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
114
|
+
runId: z.ZodNullable<z.ZodString>;
|
|
115
|
+
controlMode: z.ZodEnum<{
|
|
116
|
+
automation: "automation";
|
|
117
|
+
human: "human";
|
|
118
|
+
}>;
|
|
119
|
+
controlRevision: z.ZodNumber;
|
|
120
|
+
cwd: z.ZodString;
|
|
121
|
+
workspaceRoot: z.ZodString;
|
|
122
|
+
repository: z.ZodNullable<z.ZodString>;
|
|
123
|
+
defaultBranch: z.ZodNullable<z.ZodString>;
|
|
124
|
+
readOnly: z.ZodBoolean;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
export declare const PolicyTaskContext: z.ZodObject<{
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
projectId: z.ZodString;
|
|
129
|
+
rootTaskId: z.ZodString;
|
|
130
|
+
parentTaskId: z.ZodNullable<z.ZodString>;
|
|
131
|
+
title: z.ZodString;
|
|
132
|
+
state: z.ZodEnum<{
|
|
133
|
+
backlog: "backlog";
|
|
134
|
+
canceled: "canceled";
|
|
135
|
+
done: "done";
|
|
136
|
+
in_progress: "in_progress";
|
|
137
|
+
ready: "ready";
|
|
138
|
+
review: "review";
|
|
139
|
+
}>;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
export declare const PolicyTargetContext: z.ZodObject<{
|
|
142
|
+
id: z.ZodString;
|
|
143
|
+
hostId: z.ZodString;
|
|
144
|
+
projectId: z.ZodNullable<z.ZodString>;
|
|
145
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
146
|
+
controlMode: z.ZodEnum<{
|
|
147
|
+
automation: "automation";
|
|
148
|
+
human: "human";
|
|
149
|
+
}>;
|
|
150
|
+
controlRevision: z.ZodNumber;
|
|
151
|
+
runtime: z.ZodEnum<{
|
|
152
|
+
failed: "failed";
|
|
153
|
+
idle: "idle";
|
|
154
|
+
interrupted: "interrupted";
|
|
155
|
+
running: "running";
|
|
156
|
+
starting: "starting";
|
|
157
|
+
stopped: "stopped";
|
|
158
|
+
waiting_input: "waiting_input";
|
|
159
|
+
}>;
|
|
160
|
+
readOnly: z.ZodBoolean;
|
|
161
|
+
}, z.core.$strict>;
|
|
162
|
+
export declare const PolicyCostContext: z.ZodObject<{
|
|
163
|
+
tokens: z.ZodNullable<z.ZodNumber>;
|
|
164
|
+
costUsd: z.ZodNullable<z.ZodNumber>;
|
|
165
|
+
maxTokens: z.ZodNullable<z.ZodNumber>;
|
|
166
|
+
maxCostUsd: z.ZodNullable<z.ZodNumber>;
|
|
167
|
+
accounting: z.ZodEnum<{
|
|
168
|
+
available: "available";
|
|
169
|
+
unavailable: "unavailable";
|
|
170
|
+
}>;
|
|
171
|
+
fresh: z.ZodBoolean;
|
|
172
|
+
watermark: z.ZodNullable<z.ZodObject<{
|
|
173
|
+
runtimeId: z.ZodString;
|
|
174
|
+
settleSeq: z.ZodNumber;
|
|
175
|
+
}, z.core.$strict>>;
|
|
176
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
177
|
+
modelId: z.ZodNullable<z.ZodString>;
|
|
178
|
+
classification: z.ZodEnum<{
|
|
179
|
+
cheap: "cheap";
|
|
180
|
+
expensive: "expensive";
|
|
181
|
+
unclassified: "unclassified";
|
|
182
|
+
}>;
|
|
183
|
+
expensive: z.ZodBoolean;
|
|
184
|
+
}, z.core.$strict>;
|
|
185
|
+
export declare const PolicyContext: z.ZodObject<{
|
|
186
|
+
phase: z.ZodEnum<{
|
|
187
|
+
request: "request";
|
|
188
|
+
tool_call: "tool_call";
|
|
189
|
+
}>;
|
|
190
|
+
action: z.ZodUnion<readonly [z.ZodLiteral<"tool.call">, z.ZodEnum<{
|
|
191
|
+
"inbox.read": "inbox.read";
|
|
192
|
+
"message.send": "message.send";
|
|
193
|
+
"run.continue": "run.continue";
|
|
194
|
+
"task.create": "task.create";
|
|
195
|
+
}>]>;
|
|
196
|
+
tool: z.ZodNullable<z.ZodObject<{
|
|
197
|
+
name: z.ZodString;
|
|
198
|
+
args: z.ZodCustom<Record<string, JsonValue>, Record<string, JsonValue>>;
|
|
199
|
+
safety: z.ZodObject<{
|
|
200
|
+
destructiveDelete: z.ZodBoolean;
|
|
201
|
+
forcePush: z.ZodBoolean;
|
|
202
|
+
defaultBranchPush: z.ZodBoolean;
|
|
203
|
+
uncertain: z.ZodBoolean;
|
|
204
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
205
|
+
}, z.core.$strict>;
|
|
206
|
+
}, z.core.$strict>>;
|
|
207
|
+
request: z.ZodNullable<z.ZodObject<{
|
|
208
|
+
method: z.ZodEnum<{
|
|
209
|
+
"inbox.read": "inbox.read";
|
|
210
|
+
"message.send": "message.send";
|
|
211
|
+
"run.continue": "run.continue";
|
|
212
|
+
"task.create": "task.create";
|
|
213
|
+
}>;
|
|
214
|
+
args: z.ZodCustom<Record<string, JsonValue>, Record<string, JsonValue>>;
|
|
215
|
+
}, z.core.$strict>>;
|
|
216
|
+
session: z.ZodObject<{
|
|
217
|
+
id: z.ZodString;
|
|
218
|
+
hostId: z.ZodString;
|
|
219
|
+
nativeSessionId: z.ZodNullable<z.ZodString>;
|
|
220
|
+
runtimeId: z.ZodNullable<z.ZodString>;
|
|
221
|
+
profileId: z.ZodString;
|
|
222
|
+
projectId: z.ZodNullable<z.ZodString>;
|
|
223
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
224
|
+
runId: z.ZodNullable<z.ZodString>;
|
|
225
|
+
controlMode: z.ZodEnum<{
|
|
226
|
+
automation: "automation";
|
|
227
|
+
human: "human";
|
|
228
|
+
}>;
|
|
229
|
+
controlRevision: z.ZodNumber;
|
|
230
|
+
cwd: z.ZodString;
|
|
231
|
+
workspaceRoot: z.ZodString;
|
|
232
|
+
repository: z.ZodNullable<z.ZodString>;
|
|
233
|
+
defaultBranch: z.ZodNullable<z.ZodString>;
|
|
234
|
+
readOnly: z.ZodBoolean;
|
|
235
|
+
}, z.core.$strict>;
|
|
236
|
+
task: z.ZodNullable<z.ZodObject<{
|
|
237
|
+
id: z.ZodString;
|
|
238
|
+
projectId: z.ZodString;
|
|
239
|
+
rootTaskId: z.ZodString;
|
|
240
|
+
parentTaskId: z.ZodNullable<z.ZodString>;
|
|
241
|
+
title: z.ZodString;
|
|
242
|
+
state: z.ZodEnum<{
|
|
243
|
+
backlog: "backlog";
|
|
244
|
+
canceled: "canceled";
|
|
245
|
+
done: "done";
|
|
246
|
+
in_progress: "in_progress";
|
|
247
|
+
ready: "ready";
|
|
248
|
+
review: "review";
|
|
249
|
+
}>;
|
|
250
|
+
}, z.core.$strict>>;
|
|
251
|
+
target: z.ZodNullable<z.ZodObject<{
|
|
252
|
+
id: z.ZodString;
|
|
253
|
+
hostId: z.ZodString;
|
|
254
|
+
projectId: z.ZodNullable<z.ZodString>;
|
|
255
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
256
|
+
controlMode: z.ZodEnum<{
|
|
257
|
+
automation: "automation";
|
|
258
|
+
human: "human";
|
|
259
|
+
}>;
|
|
260
|
+
controlRevision: z.ZodNumber;
|
|
261
|
+
runtime: z.ZodEnum<{
|
|
262
|
+
failed: "failed";
|
|
263
|
+
idle: "idle";
|
|
264
|
+
interrupted: "interrupted";
|
|
265
|
+
running: "running";
|
|
266
|
+
starting: "starting";
|
|
267
|
+
stopped: "stopped";
|
|
268
|
+
waiting_input: "waiting_input";
|
|
269
|
+
}>;
|
|
270
|
+
readOnly: z.ZodBoolean;
|
|
271
|
+
}, z.core.$strict>>;
|
|
272
|
+
cost: z.ZodObject<{
|
|
273
|
+
tokens: z.ZodNullable<z.ZodNumber>;
|
|
274
|
+
costUsd: z.ZodNullable<z.ZodNumber>;
|
|
275
|
+
maxTokens: z.ZodNullable<z.ZodNumber>;
|
|
276
|
+
maxCostUsd: z.ZodNullable<z.ZodNumber>;
|
|
277
|
+
accounting: z.ZodEnum<{
|
|
278
|
+
available: "available";
|
|
279
|
+
unavailable: "unavailable";
|
|
280
|
+
}>;
|
|
281
|
+
fresh: z.ZodBoolean;
|
|
282
|
+
watermark: z.ZodNullable<z.ZodObject<{
|
|
283
|
+
runtimeId: z.ZodString;
|
|
284
|
+
settleSeq: z.ZodNumber;
|
|
285
|
+
}, z.core.$strict>>;
|
|
286
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
287
|
+
modelId: z.ZodNullable<z.ZodString>;
|
|
288
|
+
classification: z.ZodEnum<{
|
|
289
|
+
cheap: "cheap";
|
|
290
|
+
expensive: "expensive";
|
|
291
|
+
unclassified: "unclassified";
|
|
292
|
+
}>;
|
|
293
|
+
expensive: z.ZodBoolean;
|
|
294
|
+
}, z.core.$strict>;
|
|
295
|
+
counters: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
296
|
+
}, z.core.$strict>;
|
|
297
|
+
export declare const PolicyRuleResult: z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
|
|
298
|
+
verdict: z.ZodEnum<{
|
|
299
|
+
ALLOW: "ALLOW";
|
|
300
|
+
ASK: "ASK";
|
|
301
|
+
DENY: "DENY";
|
|
302
|
+
}>;
|
|
303
|
+
reason: z.ZodString;
|
|
304
|
+
state_updates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
305
|
+
}, z.core.$strict>]>;
|
|
306
|
+
export declare const PolicyEvaluation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
307
|
+
verdict: z.ZodLiteral<"ALLOW">;
|
|
308
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
309
|
+
verdict: z.ZodLiteral<"DENY">;
|
|
310
|
+
reason: z.ZodString;
|
|
311
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
312
|
+
verdict: z.ZodLiteral<"ASK">;
|
|
313
|
+
decisionId: z.ZodString;
|
|
314
|
+
interactionId: z.ZodString;
|
|
315
|
+
interactionUrl: z.ZodString;
|
|
316
|
+
}, z.core.$strict>], "verdict">;
|
|
317
|
+
export declare const PolicyPermission: z.ZodObject<{
|
|
318
|
+
kind: z.ZodLiteral<"policy">;
|
|
319
|
+
decisionId: z.ZodString;
|
|
320
|
+
rootTaskId: z.ZodNullable<z.ZodString>;
|
|
321
|
+
ruleId: z.ZodString;
|
|
322
|
+
ruleRevision: z.ZodNumber;
|
|
323
|
+
fingerprint: z.ZodString;
|
|
324
|
+
}, z.core.$strict>;
|
|
325
|
+
export declare const PolicyGrant: z.ZodObject<{
|
|
326
|
+
id: z.ZodString;
|
|
327
|
+
scope: z.ZodObject<{
|
|
328
|
+
kind: z.ZodEnum<{
|
|
329
|
+
session: "session";
|
|
330
|
+
task: "task";
|
|
331
|
+
}>;
|
|
332
|
+
id: z.ZodString;
|
|
333
|
+
}, z.core.$strict>;
|
|
334
|
+
ruleId: z.ZodString;
|
|
335
|
+
ruleRevision: z.ZodNumber;
|
|
336
|
+
fingerprint: z.ZodString;
|
|
337
|
+
approvedByDeviceId: z.ZodString;
|
|
338
|
+
approvedAt: z.ZodString;
|
|
339
|
+
}, z.core.$strict>;
|
|
340
|
+
export declare const PolicyModelClassification: z.ZodObject<{
|
|
341
|
+
provider: z.ZodString;
|
|
342
|
+
modelId: z.ZodString;
|
|
343
|
+
classification: z.ZodEnum<{
|
|
344
|
+
cheap: "cheap";
|
|
345
|
+
expensive: "expensive";
|
|
346
|
+
}>;
|
|
347
|
+
}, z.core.$strict>;
|
|
348
|
+
export declare const PolicySettings: z.ZodObject<{
|
|
349
|
+
revision: z.ZodNumber;
|
|
350
|
+
modelClassifications: z.ZodArray<z.ZodObject<{
|
|
351
|
+
provider: z.ZodString;
|
|
352
|
+
modelId: z.ZodString;
|
|
353
|
+
classification: z.ZodEnum<{
|
|
354
|
+
cheap: "cheap";
|
|
355
|
+
expensive: "expensive";
|
|
356
|
+
}>;
|
|
357
|
+
}, z.core.$strict>>;
|
|
358
|
+
updatedAt: z.ZodString;
|
|
359
|
+
}, z.core.$strict>;
|
|
360
|
+
export declare const HostPolicySampleRequest: z.ZodObject<{
|
|
361
|
+
sessionId: z.ZodString;
|
|
362
|
+
nativeSessionId: z.ZodString;
|
|
363
|
+
runtimeId: z.ZodString;
|
|
364
|
+
sampleId: z.ZodString;
|
|
365
|
+
tool: z.ZodObject<{
|
|
366
|
+
name: z.ZodString;
|
|
367
|
+
args: z.ZodCustom<Record<string, JsonValue>, Record<string, JsonValue>>;
|
|
368
|
+
}, z.core.$strict>;
|
|
369
|
+
}, z.core.$strict>;
|
|
370
|
+
export declare const HostPolicySampleResult: z.ZodObject<{
|
|
371
|
+
sessionId: z.ZodString;
|
|
372
|
+
nativeSessionId: z.ZodString;
|
|
373
|
+
runtimeId: z.ZodString;
|
|
374
|
+
sampleId: z.ZodString;
|
|
375
|
+
toolHash: z.ZodString;
|
|
376
|
+
boundary: z.ZodObject<{
|
|
377
|
+
cwd: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
378
|
+
workspaceRoot: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
379
|
+
cwdReal: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
380
|
+
workspaceRootReal: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
381
|
+
}, z.core.$strict>;
|
|
382
|
+
defaultBranch: z.ZodNullable<z.ZodString>;
|
|
383
|
+
safety: z.ZodObject<{
|
|
384
|
+
destructiveDelete: z.ZodBoolean;
|
|
385
|
+
forcePush: z.ZodBoolean;
|
|
386
|
+
defaultBranchPush: z.ZodBoolean;
|
|
387
|
+
uncertain: z.ZodBoolean;
|
|
388
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
389
|
+
}, z.core.$strict>;
|
|
390
|
+
}, z.core.$strict>;
|
|
391
|
+
export declare const PolicyEvaluateRequest: z.ZodObject<{
|
|
392
|
+
evaluationId: z.ZodString;
|
|
393
|
+
toolCallId: z.ZodString;
|
|
394
|
+
tool: z.ZodObject<{
|
|
395
|
+
name: z.ZodString;
|
|
396
|
+
args: z.ZodCustom<Record<string, JsonValue>, Record<string, JsonValue>>;
|
|
397
|
+
}, z.core.$strict>;
|
|
398
|
+
}, z.core.$strict>;
|
|
399
|
+
export declare const PolicyStatusRequest: z.ZodObject<{
|
|
400
|
+
decisionId: z.ZodString;
|
|
401
|
+
waitMs: z.ZodLiteral<25000>;
|
|
402
|
+
}, z.core.$strict>;
|
|
403
|
+
export declare const PolicyStatusResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
404
|
+
state: z.ZodLiteral<"pending">;
|
|
405
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
406
|
+
state: z.ZodLiteral<"allowed">;
|
|
407
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
408
|
+
state: z.ZodLiteral<"denied">;
|
|
409
|
+
reason: z.ZodString;
|
|
410
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
411
|
+
state: z.ZodLiteral<"canceled">;
|
|
412
|
+
reason: z.ZodString;
|
|
413
|
+
}, z.core.$strict>], "state">;
|
|
414
|
+
export declare const PolicyCancelRequest: z.ZodObject<{
|
|
415
|
+
decisionId: z.ZodString;
|
|
416
|
+
}, z.core.$strict>;
|
|
417
|
+
export declare const PolicyCancelResult: z.ZodObject<{
|
|
418
|
+
state: z.ZodEnum<{
|
|
419
|
+
already_resolved: "already_resolved";
|
|
420
|
+
canceled: "canceled";
|
|
421
|
+
}>;
|
|
422
|
+
}, z.core.$strict>;
|
|
423
|
+
export declare const PolicyTrace: z.ZodObject<{
|
|
424
|
+
scope: z.ZodEnum<{
|
|
425
|
+
profile: "profile";
|
|
426
|
+
server: "server";
|
|
427
|
+
session: "session";
|
|
428
|
+
}>;
|
|
429
|
+
scopeId: z.ZodNullable<z.ZodString>;
|
|
430
|
+
ruleId: z.ZodString;
|
|
431
|
+
ruleRevision: z.ZodNumber;
|
|
432
|
+
verdict: z.ZodNullable<z.ZodEnum<{
|
|
433
|
+
ALLOW: "ALLOW";
|
|
434
|
+
ASK: "ASK";
|
|
435
|
+
DENY: "DENY";
|
|
436
|
+
}>>;
|
|
437
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
438
|
+
granted: z.ZodBoolean;
|
|
439
|
+
overridden: z.ZodBoolean;
|
|
440
|
+
proposedStateUpdates: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
441
|
+
}, z.core.$strict>;
|
|
442
|
+
export declare const PolicyTestResult: z.ZodObject<{
|
|
443
|
+
verdict: z.ZodEnum<{
|
|
444
|
+
ALLOW: "ALLOW";
|
|
445
|
+
ASK: "ASK";
|
|
446
|
+
DENY: "DENY";
|
|
447
|
+
}>;
|
|
448
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
449
|
+
trace: z.ZodArray<z.ZodObject<{
|
|
450
|
+
scope: z.ZodEnum<{
|
|
451
|
+
profile: "profile";
|
|
452
|
+
server: "server";
|
|
453
|
+
session: "session";
|
|
454
|
+
}>;
|
|
455
|
+
scopeId: z.ZodNullable<z.ZodString>;
|
|
456
|
+
ruleId: z.ZodString;
|
|
457
|
+
ruleRevision: z.ZodNumber;
|
|
458
|
+
verdict: z.ZodNullable<z.ZodEnum<{
|
|
459
|
+
ALLOW: "ALLOW";
|
|
460
|
+
ASK: "ASK";
|
|
461
|
+
DENY: "DENY";
|
|
462
|
+
}>>;
|
|
463
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
464
|
+
granted: z.ZodBoolean;
|
|
465
|
+
overridden: z.ZodBoolean;
|
|
466
|
+
proposedStateUpdates: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
467
|
+
}, z.core.$strict>>;
|
|
468
|
+
proposedStateUpdates: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
469
|
+
enforcement: z.ZodObject<{
|
|
470
|
+
phases: z.ZodArray<z.ZodEnum<{
|
|
471
|
+
request: "request";
|
|
472
|
+
tool_call: "tool_call";
|
|
473
|
+
}>>;
|
|
474
|
+
modelRequest: z.ZodLiteral<false>;
|
|
475
|
+
explanation: z.ZodString;
|
|
476
|
+
}, z.core.$strict>;
|
|
477
|
+
}, z.core.$strict>;
|
|
478
|
+
export declare const CreatePolicyRuleRequest: z.ZodObject<{
|
|
479
|
+
scope: z.ZodEnum<{
|
|
480
|
+
profile: "profile";
|
|
481
|
+
server: "server";
|
|
482
|
+
session: "session";
|
|
483
|
+
}>;
|
|
484
|
+
scopeId: z.ZodNullable<z.ZodString>;
|
|
485
|
+
priority: z.ZodNumber;
|
|
486
|
+
enabled: z.ZodBoolean;
|
|
487
|
+
phases: z.ZodArray<z.ZodEnum<{
|
|
488
|
+
request: "request";
|
|
489
|
+
tool_call: "tool_call";
|
|
490
|
+
}>>;
|
|
491
|
+
name: z.ZodString;
|
|
492
|
+
expression: z.ZodString;
|
|
493
|
+
}, z.core.$strict>;
|
|
494
|
+
export declare const UpdatePolicyRuleRequest: z.ZodObject<{
|
|
495
|
+
expectedRevision: z.ZodNumber;
|
|
496
|
+
name: z.ZodOptional<z.ZodString>;
|
|
497
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
498
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
499
|
+
phases: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
500
|
+
request: "request";
|
|
501
|
+
tool_call: "tool_call";
|
|
502
|
+
}>>>;
|
|
503
|
+
expression: z.ZodOptional<z.ZodString>;
|
|
504
|
+
}, z.core.$strict>;
|
|
505
|
+
export declare const DeletePolicyRuleQuery: z.ZodObject<{
|
|
506
|
+
expectedRevision: z.ZodNumber;
|
|
507
|
+
}, z.core.$strict>;
|
|
508
|
+
export declare const UpdatePolicySettingsRequest: z.ZodObject<{
|
|
509
|
+
expectedRevision: z.ZodNumber;
|
|
510
|
+
modelClassifications: z.ZodArray<z.ZodObject<{
|
|
511
|
+
provider: z.ZodString;
|
|
512
|
+
modelId: z.ZodString;
|
|
513
|
+
classification: z.ZodEnum<{
|
|
514
|
+
cheap: "cheap";
|
|
515
|
+
expensive: "expensive";
|
|
516
|
+
}>;
|
|
517
|
+
}, z.core.$strict>>;
|
|
518
|
+
}, z.core.$strict>;
|
|
519
|
+
export declare const PolicyTestRequest: z.ZodObject<{
|
|
520
|
+
sessionId: z.ZodString;
|
|
521
|
+
phase: z.ZodEnum<{
|
|
522
|
+
request: "request";
|
|
523
|
+
tool_call: "tool_call";
|
|
524
|
+
}>;
|
|
525
|
+
tool: z.ZodNullable<z.ZodObject<{
|
|
526
|
+
name: z.ZodString;
|
|
527
|
+
args: z.ZodCustom<Record<string, JsonValue>, Record<string, JsonValue>>;
|
|
528
|
+
}, z.core.$strict>>;
|
|
529
|
+
request: z.ZodNullable<z.ZodObject<{
|
|
530
|
+
method: z.ZodEnum<{
|
|
531
|
+
"inbox.read": "inbox.read";
|
|
532
|
+
"message.send": "message.send";
|
|
533
|
+
"run.continue": "run.continue";
|
|
534
|
+
"task.create": "task.create";
|
|
535
|
+
}>;
|
|
536
|
+
args: z.ZodCustom<Record<string, JsonValue>, Record<string, JsonValue>>;
|
|
537
|
+
}, z.core.$strict>>;
|
|
538
|
+
}, z.core.$strict>;
|
|
539
|
+
export type CompletedUsageWatermark = z.infer<typeof CompletedUsageWatermark>;
|
|
540
|
+
export type HostPolicyBoundary = z.infer<typeof HostPolicyBoundary>;
|
|
541
|
+
export type HostToolPolicyContext = z.infer<typeof HostToolPolicyContext>;
|
|
542
|
+
export type HostPolicySampleRequest = z.infer<typeof HostPolicySampleRequest>;
|
|
543
|
+
export type HostPolicySampleResult = z.infer<typeof HostPolicySampleResult>;
|
|
544
|
+
export type PolicyPhase = z.infer<typeof PolicyPhase>;
|
|
545
|
+
export type PolicyVerdict = z.infer<typeof PolicyVerdict>;
|
|
546
|
+
export type PolicyRequestAction = z.infer<typeof PolicyRequestAction>;
|
|
547
|
+
export type PolicyScope = z.infer<typeof PolicyScope>;
|
|
548
|
+
export type PolicyCounterMap = z.infer<typeof PolicyCounterMap>;
|
|
549
|
+
export type PolicyRule = z.infer<typeof PolicyRule>;
|
|
550
|
+
export type PolicyToolSafety = z.infer<typeof PolicyToolSafety>;
|
|
551
|
+
export type PolicyToolContext = z.infer<typeof PolicyToolContext>;
|
|
552
|
+
export type PolicyRequestContext = z.infer<typeof PolicyRequestContext>;
|
|
553
|
+
export type PolicySessionContext = z.infer<typeof PolicySessionContext>;
|
|
554
|
+
export type PolicyTaskContext = z.infer<typeof PolicyTaskContext>;
|
|
555
|
+
export type PolicyTargetContext = z.infer<typeof PolicyTargetContext>;
|
|
556
|
+
export type PolicyCostContext = z.infer<typeof PolicyCostContext>;
|
|
557
|
+
export type PolicyContext = z.infer<typeof PolicyContext>;
|
|
558
|
+
export type PolicyRuleResult = z.infer<typeof PolicyRuleResult>;
|
|
559
|
+
export type PolicyEvaluation = z.infer<typeof PolicyEvaluation>;
|
|
560
|
+
export type PolicyPermission = z.infer<typeof PolicyPermission>;
|
|
561
|
+
export type PolicyGrant = z.infer<typeof PolicyGrant>;
|
|
562
|
+
export type PolicyModelClassification = z.infer<typeof PolicyModelClassification>;
|
|
563
|
+
export type PolicySettings = z.infer<typeof PolicySettings>;
|
|
564
|
+
export type PolicyEvaluateRequest = z.infer<typeof PolicyEvaluateRequest>;
|
|
565
|
+
export type PolicyStatusRequest = z.infer<typeof PolicyStatusRequest>;
|
|
566
|
+
export type PolicyStatusResult = z.infer<typeof PolicyStatusResult>;
|
|
567
|
+
export type PolicyCancelRequest = z.infer<typeof PolicyCancelRequest>;
|
|
568
|
+
export type PolicyCancelResult = z.infer<typeof PolicyCancelResult>;
|
|
569
|
+
export type PolicyTrace = z.infer<typeof PolicyTrace>;
|
|
570
|
+
export type PolicyTestResult = z.infer<typeof PolicyTestResult>;
|
|
571
|
+
export type CreatePolicyRuleRequest = z.infer<typeof CreatePolicyRuleRequest>;
|
|
572
|
+
export type UpdatePolicyRuleRequest = z.infer<typeof UpdatePolicyRuleRequest>;
|
|
573
|
+
export type DeletePolicyRuleQuery = z.infer<typeof DeletePolicyRuleQuery>;
|
|
574
|
+
export type UpdatePolicySettingsRequest = z.infer<typeof UpdatePolicySettingsRequest>;
|
|
575
|
+
export type PolicyTestRequest = z.infer<typeof PolicyTestRequest>;
|
|
576
|
+
//# sourceMappingURL=policies.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const TermViewerToServer: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
t: z.ZodLiteral<"in">;
|
|
4
|
+
d: z.ZodString;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
t: z.ZodLiteral<"resize">;
|
|
7
|
+
cols: z.ZodNumber;
|
|
8
|
+
rows: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
t: z.ZodLiteral<"claim">;
|
|
11
|
+
}, z.core.$strip>], "t">;
|
|
12
|
+
export type TermViewerToServer = z.infer<typeof TermViewerToServer>;
|
|
13
|
+
export declare const TermServerToViewer: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
|
+
t: z.ZodLiteral<"out">;
|
|
15
|
+
d: z.ZodString;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
t: z.ZodLiteral<"closed">;
|
|
18
|
+
reason: z.ZodString;
|
|
19
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
+
t: z.ZodLiteral<"size">;
|
|
21
|
+
cols: z.ZodNumber;
|
|
22
|
+
rows: z.ZodNumber;
|
|
23
|
+
owner: z.ZodBoolean;
|
|
24
|
+
}, z.core.$strip>], "t">;
|
|
25
|
+
export type TermServerToViewer = z.infer<typeof TermServerToViewer>;
|
|
26
|
+
export declare const TermCoordinatorMsg: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
27
|
+
t: z.ZodLiteral<"open">;
|
|
28
|
+
sessionId: z.ZodString;
|
|
29
|
+
cols: z.ZodNumber;
|
|
30
|
+
rows: z.ZodNumber;
|
|
31
|
+
passive: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
+
t: z.ZodLiteral<"claim">;
|
|
34
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
+
t: z.ZodLiteral<"in">;
|
|
36
|
+
d: z.ZodString;
|
|
37
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
38
|
+
t: z.ZodLiteral<"resize">;
|
|
39
|
+
cols: z.ZodNumber;
|
|
40
|
+
rows: z.ZodNumber;
|
|
41
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
42
|
+
t: z.ZodLiteral<"close">;
|
|
43
|
+
}, z.core.$strip>], "t">;
|
|
44
|
+
export type TermCoordinatorMsg = z.infer<typeof TermCoordinatorMsg>;
|
|
45
|
+
//# sourceMappingURL=terminal-wire.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Placeholder title of a session created without a prompt (coordinator). */
|
|
2
|
+
export declare const NEW_SESSION_TITLE = "New session";
|
|
3
|
+
/** Placeholder title of a session first seen from a host without a name. */
|
|
4
|
+
export declare const UNTITLED_SESSION_TITLE = "Untitled session";
|
|
5
|
+
/** Whether `t` is one of the placeholder titles, so the first prompt may name the session. */
|
|
6
|
+
export declare function isPlaceholderTitle(t: string): boolean;
|
|
7
|
+
/** First line of a prompt as a title (80 chars max: 77 + "..."); `fallback` when blank. */
|
|
8
|
+
export declare function titleFrom(prompt: string, fallback?: string): string;
|
|
9
|
+
//# sourceMappingURL=titles.d.ts.map
|