@overdeck/contracts 0.85.0 → 0.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -173,6 +173,14 @@ const DerivedPrOutsidePipeline = effect.Schema.Struct({
173
173
  /** The other worktree that has the branch checked out, when that is the reason. */
174
174
  worktreePath: effect.Schema.optional(effect.Schema.String)
175
175
  });
176
+ /**
177
+ * PAN-5279: a merged PR on an open epic's feature branch. An epic lands in
178
+ * slices, so a merged slice is progress, never the epic shipping.
179
+ */
180
+ const DerivedMergedSlice = effect.Schema.Struct({
181
+ number: effect.Schema.Number,
182
+ url: effect.Schema.String
183
+ });
176
184
  /** Everything the dashboard needs to render an issue's pipeline position. */
177
185
  const DerivedIssueState = effect.Schema.Struct({
178
186
  issueId: effect.Schema.String,
@@ -189,7 +197,13 @@ const DerivedIssueState = effect.Schema.Struct({
189
197
  /** A deferred or gave-up post-planning auto-start read from the workspace journal (PAN-4399). */
190
198
  workStart: effect.Schema.optional(DerivedWorkStart),
191
199
  /** An outside PR the pipeline never picked up (PAN-4605). */
192
- prOutsidePipeline: effect.Schema.optional(DerivedPrOutsidePipeline)
200
+ prOutsidePipeline: effect.Schema.optional(DerivedPrOutsidePipeline),
201
+ /**
202
+ * PAN-5279: the issue is an open epic and this merged PR is one of its
203
+ * slices. Present instead of `pr`, so no reader takes slice 1's review,
204
+ * checks or merge for the epic's own.
205
+ */
206
+ mergedSlice: effect.Schema.optional(DerivedMergedSlice)
193
207
  });
194
208
  const ISSUE_STATES = [
195
209
  "backlog",
@@ -499,6 +513,7 @@ const AgentRuntimeSnapshot = effect.Schema.Struct({
499
513
  lastActivity: effect.Schema.String,
500
514
  currentTool: effect.Schema.optional(effect.Schema.String),
501
515
  currentToolDescription: effect.Schema.optional(effect.Schema.String),
516
+ toolStartedAt: effect.Schema.optional(effect.Schema.String),
502
517
  thinking: effect.Schema.optional(ThinkingState),
503
518
  waiting: effect.Schema.optional(WaitingState),
504
519
  claudeSessionId: effect.Schema.optional(effect.Schema.String),
@@ -702,6 +717,54 @@ const ProjectDeploySnapshot = effect.Schema.Struct({
702
717
  /** Last lines of `logPath`. */
703
718
  logTail: effect.Schema.optional(effect.Schema.Array(effect.Schema.String))
704
719
  });
720
+ /**
721
+ * PAN-5342 — the safe-shutdown drain, derived each tick by the dashboard's
722
+ * drain service and emitted in-memory only (`system.shutdown_changed`).
723
+ * The only stored shutdown state is `<OVERDECK_HOME>/shutdown.json`.
724
+ */
725
+ const ShutdownPhase = effect.Schema.Literals([
726
+ "draining",
727
+ "waiting-for-writers",
728
+ "verifying",
729
+ "complete"
730
+ ]);
731
+ const ShutdownPendingSession = effect.Schema.Struct({
732
+ id: effect.Schema.String,
733
+ kind: effect.Schema.Literals(["agent", "conversation"]),
734
+ label: effect.Schema.String,
735
+ issueId: effect.Schema.optional(effect.Schema.String),
736
+ conversationName: effect.Schema.optional(effect.Schema.String),
737
+ /** Runtime activity, or "unknown" when the session has no runtime snapshot. */
738
+ activity: effect.Schema.String,
739
+ tool: effect.Schema.optional(effect.Schema.String),
740
+ toolDescription: effect.Schema.optional(effect.Schema.String),
741
+ toolStartedAt: effect.Schema.optional(effect.Schema.String)
742
+ });
743
+ const ShutdownWriter = effect.Schema.Struct({
744
+ kind: effect.Schema.Literals([
745
+ "auto-merge",
746
+ "post-merge",
747
+ "verification"
748
+ ]),
749
+ label: effect.Schema.String,
750
+ startedAt: effect.Schema.optional(effect.Schema.String)
751
+ });
752
+ const ShutdownSnapshot = effect.Schema.Struct({
753
+ phase: ShutdownPhase,
754
+ startedAt: effect.Schema.String,
755
+ deadlineAt: effect.Schema.String,
756
+ overdue: effect.Schema.Boolean,
757
+ reboot: effect.Schema.Boolean,
758
+ force: effect.Schema.Literals([
759
+ "never",
760
+ "at-deadline",
761
+ "now"
762
+ ]),
763
+ pending: effect.Schema.Array(ShutdownPendingSession),
764
+ writers: effect.Schema.Array(ShutdownWriter),
765
+ stoppedCount: effect.Schema.Number,
766
+ warnings: effect.Schema.Array(effect.Schema.String)
767
+ });
705
768
  /** What kind of process asked for the voluntary dashboard restart. */
706
769
  const RestartGateKind = effect.Schema.Literals([
707
770
  "deploy",
@@ -788,6 +851,7 @@ const DashboardSnapshot = effect.Schema.Struct({
788
851
  githubQuota: effect.Schema.optional(GitHubQuotaSnapshot),
789
852
  /** PAN-3751 — in-flight deploys keyed by project key. */
790
853
  deployByProjectKey: effect.Schema.optional(effect.Schema.Record(effect.Schema.String, ProjectDeploySnapshot)),
854
+ shutdown: effect.Schema.optional(effect.Schema.NullOr(ShutdownSnapshot)),
791
855
  timestamp: effect.Schema.String
792
856
  });
793
857
  const ResourceStats = effect.Schema.Struct({ containers: effect.Schema.Array(effect.Schema.Struct({
@@ -1227,7 +1291,8 @@ const RagDecisionSource = effect.Schema.Struct({
1227
1291
  "summary",
1228
1292
  "status",
1229
1293
  "sibling",
1230
- "knowledge"
1294
+ "knowledge",
1295
+ "fact"
1231
1296
  ]),
1232
1297
  scope: effect.Schema.String,
1233
1298
  score: effect.Schema.Number,
@@ -1253,7 +1318,8 @@ const RagDecision = effect.Schema.Struct({
1253
1318
  observations: effect.Schema.Number,
1254
1319
  summaries: effect.Schema.Number,
1255
1320
  sibling: effect.Schema.Number,
1256
- knowledgeIndex: effect.Schema.Number
1321
+ knowledgeIndex: effect.Schema.Number,
1322
+ facts: effect.Schema.optional(effect.Schema.Number)
1257
1323
  }),
1258
1324
  sources: effect.Schema.Array(RagDecisionSource),
1259
1325
  reason: effect.Schema.NullOr(effect.Schema.String)
@@ -1688,6 +1754,17 @@ const ProjectDeployChangedEvent = effect.Schema.Struct({
1688
1754
  timestamp: effect.Schema.String,
1689
1755
  payload: effect.Schema.Struct({ deploys: effect.Schema.Record(effect.Schema.String, ProjectDeploySnapshot) })
1690
1756
  });
1757
+ /**
1758
+ * PAN-5342 — the safe-shutdown drain snapshot; `null` when no drain runs.
1759
+ * The dashboard's drain service emits it in-memory only (`emitOnly`), like
1760
+ * `project.deploy_changed`: never persisted, never replayed at boot.
1761
+ */
1762
+ const SystemShutdownChangedEvent = effect.Schema.Struct({
1763
+ type: effect.Schema.Literal("system.shutdown_changed"),
1764
+ sequence: SequenceNumber,
1765
+ timestamp: effect.Schema.String,
1766
+ payload: effect.Schema.Struct({ shutdown: effect.Schema.NullOr(ShutdownSnapshot) })
1767
+ });
1691
1768
  /** Replaces socket.io `agents:changed` (event: 'started') */
1692
1769
  const AgentStartedEvent = effect.Schema.Struct({
1693
1770
  type: effect.Schema.Literal("agent.started"),
@@ -3007,6 +3084,7 @@ const DomainEvent = effect.Schema.Union([
3007
3084
  RestartGateChangedEvent,
3008
3085
  GitHubQuotaChangedEvent,
3009
3086
  ProjectDeployChangedEvent,
3087
+ SystemShutdownChangedEvent,
3010
3088
  AgentCreatedEvent,
3011
3089
  AgentEnrichmentChangedEvent,
3012
3090
  AgentStartedEvent,
@@ -3357,6 +3435,38 @@ function compareEffort(a, b) {
3357
3435
  return EFFORT_LEVELS.indexOf(a) - EFFORT_LEVELS.indexOf(b);
3358
3436
  }
3359
3437
  //#endregion
3438
+ //#region src/ui-commands.ts
3439
+ /** The server's answer for a path: which deck, root and file or folder to show. */
3440
+ const UiOpenResolution = effect.Schema.Struct({
3441
+ /** The registered project key (`projects.yaml`), as root ids use it. */
3442
+ projectKey: effect.Schema.String,
3443
+ /** The deck the dashboard keys this project by: its name, or its key when it has none (PAN-5398). */
3444
+ deckKey: effect.Schema.String,
3445
+ rootId: effect.Schema.String,
3446
+ /** POSIX path relative to the root folder; `''` for the root itself. */
3447
+ relPath: effect.Schema.String,
3448
+ kind: effect.Schema.Literals(["file", "dir"]),
3449
+ line: effect.Schema.optional(effect.Schema.Number),
3450
+ column: effect.Schema.optional(effect.Schema.Number)
3451
+ });
3452
+ /** The deck key the project switcher selects for a registered project: its name, or its key (PAN-5398). */
3453
+ function projectDeckKey(project) {
3454
+ return project.name ?? project.key;
3455
+ }
3456
+ /** The sentence `pan open` prints and the dashboard toasts after an open (PAN-5398). */
3457
+ function uiOpenSummary(resolution) {
3458
+ const { deckKey, rootId, relPath } = resolution;
3459
+ if (relPath) return `Opened ${relPath} in ${deckKey}`;
3460
+ if (rootId.startsWith("issue:")) return `Opened the ${rootId.slice(6)} workspace in ${deckKey}`;
3461
+ return `Opened root folder in ${deckKey}`;
3462
+ }
3463
+ /** One UI command. `id` is a random UUID that tabs use to dedupe handling. */
3464
+ const UiCommand = effect.Schema.Struct({
3465
+ id: effect.Schema.String,
3466
+ type: effect.Schema.Literal("open-path"),
3467
+ resolution: UiOpenResolution
3468
+ });
3469
+ //#endregion
3360
3470
  //#region src/explorer.ts
3361
3471
  /** "project:<key>", "issue:<id>" or "workspace:<id>". */
3362
3472
  const ExplorerRootId = effect.Schema.String;
@@ -3567,6 +3677,7 @@ const WS_METHODS = {
3567
3677
  subscribeAgentOutput: "pan.subscribeAgentOutput",
3568
3678
  subscribeConversationMessages: "pan.subscribeConversationMessages",
3569
3679
  subscribeProjectSessionTree: "pan.subscribeProjectSessionTree",
3680
+ subscribeUiCommands: "pan.subscribeUiCommands",
3570
3681
  getSnapshot: "pan.getSnapshot",
3571
3682
  replayEvents: "pan.replayEvents",
3572
3683
  readWorkspaceFile: "pan.readWorkspaceFile",
@@ -3800,6 +3911,12 @@ const SubscribeDomainEventsRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.subscri
3800
3911
  success: DomainEvent,
3801
3912
  stream: true
3802
3913
  });
3914
+ /** 1a. Subscribe to transient UI commands such as "open this path" (stream, PAN-5349) */
3915
+ const SubscribeUiCommandsRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.subscribeUiCommands, {
3916
+ payload: effect.Schema.Struct({}),
3917
+ success: UiCommand,
3918
+ stream: true
3919
+ });
3803
3920
  /** 1b. Subscribe to the live domain event stream for one issue (stream) */
3804
3921
  const SubscribeIssueEventsRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.subscribeIssueEvents, {
3805
3922
  payload: effect.Schema.Struct({ issueId: IssueId }),
@@ -4288,7 +4405,7 @@ const GetConversationStatsRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.getConve
4288
4405
  error: PanRpcError
4289
4406
  });
4290
4407
  /** All Overdeck WebSocket RPC methods */
4291
- const PanRpcGroup = effect_unstable_rpc_RpcGroup.make(SubscribeDomainEventsRpc, SubscribeIssueEventsRpc, SubscribeTerminalRpc, SubscribeAgentOutputRpc, GetSnapshotRpc, ReplayEventsRpc, ReadWorkspaceFileRpc, ReadFileAtPathRpc, WriteFileAtPathRpc, ResolveFilePathExistsRpc, ExplorerListDirRpc, ExplorerReadFileRpc, ExplorerWriteFileRpc, ExplorerCreateRpc, ExplorerRenameRpc, ExplorerCopyRpc, ExplorerDeleteRpc, ExplorerRestoreRpc, ExplorerGitStatusRpc, ExplorerGitStageRpc, ExplorerSearchFilesRpc, ExplorerSearchContentRpc, ExplorerWatchRpc, ExplorerBeginEditRpc, TerminalOpenRpc, TerminalWriteRpc, TerminalResizeRpc, TerminalCloseRpc, StartPlanningRpc, StartAgentRpc, DeepWipeRpc, SendTerminalInputRpc, ResizeTerminalRpc, SubscribeConversationMessagesRpc, SubscribeProjectSessionTreeRpc, ShellOpenInEditorRpc, GetAvailableEditorsRpc, ShellOpenInBrowserRpc, GetAvailableBrowsersRpc, ScanConversationsRpc, SearchConversationsRpc, ListDiscoveredSessionsRpc, ListSessionsFeedRpc, GetSessionsFeedFacetsRpc, GetDiscoveredSessionRpc, EnrichSessionsRpc, EmbedSessionsRpc, GetConversationCostRpc, GetConversationCostByWorkspaceRpc, GetConversationStatsRpc);
4408
+ const PanRpcGroup = effect_unstable_rpc_RpcGroup.make(SubscribeDomainEventsRpc, SubscribeUiCommandsRpc, SubscribeIssueEventsRpc, SubscribeTerminalRpc, SubscribeAgentOutputRpc, GetSnapshotRpc, ReplayEventsRpc, ReadWorkspaceFileRpc, ReadFileAtPathRpc, WriteFileAtPathRpc, ResolveFilePathExistsRpc, ExplorerListDirRpc, ExplorerReadFileRpc, ExplorerWriteFileRpc, ExplorerCreateRpc, ExplorerRenameRpc, ExplorerCopyRpc, ExplorerDeleteRpc, ExplorerRestoreRpc, ExplorerGitStatusRpc, ExplorerGitStageRpc, ExplorerSearchFilesRpc, ExplorerSearchContentRpc, ExplorerWatchRpc, ExplorerBeginEditRpc, TerminalOpenRpc, TerminalWriteRpc, TerminalResizeRpc, TerminalCloseRpc, StartPlanningRpc, StartAgentRpc, DeepWipeRpc, SendTerminalInputRpc, ResizeTerminalRpc, SubscribeConversationMessagesRpc, SubscribeProjectSessionTreeRpc, ShellOpenInEditorRpc, GetAvailableEditorsRpc, ShellOpenInBrowserRpc, GetAvailableBrowsersRpc, ScanConversationsRpc, SearchConversationsRpc, ListDiscoveredSessionsRpc, ListSessionsFeedRpc, GetSessionsFeedFacetsRpc, GetDiscoveredSessionRpc, EnrichSessionsRpc, EmbedSessionsRpc, GetConversationCostRpc, GetConversationCostByWorkspaceRpc, GetConversationStatsRpc);
4292
4409
  //#endregion
4293
4410
  //#region src/agent-runtime-merge.ts
4294
4411
  function defaultRuntimeSnapshot(agentId, timestamp, sequence) {
@@ -4376,6 +4493,7 @@ const INITIAL_READ_MODEL_STATE = {
4376
4493
  restartGate: null,
4377
4494
  githubQuota: null,
4378
4495
  deployByProjectKey: {},
4496
+ shutdown: null,
4379
4497
  agentIdBySessionId: {},
4380
4498
  dashboardLifecycle: {
4381
4499
  active: false,
@@ -4484,6 +4602,7 @@ function syncSnapshot(state, snapshot) {
4484
4602
  restartGate: snapshot.restartGate ?? state.restartGate,
4485
4603
  githubQuota: snapshot.githubQuota ?? state.githubQuota,
4486
4604
  deployByProjectKey: snapshot.deployByProjectKey ?? state.deployByProjectKey,
4605
+ shutdown: snapshot.shutdown ?? null,
4487
4606
  agentIdBySessionId
4488
4607
  };
4489
4608
  }
@@ -4589,6 +4708,7 @@ function applyEvent(state, event) {
4589
4708
  ...prevRuntime,
4590
4709
  activity: "stopped",
4591
4710
  currentTool: void 0,
4711
+ toolStartedAt: void 0,
4592
4712
  currentToolDescription: void 0,
4593
4713
  thinking: void 0,
4594
4714
  waiting: void 0,
@@ -4735,6 +4855,7 @@ function applyEvent(state, event) {
4735
4855
  ...prevRuntime,
4736
4856
  activity: "stopped",
4737
4857
  currentTool: void 0,
4858
+ toolStartedAt: void 0,
4738
4859
  currentToolDescription: void 0,
4739
4860
  thinking: void 0,
4740
4861
  waiting: void 0,
@@ -4915,6 +5036,11 @@ function applyEvent(state, event) {
4915
5036
  sequence: Math.max(state.sequence, event.sequence),
4916
5037
  deployByProjectKey: event.payload.deploys
4917
5038
  };
5039
+ case "system.shutdown_changed": return {
5040
+ ...state,
5041
+ sequence: Math.max(state.sequence, event.sequence),
5042
+ shutdown: event.payload.shutdown
5043
+ };
4918
5044
  case "resources.updated": return {
4919
5045
  ...state,
4920
5046
  sequence: Math.max(state.sequence, event.sequence),
@@ -5163,13 +5289,14 @@ function applyEvent(state, event) {
5163
5289
  sequence: Math.max(state.sequence, event.sequence)
5164
5290
  };
5165
5291
  case "agent.activity_changed": {
5166
- const { agentId, activity, currentTool, toolDescription } = event.payload;
5292
+ const { agentId, activity, currentTool, toolDescription, hookName } = event.payload;
5167
5293
  const prev = state.agentRuntimeById[agentId] ?? defaultRuntimeSnapshot(agentId, event.timestamp, event.sequence);
5168
5294
  const next = {
5169
5295
  ...prev,
5170
5296
  activity,
5171
5297
  currentTool: activity === "working" ? currentTool : void 0,
5172
5298
  currentToolDescription: activity === "working" ? toolDescription : void 0,
5299
+ toolStartedAt: activity !== "working" ? void 0 : hookName === "PreToolUse" ? event.timestamp : hookName === "PostToolUse" ? void 0 : prev.toolStartedAt,
5173
5300
  thinking: activity === "thinking" ? prev.thinking : void 0,
5174
5301
  waiting: activity === "waiting" ? prev.waiting : void 0,
5175
5302
  channelReply: activity === "working" ? void 0 : prev.channelReply,
@@ -5191,6 +5318,7 @@ function applyEvent(state, event) {
5191
5318
  ...state.agentRuntimeById[agentId] ?? defaultRuntimeSnapshot(agentId, event.timestamp, event.sequence),
5192
5319
  activity: "thinking",
5193
5320
  currentTool: void 0,
5321
+ toolStartedAt: void 0,
5194
5322
  currentToolDescription: void 0,
5195
5323
  thinking: {
5196
5324
  since: event.timestamp,
@@ -5238,6 +5366,7 @@ function applyEvent(state, event) {
5238
5366
  ...state.agentRuntimeById[agentId] ?? defaultRuntimeSnapshot(agentId, event.timestamp, event.sequence),
5239
5367
  activity: "waiting",
5240
5368
  currentTool: void 0,
5369
+ toolStartedAt: void 0,
5241
5370
  currentToolDescription: void 0,
5242
5371
  thinking: void 0,
5243
5372
  waiting: {
@@ -6081,7 +6210,9 @@ const FlywheelNeedsYouItem = effect.Schema.Struct({
6081
6210
  /** The first-raised tick message's `createdAt`. */
6082
6211
  firstRaisedAt: effect.Schema.String,
6083
6212
  /** The first-raised tick message's id, when the harness records one. */
6084
- firstRaisedMessageId: effect.Schema.optional(effect.Schema.String)
6213
+ firstRaisedMessageId: effect.Schema.optional(effect.Schema.String),
6214
+ /** The first-raised message's prose without its tick line (PAN-5283 D18). */
6215
+ context: effect.Schema.optional(effect.Schema.String)
6085
6216
  });
6086
6217
  const NEEDS_YOU_TARGET_RE = /^(.*?)\s*<(https?:\/\/[^\s<>]+)>\s*$/i;
6087
6218
  /**
@@ -6148,6 +6279,82 @@ const FlywheelAgentSummary = effect.Schema.Struct({
6148
6279
  state: effect.Schema.String,
6149
6280
  agentId: effect.Schema.optional(effect.Schema.String)
6150
6281
  });
6282
+ /** The lane an in-flight card sits in (PAN-5283 D1). */
6283
+ const FlywheelStage = effect.Schema.Literals([
6284
+ "plan",
6285
+ "build",
6286
+ "checks",
6287
+ "review",
6288
+ "merge"
6289
+ ]);
6290
+ /** Who drives an issue (PAN-5283 D3). */
6291
+ const FlywheelOwner = effect.Schema.Union([
6292
+ effect.Schema.Struct({ kind: effect.Schema.Literal("flywheel") }),
6293
+ effect.Schema.Struct({
6294
+ kind: effect.Schema.Literal("conversation"),
6295
+ name: effect.Schema.String,
6296
+ title: effect.Schema.NullOr(effect.Schema.String)
6297
+ }),
6298
+ effect.Schema.Struct({ kind: effect.Schema.Literal("operator") })
6299
+ ]);
6300
+ /** The agent a card shows (PAN-5283 D4): a live pane, or a handoff conversation. */
6301
+ const FlywheelCardAgent = effect.Schema.Struct({
6302
+ /** The pane role, or `handoff` for a handoff conversation. */
6303
+ role: effect.Schema.String,
6304
+ model: effect.Schema.NullOr(effect.Schema.String),
6305
+ harness: effect.Schema.NullOr(effect.Schema.String),
6306
+ state: effect.Schema.Literals([
6307
+ "working",
6308
+ "blocked",
6309
+ "idle",
6310
+ "waiting",
6311
+ "unknown"
6312
+ ]),
6313
+ agentId: effect.Schema.optional(effect.Schema.String),
6314
+ conversationName: effect.Schema.optional(effect.Schema.String)
6315
+ });
6316
+ const FlywheelBlockerKind = effect.Schema.Literals([
6317
+ "gate-queue",
6318
+ "agent-question",
6319
+ "agent-error",
6320
+ "start-failed",
6321
+ "pr-outside-pipeline",
6322
+ "agent-stuck",
6323
+ "test-removal-waiver",
6324
+ "verification-failed",
6325
+ "ci-failed",
6326
+ "feedback-undelivered",
6327
+ "merge-failed",
6328
+ "auto-merge-scheduled",
6329
+ "auto-merge-blocked",
6330
+ "train-batch",
6331
+ "train-paused",
6332
+ "ci-red",
6333
+ "merge-conflict",
6334
+ "declared-blocked",
6335
+ "review-stalled",
6336
+ "no-agent"
6337
+ ]);
6338
+ /** One plain-language sentence on why a card is not moving (PAN-5283 D11). */
6339
+ const FlywheelBlocker = effect.Schema.Struct({
6340
+ kind: FlywheelBlockerKind,
6341
+ severity: effect.Schema.Literals([
6342
+ "waiting",
6343
+ "stuck",
6344
+ "needs-you"
6345
+ ]),
6346
+ text: effect.Schema.String,
6347
+ action: effect.Schema.optional(effect.Schema.Literals([
6348
+ "waive-test-removal",
6349
+ "start-issue",
6350
+ "answer-agent"
6351
+ ]))
6352
+ });
6353
+ /** The newest journal entry, as a plain-text label. */
6354
+ const FlywheelActivity = effect.Schema.Struct({
6355
+ at: effect.Schema.String,
6356
+ label: effect.Schema.String
6357
+ });
6151
6358
  const FlywheelInFlightRow = effect.Schema.Struct({
6152
6359
  issueId: effect.Schema.String,
6153
6360
  /** The tracker's title, or `null` when no tracker answered for this issue. */
@@ -6163,7 +6370,15 @@ const FlywheelInFlightRow = effect.Schema.Struct({
6163
6370
  liveAgents: effect.Schema.Number,
6164
6371
  /** The loop named this id in its newest tick marker's in-flight list. */
6165
6372
  inTick: effect.Schema.Boolean,
6166
- lastJournal: effect.Schema.NullOr(FlywheelJournalSummary)
6373
+ lastJournal: effect.Schema.NullOr(FlywheelJournalSummary),
6374
+ stage: effect.Schema.optional(FlywheelStage),
6375
+ stageSince: effect.Schema.optional(effect.Schema.NullOr(effect.Schema.String)),
6376
+ owner: effect.Schema.optional(FlywheelOwner),
6377
+ agent: effect.Schema.optional(effect.Schema.NullOr(FlywheelCardAgent)),
6378
+ blocker: effect.Schema.optional(effect.Schema.NullOr(FlywheelBlocker)),
6379
+ /** USD spent on the issue, or `null` when unknown. */
6380
+ cost: effect.Schema.optional(effect.Schema.NullOr(effect.Schema.Number)),
6381
+ lastActivity: effect.Schema.optional(effect.Schema.NullOr(FlywheelActivity))
6167
6382
  });
6168
6383
  const FlywheelOrderBookSummary = effect.Schema.Struct({
6169
6384
  id: effect.Schema.String,
@@ -6172,6 +6387,73 @@ const FlywheelOrderBookSummary = effect.Schema.Struct({
6172
6387
  landed: effect.Schema.Number,
6173
6388
  total: effect.Schema.Number
6174
6389
  });
6390
+ /** One PR merge on the default branch since local midnight (PAN-5283 D12). */
6391
+ const FlywheelShippedMerge = effect.Schema.Struct({
6392
+ sha: effect.Schema.String,
6393
+ at: effect.Schema.String,
6394
+ subject: effect.Schema.String,
6395
+ prNumber: effect.Schema.Number,
6396
+ prUrl: effect.Schema.NullOr(effect.Schema.String),
6397
+ issueId: effect.Schema.NullOr(effect.Schema.String),
6398
+ title: effect.Schema.NullOr(effect.Schema.String),
6399
+ /** `null` when deploy does not apply to this project (PAN-5283 D13). */
6400
+ deployed: effect.Schema.NullOr(effect.Schema.Boolean)
6401
+ });
6402
+ const FlywheelShippedEvent = effect.Schema.Union([
6403
+ effect.Schema.Struct({
6404
+ kind: effect.Schema.Literal("merge"),
6405
+ at: effect.Schema.String,
6406
+ merge: FlywheelShippedMerge
6407
+ }),
6408
+ effect.Schema.Struct({
6409
+ kind: effect.Schema.Literal("deploy"),
6410
+ at: effect.Schema.String,
6411
+ trigger: effect.Schema.String,
6412
+ issueId: effect.Schema.NullOr(effect.Schema.String),
6413
+ initiator: effect.Schema.NullOr(effect.Schema.String)
6414
+ }),
6415
+ effect.Schema.Struct({
6416
+ kind: effect.Schema.Literal("release"),
6417
+ at: effect.Schema.String,
6418
+ tag: effect.Schema.String,
6419
+ url: effect.Schema.NullOr(effect.Schema.String)
6420
+ })
6421
+ ]);
6422
+ const FlywheelShipped = effect.Schema.Struct({
6423
+ merges: effect.Schema.Array(FlywheelShippedMerge),
6424
+ events: effect.Schema.Array(FlywheelShippedEvent)
6425
+ });
6426
+ /** Facts the global header does not show (PAN-5283 FR-9). Server route only. */
6427
+ const FlywheelHealth = effect.Schema.Struct({
6428
+ mainCi: effect.Schema.NullOr(effect.Schema.Struct({
6429
+ conclusion: effect.Schema.String,
6430
+ sha: effect.Schema.String,
6431
+ url: effect.Schema.NullOr(effect.Schema.String),
6432
+ at: effect.Schema.String
6433
+ })),
6434
+ deployed: effect.Schema.NullOr(effect.Schema.Struct({
6435
+ buildCommit: effect.Schema.String,
6436
+ behindVerdict: effect.Schema.NullOr(effect.Schema.Number)
6437
+ })),
6438
+ gateQueue: effect.Schema.Struct({
6439
+ running: effect.Schema.Number,
6440
+ queued: effect.Schema.Number,
6441
+ slots: effect.Schema.Number,
6442
+ oldestWaitSince: effect.Schema.NullOr(effect.Schema.String)
6443
+ }),
6444
+ nextBatch: effect.Schema.NullOr(effect.Schema.Struct({
6445
+ name: effect.Schema.String,
6446
+ status: effect.Schema.String,
6447
+ members: effect.Schema.Array(effect.Schema.String),
6448
+ createdAt: effect.Schema.String
6449
+ })),
6450
+ batchingPausedUntil: effect.Schema.NullOr(effect.Schema.String),
6451
+ lastRelease: effect.Schema.NullOr(effect.Schema.Struct({
6452
+ tag: effect.Schema.String,
6453
+ at: effect.Schema.String,
6454
+ url: effect.Schema.NullOr(effect.Schema.String)
6455
+ }))
6456
+ });
6175
6457
  const FlywheelDerivedStatus = effect.Schema.Struct({
6176
6458
  run: FlywheelRunState,
6177
6459
  conversation: effect.Schema.NullOr(FlywheelConversationSummary),
@@ -6188,8 +6470,15 @@ const FlywheelDerivedStatus = effect.Schema.Struct({
6188
6470
  inFlightSource: effect.Schema.Literals(["tick", "census"]),
6189
6471
  orderBook: effect.Schema.NullOr(FlywheelOrderBookSummary),
6190
6472
  projectRoot: effect.Schema.String,
6191
- generatedAt: effect.Schema.String
6473
+ generatedAt: effect.Schema.String,
6474
+ /** Added by the status route, never by `pan flywheel status` (PAN-5283 D7). */
6475
+ health: effect.Schema.optional(FlywheelHealth),
6476
+ shipped: effect.Schema.optional(FlywheelShipped)
6192
6477
  });
6478
+ /** Cards on the Deploy and Done-today lanes. */
6479
+ function shippedCardCount(status) {
6480
+ return status.shipped?.merges.length ?? 0;
6481
+ }
6193
6482
  const decodeFlywheelDerivedStatus = effect.Schema.decodeUnknownSync(FlywheelDerivedStatus);
6194
6483
  //#endregion
6195
6484
  //#region src/orders.ts
@@ -6574,7 +6863,8 @@ const HARNESS_CAPABILITY_KEYS = [
6574
6863
  "answersQuestionByMessage",
6575
6864
  "askAnswerDelivery",
6576
6865
  "runsOnFlyMachine",
6577
- "overdeckMcp"
6866
+ "overdeckMcp",
6867
+ "skillSlashCommands"
6578
6868
  ];
6579
6869
  const CLAUDE_CODE_CAPABILITIES = {
6580
6870
  contextChannel: "append-system-prompt-file",
@@ -6598,7 +6888,8 @@ const CLAUDE_CODE_CAPABILITIES = {
6598
6888
  answersQuestionByMessage: true,
6599
6889
  askAnswerDelivery: "message",
6600
6890
  runsOnFlyMachine: true,
6601
- overdeckMcp: true
6891
+ overdeckMcp: true,
6892
+ skillSlashCommands: true
6602
6893
  };
6603
6894
  const OHMYPI_CAPABILITIES = {
6604
6895
  contextChannel: "append-system-prompt",
@@ -6622,7 +6913,8 @@ const OHMYPI_CAPABILITIES = {
6622
6913
  answersQuestionByMessage: false,
6623
6914
  askAnswerDelivery: "pi-ask-modal",
6624
6915
  runsOnFlyMachine: false,
6625
- overdeckMcp: false
6916
+ overdeckMcp: false,
6917
+ skillSlashCommands: false
6626
6918
  };
6627
6919
  /**
6628
6920
  * Pi Coding Agent (PAN-5212). Same launch channel and transcript handling as
@@ -6658,7 +6950,8 @@ const CODEX_CAPABILITIES = {
6658
6950
  answersQuestionByMessage: false,
6659
6951
  askAnswerDelivery: "codex-approval",
6660
6952
  runsOnFlyMachine: true,
6661
- overdeckMcp: true
6953
+ overdeckMcp: true,
6954
+ skillSlashCommands: false
6662
6955
  };
6663
6956
  const ACP_CAPABILITIES = {
6664
6957
  contextChannel: "acp-initial-context",
@@ -6682,7 +6975,8 @@ const ACP_CAPABILITIES = {
6682
6975
  answersQuestionByMessage: false,
6683
6976
  askAnswerDelivery: "message",
6684
6977
  runsOnFlyMachine: false,
6685
- overdeckMcp: true
6978
+ overdeckMcp: true,
6979
+ skillSlashCommands: false
6686
6980
  };
6687
6981
  const KIMI_CODE_CAPABILITIES = {
6688
6982
  contextChannel: "initial-message-envelope",
@@ -6706,7 +7000,8 @@ const KIMI_CODE_CAPABILITIES = {
6706
7000
  answersQuestionByMessage: false,
6707
7001
  askAnswerDelivery: "message",
6708
7002
  runsOnFlyMachine: false,
6709
- overdeckMcp: false
7003
+ overdeckMcp: false,
7004
+ skillSlashCommands: false
6710
7005
  };
6711
7006
  const OPENCODE_CAPABILITIES = {
6712
7007
  contextChannel: "acp-initial-context",
@@ -6730,7 +7025,8 @@ const OPENCODE_CAPABILITIES = {
6730
7025
  answersQuestionByMessage: false,
6731
7026
  askAnswerDelivery: "message",
6732
7027
  runsOnFlyMachine: false,
6733
- overdeckMcp: true
7028
+ overdeckMcp: true,
7029
+ skillSlashCommands: false
6734
7030
  };
6735
7031
  const GROK_CAPABILITIES = {
6736
7032
  ...OPENCODE_CAPABILITIES,
@@ -6761,7 +7057,8 @@ const MUSE_CAPABILITIES = {
6761
7057
  answersQuestionByMessage: false,
6762
7058
  askAnswerDelivery: "message",
6763
7059
  runsOnFlyMachine: false,
6764
- overdeckMcp: false
7060
+ overdeckMcp: false,
7061
+ skillSlashCommands: false
6765
7062
  };
6766
7063
  const PRIME_AGENT_CAPABILITIES = {
6767
7064
  contextChannel: "prime-agent-append-system-prompt",
@@ -6785,7 +7082,8 @@ const PRIME_AGENT_CAPABILITIES = {
6785
7082
  answersQuestionByMessage: false,
6786
7083
  askAnswerDelivery: "message",
6787
7084
  runsOnFlyMachine: false,
6788
- overdeckMcp: false
7085
+ overdeckMcp: false,
7086
+ skillSlashCommands: false
6789
7087
  };
6790
7088
  //#endregion
6791
7089
  //#region src/harness-behavior.ts
@@ -7368,6 +7666,7 @@ const TELEMETRY_CLIENT_ROUTES = [
7368
7666
  "/api/agents/:id/message",
7369
7667
  "/api/agents/:id/permissions/:requestId/respond",
7370
7668
  "/api/agents/:id/plan-action",
7669
+ "/api/agents/:id/send-now",
7371
7670
  "/api/agents/:id/tell",
7372
7671
  "/api/backend-restart-recovery",
7373
7672
  "/api/backend-restart-recovery/dismiss",
@@ -7383,6 +7682,8 @@ const TELEMETRY_CLIENT_ROUTES = [
7383
7682
  "/api/conversations/:name/about",
7384
7683
  "/api/conversations/:name/attachments/:file",
7385
7684
  "/api/conversations/:name/bookmarks",
7685
+ "/api/conversations/:name/changes",
7686
+ "/api/conversations/:name/changes/lines",
7386
7687
  "/api/conversations/:name/compact",
7387
7688
  "/api/conversations/:name/delete-image",
7388
7689
  "/api/conversations/:name/diffs",
@@ -7405,6 +7706,7 @@ const TELEMETRY_CLIENT_ROUTES = [
7405
7706
  "/api/conversations/:name/scheduled-messages/:id",
7406
7707
  "/api/conversations/:name/schedules",
7407
7708
  "/api/conversations/:name/schedules/:id",
7709
+ "/api/conversations/:name/send-now",
7408
7710
  "/api/conversations/:name/stop",
7409
7711
  "/api/conversations/:name/switch-model",
7410
7712
  "/api/conversations/:name/thinking-level",
@@ -7416,6 +7718,7 @@ const TELEMETRY_CLIENT_ROUTES = [
7416
7718
  "/api/disk-alert",
7417
7719
  "/api/explorer/download",
7418
7720
  "/api/explorer/edit-workspaces/:workspaceId",
7721
+ "/api/explorer/edit-workspaces/:workspaceId/changes",
7419
7722
  "/api/explorer/edit-workspaces/:workspaceId/discard",
7420
7723
  "/api/explorer/edit-workspaces/:workspaceId/merge",
7421
7724
  "/api/explorer/edit-workspaces/:workspaceId/pr",
@@ -7490,7 +7793,13 @@ const TELEMETRY_CLIENT_ROUTES = [
7490
7793
  "/api/self/workers/:id",
7491
7794
  "/api/self/workers/:id/wait",
7492
7795
  "/api/settings/resolved",
7796
+ "/api/shutdown",
7797
+ "/api/shutdown/cancel",
7798
+ "/api/shutdown/force-all",
7799
+ "/api/shutdown/force-stop",
7800
+ "/api/shutdown/preview",
7493
7801
  "/api/telemetry/client-config",
7802
+ "/api/ui/open",
7494
7803
  "/api/versions/self",
7495
7804
  "/api/versions/self/update",
7496
7805
  "/api/workers",
@@ -7602,6 +7911,7 @@ const TELEMETRY_CLIENT_ROUTE_AREAS = [
7602
7911
  "share-probe",
7603
7912
  "shares",
7604
7913
  "show",
7914
+ "shutdown",
7605
7915
  "skills",
7606
7916
  "specialists",
7607
7917
  "system",
@@ -7613,6 +7923,7 @@ const TELEMETRY_CLIENT_ROUTE_AREAS = [
7613
7923
  "trackers",
7614
7924
  "triggers",
7615
7925
  "tts",
7926
+ "ui",
7616
7927
  "update",
7617
7928
  "vault",
7618
7929
  "velocity",
@@ -10045,20 +10356,70 @@ const COMPOSER_COMMAND_MANIFEST = [
10045
10356
  "id": "pan-open",
10046
10357
  "path": ["open"],
10047
10358
  "display": "/pan open",
10048
- "description": "Open an issue workspace in your preferred editor",
10359
+ "description": "Open a file, folder or issue workspace in Overdeck",
10049
10360
  "args": [{
10050
- "name": "id",
10361
+ "name": "target",
10051
10362
  "required": true,
10052
10363
  "variadic": false
10053
10364
  }],
10365
+ "options": [
10366
+ {
10367
+ "flags": "-e, --editor [editor]",
10368
+ "description": "Open in an external editor instead (cursor, vscode, zed, file-manager, …)",
10369
+ "required": false,
10370
+ "valueHint": "editor"
10371
+ },
10372
+ {
10373
+ "flags": "--line <n>",
10374
+ "description": "Open a file at this line",
10375
+ "required": true,
10376
+ "valueHint": "n"
10377
+ },
10378
+ {
10379
+ "flags": "--column <n>",
10380
+ "description": "Open a file at this column",
10381
+ "required": true,
10382
+ "valueHint": "n"
10383
+ },
10384
+ {
10385
+ "flags": "--new-tab",
10386
+ "description": "Open in a new browser tab instead of the focused dashboard tab",
10387
+ "required": false,
10388
+ "valueHint": null
10389
+ }
10390
+ ],
10391
+ "aliases": [],
10392
+ "category": "Observation"
10393
+ },
10394
+ {
10395
+ "id": "pan-integrate",
10396
+ "path": ["integrate"],
10397
+ "display": "/pan integrate",
10398
+ "description": "Add Overdeck to other tools on this machine",
10399
+ "args": [],
10400
+ "options": [],
10401
+ "aliases": [],
10402
+ "category": "Core"
10403
+ },
10404
+ {
10405
+ "id": "pan-integrate-file-manager",
10406
+ "path": ["integrate", "file-manager"],
10407
+ "display": "/pan integrate file-manager",
10408
+ "description": "Add \"Open in Overdeck\" to the file manager's right-click menu",
10409
+ "args": [],
10054
10410
  "options": [{
10055
- "flags": "-e, --editor <editor>",
10056
- "description": "Editor to use (cursor, windsurf, vscode, zed, etc.)",
10057
- "required": true,
10058
- "valueHint": "editor"
10411
+ "flags": "--remove",
10412
+ "description": "Remove the entries this command added",
10413
+ "required": false,
10414
+ "valueHint": null
10415
+ }, {
10416
+ "flags": "--dry-run",
10417
+ "description": "Print what would be written, deleted or run, and change nothing",
10418
+ "required": false,
10419
+ "valueHint": null
10059
10420
  }],
10060
10421
  "aliases": [],
10061
- "category": "Observation"
10422
+ "category": "Core"
10062
10423
  },
10063
10424
  {
10064
10425
  "id": "pan-review",
@@ -13632,6 +13993,12 @@ const COMPOSER_COMMAND_MANIFEST = [
13632
13993
  "required": false,
13633
13994
  "valueHint": null
13634
13995
  },
13996
+ {
13997
+ "flags": "--all",
13998
+ "description": "List every fact, including superseded and retired ones",
13999
+ "required": false,
14000
+ "valueHint": null
14001
+ },
13635
14002
  {
13636
14003
  "flags": "--project <key>",
13637
14004
  "description": "Project key (defaults to the project owning the cwd)",
@@ -13713,6 +14080,24 @@ const COMPOSER_COMMAND_MANIFEST = [
13713
14080
  "required": true,
13714
14081
  "valueHint": "a,b"
13715
14082
  },
14083
+ {
14084
+ "flags": "--always",
14085
+ "description": "List this fact first in every launch index and leave it out of prompt-time retrieval",
14086
+ "required": false,
14087
+ "valueHint": null
14088
+ },
14089
+ {
14090
+ "flags": "--source <text>",
14091
+ "description": "Who or what made this rule, and when (for example \"twitch:alice 2026-11-10 14:20\")",
14092
+ "required": true,
14093
+ "valueHint": "text"
14094
+ },
14095
+ {
14096
+ "flags": "--supersedes <ids>",
14097
+ "description": "Comma-separated ids of facts this one replaces; marks them superseded (same store)",
14098
+ "required": true,
14099
+ "valueHint": "ids"
14100
+ },
13716
14101
  {
13717
14102
  "flags": "--project <key>",
13718
14103
  "description": "Project key (defaults to the project owning the cwd)",
@@ -13788,12 +14173,36 @@ const COMPOSER_COMMAND_MANIFEST = [
13788
14173
  "required": true,
13789
14174
  "valueHint": "a,b"
13790
14175
  },
14176
+ {
14177
+ "flags": "--source <text>",
14178
+ "description": "Replace who or what made this rule, and when",
14179
+ "required": true,
14180
+ "valueHint": "text"
14181
+ },
14182
+ {
14183
+ "flags": "--supersedes <ids>",
14184
+ "description": "Comma-separated ids of facts this one replaces; marks them superseded (same store)",
14185
+ "required": true,
14186
+ "valueHint": "ids"
14187
+ },
13791
14188
  {
13792
14189
  "flags": "--clear-review",
13793
14190
  "description": "Remove the review marker, re-activating the fact",
13794
14191
  "required": false,
13795
14192
  "valueHint": null
13796
14193
  },
14194
+ {
14195
+ "flags": "--always",
14196
+ "description": "List this fact first in every launch index and leave it out of prompt-time retrieval",
14197
+ "required": false,
14198
+ "valueHint": null
14199
+ },
14200
+ {
14201
+ "flags": "--no-always",
14202
+ "description": "Clear the always flag",
14203
+ "required": false,
14204
+ "valueHint": null
14205
+ },
13797
14206
  {
13798
14207
  "flags": "--project <key>",
13799
14208
  "description": "Project key (defaults to the project owning the cwd)",
@@ -13861,6 +14270,59 @@ const COMPOSER_COMMAND_MANIFEST = [
13861
14270
  "aliases": [],
13862
14271
  "category": "Observation"
13863
14272
  },
14273
+ {
14274
+ "id": "pan-memory-lint",
14275
+ "path": ["memory", "lint"],
14276
+ "display": "/pan memory lint",
14277
+ "description": "Report duplicate, contradicting and badly linked memory facts (advisory; never edits)",
14278
+ "args": [],
14279
+ "options": [
14280
+ {
14281
+ "flags": "--threshold <n>",
14282
+ "description": "Duplicate similarity threshold, 0-1 (default depends on the method)",
14283
+ "required": true,
14284
+ "valueHint": "n"
14285
+ },
14286
+ {
14287
+ "flags": "--no-llm",
14288
+ "description": "Skip the LLM contradiction pass",
14289
+ "required": false,
14290
+ "valueHint": null
14291
+ },
14292
+ {
14293
+ "flags": "--project <key>",
14294
+ "description": "Project key (defaults to the project owning the cwd)",
14295
+ "required": true,
14296
+ "valueHint": "key"
14297
+ },
14298
+ {
14299
+ "flags": "--user",
14300
+ "description": "Lint the operator store (travels with you; synced when set up)",
14301
+ "required": false,
14302
+ "valueHint": null
14303
+ },
14304
+ {
14305
+ "flags": "--machine",
14306
+ "description": "Lint the machine store (this machine only)",
14307
+ "required": false,
14308
+ "valueHint": null
14309
+ },
14310
+ {
14311
+ "flags": "--here",
14312
+ "description": "Lint the cwd checkout's store instead of the primary checkout",
14313
+ "required": false,
14314
+ "valueHint": null
14315
+ },
14316
+ {
14317
+ "flags": "--json",
14318
+ "description": "Output JSON",
14319
+ "required": false,
14320
+ "valueHint": null
14321
+ }
14322
+ ],
14323
+ "aliases": [],
14324
+ "category": "Observation"
14325
+ },
13864
14326
  {
13865
14327
  "id": "pan-memory-sync",
13866
14328
  "path": ["memory", "sync"],
@@ -13890,6 +14352,26 @@ const COMPOSER_COMMAND_MANIFEST = [
13890
14352
  "aliases": [],
13891
14353
  "category": "Observation"
13892
14354
  },
14355
+ {
14356
+ "id": "pan-memory-reindex",
14357
+ "path": ["memory", "reindex"],
14358
+ "display": "/pan memory reindex",
14359
+ "description": "Refresh the fact vector cache for the project, operator and machine stores",
14360
+ "args": [],
14361
+ "options": [{
14362
+ "flags": "--project <key>",
14363
+ "description": "Project key (defaults to the project owning the cwd)",
14364
+ "required": true,
14365
+ "valueHint": "key"
14366
+ }, {
14367
+ "flags": "--json",
14368
+ "description": "Output JSON",
14369
+ "required": false,
14370
+ "valueHint": null
14371
+ }],
14372
+ "aliases": [],
14373
+ "category": "Observation"
14374
+ },
13893
14375
  {
13894
14376
  "id": "pan-briefing",
13895
14377
  "path": ["briefing"],
@@ -16398,6 +16880,18 @@ const COMPOSER_COMMAND_MANIFEST = [
16398
16880
  "description": "Skip Ollama local-model detection and optional gemma4:12b pull",
16399
16881
  "required": false,
16400
16882
  "valueHint": null
16883
+ },
16884
+ {
16885
+ "flags": "--file-manager-integration",
16886
+ "description": "Add \"Open in Overdeck\" to the file manager's right-click menu without asking",
16887
+ "required": false,
16888
+ "valueHint": null
16889
+ },
16890
+ {
16891
+ "flags": "--skip-file-manager-integration",
16892
+ "description": "Neither ask about nor add the file-manager integration",
16893
+ "required": false,
16894
+ "valueHint": null
16401
16895
  }
16402
16896
  ],
16403
16897
  "aliases": [],
@@ -17991,6 +18485,53 @@ const COMPOSER_COMMAND_MANIFEST = [
17991
18485
  "aliases": [],
17992
18486
  "category": "Core"
17993
18487
  },
18488
+ {
18489
+ "id": "pan-shutdown",
18490
+ "path": ["shutdown"],
18491
+ "display": "/pan shutdown",
18492
+ "description": "Drain Overdeck safely: let each agent finish its current tool call, stop everything, then report safe to reboot",
18493
+ "args": [],
18494
+ "options": [
18495
+ {
18496
+ "flags": "--deadline <seconds>",
18497
+ "description": "Seconds before stragglers are listed (default 120, 10–3600)",
18498
+ "required": true,
18499
+ "valueHint": "seconds"
18500
+ },
18501
+ {
18502
+ "flags": "--reboot",
18503
+ "description": "Reboot the machine when the drain completes (Linux)",
18504
+ "required": false,
18505
+ "valueHint": null
18506
+ },
18507
+ {
18508
+ "flags": "--force",
18509
+ "description": "At the deadline, stop stragglers mid-tool (on a running drain: stop them now)",
18510
+ "required": false,
18511
+ "valueHint": null
18512
+ },
18513
+ {
18514
+ "flags": "--cancel",
18515
+ "description": "Cancel a running drain; stopped sessions are offered for resume",
18516
+ "required": false,
18517
+ "valueHint": null
18518
+ },
18519
+ {
18520
+ "flags": "--status",
18521
+ "description": "Print the current drain and exit",
18522
+ "required": false,
18523
+ "valueHint": null
18524
+ },
18525
+ {
18526
+ "flags": "--no-wait",
18527
+ "description": "Start the drain and exit without following it",
18528
+ "required": false,
18529
+ "valueHint": null
18530
+ }
18531
+ ],
18532
+ "aliases": [],
18533
+ "category": "Core"
18534
+ },
17994
18535
  {
17995
18536
  "id": "pan-project",
17996
18537
  "path": ["project"],
@@ -20646,6 +21187,76 @@ function presetToCron(preset) {
20646
21187
  }
20647
21188
  }
20648
21189
  //#endregion
21190
+ //#region src/path-root.ts
21191
+ function trimSlash(path) {
21192
+ return path.length > 1 ? path.replace(/\/+$/, "") : path;
21193
+ }
21194
+ function isAtOrUnder(path, base) {
21195
+ return path === base || path.startsWith(`${base}/`);
21196
+ }
21197
+ /** The longest project path at or above `path`, or null. */
21198
+ function owningProject(path, projects) {
21199
+ let best = null;
21200
+ for (const project of projects) {
21201
+ const base = trimSlash(project.path);
21202
+ if (isAtOrUnder(path, base) && (!best || base.length > best.length)) best = {
21203
+ project,
21204
+ length: base.length
21205
+ };
21206
+ }
21207
+ return best?.project ?? null;
21208
+ }
21209
+ /**
21210
+ * Map an absolute path to its explorer root, first match wins:
21211
+ * 1. a scratch workspace path containing it (longest first) → `workspace:<id>`;
21212
+ * 2. `<projectPath>/workspaces/feature-<x>/…` → `issue:<X>`;
21213
+ * 3. any other folder under `<projectPath>/workspaces/` → `no-root`;
21214
+ * 4. the longest project path containing it → `project:<key>`;
21215
+ * 5. otherwise `outside`.
21216
+ */
21217
+ function resolvePathRoot(absPath, projects, scratch) {
21218
+ const path = trimSlash(absPath);
21219
+ let bestScratch = null;
21220
+ for (const row of scratch) {
21221
+ const base = trimSlash(row.path);
21222
+ if (isAtOrUnder(path, base) && (!bestScratch || base.length > bestScratch.length)) bestScratch = {
21223
+ row,
21224
+ length: base.length
21225
+ };
21226
+ }
21227
+ if (bestScratch) return {
21228
+ kind: "root",
21229
+ projectKey: owningProject(path, projects)?.key ?? "",
21230
+ rootId: `workspace:${bestScratch.row.id}`
21231
+ };
21232
+ let bestWorkspaces = null;
21233
+ for (const project of projects) {
21234
+ const dir = `${trimSlash(project.path)}/workspaces`;
21235
+ if (path.startsWith(`${dir}/`) && (!bestWorkspaces || dir.length > bestWorkspaces.dir.length)) bestWorkspaces = {
21236
+ project,
21237
+ dir
21238
+ };
21239
+ }
21240
+ if (bestWorkspaces) {
21241
+ const first = path.slice(bestWorkspaces.dir.length + 1).split("/")[0] ?? "";
21242
+ const slug = first.startsWith("feature-") ? first.slice(8) : "";
21243
+ return slug ? {
21244
+ kind: "root",
21245
+ projectKey: bestWorkspaces.project.key,
21246
+ rootId: `issue:${slug.toUpperCase()}`
21247
+ } : {
21248
+ kind: "no-root",
21249
+ projectKey: bestWorkspaces.project.key
21250
+ };
21251
+ }
21252
+ const project = owningProject(path, projects);
21253
+ return project ? {
21254
+ kind: "root",
21255
+ projectKey: project.key,
21256
+ rootId: `project:${project.key}`
21257
+ } : { kind: "outside" };
21258
+ }
21259
+ //#endregion
20649
21260
  exports.ACP_BEHAVIOR = ACP_BEHAVIOR;
20650
21261
  exports.ACP_CAPABILITIES = ACP_CAPABILITIES;
20651
21262
  exports.ACTIVITY_COUNT_MAX = ACTIVITY_COUNT_MAX;
@@ -20800,6 +21411,7 @@ exports.DeepWipeRpc = DeepWipeRpc;
20800
21411
  exports.DeployStalenessSnapshot = DeployStalenessSnapshot;
20801
21412
  exports.DerivedBranchState = DerivedBranchState;
20802
21413
  exports.DerivedIssueState = DerivedIssueState;
21414
+ exports.DerivedMergedSlice = DerivedMergedSlice;
20803
21415
  exports.DerivedPrOutsidePipeline = DerivedPrOutsidePipeline;
20804
21416
  exports.DerivedPrState = DerivedPrState;
20805
21417
  exports.DerivedWorkStart = DerivedWorkStart;
@@ -20904,16 +21516,21 @@ exports.FleetProjectRow = FleetProjectRow;
20904
21516
  exports.FleetProjectsResponse = FleetProjectsResponse;
20905
21517
  exports.FleetUpdateJobSchema = FleetUpdateJobSchema;
20906
21518
  exports.FleetUpdateMode = FleetUpdateMode;
21519
+ exports.FlywheelActivity = FlywheelActivity;
20907
21520
  exports.FlywheelAgent = FlywheelAgent;
20908
21521
  exports.FlywheelAgentStatus = FlywheelAgentStatus;
20909
21522
  exports.FlywheelAgentSummary = FlywheelAgentSummary;
21523
+ exports.FlywheelBlocker = FlywheelBlocker;
21524
+ exports.FlywheelBlockerKind = FlywheelBlockerKind;
20910
21525
  exports.FlywheelBugRateCriterion = FlywheelBugRateCriterion;
21526
+ exports.FlywheelCardAgent = FlywheelCardAgent;
20911
21527
  exports.FlywheelConversationSummary = FlywheelConversationSummary;
20912
21528
  exports.FlywheelDerivedStatus = FlywheelDerivedStatus;
20913
21529
  exports.FlywheelEffort = FlywheelEffort;
20914
21530
  exports.FlywheelFreshness = FlywheelFreshness;
20915
21531
  exports.FlywheelHarness = FlywheelHarness;
20916
21532
  exports.FlywheelHeadline = FlywheelHeadline;
21533
+ exports.FlywheelHealth = FlywheelHealth;
20917
21534
  exports.FlywheelHttpUrl = FlywheelHttpUrl;
20918
21535
  exports.FlywheelInFlightRow = FlywheelInFlightRow;
20919
21536
  exports.FlywheelJournalSummary = FlywheelJournalSummary;
@@ -20922,6 +21539,7 @@ exports.FlywheelNeedsYouItem = FlywheelNeedsYouItem;
20922
21539
  exports.FlywheelOrchestrator = FlywheelOrchestrator;
20923
21540
  exports.FlywheelOrderBookSummary = FlywheelOrderBookSummary;
20924
21541
  exports.FlywheelOrders = FlywheelOrders;
21542
+ exports.FlywheelOwner = FlywheelOwner;
20925
21543
  exports.FlywheelP0Criterion = FlywheelP0Criterion;
20926
21544
  exports.FlywheelParkedItem = FlywheelParkedItem;
20927
21545
  exports.FlywheelPipelineItem = FlywheelPipelineItem;
@@ -20931,6 +21549,10 @@ exports.FlywheelPolicies = FlywheelPolicies;
20931
21549
  exports.FlywheelRunId = FlywheelRunId;
20932
21550
  exports.FlywheelRunState = FlywheelRunState;
20933
21551
  exports.FlywheelScope = FlywheelScope;
21552
+ exports.FlywheelShipped = FlywheelShipped;
21553
+ exports.FlywheelShippedEvent = FlywheelShippedEvent;
21554
+ exports.FlywheelShippedMerge = FlywheelShippedMerge;
21555
+ exports.FlywheelStage = FlywheelStage;
20934
21556
  exports.FlywheelStats = FlywheelStats;
20935
21557
  exports.FlywheelStatsCriterionStatus = FlywheelStatsCriterionStatus;
20936
21558
  exports.FlywheelStatsTrend = FlywheelStatsTrend;
@@ -21195,6 +21817,10 @@ exports.ShadowInferenceUpdateEvent = ShadowInferenceUpdateEvent;
21195
21817
  exports.SharedChannelReader = SharedChannelReader;
21196
21818
  exports.ShellOpenInBrowserRpc = ShellOpenInBrowserRpc;
21197
21819
  exports.ShellOpenInEditorRpc = ShellOpenInEditorRpc;
21820
+ exports.ShutdownPendingSession = ShutdownPendingSession;
21821
+ exports.ShutdownPhase = ShutdownPhase;
21822
+ exports.ShutdownSnapshot = ShutdownSnapshot;
21823
+ exports.ShutdownWriter = ShutdownWriter;
21198
21824
  exports.SpecialistCompletedEvent = SpecialistCompletedEvent;
21199
21825
  exports.SpecialistFailedEvent = SpecialistFailedEvent;
21200
21826
  exports.SpecialistLifecycle = SpecialistLifecycle;
@@ -21214,6 +21840,7 @@ exports.SubscribeDomainEventsRpc = SubscribeDomainEventsRpc;
21214
21840
  exports.SubscribeIssueEventsRpc = SubscribeIssueEventsRpc;
21215
21841
  exports.SubscribeProjectSessionTreeRpc = SubscribeProjectSessionTreeRpc;
21216
21842
  exports.SubscribeTerminalRpc = SubscribeTerminalRpc;
21843
+ exports.SubscribeUiCommandsRpc = SubscribeUiCommandsRpc;
21217
21844
  exports.SubstrateBugFiledEvent = SubstrateBugFiledEvent;
21218
21845
  exports.SweepEscalatedEvent = SweepEscalatedEvent;
21219
21846
  exports.SweepRecommendationEvent = SweepRecommendationEvent;
@@ -21222,6 +21849,7 @@ exports.SystemHealthConsumer = SystemHealthConsumer;
21222
21849
  exports.SystemHealthSeverityChangedEvent = SystemHealthSeverityChangedEvent;
21223
21850
  exports.SystemHealthSnapshot = SystemHealthSnapshot;
21224
21851
  exports.SystemHeartbeatEvent = SystemHeartbeatEvent;
21852
+ exports.SystemShutdownChangedEvent = SystemShutdownChangedEvent;
21225
21853
  exports.TELEMETRY_CLI_VERBS = TELEMETRY_CLI_VERBS;
21226
21854
  exports.TELEMETRY_EVENT_CATALOG = TELEMETRY_EVENT_CATALOG;
21227
21855
  exports.TELEMETRY_EVENT_NAMES = TELEMETRY_EVENT_NAMES;
@@ -21242,6 +21870,8 @@ exports.TickMarkerPhase = TickMarkerPhase;
21242
21870
  exports.TurnDiffFileChange = TurnDiffFileChange;
21243
21871
  exports.TurnDiffSummary = TurnDiffSummary;
21244
21872
  exports.TurnEndAssessment = TurnEndAssessment;
21873
+ exports.UiCommand = UiCommand;
21874
+ exports.UiOpenResolution = UiOpenResolution;
21245
21875
  exports.WINDOW_PINNED_OPEN_TOOLS_MAX = WINDOW_PINNED_OPEN_TOOLS_MAX;
21246
21876
  exports.WIRED_HOOK_INVENTORY = WIRED_HOOK_INVENTORY;
21247
21877
  exports.WIRED_HOOK_NAMES = WIRED_HOOK_NAMES;
@@ -21331,13 +21961,16 @@ exports.parseTrackerIssueUrl = parseTrackerIssueUrl;
21331
21961
  exports.phoneIssueSheetPath = phoneIssueSheetPath;
21332
21962
  exports.presenceForPaneState = presenceForPaneState;
21333
21963
  exports.presetToCron = presetToCron;
21964
+ exports.projectDeckKey = projectDeckKey;
21334
21965
  exports.projectLegacySystemHealthSummary = projectLegacySystemHealthSummary;
21335
21966
  exports.readDraftPayload = readDraftPayload;
21336
21967
  exports.readableForeground = readableForeground;
21337
21968
  exports.repoFromRemoteUrl = repoFromRemoteUrl;
21338
21969
  exports.resolveEffectivePullRequest = resolveEffectivePullRequest;
21970
+ exports.resolvePathRoot = resolvePathRoot;
21339
21971
  exports.resolveTrackerIssueId = resolveTrackerIssueId;
21340
21972
  exports.sharedPromptRefusal = sharedPromptRefusal;
21973
+ exports.shippedCardCount = shippedCardCount;
21341
21974
  exports.slugifyThemeId = slugifyThemeId;
21342
21975
  exports.splitNeedsYouItems = splitNeedsYouItems;
21343
21976
  exports.syncSnapshot = syncSnapshot;
@@ -21347,4 +21980,5 @@ exports.toOpaqueHex = toOpaqueHex;
21347
21980
  exports.toSharedMessage = toSharedMessage;
21348
21981
  exports.trimMemoryObservations = trimMemoryObservations;
21349
21982
  exports.trimTurnDiffSummaries = trimTurnDiffSummaries;
21983
+ exports.uiOpenSummary = uiOpenSummary;
21350
21984
  exports.withPaneLivenessAlias = withPaneLivenessAlias;