@h-rig/contracts 0.0.6-alpha.18 → 0.0.6-alpha.181
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3442 -0
- package/dist/index.mjs +3401 -0
- package/dist/src/agent-roles.d.ts +8 -0
- package/dist/src/artifact.d.ts +13 -0
- package/dist/src/artifact.js +3 -0
- package/dist/src/baseSchemas.d.ts +63 -0
- package/dist/src/baseSchemas.js +6 -0
- package/dist/src/blocker-classifier.d.ts +21 -0
- package/dist/src/blocker-classifier.js +13 -0
- package/dist/src/browser.d.ts +80 -0
- package/dist/src/browser.js +13 -0
- package/dist/src/capability-id.d.ts +22 -0
- package/dist/src/capability-id.js +8 -0
- package/dist/src/cli-output.d.ts +348 -0
- package/dist/src/cli-output.js +190 -0
- package/dist/src/cli-runner.d.ts +43 -0
- package/dist/src/cli-runner.js +13 -0
- package/dist/src/cockpit.d.ts +58 -0
- package/dist/src/cockpit.js +13 -0
- package/dist/src/collab-session-viewer.d.ts +36 -0
- package/dist/src/collab-session-viewer.js +13 -0
- package/dist/src/config.d.ts +553 -0
- package/dist/src/config.js +767 -162
- package/dist/src/control-plane-types.d.ts +323 -0
- package/dist/src/control-plane-types.js +13 -0
- package/dist/src/conversation.d.ts +50 -0
- package/dist/src/conversation.js +3 -0
- package/dist/src/dependency-preflight.d.ts +43 -0
- package/dist/src/dependency-preflight.js +13 -0
- package/dist/src/docs-drift.d.ts +10 -0
- package/dist/src/docs-drift.js +12 -0
- package/dist/src/doctor.d.ts +90 -0
- package/dist/src/doctor.js +13 -0
- package/dist/src/drift.d.ts +28 -0
- package/dist/src/drift.js +69 -0
- package/dist/src/editor.d.ts +25 -0
- package/dist/src/editor.js +3 -0
- package/dist/src/errors.d.ts +13 -0
- package/dist/src/errors.js +17 -0
- package/dist/src/git.d.ts +152 -0
- package/dist/src/git.js +3 -0
- package/dist/src/github.d.ts +295 -0
- package/dist/src/github.js +17 -0
- package/dist/src/graph.d.ts +360 -0
- package/dist/src/graph.js +137 -1
- package/dist/src/guard.d.ts +118 -0
- package/dist/src/guard.js +15 -0
- package/dist/src/harness-events.d.ts +8 -0
- package/dist/src/harness-events.js +1 -0
- package/dist/src/harness-profile-state.d.ts +10 -0
- package/dist/src/harness-profile-state.js +13 -0
- package/dist/src/help-catalog.d.ts +41 -0
- package/dist/src/help-catalog.js +13 -0
- package/dist/src/host.d.ts +41 -0
- package/dist/src/host.js +13 -0
- package/dist/src/identity.d.ts +44 -0
- package/dist/src/identity.js +1 -0
- package/dist/src/index.d.ts +98 -0
- package/dist/src/index.js +2605 -3752
- package/dist/src/isolation.d.ts +213 -0
- package/dist/src/isolation.js +13 -0
- package/dist/src/kernel.d.ts +200 -0
- package/dist/src/kernel.js +261 -0
- package/dist/src/keybindings.d.ts +71 -0
- package/dist/src/keybindings.js +3 -0
- package/dist/src/layout.d.ts +44 -0
- package/dist/src/layout.js +8 -0
- package/dist/src/lifecycle-capabilities.d.ts +224 -0
- package/dist/src/lifecycle-capabilities.js +45 -0
- package/dist/src/managed-repos.d.ts +339 -0
- package/dist/src/managed-repos.js +37 -0
- package/dist/src/memory.d.ts +199 -0
- package/dist/src/memory.js +15 -0
- package/dist/src/model.d.ts +13 -0
- package/dist/src/model.js +3 -58
- package/dist/src/native-toolchain.d.ts +46 -0
- package/dist/src/native-toolchain.js +13 -0
- package/dist/src/notify.d.ts +46 -0
- package/dist/src/notify.js +13 -0
- package/dist/src/orchestration.d.ts +43 -0
- package/dist/src/orchestration.js +28 -961
- package/dist/src/panel-protocol.d.ts +17 -0
- package/dist/src/panel-protocol.js +10 -0
- package/dist/src/pi-session.d.ts +113 -0
- package/dist/src/pi-session.js +1 -0
- package/dist/src/placement.d.ts +47 -0
- package/dist/src/placement.js +13 -0
- package/dist/src/planning.d.ts +64 -0
- package/dist/src/planning.js +90 -0
- package/dist/src/plugin-hooks.d.ts +51 -0
- package/dist/src/plugin-hooks.js +386 -0
- package/dist/src/plugin.d.ts +476 -0
- package/dist/src/plugin.js +346 -64
- package/dist/src/policy.d.ts +16 -0
- package/dist/src/policy.js +3 -0
- package/dist/src/product-entrypoint.d.ts +22 -0
- package/dist/src/product-entrypoint.js +13 -0
- package/dist/src/project.d.ts +71 -0
- package/dist/src/project.js +3 -0
- package/dist/src/prompt.d.ts +29 -0
- package/dist/src/prompt.js +13 -0
- package/dist/src/protocol-version.d.ts +21 -0
- package/dist/src/protocol-version.js +6 -0
- package/dist/src/provider-instructions.d.ts +41 -0
- package/dist/src/provider-instructions.js +13 -0
- package/dist/src/provider.d.ts +105 -0
- package/dist/src/provider.js +16 -835
- package/dist/src/remote-control.d.ts +93 -0
- package/dist/src/remote-control.js +26 -0
- package/dist/src/remote.d.ts +318 -0
- package/dist/src/remote.js +238 -1078
- package/dist/src/review.d.ts +18 -0
- package/dist/src/review.js +3 -0
- package/dist/src/rollups.d.ts +41 -0
- package/dist/src/rollups.js +70 -0
- package/dist/src/run-control.d.ts +164 -0
- package/dist/src/run-control.js +13 -0
- package/dist/src/run-discovery.d.ts +83 -0
- package/dist/src/run-discovery.js +13 -0
- package/dist/src/run-dispatch.d.ts +34 -0
- package/dist/src/run-dispatch.js +13 -0
- package/dist/src/run-identity.d.ts +47 -0
- package/dist/src/run-identity.js +13 -0
- package/dist/src/run-journal.d.ts +694 -0
- package/dist/src/run-journal.js +569 -0
- package/dist/src/run-queue.d.ts +36 -0
- package/dist/src/run-queue.js +13 -0
- package/dist/src/run-read-model.d.ts +200 -0
- package/dist/src/run-read-model.js +13 -0
- package/dist/src/run-record.d.ts +45 -0
- package/dist/src/run-record.js +1 -0
- package/dist/src/run-registry-backbone.d.ts +56 -0
- package/dist/src/run-registry-backbone.js +13 -0
- package/dist/src/run-session-journal.d.ts +154 -0
- package/dist/src/run-session-journal.js +87 -0
- package/dist/src/run-status.d.ts +10 -0
- package/dist/src/run-status.js +27 -0
- package/dist/src/run-timeline.d.ts +7 -0
- package/dist/src/run-timeline.js +1 -0
- package/dist/src/runtime-secrets.d.ts +10 -0
- package/dist/src/runtime-secrets.js +13 -0
- package/dist/src/runtime-task-context.d.ts +82 -0
- package/dist/src/runtime-task-context.js +1 -0
- package/dist/src/runtime.d.ts +103 -0
- package/dist/src/runtime.js +73 -906
- package/dist/src/session-asset-materializer.d.ts +35 -0
- package/dist/src/session-asset-materializer.js +13 -0
- package/dist/src/session-hook-materializer.d.ts +41 -0
- package/dist/src/session-hook-materializer.js +13 -0
- package/dist/src/setup.d.ts +154 -0
- package/dist/src/setup.js +13 -0
- package/dist/src/stage.d.ts +245 -0
- package/dist/src/stage.js +169 -0
- package/dist/src/supervisor-journal.d.ts +204 -0
- package/dist/src/supervisor-journal.js +336 -0
- package/dist/src/supervisor-loop.d.ts +40 -0
- package/dist/src/supervisor-loop.js +13 -0
- package/dist/src/task-artifacts.d.ts +53 -0
- package/dist/src/task-artifacts.js +13 -0
- package/dist/src/task-config.d.ts +22 -0
- package/dist/src/task-config.js +1 -0
- package/dist/src/task-context-renderer.d.ts +29 -0
- package/dist/src/task-context-renderer.js +13 -0
- package/dist/src/task-data.d.ts +196 -0
- package/dist/src/task-data.js +13 -0
- package/dist/src/task-graph-primitives.d.ts +47 -0
- package/dist/src/task-graph-primitives.js +1 -0
- package/dist/src/task-source.d.ts +167 -0
- package/dist/src/task-source.js +24 -0
- package/dist/src/task-state-metadata.d.ts +21 -0
- package/dist/src/task-state-metadata.js +1 -0
- package/dist/src/task-state-paths.d.ts +14 -0
- package/dist/src/task-state-paths.js +13 -0
- package/dist/src/task-state-store.d.ts +36 -0
- package/dist/src/task-state-store.js +17 -0
- package/dist/src/task-tracker-state.d.ts +101 -0
- package/dist/src/task-tracker-state.js +39 -0
- package/dist/src/terminal.d.ts +130 -0
- package/dist/src/terminal.js +3 -0
- package/dist/src/tool-materializer.d.ts +36 -0
- package/dist/src/tool-materializer.js +13 -0
- package/dist/src/tool-registry.d.ts +3 -0
- package/dist/src/tool-registry.js +58 -0
- package/dist/src/toolchain-sources.d.ts +54 -0
- package/dist/src/toolchain-sources.js +17 -0
- package/dist/src/transport-config.d.ts +161 -0
- package/dist/src/transport-config.js +15 -0
- package/dist/src/validation.d.ts +14 -0
- package/dist/src/validation.js +3 -0
- package/dist/src/workflow-journal.d.ts +125 -0
- package/dist/src/workflow-journal.js +27 -0
- package/dist/src/workspace-config.d.ts +18 -0
- package/dist/src/workspace-config.js +13 -0
- package/dist/src/workspace-service.d.ts +16 -0
- package/dist/src/workspace-service.js +13 -0
- package/dist/src/workspace.d.ts +204 -0
- package/dist/src/workspace.js +76 -911
- package/package.json +55 -4
- package/dist/src/engine.js +0 -2278
- package/dist/src/providerRuntime.js +0 -1630
- package/dist/src/rig.js +0 -2374
- package/dist/src/server.js +0 -1053
- package/dist/src/serviceFabric.js +0 -1066
- package/dist/src/ws.js +0 -2968
- /package/dist/src/{ipc.js → agent-roles.js} +0 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run read-model capability vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* This file defines the contracts-only service seam that run-owner plugins can
|
|
5
|
+
* provide to CLI, cockpit, supervisor, and doctor surfaces. The OMP session is
|
|
6
|
+
* the journal source of truth: read-model implementations must key projections
|
|
7
|
+
* by the canonical run id/session id (`runId === sessionId`). Dispatch handles,
|
|
8
|
+
* worktree paths, and relay metadata are metadata only, never identity keys.
|
|
9
|
+
*
|
|
10
|
+
* Pure: types + one branded id, no folding, defaults, coercion, IO, or provider
|
|
11
|
+
* implementation.
|
|
12
|
+
*/
|
|
13
|
+
import type { CapabilityId } from "./capability-id";
|
|
14
|
+
import type { RigStatsData } from "./cli-output";
|
|
15
|
+
import type { RunDiscoveryFilter, RunRuntimeActivePredicate } from "./run-discovery";
|
|
16
|
+
import type { RunJournalProjection } from "./run-journal";
|
|
17
|
+
import type { RunRegistryRunProjection } from "./run-registry-backbone";
|
|
18
|
+
import type { RunRecord, UnifiedInboxRequest } from "./run-record";
|
|
19
|
+
import type { RunStatus } from "./runtime";
|
|
20
|
+
import type { RunSessionCustomEntry } from "./run-session-journal";
|
|
21
|
+
import type { TaskRecord } from "./task-source";
|
|
22
|
+
export type RunReadModelSource = RunRecord["source"] | "all";
|
|
23
|
+
export type RunReadModelRunSelector = {
|
|
24
|
+
/** Exact run id/session id, task id, or unique run-id prefix chosen by the caller. */
|
|
25
|
+
readonly id: string;
|
|
26
|
+
/** Prefer interpreting `id` as this kind when the caller already knows it. */
|
|
27
|
+
readonly kind?: "run-id" | "task-id" | "run-id-prefix" | "any";
|
|
28
|
+
};
|
|
29
|
+
export interface RunReadModelListInput {
|
|
30
|
+
readonly projectRoot: string;
|
|
31
|
+
readonly taskId?: string | null;
|
|
32
|
+
readonly source?: RunReadModelSource;
|
|
33
|
+
readonly includeInactive?: boolean;
|
|
34
|
+
readonly discoveryFilter?: RunDiscoveryFilter;
|
|
35
|
+
}
|
|
36
|
+
export type RunReadModelRepresentativePurpose = "inspect";
|
|
37
|
+
export interface RunReadModelRepresentativeRunInput {
|
|
38
|
+
readonly projectRoot: string;
|
|
39
|
+
readonly taskId: string;
|
|
40
|
+
readonly purpose: RunReadModelRepresentativePurpose;
|
|
41
|
+
readonly discoveryFilter?: RunDiscoveryFilter;
|
|
42
|
+
}
|
|
43
|
+
export interface RunReadModelGetInput {
|
|
44
|
+
readonly projectRoot: string;
|
|
45
|
+
readonly selector: RunReadModelRunSelector;
|
|
46
|
+
readonly discoveryFilter?: RunDiscoveryFilter;
|
|
47
|
+
}
|
|
48
|
+
export interface RunReadModelProjectionInput {
|
|
49
|
+
readonly projectRoot: string;
|
|
50
|
+
/** Canonical run id/session id. */
|
|
51
|
+
readonly runId: string;
|
|
52
|
+
readonly sessionPath?: string | null;
|
|
53
|
+
readonly discoveryFilter?: RunDiscoveryFilter;
|
|
54
|
+
}
|
|
55
|
+
export interface RunReadModelSessionProjectionInput {
|
|
56
|
+
/** Canonical run id/session id. */
|
|
57
|
+
readonly runId: string;
|
|
58
|
+
/** Raw run-session custom entries; RUN_READ_MODEL owns the fold into a journal projection. */
|
|
59
|
+
readonly entries: readonly RunSessionCustomEntry[];
|
|
60
|
+
}
|
|
61
|
+
export interface RunReadModelRegistryProjectionInput {
|
|
62
|
+
/** Canonical run id/session id. */
|
|
63
|
+
readonly runId: string;
|
|
64
|
+
/** Raw run-session custom entries; providers own timeline extraction from them. */
|
|
65
|
+
readonly entries: readonly RunSessionCustomEntry[];
|
|
66
|
+
readonly title: string;
|
|
67
|
+
readonly taskId?: string | null;
|
|
68
|
+
readonly joinLink?: string | null;
|
|
69
|
+
readonly webLink?: string | null;
|
|
70
|
+
readonly relayUrl?: string | null;
|
|
71
|
+
readonly sessionPath?: string | null;
|
|
72
|
+
readonly cwd?: string | null;
|
|
73
|
+
readonly collabCwd?: string | null;
|
|
74
|
+
readonly dispatchHandle?: string | null;
|
|
75
|
+
readonly timelineLimit?: number;
|
|
76
|
+
}
|
|
77
|
+
export interface RunReadModelDetailsInput extends RunReadModelGetInput {
|
|
78
|
+
readonly includeLogs?: boolean;
|
|
79
|
+
readonly includeSourceTask?: boolean;
|
|
80
|
+
}
|
|
81
|
+
export interface RunReadModelInboxInput {
|
|
82
|
+
readonly projectRoot: string;
|
|
83
|
+
readonly kind?: "approval" | "input" | "all";
|
|
84
|
+
readonly runId?: string | null;
|
|
85
|
+
readonly taskId?: string | null;
|
|
86
|
+
readonly discoveryFilter?: RunDiscoveryFilter;
|
|
87
|
+
}
|
|
88
|
+
export interface RunReadModelStatsInput {
|
|
89
|
+
readonly projectRoot: string;
|
|
90
|
+
/** ISO timestamp lower bound, or null for all-time. */
|
|
91
|
+
readonly since?: string | null;
|
|
92
|
+
/** Optional caller-supplied records, used when the surface already listed runs. */
|
|
93
|
+
readonly runs?: readonly RunRecord[];
|
|
94
|
+
readonly discoveryFilter?: RunDiscoveryFilter;
|
|
95
|
+
}
|
|
96
|
+
export interface RunReadModelInspectRowsInput {
|
|
97
|
+
readonly projectRoot: string;
|
|
98
|
+
readonly runs?: readonly RunRecord[];
|
|
99
|
+
readonly pendingInbox?: number | null;
|
|
100
|
+
readonly discoveryFilter?: RunDiscoveryFilter;
|
|
101
|
+
}
|
|
102
|
+
export interface RunReadModelInboxCounts {
|
|
103
|
+
readonly approvals: number;
|
|
104
|
+
readonly inputs: number;
|
|
105
|
+
readonly total: number;
|
|
106
|
+
}
|
|
107
|
+
export interface RunReadModelInboxRecord {
|
|
108
|
+
readonly runId: string;
|
|
109
|
+
readonly taskId: string | null;
|
|
110
|
+
readonly requestId: string;
|
|
111
|
+
readonly kind: "approval" | "input";
|
|
112
|
+
readonly status: "pending";
|
|
113
|
+
readonly title: string;
|
|
114
|
+
readonly body?: string | null;
|
|
115
|
+
readonly prompt: string;
|
|
116
|
+
readonly requestedAt: string | null;
|
|
117
|
+
readonly payload: unknown;
|
|
118
|
+
readonly source: "run";
|
|
119
|
+
}
|
|
120
|
+
export type RunReadModelStats = RigStatsData;
|
|
121
|
+
export type RunReadModelStatusPhase = "starting" | "active" | "waiting" | "paused" | "needs-attention" | "completed" | "failed" | "stopped" | "unknown";
|
|
122
|
+
export type RunReadModelStatusRole = "success" | "action-yellow" | "active-cyan" | "failure" | "muted" | "neutral";
|
|
123
|
+
export interface RunReadModelRunClassification {
|
|
124
|
+
readonly status: string;
|
|
125
|
+
/** RUN_READ_MODEL-owned canonical status for consumers that must emit typed run status events. */
|
|
126
|
+
readonly runStatus: RunStatus;
|
|
127
|
+
readonly phase: RunReadModelStatusPhase;
|
|
128
|
+
readonly role: RunReadModelStatusRole;
|
|
129
|
+
readonly rank: number;
|
|
130
|
+
readonly isActive: boolean;
|
|
131
|
+
readonly isTerminal: boolean;
|
|
132
|
+
readonly isNeedsAttention: boolean;
|
|
133
|
+
}
|
|
134
|
+
export type RunReadModelStageStatus = "pending" | "running" | "completed" | "needs-attention" | "failed" | "stopped" | "paused" | "waiting-approval" | "waiting-input" | "waiting-user-input";
|
|
135
|
+
export interface RunReadModelStageRow {
|
|
136
|
+
readonly id: string;
|
|
137
|
+
readonly label: string;
|
|
138
|
+
readonly currentValue: RunReadModelStageStatus;
|
|
139
|
+
readonly description?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface RunReadModelInspectRow {
|
|
142
|
+
readonly id: string;
|
|
143
|
+
readonly label: string;
|
|
144
|
+
readonly currentValue: string;
|
|
145
|
+
readonly values?: readonly string[];
|
|
146
|
+
readonly heading?: boolean;
|
|
147
|
+
readonly description?: string;
|
|
148
|
+
}
|
|
149
|
+
export interface RunReadModelFailureSummary {
|
|
150
|
+
readonly kind: string;
|
|
151
|
+
readonly summary: string;
|
|
152
|
+
readonly detail?: string | null;
|
|
153
|
+
readonly retryable?: boolean | null;
|
|
154
|
+
}
|
|
155
|
+
export interface RunReadModelDetails {
|
|
156
|
+
readonly run: RunRecord;
|
|
157
|
+
readonly projection: RunJournalProjection;
|
|
158
|
+
readonly pendingInbox: readonly UnifiedInboxRequest[];
|
|
159
|
+
readonly inboxCounts: RunReadModelInboxCounts;
|
|
160
|
+
readonly sourceTask?: TaskRecord | null;
|
|
161
|
+
readonly sessionEntries?: readonly RunSessionCustomEntry[];
|
|
162
|
+
readonly failures: readonly RunReadModelFailureSummary[];
|
|
163
|
+
readonly logs: readonly string[];
|
|
164
|
+
}
|
|
165
|
+
export interface RunReadModelInspectResult {
|
|
166
|
+
readonly details: RunReadModelDetails;
|
|
167
|
+
readonly classification: RunReadModelRunClassification;
|
|
168
|
+
readonly rows: readonly RunReadModelInspectRow[];
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Multi-method run read-model service capability.
|
|
172
|
+
*
|
|
173
|
+
* Providers own executable discovery, session folding, classification, inbox
|
|
174
|
+
* read projection, stats, and stage/inspect rows. Consumers depend only on this
|
|
175
|
+
* contracts vocabulary and resolve the provider through the typed capability seam.
|
|
176
|
+
*/
|
|
177
|
+
export interface RunReadModelService {
|
|
178
|
+
readonly listRuns: (input: RunReadModelListInput) => Promise<readonly RunRecord[]>;
|
|
179
|
+
readonly getRepresentativeRun: (input: RunReadModelRepresentativeRunInput) => Promise<RunRecord | null>;
|
|
180
|
+
readonly getRun: (input: RunReadModelGetInput) => Promise<RunRecord | null>;
|
|
181
|
+
readonly getRunProjection: (input: RunReadModelProjectionInput) => Promise<RunJournalProjection | null>;
|
|
182
|
+
readonly buildSessionProjection: (input: RunReadModelSessionProjectionInput) => RunJournalProjection;
|
|
183
|
+
readonly buildRegistryProjection: (input: RunReadModelRegistryProjectionInput) => RunRegistryRunProjection;
|
|
184
|
+
readonly getRunDetails: (input: RunReadModelDetailsInput) => Promise<RunReadModelDetails | null>;
|
|
185
|
+
readonly inspectRun: (input: RunReadModelDetailsInput) => Promise<RunReadModelInspectResult | null>;
|
|
186
|
+
readonly listInboxRecords: (input: RunReadModelInboxInput) => Promise<readonly RunReadModelInboxRecord[]>;
|
|
187
|
+
readonly getInboxCounts: (input: RunReadModelInboxInput) => Promise<RunReadModelInboxCounts>;
|
|
188
|
+
readonly getStats: (input: RunReadModelStatsInput) => Promise<RunReadModelStats>;
|
|
189
|
+
readonly getInspectRows: (input: RunReadModelInspectRowsInput) => Promise<readonly RunReadModelInspectRow[]>;
|
|
190
|
+
readonly isRuntimeActiveStatus: RunRuntimeActivePredicate;
|
|
191
|
+
readonly classifyRun: (run: RunRecord) => RunReadModelRunClassification;
|
|
192
|
+
readonly projectRunStages: (run: RunRecord) => readonly RunReadModelStageRow[];
|
|
193
|
+
}
|
|
194
|
+
/** Stable id string for the run read-model service capability. */
|
|
195
|
+
export declare const RUN_READ_MODEL_CAPABILITY_ID = "rig.runs.read-model";
|
|
196
|
+
/**
|
|
197
|
+
* Branded run read-model capability id. `defineCapability(RUN_READ_MODEL)`
|
|
198
|
+
* (provider and consumers independently) resolves to a `RunReadModelService`.
|
|
199
|
+
*/
|
|
200
|
+
export declare const RUN_READ_MODEL: CapabilityId<RunReadModelService>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/run-read-model.ts
|
|
8
|
+
var RUN_READ_MODEL_CAPABILITY_ID = "rig.runs.read-model";
|
|
9
|
+
var RUN_READ_MODEL = makeCapabilityId(RUN_READ_MODEL_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
RUN_READ_MODEL_CAPABILITY_ID,
|
|
12
|
+
RUN_READ_MODEL
|
|
13
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { RunJournalProjection } from "./run-journal";
|
|
2
|
+
import type { RigRunTimelineEntry } from "./run-timeline";
|
|
3
|
+
export type UnifiedInboxRequest = {
|
|
4
|
+
readonly requestId: string;
|
|
5
|
+
readonly kind: "approval" | "input";
|
|
6
|
+
readonly title: string;
|
|
7
|
+
readonly body?: string | null;
|
|
8
|
+
readonly options?: readonly string[];
|
|
9
|
+
readonly requestedAt: string | null;
|
|
10
|
+
readonly source: "run";
|
|
11
|
+
};
|
|
12
|
+
/** Unified operator-facing run record shared by CLI, cockpit, relay, and client projection logic. */
|
|
13
|
+
export interface RunRecord {
|
|
14
|
+
readonly runId: string;
|
|
15
|
+
readonly taskId: string | null;
|
|
16
|
+
readonly title: string;
|
|
17
|
+
/** RunStatus from the folded journal, or a liveness-derived fallback. */
|
|
18
|
+
readonly status: string;
|
|
19
|
+
readonly source: "local" | "remote";
|
|
20
|
+
/** True when the run is currently discoverable (registry heartbeat or local host). */
|
|
21
|
+
readonly live: boolean;
|
|
22
|
+
readonly stale: boolean;
|
|
23
|
+
readonly startedAt: string | null;
|
|
24
|
+
readonly updatedAt: string | null;
|
|
25
|
+
readonly completedAt: string | null;
|
|
26
|
+
readonly joinLink: string | null;
|
|
27
|
+
readonly webLink: string | null;
|
|
28
|
+
readonly relayUrl: string | null;
|
|
29
|
+
readonly sessionPath: string | null;
|
|
30
|
+
readonly prUrl: string | null;
|
|
31
|
+
readonly worktreePath: string | null;
|
|
32
|
+
readonly pendingApprovals: number;
|
|
33
|
+
readonly pendingInputs: number;
|
|
34
|
+
readonly steeringCount: number;
|
|
35
|
+
readonly stallCount: number;
|
|
36
|
+
readonly errorSummary?: string | null;
|
|
37
|
+
/** Timeline entries folded from the same OMP session custom entries as the journal. */
|
|
38
|
+
readonly timeline: RigRunTimelineEntry[];
|
|
39
|
+
/** Pending rig.run.* approvals/inputs only; rig.workflow.inbox.* is intentionally dead. */
|
|
40
|
+
readonly inbox: UnifiedInboxRequest[];
|
|
41
|
+
/** Live collab cwd when present in registry/discovery. */
|
|
42
|
+
readonly collabCwd: string | null;
|
|
43
|
+
/** The full folded journal (empty projection when no journal was readable). */
|
|
44
|
+
readonly projection: RunJournalProjection;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { CapabilityId } from "./capability-id";
|
|
2
|
+
import type { RigWorkflowOwner } from "./workflow-journal";
|
|
3
|
+
import type { RunRecord } from "./run-record";
|
|
4
|
+
import type { RunStatus } from "./runtime";
|
|
5
|
+
/**
|
|
6
|
+
* cap:run-registry-backbone — transport-owned relay/registry room publication.
|
|
7
|
+
*
|
|
8
|
+
* The transport plugin owns the concrete @rig/relay-registry client. Run workers
|
|
9
|
+
* publish journal-derived projections through this structural seam so the worker
|
|
10
|
+
* lifecycle engine does not import the relay-registry implementation package.
|
|
11
|
+
*/
|
|
12
|
+
export declare const RUN_REGISTRY_BACKBONE_CAPABILITY_ID = "transport.run-registry-backbone";
|
|
13
|
+
export type RunRegistryOwner = RigWorkflowOwner;
|
|
14
|
+
export type RunRegistryStatus = RunStatus | "starting" | "waiting-input";
|
|
15
|
+
export type RunRegistryRunProjection = Pick<RunRecord, "runId" | "taskId" | "title" | "status" | "source" | "startedAt" | "updatedAt" | "completedAt" | "joinLink" | "webLink" | "relayUrl" | "sessionPath" | "prUrl" | "worktreePath" | "pendingApprovals" | "pendingInputs" | "steeringCount" | "stallCount" | "errorSummary" | "timeline" | "collabCwd"> & {
|
|
16
|
+
readonly cwd?: string | null;
|
|
17
|
+
readonly dispatchHandle?: string | null;
|
|
18
|
+
};
|
|
19
|
+
export interface RunRegistryRegisterRoomInput {
|
|
20
|
+
readonly roomId: string;
|
|
21
|
+
readonly owner: RunRegistryOwner;
|
|
22
|
+
readonly repo: string;
|
|
23
|
+
readonly title: string;
|
|
24
|
+
readonly status: RunRegistryStatus;
|
|
25
|
+
readonly joinLink: string;
|
|
26
|
+
readonly webLink: string;
|
|
27
|
+
readonly relayUrl: string;
|
|
28
|
+
readonly startedAt: string;
|
|
29
|
+
readonly cwd?: string;
|
|
30
|
+
readonly sessionPath?: string;
|
|
31
|
+
readonly pid?: number;
|
|
32
|
+
readonly projection?: RunRegistryRunProjection;
|
|
33
|
+
}
|
|
34
|
+
export interface RunRegistryClient {
|
|
35
|
+
readonly registerRoom: (room: RunRegistryRegisterRoomInput) => Promise<unknown>;
|
|
36
|
+
readonly heartbeatRoom: (roomId: string, status: RunRegistryStatus, projection?: RunRegistryRunProjection) => Promise<unknown>;
|
|
37
|
+
readonly removeRoom: (roomId: string) => Promise<boolean>;
|
|
38
|
+
}
|
|
39
|
+
export interface RunWorkerProjectionConnection {
|
|
40
|
+
readonly ready: Promise<void>;
|
|
41
|
+
push(projection: RunRegistryRunProjection): void;
|
|
42
|
+
close(): void;
|
|
43
|
+
}
|
|
44
|
+
export interface RunRegistryBackboneService {
|
|
45
|
+
readonly createRegistryClient: (options: {
|
|
46
|
+
readonly baseUrl: string;
|
|
47
|
+
readonly namespaceKey: string;
|
|
48
|
+
}) => RunRegistryClient;
|
|
49
|
+
readonly connectWorkerProjection: (options: {
|
|
50
|
+
readonly baseUrl: string;
|
|
51
|
+
readonly namespaceKey: string;
|
|
52
|
+
readonly runId: string;
|
|
53
|
+
}) => RunWorkerProjectionConnection;
|
|
54
|
+
readonly coerceRegistryStatus: (value: unknown, fallback: RunRegistryStatus) => RunRegistryStatus;
|
|
55
|
+
}
|
|
56
|
+
export declare const RUN_REGISTRY_BACKBONE: CapabilityId<RunRegistryBackboneService>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/run-registry-backbone.ts
|
|
8
|
+
var RUN_REGISTRY_BACKBONE_CAPABILITY_ID = "transport.run-registry-backbone";
|
|
9
|
+
var RUN_REGISTRY_BACKBONE = makeCapabilityId(RUN_REGISTRY_BACKBONE_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
RUN_REGISTRY_BACKBONE_CAPABILITY_ID,
|
|
12
|
+
RUN_REGISTRY_BACKBONE
|
|
13
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { CapabilityId } from "./capability-id";
|
|
2
|
+
import type { JournalCapability } from "./kernel";
|
|
3
|
+
import { type ApprovalDecision, type RunActor, type RunCloseoutPhase, type RunCloseoutPhaseOutcome, type RunJournalEvent, type RunJournalProjection } from "./run-journal";
|
|
4
|
+
import type { RigRunTimelineEntry } from "./run-timeline";
|
|
5
|
+
import type { RunStatus } from "./runtime";
|
|
6
|
+
import type { RigWorkflowStatusChanged } from "./workflow-journal";
|
|
7
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
8
|
+
export type RunJournalEventInit = DistributiveOmit<RunJournalEvent, "v" | "seq" | "at" | "runId">;
|
|
9
|
+
export declare const RIG_RUN_STATUS_CHANGED = "rig.run.status-changed";
|
|
10
|
+
export declare const RIG_RUN_RECORD_PATCH = "rig.run.record-patch";
|
|
11
|
+
export declare const RIG_RUN_TIMELINE_ENTRY = "rig.run.timeline-entry";
|
|
12
|
+
export declare const RIG_RUN_LOG_ENTRY = "rig.run.log-entry";
|
|
13
|
+
export declare const RIG_RUN_APPROVAL_REQUESTED = "rig.run.approval-requested";
|
|
14
|
+
export declare const RIG_RUN_APPROVAL_RESOLVED = "rig.run.approval-resolved";
|
|
15
|
+
export declare const RIG_RUN_INPUT_REQUESTED = "rig.run.input-requested";
|
|
16
|
+
export declare const RIG_RUN_INPUT_RESOLVED = "rig.run.input-resolved";
|
|
17
|
+
export declare const RIG_RUN_STEERING = "rig.run.steering";
|
|
18
|
+
export declare const RIG_RUN_ADOPTED = "rig.run.adopted";
|
|
19
|
+
export declare const RIG_RUN_STALL_DETECTED = "rig.run.stall-detected";
|
|
20
|
+
export declare const RIG_RUN_CLOSEOUT_PHASE = "rig.run.closeout-phase";
|
|
21
|
+
export declare const RIG_RUN_PIPELINE_RESOLVED = "rig.run.pipeline-resolved";
|
|
22
|
+
export declare const RIG_RUN_STAGE_OUTCOME = "rig.run.stage-outcome";
|
|
23
|
+
export declare const RIG_STOP_SENTINEL = "<<RIG_STOP";
|
|
24
|
+
export declare const RIG_STOP_SENTINEL_END = ">>";
|
|
25
|
+
export declare const RIG_PAUSE_SENTINEL = "<<RIG_PAUSE";
|
|
26
|
+
export declare const RIG_RESUME_SENTINEL = "<<RIG_RESUME";
|
|
27
|
+
export declare const RIG_CONTROL_SENTINEL_END = ">>";
|
|
28
|
+
export type RunInboxResolutionSentinel = {
|
|
29
|
+
kind: "approval";
|
|
30
|
+
requestId: string;
|
|
31
|
+
decision: "approve" | "reject";
|
|
32
|
+
note?: string | null;
|
|
33
|
+
requestedBy: string | null;
|
|
34
|
+
} | {
|
|
35
|
+
kind: "input";
|
|
36
|
+
requestId: string;
|
|
37
|
+
answers: Record<string, string>;
|
|
38
|
+
requestedBy: string | null;
|
|
39
|
+
};
|
|
40
|
+
export declare const RIG_INBOX_RESOLUTION_SENTINEL = "<<RIG_INBOX_RESOLUTION";
|
|
41
|
+
export type RunInboxResolutionInit = {
|
|
42
|
+
kind: "approval";
|
|
43
|
+
requestId: string;
|
|
44
|
+
decision: "approve" | "reject";
|
|
45
|
+
note?: string | null;
|
|
46
|
+
} | {
|
|
47
|
+
kind: "input";
|
|
48
|
+
requestId: string;
|
|
49
|
+
answers: Record<string, string>;
|
|
50
|
+
};
|
|
51
|
+
export declare const CUSTOM_TYPE_FOR: {
|
|
52
|
+
readonly "status-changed": "rig.run.status-changed";
|
|
53
|
+
readonly "record-patch": "rig.run.record-patch";
|
|
54
|
+
readonly "timeline-entry": "rig.run.timeline-entry";
|
|
55
|
+
readonly "log-entry": "rig.run.log-entry";
|
|
56
|
+
readonly "approval-requested": "rig.run.approval-requested";
|
|
57
|
+
readonly "approval-resolved": "rig.run.approval-resolved";
|
|
58
|
+
readonly "input-requested": "rig.run.input-requested";
|
|
59
|
+
readonly "input-resolved": "rig.run.input-resolved";
|
|
60
|
+
readonly steering: "rig.run.steering";
|
|
61
|
+
readonly adopted: "rig.run.adopted";
|
|
62
|
+
readonly "stall-detected": "rig.run.stall-detected";
|
|
63
|
+
readonly "closeout-phase": "rig.run.closeout-phase";
|
|
64
|
+
readonly "pipeline-resolved": "rig.run.pipeline-resolved";
|
|
65
|
+
readonly "stage-outcome": "rig.run.stage-outcome";
|
|
66
|
+
};
|
|
67
|
+
export type RunSessionCustomType = (typeof CUSTOM_TYPE_FOR)[RunJournalEvent["type"]];
|
|
68
|
+
export declare const TYPE_FOR_CUSTOM: Readonly<Record<RunSessionCustomType, RunJournalEvent["type"]>>;
|
|
69
|
+
export type RunSessionCustomEntry = {
|
|
70
|
+
type: string;
|
|
71
|
+
customType?: string;
|
|
72
|
+
data?: unknown;
|
|
73
|
+
};
|
|
74
|
+
/** Minimal session surface a run-journal writer reads from when binding to an OMP
|
|
75
|
+
* session. The writable append surface is intentionally not part of the
|
|
76
|
+
* read-model codec; the run-worker-owned writer narrows live session managers
|
|
77
|
+
* internally so contracts stays free of any `@oh-my-pi` dependency. */
|
|
78
|
+
export interface RunJournalSessionManager {
|
|
79
|
+
getEntries?(): readonly unknown[];
|
|
80
|
+
getBranch?(): readonly unknown[];
|
|
81
|
+
}
|
|
82
|
+
/** A run journal provider bound to one session + run: the kernel `JournalCapability`
|
|
83
|
+
* plus run-event append and the live projection read. */
|
|
84
|
+
export type JournalSessionProvider = JournalCapability & {
|
|
85
|
+
readonly runId: string;
|
|
86
|
+
readonly appendRunEvent: (event: RunJournalEventInit) => Promise<void>;
|
|
87
|
+
readonly readEntries: () => readonly RunSessionCustomEntry[];
|
|
88
|
+
readonly readProjection: () => RunJournalProjection;
|
|
89
|
+
};
|
|
90
|
+
/** The bound run-journal WRITER handed to the run worker. */
|
|
91
|
+
export type RunJournal = {
|
|
92
|
+
readonly kernel: JournalSessionProvider;
|
|
93
|
+
appendStatus(to: RunStatus, opts?: {
|
|
94
|
+
reason?: string | null;
|
|
95
|
+
actor?: RunActor;
|
|
96
|
+
errorText?: string | null;
|
|
97
|
+
force?: boolean;
|
|
98
|
+
}): void;
|
|
99
|
+
appendTimeline(payload: unknown): void;
|
|
100
|
+
appendCloseoutPhase(input: {
|
|
101
|
+
phase: RunCloseoutPhase;
|
|
102
|
+
outcome: RunCloseoutPhaseOutcome;
|
|
103
|
+
detail?: string | null;
|
|
104
|
+
}): void;
|
|
105
|
+
appendApprovalResolved(input: {
|
|
106
|
+
requestId: string;
|
|
107
|
+
decision: ApprovalDecision;
|
|
108
|
+
note?: string | null;
|
|
109
|
+
actor: RunActor;
|
|
110
|
+
}): void;
|
|
111
|
+
appendInputResolved(input: {
|
|
112
|
+
requestId: string;
|
|
113
|
+
answers: Record<string, string>;
|
|
114
|
+
actor: RunActor;
|
|
115
|
+
}): void;
|
|
116
|
+
appendStall(input: {
|
|
117
|
+
detail: string;
|
|
118
|
+
}): void;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* The run-session journal codec: fold/projection (read), timeline extraction, and
|
|
122
|
+
* control-sentinel parse. Owned by `@rig/run-read-model-plugin`, consumed
|
|
123
|
+
* provider-anonymously through `RUN_SESSION_JOURNAL`. Writable journal binding is
|
|
124
|
+
* exposed separately by the run-worker/lifecycle writer capability.
|
|
125
|
+
*/
|
|
126
|
+
export interface RunSessionJournalCodec {
|
|
127
|
+
foldRunSessionEntries(entries: readonly RunSessionCustomEntry[], runId: string): RunJournalProjection;
|
|
128
|
+
projectRunFromSession(source: {
|
|
129
|
+
getEntries(): readonly RunSessionCustomEntry[];
|
|
130
|
+
} | readonly RunSessionCustomEntry[], runId: string): RunJournalProjection;
|
|
131
|
+
isTerminalRunStatus(status: RunStatus): boolean;
|
|
132
|
+
sessionIdFromSessionFile(sessionPath: string | null | undefined): string | null;
|
|
133
|
+
timelineEntriesFromCustomEntries(entries: readonly RunSessionCustomEntry[]): readonly RigRunTimelineEntry[];
|
|
134
|
+
latestTimelineEntriesFromCustomEntries(entries: readonly RunSessionCustomEntry[], limit: number): readonly RigRunTimelineEntry[];
|
|
135
|
+
parseStopSentinel(text: string, expectedRunId: string): {
|
|
136
|
+
reason: string | null;
|
|
137
|
+
} | null;
|
|
138
|
+
parsePauseSentinel(text: string, expectedRunId: string): {
|
|
139
|
+
requestedBy: string | null;
|
|
140
|
+
} | null;
|
|
141
|
+
parseResumeSentinel(text: string, expectedRunId: string): {
|
|
142
|
+
requestedBy: string | null;
|
|
143
|
+
} | null;
|
|
144
|
+
parseInboxResolutionSentinel(text: string, expectedRunId: string): RunInboxResolutionSentinel | null;
|
|
145
|
+
createWorkflowStatusChanged(input: Omit<RigWorkflowStatusChanged, "schemaVersion" | "changedAt"> & {
|
|
146
|
+
changedAt?: string;
|
|
147
|
+
}): RigWorkflowStatusChanged;
|
|
148
|
+
}
|
|
149
|
+
export declare const RUN_SESSION_JOURNAL_CAPABILITY_ID = "rig.runs.session-journal";
|
|
150
|
+
/** Branded read-only run session-journal codec capability id. The read-model
|
|
151
|
+
* plugin provides it; run surfaces resolve it instead of importing the codec
|
|
152
|
+
* implementation. */
|
|
153
|
+
export declare const RUN_SESSION_JOURNAL: CapabilityId<RunSessionJournalCodec>;
|
|
154
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/run-session-journal.ts
|
|
8
|
+
var RIG_RUN_STATUS_CHANGED = "rig.run.status-changed";
|
|
9
|
+
var RIG_RUN_RECORD_PATCH = "rig.run.record-patch";
|
|
10
|
+
var RIG_RUN_TIMELINE_ENTRY = "rig.run.timeline-entry";
|
|
11
|
+
var RIG_RUN_LOG_ENTRY = "rig.run.log-entry";
|
|
12
|
+
var RIG_RUN_APPROVAL_REQUESTED = "rig.run.approval-requested";
|
|
13
|
+
var RIG_RUN_APPROVAL_RESOLVED = "rig.run.approval-resolved";
|
|
14
|
+
var RIG_RUN_INPUT_REQUESTED = "rig.run.input-requested";
|
|
15
|
+
var RIG_RUN_INPUT_RESOLVED = "rig.run.input-resolved";
|
|
16
|
+
var RIG_RUN_STEERING = "rig.run.steering";
|
|
17
|
+
var RIG_RUN_ADOPTED = "rig.run.adopted";
|
|
18
|
+
var RIG_RUN_STALL_DETECTED = "rig.run.stall-detected";
|
|
19
|
+
var RIG_RUN_CLOSEOUT_PHASE = "rig.run.closeout-phase";
|
|
20
|
+
var RIG_RUN_PIPELINE_RESOLVED = "rig.run.pipeline-resolved";
|
|
21
|
+
var RIG_RUN_STAGE_OUTCOME = "rig.run.stage-outcome";
|
|
22
|
+
var RIG_STOP_SENTINEL = "<<RIG_STOP";
|
|
23
|
+
var RIG_STOP_SENTINEL_END = ">>";
|
|
24
|
+
var RIG_PAUSE_SENTINEL = "<<RIG_PAUSE";
|
|
25
|
+
var RIG_RESUME_SENTINEL = "<<RIG_RESUME";
|
|
26
|
+
var RIG_CONTROL_SENTINEL_END = ">>";
|
|
27
|
+
var RIG_INBOX_RESOLUTION_SENTINEL = "<<RIG_INBOX_RESOLUTION";
|
|
28
|
+
var CUSTOM_TYPE_FOR = {
|
|
29
|
+
"status-changed": RIG_RUN_STATUS_CHANGED,
|
|
30
|
+
"record-patch": RIG_RUN_RECORD_PATCH,
|
|
31
|
+
"timeline-entry": RIG_RUN_TIMELINE_ENTRY,
|
|
32
|
+
"log-entry": RIG_RUN_LOG_ENTRY,
|
|
33
|
+
"approval-requested": RIG_RUN_APPROVAL_REQUESTED,
|
|
34
|
+
"approval-resolved": RIG_RUN_APPROVAL_RESOLVED,
|
|
35
|
+
"input-requested": RIG_RUN_INPUT_REQUESTED,
|
|
36
|
+
"input-resolved": RIG_RUN_INPUT_RESOLVED,
|
|
37
|
+
steering: RIG_RUN_STEERING,
|
|
38
|
+
adopted: RIG_RUN_ADOPTED,
|
|
39
|
+
"stall-detected": RIG_RUN_STALL_DETECTED,
|
|
40
|
+
"closeout-phase": RIG_RUN_CLOSEOUT_PHASE,
|
|
41
|
+
"pipeline-resolved": RIG_RUN_PIPELINE_RESOLVED,
|
|
42
|
+
"stage-outcome": RIG_RUN_STAGE_OUTCOME
|
|
43
|
+
};
|
|
44
|
+
var TYPE_FOR_CUSTOM = {
|
|
45
|
+
[RIG_RUN_STATUS_CHANGED]: "status-changed",
|
|
46
|
+
[RIG_RUN_RECORD_PATCH]: "record-patch",
|
|
47
|
+
[RIG_RUN_TIMELINE_ENTRY]: "timeline-entry",
|
|
48
|
+
[RIG_RUN_LOG_ENTRY]: "log-entry",
|
|
49
|
+
[RIG_RUN_APPROVAL_REQUESTED]: "approval-requested",
|
|
50
|
+
[RIG_RUN_APPROVAL_RESOLVED]: "approval-resolved",
|
|
51
|
+
[RIG_RUN_INPUT_REQUESTED]: "input-requested",
|
|
52
|
+
[RIG_RUN_INPUT_RESOLVED]: "input-resolved",
|
|
53
|
+
[RIG_RUN_STEERING]: "steering",
|
|
54
|
+
[RIG_RUN_ADOPTED]: "adopted",
|
|
55
|
+
[RIG_RUN_STALL_DETECTED]: "stall-detected",
|
|
56
|
+
[RIG_RUN_CLOSEOUT_PHASE]: "closeout-phase",
|
|
57
|
+
[RIG_RUN_PIPELINE_RESOLVED]: "pipeline-resolved",
|
|
58
|
+
[RIG_RUN_STAGE_OUTCOME]: "stage-outcome"
|
|
59
|
+
};
|
|
60
|
+
var RUN_SESSION_JOURNAL_CAPABILITY_ID = "rig.runs.session-journal";
|
|
61
|
+
var RUN_SESSION_JOURNAL = makeCapabilityId(RUN_SESSION_JOURNAL_CAPABILITY_ID);
|
|
62
|
+
export {
|
|
63
|
+
TYPE_FOR_CUSTOM,
|
|
64
|
+
RUN_SESSION_JOURNAL_CAPABILITY_ID,
|
|
65
|
+
RUN_SESSION_JOURNAL,
|
|
66
|
+
RIG_STOP_SENTINEL_END,
|
|
67
|
+
RIG_STOP_SENTINEL,
|
|
68
|
+
RIG_RUN_TIMELINE_ENTRY,
|
|
69
|
+
RIG_RUN_STEERING,
|
|
70
|
+
RIG_RUN_STATUS_CHANGED,
|
|
71
|
+
RIG_RUN_STALL_DETECTED,
|
|
72
|
+
RIG_RUN_STAGE_OUTCOME,
|
|
73
|
+
RIG_RUN_RECORD_PATCH,
|
|
74
|
+
RIG_RUN_PIPELINE_RESOLVED,
|
|
75
|
+
RIG_RUN_LOG_ENTRY,
|
|
76
|
+
RIG_RUN_INPUT_RESOLVED,
|
|
77
|
+
RIG_RUN_INPUT_REQUESTED,
|
|
78
|
+
RIG_RUN_CLOSEOUT_PHASE,
|
|
79
|
+
RIG_RUN_APPROVAL_RESOLVED,
|
|
80
|
+
RIG_RUN_APPROVAL_REQUESTED,
|
|
81
|
+
RIG_RUN_ADOPTED,
|
|
82
|
+
RIG_RESUME_SENTINEL,
|
|
83
|
+
RIG_PAUSE_SENTINEL,
|
|
84
|
+
RIG_INBOX_RESOLUTION_SENTINEL,
|
|
85
|
+
RIG_CONTROL_SENTINEL_END,
|
|
86
|
+
CUSTOM_TYPE_FOR
|
|
87
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Operator-facing active-run classification.
|
|
2
|
+
*
|
|
3
|
+
* The canonical run-journal vocabulary intentionally keeps `needs-attention` as
|
|
4
|
+
* non-terminal so resume/steer/closeout state machines can still act on it.
|
|
5
|
+
* OpenTUI/task projections need a narrower meaning: only runs that are actively
|
|
6
|
+
* occupying a task slot should render as the task's active run. Legacy/closeout
|
|
7
|
+
* statuses from older authority files are treated conservatively as inactive so
|
|
8
|
+
* merged/closed runs do not pin task rows forever.
|
|
9
|
+
*/
|
|
10
|
+
export declare const OPERATOR_INACTIVE_RUN_STATUSES: ReadonlySet<string>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/run-status.ts
|
|
3
|
+
var OPERATOR_INACTIVE_RUN_STATUSES = new Set([
|
|
4
|
+
"completed",
|
|
5
|
+
"complete",
|
|
6
|
+
"done",
|
|
7
|
+
"success",
|
|
8
|
+
"succeeded",
|
|
9
|
+
"passed",
|
|
10
|
+
"failed",
|
|
11
|
+
"failure",
|
|
12
|
+
"error",
|
|
13
|
+
"errored",
|
|
14
|
+
"stopped",
|
|
15
|
+
"cancelled",
|
|
16
|
+
"canceled",
|
|
17
|
+
"aborted",
|
|
18
|
+
"abort",
|
|
19
|
+
"merged",
|
|
20
|
+
"closed",
|
|
21
|
+
"skipped",
|
|
22
|
+
"needs-attention",
|
|
23
|
+
"needs_attention"
|
|
24
|
+
]);
|
|
25
|
+
export {
|
|
26
|
+
OPERATOR_INACTIVE_RUN_STATUSES
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CapabilityId } from "./capability-id";
|
|
2
|
+
export type RuntimeSecretKey = "ANTHROPIC_API_KEY" | "OPENAI_API_KEY" | "OPENROUTER_API_KEY" | "AI_REVIEW_MODE" | "AI_REVIEW_PROVIDER" | "GREPTILE_API_BASE" | "GREPTILE_REMOTE" | "GREPTILE_REPOSITORY" | "GREPTILE_CONTEXT_BRANCH" | "GREPTILE_DEFAULT_BRANCH" | "GREPTILE_API_KEY" | "GREPTILE_GITHUB_TOKEN" | "GREPTILE_POLL_ATTEMPTS" | "GREPTILE_POLL_INTERVAL_MS" | "GH_TOKEN" | "GITHUB_TOKEN" | "GITHUB_SSH_KEY" | "AWS_ACCESS_KEY_ID" | "AWS_SECRET_ACCESS_KEY" | "AWS_REGION" | "LINEAR_API_KEY" | "LINEAR_WEBHOOK_SECRET";
|
|
3
|
+
export type RuntimeSecrets = Partial<Record<RuntimeSecretKey, string>>;
|
|
4
|
+
export interface RuntimeSecretsService {
|
|
5
|
+
resolveRuntimeSecrets(env: Record<string, string | undefined>, baked?: RuntimeSecrets): RuntimeSecrets;
|
|
6
|
+
loadDotEnvSecrets(projectRoot: string, env?: Record<string, string | undefined>): RuntimeSecrets;
|
|
7
|
+
secretDefinesFromEnv(env?: Record<string, string | undefined>, projectRoot?: string): Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export declare const RUNTIME_SECRETS_CAPABILITY_ID = "provider.runtime-secrets";
|
|
10
|
+
export declare const RUNTIME_SECRETS: CapabilityId<RuntimeSecretsService>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/contracts/src/capability-id.ts
|
|
3
|
+
function makeCapabilityId(id) {
|
|
4
|
+
return id;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// packages/contracts/src/runtime-secrets.ts
|
|
8
|
+
var RUNTIME_SECRETS_CAPABILITY_ID = "provider.runtime-secrets";
|
|
9
|
+
var RUNTIME_SECRETS = makeCapabilityId(RUNTIME_SECRETS_CAPABILITY_ID);
|
|
10
|
+
export {
|
|
11
|
+
RUNTIME_SECRETS_CAPABILITY_ID,
|
|
12
|
+
RUNTIME_SECRETS
|
|
13
|
+
};
|