@kitman-sh/sdk 0.8.0 → 0.10.52

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.
Files changed (63) hide show
  1. package/dist/build/index.js +531 -116
  2. package/dist/{chunk-36jhc745.js → chunk-tcbgb4wm.js} +1841 -1574
  3. package/dist/{chunk-160ww64c.js → chunk-zvzw3zs4.js} +939 -535
  4. package/dist/loop/index.js +117 -3
  5. package/dist/program/index.js +10 -6
  6. package/package.json +6 -6
  7. package/types/packages/core/src/agent-capabilities.d.ts +6 -0
  8. package/types/packages/core/src/agent-environment.d.ts +32 -216
  9. package/types/packages/core/src/agent-sandbox-policy.d.ts +17 -3
  10. package/types/packages/core/src/change-request-review.d.ts +20 -5
  11. package/types/packages/core/src/change-request.d.ts +33 -208
  12. package/types/packages/core/src/crypto.d.ts +2 -0
  13. package/types/packages/core/src/index.d.ts +8 -4
  14. package/types/packages/core/src/{package-declarations.d.ts → kit-declarations.d.ts} +84 -180
  15. package/types/packages/core/src/kit-install.d.ts +130 -0
  16. package/types/packages/core/src/kit-setup.d.ts +316 -0
  17. package/types/packages/core/src/kit.d.ts +302 -1444
  18. package/types/packages/core/src/loop-layers.d.ts +33 -4
  19. package/types/packages/core/src/loop.d.ts +325 -55
  20. package/types/packages/core/src/marketplace.d.ts +51 -10
  21. package/types/packages/core/src/my-teams.d.ts +135 -20
  22. package/types/packages/core/src/network-host.d.ts +41 -0
  23. package/types/packages/core/src/notification.d.ts +8 -0
  24. package/types/packages/core/src/npm-registry.d.ts +65 -0
  25. package/types/packages/core/src/proposal.d.ts +0 -76
  26. package/types/packages/core/src/push.d.ts +68 -0
  27. package/types/packages/core/src/question-recommendation.d.ts +28 -0
  28. package/types/packages/core/src/redaction.d.ts +15 -3
  29. package/types/packages/core/src/resource-claim.d.ts +79 -0
  30. package/types/packages/core/src/run-display.d.ts +7 -1
  31. package/types/packages/core/src/run-graph.d.ts +1 -1
  32. package/types/packages/core/src/run-launch.d.ts +15 -2
  33. package/types/packages/core/src/run-queue.d.ts +28 -0
  34. package/types/packages/core/src/runner-eligibility.d.ts +21 -2
  35. package/types/packages/core/src/runner.d.ts +46 -15
  36. package/types/packages/core/src/secret.d.ts +18 -1
  37. package/types/packages/core/src/step-brief.d.ts +21 -7
  38. package/types/packages/core/src/sync-kit.d.ts +8 -0
  39. package/types/packages/core/src/task-detail.d.ts +15 -2
  40. package/types/packages/core/src/task.d.ts +9 -0
  41. package/types/packages/core/src/transcript.d.ts +24 -4
  42. package/types/packages/core/src/trust-panel.d.ts +1 -1
  43. package/types/packages/core/src/waiting-on.d.ts +14 -0
  44. package/types/packages/core/src/work-unit.d.ts +339 -8
  45. package/types/packages/live/src/rpc/runner-client.d.ts +1229 -566
  46. package/types/packages/live/src/rpc/runner-group.d.ts +2851 -441
  47. package/types/packages/sdk/src/build/index.d.ts +45 -9
  48. package/types/packages/sdk/src/loop/activities.d.ts +382 -2
  49. package/types/packages/sdk/src/loop/claims.d.ts +57 -0
  50. package/types/packages/sdk/src/loop/config.d.ts +38 -31
  51. package/types/packages/sdk/src/loop/continuing.d.ts +22 -0
  52. package/types/packages/sdk/src/loop/define.d.ts +30 -5
  53. package/types/packages/sdk/src/loop/evidence.d.ts +18 -3
  54. package/types/packages/sdk/src/loop/index.d.ts +4 -0
  55. package/types/packages/sdk/src/loop/measure.d.ts +132 -0
  56. package/types/packages/sdk/src/loop/plan.d.ts +2 -2
  57. package/types/packages/sdk/src/loop/steps.d.ts +127 -17
  58. package/types/packages/sdk/src/loop/sync.d.ts +53 -0
  59. package/types/packages/sdk/src/loop/test-loop.d.ts +25 -5
  60. package/types/packages/sdk/src/program/engine.d.ts +116 -17
  61. package/types/packages/sdk/src/program/host.d.ts +200 -38
  62. package/types/packages/core/src/engineering-resources.d.ts +0 -24
  63. package/types/packages/core/src/package.d.ts +0 -369
@@ -1,29 +1,33 @@
1
1
  import * as Schema from 'effect/Schema';
2
- import { KitKinds } from './kit';
3
2
  import type { JsonObject, JsonValue } from './runtime-type';
4
3
  import { ScheduleRule, type ScheduleMisfirePolicy, type ScheduleOverlapPolicy } from './schedule';
5
- export declare const LoopCapabilities: readonly ['agent_work', 'ask', 'call', 'verify', 'change_request', 'write_back', 'post_comment', 'create_tasks', 'merge_change_request', 'publish_release', 'read_transcripts', 'propose', 'read_project', 'draft_update'];
4
+ export declare const LoopCapabilities: readonly ['agent_work', 'ask', 'call', 'verify', 'change_request', 'write_back', 'post_comment', 'create_tasks', 'merge_change_request', 'approve_change_request', 'publish_release', 'read_transcripts', 'read_change_request', 'measure', 'claim', 'propose', 'read_project', 'draft_update'];
6
5
  declare const JsonObject: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
7
6
  /** What the control plane reads from a Loop without running it. */
8
7
  export declare const LoopManifest: Schema.Struct<{
9
8
  readonly id: Schema.String;
10
9
  readonly title: Schema.String;
10
+ readonly version: Schema.optionalKey<Schema.String>;
11
11
  readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
12
12
  readonly output: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
13
- readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["feature", "bug", "refactor", "investigation", "docs", "migration"]>>;
13
+ readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["feature", "bug", "refactor", "investigation", "docs", "migration", "performance"]>>;
14
14
  readonly agents: Schema.$Record<Schema.String, Schema.String>;
15
15
  readonly checkout: Schema.Literals<readonly ["none", "read", "write"]>;
16
16
  readonly when: Schema.$Array<Schema.Struct<{
17
17
  readonly event: Schema.String;
18
18
  readonly filter: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]>, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]>>]>>>;
19
19
  readonly input: Schema.$Record<Schema.String, Schema.String>;
20
+ /** Loop Input fields every Run it starts gets, under the bound ones. */
21
+ readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
20
22
  }>>;
21
23
  readonly offers: Schema.$Array<Schema.Struct<{
22
24
  readonly id: Schema.String;
23
25
  readonly title: Schema.String;
24
26
  readonly loop: Schema.String;
27
+ /** The Output field holding the offered Loop's Input; the offer shows only when the Output has it. */
28
+ readonly from: Schema.optionalKey<Schema.String>;
25
29
  }>>;
26
- readonly capabilities: Schema.$Array<Schema.Literals<readonly ["agent_work", "ask", "call", "verify", "change_request", "write_back", "post_comment", "create_tasks", "merge_change_request", "publish_release", "read_transcripts", "propose", "read_project", "draft_update"]>>;
30
+ readonly capabilities: Schema.$Array<Schema.Literals<readonly ["agent_work", "ask", "call", "verify", "change_request", "write_back", "post_comment", "create_tasks", "merge_change_request", "approve_change_request", "publish_release", "read_transcripts", "read_change_request", "measure", "claim", "propose", "read_project", "draft_update"]>>;
27
31
  /** The names of the Secrets the Loop reads. */
28
32
  readonly secrets: Schema.optionalKey<Schema.$Array<Schema.String>>;
29
33
  /** The hosts the program calls besides Kitman, or `open`. */
@@ -51,6 +55,7 @@ export declare const LoopDetail: Schema.Struct<{
51
55
  readonly resolved: Schema.optionalKey<Schema.Struct<{
52
56
  readonly id: Schema.String;
53
57
  readonly title: Schema.String;
58
+ readonly version: Schema.optionalKey<Schema.String>;
54
59
  readonly layer: Schema.Literals<readonly ["team", "workspace", "shipped"]>;
55
60
  readonly digest: Schema.String;
56
61
  readonly outcome: Schema.optionalKey<Schema.String>;
@@ -58,14 +63,17 @@ export declare const LoopDetail: Schema.Struct<{
58
63
  readonly id: Schema.String;
59
64
  readonly title: Schema.String;
60
65
  readonly loop: Schema.String;
66
+ readonly from: Schema.optionalKey<Schema.String>;
61
67
  }>>;
62
68
  readonly publishedAt: Schema.String;
63
- readonly package: Schema.String;
69
+ readonly kit: Schema.String;
64
70
  readonly agents: Schema.$Record<Schema.String, Schema.String>;
65
71
  readonly when: Schema.$Array<Schema.Struct<{
66
72
  readonly event: Schema.String;
67
73
  readonly filter: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]>, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]>>]>>>;
68
74
  readonly input: Schema.$Record<Schema.String, Schema.String>;
75
+ /** Loop Input fields every Run it starts gets, under the bound ones. */
76
+ readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
69
77
  }>>;
70
78
  /** The Schedule the Loop offers: whether this Workspace turned it on, and when it next runs. */
71
79
  readonly schedule: Schema.optionalKey<Schema.Struct<{
@@ -85,21 +93,27 @@ export declare const LoopDetail: Schema.Struct<{
85
93
  }>>;
86
94
  }>;
87
95
  export type LoopDetail = (typeof LoopDetail)['Type'];
88
- /** An Agent as a Package declares it, with its instructions already read from the repository. */
96
+ /** An Agent as a Kit declares it, with its instructions already read from the repository. */
89
97
  export declare const AgentDeclaration: Schema.Struct<{
90
98
  readonly extends: Schema.optionalKey<Schema.String>;
91
99
  readonly instructions: Schema.optionalKey<Schema.String>;
92
100
  readonly harness: Schema.optionalKey<Schema.String>;
93
101
  readonly model: Schema.optionalKey<Schema.String>;
94
102
  readonly effort: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
95
- readonly kits: Schema.optionalKey<Schema.$Array<Schema.String>>;
103
+ readonly fallbacks: Schema.optionalKey<Schema.$Array<Schema.Struct<{
104
+ readonly harness: Schema.String;
105
+ readonly model: Schema.optionalKey<Schema.String>;
106
+ readonly effort: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
107
+ }>>>;
108
+ readonly tools: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["web", "subagents", "artifacts", "browser"]>>>;
109
+ readonly skills: Schema.optionalKey<Schema.$Array<Schema.String>>;
96
110
  readonly network: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
97
111
  readonly hosts: Schema.$Array<Schema.String>;
98
112
  }>, Schema.Literal<"open">]>>;
99
113
  readonly sandbox: Schema.optionalKey<Schema.Literal<"docker">>;
100
114
  }>;
101
115
  export type AgentDeclaration = typeof AgentDeclaration.Type;
102
- /** A recurring start of a Loop, as a Package declares it: by cron, or by a daily or weekly calendar rule. */
116
+ /** A recurring start of a Loop, as a Kit declares it: by cron, or by a daily or weekly calendar rule. */
103
117
  export declare const ScheduleDeclaration: Schema.Union<readonly [Schema.Struct<{
104
118
  readonly name: Schema.String;
105
119
  readonly loop: Schema.String;
@@ -129,69 +143,41 @@ export declare const ScheduleDeclaration: Schema.Union<readonly [Schema.Struct<{
129
143
  }, unknown>;
130
144
  }>]>;
131
145
  export type ScheduleDeclaration = typeof ScheduleDeclaration.Type;
132
- /** A Kit the Package writes from its own files: context text, and each skill's files by path, `SKILL.md` among them. */
133
- export declare const AuthoredKitDeclaration: Schema.Struct<{
146
+ /** A Kit a build carries: itself or one it builds on, its setup archive's digest, and the Loops and Agents it brings. */
147
+ export declare const CarriedKit: Schema.Struct<{
134
148
  readonly name: Schema.String;
135
- readonly kind: Schema.optionalKey<Schema.Literals<readonly ["technology", "brand", "domain", "process", "other"]>>;
136
- readonly description: Schema.optionalKey<Schema.String>;
137
- readonly context: Schema.String;
138
- readonly skills: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.String>>>;
149
+ readonly version: Schema.String;
150
+ readonly setup: Schema.String;
151
+ readonly loops: Schema.$Array<Schema.String>;
152
+ readonly agents: Schema.$Array<Schema.String>;
139
153
  }>;
140
- export type AuthoredKitDeclaration = typeof AuthoredKitDeclaration.Type;
141
- /** A Marketplace Kit the Workspace installs, by its source's slug or id. */
142
- export declare const KitInstallationDeclaration: Schema.Struct<{
143
- readonly source: Schema.String;
144
- readonly version: Schema.optionalKey<Schema.String>;
145
- }>;
146
- export type KitInstallationDeclaration = typeof KitInstallationDeclaration.Type;
147
- /** Where a Kit applies: as Workspace policy, and attached to Teams by slug. */
148
- export declare const KitAssignmentDeclaration: Schema.Struct<{
149
- /** An authored Kit's key, or an installed Kit's source slug. */
150
- readonly kit: Schema.String;
151
- readonly workspace: Schema.optionalKey<Schema.Literals<readonly ["default", "mandatory"]>>;
152
- readonly teams: Schema.optionalKey<Schema.$Array<Schema.String>>;
153
- }>;
154
- export type KitAssignmentDeclaration = typeof KitAssignmentDeclaration.Type;
155
- export declare const KitDeclaration: Schema.Union<readonly [Schema.Struct<{
156
- readonly source: Schema.String;
157
- readonly version: Schema.optionalKey<Schema.String>;
158
- }>, Schema.Struct<{
159
- /** An authored Kit's key, or an installed Kit's source slug. */
160
- readonly kit: Schema.String;
161
- readonly workspace: Schema.optionalKey<Schema.Literals<readonly ["default", "mandatory"]>>;
162
- readonly teams: Schema.optionalKey<Schema.$Array<Schema.String>>;
163
- }>, Schema.Struct<{
164
- readonly name: Schema.String;
165
- readonly kind: Schema.optionalKey<Schema.Literals<readonly ["technology", "brand", "domain", "process", "other"]>>;
166
- readonly description: Schema.optionalKey<Schema.String>;
167
- readonly context: Schema.String;
168
- readonly skills: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.String>>>;
169
- }>]>;
170
- export type KitDeclaration = typeof KitDeclaration.Type;
171
- export declare const isKitInstallation: (declaration: KitDeclaration) => declaration is KitInstallationDeclaration;
172
- export declare const isKitAssignment: (declaration: KitDeclaration) => declaration is KitAssignmentDeclaration;
173
- export declare const isAuthoredKit: (declaration: KitDeclaration) => declaration is AuthoredKitDeclaration;
174
- /** Everything a Package declares, as its build encodes it and Kitman decodes it. */
175
- export declare const PackageDeclarations: Schema.Struct<{
154
+ export type CarriedKit = typeof CarriedKit.Type;
155
+ /** Everything a Kit declares, as its build encodes it and Kitman decodes it. */
156
+ export declare const KitDeclarations: Schema.Struct<{
176
157
  readonly loops: Schema.$Array<Schema.Struct<{
177
158
  readonly id: Schema.String;
178
159
  readonly title: Schema.String;
160
+ readonly version: Schema.optionalKey<Schema.String>;
179
161
  readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
180
162
  readonly output: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
181
- readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["feature", "bug", "refactor", "investigation", "docs", "migration"]>>;
163
+ readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["feature", "bug", "refactor", "investigation", "docs", "migration", "performance"]>>;
182
164
  readonly agents: Schema.$Record<Schema.String, Schema.String>;
183
165
  readonly checkout: Schema.Literals<readonly ["none", "read", "write"]>;
184
166
  readonly when: Schema.$Array<Schema.Struct<{
185
167
  readonly event: Schema.String;
186
168
  readonly filter: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]>, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]>>]>>>;
187
169
  readonly input: Schema.$Record<Schema.String, Schema.String>;
170
+ /** Loop Input fields every Run it starts gets, under the bound ones. */
171
+ readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
188
172
  }>>;
189
173
  readonly offers: Schema.$Array<Schema.Struct<{
190
174
  readonly id: Schema.String;
191
175
  readonly title: Schema.String;
192
176
  readonly loop: Schema.String;
177
+ /** The Output field holding the offered Loop's Input; the offer shows only when the Output has it. */
178
+ readonly from: Schema.optionalKey<Schema.String>;
193
179
  }>>;
194
- readonly capabilities: Schema.$Array<Schema.Literals<readonly ["agent_work", "ask", "call", "verify", "change_request", "write_back", "post_comment", "create_tasks", "merge_change_request", "publish_release", "read_transcripts", "propose", "read_project", "draft_update"]>>;
180
+ readonly capabilities: Schema.$Array<Schema.Literals<readonly ["agent_work", "ask", "call", "verify", "change_request", "write_back", "post_comment", "create_tasks", "merge_change_request", "approve_change_request", "publish_release", "read_transcripts", "read_change_request", "measure", "claim", "propose", "read_project", "draft_update"]>>;
195
181
  /** The names of the Secrets the Loop reads. */
196
182
  readonly secrets: Schema.optionalKey<Schema.$Array<Schema.String>>;
197
183
  /** The hosts the program calls besides Kitman, or `open`. */
@@ -218,7 +204,13 @@ export declare const PackageDeclarations: Schema.Struct<{
218
204
  readonly harness: Schema.optionalKey<Schema.String>;
219
205
  readonly model: Schema.optionalKey<Schema.String>;
220
206
  readonly effort: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
221
- readonly kits: Schema.optionalKey<Schema.$Array<Schema.String>>;
207
+ readonly fallbacks: Schema.optionalKey<Schema.$Array<Schema.Struct<{
208
+ readonly harness: Schema.String;
209
+ readonly model: Schema.optionalKey<Schema.String>;
210
+ readonly effort: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
211
+ }>>>;
212
+ readonly tools: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["web", "subagents", "artifacts", "browser"]>>>;
213
+ readonly skills: Schema.optionalKey<Schema.$Array<Schema.String>>;
222
214
  readonly network: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
223
215
  readonly hosts: Schema.$Array<Schema.String>;
224
216
  }>, Schema.Literal<"open">]>>;
@@ -252,37 +244,30 @@ export declare const PackageDeclarations: Schema.Struct<{
252
244
  readonly cron: string;
253
245
  }, unknown>;
254
246
  }>]>>>;
255
- readonly kits: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
256
- readonly source: Schema.String;
257
- readonly version: Schema.optionalKey<Schema.String>;
258
- }>, Schema.Struct<{
259
- /** An authored Kit's key, or an installed Kit's source slug. */
260
- readonly kit: Schema.String;
261
- readonly workspace: Schema.optionalKey<Schema.Literals<readonly ["default", "mandatory"]>>;
262
- readonly teams: Schema.optionalKey<Schema.$Array<Schema.String>>;
263
- }>, Schema.Struct<{
247
+ /** The built Kit first, then each Kit it builds on, once. */
248
+ readonly carried: Schema.optionalKey<Schema.$Array<Schema.Struct<{
264
249
  readonly name: Schema.String;
265
- readonly kind: Schema.optionalKey<Schema.Literals<readonly ["technology", "brand", "domain", "process", "other"]>>;
266
- readonly description: Schema.optionalKey<Schema.String>;
267
- readonly context: Schema.String;
268
- readonly skills: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.String>>>;
269
- }>]>>>;
250
+ readonly version: Schema.String;
251
+ readonly setup: Schema.String;
252
+ readonly loops: Schema.$Array<Schema.String>;
253
+ readonly agents: Schema.$Array<Schema.String>;
254
+ }>>>;
270
255
  }>;
271
- export type PackageDeclarations = typeof PackageDeclarations.Type;
256
+ export type KitDeclarations = typeof KitDeclarations.Type;
272
257
  /** What a deploy does to one kind of record, by id. */
273
- export type PackageChanges = {
258
+ export type KitChanges = {
274
259
  readonly created: readonly string[];
275
260
  readonly changed: readonly string[];
276
261
  readonly removed: readonly string[];
277
262
  };
278
- /** What a deploy does to records a Package owns, by key; `adopted` names the live record each key takes over. */
279
- export type PackageRecordChanges = PackageChanges & {
263
+ /** What a deploy does to records a Kit owns, by key; `adopted` names the live record each key takes over. */
264
+ export type KitRecordChanges = KitChanges & {
280
265
  readonly adopted: readonly {
281
266
  readonly key: string;
282
267
  readonly id: string;
283
268
  }[];
284
269
  };
285
- /** A Schedule as it is live, and as a Package last deployed it. */
270
+ /** A Schedule as it is live, and as a Kit last deployed it. */
286
271
  export type ScheduleRecord = {
287
272
  readonly name?: string;
288
273
  readonly loop: string;
@@ -304,56 +289,6 @@ export type RecordChange<V> = {
304
289
  };
305
290
  readonly at: string;
306
291
  };
307
- /** An authored Kit as it is live, and as a Package last deployed it. */
308
- export type AuthoredKitRecord = {
309
- readonly name: string;
310
- readonly slug: string;
311
- readonly kind: (typeof KitKinds)[number];
312
- readonly description: string | null;
313
- readonly context: string;
314
- readonly skills: {
315
- readonly [skill: string]: {
316
- readonly [path: string]: string;
317
- };
318
- };
319
- };
320
- /** A Workspace's installation of a Kit source, pinned to a version or following the latest. */
321
- export type KitInstallationRecord = {
322
- readonly source: string;
323
- readonly version: string | null;
324
- };
325
- /** A Kit's Workspace policy mode and the Teams it is attached to. */
326
- export type KitAssignmentRecord = {
327
- /** As declared: an authored Kit's key or an installed Kit's source slug. */
328
- readonly kit: string;
329
- readonly workspace: 'default' | 'mandatory' | null;
330
- readonly teams: readonly string[];
331
- };
332
- /** A Kit source the Marketplace offers the Workspace, its versions newest first. */
333
- export type KitSourceOption = {
334
- readonly id: string;
335
- readonly slug: string;
336
- /** Reviewed, approved, trusted and active, as installing requires. */
337
- readonly installable: boolean;
338
- readonly versions: readonly {
339
- readonly id: string;
340
- readonly version: string;
341
- readonly installable: boolean;
342
- /** The Kit that carries this version's content. */
343
- readonly contentKitId?: string;
344
- }[];
345
- };
346
- /** The live Kit records a deploy plan reads. */
347
- export type KitSnapshot = {
348
- readonly authored: RecordSnapshot<AuthoredKitRecord>;
349
- readonly installations: RecordSnapshot<KitInstallationRecord>;
350
- /** Unowned entries are keyed by the id of the Kit they assign. */
351
- readonly assignments: RecordSnapshot<KitAssignmentRecord>;
352
- readonly sources: readonly KitSourceOption[];
353
- /** The Workspace's live installations. */
354
- readonly installed: readonly KitInstallationRecord[];
355
- readonly policyEnabled: boolean;
356
- };
357
292
  export type RecordSnapshot<V> = {
358
293
  readonly owned: readonly OwnedRecord<V>[];
359
294
  readonly unowned: readonly {
@@ -361,82 +296,62 @@ export type RecordSnapshot<V> = {
361
296
  readonly value: V;
362
297
  }[];
363
298
  };
364
- /** A record a Package owns; `history` runs oldest first and ends with the live value. */
299
+ /** A record a Kit owns; `history` runs oldest first and ends with the live value. */
365
300
  export type OwnedRecord<V> = {
366
301
  readonly key: string;
367
302
  readonly id: string;
368
303
  readonly deployed: V;
369
304
  readonly history: readonly RecordChange<V>[];
370
305
  };
371
- export type PackageRecordKind = 'schedule' | 'kit' | 'kit_installation' | 'kit_assignment';
306
+ export type KitRecordKind = 'schedule';
372
307
  export type RecordDrift = {
373
- readonly kind: PackageRecordKind;
308
+ readonly kind: KitRecordKind;
374
309
  readonly key: string;
375
310
  readonly field: string;
376
- /** As the Package last deployed it. */
311
+ /** As the Kit last deployed it. */
377
312
  readonly declared: JsonValue;
378
313
  readonly live: JsonValue;
379
314
  readonly changedBy?: NonNullable<RecordChange<JsonObject>['by']>;
380
315
  readonly changedAt?: string;
381
316
  };
382
- export type PackagePlanConflict = {
317
+ export type KitPlanConflict = {
383
318
  readonly kind: 'id_taken';
384
319
  readonly resource: 'loop' | 'agent';
385
320
  readonly id: string;
386
- /** The other Package in the layer that declares it. */
387
- readonly package: string;
321
+ /** The other Kit in the layer that declares it. */
322
+ readonly kit: string;
388
323
  } | {
389
324
  readonly kind: 'not_for_team';
390
325
  readonly declaration: string;
391
326
  } | {
392
327
  readonly kind: 'schedule_team';
393
328
  readonly key: string;
394
- /** `missing` in a Workspace Package, `not_allowed` in a Team Package, `unknown` for no such Team. */
329
+ /** `missing` in a Workspace Kit, `not_allowed` in a Team Kit, `unknown` for no such Team. */
395
330
  readonly problem: 'missing' | 'not_allowed' | 'unknown';
396
331
  } | {
397
332
  readonly kind: 'loop_unresolved';
398
333
  readonly record: 'schedule';
399
334
  readonly key: string;
400
335
  readonly loop: string;
401
- } | {
402
- readonly kind: 'kit_unresolved';
403
- /** An Agent's id, or a Kit assignment's key. */
404
- readonly record: 'agent' | 'kit_assignment';
405
- readonly key: string;
406
- readonly kit: string;
407
- } | {
408
- readonly kind: 'kit_source';
409
- readonly key: string;
410
- readonly problem: 'unknown' | 'untrusted' | 'version_unknown';
411
- } | {
412
- readonly kind: 'kit_policy_disabled';
413
- readonly key: string;
414
- } | {
415
- readonly kind: 'kit_team_unknown';
416
- readonly key: string;
417
- readonly team: string;
418
336
  };
419
- /** A Loop or Agent the deploy removes that a record outside the Package still names. */
420
- export type PackagePlanWarning = {
337
+ /** A Loop or Agent the deploy removes that a record outside the Kit still names. */
338
+ export type KitPlanWarning = {
421
339
  readonly kind: 'still_named';
422
340
  readonly resource: 'loop' | 'agent';
423
341
  readonly id: string;
424
342
  readonly record: string;
425
343
  };
426
344
  /** A plan with conflicts cannot deploy. */
427
- export type PackagePlan = {
428
- readonly loops: PackageChanges;
429
- readonly agents: PackageChanges;
430
- readonly schedules: PackageRecordChanges;
431
- readonly kits: PackageRecordChanges;
432
- readonly kitInstallations: PackageRecordChanges;
433
- readonly kitAssignments: PackageRecordChanges;
345
+ export type KitPlan = {
346
+ readonly loops: KitChanges;
347
+ readonly agents: KitChanges;
348
+ readonly schedules: KitRecordChanges;
434
349
  readonly drift: readonly RecordDrift[];
435
- readonly conflicts: readonly PackagePlanConflict[];
436
- readonly warnings: readonly PackagePlanWarning[];
350
+ readonly conflicts: readonly KitPlanConflict[];
351
+ readonly warnings: readonly KitPlanWarning[];
437
352
  };
438
- /** A Package's layer, and where it puts its Schedules. */
439
- export type PackagePlanScope = {
353
+ /** A Kit's layer, and where it puts its Schedules. */
354
+ export type KitPlanScope = {
440
355
  readonly layer: 'team';
441
356
  readonly teamId: string;
442
357
  } | {
@@ -445,7 +360,7 @@ export type PackagePlanScope = {
445
360
  readonly teams: ReadonlyMap<string, string>;
446
361
  };
447
362
  /** The Team a declared Schedule runs in, or why it has none. */
448
- export declare const scheduleTeam: (declaration: ScheduleDeclaration, scope: PackagePlanScope) => {
363
+ export declare const scheduleTeam: (declaration: ScheduleDeclaration, scope: KitPlanScope) => {
449
364
  readonly teamId: string;
450
365
  } | {
451
366
  readonly problem: 'missing' | 'not_allowed' | 'unknown';
@@ -454,26 +369,16 @@ export declare const scheduleTeam: (declaration: ScheduleDeclaration, scope: Pac
454
369
  export declare const scheduleRecord: (declaration: ScheduleDeclaration, teamId: string) => ScheduleRecord;
455
370
  /** The fields where a record's live value left what was deployed, each with the version that last changed it. */
456
371
  export declare const recordDrift: (kind: RecordDrift['kind'], owned: OwnedRecord<JsonObject>) => RecordDrift[];
457
- /** The live Kit an authored Kit declaration asks for; its key is its slug. */
458
- export declare const authoredKitRecord: (key: string, declaration: AuthoredKitDeclaration) => AuthoredKitRecord;
459
- /** The installation a declaration asks for, pinned to its version or the newest installable one. */
460
- export declare const kitInstallationRecord: (declaration: KitInstallationDeclaration, sources: readonly KitSourceOption[]) => KitInstallationRecord | {
461
- readonly problem: 'unknown' | 'untrusted' | 'version_unknown';
462
- };
463
- /** The assignment a declaration asks for, with its Teams' ids, or the first Team slug that names none. */
464
- export declare const kitAssignmentRecord: (declaration: KitAssignmentDeclaration, teams: ReadonlyMap<string, string>) => KitAssignmentRecord | {
465
- readonly unknownTeam: string;
466
- };
467
372
  /**
468
- * Compares a Package's current declarations with new ones. `others` are the other Packages in the same layer,
373
+ * Compares a Kit's current declarations with new ones. `others` are the other Kits in the same layer,
469
374
  * `elsewhere` what the layers beneath it declare, and `otherDeclarations` the kinds the new version declares besides
470
- * Loops, Agents and Schedules. `schedules` holds the Schedules the Package owns and, for adoption, those no Package owns;
471
- * `outside` the records outside the Package that name a Loop or Agent.
375
+ * Loops, Agents and Schedules. `schedules` holds the Schedules the Kit owns and, for adoption, those no Kit owns;
376
+ * `outside` the records outside the Kit that name a Loop or Agent.
472
377
  */
473
- export declare const planPackageDeploy: (input: {
474
- readonly scope: PackagePlanScope;
475
- readonly current?: PackageDeclarations;
476
- readonly next: PackageDeclarations;
378
+ export declare const planKitDeploy: (input: {
379
+ readonly scope: KitPlanScope;
380
+ readonly current?: KitDeclarations;
381
+ readonly next: KitDeclarations;
477
382
  readonly otherDeclarations?: readonly string[];
478
383
  readonly others: readonly {
479
384
  readonly name: string;
@@ -496,6 +401,5 @@ export declare const planPackageDeploy: (input: {
496
401
  readonly loop?: string;
497
402
  readonly agent?: string;
498
403
  }[];
499
- readonly kits?: KitSnapshot;
500
- }) => PackagePlan;
404
+ }) => KitPlan;
501
405
  export {};
@@ -0,0 +1,130 @@
1
+ import * as Schema from 'effect/Schema';
2
+ /** A Kit installed from npm on the Workspace, a Team, or one person. */
3
+ export declare const KitInstall: Schema.Struct<{
4
+ readonly name: Schema.String;
5
+ readonly owner: Schema.Literals<readonly ["workspace", "team", "personal"]>;
6
+ readonly teamId: Schema.optionalKey<Schema.String>;
7
+ /** Absent for an install carried over from the old Kit model until a Run or a check first resolves it. */
8
+ readonly version: Schema.optionalKey<Schema.String>;
9
+ /** It follows npm `latest` without one. */
10
+ readonly pinnedVersion: Schema.optionalKey<Schema.String>;
11
+ readonly lastCheckedAt: Schema.optionalKey<Schema.String>;
12
+ /** Why its last check left it at `version`. */
13
+ readonly problem: Schema.optionalKey<Schema.String>;
14
+ /** The person its Loops' automatic starts act for; with nobody, they start only once someone Adds it again. */
15
+ readonly actsFor: Schema.optionalKey<Schema.String>;
16
+ }>;
17
+ export type KitInstall = typeof KitInstall.Type;
18
+ export declare const KitInstallList: Schema.Struct<{
19
+ readonly items: Schema.$Array<Schema.Struct<{
20
+ readonly name: Schema.String;
21
+ readonly owner: Schema.Literals<readonly ["workspace", "team", "personal"]>;
22
+ readonly teamId: Schema.optionalKey<Schema.String>;
23
+ /** Absent for an install carried over from the old Kit model until a Run or a check first resolves it. */
24
+ readonly version: Schema.optionalKey<Schema.String>;
25
+ /** It follows npm `latest` without one. */
26
+ readonly pinnedVersion: Schema.optionalKey<Schema.String>;
27
+ readonly lastCheckedAt: Schema.optionalKey<Schema.String>;
28
+ /** Why its last check left it at `version`. */
29
+ readonly problem: Schema.optionalKey<Schema.String>;
30
+ /** The person its Loops' automatic starts act for; with nobody, they start only once someone Adds it again. */
31
+ readonly actsFor: Schema.optionalKey<Schema.String>;
32
+ }>>;
33
+ }>;
34
+ export type KitInstallList = typeof KitInstallList.Type;
35
+ /** Installs on the Workspace, the Team `teamId` names, or, with `me`, the caller. */
36
+ export declare const KitOwnerQuery: Schema.Struct<{
37
+ readonly teamId: Schema.optionalKey<Schema.String>;
38
+ readonly me: Schema.optionalKey<Schema.Literals<readonly ["true", "false"]>>;
39
+ }>;
40
+ export declare const KitAddRequest: Schema.Struct<{
41
+ readonly name: Schema.String;
42
+ readonly teamId: Schema.optionalKey<Schema.String>;
43
+ readonly me: Schema.optionalKey<Schema.Boolean>;
44
+ }>;
45
+ export type KitAddRequest = typeof KitAddRequest.Type;
46
+ export declare const KitPinRequest: Schema.Struct<{
47
+ readonly version: Schema.String;
48
+ }>;
49
+ /** The Kits a person's machines get, nearest first: their own, their Teams', the Workspace's, then Kitman's. */
50
+ export declare const KitChain: Schema.Struct<{
51
+ readonly kits: Schema.$Array<Schema.Struct<{
52
+ readonly name: Schema.String;
53
+ readonly version: Schema.String;
54
+ readonly setupDigest: Schema.String;
55
+ }>>;
56
+ /** Installs with no version to sync, and why. */
57
+ readonly skipped: Schema.$Array<Schema.Struct<{
58
+ readonly name: Schema.String;
59
+ readonly problem: Schema.String;
60
+ }>>;
61
+ }>;
62
+ export type KitChain = typeof KitChain.Type;
63
+ /** The Kits of an Owner chain, nearest first, each deployed or installed. */
64
+ export declare const OwnerKits: Schema.Struct<{
65
+ readonly kits: Schema.$Array<Schema.Struct<{
66
+ readonly name: Schema.String;
67
+ readonly version: Schema.String;
68
+ readonly source: Schema.Literals<readonly ["deployed", "installed"]>;
69
+ }>>;
70
+ }>;
71
+ export type OwnerKits = typeof OwnerKits.Type;
72
+ export declare const OwnerKitsQuery: Schema.Struct<{
73
+ readonly teamId: Schema.optionalKey<Schema.String>;
74
+ }>;
75
+ /** A setup archive's JSON text, whose sha256 is its digest. */
76
+ export declare const KitSetupDownload: Schema.Struct<{
77
+ readonly archive: Schema.String;
78
+ }>;
79
+ export type KitSetupDownload = typeof KitSetupDownload.Type;
80
+ export declare const KitPreviewQuery: Schema.Struct<{
81
+ readonly name: Schema.String;
82
+ readonly version: Schema.optionalKey<Schema.String>;
83
+ }>;
84
+ /** What a Kit brings, from its published build, before it is added. */
85
+ export declare const KitPreview: Schema.Struct<{
86
+ readonly name: Schema.String;
87
+ readonly version: Schema.String;
88
+ readonly loops: Schema.$Array<Schema.Struct<{
89
+ readonly id: Schema.String;
90
+ readonly title: Schema.String;
91
+ readonly when: Schema.$Array<Schema.Struct<{
92
+ readonly event: Schema.String;
93
+ readonly filter: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]>, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]>>]>>>;
94
+ readonly input: Schema.$Record<Schema.String, Schema.String>;
95
+ readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
96
+ }>>;
97
+ }>>;
98
+ readonly agents: Schema.$Array<Schema.Struct<{
99
+ readonly id: Schema.String;
100
+ }>>;
101
+ readonly skills: Schema.$Array<Schema.Struct<{
102
+ readonly kit: Schema.String;
103
+ readonly name: Schema.String;
104
+ }>>;
105
+ readonly plugins: Schema.$Array<Schema.Struct<{
106
+ readonly kit: Schema.String;
107
+ readonly name: Schema.String;
108
+ readonly hooks: Schema.$Array<Schema.String>;
109
+ }>>;
110
+ readonly mcpServers: Schema.$Array<Schema.Struct<{
111
+ readonly kit: Schema.String;
112
+ readonly name: Schema.String;
113
+ /** A remote server's host; a stdio server runs `command` instead. */
114
+ readonly host: Schema.optionalKey<Schema.String>;
115
+ readonly command: Schema.optionalKey<Schema.String>;
116
+ }>>;
117
+ /** The Secrets its MCP config names by `{env:NAME}`. */
118
+ readonly secrets: Schema.$Array<Schema.String>;
119
+ }>;
120
+ export type KitPreview = typeof KitPreview.Type;
121
+ /** A published Kit's preview; declarations or archives that don't decode contribute nothing. */
122
+ export declare const kitPreview: (kit: {
123
+ readonly name: string;
124
+ readonly version: string;
125
+ readonly declarations: unknown;
126
+ readonly setupArchives: readonly {
127
+ readonly digest: string;
128
+ readonly archive: Uint8Array;
129
+ }[];
130
+ }) => KitPreview;