@h-rig/contracts 0.0.6-alpha.136 → 0.0.6-alpha.138

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 CHANGED
@@ -257,6 +257,7 @@ __export(exports_src, {
257
257
  RunStatusChangedEvent: () => RunStatusChangedEvent,
258
258
  RunStatus: () => RunStatus,
259
259
  RunStallDetectedEvent: () => RunStallDetectedEvent,
260
+ RunStageOutcomeEvent: () => RunStageOutcomeEvent,
260
261
  RunSetStatusCommand: () => RunSetStatusCommand,
261
262
  RunSetRuntimeModeCommand: () => RunSetRuntimeModeCommand,
262
263
  RunSetInteractionModeCommand: () => RunSetInteractionModeCommand,
@@ -265,6 +266,7 @@ __export(exports_src, {
265
266
  RunReleaseRemoteLeaseCommand: () => RunReleaseRemoteLeaseCommand,
266
267
  RunRecordPatchEvent: () => RunRecordPatchEvent,
267
268
  RunRecordPatch: () => RunRecordPatch,
269
+ RunPipelineResolvedEvent: () => RunPipelineResolvedEvent,
268
270
  RunMode: () => RunMode,
269
271
  RunMarkFailedCommand: () => RunMarkFailedCommand,
270
272
  RunMarkCompletedCommand: () => RunMarkCompletedCommand,
@@ -417,7 +419,9 @@ __export(exports_src, {
417
419
  RIG_RUN_STEERING: () => RIG_RUN_STEERING,
418
420
  RIG_RUN_STATUS_CHANGED: () => RIG_RUN_STATUS_CHANGED,
419
421
  RIG_RUN_STALL_DETECTED: () => RIG_RUN_STALL_DETECTED,
422
+ RIG_RUN_STAGE_OUTCOME: () => RIG_RUN_STAGE_OUTCOME,
420
423
  RIG_RUN_RECORD_PATCH: () => RIG_RUN_RECORD_PATCH,
424
+ RIG_RUN_PIPELINE_RESOLVED: () => RIG_RUN_PIPELINE_RESOLVED,
421
425
  RIG_RUN_LOG_ENTRY: () => RIG_RUN_LOG_ENTRY,
422
426
  RIG_RUN_INPUT_RESOLVED: () => RIG_RUN_INPUT_RESOLVED,
423
427
  RIG_RUN_INPUT_REQUESTED: () => RIG_RUN_INPUT_REQUESTED,
@@ -456,8 +460,6 @@ __export(exports_src, {
456
460
  ProviderEvent: () => ProviderEvent,
457
461
  ProviderApprovalPolicy: () => ProviderApprovalPolicy,
458
462
  ProviderApprovalDecision: () => ProviderApprovalDecision,
459
- ProtectedStageViolation: () => ProtectedStageViolation,
460
- ProtectedStageGrant: () => ProtectedStageGrant,
461
463
  ProjectionPendingApprovalStatus: () => ProjectionPendingApprovalStatus,
462
464
  ProjectionPendingApprovalDecision: () => ProjectionPendingApprovalDecision,
463
465
  ProjectWriteFileResult: () => ProjectWriteFileResult,
@@ -478,6 +480,7 @@ __export(exports_src, {
478
480
  ProjectDeletedPayload: () => ProjectDeletedPayload,
479
481
  ProjectCreatedPayload: () => ProjectCreatedPayload,
480
482
  ProjectCreateCommand: () => ProjectCreateCommand,
483
+ ProductCapabilityRegistration: () => ProductCapabilityRegistration,
481
484
  PositiveInt: () => PositiveInt,
482
485
  PolicyMode: () => PolicyMode,
483
486
  PolicyDecisionSummary: () => PolicyDecisionSummary,
@@ -490,6 +493,7 @@ __export(exports_src, {
490
493
  PipelineUnresolvable: () => PipelineUnresolvable,
491
494
  PiRuntimeConfig: () => PiRuntimeConfig,
492
495
  PercentComplete: () => PercentComplete,
496
+ PanelRegistration: () => PanelRegistration,
493
497
  PROVIDER_SEND_TURN_MAX_INPUT_CHARS: () => PROVIDER_SEND_TURN_MAX_INPUT_CHARS,
494
498
  PROVIDER_SEND_TURN_MAX_IMAGE_BYTES: () => PROVIDER_SEND_TURN_MAX_IMAGE_BYTES,
495
499
  PROVIDER_SEND_TURN_MAX_ATTACHMENTS: () => PROVIDER_SEND_TURN_MAX_ATTACHMENTS,
@@ -663,6 +667,7 @@ __export(exports_src, {
663
667
  CLI_OUTPUT_VERSION: () => CLI_OUTPUT_VERSION,
664
668
  BootResultDescriptor: () => BootResultDescriptor,
665
669
  BootIncoherent: () => BootIncoherent,
670
+ BlockerClassifierRegistration: () => BlockerClassifierRegistration,
666
671
  BlockerClassification: () => BlockerClassification,
667
672
  BlockerClass: () => BlockerClass,
668
673
  AutomationConfig: () => AutomationConfig,
@@ -2060,12 +2065,120 @@ var WorktreeSummary = import_effect6.Schema.Struct({
2060
2065
  cleanedAt: import_effect6.Schema.NullOr(IsoDateTime)
2061
2066
  });
2062
2067
  // packages/contracts/src/run-journal.ts
2068
+ var import_effect8 = require("effect");
2069
+
2070
+ // packages/contracts/src/stage.ts
2063
2071
  var import_effect7 = require("effect");
2064
- var RunActor = import_effect7.Schema.Struct({
2065
- kind: import_effect7.Schema.Literals(["operator", "agent", "server", "system"]),
2066
- id: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString))
2072
+ var StageKind = import_effect7.Schema.Literals(["transform", "gate", "observe"]);
2073
+ var StageId = TrimmedNonEmptyString.pipe(import_effect7.Schema.brand("StageId"));
2074
+ var StageContext = import_effect7.Schema.Struct({
2075
+ runId: RunId,
2076
+ taskId: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TaskId)),
2077
+ state: import_effect7.Schema.Unknown,
2078
+ metadata: import_effect7.Schema.optional(import_effect7.Schema.Record(import_effect7.Schema.String, import_effect7.Schema.Unknown))
2067
2079
  });
2068
- var RunCloseoutPhase = import_effect7.Schema.Literals([
2080
+ var StageDescriptor = import_effect7.Schema.Struct({
2081
+ id: StageId,
2082
+ kind: StageKind,
2083
+ before: import_effect7.Schema.optional(import_effect7.Schema.Array(StageId)),
2084
+ after: import_effect7.Schema.optional(import_effect7.Schema.Array(StageId)),
2085
+ priority: import_effect7.Schema.Number.pipe(import_effect7.Schema.withDecodingDefault(() => 0)),
2086
+ protected: import_effect7.Schema.Boolean.pipe(import_effect7.Schema.withDecodingDefault(() => false))
2087
+ });
2088
+ var Stage = StageDescriptor;
2089
+ var StageContinueResult = import_effect7.Schema.Struct({
2090
+ kind: import_effect7.Schema.Literal("continue"),
2091
+ ctx: StageContext
2092
+ });
2093
+ var StageAllowResult = import_effect7.Schema.Struct({
2094
+ kind: import_effect7.Schema.Literal("allow")
2095
+ });
2096
+ var StageBlockResult = import_effect7.Schema.Struct({
2097
+ kind: import_effect7.Schema.Literal("block"),
2098
+ reason: TrimmedNonEmptyString
2099
+ });
2100
+ var StageResult = import_effect7.Schema.Union([
2101
+ StageContinueResult,
2102
+ StageAllowResult,
2103
+ StageBlockResult
2104
+ ]);
2105
+ var StageWrapperDescriptor = import_effect7.Schema.Struct({
2106
+ id: TrimmedNonEmptyString,
2107
+ priority: import_effect7.Schema.Number.pipe(import_effect7.Schema.withDecodingDefault(() => 0))
2108
+ });
2109
+ var StageMutationOp = import_effect7.Schema.Literals(["insert", "remove", "replace", "wrap", "reorder"]);
2110
+ var InsertStageMutation = import_effect7.Schema.Struct({
2111
+ op: import_effect7.Schema.Literal("insert"),
2112
+ stage: StageDescriptor,
2113
+ contributedBy: import_effect7.Schema.optional(TrimmedNonEmptyString)
2114
+ });
2115
+ var RemoveStageMutation = import_effect7.Schema.Struct({
2116
+ op: import_effect7.Schema.Literal("remove"),
2117
+ id: StageId,
2118
+ contributedBy: import_effect7.Schema.optional(TrimmedNonEmptyString)
2119
+ });
2120
+ var ReplaceStageMutation = import_effect7.Schema.Struct({
2121
+ op: import_effect7.Schema.Literal("replace"),
2122
+ id: StageId,
2123
+ stage: StageDescriptor,
2124
+ contributedBy: import_effect7.Schema.optional(TrimmedNonEmptyString)
2125
+ });
2126
+ var WrapStageMutation = import_effect7.Schema.Struct({
2127
+ op: import_effect7.Schema.Literal("wrap"),
2128
+ id: StageId,
2129
+ around: StageWrapperDescriptor,
2130
+ contributedBy: import_effect7.Schema.optional(TrimmedNonEmptyString)
2131
+ });
2132
+ var ReorderStageMutation = import_effect7.Schema.Struct({
2133
+ op: import_effect7.Schema.Literal("reorder"),
2134
+ id: StageId,
2135
+ before: import_effect7.Schema.optional(import_effect7.Schema.Array(StageId)),
2136
+ after: import_effect7.Schema.optional(import_effect7.Schema.Array(StageId)),
2137
+ contributedBy: import_effect7.Schema.optional(TrimmedNonEmptyString)
2138
+ });
2139
+ var StageMutation = import_effect7.Schema.Union([
2140
+ InsertStageMutation,
2141
+ RemoveStageMutation,
2142
+ ReplaceStageMutation,
2143
+ WrapStageMutation,
2144
+ ReorderStageMutation
2145
+ ]);
2146
+ var ResolutionGrantUse = import_effect7.Schema.Struct({
2147
+ kind: import_effect7.Schema.Literal("kernel-replacement"),
2148
+ target: TrimmedNonEmptyString,
2149
+ pluginId: TrimmedNonEmptyString
2150
+ });
2151
+ var ResolutionRecordEntry = import_effect7.Schema.Struct({
2152
+ stageId: StageId,
2153
+ contributedBy: TrimmedNonEmptyString,
2154
+ removedBy: import_effect7.Schema.optional(TrimmedNonEmptyString),
2155
+ replacedBy: import_effect7.Schema.optional(TrimmedNonEmptyString),
2156
+ wrappedBy: import_effect7.Schema.optional(import_effect7.Schema.Array(TrimmedNonEmptyString)),
2157
+ droppedAnchors: import_effect7.Schema.optional(import_effect7.Schema.Array(StageId)),
2158
+ isProtected: import_effect7.Schema.Boolean
2159
+ });
2160
+ var ResolvedPipeline = import_effect7.Schema.Struct({
2161
+ runId: import_effect7.Schema.optional(RunId),
2162
+ order: import_effect7.Schema.Array(StageId),
2163
+ record: import_effect7.Schema.Array(ResolutionRecordEntry),
2164
+ cycles: import_effect7.Schema.Array(import_effect7.Schema.Array(StageId)),
2165
+ grantUses: import_effect7.Schema.optional(import_effect7.Schema.Array(ResolutionGrantUse)),
2166
+ resolvedAt: import_effect7.Schema.optional(IsoDateTime)
2167
+ });
2168
+ var ResolutionRecord = ResolvedPipeline;
2169
+ var StageRunOutcome = import_effect7.Schema.Struct({
2170
+ stageId: StageId,
2171
+ result: StageResult,
2172
+ startedAt: IsoDateTime,
2173
+ finishedAt: IsoDateTime
2174
+ });
2175
+
2176
+ // packages/contracts/src/run-journal.ts
2177
+ var RunActor = import_effect8.Schema.Struct({
2178
+ kind: import_effect8.Schema.Literals(["operator", "agent", "server", "system"]),
2179
+ id: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString))
2180
+ });
2181
+ var RunCloseoutPhase = import_effect8.Schema.Literals([
2069
2182
  "queued",
2070
2183
  "commit",
2071
2184
  "push",
@@ -2075,102 +2188,102 @@ var RunCloseoutPhase = import_effect7.Schema.Literals([
2075
2188
  "close-source",
2076
2189
  "completed"
2077
2190
  ]);
2078
- var RunCloseoutPhaseOutcome = import_effect7.Schema.Literals(["started", "completed", "failed"]);
2079
- var RunCloseoutStatus = import_effect7.Schema.Literals([
2191
+ var RunCloseoutPhaseOutcome = import_effect8.Schema.Literals(["started", "completed", "failed"]);
2192
+ var RunCloseoutStatus = import_effect8.Schema.Literals([
2080
2193
  "pending",
2081
2194
  "running",
2082
2195
  "completed",
2083
2196
  "needs-attention",
2084
2197
  "failed"
2085
2198
  ]);
2086
- var RunCloseoutState = import_effect7.Schema.Struct({
2199
+ var RunCloseoutState = import_effect8.Schema.Struct({
2087
2200
  phase: RunCloseoutPhase,
2088
2201
  status: RunCloseoutStatus,
2089
2202
  updatedAt: IsoDateTime,
2090
- taskId: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2091
- runtimeWorkspace: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2092
- branch: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2093
- prUrl: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2094
- artifactRoot: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2095
- iterations: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.Int)),
2096
- feedback: import_effect7.Schema.optional(import_effect7.Schema.Array(import_effect7.Schema.String)),
2097
- error: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.String)),
2098
- reason: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.String)),
2099
- merged: import_effect7.Schema.optional(import_effect7.Schema.Boolean),
2100
- resumedAt: import_effect7.Schema.optional(import_effect7.Schema.NullOr(IsoDateTime)),
2101
- completedAt: import_effect7.Schema.optional(import_effect7.Schema.NullOr(IsoDateTime))
2102
- });
2103
- var ApprovalDecision = import_effect7.Schema.Literals(["approve", "reject"]);
2203
+ taskId: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2204
+ runtimeWorkspace: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2205
+ branch: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2206
+ prUrl: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2207
+ artifactRoot: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2208
+ iterations: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.Int)),
2209
+ feedback: import_effect8.Schema.optional(import_effect8.Schema.Array(import_effect8.Schema.String)),
2210
+ error: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.String)),
2211
+ reason: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.String)),
2212
+ merged: import_effect8.Schema.optional(import_effect8.Schema.Boolean),
2213
+ resumedAt: import_effect8.Schema.optional(import_effect8.Schema.NullOr(IsoDateTime)),
2214
+ completedAt: import_effect8.Schema.optional(import_effect8.Schema.NullOr(IsoDateTime))
2215
+ });
2216
+ var ApprovalDecision = import_effect8.Schema.Literals(["approve", "reject"]);
2104
2217
  var runRecordFields = {
2105
2218
  runId: TrimmedNonEmptyString,
2106
2219
  workspaceId: TrimmedNonEmptyString,
2107
- taskId: import_effect7.Schema.NullOr(TrimmedNonEmptyString),
2108
- threadId: import_effect7.Schema.NullOr(TrimmedNonEmptyString),
2109
- mode: import_effect7.Schema.Literals(["local", "remote"]),
2110
- runtimeAdapter: import_effect7.Schema.Literal("pi"),
2220
+ taskId: import_effect8.Schema.NullOr(TrimmedNonEmptyString),
2221
+ threadId: import_effect8.Schema.NullOr(TrimmedNonEmptyString),
2222
+ mode: import_effect8.Schema.Literals(["local", "remote"]),
2223
+ runtimeAdapter: import_effect8.Schema.Literal("pi"),
2111
2224
  createdAt: IsoDateTime,
2112
- startedAt: import_effect7.Schema.NullOr(IsoDateTime),
2113
- completedAt: import_effect7.Schema.NullOr(IsoDateTime),
2114
- endpointId: import_effect7.Schema.NullOr(TrimmedNonEmptyString),
2115
- hostId: import_effect7.Schema.NullOr(TrimmedNonEmptyString),
2116
- worktreePath: import_effect7.Schema.NullOr(TrimmedNonEmptyString),
2117
- artifactRoot: import_effect7.Schema.NullOr(TrimmedNonEmptyString),
2118
- logRoot: import_effect7.Schema.NullOr(TrimmedNonEmptyString),
2119
- sessionPath: import_effect7.Schema.NullOr(TrimmedNonEmptyString),
2120
- sessionLogPath: import_effect7.Schema.NullOr(TrimmedNonEmptyString),
2121
- pid: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.Int)),
2122
- piSession: import_effect7.Schema.optional(import_effect7.Schema.Unknown),
2123
- piSessionPrivate: import_effect7.Schema.optional(import_effect7.Schema.Unknown),
2225
+ startedAt: import_effect8.Schema.NullOr(IsoDateTime),
2226
+ completedAt: import_effect8.Schema.NullOr(IsoDateTime),
2227
+ endpointId: import_effect8.Schema.NullOr(TrimmedNonEmptyString),
2228
+ hostId: import_effect8.Schema.NullOr(TrimmedNonEmptyString),
2229
+ worktreePath: import_effect8.Schema.NullOr(TrimmedNonEmptyString),
2230
+ artifactRoot: import_effect8.Schema.NullOr(TrimmedNonEmptyString),
2231
+ logRoot: import_effect8.Schema.NullOr(TrimmedNonEmptyString),
2232
+ sessionPath: import_effect8.Schema.NullOr(TrimmedNonEmptyString),
2233
+ sessionLogPath: import_effect8.Schema.NullOr(TrimmedNonEmptyString),
2234
+ pid: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.Int)),
2235
+ piSession: import_effect8.Schema.optional(import_effect8.Schema.Unknown),
2236
+ piSessionPrivate: import_effect8.Schema.optional(import_effect8.Schema.Unknown),
2124
2237
  updatedAt: IsoDateTime,
2125
2238
  title: TrimmedNonEmptyString,
2126
- projectRoot: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2127
- errorText: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.String)),
2128
- latestMessageId: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2129
- prUrl: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2130
- leaseId: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2131
- serverCloseout: import_effect7.Schema.optional(import_effect7.Schema.NullOr(RunCloseoutState)),
2132
- model: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2133
- runtimeMode: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2134
- interactionMode: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2135
- runMode: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2136
- initialPrompt: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.String)),
2137
- baselineMode: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2138
- prMode: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.Literals(["auto", "ask", "off"]))),
2139
- initiatedBy: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2140
- sourceTask: import_effect7.Schema.optional(import_effect7.Schema.Unknown),
2141
- serverPid: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.Int)),
2142
- latestSteeringAt: import_effect7.Schema.optional(import_effect7.Schema.NullOr(IsoDateTime)),
2143
- latestSteeringDeliveredAt: import_effect7.Schema.optional(import_effect7.Schema.NullOr(IsoDateTime)),
2144
- statusDetail: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.String)),
2145
- planning: import_effect7.Schema.optional(import_effect7.Schema.Unknown),
2146
- branch: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString))
2239
+ projectRoot: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2240
+ errorText: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.String)),
2241
+ latestMessageId: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2242
+ prUrl: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2243
+ leaseId: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2244
+ serverCloseout: import_effect8.Schema.optional(import_effect8.Schema.NullOr(RunCloseoutState)),
2245
+ model: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2246
+ runtimeMode: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2247
+ interactionMode: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2248
+ runMode: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2249
+ initialPrompt: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.String)),
2250
+ baselineMode: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2251
+ prMode: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.Literals(["auto", "ask", "off"]))),
2252
+ initiatedBy: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2253
+ sourceTask: import_effect8.Schema.optional(import_effect8.Schema.Unknown),
2254
+ serverPid: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.Int)),
2255
+ latestSteeringAt: import_effect8.Schema.optional(import_effect8.Schema.NullOr(IsoDateTime)),
2256
+ latestSteeringDeliveredAt: import_effect8.Schema.optional(import_effect8.Schema.NullOr(IsoDateTime)),
2257
+ statusDetail: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.String)),
2258
+ planning: import_effect8.Schema.optional(import_effect8.Schema.Unknown),
2259
+ branch: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString))
2147
2260
  };
2148
- var RunJournalRecord = import_effect7.Schema.Struct({
2261
+ var RunJournalRecord = import_effect8.Schema.Struct({
2149
2262
  ...runRecordFields,
2150
2263
  status: RunStatus
2151
2264
  });
2152
- var RunRecordPatch = import_effect7.Schema.Struct({
2153
- runId: import_effect7.Schema.optional(runRecordFields.runId),
2154
- workspaceId: import_effect7.Schema.optional(runRecordFields.workspaceId),
2155
- taskId: import_effect7.Schema.optional(runRecordFields.taskId),
2156
- threadId: import_effect7.Schema.optional(runRecordFields.threadId),
2157
- mode: import_effect7.Schema.optional(runRecordFields.mode),
2158
- runtimeAdapter: import_effect7.Schema.optional(runRecordFields.runtimeAdapter),
2159
- createdAt: import_effect7.Schema.optional(runRecordFields.createdAt),
2160
- startedAt: import_effect7.Schema.optional(runRecordFields.startedAt),
2161
- completedAt: import_effect7.Schema.optional(runRecordFields.completedAt),
2162
- endpointId: import_effect7.Schema.optional(runRecordFields.endpointId),
2163
- hostId: import_effect7.Schema.optional(runRecordFields.hostId),
2164
- worktreePath: import_effect7.Schema.optional(runRecordFields.worktreePath),
2165
- artifactRoot: import_effect7.Schema.optional(runRecordFields.artifactRoot),
2166
- logRoot: import_effect7.Schema.optional(runRecordFields.logRoot),
2167
- sessionPath: import_effect7.Schema.optional(runRecordFields.sessionPath),
2168
- sessionLogPath: import_effect7.Schema.optional(runRecordFields.sessionLogPath),
2265
+ var RunRecordPatch = import_effect8.Schema.Struct({
2266
+ runId: import_effect8.Schema.optional(runRecordFields.runId),
2267
+ workspaceId: import_effect8.Schema.optional(runRecordFields.workspaceId),
2268
+ taskId: import_effect8.Schema.optional(runRecordFields.taskId),
2269
+ threadId: import_effect8.Schema.optional(runRecordFields.threadId),
2270
+ mode: import_effect8.Schema.optional(runRecordFields.mode),
2271
+ runtimeAdapter: import_effect8.Schema.optional(runRecordFields.runtimeAdapter),
2272
+ createdAt: import_effect8.Schema.optional(runRecordFields.createdAt),
2273
+ startedAt: import_effect8.Schema.optional(runRecordFields.startedAt),
2274
+ completedAt: import_effect8.Schema.optional(runRecordFields.completedAt),
2275
+ endpointId: import_effect8.Schema.optional(runRecordFields.endpointId),
2276
+ hostId: import_effect8.Schema.optional(runRecordFields.hostId),
2277
+ worktreePath: import_effect8.Schema.optional(runRecordFields.worktreePath),
2278
+ artifactRoot: import_effect8.Schema.optional(runRecordFields.artifactRoot),
2279
+ logRoot: import_effect8.Schema.optional(runRecordFields.logRoot),
2280
+ sessionPath: import_effect8.Schema.optional(runRecordFields.sessionPath),
2281
+ sessionLogPath: import_effect8.Schema.optional(runRecordFields.sessionLogPath),
2169
2282
  pid: runRecordFields.pid,
2170
2283
  piSession: runRecordFields.piSession,
2171
2284
  piSessionPrivate: runRecordFields.piSessionPrivate,
2172
- updatedAt: import_effect7.Schema.optional(runRecordFields.updatedAt),
2173
- title: import_effect7.Schema.optional(runRecordFields.title),
2285
+ updatedAt: import_effect8.Schema.optional(runRecordFields.updatedAt),
2286
+ title: import_effect8.Schema.optional(runRecordFields.title),
2174
2287
  projectRoot: runRecordFields.projectRoot,
2175
2288
  errorText: runRecordFields.errorText,
2176
2289
  latestMessageId: runRecordFields.latestMessageId,
@@ -2194,88 +2307,98 @@ var RunRecordPatch = import_effect7.Schema.Struct({
2194
2307
  branch: runRecordFields.branch
2195
2308
  });
2196
2309
  var journalEnvelopeFields = {
2197
- v: import_effect7.Schema.Literal(1),
2310
+ v: import_effect8.Schema.Literal(1),
2198
2311
  seq: PositiveInt,
2199
2312
  at: IsoDateTime,
2200
2313
  runId: RunId
2201
2314
  };
2202
- var RunStatusChangedEvent = import_effect7.Schema.Struct({
2315
+ var RunStatusChangedEvent = import_effect8.Schema.Struct({
2203
2316
  ...journalEnvelopeFields,
2204
- type: import_effect7.Schema.Literal("status-changed"),
2205
- from: import_effect7.Schema.NullOr(RunStatus),
2317
+ type: import_effect8.Schema.Literal("status-changed"),
2318
+ from: import_effect8.Schema.NullOr(RunStatus),
2206
2319
  to: RunStatus,
2207
- reason: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.String)),
2208
- actor: import_effect7.Schema.optional(RunActor)
2320
+ reason: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.String)),
2321
+ actor: import_effect8.Schema.optional(RunActor)
2209
2322
  });
2210
- var RunRecordPatchEvent = import_effect7.Schema.Struct({
2323
+ var RunRecordPatchEvent = import_effect8.Schema.Struct({
2211
2324
  ...journalEnvelopeFields,
2212
- type: import_effect7.Schema.Literal("record-patch"),
2325
+ type: import_effect8.Schema.Literal("record-patch"),
2213
2326
  patch: RunRecordPatch
2214
2327
  });
2215
- var RunTimelineEntryEvent = import_effect7.Schema.Struct({
2328
+ var RunTimelineEntryEvent = import_effect8.Schema.Struct({
2216
2329
  ...journalEnvelopeFields,
2217
- type: import_effect7.Schema.Literal("timeline-entry"),
2218
- payload: import_effect7.Schema.Unknown
2330
+ type: import_effect8.Schema.Literal("timeline-entry"),
2331
+ payload: import_effect8.Schema.Unknown
2219
2332
  });
2220
- var RunLogEntryEvent = import_effect7.Schema.Struct({
2333
+ var RunLogEntryEvent = import_effect8.Schema.Struct({
2221
2334
  ...journalEnvelopeFields,
2222
- type: import_effect7.Schema.Literal("log-entry"),
2223
- payload: import_effect7.Schema.Unknown
2335
+ type: import_effect8.Schema.Literal("log-entry"),
2336
+ payload: import_effect8.Schema.Unknown
2224
2337
  });
2225
- var RunApprovalRequestedEvent = import_effect7.Schema.Struct({
2338
+ var RunApprovalRequestedEvent = import_effect8.Schema.Struct({
2226
2339
  ...journalEnvelopeFields,
2227
- type: import_effect7.Schema.Literal("approval-requested"),
2340
+ type: import_effect8.Schema.Literal("approval-requested"),
2228
2341
  requestId: TrimmedNonEmptyString,
2229
2342
  requestKind: TrimmedNonEmptyString,
2230
- actionId: import_effect7.Schema.optional(import_effect7.Schema.NullOr(TrimmedNonEmptyString)),
2231
- payload: import_effect7.Schema.Unknown
2343
+ actionId: import_effect8.Schema.optional(import_effect8.Schema.NullOr(TrimmedNonEmptyString)),
2344
+ payload: import_effect8.Schema.Unknown
2232
2345
  });
2233
- var RunApprovalResolvedEvent = import_effect7.Schema.Struct({
2346
+ var RunApprovalResolvedEvent = import_effect8.Schema.Struct({
2234
2347
  ...journalEnvelopeFields,
2235
- type: import_effect7.Schema.Literal("approval-resolved"),
2348
+ type: import_effect8.Schema.Literal("approval-resolved"),
2236
2349
  requestId: TrimmedNonEmptyString,
2237
2350
  decision: ApprovalDecision,
2238
- note: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.String)),
2351
+ note: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.String)),
2239
2352
  actor: RunActor
2240
2353
  });
2241
- var RunInputRequestedEvent = import_effect7.Schema.Struct({
2354
+ var RunInputRequestedEvent = import_effect8.Schema.Struct({
2242
2355
  ...journalEnvelopeFields,
2243
- type: import_effect7.Schema.Literal("input-requested"),
2356
+ type: import_effect8.Schema.Literal("input-requested"),
2244
2357
  requestId: TrimmedNonEmptyString,
2245
- payload: import_effect7.Schema.Unknown
2358
+ payload: import_effect8.Schema.Unknown
2246
2359
  });
2247
- var RunInputResolvedEvent = import_effect7.Schema.Struct({
2360
+ var RunInputResolvedEvent = import_effect8.Schema.Struct({
2248
2361
  ...journalEnvelopeFields,
2249
- type: import_effect7.Schema.Literal("input-resolved"),
2362
+ type: import_effect8.Schema.Literal("input-resolved"),
2250
2363
  requestId: TrimmedNonEmptyString,
2251
- answers: import_effect7.Schema.Record(import_effect7.Schema.String, import_effect7.Schema.String),
2364
+ answers: import_effect8.Schema.Record(import_effect8.Schema.String, import_effect8.Schema.String),
2252
2365
  actor: RunActor
2253
2366
  });
2254
- var RunSteeringEvent = import_effect7.Schema.Struct({
2367
+ var RunSteeringEvent = import_effect8.Schema.Struct({
2255
2368
  ...journalEnvelopeFields,
2256
- type: import_effect7.Schema.Literal("steering"),
2369
+ type: import_effect8.Schema.Literal("steering"),
2257
2370
  actor: RunActor,
2258
- text: import_effect7.Schema.String
2371
+ text: import_effect8.Schema.String
2259
2372
  });
2260
- var RunAdoptedEvent = import_effect7.Schema.Struct({
2373
+ var RunAdoptedEvent = import_effect8.Schema.Struct({
2261
2374
  ...journalEnvelopeFields,
2262
- type: import_effect7.Schema.Literal("adopted"),
2263
- pid: import_effect7.Schema.NullOr(import_effect7.Schema.Int),
2264
- serverPid: import_effect7.Schema.Int
2375
+ type: import_effect8.Schema.Literal("adopted"),
2376
+ pid: import_effect8.Schema.NullOr(import_effect8.Schema.Int),
2377
+ serverPid: import_effect8.Schema.Int
2265
2378
  });
2266
- var RunStallDetectedEvent = import_effect7.Schema.Struct({
2379
+ var RunStallDetectedEvent = import_effect8.Schema.Struct({
2267
2380
  ...journalEnvelopeFields,
2268
- type: import_effect7.Schema.Literal("stall-detected"),
2269
- detail: import_effect7.Schema.String
2381
+ type: import_effect8.Schema.Literal("stall-detected"),
2382
+ detail: import_effect8.Schema.String
2270
2383
  });
2271
- var RunCloseoutPhaseEvent = import_effect7.Schema.Struct({
2384
+ var RunCloseoutPhaseEvent = import_effect8.Schema.Struct({
2272
2385
  ...journalEnvelopeFields,
2273
- type: import_effect7.Schema.Literal("closeout-phase"),
2386
+ type: import_effect8.Schema.Literal("closeout-phase"),
2274
2387
  phase: RunCloseoutPhase,
2275
2388
  outcome: RunCloseoutPhaseOutcome,
2276
- detail: import_effect7.Schema.optional(import_effect7.Schema.NullOr(import_effect7.Schema.String))
2389
+ detail: import_effect8.Schema.optional(import_effect8.Schema.NullOr(import_effect8.Schema.String))
2390
+ });
2391
+ var RunPipelineResolvedEvent = import_effect8.Schema.Struct({
2392
+ ...journalEnvelopeFields,
2393
+ type: import_effect8.Schema.Literal("pipeline-resolved"),
2394
+ pipeline: ResolvedPipeline
2395
+ });
2396
+ var RunStageOutcomeEvent = import_effect8.Schema.Struct({
2397
+ ...journalEnvelopeFields,
2398
+ type: import_effect8.Schema.Literal("stage-outcome"),
2399
+ outcome: StageRunOutcome
2277
2400
  });
2278
- var RunJournalEvent = import_effect7.Schema.Union([
2401
+ var RunJournalEvent = import_effect8.Schema.Union([
2279
2402
  RunStatusChangedEvent,
2280
2403
  RunRecordPatchEvent,
2281
2404
  RunTimelineEntryEvent,
@@ -2287,9 +2410,11 @@ var RunJournalEvent = import_effect7.Schema.Union([
2287
2410
  RunSteeringEvent,
2288
2411
  RunAdoptedEvent,
2289
2412
  RunStallDetectedEvent,
2290
- RunCloseoutPhaseEvent
2413
+ RunCloseoutPhaseEvent,
2414
+ RunPipelineResolvedEvent,
2415
+ RunStageOutcomeEvent
2291
2416
  ]);
2292
- var decodeRunJournalEvent = import_effect7.Schema.decodeUnknownSync(RunJournalEvent);
2417
+ var decodeRunJournalEvent = import_effect8.Schema.decodeUnknownSync(RunJournalEvent);
2293
2418
  var RUN_STATUS_TRANSITIONS = {
2294
2419
  created: ["queued", "preparing", "running", "failed", "stopped"],
2295
2420
  queued: ["preparing", "running", "failed", "stopped"],
@@ -2347,6 +2472,8 @@ function reduceRunJournal(events, runId = null) {
2347
2472
  const pendingUserInputs = new Map;
2348
2473
  const resolvedUserInputs = [];
2349
2474
  const closeoutPhases = [];
2475
+ let resolvedPipeline = null;
2476
+ const stageOutcomes = [];
2350
2477
  const anomalies = [];
2351
2478
  let steeringCount = 0;
2352
2479
  let stallCount = 0;
@@ -2480,6 +2607,14 @@ function reduceRunJournal(events, runId = null) {
2480
2607
  });
2481
2608
  break;
2482
2609
  }
2610
+ case "pipeline-resolved": {
2611
+ resolvedPipeline = event.pipeline;
2612
+ break;
2613
+ }
2614
+ case "stage-outcome": {
2615
+ stageOutcomes.push({ seq: event.seq, at: event.at, outcome: event.outcome });
2616
+ break;
2617
+ }
2483
2618
  case "timeline-entry":
2484
2619
  case "log-entry":
2485
2620
  break;
@@ -2497,6 +2632,8 @@ function reduceRunJournal(events, runId = null) {
2497
2632
  steeringCount,
2498
2633
  stallCount,
2499
2634
  closeoutPhases,
2635
+ resolvedPipeline,
2636
+ stageOutcomes,
2500
2637
  lastSeq,
2501
2638
  lastEventAt,
2502
2639
  anomalies
@@ -2515,6 +2652,8 @@ var RIG_RUN_STEERING = "rig.run.steering";
2515
2652
  var RIG_RUN_ADOPTED = "rig.run.adopted";
2516
2653
  var RIG_RUN_STALL_DETECTED = "rig.run.stall-detected";
2517
2654
  var RIG_RUN_CLOSEOUT_PHASE = "rig.run.closeout-phase";
2655
+ var RIG_RUN_PIPELINE_RESOLVED = "rig.run.pipeline-resolved";
2656
+ var RIG_RUN_STAGE_OUTCOME = "rig.run.stage-outcome";
2518
2657
  var RIG_STOP_SENTINEL = "<<RIG_STOP";
2519
2658
  var RIG_STOP_SENTINEL_END = ">>";
2520
2659
  function buildStopSentinel(runId, reason, requestedBy = "rig") {
@@ -2631,7 +2770,9 @@ var CUSTOM_TYPE_FOR = {
2631
2770
  steering: RIG_RUN_STEERING,
2632
2771
  adopted: RIG_RUN_ADOPTED,
2633
2772
  "stall-detected": RIG_RUN_STALL_DETECTED,
2634
- "closeout-phase": RIG_RUN_CLOSEOUT_PHASE
2773
+ "closeout-phase": RIG_RUN_CLOSEOUT_PHASE,
2774
+ "pipeline-resolved": RIG_RUN_PIPELINE_RESOLVED,
2775
+ "stage-outcome": RIG_RUN_STAGE_OUTCOME
2635
2776
  };
2636
2777
  var TYPE_FOR_CUSTOM = {
2637
2778
  [RIG_RUN_STATUS_CHANGED]: "status-changed",
@@ -2645,7 +2786,9 @@ var TYPE_FOR_CUSTOM = {
2645
2786
  [RIG_RUN_STEERING]: "steering",
2646
2787
  [RIG_RUN_ADOPTED]: "adopted",
2647
2788
  [RIG_RUN_STALL_DETECTED]: "stall-detected",
2648
- [RIG_RUN_CLOSEOUT_PHASE]: "closeout-phase"
2789
+ [RIG_RUN_CLOSEOUT_PHASE]: "closeout-phase",
2790
+ [RIG_RUN_PIPELINE_RESOLVED]: "pipeline-resolved",
2791
+ [RIG_RUN_STAGE_OUTCOME]: "stage-outcome"
2649
2792
  };
2650
2793
  function isRunSessionCustomType(customType) {
2651
2794
  return customType !== undefined && Object.hasOwn(TYPE_FOR_CUSTOM, customType);
@@ -3097,52 +3240,52 @@ function isOperatorActiveRunStatus(status) {
3097
3240
  return !OPERATOR_INACTIVE_RUN_STATUSES.has(normalized);
3098
3241
  }
3099
3242
  // packages/contracts/src/conversation.ts
3100
- var import_effect8 = require("effect");
3101
- var EngineMessageRole = import_effect8.Schema.Literals(["user", "assistant", "system"]);
3102
- var EngineMessageState = import_effect8.Schema.Literals([
3243
+ var import_effect9 = require("effect");
3244
+ var EngineMessageRole = import_effect9.Schema.Literals(["user", "assistant", "system"]);
3245
+ var EngineMessageState = import_effect9.Schema.Literals([
3103
3246
  "streaming",
3104
3247
  "completed",
3105
3248
  "interrupted",
3106
3249
  "errored"
3107
3250
  ]);
3108
- var ConversationSummary = import_effect8.Schema.Struct({
3251
+ var ConversationSummary = import_effect9.Schema.Struct({
3109
3252
  id: ConversationId,
3110
3253
  runId: RunId,
3111
3254
  title: TrimmedNonEmptyString,
3112
3255
  createdAt: IsoDateTime,
3113
3256
  updatedAt: IsoDateTime
3114
3257
  });
3115
- var EngineMessage = import_effect8.Schema.Struct({
3258
+ var EngineMessage = import_effect9.Schema.Struct({
3116
3259
  id: MessageId,
3117
3260
  conversationId: ConversationId,
3118
3261
  role: EngineMessageRole,
3119
- text: import_effect8.Schema.String,
3120
- attachments: import_effect8.Schema.Array(import_effect8.Schema.Unknown),
3262
+ text: import_effect9.Schema.String,
3263
+ attachments: import_effect9.Schema.Array(import_effect9.Schema.Unknown),
3121
3264
  state: EngineMessageState,
3122
3265
  createdAt: IsoDateTime,
3123
- completedAt: import_effect8.Schema.NullOr(IsoDateTime)
3266
+ completedAt: import_effect9.Schema.NullOr(IsoDateTime)
3124
3267
  });
3125
- var EngineAction = import_effect8.Schema.Struct({
3268
+ var EngineAction = import_effect9.Schema.Struct({
3126
3269
  id: ActionId,
3127
3270
  runId: RunId,
3128
- messageId: import_effect8.Schema.NullOr(MessageId),
3271
+ messageId: import_effect9.Schema.NullOr(MessageId),
3129
3272
  actionType: TrimmedNonEmptyString,
3130
3273
  title: TrimmedNonEmptyString,
3131
- detail: import_effect8.Schema.NullOr(import_effect8.Schema.String),
3274
+ detail: import_effect9.Schema.NullOr(import_effect9.Schema.String),
3132
3275
  state: TrimmedNonEmptyString,
3133
- payload: import_effect8.Schema.Unknown,
3276
+ payload: import_effect9.Schema.Unknown,
3134
3277
  startedAt: IsoDateTime,
3135
- completedAt: import_effect8.Schema.NullOr(IsoDateTime)
3278
+ completedAt: import_effect9.Schema.NullOr(IsoDateTime)
3136
3279
  });
3137
- var EngineLogTone = import_effect8.Schema.Literals(["thinking", "tool", "info", "error"]);
3138
- var EngineRunLog = import_effect8.Schema.Struct({
3280
+ var EngineLogTone = import_effect9.Schema.Literals(["thinking", "tool", "info", "error"]);
3281
+ var EngineRunLog = import_effect9.Schema.Struct({
3139
3282
  id: TrimmedNonEmptyString,
3140
3283
  runId: RunId,
3141
3284
  title: TrimmedNonEmptyString,
3142
- detail: import_effect8.Schema.NullOr(import_effect8.Schema.String),
3285
+ detail: import_effect9.Schema.NullOr(import_effect9.Schema.String),
3143
3286
  tone: EngineLogTone,
3144
- status: import_effect8.Schema.NullOr(TrimmedNonEmptyString),
3145
- payload: import_effect8.Schema.Unknown,
3287
+ status: import_effect9.Schema.NullOr(TrimmedNonEmptyString),
3288
+ payload: import_effect9.Schema.Unknown,
3146
3289
  createdAt: IsoDateTime
3147
3290
  });
3148
3291
  // packages/contracts/src/plugin.ts
@@ -3150,114 +3293,6 @@ var import_effect11 = require("effect");
3150
3293
 
3151
3294
  // packages/contracts/src/kernel.ts
3152
3295
  var import_effect10 = require("effect");
3153
-
3154
- // packages/contracts/src/stage.ts
3155
- var import_effect9 = require("effect");
3156
- var StageKind = import_effect9.Schema.Literals(["transform", "gate", "observe"]);
3157
- var StageId = TrimmedNonEmptyString.pipe(import_effect9.Schema.brand("StageId"));
3158
- var StageContext = import_effect9.Schema.Struct({
3159
- runId: RunId,
3160
- taskId: import_effect9.Schema.optional(import_effect9.Schema.NullOr(TaskId)),
3161
- state: import_effect9.Schema.Unknown,
3162
- metadata: import_effect9.Schema.optional(import_effect9.Schema.Record(import_effect9.Schema.String, import_effect9.Schema.Unknown))
3163
- });
3164
- var StageDescriptor = import_effect9.Schema.Struct({
3165
- id: StageId,
3166
- kind: StageKind,
3167
- before: import_effect9.Schema.optional(import_effect9.Schema.Array(StageId)),
3168
- after: import_effect9.Schema.optional(import_effect9.Schema.Array(StageId)),
3169
- priority: import_effect9.Schema.Number.pipe(import_effect9.Schema.withDecodingDefault(() => 0)),
3170
- protected: import_effect9.Schema.Boolean.pipe(import_effect9.Schema.withDecodingDefault(() => false))
3171
- });
3172
- var Stage = StageDescriptor;
3173
- var StageContinueResult = import_effect9.Schema.Struct({
3174
- kind: import_effect9.Schema.Literal("continue"),
3175
- ctx: StageContext
3176
- });
3177
- var StageAllowResult = import_effect9.Schema.Struct({
3178
- kind: import_effect9.Schema.Literal("allow")
3179
- });
3180
- var StageBlockResult = import_effect9.Schema.Struct({
3181
- kind: import_effect9.Schema.Literal("block"),
3182
- reason: TrimmedNonEmptyString
3183
- });
3184
- var StageResult = import_effect9.Schema.Union([
3185
- StageContinueResult,
3186
- StageAllowResult,
3187
- StageBlockResult
3188
- ]);
3189
- var StageWrapperDescriptor = import_effect9.Schema.Struct({
3190
- id: TrimmedNonEmptyString,
3191
- priority: import_effect9.Schema.Number.pipe(import_effect9.Schema.withDecodingDefault(() => 0))
3192
- });
3193
- var StageMutationOp = import_effect9.Schema.Literals(["insert", "remove", "replace", "wrap", "reorder"]);
3194
- var InsertStageMutation = import_effect9.Schema.Struct({
3195
- op: import_effect9.Schema.Literal("insert"),
3196
- stage: StageDescriptor,
3197
- contributedBy: import_effect9.Schema.optional(TrimmedNonEmptyString)
3198
- });
3199
- var RemoveStageMutation = import_effect9.Schema.Struct({
3200
- op: import_effect9.Schema.Literal("remove"),
3201
- id: StageId,
3202
- contributedBy: import_effect9.Schema.optional(TrimmedNonEmptyString)
3203
- });
3204
- var ReplaceStageMutation = import_effect9.Schema.Struct({
3205
- op: import_effect9.Schema.Literal("replace"),
3206
- id: StageId,
3207
- stage: StageDescriptor,
3208
- contributedBy: import_effect9.Schema.optional(TrimmedNonEmptyString)
3209
- });
3210
- var WrapStageMutation = import_effect9.Schema.Struct({
3211
- op: import_effect9.Schema.Literal("wrap"),
3212
- id: StageId,
3213
- around: StageWrapperDescriptor,
3214
- contributedBy: import_effect9.Schema.optional(TrimmedNonEmptyString)
3215
- });
3216
- var ReorderStageMutation = import_effect9.Schema.Struct({
3217
- op: import_effect9.Schema.Literal("reorder"),
3218
- id: StageId,
3219
- before: import_effect9.Schema.optional(import_effect9.Schema.Array(StageId)),
3220
- after: import_effect9.Schema.optional(import_effect9.Schema.Array(StageId)),
3221
- contributedBy: import_effect9.Schema.optional(TrimmedNonEmptyString)
3222
- });
3223
- var StageMutation = import_effect9.Schema.Union([
3224
- InsertStageMutation,
3225
- RemoveStageMutation,
3226
- ReplaceStageMutation,
3227
- WrapStageMutation,
3228
- ReorderStageMutation
3229
- ]);
3230
- var ResolutionGrantUse = import_effect9.Schema.Struct({
3231
- kind: import_effect9.Schema.Literals(["protected-stage", "kernel-replacement"]),
3232
- target: TrimmedNonEmptyString,
3233
- pluginId: TrimmedNonEmptyString
3234
- });
3235
- var ResolutionRecordEntry = import_effect9.Schema.Struct({
3236
- stageId: StageId,
3237
- contributedBy: TrimmedNonEmptyString,
3238
- removedBy: import_effect9.Schema.optional(TrimmedNonEmptyString),
3239
- replacedBy: import_effect9.Schema.optional(TrimmedNonEmptyString),
3240
- wrappedBy: import_effect9.Schema.optional(import_effect9.Schema.Array(TrimmedNonEmptyString)),
3241
- droppedAnchors: import_effect9.Schema.optional(import_effect9.Schema.Array(StageId)),
3242
- isProtected: import_effect9.Schema.Boolean
3243
- });
3244
- var ResolvedPipeline = import_effect9.Schema.Struct({
3245
- runId: import_effect9.Schema.optional(RunId),
3246
- order: import_effect9.Schema.Array(StageId),
3247
- record: import_effect9.Schema.Array(ResolutionRecordEntry),
3248
- cycles: import_effect9.Schema.Array(import_effect9.Schema.Array(StageId)),
3249
- grantUses: import_effect9.Schema.optional(import_effect9.Schema.Array(ResolutionGrantUse)),
3250
- resolvedAt: import_effect9.Schema.optional(IsoDateTime)
3251
- });
3252
- var ResolutionRecord = ResolvedPipeline;
3253
- var StageRunOutcome = import_effect9.Schema.Struct({
3254
- stageId: StageId,
3255
- result: StageResult,
3256
- startedAt: IsoDateTime,
3257
- finishedAt: IsoDateTime
3258
- });
3259
-
3260
- // packages/contracts/src/kernel.ts
3261
3296
  var CapabilityTag = import_effect10.Schema.Literals([
3262
3297
  "kernel",
3263
3298
  "journal",
@@ -3290,13 +3325,6 @@ var LoadedPluginDescriptor = import_effect10.Schema.Struct({
3290
3325
  contributes: import_effect10.Schema.Unknown,
3291
3326
  runtime: import_effect10.Schema.Unknown
3292
3327
  });
3293
- var ProtectedStageGrant = import_effect10.Schema.Struct({
3294
- stageId: TrimmedNonEmptyString,
3295
- pluginId: TrimmedNonEmptyString,
3296
- operations: import_effect10.Schema.Array(import_effect10.Schema.Literals(["remove", "replace"])),
3297
- grantedBy: import_effect10.Schema.optional(TrimmedNonEmptyString),
3298
- reason: import_effect10.Schema.optional(import_effect10.Schema.String)
3299
- });
3300
3328
  var KernelReplacementGrant = import_effect10.Schema.Struct({
3301
3329
  pluginId: TrimmedNonEmptyString,
3302
3330
  grantedBy: import_effect10.Schema.optional(TrimmedNonEmptyString),
@@ -3304,14 +3332,12 @@ var KernelReplacementGrant = import_effect10.Schema.Struct({
3304
3332
  });
3305
3333
  var CapabilityGrants = import_effect10.Schema.Struct({
3306
3334
  capabilityPrecedence: import_effect10.Schema.optional(import_effect10.Schema.Record(import_effect10.Schema.String, import_effect10.Schema.Array(TrimmedNonEmptyString))),
3307
- protectedStageGrants: import_effect10.Schema.optional(import_effect10.Schema.Array(ProtectedStageGrant)),
3308
3335
  kernelReplacementGrants: import_effect10.Schema.optional(import_effect10.Schema.Array(KernelReplacementGrant))
3309
3336
  });
3310
3337
  var KernelBootErrorCode = import_effect10.Schema.Literals([
3311
3338
  "BootIncoherent",
3312
3339
  "AmbiguousCapability",
3313
3340
  "MissingCapability",
3314
- "ProtectedStageViolation",
3315
3341
  "KernelReplacementDenied",
3316
3342
  "PipelineUnresolvable"
3317
3343
  ]);
@@ -3335,10 +3361,6 @@ class MissingCapability extends Error {
3335
3361
  code = "MissingCapability";
3336
3362
  }
3337
3363
 
3338
- class ProtectedStageViolation extends Error {
3339
- code = "ProtectedStageViolation";
3340
- }
3341
-
3342
3364
  class KernelReplacementDenied extends Error {
3343
3365
  code = "KernelReplacementDenied";
3344
3366
  }
@@ -3440,9 +3462,34 @@ var TaskSourceRegistration = import_effect11.Schema.Struct({
3440
3462
  });
3441
3463
  var CliCommandRegistration = import_effect11.Schema.Struct({
3442
3464
  id: import_effect11.Schema.String,
3443
- command: import_effect11.Schema.String,
3465
+ family: import_effect11.Schema.optional(import_effect11.Schema.String),
3466
+ command: import_effect11.Schema.optional(import_effect11.Schema.String),
3467
+ description: import_effect11.Schema.optional(import_effect11.Schema.String),
3468
+ usage: import_effect11.Schema.optional(import_effect11.Schema.String),
3469
+ aliases: import_effect11.Schema.optional(import_effect11.Schema.Array(import_effect11.Schema.String)),
3470
+ projectRequired: import_effect11.Schema.optional(import_effect11.Schema.Boolean)
3471
+ });
3472
+ var ProductCapabilityRegistration = import_effect11.Schema.Struct({
3473
+ id: import_effect11.Schema.String,
3474
+ title: import_effect11.Schema.String,
3475
+ description: import_effect11.Schema.optional(import_effect11.Schema.String),
3476
+ commandId: import_effect11.Schema.optional(import_effect11.Schema.String),
3477
+ panelId: import_effect11.Schema.optional(import_effect11.Schema.String)
3478
+ });
3479
+ var PanelRegistration = import_effect11.Schema.Struct({
3480
+ id: import_effect11.Schema.String,
3481
+ slot: import_effect11.Schema.String,
3482
+ title: import_effect11.Schema.String,
3483
+ capabilityId: import_effect11.Schema.optional(import_effect11.Schema.String),
3484
+ badge: import_effect11.Schema.optional(import_effect11.Schema.String),
3485
+ disabled: import_effect11.Schema.optional(import_effect11.Schema.Boolean),
3444
3486
  description: import_effect11.Schema.optional(import_effect11.Schema.String)
3445
3487
  });
3488
+ var BlockerClassifierRegistration = import_effect11.Schema.Struct({
3489
+ id: import_effect11.Schema.String,
3490
+ description: import_effect11.Schema.optional(import_effect11.Schema.String),
3491
+ priority: import_effect11.Schema.optional(import_effect11.Schema.Number)
3492
+ });
3446
3493
  var PluginContributes = import_effect11.Schema.Struct({
3447
3494
  validators: import_effect11.Schema.optional(import_effect11.Schema.Array(ValidatorRegistration)),
3448
3495
  hooks: import_effect11.Schema.optional(import_effect11.Schema.Array(HookRegistration)),
@@ -3452,7 +3499,11 @@ var PluginContributes = import_effect11.Schema.Struct({
3452
3499
  taskFieldSchemas: import_effect11.Schema.optional(import_effect11.Schema.Array(TaskFieldExtension)),
3453
3500
  taskSources: import_effect11.Schema.optional(import_effect11.Schema.Array(TaskSourceRegistration)),
3454
3501
  cliCommands: import_effect11.Schema.optional(import_effect11.Schema.Array(CliCommandRegistration)),
3455
- stageMutations: import_effect11.Schema.optional(import_effect11.Schema.Array(StageMutation))
3502
+ stages: import_effect11.Schema.optional(import_effect11.Schema.Array(Stage)),
3503
+ stageMutations: import_effect11.Schema.optional(import_effect11.Schema.Array(StageMutation)),
3504
+ capabilities: import_effect11.Schema.optional(import_effect11.Schema.Array(ProductCapabilityRegistration)),
3505
+ panels: import_effect11.Schema.optional(import_effect11.Schema.Array(PanelRegistration)),
3506
+ blockerClassifiers: import_effect11.Schema.optional(import_effect11.Schema.Array(BlockerClassifierRegistration))
3456
3507
  });
3457
3508
  var RigPlugin = import_effect11.Schema.Struct({
3458
3509
  name: import_effect11.Schema.String,
@@ -6974,7 +7025,7 @@ var PRIMARY_GROUPS = [
6974
7025
  name: "pipeline",
6975
7026
  summary: "Default lifecycle pipeline inspection.",
6976
7027
  usage: ["rig pipeline show [--json]"],
6977
- commands: [{ command: "show [--json]", description: "Show resolved default lifecycle stages, protected stages, dropped anchors, and cycles.", primary: true }],
7028
+ commands: [{ command: "show [--json]", description: "Show resolved default lifecycle stages, mutation annotations, dropped anchors, and cycles.", primary: true }],
6978
7029
  examples: ["rig pipeline show", "rig pipeline show --json"]
6979
7030
  },
6980
7031
  {