@kitman-sh/loops 0.0.0-stage → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/index.js +1066 -0
  2. package/package.json +19 -4
  3. package/types/packages/core/src/agent-environment.d.ts +2429 -0
  4. package/types/packages/core/src/agent-sandbox-policy.d.ts +31 -0
  5. package/types/packages/core/src/common.d.ts +6 -0
  6. package/types/packages/core/src/context-pack.d.ts +182 -0
  7. package/types/packages/core/src/extension.d.ts +35 -0
  8. package/types/packages/core/src/kit.d.ts +1489 -0
  9. package/types/packages/core/src/loop-layers.d.ts +59 -0
  10. package/types/packages/core/src/loop-version.d.ts +59 -0
  11. package/types/packages/core/src/loop.d.ts +3076 -0
  12. package/types/packages/core/src/package-declarations.d.ts +427 -0
  13. package/types/packages/core/src/proposal.d.ts +292 -0
  14. package/types/packages/core/src/redaction.d.ts +73 -0
  15. package/types/packages/core/src/run.d.ts +566 -0
  16. package/types/packages/core/src/runtime-type.d.ts +36 -0
  17. package/types/packages/core/src/schedule.d.ts +136 -0
  18. package/types/packages/core/src/schema.d.ts +89 -0
  19. package/types/packages/core/src/trigger-dispatch.d.ts +421 -0
  20. package/types/packages/loops/src/build.d.ts +33 -0
  21. package/types/packages/loops/src/change-request-body.d.ts +14 -0
  22. package/types/packages/loops/src/code-quality-pass.d.ts +50 -0
  23. package/types/packages/loops/src/code-quality.d.ts +26 -0
  24. package/types/packages/loops/src/hello.d.ts +9 -0
  25. package/types/packages/loops/src/incident.d.ts +13 -0
  26. package/types/packages/loops/src/index.d.ts +172 -0
  27. package/types/packages/loops/src/plan.d.ts +37 -0
  28. package/types/packages/loops/src/release.d.ts +21 -0
  29. package/types/packages/loops/src/research.d.ts +8 -0
  30. package/types/packages/loops/src/review.d.ts +38 -0
  31. package/types/packages/sdk/src/loop/activities.d.ts +187 -0
  32. package/types/packages/sdk/src/loop/check.d.ts +39 -0
  33. package/types/packages/sdk/src/loop/config.d.ts +68 -0
  34. package/types/packages/sdk/src/loop/define.d.ts +69 -0
  35. package/types/packages/sdk/src/loop/evidence.d.ts +66 -0
  36. package/types/packages/sdk/src/loop/index.d.ts +9 -0
  37. package/types/packages/sdk/src/loop/plan.d.ts +43 -0
  38. package/types/packages/sdk/src/loop/review.d.ts +86 -0
  39. package/types/packages/sdk/src/loop/steps.d.ts +224 -0
  40. package/types/packages/sdk/src/loop/test-loop.d.ts +112 -0
  41. package/README.md +0 -3
@@ -0,0 +1,427 @@
1
+ import * as Schema from 'effect/Schema';
2
+ import { KitKinds } from './kit';
3
+ import type { JsonObject, JsonValue } from './runtime-type';
4
+ import { type 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'];
6
+ declare const JsonObject: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
7
+ /** What the control plane reads from a Loop without running it. */
8
+ export declare const LoopManifest: Schema.Struct<{
9
+ readonly id: Schema.String;
10
+ readonly title: Schema.String;
11
+ readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
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"]>>;
14
+ readonly agents: Schema.$Record<Schema.String, Schema.String>;
15
+ readonly checkout: Schema.Literals<readonly ["none", "read", "write"]>;
16
+ readonly when: Schema.$Array<Schema.Struct<{
17
+ readonly event: Schema.String;
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
+ readonly input: Schema.$Record<Schema.String, Schema.String>;
20
+ }>>;
21
+ readonly offers: Schema.$Array<Schema.Struct<{
22
+ readonly id: Schema.String;
23
+ readonly title: Schema.String;
24
+ readonly loop: Schema.String;
25
+ }>>;
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"]>>;
27
+ /** The names of the Secrets the Loop reads. */
28
+ readonly secrets: Schema.optionalKey<Schema.$Array<Schema.String>>;
29
+ }>;
30
+ export type LoopManifest = typeof LoopManifest.Type;
31
+ /** An Agent as a Package declares it, with its instructions already read from the repository. */
32
+ export declare const AgentDeclaration: Schema.Struct<{
33
+ readonly extends: Schema.optionalKey<Schema.String>;
34
+ readonly instructions: Schema.optionalKey<Schema.String>;
35
+ readonly harness: Schema.optionalKey<Schema.String>;
36
+ readonly model: Schema.optionalKey<Schema.String>;
37
+ readonly effort: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
38
+ readonly kits: Schema.optionalKey<Schema.$Array<Schema.String>>;
39
+ readonly network: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
40
+ readonly hosts: Schema.$Array<Schema.String>;
41
+ }>, Schema.Literal<"open">]>>;
42
+ readonly sandbox: Schema.optionalKey<Schema.Literal<"docker">>;
43
+ }>;
44
+ export type AgentDeclaration = typeof AgentDeclaration.Type;
45
+ /** A recurring start of a Loop, as a Package declares it: by cron, or by a daily or weekly calendar rule. */
46
+ export declare const ScheduleDeclaration: Schema.Union<readonly [Schema.Struct<{
47
+ readonly name: Schema.String;
48
+ readonly loop: Schema.String;
49
+ readonly project: Schema.optionalKey<Schema.String>;
50
+ readonly input: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
51
+ readonly timezone: Schema.String;
52
+ readonly misfire: Schema.optionalKey<Schema.Literals<readonly ["skip", "fire_once", "catch_up"]>>;
53
+ readonly overlap: Schema.optionalKey<Schema.Literals<readonly ["allow", "skip", "coalesce"]>>;
54
+ /** Five fields, minute hour day-of-month month day-of-week, read in `timezone`. */
55
+ readonly cron: Schema.String;
56
+ }>, Schema.Struct<{
57
+ readonly name: Schema.String;
58
+ readonly loop: Schema.String;
59
+ readonly project: Schema.optionalKey<Schema.String>;
60
+ readonly input: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
61
+ readonly timezone: Schema.String;
62
+ readonly misfire: Schema.optionalKey<Schema.Literals<readonly ["skip", "fire_once", "catch_up"]>>;
63
+ readonly overlap: Schema.optionalKey<Schema.Literals<readonly ["allow", "skip", "coalesce"]>>;
64
+ readonly rule: Schema.declare<{
65
+ readonly frequency: "daily" | "weekly";
66
+ readonly hour: number;
67
+ readonly minute: number;
68
+ readonly second?: number;
69
+ readonly daysOfWeek?: readonly number[];
70
+ } | {
71
+ readonly cron: string;
72
+ }, unknown>;
73
+ }>]>;
74
+ export type ScheduleDeclaration = typeof ScheduleDeclaration.Type;
75
+ /** A Kit the Package writes from its own files: context text, and each skill's files by path, `SKILL.md` among them. */
76
+ export declare const AuthoredKitDeclaration: Schema.Struct<{
77
+ readonly name: Schema.String;
78
+ readonly kind: Schema.optionalKey<Schema.Literals<readonly ["technology", "brand", "domain", "process", "other"]>>;
79
+ readonly description: Schema.optionalKey<Schema.String>;
80
+ readonly context: Schema.String;
81
+ readonly skills: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.String>>>;
82
+ }>;
83
+ export type AuthoredKitDeclaration = typeof AuthoredKitDeclaration.Type;
84
+ /** A Marketplace Kit the Workspace installs, by its source's slug or id. */
85
+ export declare const KitInstallationDeclaration: Schema.Struct<{
86
+ readonly source: Schema.String;
87
+ readonly version: Schema.optionalKey<Schema.String>;
88
+ }>;
89
+ export type KitInstallationDeclaration = typeof KitInstallationDeclaration.Type;
90
+ /** Where a Kit applies: as Workspace policy, and attached to Projects by slug. */
91
+ export declare const KitAssignmentDeclaration: Schema.Struct<{
92
+ /** An authored Kit's key, or an installed Kit's source slug. */
93
+ readonly kit: Schema.String;
94
+ readonly workspace: Schema.optionalKey<Schema.Literals<readonly ["default", "mandatory"]>>;
95
+ readonly projects: Schema.optionalKey<Schema.$Array<Schema.String>>;
96
+ }>;
97
+ export type KitAssignmentDeclaration = typeof KitAssignmentDeclaration.Type;
98
+ export declare const KitDeclaration: Schema.Union<readonly [Schema.Struct<{
99
+ readonly source: Schema.String;
100
+ readonly version: Schema.optionalKey<Schema.String>;
101
+ }>, Schema.Struct<{
102
+ /** An authored Kit's key, or an installed Kit's source slug. */
103
+ readonly kit: Schema.String;
104
+ readonly workspace: Schema.optionalKey<Schema.Literals<readonly ["default", "mandatory"]>>;
105
+ readonly projects: Schema.optionalKey<Schema.$Array<Schema.String>>;
106
+ }>, Schema.Struct<{
107
+ readonly name: Schema.String;
108
+ readonly kind: Schema.optionalKey<Schema.Literals<readonly ["technology", "brand", "domain", "process", "other"]>>;
109
+ readonly description: Schema.optionalKey<Schema.String>;
110
+ readonly context: Schema.String;
111
+ readonly skills: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.String>>>;
112
+ }>]>;
113
+ export type KitDeclaration = typeof KitDeclaration.Type;
114
+ export declare const isKitInstallation: (declaration: KitDeclaration) => declaration is KitInstallationDeclaration;
115
+ export declare const isKitAssignment: (declaration: KitDeclaration) => declaration is KitAssignmentDeclaration;
116
+ export declare const isAuthoredKit: (declaration: KitDeclaration) => declaration is AuthoredKitDeclaration;
117
+ /** Everything a Package declares, as its build encodes it and Kitman decodes it. */
118
+ export declare const PackageDeclarations: Schema.Struct<{
119
+ readonly loops: Schema.$Array<Schema.Struct<{
120
+ readonly id: Schema.String;
121
+ readonly title: Schema.String;
122
+ readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
123
+ readonly output: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
124
+ readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["feature", "bug", "refactor", "investigation", "docs", "migration"]>>;
125
+ readonly agents: Schema.$Record<Schema.String, Schema.String>;
126
+ readonly checkout: Schema.Literals<readonly ["none", "read", "write"]>;
127
+ readonly when: Schema.$Array<Schema.Struct<{
128
+ readonly event: Schema.String;
129
+ 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]>>]>>>;
130
+ readonly input: Schema.$Record<Schema.String, Schema.String>;
131
+ }>>;
132
+ readonly offers: Schema.$Array<Schema.Struct<{
133
+ readonly id: Schema.String;
134
+ readonly title: Schema.String;
135
+ readonly loop: Schema.String;
136
+ }>>;
137
+ 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"]>>;
138
+ /** The names of the Secrets the Loop reads. */
139
+ readonly secrets: Schema.optionalKey<Schema.$Array<Schema.String>>;
140
+ }>>;
141
+ readonly agents: Schema.$Record<Schema.String, Schema.Struct<{
142
+ readonly extends: Schema.optionalKey<Schema.String>;
143
+ readonly instructions: Schema.optionalKey<Schema.String>;
144
+ readonly harness: Schema.optionalKey<Schema.String>;
145
+ readonly model: Schema.optionalKey<Schema.String>;
146
+ readonly effort: Schema.optionalKey<Schema.Literals<readonly ["low", "medium", "high", "xhigh"]>>;
147
+ readonly kits: Schema.optionalKey<Schema.$Array<Schema.String>>;
148
+ readonly network: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
149
+ readonly hosts: Schema.$Array<Schema.String>;
150
+ }>, Schema.Literal<"open">]>>;
151
+ readonly sandbox: Schema.optionalKey<Schema.Literal<"docker">>;
152
+ }>>;
153
+ readonly schedules: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
154
+ readonly name: Schema.String;
155
+ readonly loop: Schema.String;
156
+ readonly project: Schema.optionalKey<Schema.String>;
157
+ readonly input: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
158
+ readonly timezone: Schema.String;
159
+ readonly misfire: Schema.optionalKey<Schema.Literals<readonly ["skip", "fire_once", "catch_up"]>>;
160
+ readonly overlap: Schema.optionalKey<Schema.Literals<readonly ["allow", "skip", "coalesce"]>>;
161
+ /** Five fields, minute hour day-of-month month day-of-week, read in `timezone`. */
162
+ readonly cron: Schema.String;
163
+ }>, Schema.Struct<{
164
+ readonly name: Schema.String;
165
+ readonly loop: Schema.String;
166
+ readonly project: Schema.optionalKey<Schema.String>;
167
+ readonly input: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
168
+ readonly timezone: Schema.String;
169
+ readonly misfire: Schema.optionalKey<Schema.Literals<readonly ["skip", "fire_once", "catch_up"]>>;
170
+ readonly overlap: Schema.optionalKey<Schema.Literals<readonly ["allow", "skip", "coalesce"]>>;
171
+ readonly rule: Schema.declare<{
172
+ readonly frequency: "daily" | "weekly";
173
+ readonly hour: number;
174
+ readonly minute: number;
175
+ readonly second?: number;
176
+ readonly daysOfWeek?: readonly number[];
177
+ } | {
178
+ readonly cron: string;
179
+ }, unknown>;
180
+ }>]>>>;
181
+ readonly kits: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
182
+ readonly source: Schema.String;
183
+ readonly version: Schema.optionalKey<Schema.String>;
184
+ }>, Schema.Struct<{
185
+ /** An authored Kit's key, or an installed Kit's source slug. */
186
+ readonly kit: Schema.String;
187
+ readonly workspace: Schema.optionalKey<Schema.Literals<readonly ["default", "mandatory"]>>;
188
+ readonly projects: Schema.optionalKey<Schema.$Array<Schema.String>>;
189
+ }>, Schema.Struct<{
190
+ readonly name: Schema.String;
191
+ readonly kind: Schema.optionalKey<Schema.Literals<readonly ["technology", "brand", "domain", "process", "other"]>>;
192
+ readonly description: Schema.optionalKey<Schema.String>;
193
+ readonly context: Schema.String;
194
+ readonly skills: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.String>>>;
195
+ }>]>>>;
196
+ }>;
197
+ export type PackageDeclarations = typeof PackageDeclarations.Type;
198
+ /** What a deploy does to one kind of record, by id. */
199
+ export type PackageChanges = {
200
+ readonly created: readonly string[];
201
+ readonly changed: readonly string[];
202
+ readonly removed: readonly string[];
203
+ };
204
+ /** What a deploy does to records a Package owns, by key; `adopted` names the live record each key takes over. */
205
+ export type PackageRecordChanges = PackageChanges & {
206
+ readonly adopted: readonly {
207
+ readonly key: string;
208
+ readonly id: string;
209
+ }[];
210
+ };
211
+ /** A Schedule as it is live, and as a Package last deployed it. */
212
+ export type ScheduleRecord = {
213
+ readonly name?: string;
214
+ readonly loop: string;
215
+ readonly projectId: string;
216
+ readonly input: JsonValue;
217
+ readonly rule: ScheduleRule;
218
+ readonly timezone: string;
219
+ readonly misfire: ScheduleMisfirePolicy;
220
+ readonly overlap: ScheduleOverlapPolicy;
221
+ readonly status: 'published' | 'disabled' | 'archived';
222
+ };
223
+ /** One version of a live record: its value, and who made it when. */
224
+ export type RecordChange<V> = {
225
+ readonly value: V;
226
+ /** Unknown for records that keep no author. */
227
+ readonly by?: {
228
+ readonly actorType: string;
229
+ readonly actorId: string;
230
+ };
231
+ readonly at: string;
232
+ };
233
+ /** An authored Kit as it is live, and as a Package last deployed it. */
234
+ export type AuthoredKitRecord = {
235
+ readonly name: string;
236
+ readonly slug: string;
237
+ readonly kind: (typeof KitKinds)[number];
238
+ readonly description: string | null;
239
+ readonly context: string;
240
+ readonly skills: {
241
+ readonly [skill: string]: {
242
+ readonly [path: string]: string;
243
+ };
244
+ };
245
+ };
246
+ /** A Workspace's installation of a Kit source, pinned to a version or following the latest. */
247
+ export type KitInstallationRecord = {
248
+ readonly source: string;
249
+ readonly version: string | null;
250
+ };
251
+ /** A Kit's Workspace policy mode and the Projects it is attached to. */
252
+ export type KitAssignmentRecord = {
253
+ /** As declared: an authored Kit's key or an installed Kit's source slug. */
254
+ readonly kit: string;
255
+ readonly workspace: 'default' | 'mandatory' | null;
256
+ readonly projects: readonly string[];
257
+ };
258
+ /** A Kit source the Marketplace offers the Workspace, its versions newest first. */
259
+ export type KitSourceOption = {
260
+ readonly id: string;
261
+ readonly slug: string;
262
+ /** Reviewed, approved, trusted and active, as installing requires. */
263
+ readonly installable: boolean;
264
+ readonly versions: readonly {
265
+ readonly id: string;
266
+ readonly version: string;
267
+ readonly installable: boolean;
268
+ /** The Kit that carries this version's content. */
269
+ readonly contentKitId?: string;
270
+ }[];
271
+ };
272
+ /** The live Kit records a deploy plan reads. */
273
+ export type KitSnapshot = {
274
+ readonly authored: RecordSnapshot<AuthoredKitRecord>;
275
+ readonly installations: RecordSnapshot<KitInstallationRecord>;
276
+ /** Unowned entries are keyed by the id of the Kit they assign. */
277
+ readonly assignments: RecordSnapshot<KitAssignmentRecord>;
278
+ readonly sources: readonly KitSourceOption[];
279
+ /** The Workspace's live installations. */
280
+ readonly installed: readonly KitInstallationRecord[];
281
+ readonly policyEnabled: boolean;
282
+ };
283
+ export type RecordSnapshot<V> = {
284
+ readonly owned: readonly OwnedRecord<V>[];
285
+ readonly unowned: readonly {
286
+ readonly id: string;
287
+ readonly value: V;
288
+ }[];
289
+ };
290
+ /** A record a Package owns; `history` runs oldest first and ends with the live value. */
291
+ export type OwnedRecord<V> = {
292
+ readonly key: string;
293
+ readonly id: string;
294
+ readonly deployed: V;
295
+ readonly history: readonly RecordChange<V>[];
296
+ };
297
+ export type PackageRecordKind = 'schedule' | 'kit' | 'kit_installation' | 'kit_assignment';
298
+ export type RecordDrift = {
299
+ readonly kind: PackageRecordKind;
300
+ readonly key: string;
301
+ readonly field: string;
302
+ /** As the Package last deployed it. */
303
+ readonly declared: JsonValue;
304
+ readonly live: JsonValue;
305
+ readonly changedBy?: NonNullable<RecordChange<JsonObject>['by']>;
306
+ readonly changedAt?: string;
307
+ };
308
+ export type PackagePlanConflict = {
309
+ readonly kind: 'id_taken';
310
+ readonly resource: 'loop' | 'agent';
311
+ readonly id: string;
312
+ /** The other Package in the layer that declares it. */
313
+ readonly package: string;
314
+ } | {
315
+ readonly kind: 'not_for_project';
316
+ readonly declaration: string;
317
+ } | {
318
+ readonly kind: 'schedule_project';
319
+ readonly key: string;
320
+ /** `missing` in a Workspace Package, `not_allowed` in a Project Package, `unknown` for no such Project. */
321
+ readonly problem: 'missing' | 'not_allowed' | 'unknown';
322
+ } | {
323
+ readonly kind: 'loop_unresolved';
324
+ readonly record: 'schedule';
325
+ readonly key: string;
326
+ readonly loop: string;
327
+ } | {
328
+ readonly kind: 'kit_unresolved';
329
+ /** An Agent's id, or a Kit assignment's key. */
330
+ readonly record: 'agent' | 'kit_assignment';
331
+ readonly key: string;
332
+ readonly kit: string;
333
+ } | {
334
+ readonly kind: 'kit_source';
335
+ readonly key: string;
336
+ readonly problem: 'unknown' | 'untrusted' | 'version_unknown';
337
+ } | {
338
+ readonly kind: 'kit_policy_disabled';
339
+ readonly key: string;
340
+ } | {
341
+ readonly kind: 'kit_project_unknown';
342
+ readonly key: string;
343
+ readonly project: string;
344
+ };
345
+ /** A Loop or Agent the deploy removes that a record outside the Package still names. */
346
+ export type PackagePlanWarning = {
347
+ readonly kind: 'still_named';
348
+ readonly resource: 'loop' | 'agent';
349
+ readonly id: string;
350
+ readonly record: string;
351
+ };
352
+ /** A plan with conflicts cannot deploy. */
353
+ export type PackagePlan = {
354
+ readonly loops: PackageChanges;
355
+ readonly agents: PackageChanges;
356
+ readonly schedules: PackageRecordChanges;
357
+ readonly kits: PackageRecordChanges;
358
+ readonly kitInstallations: PackageRecordChanges;
359
+ readonly kitAssignments: PackageRecordChanges;
360
+ readonly drift: readonly RecordDrift[];
361
+ readonly conflicts: readonly PackagePlanConflict[];
362
+ readonly warnings: readonly PackagePlanWarning[];
363
+ };
364
+ /** A Package's layer, and where it puts its Schedules. */
365
+ export type PackagePlanScope = {
366
+ readonly layer: 'project';
367
+ readonly projectId: string;
368
+ } | {
369
+ readonly layer: 'workspace';
370
+ /** The Workspace's Projects, by slug. */
371
+ readonly projects: ReadonlyMap<string, string>;
372
+ };
373
+ /** The Project a declared Schedule runs in, or why it has none. */
374
+ export declare const scheduleProject: (declaration: ScheduleDeclaration, scope: PackagePlanScope) => {
375
+ readonly projectId: string;
376
+ } | {
377
+ readonly problem: 'missing' | 'not_allowed' | 'unknown';
378
+ };
379
+ /** The live Schedule a declaration asks for. */
380
+ export declare const scheduleRecord: (declaration: ScheduleDeclaration, projectId: string) => ScheduleRecord;
381
+ /** The fields where a record's live value left what was deployed, each with the version that last changed it. */
382
+ export declare const recordDrift: (kind: RecordDrift['kind'], owned: OwnedRecord<JsonObject>) => RecordDrift[];
383
+ /** The live Kit an authored Kit declaration asks for; its key is its slug. */
384
+ export declare const authoredKitRecord: (key: string, declaration: AuthoredKitDeclaration) => AuthoredKitRecord;
385
+ /** The installation a declaration asks for, pinned to its version or the newest installable one. */
386
+ export declare const kitInstallationRecord: (declaration: KitInstallationDeclaration, sources: readonly KitSourceOption[]) => KitInstallationRecord | {
387
+ readonly problem: 'unknown' | 'untrusted' | 'version_unknown';
388
+ };
389
+ /** The assignment a declaration asks for, with its Projects' ids, or the first Project slug that names none. */
390
+ export declare const kitAssignmentRecord: (declaration: KitAssignmentDeclaration, projects: ReadonlyMap<string, string>) => KitAssignmentRecord | {
391
+ readonly unknownProject: string;
392
+ };
393
+ /**
394
+ * Compares a Package's current declarations with new ones. `others` are the other Packages in the same layer,
395
+ * `elsewhere` what the layers beneath it declare, and `otherDeclarations` the kinds the new version declares besides
396
+ * Loops, Agents and Schedules. `schedules` holds the Schedules the Package owns and, for adoption, those no Package owns;
397
+ * `outside` the records outside the Package that name a Loop or Agent.
398
+ */
399
+ export declare const planPackageDeploy: (input: {
400
+ readonly scope: PackagePlanScope;
401
+ readonly current?: PackageDeclarations;
402
+ readonly next: PackageDeclarations;
403
+ readonly otherDeclarations?: readonly string[];
404
+ readonly others: readonly {
405
+ readonly name: string;
406
+ readonly loops: readonly string[];
407
+ readonly agents: readonly string[];
408
+ }[];
409
+ readonly elsewhere?: {
410
+ readonly loops: readonly string[];
411
+ readonly agents: readonly string[];
412
+ };
413
+ readonly schedules?: {
414
+ readonly owned: readonly OwnedRecord<ScheduleRecord>[];
415
+ readonly unowned: readonly {
416
+ readonly id: string;
417
+ readonly value: ScheduleRecord;
418
+ }[];
419
+ };
420
+ readonly outside?: readonly {
421
+ readonly record: string;
422
+ readonly loop?: string;
423
+ readonly agent?: string;
424
+ }[];
425
+ readonly kits?: KitSnapshot;
426
+ }) => PackagePlan;
427
+ export {};