@kitman-sh/sdk 0.7.4 → 0.8.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 (79) hide show
  1. package/dist/build/index.js +10 -11
  2. package/dist/{chunk-p8v1smcg.js → chunk-160ww64c.js} +668 -185
  3. package/dist/{chunk-7jc5y0mj.js → chunk-36jhc745.js} +285 -83
  4. package/dist/loop/index.js +43 -1
  5. package/dist/program/index.js +7 -3
  6. package/package.json +3 -1
  7. package/types/packages/core/src/agent-capabilities.d.ts +68 -74
  8. package/types/packages/core/src/agent-environment.d.ts +26 -26
  9. package/types/packages/core/src/agent-launch-snapshot.d.ts +1 -1
  10. package/types/packages/core/src/agent-sandbox-policy.d.ts +15 -0
  11. package/types/packages/core/src/approval-queue.d.ts +4 -4
  12. package/types/packages/core/src/audit.d.ts +1 -1
  13. package/types/packages/core/src/change-delivery.d.ts +1 -1
  14. package/types/packages/core/src/change-request-review.d.ts +199 -7
  15. package/types/packages/core/src/change-request.d.ts +43 -12
  16. package/types/packages/core/src/connection.d.ts +1 -1
  17. package/types/packages/core/src/context-feedback.d.ts +8 -8
  18. package/types/packages/core/src/context-pack.d.ts +8 -8
  19. package/types/packages/core/src/crypto.d.ts +5 -0
  20. package/types/packages/core/src/data-lifecycle.d.ts +12 -12
  21. package/types/packages/core/src/decision.d.ts +2 -2
  22. package/types/packages/core/src/delivery-policy.d.ts +3 -3
  23. package/types/packages/core/src/enterprise-forge.d.ts +19 -0
  24. package/types/packages/core/src/epic-delivery.d.ts +1 -1
  25. package/types/packages/core/src/external-effect.d.ts +2 -2
  26. package/types/packages/core/src/global-search.d.ts +1 -1
  27. package/types/packages/core/src/index.d.ts +10 -2
  28. package/types/packages/core/src/integration.d.ts +58 -57
  29. package/types/packages/core/src/kit.d.ts +47 -47
  30. package/types/packages/core/src/live.d.ts +694 -781
  31. package/types/packages/core/src/loop-layers.d.ts +1 -1
  32. package/types/packages/core/src/loop-version.d.ts +1 -1
  33. package/types/packages/core/src/loop.d.ts +488 -86
  34. package/types/packages/core/src/marketplace.d.ts +127 -0
  35. package/types/packages/core/src/memory.d.ts +17 -12
  36. package/types/packages/core/src/my-teams.d.ts +238 -40
  37. package/types/packages/core/src/notification.d.ts +73 -12
  38. package/types/packages/core/src/owner.d.ts +15 -0
  39. package/types/packages/core/src/package-declarations.d.ts +97 -31
  40. package/types/packages/core/src/package.d.ts +22 -22
  41. package/types/packages/core/src/personal-development-profile.d.ts +2 -2
  42. package/types/packages/core/src/proposal.d.ts +25 -25
  43. package/types/packages/core/src/redaction.d.ts +2 -1
  44. package/types/packages/core/src/repo-binding.d.ts +19 -10
  45. package/types/packages/core/src/run-display.d.ts +12 -0
  46. package/types/packages/core/src/run-file.d.ts +190 -0
  47. package/types/packages/core/src/run-graph.d.ts +67 -0
  48. package/types/packages/core/src/run-launch.d.ts +7 -5
  49. package/types/packages/core/src/run.d.ts +9 -9
  50. package/types/packages/core/src/runner-eligibility.d.ts +4 -4
  51. package/types/packages/core/src/runner.d.ts +339 -111
  52. package/types/packages/core/src/schedule.d.ts +2 -2
  53. package/types/packages/core/src/scope-directory.d.ts +5 -5
  54. package/types/packages/core/src/secret.d.ts +9 -9
  55. package/types/packages/core/src/session.d.ts +2 -2
  56. package/types/packages/core/src/step-brief.d.ts +10 -3
  57. package/types/packages/core/src/storage.d.ts +49 -0
  58. package/types/packages/core/src/sync-kit.d.ts +25 -25
  59. package/types/packages/core/src/task-detail.d.ts +20 -13
  60. package/types/packages/core/src/task-execution-record.d.ts +6 -6
  61. package/types/packages/core/src/task.d.ts +52 -16
  62. package/types/packages/core/src/team-context.d.ts +33 -0
  63. package/types/packages/core/src/transcript.d.ts +230 -0
  64. package/types/packages/core/src/trigger-dispatch.d.ts +2 -2
  65. package/types/packages/core/src/trust-panel.d.ts +27 -0
  66. package/types/packages/core/src/work-unit.d.ts +44 -18
  67. package/types/packages/core/src/workspace.d.ts +77 -6
  68. package/types/packages/live/src/rpc/runner-client.d.ts +586 -15
  69. package/types/packages/live/src/rpc/runner-group.d.ts +597 -241
  70. package/types/packages/sdk/src/loop/activities.d.ts +208 -1
  71. package/types/packages/sdk/src/loop/config.d.ts +1 -1
  72. package/types/packages/sdk/src/loop/define.d.ts +8 -2
  73. package/types/packages/sdk/src/loop/plan.d.ts +2 -2
  74. package/types/packages/sdk/src/loop/steps.d.ts +2 -2
  75. package/types/packages/sdk/src/loop/test-loop.d.ts +6 -1
  76. package/types/packages/sdk/src/program/engine.d.ts +71 -3
  77. package/types/packages/sdk/src/program/host.d.ts +13 -1
  78. package/types/packages/core/src/enterprise-code-host.d.ts +0 -18
  79. package/types/packages/core/src/project.d.ts +0 -66
@@ -21,12 +21,30 @@ export declare const WriteBackRequest: Schema.Struct<{
21
21
  readonly milestone: Schema.optional<Schema.Literals<readonly ["started", "change_request_opened", "merged", "failed"]>>;
22
22
  readonly changeRequestUrl: Schema.optional<Schema.String>;
23
23
  }>;
24
+ /** A file kept on the Run, by id. */
25
+ export declare const RunFile: Schema.decodeTo<Schema.Struct<{
26
+ readonly id: Schema.String;
27
+ }>, Schema.Struct<{
28
+ readonly runFile: Schema.String;
29
+ }>, never, never>;
30
+ export type RunFile = typeof RunFile.Type;
31
+ /** A file the program wrote, by its path from the program's working directory. */
32
+ export declare const FileRequest: Schema.Struct<{
33
+ readonly path: Schema.String;
34
+ readonly caption: Schema.optional<Schema.String>;
35
+ }>;
24
36
  /** A document stored in Kitman with the Run, such as a plan, findings or a conclusion; later Runs retrieve it. */
25
37
  export declare const ArtifactRequest: Schema.Struct<{
26
38
  readonly kind: Schema.String;
27
39
  readonly title: Schema.String;
28
40
  readonly text: Schema.String;
29
41
  readonly data: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
42
+ /** Run Files the artifact shows. */
43
+ readonly files: Schema.optional<Schema.$Array<Schema.decodeTo<Schema.Struct<{
44
+ readonly id: Schema.String;
45
+ }>, Schema.Struct<{
46
+ readonly runFile: Schema.String;
47
+ }>, never, never>>>;
30
48
  }>;
31
49
  export declare const ArtifactResult: Schema.Struct<{
32
50
  readonly artifactId: Schema.String;
@@ -54,7 +72,7 @@ export declare const CreateTasksResult: Schema.Struct<{
54
72
  readonly taskId: Schema.String;
55
73
  }>>;
56
74
  }>;
57
- /** The Project's default RepoBinding when left out. */
75
+ /** The Team's default RepoBinding when left out. */
58
76
  export declare const IntegrationBranchRequest: Schema.Struct<{
59
77
  readonly repoBindingId: Schema.optional<Schema.String>;
60
78
  }>;
@@ -93,6 +111,112 @@ export declare const ReleaseResult: Schema.Struct<{
93
111
  readonly url: Schema.String;
94
112
  }>;
95
113
  export type ReleaseResult = typeof ReleaseResult.Type;
114
+ /** An entry of a Run's Transcript. */
115
+ export declare const TranscriptPoint: Schema.Struct<{
116
+ readonly runId: Schema.String;
117
+ readonly stepAttemptId: Schema.String;
118
+ readonly sequence: Schema.Int;
119
+ }>;
120
+ export type TranscriptPoint = typeof TranscriptPoint.Type;
121
+ export declare const TranscriptsRequest: Schema.Struct<{
122
+ readonly days: Schema.Int;
123
+ }>;
124
+ /** The Workspace's failed Runs of the window that the person the Run acts for may read, with their Transcripts. */
125
+ export declare const TranscriptsResult: Schema.Struct<{
126
+ readonly runs: Schema.$Array<Schema.Struct<{
127
+ readonly runId: Schema.String;
128
+ readonly loopId: Schema.String;
129
+ readonly teamId: Schema.optional<Schema.String>;
130
+ readonly failure: Schema.optional<Schema.String>;
131
+ readonly entries: Schema.$Array<Schema.Struct<{
132
+ readonly stepAttemptId: Schema.String;
133
+ readonly sequence: Schema.Int;
134
+ readonly kind: Schema.String;
135
+ readonly text: Schema.String;
136
+ }>>;
137
+ }>>;
138
+ }>;
139
+ export type TranscriptsResult = typeof TranscriptsResult.Type;
140
+ /** Memory for a Team, or a Task, for people to accept; it cites the Transcript points it came from. */
141
+ export declare const ProposeRequest: Schema.Union<readonly [Schema.Struct<{
142
+ readonly kind: Schema.Literal<"memory">;
143
+ readonly teamId: Schema.String;
144
+ readonly content: Schema.String;
145
+ readonly citations: Schema.NonEmptyArray<Schema.Struct<{
146
+ readonly runId: Schema.String;
147
+ readonly stepAttemptId: Schema.String;
148
+ readonly sequence: Schema.Int;
149
+ }>>;
150
+ }>, Schema.Struct<{
151
+ readonly kind: Schema.Literal<"task">;
152
+ readonly title: Schema.String;
153
+ readonly description: Schema.String;
154
+ /** The Team the approver is offered first. */
155
+ readonly teamId: Schema.optional<Schema.String>;
156
+ readonly citations: Schema.NonEmptyArray<Schema.Struct<{
157
+ readonly runId: Schema.String;
158
+ readonly stepAttemptId: Schema.String;
159
+ readonly sequence: Schema.Int;
160
+ }>>;
161
+ }>]>;
162
+ export type ProposeRequest = typeof ProposeRequest.Type;
163
+ export declare const ProposeResult: Schema.Struct<{
164
+ readonly kind: Schema.Literals<readonly ["memory", "task"]>;
165
+ readonly id: Schema.String;
166
+ }>;
167
+ export declare const ProjectActivityRequest: Schema.Struct<{
168
+ readonly projectId: Schema.String;
169
+ }>;
170
+ /**
171
+ * A Project's Runs and Task changes since its latest Update, as the person the Run acts for may read them: a Run's
172
+ * Transcript entries only where that person may read its repositories.
173
+ */
174
+ export declare const ProjectActivityResult: Schema.Struct<{
175
+ readonly project: Schema.Struct<{
176
+ readonly id: Schema.String;
177
+ readonly name: Schema.String;
178
+ }>;
179
+ /** The latest Update's health; left out while the Project has none. */
180
+ readonly health: Schema.optional<Schema.Literals<readonly ["on_track", "at_risk", "off_track"]>>;
181
+ /** When the latest Update was posted; left out while there is none. */
182
+ readonly since: Schema.optional<Schema.String>;
183
+ readonly runs: Schema.$Array<Schema.Struct<{
184
+ readonly runId: Schema.String;
185
+ readonly loopId: Schema.String;
186
+ readonly status: Schema.String;
187
+ readonly taskKey: Schema.optional<Schema.String>;
188
+ readonly taskTitle: Schema.optional<Schema.String>;
189
+ readonly summary: Schema.optional<Schema.String>;
190
+ readonly entries: Schema.$Array<Schema.Struct<{
191
+ readonly stepAttemptId: Schema.String;
192
+ readonly sequence: Schema.Int;
193
+ readonly kind: Schema.String;
194
+ readonly text: Schema.String;
195
+ }>>;
196
+ }>>;
197
+ readonly taskChanges: Schema.$Array<Schema.Struct<{
198
+ readonly taskKey: Schema.String;
199
+ readonly title: Schema.String;
200
+ readonly change: Schema.String;
201
+ readonly at: Schema.String;
202
+ }>>;
203
+ }>;
204
+ export type ProjectActivityResult = typeof ProjectActivityResult.Type;
205
+ /** A draft Project Update for the person the Run acts for, who reviews and posts it. */
206
+ export declare const DraftUpdateRequest: Schema.Struct<{
207
+ readonly projectId: Schema.String;
208
+ readonly health: Schema.Literals<readonly ["on_track", "at_risk", "off_track"]>;
209
+ readonly note: Schema.String;
210
+ readonly writtenFrom: Schema.Struct<{
211
+ readonly runs: Schema.Int;
212
+ readonly taskChanges: Schema.Int;
213
+ readonly since: Schema.optional<Schema.String>;
214
+ }>;
215
+ }>;
216
+ export type DraftUpdateRequest = typeof DraftUpdateRequest.Type;
217
+ export declare const DraftUpdateResult: Schema.Struct<{
218
+ readonly id: Schema.String;
219
+ }>;
96
220
  declare const ChangeRequestActivity_base: Context.ServiceClass<ChangeRequestActivity, "@kitman-sh/sdk/loop/ChangeRequestActivity", {
97
221
  /** A Run has one ChangeRequest: it opens once, and a later Step updates it. */
98
222
  readonly run: (request: typeof ChangeRequestRequest.Type, step: string) => Effect.Effect<ChangeRequestResult, StepFailed>;
@@ -113,6 +237,12 @@ declare const ArtifactActivity_base: Context.ServiceClass<ArtifactActivity, "@ki
113
237
  /** Stores a Run artifact in Kitman, indexed for later Runs' ContextPacks and search. */
114
238
  export declare class ArtifactActivity extends ArtifactActivity_base {
115
239
  }
240
+ declare const FileActivity_base: Context.ServiceClass<FileActivity, "@kitman-sh/sdk/loop/FileActivity", {
241
+ readonly run: (request: typeof FileRequest.Type, step: string) => Effect.Effect<RunFile, StepFailed>;
242
+ }>;
243
+ /** Keeps a file on the Run, counted against the Workspace's storage. */
244
+ export declare class FileActivity extends FileActivity_base {
245
+ }
116
246
  declare const NoteActivity_base: Context.ServiceClass<NoteActivity, "@kitman-sh/sdk/loop/NoteActivity", {
117
247
  readonly run: (request: typeof NoteRequest.Type, step: string) => Effect.Effect<void, StepFailed>;
118
248
  }>;
@@ -150,6 +280,30 @@ declare const ReleaseActivity_base: Context.ServiceClass<ReleaseActivity, "@kitm
150
280
  /** Tags and publishes a release on the Run's repository through the external-effect ledger; a Step releases once. */
151
281
  export declare class ReleaseActivity extends ReleaseActivity_base {
152
282
  }
283
+ declare const TranscriptsActivity_base: Context.ServiceClass<TranscriptsActivity, "@kitman-sh/sdk/loop/TranscriptsActivity", {
284
+ readonly run: (request: typeof TranscriptsRequest.Type, step: string) => Effect.Effect<TranscriptsResult, StepFailed>;
285
+ }>;
286
+ /** Reads Transcripts through the Transcript access rule, as the person the Run acts for. */
287
+ export declare class TranscriptsActivity extends TranscriptsActivity_base {
288
+ }
289
+ declare const ProposeActivity_base: Context.ServiceClass<ProposeActivity, "@kitman-sh/sdk/loop/ProposeActivity", {
290
+ readonly run: (request: ProposeRequest, step: string) => Effect.Effect<typeof ProposeResult.Type, StepFailed>;
291
+ }>;
292
+ /** Proposes Memory or a Task; a Step proposes once. */
293
+ export declare class ProposeActivity extends ProposeActivity_base {
294
+ }
295
+ declare const ProjectActivityActivity_base: Context.ServiceClass<ProjectActivityActivity, "@kitman-sh/sdk/loop/ProjectActivityActivity", {
296
+ readonly run: (request: typeof ProjectActivityRequest.Type, step: string) => Effect.Effect<ProjectActivityResult, StepFailed>;
297
+ }>;
298
+ /** Reads a Project's activity since its latest Update, as the person the Run acts for. */
299
+ export declare class ProjectActivityActivity extends ProjectActivityActivity_base {
300
+ }
301
+ declare const DraftUpdateActivity_base: Context.ServiceClass<DraftUpdateActivity, "@kitman-sh/sdk/loop/DraftUpdateActivity", {
302
+ readonly run: (request: DraftUpdateRequest, step: string) => Effect.Effect<typeof DraftUpdateResult.Type, StepFailed>;
303
+ }>;
304
+ /** Drafts a Project Update for the person the Run acts for; a Run drafts once. Nothing a Loop calls posts one. */
305
+ export declare class DraftUpdateActivity extends DraftUpdateActivity_base {
306
+ }
153
307
  export declare const changeRequest: (name: string, request: typeof ChangeRequestRequest.Type) => Effect.Effect<{
154
308
  readonly id: string;
155
309
  readonly number: string;
@@ -159,6 +313,10 @@ export declare const writeBack: (name: string, request: typeof WriteBackRequest.
159
313
  export declare const artifact: (name: string, request: typeof ArtifactRequest.Type) => Effect.Effect<{
160
314
  readonly artifactId: string;
161
315
  }, import("./steps").CapabilityDenied | import("./steps").DuplicateStep | StepFailed, ArtifactActivity | import("./steps").LoopRun | import("effect/workflow/WorkflowEngine").WorkflowEngine | import("effect/workflow/WorkflowEngine").WorkflowInstance>;
316
+ /** The file is uploaded once; a replay returns the Run File it kept. */
317
+ export declare const file: (name: string, request: typeof FileRequest.Type) => Effect.Effect<{
318
+ readonly id: string;
319
+ }, import("./steps").CapabilityDenied | import("./steps").DuplicateStep | StepFailed, FileActivity | import("./steps").LoopRun | import("effect/workflow/WorkflowEngine").WorkflowEngine | import("effect/workflow/WorkflowEngine").WorkflowInstance>;
162
320
  export declare const note: (name: string, request: typeof NoteRequest.Type) => Effect.Effect<void, import("./steps").CapabilityDenied | import("./steps").DuplicateStep | StepFailed, import("./steps").LoopRun | NoteActivity | import("effect/workflow/WorkflowEngine").WorkflowEngine | import("effect/workflow/WorkflowEngine").WorkflowInstance>;
163
321
  export declare const comment: (name: string, request: typeof CommentRequest.Type) => Effect.Effect<void, import("./steps").CapabilityDenied | import("./steps").DuplicateStep | StepFailed, CommentActivity | import("./steps").LoopRun | import("effect/workflow/WorkflowEngine").WorkflowEngine | import("effect/workflow/WorkflowEngine").WorkflowInstance>;
164
322
  export declare const createTasks: (name: string, request: typeof CreateTasksRequest.Type) => Effect.Effect<{
@@ -184,4 +342,53 @@ export declare const release: (name: string, request: typeof ReleaseRequest.Type
184
342
  readonly revision: string;
185
343
  readonly url: string;
186
344
  }, import("./steps").CapabilityDenied | import("./steps").DuplicateStep | StepFailed, import("./steps").LoopRun | ReleaseActivity | import("effect/workflow/WorkflowEngine").WorkflowEngine | import("effect/workflow/WorkflowEngine").WorkflowInstance>;
345
+ export declare const transcripts: (name: string, request: typeof TranscriptsRequest.Type) => Effect.Effect<{
346
+ readonly runs: readonly {
347
+ readonly runId: string;
348
+ readonly loopId: string;
349
+ readonly teamId?: string | undefined;
350
+ readonly failure?: string | undefined;
351
+ readonly entries: readonly {
352
+ readonly stepAttemptId: string;
353
+ readonly sequence: number;
354
+ readonly kind: string;
355
+ readonly text: string;
356
+ }[];
357
+ }[];
358
+ }, import("./steps").CapabilityDenied | import("./steps").DuplicateStep | StepFailed, import("./steps").LoopRun | TranscriptsActivity | import("effect/workflow/WorkflowEngine").WorkflowEngine | import("effect/workflow/WorkflowEngine").WorkflowInstance>;
359
+ export declare const propose: (name: string, request: ProposeRequest) => Effect.Effect<{
360
+ readonly kind: "memory" | "task";
361
+ readonly id: string;
362
+ }, import("./steps").CapabilityDenied | import("./steps").DuplicateStep | StepFailed, import("./steps").LoopRun | ProposeActivity | import("effect/workflow/WorkflowEngine").WorkflowEngine | import("effect/workflow/WorkflowEngine").WorkflowInstance>;
363
+ export declare const projectActivity: (name: string, request: typeof ProjectActivityRequest.Type) => Effect.Effect<{
364
+ readonly project: {
365
+ readonly id: string;
366
+ readonly name: string;
367
+ };
368
+ readonly health?: "at_risk" | "off_track" | "on_track" | undefined;
369
+ readonly since?: string | undefined;
370
+ readonly runs: readonly {
371
+ readonly runId: string;
372
+ readonly loopId: string;
373
+ readonly status: string;
374
+ readonly taskKey?: string | undefined;
375
+ readonly taskTitle?: string | undefined;
376
+ readonly summary?: string | undefined;
377
+ readonly entries: readonly {
378
+ readonly stepAttemptId: string;
379
+ readonly sequence: number;
380
+ readonly kind: string;
381
+ readonly text: string;
382
+ }[];
383
+ }[];
384
+ readonly taskChanges: readonly {
385
+ readonly taskKey: string;
386
+ readonly title: string;
387
+ readonly change: string;
388
+ readonly at: string;
389
+ }[];
390
+ }, import("./steps").CapabilityDenied | import("./steps").DuplicateStep | StepFailed, import("./steps").LoopRun | ProjectActivityActivity | import("effect/workflow/WorkflowEngine").WorkflowEngine | import("effect/workflow/WorkflowEngine").WorkflowInstance>;
391
+ export declare const draftUpdate: (name: string, request: DraftUpdateRequest) => Effect.Effect<{
392
+ readonly id: string;
393
+ }, import("./steps").CapabilityDenied | import("./steps").DuplicateStep | StepFailed, DraftUpdateActivity | import("./steps").LoopRun | import("effect/workflow/WorkflowEngine").WorkflowEngine | import("effect/workflow/WorkflowEngine").WorkflowInstance>;
187
394
  export {};
@@ -18,7 +18,7 @@ export type AgentConfig = {
18
18
  readonly network?: {
19
19
  readonly hosts: readonly string[];
20
20
  } | 'open';
21
- /** Runs its Steps only on Runners that run agents in docker, for services or a project image. */
21
+ /** Runs its Steps only on Runners that run agents in docker, for services or a team image. */
22
22
  readonly sandbox?: 'docker';
23
23
  };
24
24
  /** A Kit written from the Package's files: its context, and skill directories each holding a `SKILL.md`. */
@@ -1,10 +1,11 @@
1
1
  import { LoopCapabilities, type LoopManifest } from '../../../core/src/package-declarations';
2
+ import type { ScheduleRule } from '../../../core/src/schedule';
2
3
  import * as Effect from 'effect/Effect';
3
4
  import * as Schema from 'effect/Schema';
4
5
  import type { WorkflowEngine } from 'effect/workflow';
5
6
  import type { LoopHost, LoopRun } from './steps';
6
7
  import type { LoopCheck } from './test-loop';
7
- import type { ArtifactActivity, ChangeRequestActivity, CommentActivity, CreateTasksActivity, IntegrationBranchActivity, MergeChangeRequestActivity, NoteActivity, ReleaseActivity, WriteBackActivity } from './activities';
8
+ import type { ArtifactActivity, ChangeRequestActivity, CommentActivity, CreateTasksActivity, FileActivity, IntegrationBranchActivity, MergeChangeRequestActivity, NoteActivity, ProjectActivityActivity, DraftUpdateActivity, ProposeActivity, ReleaseActivity, TranscriptsActivity, WriteBackActivity } from './activities';
8
9
  export { LoopCapabilities, type LoopManifest };
9
10
  /** What a Loop's program may ask Kitman for; the control plane checks each request against them. */
10
11
  export type LoopCapability = (typeof LoopCapabilities)[number];
@@ -31,7 +32,7 @@ export type LoopOffer = {
31
32
  readonly loop: string;
32
33
  };
33
34
  /** The services a Loop's program runs with; a Runner or `testLoop` provides them. */
34
- export type LoopServices = LoopRun | LoopHost | ChangeRequestActivity | WriteBackActivity | ArtifactActivity | NoteActivity | CommentActivity | CreateTasksActivity | IntegrationBranchActivity | MergeChangeRequestActivity | ReleaseActivity | WorkflowEngine.WorkflowEngine | WorkflowEngine.WorkflowInstance;
35
+ export type LoopServices = LoopRun | LoopHost | ChangeRequestActivity | WriteBackActivity | ArtifactActivity | FileActivity | NoteActivity | CommentActivity | CreateTasksActivity | IntegrationBranchActivity | MergeChangeRequestActivity | ReleaseActivity | TranscriptsActivity | ProposeActivity | ProjectActivityActivity | DraftUpdateActivity | WorkflowEngine.WorkflowEngine | WorkflowEngine.WorkflowInstance;
35
36
  /** A schema a Loop can decode and encode with no services. */
36
37
  export type LoopSchema<T> = Schema.Codec<T, unknown>;
37
38
  export type LoopDefinition<In, Out, E> = {
@@ -57,6 +58,11 @@ export type LoopDefinition<In, Out, E> = {
57
58
  readonly network?: {
58
59
  readonly hosts: readonly string[];
59
60
  } | 'open';
61
+ /** A Schedule a Workspace can turn on in one click; off until someone does. */
62
+ readonly schedule?: {
63
+ readonly rule: ScheduleRule;
64
+ readonly timezone: string;
65
+ };
60
66
  readonly run: (input: In) => Effect.Effect<Out, E, LoopServices>;
61
67
  /** Scripts a build runs twice, the second time from the journal; not part of the manifest. */
62
68
  readonly checks?: readonly LoopCheck[];
@@ -7,7 +7,7 @@ export declare const PlanTicket: Schema.Struct<{
7
7
  readonly title: Schema.String;
8
8
  readonly body: Schema.String;
9
9
  readonly acceptanceCriteria: Schema.$Array<Schema.String>;
10
- /** The repository it changes; the Project's default when left out. */
10
+ /** The repository it changes; the Team's default when left out. */
11
11
  readonly repoBindingId: Schema.optional<Schema.String>;
12
12
  /** Keys of the tickets that must be built first. */
13
13
  readonly blockedBy: Schema.$Array<Schema.String>;
@@ -22,7 +22,7 @@ export declare const PlanTickets: Schema.$Array<Schema.Struct<{
22
22
  readonly title: Schema.String;
23
23
  readonly body: Schema.String;
24
24
  readonly acceptanceCriteria: Schema.$Array<Schema.String>;
25
- /** The repository it changes; the Project's default when left out. */
25
+ /** The repository it changes; the Team's default when left out. */
26
26
  readonly repoBindingId: Schema.optional<Schema.String>;
27
27
  /** Keys of the tickets that must be built first. */
28
28
  readonly blockedBy: Schema.$Array<Schema.String>;
@@ -41,7 +41,7 @@ export declare class ChildFailed extends ChildFailed_base {
41
41
  }
42
42
  declare const CapabilityDenied_base: Schema.Class<CapabilityDenied, Schema.TaggedStruct<"CapabilityDenied", {
43
43
  readonly step: Schema.String;
44
- readonly capability: Schema.Literals<readonly ["agent_work", "ask", "call", "verify", "change_request", "write_back", "post_comment", "create_tasks", "merge_change_request", "publish_release"]>;
44
+ readonly capability: 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"]>;
45
45
  /** A Secret the Step names that its Loop does not declare. */
46
46
  readonly secret: Schema.optionalKey<Schema.String>;
47
47
  }>, Cause.YieldableError>;
@@ -64,7 +64,7 @@ export declare const LoopEvent: Schema.Struct<{
64
64
  readonly payload: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
65
65
  }>;
66
66
  export type LoopEvent = typeof LoopEvent.Type;
67
- export type StepKind = 'agent_work' | 'ask' | 'call' | 'wait_for' | 'verify' | 'change_request' | 'write_back' | 'artifact' | 'note' | 'comment' | 'create_tasks' | 'integration_branch' | 'merge_change_request' | 'release';
67
+ export type StepKind = 'agent_work' | 'ask' | 'call' | 'wait_for' | 'verify' | 'change_request' | 'write_back' | 'artifact' | 'file' | 'note' | 'comment' | 'create_tasks' | 'integration_branch' | 'merge_change_request' | 'release' | 'transcripts' | 'propose' | 'project_activity' | 'draft_update';
68
68
  /** A Step a Run took, as its program saw it. */
69
69
  export type StepRecord = {
70
70
  readonly name: string;
@@ -2,7 +2,7 @@ import * as Effect from 'effect/Effect';
2
2
  import * as Exit from 'effect/Exit';
3
3
  import * as Schema from 'effect/Schema';
4
4
  import { Workflow, WorkflowEngine } from 'effect/workflow';
5
- import { ArtifactActivity, ChangeRequestActivity, CommentActivity, CreateTasksActivity, IntegrationBranchActivity, MergeChangeRequestActivity, NoteActivity, ReleaseActivity, WriteBackActivity } from './activities';
5
+ import { ArtifactActivity, ChangeRequestActivity, CommentActivity, CreateTasksActivity, FileActivity, IntegrationBranchActivity, MergeChangeRequestActivity, NoteActivity, ProjectActivityActivity, DraftUpdateActivity, ProposeActivity, ReleaseActivity, TranscriptsActivity, WriteBackActivity } from './activities';
6
6
  import type { LoopCapability, LoopDefinition } from './define';
7
7
  import type { VerifyResult } from './evidence';
8
8
  import { InputInvalid, LoopHost, LoopRun, type LoopEvent, type StepRecord } from './steps';
@@ -26,12 +26,17 @@ export type HostActivities = {
26
26
  readonly changeRequest: ChangeRequestActivity['Service'];
27
27
  readonly writeBack: WriteBackActivity['Service'];
28
28
  readonly artifact: ArtifactActivity['Service'];
29
+ readonly file: FileActivity['Service'];
29
30
  readonly note: NoteActivity['Service'];
30
31
  readonly comment: CommentActivity['Service'];
31
32
  readonly createTasks: CreateTasksActivity['Service'];
32
33
  readonly integrationBranch: IntegrationBranchActivity['Service'];
33
34
  readonly mergeChangeRequest: MergeChangeRequestActivity['Service'];
34
35
  readonly release: ReleaseActivity['Service'];
36
+ readonly transcripts: TranscriptsActivity['Service'];
37
+ readonly propose: ProposeActivity['Service'];
38
+ readonly projectActivity: ProjectActivityActivity['Service'];
39
+ readonly draftUpdate: DraftUpdateActivity['Service'];
35
40
  };
36
41
  export type TestLoopScript = {
37
42
  /** The Loop Input as JSON, as a Run receives it. */
@@ -1,8 +1,10 @@
1
- import { type OrchestrationWorkUnit, type ProgramWorkUnit } from '../../../core/src/index';
2
- import { type ChangeRequestResult, type EventFilter, type IntegrationBranch, type LoopDefinition, type MergeResult, type ReleaseResult, type PlanTicket, type WriteBackMilestones, type SuggestedVerification } from '../loop';
1
+ import { type OrchestrationWorkUnit, type ProgramWorkUnit, type RunFilePartUrl, type RunFileRecord, type RunFileUpload } from '../../../core/src/index';
2
+ import { type ChangeRequestResult, type EventFilter, type IntegrationBranch, type LoopDefinition, type MergeResult, type ReleaseResult, type PlanTicket, type ProposeRequest, type TranscriptsResult, type DraftUpdateRequest, type ProjectActivityResult, type WriteBackMilestones, type SuggestedVerification } from '../loop';
3
3
  import * as Cause from 'effect/Cause';
4
4
  import * as Effect from 'effect/Effect';
5
+ import * as FileSystem from 'effect/FileSystem';
5
6
  import * as Schema from 'effect/Schema';
7
+ import * as HttpClient from 'effect/http/HttpClient';
6
8
  import { type ProgramLease } from '../../../live/src/rpc/runner-group';
7
9
  import type { RunnerRpcClient } from '../../../live/src/rpc/runner-client';
8
10
  type WriteBackMilestone = (typeof WriteBackMilestones)[number];
@@ -71,9 +73,32 @@ export type ProgramJournal = {
71
73
  readonly title: string;
72
74
  readonly text: string;
73
75
  readonly data?: Schema.Json | undefined;
76
+ readonly fileIds?: readonly string[];
74
77
  }) => Effect.Effect<{
75
78
  readonly artifactId: string;
76
79
  }, Error>;
80
+ readonly createRunFile: (file: {
81
+ readonly step: string;
82
+ readonly name: string;
83
+ readonly caption?: string;
84
+ readonly contentType: string;
85
+ readonly byteSize: number;
86
+ readonly sha256: string;
87
+ }) => Effect.Effect<{
88
+ readonly file: RunFileRecord;
89
+ readonly upload?: RunFileUpload | undefined;
90
+ }, Error>;
91
+ readonly runFileParts: (request: {
92
+ readonly fileId: string;
93
+ readonly partNumbers: readonly number[];
94
+ }) => Effect.Effect<readonly (typeof RunFilePartUrl.Type)[], Error>;
95
+ readonly completeRunFile: (request: {
96
+ readonly fileId: string;
97
+ readonly parts?: readonly {
98
+ readonly partNumber: number;
99
+ readonly etag: string;
100
+ }[];
101
+ }) => Effect.Effect<RunFileRecord, Error>;
77
102
  readonly recordNote: (note: {
78
103
  readonly step: string;
79
104
  readonly text: string;
@@ -100,6 +125,26 @@ export type ProgramJournal = {
100
125
  readonly key: string;
101
126
  readonly taskId: string;
102
127
  }[], Error>;
128
+ readonly readTranscripts: (request: {
129
+ readonly step: string;
130
+ readonly days: number;
131
+ }) => Effect.Effect<TranscriptsResult, Error>;
132
+ readonly propose: (request: {
133
+ readonly step: string;
134
+ readonly proposal: ProposeRequest;
135
+ }) => Effect.Effect<{
136
+ readonly kind: 'memory' | 'task';
137
+ readonly id: string;
138
+ }, Error>;
139
+ readonly readProject: (request: {
140
+ readonly step: string;
141
+ readonly projectId: string;
142
+ }) => Effect.Effect<ProjectActivityResult, Error>;
143
+ readonly draftUpdate: (request: DraftUpdateRequest & {
144
+ readonly step: string;
145
+ }) => Effect.Effect<{
146
+ readonly id: string;
147
+ }, Error>;
103
148
  readonly integrationBranch: (repoBindingId?: string) => Effect.Effect<IntegrationBranch, Error>;
104
149
  readonly mergeChangeRequest: (request: {
105
150
  readonly step: string;
@@ -132,13 +177,36 @@ export declare class JournalWriteFailed extends JournalWriteFailed_base<{
132
177
  }
133
178
  /** A refusal of the request itself, as opposed to a lost lease or a failure of Kitman's. */
134
179
  export declare const refusedStep: (cause: Error) => boolean;
180
+ /** What uploading a Run File asks of Kitman, under whichever lease its maker holds. */
181
+ export type RunFileClient = Pick<ProgramJournal, 'createRunFile' | 'runFileParts' | 'completeRunFile'>;
182
+ type FileServices = FileSystem.FileSystem | HttpClient.HttpClient;
183
+ /** Hashes the file at `path`, uploads it straight to storage and completes it; its status says whether Kitman kept it. */
184
+ export declare const uploadRunFile: (files: RunFileClient, file: {
185
+ readonly step: string;
186
+ readonly name: string;
187
+ readonly path: string;
188
+ readonly caption?: string | undefined;
189
+ }) => Effect.Effect<{
190
+ readonly id: string;
191
+ readonly runId: string;
192
+ readonly step: string;
193
+ readonly name: string;
194
+ readonly caption?: string;
195
+ readonly contentType: string;
196
+ readonly kind: "html" | "image" | "other" | "text" | "video";
197
+ readonly byteSize: number;
198
+ readonly sha256: string;
199
+ readonly status: "available" | "expired" | "refused" | "rejected" | "removed" | "removing" | "uploading";
200
+ }, Error | import("effect/http/HttpClientError").HttpClientError | import("effect/PlatformError").PlatformError, FileSystem.FileSystem | HttpClient.HttpClient>;
135
201
  /**
136
202
  * Runs or replays a Run's program for one orchestration lease, and reports what became of it: suspended, with the
137
203
  * lease given back; completed; or failed. A refused journal write means the lease is gone, so nothing is reported.
138
204
  */
139
- export declare const runProgram: <In, Out, E>(loop: LoopDefinition<In, Out, E>, work: ProgramWorkUnit, journal: ProgramJournal) => Effect.Effect<'suspended' | 'completed' | 'failed', JournalWriteFailed>;
205
+ export declare const runProgram: <In, Out, E>(loop: LoopDefinition<In, Out, E>, work: ProgramWorkUnit, journal: ProgramJournal) => Effect.Effect<'suspended' | 'completed' | 'failed', JournalWriteFailed, FileServices>;
140
206
  /** A Work Unit's lease as the Runner RPC calls carry it. */
141
207
  export declare const programLease: (work: Pick<OrchestrationWorkUnit, 'id' | 'lease'>) => ProgramLease;
208
+ /** Run File uploads over the Runner RPC channel, under `lease`. */
209
+ export declare const rpcRunFiles: (rpc: Pick<RunnerRpcClient, 'createRunFile' | 'runFileParts' | 'completeRunFile'>, lease: ProgramLease) => RunFileClient;
142
210
  /** The journal over the Runner RPC channel, each write under the Work Unit's lease. */
143
211
  export declare const rpcProgramJournal: (rpc: RunnerRpcClient, work: ProgramWorkUnit) => ProgramJournal;
144
212
  export {};
@@ -27,11 +27,23 @@ export declare const Described: Schema.Union<readonly [Schema.TaggedStruct<"Desc
27
27
  readonly title: Schema.String;
28
28
  readonly loop: Schema.String;
29
29
  }>>;
30
- 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"]>>;
30
+ 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"]>>;
31
31
  readonly secrets: Schema.optionalKey<Schema.$Array<Schema.String>>;
32
32
  readonly network: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
33
33
  readonly hosts: Schema.$Array<Schema.String>;
34
34
  }>, Schema.Literal<"open">]>>;
35
+ readonly schedule: Schema.optionalKey<Schema.Struct<{
36
+ readonly rule: Schema.Union<readonly [Schema.Struct<{
37
+ readonly frequency: Schema.Literals<readonly ["daily", "weekly"]>;
38
+ readonly hour: Schema.Int;
39
+ readonly minute: Schema.Int;
40
+ readonly second: Schema.optionalKey<Schema.Int>;
41
+ readonly daysOfWeek: Schema.optionalKey<Schema.$Array<Schema.Int>>;
42
+ }>, Schema.Struct<{
43
+ readonly cron: Schema.String;
44
+ }>]>;
45
+ readonly timezone: Schema.String;
46
+ }>>;
35
47
  }>>;
36
48
  readonly agents: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
37
49
  readonly schedules: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
@@ -1,18 +0,0 @@
1
- import { type CodeHostCapability } from './integration';
2
- type EnterpriseCodeHostSetup = {
3
- readonly provider: 'github' | 'gitlab';
4
- readonly host: string;
5
- readonly tls?: {
6
- readonly customCaRef?: string;
7
- };
8
- readonly capabilities: readonly CodeHostCapability[];
9
- };
10
- type EnterpriseSupportEvidence = {
11
- readonly provider: 'github' | 'gitlab';
12
- readonly host: string;
13
- readonly capability: CodeHostCapability;
14
- readonly support: 'certified' | 'detected' | 'unsupported';
15
- readonly evidenceDigest: string;
16
- };
17
- export declare function certifyEnterpriseCodeHostSetup(setup: EnterpriseCodeHostSetup): readonly EnterpriseSupportEvidence[];
18
- export {};
@@ -1,66 +0,0 @@
1
- import * as Schema from 'effect/Schema';
2
- export declare const ProjectDeliverySettings: Schema.Struct<{
3
- readonly defaultRepoBindingId: Schema.optionalKey<Schema.String>;
4
- readonly standardBranchTemplate: Schema.String;
5
- readonly epicBranchTemplate: Schema.String;
6
- readonly isolatedChildBranchTemplate: Schema.String;
7
- readonly revision: Schema.Int;
8
- }>;
9
- export declare const ProjectDeliverySettingsUpdate: Schema.Struct<{
10
- readonly defaultRepoBindingId: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null]>>;
11
- readonly standardBranchTemplate: Schema.optionalKey<Schema.String>;
12
- readonly epicBranchTemplate: Schema.optionalKey<Schema.String>;
13
- readonly isolatedChildBranchTemplate: Schema.optionalKey<Schema.String>;
14
- readonly expectedRevision: Schema.Int;
15
- }>;
16
- export declare const ProjectDirectoryItem: Schema.Struct<{
17
- readonly id: Schema.String;
18
- readonly workspaceId: Schema.String;
19
- readonly name: Schema.String;
20
- readonly slug: Schema.String;
21
- readonly description: Schema.optionalKey<Schema.String>;
22
- readonly sourceType: Schema.Literal<"manual">;
23
- readonly openTaskCount: Schema.Int;
24
- readonly blockedTaskCount: Schema.Int;
25
- readonly createdAt: Schema.String;
26
- readonly updatedAt: Schema.String;
27
- }>;
28
- export declare const Project: Schema.Struct<{
29
- readonly id: Schema.String;
30
- readonly workspaceId: Schema.String;
31
- readonly name: Schema.String;
32
- readonly slug: Schema.String;
33
- readonly description: Schema.optionalKey<Schema.String>;
34
- readonly sourceType: Schema.Literal<"manual">;
35
- readonly openTaskCount: Schema.Int;
36
- readonly blockedTaskCount: Schema.Int;
37
- readonly createdAt: Schema.String;
38
- readonly updatedAt: Schema.String;
39
- readonly defaultStatusMapping: Schema.$Record<Schema.String, Schema.String>;
40
- }>;
41
- export declare const ProjectCreate: Schema.Struct<{
42
- readonly name: Schema.String;
43
- readonly slug: Schema.optionalKey<Schema.String>;
44
- readonly description: Schema.optionalKey<Schema.String>;
45
- readonly sourceType: Schema.optionalKey<Schema.Literal<"manual">>;
46
- }>;
47
- export declare const ProjectList: Schema.Struct<{
48
- readonly items: Schema.$Array<Schema.Struct<{
49
- readonly id: Schema.String;
50
- readonly workspaceId: Schema.String;
51
- readonly name: Schema.String;
52
- readonly slug: Schema.String;
53
- readonly description: Schema.optionalKey<Schema.String>;
54
- readonly sourceType: Schema.Literal<"manual">;
55
- readonly openTaskCount: Schema.Int;
56
- readonly blockedTaskCount: Schema.Int;
57
- readonly createdAt: Schema.String;
58
- readonly updatedAt: Schema.String;
59
- }>>;
60
- }>;
61
- export type Project = (typeof Project)['Type'];
62
- export type ProjectDirectoryItem = (typeof ProjectDirectoryItem)['Type'];
63
- export type ProjectCreate = (typeof ProjectCreate)['Type'];
64
- export type ProjectList = (typeof ProjectList)['Type'];
65
- export type ProjectDeliverySettings = (typeof ProjectDeliverySettings)['Type'];
66
- export type ProjectDeliverySettingsUpdate = (typeof ProjectDeliverySettingsUpdate)['Type'];