@agentshouse/kit-wire 0.1.0-c2e87e570c808 → 0.1.0-c619b2dbd69ae
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/README.md +7 -0
- package/dist/acts.d.ts +74 -5
- package/dist/acts.js +52 -8
- package/dist/arguments.d.ts +11 -0
- package/dist/arguments.js +11 -0
- package/dist/connection.d.ts +52 -19
- package/dist/connection.js +46 -6
- package/dist/enrollment.d.ts +0 -1
- package/dist/enrollment.js +0 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/wire.d.ts +72 -25
- package/dist/wire.js +4 -5
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -9,11 +9,18 @@ The Kit wire: every shape agents.house and the Kit exchange, declared once with
|
|
|
9
9
|
- Every `/kit/<act>` request and answer (`KIT_ACTS`), the names of the door acts the Kit calls
|
|
10
10
|
at `/kit/door/<act>` (`KIT_DOOR_ACTS`), and the sign-in at `/kit` and `/kit/token`
|
|
11
11
|
(`KIT_LOGIN_START`, `KIT_LOGIN_POLL` and their answers).
|
|
12
|
+
- The request-metadata key a `house` call names its Environment function run under
|
|
13
|
+
(`FUNCTION_RUN_META_KEY`).
|
|
12
14
|
- `KIT_WIRE` is computed from those shapes, so a change to any of them is a new wire. A Kit
|
|
13
15
|
names it in the `x-house-kit-wire` header (`KIT_WIRE_HEADER`) of every request and in its
|
|
14
16
|
connection's subprotocol, `KIT_CONNECTION_PROTOCOL_PREFIX` followed by the wire. House serves
|
|
15
17
|
its own wire alone and answers any other with `kit_update_required`, whose `release` and
|
|
16
18
|
`commands` (`BUILDING_KIT`) name the Kit release its Building serves.
|
|
19
|
+
- At `@agentshouse/kit-wire/arguments`, the arguments House takes for each door act
|
|
20
|
+
(`KIT_DOOR_ARGUMENTS`) and for each Tool the Kit calls itself over a conversation's House
|
|
21
|
+
connection (`KIT_TOOLS`, `KIT_TOOL_ARGUMENTS`), each a zod schema of the JSON Schema of the
|
|
22
|
+
shape House refuses a call with, so a rule House checks in its own code stays out. They are
|
|
23
|
+
no part of the wire: a changed argument is a new version of this package, not a new wire.
|
|
17
24
|
|
|
18
25
|
```ts
|
|
19
26
|
import { KIT_WIRE, KIT_WIRE_HEADER, KIT_CALL, type KitActRequest } from '@agentshouse/kit-wire';
|
package/dist/acts.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ declare const CEREMONY_STEP: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
19
19
|
label: z.ZodString;
|
|
20
20
|
name: z.ZodString;
|
|
21
21
|
description: z.ZodOptional<z.ZodString>;
|
|
22
|
+
optional: z.ZodOptional<z.ZodLiteral<true>>;
|
|
22
23
|
}, z.core.$strict>], "kind">;
|
|
23
24
|
export type SecretCeremonyStep = z.infer<typeof CEREMONY_STEP>;
|
|
24
25
|
export declare const DECLARED_SECRET_CEREMONY: z.ZodObject<{
|
|
@@ -35,6 +36,7 @@ export declare const DECLARED_SECRET_CEREMONY: z.ZodObject<{
|
|
|
35
36
|
label: z.ZodString;
|
|
36
37
|
name: z.ZodString;
|
|
37
38
|
description: z.ZodOptional<z.ZodString>;
|
|
39
|
+
optional: z.ZodOptional<z.ZodLiteral<true>>;
|
|
38
40
|
}, z.core.$strict>], "kind">>;
|
|
39
41
|
}, z.core.$strict>;
|
|
40
42
|
export type DeclaredSecretCeremony = z.infer<typeof DECLARED_SECRET_CEREMONY>;
|
|
@@ -59,10 +61,15 @@ export declare const REPORTED_AGENT_KIND: z.ZodObject<{
|
|
|
59
61
|
failure: z.ZodNullable<z.ZodString>;
|
|
60
62
|
installing: z.ZodOptional<z.ZodLiteral<true>>;
|
|
61
63
|
signed_in: z.ZodBoolean;
|
|
64
|
+
api_key: z.ZodOptional<z.ZodLiteral<true>>;
|
|
65
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
62
66
|
models: z.ZodArray<z.ZodObject<{
|
|
63
67
|
model: z.ZodString;
|
|
68
|
+
name: z.ZodString;
|
|
64
69
|
efforts: z.ZodArray<z.ZodString>;
|
|
65
70
|
}, z.core.$strict>>;
|
|
71
|
+
default_model: z.ZodOptional<z.ZodString>;
|
|
72
|
+
default_effort: z.ZodOptional<z.ZodString>;
|
|
66
73
|
modes: z.ZodArray<z.ZodObject<{
|
|
67
74
|
mode: z.ZodString;
|
|
68
75
|
name: z.ZodString;
|
|
@@ -71,6 +78,7 @@ export declare const REPORTED_AGENT_KIND: z.ZodObject<{
|
|
|
71
78
|
}, z.core.$strict>;
|
|
72
79
|
export type ReportedAgentKind = z.infer<typeof REPORTED_AGENT_KIND>;
|
|
73
80
|
export declare const ENVIRONMENT_FORMS: readonly ['laptop', 'desktop', 'server'];
|
|
81
|
+
export declare const KIT_REINSTALLS: readonly ['linux', 'windows'];
|
|
74
82
|
declare const TRANSCRIPTION_REPORT: z.ZodObject<{
|
|
75
83
|
installed: z.ZodBoolean;
|
|
76
84
|
failure: z.ZodNullable<z.ZodString>;
|
|
@@ -88,6 +96,14 @@ export declare const AGENT_CAPABILITY_DECLARATION: z.ZodObject<{
|
|
|
88
96
|
}>>;
|
|
89
97
|
ssh_host_key: z.ZodOptional<z.ZodString>;
|
|
90
98
|
agent_base: z.ZodOptional<z.ZodString>;
|
|
99
|
+
reinstall: z.ZodOptional<z.ZodEnum<{
|
|
100
|
+
linux: "linux";
|
|
101
|
+
windows: "windows";
|
|
102
|
+
}>>;
|
|
103
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
skills: z.ZodBoolean;
|
|
105
|
+
workspace: z.ZodString;
|
|
106
|
+
}, z.core.$strict>>;
|
|
91
107
|
agents: z.ZodArray<z.ZodObject<{
|
|
92
108
|
kind: z.ZodString;
|
|
93
109
|
release: z.ZodNullable<z.ZodString>;
|
|
@@ -96,10 +112,15 @@ export declare const AGENT_CAPABILITY_DECLARATION: z.ZodObject<{
|
|
|
96
112
|
failure: z.ZodNullable<z.ZodString>;
|
|
97
113
|
installing: z.ZodOptional<z.ZodLiteral<true>>;
|
|
98
114
|
signed_in: z.ZodBoolean;
|
|
115
|
+
api_key: z.ZodOptional<z.ZodLiteral<true>>;
|
|
116
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
99
117
|
models: z.ZodArray<z.ZodObject<{
|
|
100
118
|
model: z.ZodString;
|
|
119
|
+
name: z.ZodString;
|
|
101
120
|
efforts: z.ZodArray<z.ZodString>;
|
|
102
121
|
}, z.core.$strict>>;
|
|
122
|
+
default_model: z.ZodOptional<z.ZodString>;
|
|
123
|
+
default_effort: z.ZodOptional<z.ZodString>;
|
|
103
124
|
modes: z.ZodArray<z.ZodObject<{
|
|
104
125
|
mode: z.ZodString;
|
|
105
126
|
name: z.ZodString;
|
|
@@ -152,6 +173,13 @@ export declare const KIT_UPLOAD_FINISH: z.ZodObject<{
|
|
|
152
173
|
upload: z.ZodUUID;
|
|
153
174
|
part_sha256: z.ZodArray<z.ZodString>;
|
|
154
175
|
}, z.core.$strict>;
|
|
176
|
+
export declare const KIT_BINARY_CHANGE: z.ZodObject<{
|
|
177
|
+
path: z.ZodString;
|
|
178
|
+
revision: z.ZodString;
|
|
179
|
+
bytes: z.ZodInt;
|
|
180
|
+
sha256: z.ZodString;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
export type KitBinaryChange = z.infer<typeof KIT_BINARY_CHANGE>;
|
|
155
183
|
export declare const TRANSCRIPT: z.ZodObject<{
|
|
156
184
|
path: z.ZodString;
|
|
157
185
|
text: z.ZodString;
|
|
@@ -166,6 +194,11 @@ export type KitQuestion = z.infer<typeof KIT_QUESTION>;
|
|
|
166
194
|
export declare const LOCAL_COPY_ROOM: z.ZodObject<{
|
|
167
195
|
room_ref: z.ZodString;
|
|
168
196
|
room_handle: z.ZodString;
|
|
197
|
+
level: z.ZodEnum<{
|
|
198
|
+
keep: "keep";
|
|
199
|
+
open: "open";
|
|
200
|
+
search: "search";
|
|
201
|
+
}>;
|
|
169
202
|
}, z.core.$strict>;
|
|
170
203
|
export type LocalCopyRoom = z.infer<typeof LOCAL_COPY_ROOM>;
|
|
171
204
|
export interface KitActDeclaration<Id extends string, Body extends z.ZodType, Answer extends z.ZodType | KitDoorAnswer> {
|
|
@@ -191,6 +224,7 @@ export declare const KIT_ACTS: {
|
|
|
191
224
|
label: z.ZodString;
|
|
192
225
|
name: z.ZodString;
|
|
193
226
|
description: z.ZodOptional<z.ZodString>;
|
|
227
|
+
optional: z.ZodOptional<z.ZodLiteral<true>>;
|
|
194
228
|
}, z.core.$strict>], "kind">>;
|
|
195
229
|
}, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
196
230
|
outcome: z.ZodLiteral<"collected">;
|
|
@@ -214,6 +248,14 @@ export declare const KIT_ACTS: {
|
|
|
214
248
|
}>>;
|
|
215
249
|
ssh_host_key: z.ZodOptional<z.ZodString>;
|
|
216
250
|
agent_base: z.ZodOptional<z.ZodString>;
|
|
251
|
+
reinstall: z.ZodOptional<z.ZodEnum<{
|
|
252
|
+
linux: "linux";
|
|
253
|
+
windows: "windows";
|
|
254
|
+
}>>;
|
|
255
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
256
|
+
skills: z.ZodBoolean;
|
|
257
|
+
workspace: z.ZodString;
|
|
258
|
+
}, z.core.$strict>>;
|
|
217
259
|
agents: z.ZodArray<z.ZodObject<{
|
|
218
260
|
kind: z.ZodString;
|
|
219
261
|
release: z.ZodNullable<z.ZodString>;
|
|
@@ -222,10 +264,15 @@ export declare const KIT_ACTS: {
|
|
|
222
264
|
failure: z.ZodNullable<z.ZodString>;
|
|
223
265
|
installing: z.ZodOptional<z.ZodLiteral<true>>;
|
|
224
266
|
signed_in: z.ZodBoolean;
|
|
267
|
+
api_key: z.ZodOptional<z.ZodLiteral<true>>;
|
|
268
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
225
269
|
models: z.ZodArray<z.ZodObject<{
|
|
226
270
|
model: z.ZodString;
|
|
271
|
+
name: z.ZodString;
|
|
227
272
|
efforts: z.ZodArray<z.ZodString>;
|
|
228
273
|
}, z.core.$strict>>;
|
|
274
|
+
default_model: z.ZodOptional<z.ZodString>;
|
|
275
|
+
default_effort: z.ZodOptional<z.ZodString>;
|
|
229
276
|
modes: z.ZodArray<z.ZodObject<{
|
|
230
277
|
mode: z.ZodString;
|
|
231
278
|
name: z.ZodString;
|
|
@@ -268,6 +315,11 @@ export declare const KIT_ACTS: {
|
|
|
268
315
|
timed_out: z.ZodLiteral<true>;
|
|
269
316
|
}, z.core.$strict>, z.ZodObject<{
|
|
270
317
|
started: z.ZodLiteral<true>;
|
|
318
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
319
|
+
settings: z.ZodObject<{
|
|
320
|
+
skills: z.ZodBoolean;
|
|
321
|
+
workspace: z.ZodString;
|
|
322
|
+
}, z.core.$strict>;
|
|
271
323
|
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>, z.ZodObject<{}, z.core.$strict>>;
|
|
272
324
|
'turns/start': KitActDeclaration<"conversation" | "turn", z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
273
325
|
run: z.ZodOptional<z.ZodLiteral<true>>;
|
|
@@ -285,7 +337,7 @@ export declare const KIT_ACTS: {
|
|
|
285
337
|
}, z.core.$strict>, {
|
|
286
338
|
door: string;
|
|
287
339
|
}>;
|
|
288
|
-
'
|
|
340
|
+
'agent_update.transcript_keep': KitActDeclaration<"conversation" | "message", z.ZodObject<{
|
|
289
341
|
path: z.ZodString;
|
|
290
342
|
text: z.ZodString;
|
|
291
343
|
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
|
|
@@ -295,14 +347,20 @@ export declare const KIT_ACTS: {
|
|
|
295
347
|
}, z.core.$strict>, {
|
|
296
348
|
door: string;
|
|
297
349
|
}>;
|
|
298
|
-
'
|
|
350
|
+
'agent_update.conversation_ask': KitActDeclaration<"conversation" | "turn", z.ZodObject<{
|
|
299
351
|
interaction_id: z.ZodUUID;
|
|
300
352
|
request: z.ZodJSONSchema;
|
|
301
353
|
secret: z.ZodBoolean;
|
|
302
354
|
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
|
|
303
355
|
'kits/report-idle': KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
|
|
304
|
-
'kits/report-restart': KitActDeclaration<never, z.ZodObject<{
|
|
305
|
-
|
|
356
|
+
'kits/report-restart': KitActDeclaration<never, z.ZodObject<{
|
|
357
|
+
planned: z.ZodOptional<z.ZodLiteral<true>>;
|
|
358
|
+
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
|
|
359
|
+
'agent_update.credentials_issue': KitActDeclaration<never, z.ZodUnion<readonly [z.ZodObject<{
|
|
360
|
+
conversation: z.ZodString;
|
|
361
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
362
|
+
run: z.ZodString;
|
|
363
|
+
}, z.core.$strict>]>, z.ZodObject<{
|
|
306
364
|
credential: z.ZodString;
|
|
307
365
|
}, z.core.$strict>>;
|
|
308
366
|
'kits/log-out': KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
@@ -314,10 +372,21 @@ export declare const KIT_ACTS: {
|
|
|
314
372
|
rooms: z.ZodArray<z.ZodObject<{
|
|
315
373
|
room_ref: z.ZodString;
|
|
316
374
|
room_handle: z.ZodString;
|
|
375
|
+
level: z.ZodEnum<{
|
|
376
|
+
keep: "keep";
|
|
377
|
+
open: "open";
|
|
378
|
+
search: "search";
|
|
379
|
+
}>;
|
|
317
380
|
}, z.core.$strict>>;
|
|
318
381
|
}, z.core.$strict>;
|
|
319
382
|
}, z.core.$strict>>;
|
|
320
383
|
};
|
|
384
|
+
export interface KitActRoute {
|
|
385
|
+
readonly path: string;
|
|
386
|
+
readonly op: string | null;
|
|
387
|
+
}
|
|
388
|
+
export declare function kitActRoute(name: string): KitActRoute;
|
|
389
|
+
export declare const FUNCTION_RUN_META_KEY = "agents.house/function-run";
|
|
321
390
|
export type KitActName = keyof typeof KIT_ACTS;
|
|
322
391
|
type Declared<Name extends KitActName> = (typeof KIT_ACTS)[Name];
|
|
323
392
|
type Fields<Body> = Body extends unknown ? (string extends keyof Body ? {} : Body) : never;
|
|
@@ -325,6 +394,6 @@ export type KitActRequest<Name extends KitActName> = {
|
|
|
325
394
|
readonly [Id in Declared<Name>['ids'][number]]: string;
|
|
326
395
|
} & Fields<z.input<Declared<Name>['body']>>;
|
|
327
396
|
export type KitActAnswer<Name extends KitActName> = Declared<Name>['answer'] extends z.ZodType ? z.output<Declared<Name>['answer']> : unknown;
|
|
328
|
-
export declare const KIT_DOOR_ACTS: readonly ['rooms/discover', 'room-chunks/list', 'changes/enumerate', 'files/revisions/list', '
|
|
397
|
+
export declare const KIT_DOOR_ACTS: readonly ['rooms/discover', 'room-chunks/list', 'changes/enumerate', 'files/revisions/list', 'update'];
|
|
329
398
|
export type KitDoorAct = (typeof KIT_DOOR_ACTS)[number];
|
|
330
399
|
export {};
|
package/dist/acts.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { KIT_CALL_RESULT, KIT_CAUSE } from './connection.js';
|
|
2
|
+
import { KIT_CALL_RESULT, KIT_CAUSE, KIT_SETTINGS } from './connection.js';
|
|
3
3
|
export const SHA256 = z
|
|
4
4
|
.string()
|
|
5
5
|
.regex(/^[0-9a-f]{64}$/u, "must be the file's SHA-256 as 64 lowercase hex digits");
|
|
@@ -38,6 +38,9 @@ const CEREMONY_STEP = z.discriminatedUnion('kind', [
|
|
|
38
38
|
label: LABEL,
|
|
39
39
|
name: NAME.max(SECRET_STEP_NAME_MAX),
|
|
40
40
|
description: z.string().max(SECRET_STEP_TEXT_MAX).optional(),
|
|
41
|
+
optional: z.literal(true).optional().meta({
|
|
42
|
+
description: 'Present only for a step whose value may be empty.',
|
|
43
|
+
}),
|
|
41
44
|
}),
|
|
42
45
|
]);
|
|
43
46
|
export const DECLARED_SECRET_CEREMONY = z
|
|
@@ -56,6 +59,7 @@ export const SECRET_RELAY_OUTCOME = z.discriminatedUnion('outcome', [
|
|
|
56
59
|
const AGENT_KIND_MAX = 64;
|
|
57
60
|
const AGENT_RELEASE_MAX = 64;
|
|
58
61
|
const UPDATE_COMMAND_MAX = 256;
|
|
62
|
+
const PROVIDER_HOST_MAX = 255;
|
|
59
63
|
const OPERATING_SYSTEM_MAX = 256;
|
|
60
64
|
const KIT_RELEASE_MAX = 64;
|
|
61
65
|
const OFFERED_MODELS_MAX = 256;
|
|
@@ -64,7 +68,11 @@ const OFFERED_MODES_MAX = 32;
|
|
|
64
68
|
const MODE_NAME_MAX = 128;
|
|
65
69
|
const CHOICE = z.string().min(1);
|
|
66
70
|
const OFFERED_MODELS = z
|
|
67
|
-
.array(z.strictObject({
|
|
71
|
+
.array(z.strictObject({
|
|
72
|
+
model: CHOICE,
|
|
73
|
+
name: z.string().min(1),
|
|
74
|
+
efforts: z.array(CHOICE).max(MODEL_EFFORTS_MAX),
|
|
75
|
+
}))
|
|
68
76
|
.max(OFFERED_MODELS_MAX);
|
|
69
77
|
const OFFERED_MODES = z
|
|
70
78
|
.array(z.strictObject({ mode: CHOICE, name: z.string().min(1).max(MODE_NAME_MAX) }))
|
|
@@ -84,11 +92,24 @@ export const REPORTED_AGENT_KIND = z.strictObject({
|
|
|
84
92
|
description: 'Present only while the Kit installs the CLI, whose release and failure are then null.',
|
|
85
93
|
}),
|
|
86
94
|
signed_in: z.boolean(),
|
|
95
|
+
api_key: z.literal(true).optional().meta({
|
|
96
|
+
description: 'Present only while the CLI runs on an API key it found in its own settings.',
|
|
97
|
+
}),
|
|
98
|
+
provider: z.string().min(1).max(PROVIDER_HOST_MAX).optional().meta({
|
|
99
|
+
description: "Present only while the CLI's endpoint is not its maker's: that endpoint's host.",
|
|
100
|
+
}),
|
|
87
101
|
models: OFFERED_MODELS,
|
|
102
|
+
default_model: CHOICE.optional().meta({
|
|
103
|
+
description: 'Present only where the Kit can name the model a fresh session of the CLI starts with: that model, as models lists it.',
|
|
104
|
+
}),
|
|
105
|
+
default_effort: CHOICE.optional().meta({
|
|
106
|
+
description: 'Present only where the Kit can name the effort a fresh session of the CLI starts with: that effort.',
|
|
107
|
+
}),
|
|
88
108
|
modes: OFFERED_MODES,
|
|
89
109
|
full_access: CHOICE.nullable(),
|
|
90
110
|
});
|
|
91
111
|
export const ENVIRONMENT_FORMS = ['laptop', 'desktop', 'server'];
|
|
112
|
+
export const KIT_REINSTALLS = ['linux', 'windows'];
|
|
92
113
|
const TRANSCRIPTION_REPORT = z.strictObject({
|
|
93
114
|
installed: z.boolean(),
|
|
94
115
|
failure: KIT_CAUSE.nullable(),
|
|
@@ -106,6 +127,10 @@ export const AGENT_CAPABILITY_DECLARATION = z.strictObject({
|
|
|
106
127
|
.regex(/^SHA256:[A-Za-z0-9+/]{43}$/)
|
|
107
128
|
.optional(),
|
|
108
129
|
agent_base: z.string().startsWith('/').optional(),
|
|
130
|
+
reinstall: z.enum(KIT_REINSTALLS).optional().meta({
|
|
131
|
+
description: 'Present only while this Kit runs where an earlier install placed it and only the install command run again on its computer moves it: that command.',
|
|
132
|
+
}),
|
|
133
|
+
settings: KIT_SETTINGS.optional(),
|
|
109
134
|
agents: z
|
|
110
135
|
.array(REPORTED_AGENT_KIND)
|
|
111
136
|
.refine((agents) => new Set(agents.map((agent) => agent.kind)).size === agents.length),
|
|
@@ -133,6 +158,12 @@ export const KIT_TURN_IMAGE = z.strictObject({
|
|
|
133
158
|
media_type: MEDIA_TYPE,
|
|
134
159
|
});
|
|
135
160
|
export const KIT_UPLOAD_FINISH = z.strictObject({ upload: z.uuid(), part_sha256: PART_SHA256 });
|
|
161
|
+
export const KIT_BINARY_CHANGE = z.object({
|
|
162
|
+
path: z.string().min(1),
|
|
163
|
+
revision: z.string().min(1),
|
|
164
|
+
bytes: FILE_BYTES,
|
|
165
|
+
sha256: SHA256,
|
|
166
|
+
});
|
|
136
167
|
export const TRANSCRIPT = z.strictObject({
|
|
137
168
|
path: z.string().regex(/^\/rooms\/[^/)\s]+\/[^)\s]+$/u),
|
|
138
169
|
text: z.string().min(1),
|
|
@@ -142,12 +173,18 @@ export const KIT_QUESTION = z.strictObject({
|
|
|
142
173
|
request: z.json(),
|
|
143
174
|
secret: z.boolean(),
|
|
144
175
|
});
|
|
145
|
-
export const LOCAL_COPY_ROOM = z.strictObject({
|
|
176
|
+
export const LOCAL_COPY_ROOM = z.strictObject({
|
|
177
|
+
room_ref: z.string(),
|
|
178
|
+
room_handle: z.string(),
|
|
179
|
+
level: z.enum(['search', 'open', 'keep']),
|
|
180
|
+
});
|
|
146
181
|
const NOTHING = z.strictObject({});
|
|
182
|
+
const KIT_RESTART = z.strictObject({ planned: z.literal(true).optional() });
|
|
147
183
|
function act(ids, body, answer) {
|
|
148
184
|
return { ids, body, answer };
|
|
149
185
|
}
|
|
150
186
|
const CONVERSATION_TURN = ['conversation', 'turn'];
|
|
187
|
+
const CREDENTIAL = z.strictObject({ credential: z.string().min(1) });
|
|
151
188
|
export const KIT_ACTS = {
|
|
152
189
|
'secret-inputs/await': act(['subject'], DECLARED_SECRET_CEREMONY, SECRET_RELAY_OUTCOME),
|
|
153
190
|
'agents/report': act([], AGENT_CAPABILITY_DECLARATION, NOTHING),
|
|
@@ -157,19 +194,26 @@ export const KIT_ACTS = {
|
|
|
157
194
|
'turns/activity/report': act(CONVERSATION_TURN, NOTHING, NOTHING),
|
|
158
195
|
'turns/end': act(CONVERSATION_TURN, KIT_TURN_END, NOTHING),
|
|
159
196
|
'turns/images/declare': act(CONVERSATION_TURN, KIT_TURN_IMAGE, { door: 'files/attach' }),
|
|
160
|
-
'
|
|
197
|
+
'agent_update.transcript_keep': act(['conversation', 'message'], TRANSCRIPT, NOTHING),
|
|
161
198
|
'uploads/finish': act([], KIT_UPLOAD_FINISH, { door: 'files/finish' }),
|
|
162
|
-
'
|
|
199
|
+
'agent_update.conversation_ask': act(CONVERSATION_TURN, KIT_QUESTION, NOTHING),
|
|
163
200
|
'kits/report-idle': act([], NOTHING, NOTHING),
|
|
164
|
-
'kits/report-restart': act([],
|
|
165
|
-
'
|
|
201
|
+
'kits/report-restart': act([], KIT_RESTART, NOTHING),
|
|
202
|
+
'agent_update.credentials_issue': act([], z.union([z.strictObject({ conversation: z.string() }), z.strictObject({ run: z.string() })]), CREDENTIAL),
|
|
166
203
|
'kits/log-out': act([], NOTHING, z.strictObject({ environment: z.uuid(), revoked: z.literal(true) })),
|
|
167
204
|
'local-copies/selection/read': act([], NOTHING, z.strictObject({ local_copy: z.strictObject({ rooms: z.array(LOCAL_COPY_ROOM) }) })),
|
|
168
205
|
};
|
|
206
|
+
export function kitActRoute(name) {
|
|
207
|
+
const dot = name.indexOf('.');
|
|
208
|
+
return dot < 0
|
|
209
|
+
? { path: `/kit/${name}`, op: null }
|
|
210
|
+
: { path: `/kit/${name.slice(0, dot)}`, op: name.slice(dot + 1) };
|
|
211
|
+
}
|
|
212
|
+
export const FUNCTION_RUN_META_KEY = 'agents.house/function-run';
|
|
169
213
|
export const KIT_DOOR_ACTS = [
|
|
170
214
|
'rooms/discover',
|
|
171
215
|
'room-chunks/list',
|
|
172
216
|
'changes/enumerate',
|
|
173
217
|
'files/revisions/list',
|
|
174
|
-
'
|
|
218
|
+
'update',
|
|
175
219
|
];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { KitDoorAct } from './acts.ts';
|
|
3
|
+
export declare const KIT_TOOLS: readonly ['upload', 'update', 'info'];
|
|
4
|
+
export type KitTool = (typeof KIT_TOOLS)[number];
|
|
5
|
+
export type KitArgumentShape = Readonly<Record<string, unknown>>;
|
|
6
|
+
export interface KitArgumentShapes {
|
|
7
|
+
readonly door: Readonly<Record<KitDoorAct, KitArgumentShape>>;
|
|
8
|
+
readonly tools: Readonly<Record<KitTool, KitArgumentShape>>;
|
|
9
|
+
}
|
|
10
|
+
export declare const KIT_DOOR_ARGUMENTS: Readonly<Partial<Record<"changes/enumerate" | "files/revisions/list" | "room-chunks/list" | "rooms/discover" | "update", z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>>;
|
|
11
|
+
export declare const KIT_TOOL_ARGUMENTS: Readonly<Partial<Record<"info" | "update" | "upload", z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const KIT_TOOLS = ['upload', 'update', 'info'];
|
|
3
|
+
const HOUSE_ARGUMENTS = {"door":{"rooms/discover":{"type":"object","properties":{"prefixes":{"maxItems":256,"type":"array","items":{"type":"string"}},"operation_id":{"type":"string"}},"required":["prefixes"],"additionalProperties":false},"room-chunks/list":{"type":"object","properties":{"prefixes":{"maxItems":256,"type":"array","items":{"type":"string"}},"operation_id":{"type":"string"}},"required":["prefixes"],"additionalProperties":false},"changes/enumerate":{"type":"object","properties":{"prefixes":{"maxItems":256,"type":"array","items":{"type":"string"}},"positions":{"maxItems":256,"type":"array","items":{"type":"object","properties":{"authority":{"type":"string","minLength":1,"maxLength":128},"position":{"type":"string"},"log_epoch":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"page":{"type":"object","properties":{"through":{"type":"string"},"read":{"type":"integer","minimum":0,"maximum":2147483647}},"required":["through","read"],"additionalProperties":false}},"required":["authority","position","log_epoch"],"additionalProperties":false}},"operation_id":{"type":"string"}},"required":["prefixes","positions"],"additionalProperties":false},"files/revisions/list":{"type":"object","properties":{"path":{"type":"string","minLength":1},"revision":{"type":"string"},"before":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"limit":{"type":"integer","minimum":1,"maximum":200},"operation_id":{"type":"string"}},"required":["path"],"additionalProperties":false},"update":{"anyOf":[{"type":"object","properties":{"mount":{"type":"string","minLength":1},"changes":{"minItems":1,"maxItems":10000,"type":"array","items":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","const":"write"},"path":{"type":"string","minLength":1},"content":{"type":"string"},"base":{"type":"string","minLength":1,"maxLength":64}},"required":["op","path","content"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"edit"},"path":{"type":"string","minLength":1},"find":{"type":"string","minLength":1},"replace":{"type":"string"},"base":{"type":"string","minLength":1,"maxLength":64}},"required":["op","path","find","replace"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"move"},"path":{"type":"string","minLength":1},"to":{"type":"string","minLength":1},"base":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"object","propertyNames":{"type":"string","minLength":1},"additionalProperties":{"type":"string","minLength":1,"maxLength":64}}]}},"required":["op","path","to"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"delete"},"path":{"type":"string","minLength":1},"base":{"type":"string","minLength":1,"maxLength":64}},"required":["op","path"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"upload"},"path":{"type":"string","minLength":1},"base":{"type":"string","minLength":1,"maxLength":64},"local_id":{"type":"string","minLength":1,"maxLength":64},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"media_type":{"type":"string","minLength":1,"maxLength":255}},"required":["op","path","bytes","sha256","media_type"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"record"},"path":{"type":"string","minLength":1},"body":{"type":"string"},"claimed":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"name":{"type":"string","minLength":1,"maxLength":200},"key":{"type":"string","minLength":1},"original":{"type":"string","minLength":1}},"required":["op","path","body","claimed"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"mkdir"},"path":{"type":"string","minLength":1},"name":{"type":"string","maxLength":200},"from":{"type":"string","minLength":1,"maxLength":200},"content":{"type":"boolean"},"readme":{"type":"string"},"space":{"type":"string","minLength":1,"maxLength":200}},"required":["op","path"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"set"},"path":{"type":"string","minLength":1},"name":{"type":"string","maxLength":200},"time_zone":{"type":"string","maxLength":64},"public":{"type":"boolean"},"space":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["op","path"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"restore"},"path":{"type":"string","minLength":1},"ref":{"type":"string","minLength":1,"maxLength":200}},"required":["op","path"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"erase"},"path":{"type":"string","minLength":1},"ref":{"type":"string","minLength":1,"maxLength":200}},"required":["op","path"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"clear"},"room":{"type":"string","minLength":1,"maxLength":200}},"required":["op","room"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"trash_empty"},"room":{"type":"string","minLength":1,"maxLength":200}},"required":["op","room"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"versions_clear"},"room":{"type":"string","minLength":1,"maxLength":200}},"required":["op","room"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"trigger_create"},"room":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\r\\n\\u2028\\u2029]*$"},"condition":{"anyOf":[{"type":"object","properties":{"on":{"type":"string","const":"documents"},"query":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"}},"pathPrefix":{"type":"string"},"paths":{"type":"array","items":{"type":"string"}},"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false},"new_documents":{"type":"boolean"},"changes":{"anyOf":[{"type":"string","const":"text"},{"type":"object","properties":{"field":{"type":"string"},"from":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean","null"]}},{"type":"string","const":"new"}]},"to":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean","null"]}},{"type":"string","const":"deleted"}]}},"required":["field"],"additionalProperties":false}]},"by":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"moved_between_rooms":{"type":"boolean"}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"items"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"notifications"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"messages"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"clock"},"cron":{"type":"string"},"time_zone":{"type":"string"}},"required":["on","cron"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"clock"},"query":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"}},"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["types"],"additionalProperties":false},"date":{"type":"string"},"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"at":{"type":"string"},"time_zone":{"type":"string"}},"required":["on","query","date","days","at"],"additionalProperties":false}]},"actions":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"notify"},"title":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","minLength":1,"maxLength":4000},"to":{"type":"object","properties":{"users":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"fields":{"default":[],"maxItems":16,"type":"array","items":{"type":"string"}},"roles":{"default":[],"maxItems":16,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"additionalProperties":false},"in_group":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","title","text","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"agent_function"},"card":{"type":"string","pattern":"^[^/]+$"},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1},"enabled":{"default":true,"type":"boolean"}},"required":["kind","card"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"message"},"card":{"type":"string","pattern":"^[^/]+$"},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1},"enabled":{"default":true,"type":"boolean"}},"required":["kind","card"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"function"},"app":{"type":"string","pattern":"^a_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz])$"},"function":{"type":"string","pattern":"^[^\\p{Cc}]{1,64}$"},"attached_by":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attach":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","app","function"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"function"},"function":{"type":"string","pattern":"^[^\\p{Cc}]{1,64}$"},"owner":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","function","owner"],"additionalProperties":false}]}},"enabled":{"type":"boolean"}},"required":["op","room","description","condition","actions"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"trigger_set"},"trigger":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\r\\n\\u2028\\u2029]*$"},"condition":{"anyOf":[{"type":"object","properties":{"on":{"type":"string","const":"documents"},"query":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"}},"pathPrefix":{"type":"string"},"paths":{"type":"array","items":{"type":"string"}},"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false},"new_documents":{"type":"boolean"},"changes":{"anyOf":[{"type":"string","const":"text"},{"type":"object","properties":{"field":{"type":"string"},"from":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean","null"]}},{"type":"string","const":"new"}]},"to":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean","null"]}},{"type":"string","const":"deleted"}]}},"required":["field"],"additionalProperties":false}]},"by":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"moved_between_rooms":{"type":"boolean"}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"items"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"notifications"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"messages"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"clock"},"cron":{"type":"string"},"time_zone":{"type":"string"}},"required":["on","cron"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"clock"},"query":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"}},"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["types"],"additionalProperties":false},"date":{"type":"string"},"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"at":{"type":"string"},"time_zone":{"type":"string"}},"required":["on","query","date","days","at"],"additionalProperties":false}]},"actions":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"notify"},"title":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","minLength":1,"maxLength":4000},"to":{"type":"object","properties":{"users":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"fields":{"default":[],"maxItems":16,"type":"array","items":{"type":"string"}},"roles":{"default":[],"maxItems":16,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"additionalProperties":false},"in_group":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","title","text","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"agent_function"},"card":{"type":"string","pattern":"^[^/]+$"},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1},"enabled":{"default":true,"type":"boolean"}},"required":["kind","card"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"message"},"card":{"type":"string","pattern":"^[^/]+$"},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1},"enabled":{"default":true,"type":"boolean"}},"required":["kind","card"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"function"},"app":{"type":"string","pattern":"^a_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz])$"},"function":{"type":"string","pattern":"^[^\\p{Cc}]{1,64}$"},"attached_by":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attach":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","app","function"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"function"},"function":{"type":"string","pattern":"^[^\\p{Cc}]{1,64}$"},"owner":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","function","owner"],"additionalProperties":false}]}},"enabled":{"type":"boolean"},"action":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["op","trigger"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"trigger_delete"},"trigger":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["op","trigger"],"additionalProperties":false}]}},"runtime":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"app_ref":{"type":"string"},"release":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"operation_id":{"type":"string"}},"required":["changes"],"additionalProperties":false},{"type":"object","properties":{"mount":{"type":"string","minLength":1},"paths":{"minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","minLength":1}},"upload":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"operation":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"bytes":{"type":"integer","minimum":3936001,"maximum":31999963},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["url","operation","bytes","sha256"],"additionalProperties":false},"runtime":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"app_ref":{"type":"string"},"release":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"operation_id":{"type":"string"}},"required":["paths","upload"],"additionalProperties":false}]}},"tools":{"upload":{"type":"object","properties":{"file":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"download_url":{"type":"string","format":"uri"},"file_id":{"type":"string","minLength":1},"mime_type":{"type":"string","minLength":1,"maxLength":255},"file_name":{"type":"string"}},"required":["download_url","file_id"],"additionalProperties":false}]},"path":{"type":"string","minLength":1},"base":{"type":"string","minLength":1},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"media_type":{"type":"string","minLength":1,"maxLength":255},"upload":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"part_sha256":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{64}$"}}},"additionalProperties":false},"update":{"type":"object","properties":{"changes":{"minItems":1,"maxItems":10000,"type":"array","items":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","const":"write"},"path":{"type":"string","minLength":1},"content":{"type":"string"},"base":{"type":"string","minLength":1,"maxLength":64}},"required":["op","path","content"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"edit"},"path":{"type":"string","minLength":1},"find":{"type":"string","minLength":1},"replace":{"type":"string"},"base":{"type":"string","minLength":1,"maxLength":64}},"required":["op","path","find","replace"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"move"},"path":{"type":"string","minLength":1},"to":{"type":"string","minLength":1},"base":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"object","propertyNames":{"type":"string","minLength":1},"additionalProperties":{"type":"string","minLength":1,"maxLength":64}}]}},"required":["op","path","to"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"delete"},"path":{"type":"string","minLength":1},"base":{"type":"string","minLength":1,"maxLength":64}},"required":["op","path"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"upload"},"path":{"type":"string","minLength":1},"base":{"type":"string","minLength":1,"maxLength":64},"local_id":{"type":"string","minLength":1,"maxLength":64},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"media_type":{"type":"string","minLength":1,"maxLength":255}},"required":["op","path","bytes","sha256","media_type"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"record"},"path":{"type":"string","minLength":1},"body":{"type":"string"},"claimed":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"name":{"type":"string","minLength":1,"maxLength":200},"key":{"type":"string","minLength":1},"original":{"type":"string","minLength":1}},"required":["op","path","body","claimed"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"mkdir"},"path":{"type":"string","minLength":1},"name":{"type":"string","maxLength":200},"from":{"type":"string","minLength":1,"maxLength":200},"content":{"type":"boolean"},"readme":{"type":"string"},"space":{"type":"string","minLength":1,"maxLength":200}},"required":["op","path"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"set"},"path":{"type":"string","minLength":1},"name":{"type":"string","maxLength":200},"time_zone":{"type":"string","maxLength":64},"public":{"type":"boolean"},"space":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["op","path"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"restore"},"path":{"type":"string","minLength":1},"ref":{"type":"string","minLength":1,"maxLength":200}},"required":["op","path"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"erase"},"path":{"type":"string","minLength":1},"ref":{"type":"string","minLength":1,"maxLength":200}},"required":["op","path"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"clear"},"room":{"type":"string","minLength":1,"maxLength":200}},"required":["op","room"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"trash_empty"},"room":{"type":"string","minLength":1,"maxLength":200}},"required":["op","room"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"versions_clear"},"room":{"type":"string","minLength":1,"maxLength":200}},"required":["op","room"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"trigger_create"},"room":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\r\\n\\u2028\\u2029]*$"},"condition":{"anyOf":[{"type":"object","properties":{"on":{"type":"string","const":"documents"},"query":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"}},"pathPrefix":{"type":"string"},"paths":{"type":"array","items":{"type":"string"}},"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false},"new_documents":{"type":"boolean"},"changes":{"anyOf":[{"type":"string","const":"text"},{"type":"object","properties":{"field":{"type":"string"},"from":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean","null"]}},{"type":"string","const":"new"}]},"to":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean","null"]}},{"type":"string","const":"deleted"}]}},"required":["field"],"additionalProperties":false}]},"by":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"moved_between_rooms":{"type":"boolean"}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"items"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"notifications"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"messages"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"clock"},"cron":{"type":"string"},"time_zone":{"type":"string"}},"required":["on","cron"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"clock"},"query":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"}},"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["types"],"additionalProperties":false},"date":{"type":"string"},"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"at":{"type":"string"},"time_zone":{"type":"string"}},"required":["on","query","date","days","at"],"additionalProperties":false}]},"actions":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"notify"},"title":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","minLength":1,"maxLength":4000},"to":{"type":"object","properties":{"users":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"fields":{"default":[],"maxItems":16,"type":"array","items":{"type":"string"}},"roles":{"default":[],"maxItems":16,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"additionalProperties":false},"in_group":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","title","text","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"agent_function"},"card":{"type":"string","pattern":"^[^/]+$"},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1},"enabled":{"default":true,"type":"boolean"}},"required":["kind","card"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"message"},"card":{"type":"string","pattern":"^[^/]+$"},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1},"enabled":{"default":true,"type":"boolean"}},"required":["kind","card"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"function"},"app":{"type":"string","pattern":"^a_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz])$"},"function":{"type":"string","pattern":"^[^\\p{Cc}]{1,64}$"},"attached_by":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attach":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","app","function"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"function"},"function":{"type":"string","pattern":"^[^\\p{Cc}]{1,64}$"},"owner":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","function","owner"],"additionalProperties":false}]}},"enabled":{"type":"boolean"}},"required":["op","room","description","condition","actions"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"trigger_set"},"trigger":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\r\\n\\u2028\\u2029]*$"},"condition":{"anyOf":[{"type":"object","properties":{"on":{"type":"string","const":"documents"},"query":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"}},"pathPrefix":{"type":"string"},"paths":{"type":"array","items":{"type":"string"}},"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false},"new_documents":{"type":"boolean"},"changes":{"anyOf":[{"type":"string","const":"text"},{"type":"object","properties":{"field":{"type":"string"},"from":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean","null"]}},{"type":"string","const":"new"}]},"to":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean","null"]}},{"type":"string","const":"deleted"}]}},"required":["field"],"additionalProperties":false}]},"by":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"moved_between_rooms":{"type":"boolean"}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"items"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"notifications"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"messages"},"query":{"type":"object","properties":{"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}},"required":["on"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"clock"},"cron":{"type":"string"},"time_zone":{"type":"string"}},"required":["on","cron"],"additionalProperties":false},{"type":"object","properties":{"on":{"type":"string","const":"clock"},"query":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"}},"where":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["types"],"additionalProperties":false},"date":{"type":"string"},"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"at":{"type":"string"},"time_zone":{"type":"string"}},"required":["on","query","date","days","at"],"additionalProperties":false}]},"actions":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"notify"},"title":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","minLength":1,"maxLength":4000},"to":{"type":"object","properties":{"users":{"default":[],"maxItems":64,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"fields":{"default":[],"maxItems":16,"type":"array","items":{"type":"string"}},"roles":{"default":[],"maxItems":16,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"additionalProperties":false},"in_group":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","title","text","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"agent_function"},"card":{"type":"string","pattern":"^[^/]+$"},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1},"enabled":{"default":true,"type":"boolean"}},"required":["kind","card"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"message"},"card":{"type":"string","pattern":"^[^/]+$"},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1},"enabled":{"default":true,"type":"boolean"}},"required":["kind","card"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"function"},"app":{"type":"string","pattern":"^a_([0123456789abcdefghjkmnpqrstvwxyz]+)\\.([0123456789abcdefghjkmnpqrstvwxyz])$"},"function":{"type":"string","pattern":"^[^\\p{Cc}]{1,64}$"},"attached_by":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"attach":{"default":false,"type":"boolean"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","app","function"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"function"},"function":{"type":"string","pattern":"^[^\\p{Cc}]{1,64}$"},"owner":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"enabled":{"default":true,"type":"boolean"}},"required":["kind","function","owner"],"additionalProperties":false}]}},"enabled":{"type":"boolean"},"action":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["op","trigger"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"trigger_delete"},"trigger":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["op","trigger"],"additionalProperties":false}]}},"upload":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"operation":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"bytes":{"type":"integer","minimum":3936001,"maximum":31999963},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["url","operation","bytes","sha256"],"additionalProperties":false},"mount":{"type":"string","minLength":1},"op":{"type":"string","const":"stage"},"paths":{"minItems":1,"maxItems":2000,"type":"array","items":{"type":"string","minLength":1}},"bytes":{"type":"integer","minimum":3936001,"maximum":31999963},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"additionalProperties":false},"info":{"type":"object","properties":{"path":{"type":"string","minLength":1},"ref":{"type":"string","minLength":1},"app":{"type":"string","minLength":1},"agent":{"type":"string","minLength":1},"environment":{"type":"string","minLength":1},"conversation":{"type":"string","minLength":1},"history":{"type":"boolean"},"events":{"type":"boolean"},"errors":{"type":"boolean"},"query":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"cursor":{"type":"string","minLength":1}},"additionalProperties":false}}};
|
|
4
|
+
function declared(shapes) {
|
|
5
|
+
return Object.fromEntries(Object.entries(shapes ?? {}).map(([name, shape]) => [
|
|
6
|
+
name,
|
|
7
|
+
z.fromJSONSchema(shape),
|
|
8
|
+
]));
|
|
9
|
+
}
|
|
10
|
+
export const KIT_DOOR_ARGUMENTS = declared(HOUSE_ARGUMENTS.door);
|
|
11
|
+
export const KIT_TOOL_ARGUMENTS = declared(HOUSE_ARGUMENTS.tools);
|
package/dist/connection.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const KIT_CONNECTION_PATH = "/kit/stream";
|
|
3
3
|
export declare const KIT_CONNECTION_PROTOCOL_PREFIX = "house.kit.stream.";
|
|
4
4
|
export declare const KIT_CAUSE: z.ZodString;
|
|
5
|
+
export declare const KIT_SETTINGS: z.ZodObject<{
|
|
6
|
+
skills: z.ZodBoolean;
|
|
7
|
+
workspace: z.ZodString;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export type KitSettings = z.infer<typeof KIT_SETTINGS>;
|
|
5
10
|
export declare const KIT_CALL_RESULT: z.ZodUnion<readonly [z.ZodObject<{
|
|
6
11
|
provider_session_id: z.ZodString;
|
|
7
12
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -19,8 +24,14 @@ export declare const KIT_CALL_RESULT: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
19
24
|
timed_out: z.ZodLiteral<true>;
|
|
20
25
|
}, z.core.$strict>, z.ZodObject<{
|
|
21
26
|
started: z.ZodLiteral<true>;
|
|
27
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
28
|
+
settings: z.ZodObject<{
|
|
29
|
+
skills: z.ZodBoolean;
|
|
30
|
+
workspace: z.ZodString;
|
|
31
|
+
}, z.core.$strict>;
|
|
22
32
|
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>;
|
|
23
33
|
export type KitCallResult = z.infer<typeof KIT_CALL_RESULT>;
|
|
34
|
+
export declare const SESSION_CHOICE_BYTES_MAX = 128;
|
|
24
35
|
export declare const KIT_CALLS: {
|
|
25
36
|
open: z.ZodObject<{
|
|
26
37
|
type: z.ZodLiteral<"input">;
|
|
@@ -29,7 +40,11 @@ export declare const KIT_CALLS: {
|
|
|
29
40
|
agent_id: z.ZodUUID;
|
|
30
41
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
31
42
|
kind: z.ZodLiteral<"open">;
|
|
43
|
+
model: z.ZodOptional<z.ZodString>;
|
|
44
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
32
45
|
afk: z.ZodOptional<z.ZodLiteral<true>>;
|
|
46
|
+
room_ref: z.ZodNullable<z.ZodString>;
|
|
47
|
+
name: z.ZodString;
|
|
33
48
|
}, z.core.$strict>;
|
|
34
49
|
kill: z.ZodObject<{
|
|
35
50
|
type: z.ZodLiteral<"input">;
|
|
@@ -39,14 +54,6 @@ export declare const KIT_CALLS: {
|
|
|
39
54
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
40
55
|
kind: z.ZodLiteral<"kill">;
|
|
41
56
|
}, z.core.$strict>;
|
|
42
|
-
done: z.ZodObject<{
|
|
43
|
-
type: z.ZodLiteral<"input">;
|
|
44
|
-
input_id: z.ZodUUID;
|
|
45
|
-
conversation_id: z.ZodUUID;
|
|
46
|
-
agent_id: z.ZodUUID;
|
|
47
|
-
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
48
|
-
kind: z.ZodLiteral<"done">;
|
|
49
|
-
}, z.core.$strict>;
|
|
50
57
|
message: z.ZodObject<{
|
|
51
58
|
type: z.ZodLiteral<"input">;
|
|
52
59
|
input_id: z.ZodUUID;
|
|
@@ -54,6 +61,8 @@ export declare const KIT_CALLS: {
|
|
|
54
61
|
agent_id: z.ZodUUID;
|
|
55
62
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
56
63
|
kind: z.ZodLiteral<"message">;
|
|
64
|
+
model: z.ZodOptional<z.ZodString>;
|
|
65
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
57
66
|
message_id: z.ZodUUID;
|
|
58
67
|
text: z.ZodString;
|
|
59
68
|
first: z.ZodBoolean;
|
|
@@ -86,6 +95,8 @@ export declare const KIT_CALLS: {
|
|
|
86
95
|
agent_id: z.ZodUUID;
|
|
87
96
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
88
97
|
kind: z.ZodLiteral<"answer">;
|
|
98
|
+
model: z.ZodOptional<z.ZodString>;
|
|
99
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
89
100
|
interaction_id: z.ZodUUID;
|
|
90
101
|
response: z.ZodUnknown;
|
|
91
102
|
request: z.ZodUnknown;
|
|
@@ -97,8 +108,8 @@ export declare const KIT_CALLS: {
|
|
|
97
108
|
agent_id: z.ZodUUID;
|
|
98
109
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
99
110
|
kind: z.ZodLiteral<"option">;
|
|
100
|
-
|
|
101
|
-
|
|
111
|
+
model: z.ZodOptional<z.ZodString>;
|
|
112
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
102
113
|
}, z.core.$strict>;
|
|
103
114
|
sign_in: z.ZodObject<{
|
|
104
115
|
type: z.ZodLiteral<"input">;
|
|
@@ -109,6 +120,7 @@ export declare const KIT_CALLS: {
|
|
|
109
120
|
kind: z.ZodLiteral<"sign_in">;
|
|
110
121
|
cli: z.ZodString;
|
|
111
122
|
ends_in: z.ZodInt;
|
|
123
|
+
api_key: z.ZodOptional<z.ZodLiteral<true>>;
|
|
112
124
|
}, z.core.$strict>;
|
|
113
125
|
update: z.ZodObject<{
|
|
114
126
|
type: z.ZodLiteral<"input">;
|
|
@@ -119,6 +131,16 @@ export declare const KIT_CALLS: {
|
|
|
119
131
|
kind: z.ZodLiteral<"update">;
|
|
120
132
|
release: z.ZodString;
|
|
121
133
|
}, z.core.$strict>;
|
|
134
|
+
settings: z.ZodObject<{
|
|
135
|
+
type: z.ZodLiteral<"input">;
|
|
136
|
+
input_id: z.ZodUUID;
|
|
137
|
+
conversation_id: z.ZodNull;
|
|
138
|
+
agent_id: z.ZodNull;
|
|
139
|
+
provider_session_id: z.ZodNull;
|
|
140
|
+
kind: z.ZodLiteral<"settings">;
|
|
141
|
+
skills: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
143
|
+
}, z.core.$strict>;
|
|
122
144
|
run_wizard: z.ZodObject<{
|
|
123
145
|
type: z.ZodLiteral<"input">;
|
|
124
146
|
input_id: z.ZodUUID;
|
|
@@ -149,7 +171,11 @@ export declare const KIT_CALL: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
149
171
|
agent_id: z.ZodUUID;
|
|
150
172
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
151
173
|
kind: z.ZodLiteral<"open">;
|
|
174
|
+
model: z.ZodOptional<z.ZodString>;
|
|
175
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
152
176
|
afk: z.ZodOptional<z.ZodLiteral<true>>;
|
|
177
|
+
room_ref: z.ZodNullable<z.ZodString>;
|
|
178
|
+
name: z.ZodString;
|
|
153
179
|
}, z.core.$strict>, z.ZodObject<{
|
|
154
180
|
type: z.ZodLiteral<"input">;
|
|
155
181
|
input_id: z.ZodUUID;
|
|
@@ -157,13 +183,6 @@ export declare const KIT_CALL: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
157
183
|
agent_id: z.ZodUUID;
|
|
158
184
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
159
185
|
kind: z.ZodLiteral<"kill">;
|
|
160
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
161
|
-
type: z.ZodLiteral<"input">;
|
|
162
|
-
input_id: z.ZodUUID;
|
|
163
|
-
conversation_id: z.ZodUUID;
|
|
164
|
-
agent_id: z.ZodUUID;
|
|
165
|
-
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
166
|
-
kind: z.ZodLiteral<"done">;
|
|
167
186
|
}, z.core.$strict>, z.ZodObject<{
|
|
168
187
|
type: z.ZodLiteral<"input">;
|
|
169
188
|
input_id: z.ZodUUID;
|
|
@@ -171,6 +190,8 @@ export declare const KIT_CALL: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
171
190
|
agent_id: z.ZodUUID;
|
|
172
191
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
173
192
|
kind: z.ZodLiteral<"message">;
|
|
193
|
+
model: z.ZodOptional<z.ZodString>;
|
|
194
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
174
195
|
message_id: z.ZodUUID;
|
|
175
196
|
text: z.ZodString;
|
|
176
197
|
first: z.ZodBoolean;
|
|
@@ -200,6 +221,8 @@ export declare const KIT_CALL: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
200
221
|
agent_id: z.ZodUUID;
|
|
201
222
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
202
223
|
kind: z.ZodLiteral<"answer">;
|
|
224
|
+
model: z.ZodOptional<z.ZodString>;
|
|
225
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
203
226
|
interaction_id: z.ZodUUID;
|
|
204
227
|
response: z.ZodUnknown;
|
|
205
228
|
request: z.ZodUnknown;
|
|
@@ -210,8 +233,8 @@ export declare const KIT_CALL: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
210
233
|
agent_id: z.ZodUUID;
|
|
211
234
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
212
235
|
kind: z.ZodLiteral<"option">;
|
|
213
|
-
|
|
214
|
-
|
|
236
|
+
model: z.ZodOptional<z.ZodString>;
|
|
237
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
215
238
|
}, z.core.$strict>, z.ZodObject<{
|
|
216
239
|
type: z.ZodLiteral<"input">;
|
|
217
240
|
input_id: z.ZodUUID;
|
|
@@ -221,6 +244,7 @@ export declare const KIT_CALL: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
221
244
|
kind: z.ZodLiteral<"sign_in">;
|
|
222
245
|
cli: z.ZodString;
|
|
223
246
|
ends_in: z.ZodInt;
|
|
247
|
+
api_key: z.ZodOptional<z.ZodLiteral<true>>;
|
|
224
248
|
}, z.core.$strict>, z.ZodObject<{
|
|
225
249
|
type: z.ZodLiteral<"input">;
|
|
226
250
|
input_id: z.ZodUUID;
|
|
@@ -229,6 +253,15 @@ export declare const KIT_CALL: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
229
253
|
provider_session_id: z.ZodNull;
|
|
230
254
|
kind: z.ZodLiteral<"update">;
|
|
231
255
|
release: z.ZodString;
|
|
256
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
257
|
+
type: z.ZodLiteral<"input">;
|
|
258
|
+
input_id: z.ZodUUID;
|
|
259
|
+
conversation_id: z.ZodNull;
|
|
260
|
+
agent_id: z.ZodNull;
|
|
261
|
+
provider_session_id: z.ZodNull;
|
|
262
|
+
kind: z.ZodLiteral<"settings">;
|
|
263
|
+
skills: z.ZodOptional<z.ZodBoolean>;
|
|
264
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
232
265
|
}, z.core.$strict>, z.ZodObject<{
|
|
233
266
|
type: z.ZodLiteral<"input">;
|
|
234
267
|
input_id: z.ZodUUID;
|
package/dist/connection.js
CHANGED
|
@@ -7,6 +7,10 @@ const TERMINAL_SIDE_MAX = 65_535;
|
|
|
7
7
|
export const KIT_CAUSE = z.string().min(1).max(4096);
|
|
8
8
|
const EXIT_CODE = z.int().min(0).max(EXIT_STATUS_MAX);
|
|
9
9
|
const KEPT_OUTPUT = { output: z.string(), cut: z.boolean() };
|
|
10
|
+
export const KIT_SETTINGS = z.strictObject({
|
|
11
|
+
skills: z.boolean(),
|
|
12
|
+
workspace: z.string().startsWith('/'),
|
|
13
|
+
});
|
|
10
14
|
export const KIT_CALL_RESULT = z.union([
|
|
11
15
|
z.strictObject({ provider_session_id: z.string().min(1).max(PROVIDER_SESSION_ID_MAX) }),
|
|
12
16
|
z.strictObject({ refused: KIT_CAUSE, resume_refused: z.literal(true).optional() }),
|
|
@@ -14,6 +18,7 @@ export const KIT_CALL_RESULT = z.union([
|
|
|
14
18
|
z.strictObject({ exit_code: EXIT_CODE, ...KEPT_OUTPUT }),
|
|
15
19
|
z.strictObject({ timed_out: z.literal(true), ...KEPT_OUTPUT }),
|
|
16
20
|
z.strictObject({ started: z.literal(true) }),
|
|
21
|
+
z.strictObject({ settings: KIT_SETTINGS }),
|
|
17
22
|
z.strictObject({}),
|
|
18
23
|
]);
|
|
19
24
|
const CONVERSATION_CALL = {
|
|
@@ -37,10 +42,29 @@ function environmentCall(kind, params) {
|
|
|
37
42
|
return z.strictObject({ ...ENVIRONMENT_CALL, kind: z.literal(kind), ...params });
|
|
38
43
|
}
|
|
39
44
|
const AFK = z.literal(true).optional();
|
|
45
|
+
export const SESSION_CHOICE_BYTES_MAX = 128;
|
|
46
|
+
const SESSION_CHOICE = z
|
|
47
|
+
.string()
|
|
48
|
+
.min(1)
|
|
49
|
+
.refine((value) => new TextEncoder().encode(value).length <= SESSION_CHOICE_BYTES_MAX);
|
|
50
|
+
const STARTING_CHOICES = {
|
|
51
|
+
model: SESSION_CHOICE.optional().meta({
|
|
52
|
+
description: "Present only for a conversation with its own model: the model a session this call starts or resumes runs, in the Agent's place.",
|
|
53
|
+
}),
|
|
54
|
+
effort: SESSION_CHOICE.optional().meta({
|
|
55
|
+
description: "Present only for a conversation with its own effort: the effort a session this call starts or resumes runs, in the Agent's place.",
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
40
58
|
export const KIT_CALLS = {
|
|
41
|
-
open: conversationCall('open', {
|
|
59
|
+
open: conversationCall('open', {
|
|
60
|
+
afk: AFK,
|
|
61
|
+
...STARTING_CHOICES,
|
|
62
|
+
room_ref: z.string().nullable().meta({
|
|
63
|
+
description: "The conversation's Room as it stands when the session opens, by its ref, or null where it has none.",
|
|
64
|
+
}),
|
|
65
|
+
name: z.string().min(1).meta({ description: "The conversation's name." }),
|
|
66
|
+
}),
|
|
42
67
|
kill: conversationCall('kill', {}),
|
|
43
|
-
done: conversationCall('done', {}),
|
|
44
68
|
message: conversationCall('message', {
|
|
45
69
|
message_id: z.uuid(),
|
|
46
70
|
text: z.string(),
|
|
@@ -48,6 +72,7 @@ export const KIT_CALLS = {
|
|
|
48
72
|
at_once: z.literal(true).optional(),
|
|
49
73
|
recent: z.string().optional(),
|
|
50
74
|
afk: AFK,
|
|
75
|
+
...STARTING_CHOICES,
|
|
51
76
|
}),
|
|
52
77
|
take_out: conversationCall('take_out', { message_id: z.uuid() }),
|
|
53
78
|
interrupt: conversationCall('interrupt', { turn_id: z.uuid() }),
|
|
@@ -55,13 +80,28 @@ export const KIT_CALLS = {
|
|
|
55
80
|
interaction_id: z.uuid(),
|
|
56
81
|
response: z.unknown(),
|
|
57
82
|
request: z.unknown(),
|
|
83
|
+
...STARTING_CHOICES,
|
|
58
84
|
}),
|
|
59
85
|
option: conversationCall('option', {
|
|
60
|
-
|
|
61
|
-
|
|
86
|
+
model: SESSION_CHOICE.optional().meta({
|
|
87
|
+
description: 'Present only for a change of the model: the model the running process takes.',
|
|
88
|
+
}),
|
|
89
|
+
effort: SESSION_CHOICE.optional().meta({
|
|
90
|
+
description: 'Present only for a change of the effort: the effort the running process takes.',
|
|
91
|
+
}),
|
|
92
|
+
}),
|
|
93
|
+
sign_in: environmentCall('sign_in', {
|
|
94
|
+
cli: z.string(),
|
|
95
|
+
ends_in: z.int().nonnegative(),
|
|
96
|
+
api_key: z.literal(true).optional().meta({
|
|
97
|
+
description: "Present only for a sign-in by API key in place of the CLI's own login.",
|
|
98
|
+
}),
|
|
62
99
|
}),
|
|
63
|
-
sign_in: environmentCall('sign_in', { cli: z.string(), ends_in: z.int().nonnegative() }),
|
|
64
100
|
update: environmentCall('update', { release: z.string() }),
|
|
101
|
+
settings: environmentCall('settings', {
|
|
102
|
+
skills: z.boolean().optional(),
|
|
103
|
+
workspace: z.string().optional(),
|
|
104
|
+
}),
|
|
65
105
|
run_wizard: environmentCall('run_wizard', { script: z.string() }),
|
|
66
106
|
run_function: environmentCall('run_function', {
|
|
67
107
|
script: z.string(),
|
|
@@ -74,7 +114,6 @@ export const KIT_CALLS = {
|
|
|
74
114
|
export const KIT_CALL = z.discriminatedUnion('kind', [
|
|
75
115
|
KIT_CALLS.open,
|
|
76
116
|
KIT_CALLS.kill,
|
|
77
|
-
KIT_CALLS.done,
|
|
78
117
|
KIT_CALLS.message,
|
|
79
118
|
KIT_CALLS.take_out,
|
|
80
119
|
KIT_CALLS.interrupt,
|
|
@@ -82,6 +121,7 @@ export const KIT_CALL = z.discriminatedUnion('kind', [
|
|
|
82
121
|
KIT_CALLS.option,
|
|
83
122
|
KIT_CALLS.sign_in,
|
|
84
123
|
KIT_CALLS.update,
|
|
124
|
+
KIT_CALLS.settings,
|
|
85
125
|
KIT_CALLS.run_wizard,
|
|
86
126
|
KIT_CALLS.run_function,
|
|
87
127
|
]);
|
package/dist/enrollment.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export declare const KIT_LOGIN_START: z.ZodObject<{
|
|
|
20
20
|
new_environment: "new_environment";
|
|
21
21
|
}>;
|
|
22
22
|
environment_id: z.ZodOptional<z.ZodUUID>;
|
|
23
|
-
replaces: z.ZodOptional<z.ZodUUID>;
|
|
24
23
|
headless: z.ZodOptional<z.ZodLiteral<true>>;
|
|
25
24
|
rooms: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
26
25
|
reach: z.ZodLiteral<"all">;
|
package/dist/enrollment.js
CHANGED
|
@@ -17,7 +17,6 @@ export const KIT_ENROLLMENT_ACTS = ['new_environment', 'existing_environment'];
|
|
|
17
17
|
export const KIT_LOGIN_START = z.strictObject({
|
|
18
18
|
act: z.enum(KIT_ENROLLMENT_ACTS),
|
|
19
19
|
environment_id: z.uuid().optional(),
|
|
20
|
-
replaces: z.uuid().optional(),
|
|
21
20
|
headless: z.literal(true).optional(),
|
|
22
21
|
rooms: ENVIRONMENT_ROOMS.optional(),
|
|
23
22
|
code_challenge: z.string().regex(/^[A-Za-z0-9_-]{43}$/),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { HOUSE_ONE_WAY_CALLS, KIT_CALL, KIT_CALL_RESULT, KIT_CALLS, KIT_CAUSE, KIT_CONNECTION_PATH, KIT_CONNECTION_PROTOCOL_PREFIX, KIT_ONE_WAY_CALLS, STARTING_STEPS, } from './connection.ts';
|
|
2
|
-
export type { HouseOneWayCall, HouseOneWayCallOf, KitCall, KitCallOf, KitCallResult, KitMethod, KitOneWayCall, KitOneWayCallOf, } from './connection.ts';
|
|
3
|
-
export { AGENT_CAPABILITY_DECLARATION, DECLARED_SECRET_CEREMONY, DESIRED_AGENT_ROUTE, DESIRED_AGENTS, ENVIRONMENT_FORMS, FILE_BYTES, FILE_NAME, FILE_NAME_MAX, KIT_ACTS, KIT_DOOR_ACTS, KIT_QUESTION, KIT_TURN_END, KIT_TURN_IMAGE, KIT_UPLOAD_FINISH, LOCAL_COPY_ROOM, MEDIA_TYPE, PART_SHA256, REPORTED_AGENT_KIND, SECRET_CEREMONY_STEPS_MAX, SECRET_RELAY_OUTCOME, SECRET_RELAY_RELEASES, SHA256, TRANSCRIPT, } from './acts.ts';
|
|
4
|
-
export type { AgentCapabilityDeclaration, DeclaredSecretCeremony, DesiredAgentRoute, KitActAnswer, KitActDeclaration, KitActName, KitActRequest, KitDoorAct, KitDoorAnswer, KitQuestion, KitTurnEnd, KitTurnImage, LocalCopyRoom, ReportedAgentKind, SecretCeremonyStep, SecretRelayOutcome, Transcript, TranscriptionReport, } from './acts.ts';
|
|
1
|
+
export { HOUSE_ONE_WAY_CALLS, KIT_CALL, KIT_CALL_RESULT, KIT_CALLS, KIT_CAUSE, KIT_CONNECTION_PATH, KIT_CONNECTION_PROTOCOL_PREFIX, KIT_ONE_WAY_CALLS, KIT_SETTINGS, SESSION_CHOICE_BYTES_MAX, STARTING_STEPS, } from './connection.ts';
|
|
2
|
+
export type { HouseOneWayCall, HouseOneWayCallOf, KitCall, KitCallOf, KitCallResult, KitMethod, KitOneWayCall, KitOneWayCallOf, KitSettings, } from './connection.ts';
|
|
3
|
+
export { AGENT_CAPABILITY_DECLARATION, DECLARED_SECRET_CEREMONY, DESIRED_AGENT_ROUTE, DESIRED_AGENTS, ENVIRONMENT_FORMS, FILE_BYTES, FILE_NAME, FILE_NAME_MAX, FUNCTION_RUN_META_KEY, KIT_ACTS, KIT_BINARY_CHANGE, KIT_DOOR_ACTS, KIT_QUESTION, KIT_REINSTALLS, KIT_TURN_END, KIT_TURN_IMAGE, KIT_UPLOAD_FINISH, kitActRoute, LOCAL_COPY_ROOM, MEDIA_TYPE, PART_SHA256, REPORTED_AGENT_KIND, SECRET_CEREMONY_STEPS_MAX, SECRET_RELAY_OUTCOME, SECRET_RELAY_RELEASES, SHA256, TRANSCRIPT, } from './acts.ts';
|
|
4
|
+
export type { AgentCapabilityDeclaration, DeclaredSecretCeremony, DesiredAgentRoute, KitActAnswer, KitActDeclaration, KitActName, KitActRequest, KitActRoute, KitBinaryChange, KitDoorAct, KitDoorAnswer, KitQuestion, KitTurnEnd, KitTurnImage, LocalCopyRoom, ReportedAgentKind, SecretCeremonyStep, SecretRelayOutcome, Transcript, TranscriptionReport, } from './acts.ts';
|
|
5
5
|
export { ENVIRONMENT_REACHES, ENVIRONMENT_ROOM_LIMIT, ENVIRONMENT_ROOM_REFS, ENVIRONMENT_ROOMS, KIT_ENROLLMENT_ACTS, KIT_LOGIN_ISSUED, KIT_LOGIN_PATHS, KIT_LOGIN_POLL, KIT_LOGIN_START, KIT_LOGIN_STARTED, } from './enrollment.ts';
|
|
6
6
|
export type { EnvironmentReach, EnvironmentRooms, KitEnrollmentAct } from './enrollment.ts';
|
|
7
7
|
export { BUILDING_KIT, KIT_COMMANDS, KIT_DECLARATION, KIT_WIRE, KIT_WIRE_HEADER, kitWire, kitWireRefusal, } from './wire.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { HOUSE_ONE_WAY_CALLS, KIT_CALL, KIT_CALL_RESULT, KIT_CALLS, KIT_CAUSE, KIT_CONNECTION_PATH, KIT_CONNECTION_PROTOCOL_PREFIX, KIT_ONE_WAY_CALLS, STARTING_STEPS, } from './connection.js';
|
|
2
|
-
export { AGENT_CAPABILITY_DECLARATION, DECLARED_SECRET_CEREMONY, DESIRED_AGENT_ROUTE, DESIRED_AGENTS, ENVIRONMENT_FORMS, FILE_BYTES, FILE_NAME, FILE_NAME_MAX, KIT_ACTS, KIT_DOOR_ACTS, KIT_QUESTION, KIT_TURN_END, KIT_TURN_IMAGE, KIT_UPLOAD_FINISH, LOCAL_COPY_ROOM, MEDIA_TYPE, PART_SHA256, REPORTED_AGENT_KIND, SECRET_CEREMONY_STEPS_MAX, SECRET_RELAY_OUTCOME, SECRET_RELAY_RELEASES, SHA256, TRANSCRIPT, } from './acts.js';
|
|
1
|
+
export { HOUSE_ONE_WAY_CALLS, KIT_CALL, KIT_CALL_RESULT, KIT_CALLS, KIT_CAUSE, KIT_CONNECTION_PATH, KIT_CONNECTION_PROTOCOL_PREFIX, KIT_ONE_WAY_CALLS, KIT_SETTINGS, SESSION_CHOICE_BYTES_MAX, STARTING_STEPS, } from './connection.js';
|
|
2
|
+
export { AGENT_CAPABILITY_DECLARATION, DECLARED_SECRET_CEREMONY, DESIRED_AGENT_ROUTE, DESIRED_AGENTS, ENVIRONMENT_FORMS, FILE_BYTES, FILE_NAME, FILE_NAME_MAX, FUNCTION_RUN_META_KEY, KIT_ACTS, KIT_BINARY_CHANGE, KIT_DOOR_ACTS, KIT_QUESTION, KIT_REINSTALLS, KIT_TURN_END, KIT_TURN_IMAGE, KIT_UPLOAD_FINISH, kitActRoute, LOCAL_COPY_ROOM, MEDIA_TYPE, PART_SHA256, REPORTED_AGENT_KIND, SECRET_CEREMONY_STEPS_MAX, SECRET_RELAY_OUTCOME, SECRET_RELAY_RELEASES, SHA256, TRANSCRIPT, } from './acts.js';
|
|
3
3
|
export { ENVIRONMENT_REACHES, ENVIRONMENT_ROOM_LIMIT, ENVIRONMENT_ROOM_REFS, ENVIRONMENT_ROOMS, KIT_ENROLLMENT_ACTS, KIT_LOGIN_ISSUED, KIT_LOGIN_PATHS, KIT_LOGIN_POLL, KIT_LOGIN_START, KIT_LOGIN_STARTED, } from './enrollment.js';
|
|
4
4
|
export { BUILDING_KIT, KIT_COMMANDS, KIT_DECLARATION, KIT_WIRE, KIT_WIRE_HEADER, kitWire, kitWireRefusal, } from './wire.js';
|
package/dist/wire.d.ts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const KIT_WIRE_HEADER = "x-house-kit-wire";
|
|
3
3
|
export declare const KIT_COMMANDS: z.ZodObject<{
|
|
4
|
-
macos: z.ZodString;
|
|
5
4
|
linux: z.ZodString;
|
|
6
|
-
container: z.ZodString;
|
|
7
|
-
server: z.ZodString;
|
|
8
5
|
windows: z.ZodString;
|
|
9
6
|
}, z.core.$strict>;
|
|
10
7
|
export type KitCommands = z.infer<typeof KIT_COMMANDS>;
|
|
11
8
|
export declare const BUILDING_KIT: z.ZodObject<{
|
|
12
9
|
release: z.ZodString;
|
|
13
10
|
commands: z.ZodObject<{
|
|
14
|
-
macos: z.ZodString;
|
|
15
11
|
linux: z.ZodString;
|
|
16
|
-
container: z.ZodString;
|
|
17
|
-
server: z.ZodString;
|
|
18
12
|
windows: z.ZodString;
|
|
19
13
|
}, z.core.$strict>;
|
|
20
14
|
}, z.core.$strict>;
|
|
@@ -32,7 +26,11 @@ export declare const KIT_DECLARATION: {
|
|
|
32
26
|
agent_id: z.ZodUUID;
|
|
33
27
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
34
28
|
kind: z.ZodLiteral<"open">;
|
|
29
|
+
model: z.ZodOptional<z.ZodString>;
|
|
30
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
35
31
|
afk: z.ZodOptional<z.ZodLiteral<true>>;
|
|
32
|
+
room_ref: z.ZodNullable<z.ZodString>;
|
|
33
|
+
name: z.ZodString;
|
|
36
34
|
}, z.core.$strict>;
|
|
37
35
|
kill: z.ZodObject<{
|
|
38
36
|
type: z.ZodLiteral<"input">;
|
|
@@ -42,14 +40,6 @@ export declare const KIT_DECLARATION: {
|
|
|
42
40
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
43
41
|
kind: z.ZodLiteral<"kill">;
|
|
44
42
|
}, z.core.$strict>;
|
|
45
|
-
done: z.ZodObject<{
|
|
46
|
-
type: z.ZodLiteral<"input">;
|
|
47
|
-
input_id: z.ZodUUID;
|
|
48
|
-
conversation_id: z.ZodUUID;
|
|
49
|
-
agent_id: z.ZodUUID;
|
|
50
|
-
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
51
|
-
kind: z.ZodLiteral<"done">;
|
|
52
|
-
}, z.core.$strict>;
|
|
53
43
|
message: z.ZodObject<{
|
|
54
44
|
type: z.ZodLiteral<"input">;
|
|
55
45
|
input_id: z.ZodUUID;
|
|
@@ -57,6 +47,8 @@ export declare const KIT_DECLARATION: {
|
|
|
57
47
|
agent_id: z.ZodUUID;
|
|
58
48
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
59
49
|
kind: z.ZodLiteral<"message">;
|
|
50
|
+
model: z.ZodOptional<z.ZodString>;
|
|
51
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
60
52
|
message_id: z.ZodUUID;
|
|
61
53
|
text: z.ZodString;
|
|
62
54
|
first: z.ZodBoolean;
|
|
@@ -89,6 +81,8 @@ export declare const KIT_DECLARATION: {
|
|
|
89
81
|
agent_id: z.ZodUUID;
|
|
90
82
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
91
83
|
kind: z.ZodLiteral<"answer">;
|
|
84
|
+
model: z.ZodOptional<z.ZodString>;
|
|
85
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
92
86
|
interaction_id: z.ZodUUID;
|
|
93
87
|
response: z.ZodUnknown;
|
|
94
88
|
request: z.ZodUnknown;
|
|
@@ -100,8 +94,8 @@ export declare const KIT_DECLARATION: {
|
|
|
100
94
|
agent_id: z.ZodUUID;
|
|
101
95
|
provider_session_id: z.ZodNullable<z.ZodString>;
|
|
102
96
|
kind: z.ZodLiteral<"option">;
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
model: z.ZodOptional<z.ZodString>;
|
|
98
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
105
99
|
}, z.core.$strict>;
|
|
106
100
|
sign_in: z.ZodObject<{
|
|
107
101
|
type: z.ZodLiteral<"input">;
|
|
@@ -112,6 +106,7 @@ export declare const KIT_DECLARATION: {
|
|
|
112
106
|
kind: z.ZodLiteral<"sign_in">;
|
|
113
107
|
cli: z.ZodString;
|
|
114
108
|
ends_in: z.ZodInt;
|
|
109
|
+
api_key: z.ZodOptional<z.ZodLiteral<true>>;
|
|
115
110
|
}, z.core.$strict>;
|
|
116
111
|
update: z.ZodObject<{
|
|
117
112
|
type: z.ZodLiteral<"input">;
|
|
@@ -122,6 +117,16 @@ export declare const KIT_DECLARATION: {
|
|
|
122
117
|
kind: z.ZodLiteral<"update">;
|
|
123
118
|
release: z.ZodString;
|
|
124
119
|
}, z.core.$strict>;
|
|
120
|
+
settings: z.ZodObject<{
|
|
121
|
+
type: z.ZodLiteral<"input">;
|
|
122
|
+
input_id: z.ZodUUID;
|
|
123
|
+
conversation_id: z.ZodNull;
|
|
124
|
+
agent_id: z.ZodNull;
|
|
125
|
+
provider_session_id: z.ZodNull;
|
|
126
|
+
kind: z.ZodLiteral<"settings">;
|
|
127
|
+
skills: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strict>;
|
|
125
130
|
run_wizard: z.ZodObject<{
|
|
126
131
|
type: z.ZodLiteral<"input">;
|
|
127
132
|
input_id: z.ZodUUID;
|
|
@@ -162,6 +167,11 @@ export declare const KIT_DECLARATION: {
|
|
|
162
167
|
timed_out: z.ZodLiteral<true>;
|
|
163
168
|
}, z.core.$strict>, z.ZodObject<{
|
|
164
169
|
started: z.ZodLiteral<true>;
|
|
170
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
171
|
+
settings: z.ZodObject<{
|
|
172
|
+
skills: z.ZodBoolean;
|
|
173
|
+
workspace: z.ZodString;
|
|
174
|
+
}, z.core.$strict>;
|
|
165
175
|
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>;
|
|
166
176
|
house: {
|
|
167
177
|
beat: z.ZodObject<{
|
|
@@ -285,6 +295,7 @@ export declare const KIT_DECLARATION: {
|
|
|
285
295
|
label: z.ZodString;
|
|
286
296
|
name: z.ZodString;
|
|
287
297
|
description: z.ZodOptional<z.ZodString>;
|
|
298
|
+
optional: z.ZodOptional<z.ZodLiteral<true>>;
|
|
288
299
|
}, z.core.$strict>], "kind">>;
|
|
289
300
|
}, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
290
301
|
outcome: z.ZodLiteral<"collected">;
|
|
@@ -308,6 +319,14 @@ export declare const KIT_DECLARATION: {
|
|
|
308
319
|
}>>;
|
|
309
320
|
ssh_host_key: z.ZodOptional<z.ZodString>;
|
|
310
321
|
agent_base: z.ZodOptional<z.ZodString>;
|
|
322
|
+
reinstall: z.ZodOptional<z.ZodEnum<{
|
|
323
|
+
linux: "linux";
|
|
324
|
+
windows: "windows";
|
|
325
|
+
}>>;
|
|
326
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
327
|
+
skills: z.ZodBoolean;
|
|
328
|
+
workspace: z.ZodString;
|
|
329
|
+
}, z.core.$strict>>;
|
|
311
330
|
agents: z.ZodArray<z.ZodObject<{
|
|
312
331
|
kind: z.ZodString;
|
|
313
332
|
release: z.ZodNullable<z.ZodString>;
|
|
@@ -316,10 +335,15 @@ export declare const KIT_DECLARATION: {
|
|
|
316
335
|
failure: z.ZodNullable<z.ZodString>;
|
|
317
336
|
installing: z.ZodOptional<z.ZodLiteral<true>>;
|
|
318
337
|
signed_in: z.ZodBoolean;
|
|
338
|
+
api_key: z.ZodOptional<z.ZodLiteral<true>>;
|
|
339
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
319
340
|
models: z.ZodArray<z.ZodObject<{
|
|
320
341
|
model: z.ZodString;
|
|
342
|
+
name: z.ZodString;
|
|
321
343
|
efforts: z.ZodArray<z.ZodString>;
|
|
322
344
|
}, z.core.$strict>>;
|
|
345
|
+
default_model: z.ZodOptional<z.ZodString>;
|
|
346
|
+
default_effort: z.ZodOptional<z.ZodString>;
|
|
323
347
|
modes: z.ZodArray<z.ZodObject<{
|
|
324
348
|
mode: z.ZodString;
|
|
325
349
|
name: z.ZodString;
|
|
@@ -362,6 +386,11 @@ export declare const KIT_DECLARATION: {
|
|
|
362
386
|
timed_out: z.ZodLiteral<true>;
|
|
363
387
|
}, z.core.$strict>, z.ZodObject<{
|
|
364
388
|
started: z.ZodLiteral<true>;
|
|
389
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
390
|
+
settings: z.ZodObject<{
|
|
391
|
+
skills: z.ZodBoolean;
|
|
392
|
+
workspace: z.ZodString;
|
|
393
|
+
}, z.core.$strict>;
|
|
365
394
|
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>, z.ZodObject<{}, z.core.$strict>>;
|
|
366
395
|
'turns/start': import("./acts.ts").KitActDeclaration<"conversation" | "turn", z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
367
396
|
run: z.ZodOptional<z.ZodLiteral<true>>;
|
|
@@ -379,7 +408,7 @@ export declare const KIT_DECLARATION: {
|
|
|
379
408
|
}, z.core.$strict>, {
|
|
380
409
|
door: string;
|
|
381
410
|
}>;
|
|
382
|
-
'
|
|
411
|
+
'agent_update.transcript_keep': import("./acts.ts").KitActDeclaration<"conversation" | "message", z.ZodObject<{
|
|
383
412
|
path: z.ZodString;
|
|
384
413
|
text: z.ZodString;
|
|
385
414
|
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
|
|
@@ -389,14 +418,20 @@ export declare const KIT_DECLARATION: {
|
|
|
389
418
|
}, z.core.$strict>, {
|
|
390
419
|
door: string;
|
|
391
420
|
}>;
|
|
392
|
-
'
|
|
421
|
+
'agent_update.conversation_ask': import("./acts.ts").KitActDeclaration<"conversation" | "turn", z.ZodObject<{
|
|
393
422
|
interaction_id: z.ZodUUID;
|
|
394
423
|
request: z.ZodJSONSchema;
|
|
395
424
|
secret: z.ZodBoolean;
|
|
396
425
|
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
|
|
397
426
|
'kits/report-idle': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
|
|
398
|
-
'kits/report-restart': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{
|
|
399
|
-
|
|
427
|
+
'kits/report-restart': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{
|
|
428
|
+
planned: z.ZodOptional<z.ZodLiteral<true>>;
|
|
429
|
+
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
|
|
430
|
+
'agent_update.credentials_issue': import("./acts.ts").KitActDeclaration<never, z.ZodUnion<readonly [z.ZodObject<{
|
|
431
|
+
conversation: z.ZodString;
|
|
432
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
433
|
+
run: z.ZodString;
|
|
434
|
+
}, z.core.$strict>]>, z.ZodObject<{
|
|
400
435
|
credential: z.ZodString;
|
|
401
436
|
}, z.core.$strict>>;
|
|
402
437
|
'kits/log-out': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
|
|
@@ -408,11 +443,27 @@ export declare const KIT_DECLARATION: {
|
|
|
408
443
|
rooms: z.ZodArray<z.ZodObject<{
|
|
409
444
|
room_ref: z.ZodString;
|
|
410
445
|
room_handle: z.ZodString;
|
|
446
|
+
level: z.ZodEnum<{
|
|
447
|
+
keep: "keep";
|
|
448
|
+
open: "open";
|
|
449
|
+
search: "search";
|
|
450
|
+
}>;
|
|
411
451
|
}, z.core.$strict>>;
|
|
412
452
|
}, z.core.$strict>;
|
|
413
453
|
}, z.core.$strict>>;
|
|
414
454
|
};
|
|
415
|
-
door: readonly ["rooms/discover", "room-chunks/list", "changes/enumerate", "files/revisions/list", "
|
|
455
|
+
door: readonly ["rooms/discover", "room-chunks/list", "changes/enumerate", "files/revisions/list", "update"];
|
|
456
|
+
changes: {
|
|
457
|
+
binary: z.ZodObject<{
|
|
458
|
+
path: z.ZodString;
|
|
459
|
+
revision: z.ZodString;
|
|
460
|
+
bytes: z.ZodInt;
|
|
461
|
+
sha256: z.ZodString;
|
|
462
|
+
}, z.core.$strip>;
|
|
463
|
+
};
|
|
464
|
+
meta: {
|
|
465
|
+
run: string;
|
|
466
|
+
};
|
|
416
467
|
login: {
|
|
417
468
|
paths: {
|
|
418
469
|
readonly start: '/kit';
|
|
@@ -425,7 +476,6 @@ export declare const KIT_DECLARATION: {
|
|
|
425
476
|
new_environment: "new_environment";
|
|
426
477
|
}>;
|
|
427
478
|
environment_id: z.ZodOptional<z.ZodUUID>;
|
|
428
|
-
replaces: z.ZodOptional<z.ZodUUID>;
|
|
429
479
|
headless: z.ZodOptional<z.ZodLiteral<true>>;
|
|
430
480
|
rooms: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
431
481
|
reach: z.ZodLiteral<"all">;
|
|
@@ -460,10 +510,7 @@ export declare const KIT_DECLARATION: {
|
|
|
460
510
|
refusal: z.ZodObject<{
|
|
461
511
|
release: z.ZodString;
|
|
462
512
|
commands: z.ZodObject<{
|
|
463
|
-
macos: z.ZodString;
|
|
464
513
|
linux: z.ZodString;
|
|
465
|
-
container: z.ZodString;
|
|
466
|
-
server: z.ZodString;
|
|
467
514
|
windows: z.ZodString;
|
|
468
515
|
}, z.core.$strict>;
|
|
469
516
|
}, z.core.$strict>;
|
package/dist/wire.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { KIT_ACTS, KIT_DOOR_ACTS } from './acts.js';
|
|
3
|
+
import { FUNCTION_RUN_META_KEY, KIT_ACTS, KIT_BINARY_CHANGE, KIT_DOOR_ACTS } from './acts.js';
|
|
4
4
|
import { HOUSE_ONE_WAY_CALLS, KIT_CALL_RESULT, KIT_CALLS, KIT_CONNECTION_PATH, KIT_CONNECTION_PROTOCOL_PREFIX, KIT_ONE_WAY_CALLS, } from './connection.js';
|
|
5
5
|
import { KIT_LOGIN_ISSUED, KIT_LOGIN_PATHS, KIT_LOGIN_POLL, KIT_LOGIN_START, KIT_LOGIN_STARTED, } from './enrollment.js';
|
|
6
6
|
const WIRE_HEX_LENGTH = 16;
|
|
7
7
|
export const KIT_WIRE_HEADER = 'x-house-kit-wire';
|
|
8
8
|
export const KIT_COMMANDS = z.strictObject({
|
|
9
|
-
macos: z.string(),
|
|
10
9
|
linux: z.string(),
|
|
11
|
-
container: z.string(),
|
|
12
|
-
server: z.string(),
|
|
13
10
|
windows: z.string(),
|
|
14
11
|
});
|
|
15
12
|
export const BUILDING_KIT = z.strictObject({ release: z.string(), commands: KIT_COMMANDS });
|
|
@@ -25,6 +22,8 @@ export const KIT_DECLARATION = {
|
|
|
25
22
|
},
|
|
26
23
|
acts: KIT_ACTS,
|
|
27
24
|
door: KIT_DOOR_ACTS,
|
|
25
|
+
changes: { binary: KIT_BINARY_CHANGE },
|
|
26
|
+
meta: { run: FUNCTION_RUN_META_KEY },
|
|
28
27
|
login: {
|
|
29
28
|
paths: KIT_LOGIN_PATHS,
|
|
30
29
|
start: { request: KIT_LOGIN_START, answer: KIT_LOGIN_STARTED },
|
|
@@ -50,7 +49,7 @@ export function kitWire(declaration) {
|
|
|
50
49
|
.digest('hex')
|
|
51
50
|
.slice(0, WIRE_HEX_LENGTH);
|
|
52
51
|
}
|
|
53
|
-
export const KIT_WIRE = '
|
|
52
|
+
export const KIT_WIRE = '1da6f1191157599c';
|
|
54
53
|
export function kitWireRefusal(named) {
|
|
55
54
|
if (typeof named !== 'string')
|
|
56
55
|
return 'kit_declaration_invalid';
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentshouse/kit-wire",
|
|
3
|
-
"version": "0.1.0-c2e87e570c808",
|
|
4
3
|
"description": "The Kit wire: every shape House and the Kit exchange, the Kit connection's frames and every /kit/ request and answer, and the wire computed from them",
|
|
5
4
|
"license": "MIT",
|
|
6
5
|
"type": "module",
|
|
@@ -16,6 +15,10 @@
|
|
|
16
15
|
"types": "./dist/index.d.ts",
|
|
17
16
|
"default": "./dist/index.js"
|
|
18
17
|
},
|
|
18
|
+
"./arguments": {
|
|
19
|
+
"types": "./dist/arguments.d.ts",
|
|
20
|
+
"default": "./dist/arguments.js"
|
|
21
|
+
},
|
|
19
22
|
"./package.json": "./package.json"
|
|
20
23
|
},
|
|
21
24
|
"files": [
|
|
@@ -30,5 +33,6 @@
|
|
|
30
33
|
"type": "git",
|
|
31
34
|
"url": "git+https://github.com/agentshouse/core.git",
|
|
32
35
|
"directory": "kit-wire"
|
|
33
|
-
}
|
|
36
|
+
},
|
|
37
|
+
"version": "0.1.0-c619b2dbd69ae"
|
|
34
38
|
}
|