@kitman-sh/sdk 0.10.82 → 0.10.83

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 +2 -2
  2. package/dist/{chunk-fc5r66fq.js → chunk-3pz068kn.js} +11 -5
  3. package/dist/{chunk-0f530caz.js → chunk-cqknxyv9.js} +88 -47
  4. package/dist/loop/index.js +7 -1
  5. package/dist/program/index.js +2 -2
  6. package/package.json +1 -1
  7. package/types/packages/core/src/a2a.d.ts +577 -0
  8. package/types/packages/core/src/agent-capabilities.d.ts +1434 -0
  9. package/types/packages/core/src/agent-launch-snapshot.d.ts +44 -0
  10. package/types/packages/core/src/approval-queue.d.ts +126 -0
  11. package/types/packages/core/src/audit.d.ts +52 -0
  12. package/types/packages/core/src/change-delivery.d.ts +39 -0
  13. package/types/packages/core/src/change-request-review.d.ts +361 -0
  14. package/types/packages/core/src/change-request.d.ts +288 -0
  15. package/types/packages/core/src/connection.d.ts +33 -0
  16. package/types/packages/core/src/context-feedback.d.ts +89 -0
  17. package/types/packages/core/src/data-lifecycle.d.ts +195 -0
  18. package/types/packages/core/src/decision.d.ts +48 -0
  19. package/types/packages/core/src/delivery-operation.d.ts +125 -0
  20. package/types/packages/core/src/delivery-policy.d.ts +174 -0
  21. package/types/packages/core/src/enterprise-forge.d.ts +19 -0
  22. package/types/packages/core/src/epic-delivery.d.ts +38 -0
  23. package/types/packages/core/src/external-effect.d.ts +313 -0
  24. package/types/packages/core/src/fix-flow.d.ts +149 -0
  25. package/types/packages/core/src/following.d.ts +59 -0
  26. package/types/packages/core/src/github-delivery-fixtures.d.ts +28 -0
  27. package/types/packages/core/src/github-delivery.d.ts +78 -0
  28. package/types/packages/core/src/gitlab-delivery-fixtures.d.ts +26 -0
  29. package/types/packages/core/src/gitlab-delivery.d.ts +76 -0
  30. package/types/packages/core/src/global-search.d.ts +42 -0
  31. package/types/packages/core/src/id.d.ts +1 -0
  32. package/types/packages/core/src/integration.d.ts +276 -0
  33. package/types/packages/core/src/intent.d.ts +260 -0
  34. package/types/packages/core/src/kit-install.d.ts +130 -0
  35. package/types/packages/core/src/live.d.ts +8231 -0
  36. package/types/packages/core/src/marketplace.d.ts +168 -0
  37. package/types/packages/core/src/me.d.ts +31 -0
  38. package/types/packages/core/src/memory.d.ts +93 -0
  39. package/types/packages/core/src/my-teams.d.ts +1599 -0
  40. package/types/packages/core/src/notification.d.ts +250 -0
  41. package/types/packages/core/src/observability.d.ts +175 -0
  42. package/types/packages/core/src/owner.d.ts +15 -0
  43. package/types/packages/core/src/personal-development-profile.d.ts +11 -0
  44. package/types/packages/core/src/platform-release.d.ts +60 -0
  45. package/types/packages/core/src/program-credential.d.ts +10 -0
  46. package/types/packages/core/src/provider-safe-text.d.ts +2 -0
  47. package/types/packages/core/src/push.d.ts +68 -0
  48. package/types/packages/core/src/run-display.d.ts +22 -0
  49. package/types/packages/core/src/run-file.d.ts +190 -0
  50. package/types/packages/core/src/run-graph.d.ts +67 -0
  51. package/types/packages/core/src/run-journal.d.ts +28 -0
  52. package/types/packages/core/src/run-launch.d.ts +82 -0
  53. package/types/packages/core/src/runner-eligibility.d.ts +62 -0
  54. package/types/packages/core/src/runner-routing.d.ts +11 -0
  55. package/types/packages/core/src/runner-trust.d.ts +67 -0
  56. package/types/packages/core/src/runner.d.ts +4076 -0
  57. package/types/packages/core/src/scope-directory.d.ts +100 -0
  58. package/types/packages/core/src/session.d.ts +90 -0
  59. package/types/packages/core/src/step-brief.d.ts +70 -0
  60. package/types/packages/core/src/storage.d.ts +49 -0
  61. package/types/packages/core/src/sync-kit.d.ts +595 -0
  62. package/types/packages/core/src/task-detail.d.ts +511 -0
  63. package/types/packages/core/src/task-execution-record.d.ts +620 -0
  64. package/types/packages/core/src/task-key.d.ts +9 -0
  65. package/types/packages/core/src/task.d.ts +588 -0
  66. package/types/packages/core/src/team-context.d.ts +43 -0
  67. package/types/packages/core/src/transcript.d.ts +250 -0
  68. package/types/packages/core/src/trust-panel.d.ts +27 -0
  69. package/types/packages/core/src/work-unit.d.ts +33 -1
  70. package/types/packages/core/src/workspace.d.ts +167 -0
  71. package/types/packages/live/src/rpc/runner-client.d.ts +15 -0
  72. package/types/packages/live/src/rpc/runner-group.d.ts +1515 -1486
  73. package/types/packages/sdk/src/loop/activities.d.ts +3 -0
  74. package/types/packages/sdk/src/loop/index.d.ts +1 -0
  75. package/types/packages/sdk/src/loop/resolve.d.ts +13 -0
  76. package/types/packages/sdk/src/loop/steps.d.ts +5 -0
  77. package/types/packages/sdk/src/loop/sync.d.ts +8 -1
  78. package/types/packages/sdk/src/loop/test-loop.d.ts +7 -0
  79. package/types/packages/sdk/src/program/engine.d.ts +2 -1
@@ -0,0 +1,190 @@
1
+ import * as Schema from 'effect/Schema';
2
+ import { type JsonObject, type JsonValue } from './runtime-type';
3
+ export declare const RunFileRefusalReasons: readonly ['type', 'too_large', 'too_many', 'quota', 'name_taken'];
4
+ export type RunFileRefusalReason = (typeof RunFileRefusalReasons)[number];
5
+ export declare const isRunFileRefusalReason: (reason: string) => reason is RunFileRefusalReason;
6
+ /** Why Kitman refused a file, in the words every reader shows. */
7
+ export declare const runFileRefusalWords: (refusal: {
8
+ readonly reason: RunFileRefusalReason;
9
+ readonly limit?: number;
10
+ readonly actual?: number;
11
+ }) => string;
12
+ declare const RunFileRefused_base: Schema.Class<RunFileRefused, Schema.TaggedStruct<"RunFileRefused", {
13
+ readonly reason: Schema.Literals<readonly ["type", "too_large", "too_many", "quota", "name_taken"]>;
14
+ readonly limit: Schema.optionalKey<Schema.Int>;
15
+ readonly actual: Schema.optionalKey<Schema.Int>;
16
+ }>, import("effect/Cause").YieldableError>;
17
+ /** A file Kitman would not keep, with the limit it hit and the number that hit it. */
18
+ export declare class RunFileRefused extends RunFileRefused_base {
19
+ get message(): string;
20
+ }
21
+ export declare const runFileContentType: (name: string) => string;
22
+ export declare const RunFileKinds: readonly ['image', 'video', 'html', 'text', 'other'];
23
+ export declare const RunFileStatuses: readonly ['uploading', 'available', 'rejected', 'refused', 'removing', 'removed', 'expired'];
24
+ /** A Run File as its maker sees it; its key stays in Kitman. */
25
+ export declare const RunFileRecord: Schema.Struct<{
26
+ readonly id: Schema.String;
27
+ readonly runId: Schema.String;
28
+ readonly step: Schema.String;
29
+ readonly name: Schema.String;
30
+ readonly caption: Schema.optionalKey<Schema.String>;
31
+ readonly contentType: Schema.String;
32
+ readonly kind: Schema.Literals<readonly ["image", "video", "html", "text", "other"]>;
33
+ readonly byteSize: Schema.Int;
34
+ readonly sha256: Schema.String;
35
+ readonly status: Schema.Literals<readonly ["uploading", "available", "rejected", "refused", "removing", "removed", "expired"]>;
36
+ }>;
37
+ export type RunFileRecord = typeof RunFileRecord.Type;
38
+ export declare const RunFileMakers: readonly ['program', 'agent', 'check'];
39
+ /** A Run File as people and Loops read it; its key stays in Kitman. */
40
+ export declare const RunFileView: Schema.Struct<{
41
+ readonly id: Schema.String;
42
+ readonly runId: Schema.String;
43
+ readonly step: Schema.String;
44
+ readonly stepAttemptId: Schema.optionalKey<Schema.String>;
45
+ readonly verificationId: Schema.optionalKey<Schema.String>;
46
+ readonly madeBy: Schema.Literals<readonly ["program", "agent", "check"]>;
47
+ readonly name: Schema.String;
48
+ readonly caption: Schema.optionalKey<Schema.String>;
49
+ readonly kind: Schema.Literals<readonly ["image", "video", "html", "text", "other"]>;
50
+ readonly contentType: Schema.String;
51
+ readonly byteSize: Schema.Int;
52
+ readonly sha256: Schema.String;
53
+ readonly status: Schema.Literals<readonly ["uploading", "available", "rejected", "refused", "removing", "removed", "expired"]>;
54
+ readonly reason: Schema.optionalKey<Schema.String>;
55
+ /** A refused file's limit and the number that passed it, as `RunFileRefused` gave them. */
56
+ readonly limit: Schema.optionalKey<Schema.Int>;
57
+ readonly actual: Schema.optionalKey<Schema.Int>;
58
+ readonly removedBy: Schema.optionalKey<Schema.String>;
59
+ readonly removedAt: Schema.optionalKey<Schema.String>;
60
+ readonly createdAt: Schema.String;
61
+ }>;
62
+ export type RunFileView = typeof RunFileView.Type;
63
+ /** Without access to the content of the Run's repositories, only how many files it kept. */
64
+ export declare const RunFileList: Schema.Union<readonly [Schema.Struct<{
65
+ readonly files: Schema.$Array<Schema.Struct<{
66
+ readonly id: Schema.String;
67
+ readonly runId: Schema.String;
68
+ readonly step: Schema.String;
69
+ readonly stepAttemptId: Schema.optionalKey<Schema.String>;
70
+ readonly verificationId: Schema.optionalKey<Schema.String>;
71
+ readonly madeBy: Schema.Literals<readonly ["program", "agent", "check"]>;
72
+ readonly name: Schema.String;
73
+ readonly caption: Schema.optionalKey<Schema.String>;
74
+ readonly kind: Schema.Literals<readonly ["image", "video", "html", "text", "other"]>;
75
+ readonly contentType: Schema.String;
76
+ readonly byteSize: Schema.Int;
77
+ readonly sha256: Schema.String;
78
+ readonly status: Schema.Literals<readonly ["uploading", "available", "rejected", "refused", "removing", "removed", "expired"]>;
79
+ readonly reason: Schema.optionalKey<Schema.String>;
80
+ /** A refused file's limit and the number that passed it, as `RunFileRefused` gave them. */
81
+ readonly limit: Schema.optionalKey<Schema.Int>;
82
+ readonly actual: Schema.optionalKey<Schema.Int>;
83
+ readonly removedBy: Schema.optionalKey<Schema.String>;
84
+ readonly removedAt: Schema.optionalKey<Schema.String>;
85
+ readonly createdAt: Schema.String;
86
+ }>>;
87
+ }>, Schema.Struct<{
88
+ readonly count: Schema.Int;
89
+ }>]>;
90
+ export type RunFileList = typeof RunFileList.Type;
91
+ export declare const RunFileUrlsRequest: Schema.Struct<{
92
+ readonly ids: Schema.$Array<Schema.String>;
93
+ readonly use: Schema.Literals<readonly ["view", "download"]>;
94
+ }>;
95
+ export type RunFileUrlsRequest = typeof RunFileUrlsRequest.Type;
96
+ /** Why a person removed a file, for the note the Run keeps. */
97
+ export declare const RunFileRemoveRequest: Schema.Struct<{
98
+ readonly note: Schema.optionalKey<Schema.String>;
99
+ }>;
100
+ export type RunFileRemoveRequest = typeof RunFileRemoveRequest.Type;
101
+ export declare const RunFileUrl: Schema.Struct<{
102
+ readonly id: Schema.String;
103
+ readonly url: Schema.String;
104
+ readonly expiresAt: Schema.String;
105
+ }>;
106
+ export declare const RunFileUrls: Schema.Struct<{
107
+ readonly urls: Schema.$Array<Schema.Struct<{
108
+ readonly id: Schema.String;
109
+ readonly url: Schema.String;
110
+ readonly expiresAt: Schema.String;
111
+ }>>;
112
+ }>;
113
+ export type RunFileUrls = typeof RunFileUrls.Type;
114
+ export declare const RunFilePartUrl: Schema.Struct<{
115
+ readonly url: Schema.String;
116
+ readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
117
+ readonly expiresAt: Schema.String;
118
+ readonly partNumber: Schema.Int;
119
+ }>;
120
+ /** Where a maker PUTs a file's bytes: one URL, or one per part of `partSize` bytes. */
121
+ export declare const RunFileUpload: Schema.Union<readonly [Schema.Struct<{
122
+ readonly url: Schema.String;
123
+ readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
124
+ readonly expiresAt: Schema.String;
125
+ readonly kind: Schema.Literal<"single">;
126
+ }>, Schema.Struct<{
127
+ readonly kind: Schema.Literal<"multipart">;
128
+ readonly partSize: Schema.Int;
129
+ readonly parts: Schema.$Array<Schema.Struct<{
130
+ readonly url: Schema.String;
131
+ readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
132
+ readonly expiresAt: Schema.String;
133
+ readonly partNumber: Schema.Int;
134
+ }>>;
135
+ }>]>;
136
+ export type RunFileUpload = typeof RunFileUpload.Type;
137
+ export declare const UploadedRunFilePart: Schema.Struct<{
138
+ readonly partNumber: Schema.Int;
139
+ readonly etag: Schema.String;
140
+ }>;
141
+ /** A Run File an Output cites, as Kitman holds it. */
142
+ export type CitedRunFile = {
143
+ readonly id: string;
144
+ readonly runId: string;
145
+ readonly status: (typeof RunFileStatuses)[number];
146
+ readonly purpose: 'evidence' | 'checkpoint';
147
+ };
148
+ /** The Run Files an Output cites, by the field its schema places each in. */
149
+ export declare function runFileReferences(schema: JsonObject, output: JsonValue): readonly {
150
+ readonly field: string;
151
+ readonly id: string;
152
+ }[];
153
+ /** A file a Step's agent keeps on the Run; Kitman names its Step and attempt. */
154
+ export declare const StepRunFileRequest: Schema.Struct<{
155
+ readonly name: Schema.String;
156
+ readonly caption: Schema.optionalKey<Schema.String>;
157
+ readonly contentType: Schema.String;
158
+ readonly byteSize: Schema.Int;
159
+ readonly sha256: Schema.String;
160
+ }>;
161
+ export declare const RunFileSlotted: Schema.Struct<{
162
+ readonly file: Schema.Struct<{
163
+ readonly id: Schema.String;
164
+ readonly runId: Schema.String;
165
+ readonly step: Schema.String;
166
+ readonly name: Schema.String;
167
+ readonly caption: Schema.optionalKey<Schema.String>;
168
+ readonly contentType: Schema.String;
169
+ readonly kind: Schema.Literals<readonly ["image", "video", "html", "text", "other"]>;
170
+ readonly byteSize: Schema.Int;
171
+ readonly sha256: Schema.String;
172
+ readonly status: Schema.Literals<readonly ["uploading", "available", "rejected", "refused", "removing", "removed", "expired"]>;
173
+ }>;
174
+ readonly upload: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
175
+ readonly url: Schema.String;
176
+ readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
177
+ readonly expiresAt: Schema.String;
178
+ readonly kind: Schema.Literal<"single">;
179
+ }>, Schema.Struct<{
180
+ readonly kind: Schema.Literal<"multipart">;
181
+ readonly partSize: Schema.Int;
182
+ readonly parts: Schema.$Array<Schema.Struct<{
183
+ readonly url: Schema.String;
184
+ readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
185
+ readonly expiresAt: Schema.String;
186
+ readonly partNumber: Schema.Int;
187
+ }>>;
188
+ }>]>>;
189
+ }>;
190
+ export {};
@@ -0,0 +1,67 @@
1
+ import type { Question, Run, RunDisplayState, RunGraph, RunGraphNode, StepAttempt } from './loop';
2
+ type Reached = {
3
+ readonly id: string;
4
+ readonly name: string;
5
+ /** When the journal recorded its launch. */
6
+ readonly startedAt: string;
7
+ /** When the journal recorded its deferred resolved, and whether with success. */
8
+ readonly resolved?: {
9
+ readonly at: string;
10
+ readonly ok: boolean;
11
+ };
12
+ };
13
+ /** What the journal and its records say of one Step a Run reached. */
14
+ export type RunGraphStep = (Reached & {
15
+ readonly kind: 'agent';
16
+ readonly attempts: readonly {
17
+ readonly id: string;
18
+ readonly attempt: number;
19
+ readonly status: StepAttempt['status'];
20
+ /** A Runner holds it. */
21
+ readonly leased: boolean;
22
+ readonly failureSummary?: string;
23
+ }[];
24
+ readonly agent?: RunGraphNode['agent'];
25
+ }) | (Reached & {
26
+ readonly kind: 'check';
27
+ readonly verification?: {
28
+ readonly id: string;
29
+ readonly attempt: number;
30
+ readonly status: 'waiting' | 'completed' | 'failed' | 'canceled';
31
+ readonly leased: boolean;
32
+ readonly failureSummary?: string;
33
+ };
34
+ /** Every check passed or already failed on the baseline. */
35
+ readonly passed?: boolean;
36
+ }) | (Reached & {
37
+ readonly kind: 'question';
38
+ readonly question?: Question['status'];
39
+ }) | (Reached & {
40
+ readonly kind: 'child';
41
+ readonly child?: RunGraphNode['child'];
42
+ }) | (Reached & {
43
+ readonly kind: 'wait';
44
+ }) | {
45
+ readonly kind: 'activity';
46
+ readonly id: string;
47
+ readonly name: string;
48
+ readonly recordedAt: string;
49
+ readonly ok: boolean;
50
+ };
51
+ /**
52
+ * Groups nodes into columns in order of start: a node starts a new column when it starts after every node in the
53
+ * current column has ended, and otherwise joins it.
54
+ */
55
+ export declare const runGraphColumns: <Node extends {
56
+ readonly startedAt: string;
57
+ readonly endedAt?: string;
58
+ }>(nodes: readonly Node[]) => Node[][];
59
+ export type TaskBlock = {
60
+ readonly blocking: string;
61
+ readonly blocked: string;
62
+ };
63
+ /** The Run graph: every Step the Run reached, in columns, and which Child Runs need which (ADR-0072). */
64
+ export declare const runGraph: (run: Pick<Run, 'status'>, steps: readonly RunGraphStep[], blocks?: readonly TaskBlock[]) => RunGraph;
65
+ /** One status per column, the worst in it, for a Run row's mini graph (ADR-0072). */
66
+ export declare const runMiniGraph: (graph: Pick<RunGraph, 'columns'>) => RunDisplayState[];
67
+ export {};
@@ -0,0 +1,28 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import * as Exit from 'effect/Exit';
3
+ import * as Schema from 'effect/Schema';
4
+ /** The largest encoded journal entry Kitman stores; larger content belongs in a Run artifact. */
5
+ export declare const journalEntryMaxBytes: number;
6
+ export declare const encodeJournalExit: (exit: Exit.Exit<unknown, unknown>) => Effect.Effect<Schema.Json, Schema.SchemaError, never>;
7
+ export declare const decodeJournalExit: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<Exit.Exit<Schema.Json, Schema.Json>, Schema.SchemaError, never>;
8
+ /** How a deferred resolved by Kitman (an answer, a fired clock) is written to the journal. */
9
+ export declare const journalSuccess: (value: Schema.Json) => Schema.Json;
10
+ /** The SDK's Step failure as the journal holds it, for a Step Kitman fails on a program's behalf. */
11
+ export declare const JournalStepFailed: Schema.TaggedStruct<"StepFailed", {
12
+ readonly step: Schema.String;
13
+ readonly reason: Schema.String;
14
+ }>;
15
+ /** The SDK's Child Run failure as the journal holds it. */
16
+ export declare const JournalChildFailed: Schema.TaggedStruct<"ChildFailed", {
17
+ readonly step: Schema.String;
18
+ readonly loop: Schema.String;
19
+ readonly reason: Schema.String;
20
+ }>;
21
+ /** The SDK's `waitFor` timeout as the journal holds it. */
22
+ export declare const JournalWaitTimedOut: Schema.TaggedStruct<"WaitTimedOut", {
23
+ readonly step: Schema.String;
24
+ readonly event: Schema.String;
25
+ }>;
26
+ /** A deferred Kitman fails, with the deferred's error already encoded as JSON. */
27
+ export declare const journalFailure: (error: Schema.Json) => Schema.Json;
28
+ export declare const journalEntryBytes: (entry: Schema.Json) => number;
@@ -0,0 +1,82 @@
1
+ import type { JsonObject } from './runtime-type';
2
+ export type LaunchOutcome = 'feature' | 'bug' | 'refactor' | 'investigation' | 'docs' | 'migration' | 'performance';
3
+ /** Where and how a developer launched: their checkout, and the words they typed. */
4
+ export type LaunchContext = {
5
+ /** The Team the request names; it wins over the repository's. */
6
+ readonly teamId?: string;
7
+ readonly remoteUrl?: string;
8
+ /** A repository chosen outright, as the web's New run form does. */
9
+ readonly repoBindingId?: string;
10
+ readonly branch?: string;
11
+ readonly words?: string;
12
+ /** A Task key in the words is text, as New run from words means them. */
13
+ readonly plainWords?: boolean;
14
+ };
15
+ /** What the control plane knows that a launch may point at. */
16
+ export type LaunchCandidates = {
17
+ readonly repositories: readonly {
18
+ readonly repoBindingId: string;
19
+ readonly teamId: string | null;
20
+ readonly repositoryUrl: string;
21
+ }[];
22
+ /** Open ChangeRequests in those repositories. */
23
+ readonly changeRequests: readonly {
24
+ readonly id: string;
25
+ readonly repoBindingId: string;
26
+ readonly number?: number;
27
+ readonly sourceBranch?: string;
28
+ }[];
29
+ };
30
+ /** A Task's open ChangeRequest, as a launch names it to a person. */
31
+ export type LaunchChangeRequest = {
32
+ readonly id: string;
33
+ readonly title: string;
34
+ readonly url: string;
35
+ readonly repoBindingId: string;
36
+ };
37
+ export type LaunchTask = {
38
+ readonly kind: 'tracker';
39
+ readonly key: string;
40
+ } | {
41
+ readonly kind: 'words';
42
+ readonly words: string;
43
+ };
44
+ export type InferredLaunch = {
45
+ readonly teamId?: string;
46
+ readonly repoBindingId?: string;
47
+ readonly branch?: string;
48
+ readonly changeRequestId?: string;
49
+ /** The Task's open ChangeRequests, when the Loop needs one and only a person can say which. */
50
+ readonly changeRequestChoices?: readonly LaunchChangeRequest[];
51
+ readonly trackerKeys: readonly string[];
52
+ readonly task?: LaunchTask;
53
+ readonly outcome?: LaunchOutcome;
54
+ /** Loop Input fields; `taskId` is left to whoever makes the Task. */
55
+ readonly input: JsonObject;
56
+ /** Required Loop Input fields nothing filled. */
57
+ readonly missing: readonly string[];
58
+ };
59
+ /** host/owner/name of a git remote, so SSH and HTTPS remotes of one repository match. */
60
+ export declare const repositoryKey: (url: string) => string;
61
+ /** A Loop Input JSON Schema's top-level fields, behind a `$ref` if it has one. */
62
+ export declare const launchInputSchema: (schema: JsonObject) => {
63
+ properties: JsonObject;
64
+ required: any[];
65
+ };
66
+ /**
67
+ * What a launch means: the Team, repository, branch, open ChangeRequest, Task and Outcome its context points at,
68
+ * and the Loop Input they fill. The words fill a `words` field, or else the one required text field left other than
69
+ * `taskId` and `changeRequestId`. A Loop that requires a ChangeRequest the launch does not point at takes the Task's
70
+ * only open one.
71
+ */
72
+ export declare const inferLaunch: (launch: {
73
+ readonly context: LaunchContext;
74
+ readonly loop: {
75
+ readonly input: JsonObject;
76
+ readonly outcome?: LaunchOutcome;
77
+ };
78
+ readonly candidates: LaunchCandidates;
79
+ /** The open ChangeRequests of the Task the launch is for. */
80
+ readonly taskChangeRequests?: readonly LaunchChangeRequest[];
81
+ readonly given?: JsonObject;
82
+ }) => InferredLaunch;
@@ -0,0 +1,62 @@
1
+ import type { HarnessHoldReason, SkippedChoice } from './loop';
2
+ import type { AgentChoice } from './loop-layers';
3
+ import { type Runner, type RunnerCapabilities } from './runner';
4
+ import type { RunnerExecutionRouting } from './runner-routing';
5
+ export declare const RunnerEligibilityReasonCodes: readonly ['workspace_mismatch', 'team_access_denied', 'personal_owner_attribution_required', 'personal_owner_team_access_denied', 'agent_identity_authority_missing', 'foreground_target_required', 'foreground_target_mismatch', 'foreground_target_not_personal', 'runner_requirements_mismatch', 'runner_replica_unavailable'];
6
+ export type RunnerEligibilityReasonCode = (typeof RunnerEligibilityReasonCodes)[number];
7
+ export type RunnerSchedulingAuthority = {
8
+ readonly kind: 'direct_human';
9
+ readonly userId: string;
10
+ } | {
11
+ readonly kind: 'durable_delegation';
12
+ readonly ownerUserId: string;
13
+ readonly delegationId: string;
14
+ } | {
15
+ readonly kind: 'agent';
16
+ readonly agentIdentityId: string;
17
+ } | {
18
+ readonly kind: 'system';
19
+ };
20
+ export interface RunnerEligibilityInput {
21
+ readonly runner: Runner;
22
+ readonly workspaceId: string;
23
+ readonly teamId: string;
24
+ readonly schedulingAuthority: RunnerSchedulingAuthority;
25
+ readonly routing?: RunnerExecutionRouting;
26
+ readonly ownerHasTeamAccess: boolean;
27
+ readonly agentIdentityAuthorized: boolean;
28
+ readonly requirementsMatch: boolean;
29
+ readonly replicaReady: boolean;
30
+ }
31
+ export interface RunnerEligibilityResult {
32
+ readonly eligible: boolean;
33
+ readonly reasons: readonly RunnerEligibilityReasonCode[];
34
+ }
35
+ /**
36
+ * The only scope/authority predicate used by runner admission callers.
37
+ * Inputs such as labels, claimed Team IDs, or runner metadata are
38
+ * deliberately absent; callers must resolve them from trusted control-plane
39
+ * state before invoking this function.
40
+ */
41
+ export declare function evaluateRunnerEligibility(input: RunnerEligibilityInput): RunnerEligibilityResult;
42
+ /** A (harness, model) this Runner cannot run until `until`, or, with no `until`, that this Step passes over. */
43
+ export type RunnerHarnessHold = {
44
+ readonly harness: string;
45
+ readonly model: string;
46
+ readonly reason: HarnessHoldReason;
47
+ readonly until?: string;
48
+ };
49
+ /** The owner's choice while the Runner offers it, else the first offered of Pi, Claude Code and Codex. */
50
+ export declare function runnerDefaultHarness(harnesses: readonly string[], chosen: string | undefined): string | undefined;
51
+ /**
52
+ * The first choice this Runner offers, with its Harness resolved, and the choices before it as skipped; undefined when
53
+ * it offers none, so the Step is not this Runner's.
54
+ */
55
+ export declare function offeredChoice(capabilities: Pick<RunnerCapabilities, 'harnesses' | 'defaultHarness'>, choices: readonly AgentChoice[],
56
+ /** The Runner's live Harness Holds; a held choice is skipped. `model` is `''` for the Harness's own. */
57
+ holds?: readonly RunnerHarnessHold[]): {
58
+ readonly choice: AgentChoice & {
59
+ readonly harness: string;
60
+ };
61
+ readonly skipped: readonly SkippedChoice[];
62
+ } | undefined;
@@ -0,0 +1,11 @@
1
+ import * as Schema from 'effect/Schema';
2
+ export declare const RunnerExecutionRouting: Schema.Union<readonly [Schema.Struct<{
3
+ readonly mode: Schema.Literal<"background">;
4
+ readonly requestedByUserId: Schema.optionalKey<Schema.String>;
5
+ }>, Schema.Struct<{
6
+ readonly mode: Schema.Literal<"foreground">;
7
+ readonly requestedByUserId: Schema.String;
8
+ readonly targetPersonalRunnerId: Schema.String;
9
+ readonly interaction: Schema.Literal<"observable">;
10
+ }>]>;
11
+ export type RunnerExecutionRouting = (typeof RunnerExecutionRouting)['Type'];
@@ -0,0 +1,67 @@
1
+ export declare const RunnerArchitecture: readonly ['amd64', 'arm64'];
2
+ export type RunnerArchitecture = (typeof RunnerArchitecture)[number];
3
+ declare const RunnerArtifactKinds: readonly ['host_package', 'oci_image'];
4
+ type RunnerArtifactKind = (typeof RunnerArtifactKinds)[number];
5
+ declare const RunnerArtifactTrustErrorCodes: readonly ['artifact_signature_invalid', 'artifact_sbom_invalid', 'artifact_provenance_invalid', 'artifact_expired', 'artifact_signed_in_future', 'artifact_architecture_mismatch', 'artifact_digest_not_allowed', 'artifact_profile_mismatch', 'artifact_sbom_mismatch', 'artifact_provenance_mismatch', 'artifact_metadata_rollback', 'artifact_metadata_expired', 'artifact_subject_mismatch', 'artifact_index_invalid'];
6
+ type RunnerArtifactTrustErrorCode = (typeof RunnerArtifactTrustErrorCodes)[number];
7
+ declare const RunnerArtifactTrustError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
8
+ readonly _tag: "RunnerArtifactTrustError";
9
+ } & Readonly<A>;
10
+ export declare class RunnerArtifactTrustError extends RunnerArtifactTrustError_base<{
11
+ readonly code: RunnerArtifactTrustErrorCode;
12
+ readonly message: string;
13
+ }> {
14
+ constructor(code: RunnerArtifactTrustErrorCode);
15
+ }
16
+ export type RunnerArtifactManifest = {
17
+ readonly contractVersion: 'runner-trust-distribution.v1';
18
+ readonly artifactId: string;
19
+ readonly kind: RunnerArtifactKind;
20
+ readonly version: string;
21
+ readonly channel: string;
22
+ readonly architecture: RunnerArchitecture;
23
+ readonly platform: 'linux';
24
+ readonly subjectDigest: string;
25
+ readonly subjectLength: number;
26
+ readonly profileDigest: string;
27
+ readonly certificationDigest: string;
28
+ readonly sbomDigest: string;
29
+ readonly provenanceDigest: string;
30
+ readonly metadataVersion: number;
31
+ readonly rollbackFloor: number;
32
+ readonly signedAt: string;
33
+ readonly expiresAt: string;
34
+ };
35
+ type RunnerArtifactManifestInput = Omit<RunnerArtifactManifest, 'contractVersion' | 'kind' | 'platform' | 'signedAt' | 'expiresAt'> & {
36
+ readonly kind?: RunnerArtifactKind;
37
+ readonly platform?: 'linux';
38
+ readonly signedAt: Date | string;
39
+ readonly expiresAt: Date | string;
40
+ };
41
+ type RunnerArtifactVerificationResult = {
42
+ readonly ok: boolean;
43
+ readonly reasons: readonly RunnerArtifactTrustErrorCode[];
44
+ };
45
+ type RunnerOciManifest = {
46
+ readonly digest: string;
47
+ readonly size: number;
48
+ readonly platform: {
49
+ readonly os: 'linux';
50
+ readonly architecture: RunnerArchitecture;
51
+ };
52
+ readonly artifactDigest: string;
53
+ };
54
+ export type RunnerOciIndex = {
55
+ readonly schemaVersion: 2;
56
+ readonly mediaType: 'application/vnd.oci.image.index.v1+json';
57
+ readonly indexDigest: string;
58
+ readonly manifests: readonly RunnerOciManifest[];
59
+ };
60
+ export declare function createRunnerArtifactManifest(input: RunnerArtifactManifestInput): RunnerArtifactManifest;
61
+ export declare function verifyRunnerOciIndex(index: RunnerOciIndex): RunnerArtifactVerificationResult;
62
+ export declare function createRunnerOciIndex(artifacts: readonly RunnerArtifactManifest[], options?: {
63
+ readonly digest?: string;
64
+ }): RunnerOciIndex;
65
+ export declare function runnerCanonicalJson<ValueType>(value: ValueType): string;
66
+ export declare function sha256(value: string): string;
67
+ export {};