@agentshouse/kit-wire 0.1.0-caa55b2516c5d → 0.1.0-caf9c7b612dda

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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,6 +61,8 @@ 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;
64
68
  name: z.ZodString;
@@ -108,6 +112,8 @@ export declare const AGENT_CAPABILITY_DECLARATION: z.ZodObject<{
108
112
  failure: z.ZodNullable<z.ZodString>;
109
113
  installing: z.ZodOptional<z.ZodLiteral<true>>;
110
114
  signed_in: z.ZodBoolean;
115
+ api_key: z.ZodOptional<z.ZodLiteral<true>>;
116
+ provider: z.ZodOptional<z.ZodString>;
111
117
  models: z.ZodArray<z.ZodObject<{
112
118
  model: z.ZodString;
113
119
  name: z.ZodString;
@@ -167,6 +173,13 @@ export declare const KIT_UPLOAD_FINISH: z.ZodObject<{
167
173
  upload: z.ZodUUID;
168
174
  part_sha256: z.ZodArray<z.ZodString>;
169
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>;
170
183
  export declare const TRANSCRIPT: z.ZodObject<{
171
184
  path: z.ZodString;
172
185
  text: z.ZodString;
@@ -206,6 +219,7 @@ export declare const KIT_ACTS: {
206
219
  label: z.ZodString;
207
220
  name: z.ZodString;
208
221
  description: z.ZodOptional<z.ZodString>;
222
+ optional: z.ZodOptional<z.ZodLiteral<true>>;
209
223
  }, z.core.$strict>], "kind">>;
210
224
  }, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
211
225
  outcome: z.ZodLiteral<"collected">;
@@ -245,6 +259,8 @@ export declare const KIT_ACTS: {
245
259
  failure: z.ZodNullable<z.ZodString>;
246
260
  installing: z.ZodOptional<z.ZodLiteral<true>>;
247
261
  signed_in: z.ZodBoolean;
262
+ api_key: z.ZodOptional<z.ZodLiteral<true>>;
263
+ provider: z.ZodOptional<z.ZodString>;
248
264
  models: z.ZodArray<z.ZodObject<{
249
265
  model: z.ZodString;
250
266
  name: z.ZodString;
@@ -332,7 +348,9 @@ export declare const KIT_ACTS: {
332
348
  secret: z.ZodBoolean;
333
349
  }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
334
350
  'kits/report-idle': KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
335
- 'kits/report-restart': KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
351
+ 'kits/report-restart': KitActDeclaration<never, z.ZodObject<{
352
+ planned: z.ZodOptional<z.ZodLiteral<true>>;
353
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
336
354
  'conversations/credentials/issue': KitActDeclaration<"conversation", z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
337
355
  credential: z.ZodString;
338
356
  }, z.core.$strict>>;
@@ -356,6 +374,6 @@ export type KitActRequest<Name extends KitActName> = {
356
374
  readonly [Id in Declared<Name>['ids'][number]]: string;
357
375
  } & Fields<z.input<Declared<Name>['body']>>;
358
376
  export type KitActAnswer<Name extends KitActName> = Declared<Name>['answer'] extends z.ZodType ? z.output<Declared<Name>['answer']> : unknown;
359
- export declare const KIT_DOOR_ACTS: readonly ['rooms/discover', 'room-chunks/list', 'changes/enumerate', 'files/revisions/list', 'files/batch'];
377
+ export declare const KIT_DOOR_ACTS: readonly ['rooms/discover', 'room-chunks/list', 'changes/enumerate', 'files/revisions/list', 'update'];
360
378
  export type KitDoorAct = (typeof KIT_DOOR_ACTS)[number];
361
379
  export {};
package/dist/acts.js CHANGED
@@ -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;
@@ -88,6 +92,12 @@ export const REPORTED_AGENT_KIND = z.strictObject({
88
92
  description: 'Present only while the Kit installs the CLI, whose release and failure are then null.',
89
93
  }),
90
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
+ }),
91
101
  models: OFFERED_MODELS,
92
102
  default_model: CHOICE.optional().meta({
93
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.',
@@ -148,6 +158,12 @@ export const KIT_TURN_IMAGE = z.strictObject({
148
158
  media_type: MEDIA_TYPE,
149
159
  });
150
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
+ });
151
167
  export const TRANSCRIPT = z.strictObject({
152
168
  path: z.string().regex(/^\/rooms\/[^/)\s]+\/[^)\s]+$/u),
153
169
  text: z.string().min(1),
@@ -159,6 +175,7 @@ export const KIT_QUESTION = z.strictObject({
159
175
  });
160
176
  export const LOCAL_COPY_ROOM = z.strictObject({ room_ref: z.string(), room_handle: z.string() });
161
177
  const NOTHING = z.strictObject({});
178
+ const KIT_RESTART = z.strictObject({ planned: z.literal(true).optional() });
162
179
  function act(ids, body, answer) {
163
180
  return { ids, body, answer };
164
181
  }
@@ -176,7 +193,7 @@ export const KIT_ACTS = {
176
193
  'uploads/finish': act([], KIT_UPLOAD_FINISH, { door: 'files/finish' }),
177
194
  'conversations/interaction/ask': act(CONVERSATION_TURN, KIT_QUESTION, NOTHING),
178
195
  'kits/report-idle': act([], NOTHING, NOTHING),
179
- 'kits/report-restart': act([], NOTHING, NOTHING),
196
+ 'kits/report-restart': act([], KIT_RESTART, NOTHING),
180
197
  'conversations/credentials/issue': act(['conversation'], NOTHING, z.strictObject({ credential: z.string().min(1) })),
181
198
  'kits/log-out': act([], NOTHING, z.strictObject({ environment: z.uuid(), revoked: z.literal(true) })),
182
199
  'local-copies/selection/read': act([], NOTHING, z.strictObject({ local_copy: z.strictObject({ rooms: z.array(LOCAL_COPY_ROOM) }) })),
@@ -186,5 +203,5 @@ export const KIT_DOOR_ACTS = [
186
203
  'room-chunks/list',
187
204
  'changes/enumerate',
188
205
  'files/revisions/list',
189
- 'files/batch',
206
+ 'update',
190
207
  ];
@@ -119,6 +119,7 @@ export declare const KIT_CALLS: {
119
119
  kind: z.ZodLiteral<"sign_in">;
120
120
  cli: z.ZodString;
121
121
  ends_in: z.ZodInt;
122
+ api_key: z.ZodOptional<z.ZodLiteral<true>>;
122
123
  }, z.core.$strict>;
123
124
  update: z.ZodObject<{
124
125
  type: z.ZodLiteral<"input">;
@@ -241,6 +242,7 @@ export declare const KIT_CALL: z.ZodDiscriminatedUnion<[z.ZodObject<{
241
242
  kind: z.ZodLiteral<"sign_in">;
242
243
  cli: z.ZodString;
243
244
  ends_in: z.ZodInt;
245
+ api_key: z.ZodOptional<z.ZodLiteral<true>>;
244
246
  }, z.core.$strict>, z.ZodObject<{
245
247
  type: z.ZodLiteral<"input">;
246
248
  input_id: z.ZodUUID;
@@ -65,7 +65,13 @@ export const KIT_CALLS = {
65
65
  option: z.string(),
66
66
  value: z.union([z.string(), z.boolean()]),
67
67
  }),
68
- sign_in: environmentCall('sign_in', { cli: z.string(), ends_in: z.int().nonnegative() }),
68
+ sign_in: environmentCall('sign_in', {
69
+ cli: z.string(),
70
+ ends_in: z.int().nonnegative(),
71
+ api_key: z.literal(true).optional().meta({
72
+ description: "Present only for a sign-in by API key in place of the CLI's own login.",
73
+ }),
74
+ }),
69
75
  update: environmentCall('update', { release: z.string() }),
70
76
  settings: environmentCall('settings', {
71
77
  skills: z.boolean().optional(),
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
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, STARTING_STEPS, } from './connection.ts';
2
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, KIT_ACTS, KIT_DOOR_ACTS, KIT_QUESTION, KIT_REINSTALLS, 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';
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_BINARY_CHANGE, KIT_DOOR_ACTS, KIT_QUESTION, KIT_REINSTALLS, 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, 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
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, 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_REINSTALLS, 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';
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_BINARY_CHANGE, KIT_DOOR_ACTS, KIT_QUESTION, KIT_REINSTALLS, 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';
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
@@ -106,6 +106,7 @@ export declare const KIT_DECLARATION: {
106
106
  kind: z.ZodLiteral<"sign_in">;
107
107
  cli: z.ZodString;
108
108
  ends_in: z.ZodInt;
109
+ api_key: z.ZodOptional<z.ZodLiteral<true>>;
109
110
  }, z.core.$strict>;
110
111
  update: z.ZodObject<{
111
112
  type: z.ZodLiteral<"input">;
@@ -294,6 +295,7 @@ export declare const KIT_DECLARATION: {
294
295
  label: z.ZodString;
295
296
  name: z.ZodString;
296
297
  description: z.ZodOptional<z.ZodString>;
298
+ optional: z.ZodOptional<z.ZodLiteral<true>>;
297
299
  }, z.core.$strict>], "kind">>;
298
300
  }, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
299
301
  outcome: z.ZodLiteral<"collected">;
@@ -333,6 +335,8 @@ export declare const KIT_DECLARATION: {
333
335
  failure: z.ZodNullable<z.ZodString>;
334
336
  installing: z.ZodOptional<z.ZodLiteral<true>>;
335
337
  signed_in: z.ZodBoolean;
338
+ api_key: z.ZodOptional<z.ZodLiteral<true>>;
339
+ provider: z.ZodOptional<z.ZodString>;
336
340
  models: z.ZodArray<z.ZodObject<{
337
341
  model: z.ZodString;
338
342
  name: z.ZodString;
@@ -420,7 +424,9 @@ export declare const KIT_DECLARATION: {
420
424
  secret: z.ZodBoolean;
421
425
  }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
422
426
  'kits/report-idle': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
423
- 'kits/report-restart': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
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>>;
424
430
  'conversations/credentials/issue': import("./acts.ts").KitActDeclaration<"conversation", z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
425
431
  credential: z.ZodString;
426
432
  }, z.core.$strict>>;
@@ -437,7 +443,15 @@ export declare const KIT_DECLARATION: {
437
443
  }, z.core.$strict>;
438
444
  }, z.core.$strict>>;
439
445
  };
440
- door: readonly ["rooms/discover", "room-chunks/list", "changes/enumerate", "files/revisions/list", "files/batch"];
446
+ door: readonly ["rooms/discover", "room-chunks/list", "changes/enumerate", "files/revisions/list", "update"];
447
+ changes: {
448
+ binary: z.ZodObject<{
449
+ path: z.ZodString;
450
+ revision: z.ZodString;
451
+ bytes: z.ZodInt;
452
+ sha256: z.ZodString;
453
+ }, z.core.$strip>;
454
+ };
441
455
  login: {
442
456
  paths: {
443
457
  readonly start: '/kit';
package/dist/wire.js CHANGED
@@ -1,6 +1,6 @@
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 { 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;
@@ -22,6 +22,7 @@ export const KIT_DECLARATION = {
22
22
  },
23
23
  acts: KIT_ACTS,
24
24
  door: KIT_DOOR_ACTS,
25
+ changes: { binary: KIT_BINARY_CHANGE },
25
26
  login: {
26
27
  paths: KIT_LOGIN_PATHS,
27
28
  start: { request: KIT_LOGIN_START, answer: KIT_LOGIN_STARTED },
@@ -47,7 +48,7 @@ export function kitWire(declaration) {
47
48
  .digest('hex')
48
49
  .slice(0, WIRE_HEX_LENGTH);
49
50
  }
50
- export const KIT_WIRE = 'e1ec8094a33111a4';
51
+ export const KIT_WIRE = 'a2dfd0b44abddc1e';
51
52
  export function kitWireRefusal(named) {
52
53
  if (typeof named !== 'string')
53
54
  return 'kit_declaration_invalid';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/kit-wire",
3
- "version": "0.1.0-caa55b2516c5d",
3
+ "version": "0.1.0-caf9c7b612dda",
4
4
  "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
5
  "license": "MIT",
6
6
  "type": "module",