@overdeck/contracts 0.68.0 → 0.70.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
@@ -108,7 +108,8 @@ const IssueAttention = effect.Schema.Literals([
108
108
  "needs-you",
109
109
  "stuck",
110
110
  "api-error",
111
- "work-not-started"
111
+ "work-not-started",
112
+ "pr-outside-pipeline"
112
113
  ]);
113
114
  /** Latest review decision on the PR, as the forge reports it. */
114
115
  const PrReviewState = effect.Schema.Literals([
@@ -151,6 +152,14 @@ const DerivedWorkStart = effect.Schema.Struct({
151
152
  /** The retry is journaled but not actually running because the Deacon is frozen (PAN-4210). Present only when true. */
152
153
  held: effect.Schema.optional(effect.Schema.Literal(true))
153
154
  });
155
+ /** An open pull request the pipeline never picked up (PAN-4605). */
156
+ const DerivedPrOutsidePipeline = effect.Schema.Struct({
157
+ prNumber: effect.Schema.Number,
158
+ /** One operator-facing paragraph naming the PR, the reason and the exact commands. */
159
+ fix: effect.Schema.String,
160
+ /** The other worktree that has the branch checked out, when that is the reason. */
161
+ worktreePath: effect.Schema.optional(effect.Schema.String)
162
+ });
154
163
  /** Everything the dashboard needs to render an issue's pipeline position. */
155
164
  const DerivedIssueState = effect.Schema.Struct({
156
165
  issueId: effect.Schema.String,
@@ -165,7 +174,9 @@ const DerivedIssueState = effect.Schema.Struct({
165
174
  */
166
175
  trackerUnknown: effect.Schema.optional(effect.Schema.Literal(true)),
167
176
  /** A deferred or gave-up post-planning auto-start read from the workspace journal (PAN-4399). */
168
- workStart: effect.Schema.optional(DerivedWorkStart)
177
+ workStart: effect.Schema.optional(DerivedWorkStart),
178
+ /** An outside PR the pipeline never picked up (PAN-4605). */
179
+ prOutsidePipeline: effect.Schema.optional(DerivedPrOutsidePipeline)
169
180
  });
170
181
  const ISSUE_STATES = [
171
182
  "backlog",
@@ -194,7 +205,8 @@ const ISSUE_ATTENTIONS = [
194
205
  "needs-you",
195
206
  "stuck",
196
207
  "api-error",
197
- "work-not-started"
208
+ "work-not-started",
209
+ "pr-outside-pipeline"
198
210
  ];
199
211
  function isIssueState(value) {
200
212
  return typeof value === "string" && ISSUE_STATES.includes(value);
@@ -220,6 +232,7 @@ const GITHUB_QUOTA_CALLERS = [
220
232
  "app-rest",
221
233
  "quota-sampler",
222
234
  "agent",
235
+ "pr-adoption",
223
236
  "other"
224
237
  ];
225
238
  const GitHubQuotaCaller = effect.Schema.Literals(GITHUB_QUOTA_CALLERS);
@@ -566,8 +579,7 @@ const AgentSnapshot = effect.Schema.Struct({
566
579
  })),
567
580
  resolution: effect.Schema.optional(AgentResolution),
568
581
  resolutionCount: effect.Schema.optional(effect.Schema.Number),
569
- turnEndAssessment: effect.Schema.optional(TurnEndAssessment),
570
- runtimeSnapshotSequence: effect.Schema.optional(SequenceNumber)
582
+ turnEndAssessment: effect.Schema.optional(TurnEndAssessment)
571
583
  });
572
584
  /** PAN-3151: A recorded cycle in the review convergence tracking series */
573
585
  const TurnDiffFileChange = effect.Schema.Struct({
@@ -1553,7 +1565,8 @@ const BeadsFreshnessChangedEvent = effect.Schema.Struct({
1553
1565
  * (PAN-3537).
1554
1566
  *
1555
1567
  * Emitted by the `check_suite` webhook handler for live updates, only after an
1556
- * independent branch-head lookup verifies the payload SHA is still current.
1568
+ * independent lookup verifies the payload SHA is still the current CI head
1569
+ * (the newest push run of the CI workflow, PAN-4618).
1557
1570
  * `suiteId` is the check suite id — for GitHub Actions that is one suite per
1558
1571
  * workflow run. The webhook payload does not carry `htmlUrl`.
1559
1572
  *
@@ -1576,15 +1589,16 @@ const ProjectCiSuiteObservedEvent = effect.Schema.Struct({
1576
1589
  conclusion: effect.Schema.NullOr(effect.Schema.String),
1577
1590
  htmlUrl: effect.Schema.optional(effect.Schema.String),
1578
1591
  observedAt: effect.Schema.String,
1579
- /** True only after the emitter verified headSha against the branch head. */
1592
+ /** True only after the emitter verified headSha against the current CI head. */
1580
1593
  authoritativeHead: effect.Schema.optional(effect.Schema.Boolean)
1581
1594
  })
1582
1595
  });
1583
1596
  /**
1584
- * Complete GitHub Actions projection for the verified default-branch head.
1585
- * The REST seed/repair emits one event after paginating every run and verifying
1586
- * the branch head a second time. An empty suites record explicitly clears stale
1587
- * CI when the current commit has no Actions runs.
1597
+ * Complete GitHub Actions projection for the verified current CI head (the
1598
+ * newest push run of the CI workflow, PAN-4618). The REST seed/repair emits
1599
+ * one event after paginating every run and verifying the CI head a second
1600
+ * time. An empty suites record explicitly clears stale CI when the current
1601
+ * commit has no Actions runs.
1588
1602
  */
1589
1603
  const ProjectCiHeadObservedEvent = effect.Schema.Struct({
1590
1604
  type: effect.Schema.Literal("project.ci_head_observed"),
@@ -3366,7 +3380,11 @@ const WorkLogEntry = effect.Schema.Struct({
3366
3380
  toolTitle: effect.Schema.optional(effect.Schema.String),
3367
3381
  /** Raw tool_use input dict — drives per-tool expanded rendering (PAN-1459). */
3368
3382
  toolInput: effect.Schema.optional(effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown)),
3369
- sequence: effect.Schema.optional(effect.Schema.Number)
3383
+ sequence: effect.Schema.optional(effect.Schema.Number),
3384
+ /** PAN-4558: UTF-8 byte length of a `result` the wire projection removed. */
3385
+ resultBytes: effect.Schema.optional(effect.Schema.Number),
3386
+ /** PAN-4558: the wire projection removed or cut a tool body; fetch the full entry on expand. */
3387
+ bodyOmitted: effect.Schema.optional(effect.Schema.Boolean)
3370
3388
  });
3371
3389
  /** A human-origin message read from a subagent's own sidechain transcript (PAN-4247). */
3372
3390
  const SubagentHumanInput = effect.Schema.Struct({
@@ -3386,6 +3404,20 @@ const SubagentSummary = effect.Schema.Struct({
3386
3404
  /** Recent human-origin sidechain inputs, most useful when a message routed into this subagent instead of the main conversation (PAN-4247). */
3387
3405
  humanInputs: effect.Schema.optional(effect.Schema.Array(SubagentHumanInput))
3388
3406
  });
3407
+ /** PAN-4558: where a windowed response or page sits in the whole transcript. */
3408
+ const ConversationWindow = effect.Schema.Struct({
3409
+ /** Encoded timeline key of the oldest contiguous entry; pass as `before=` for the next older page. */
3410
+ cursor: effect.Schema.NullOr(effect.Schema.String),
3411
+ hasOlder: effect.Schema.Boolean,
3412
+ /** `"<dev>:<ino>"` of the transcript file the window was read from. */
3413
+ transcript: effect.Schema.optional(effect.Schema.String)
3414
+ });
3415
+ /** PAN-4558: what a resubscribing client already holds. */
3416
+ const ConversationResume = effect.Schema.Struct({
3417
+ afterSequence: effect.Schema.Number,
3418
+ openIds: effect.Schema.Array(effect.Schema.String),
3419
+ transcript: effect.Schema.String
3420
+ });
3389
3421
  /**
3390
3422
  * Response shape for GET /api/agents/:id/conversation.
3391
3423
  * Shared between the dashboard server route and the frontend TerminalPanel.
@@ -3408,7 +3440,9 @@ const ConversationResponse = effect.Schema.Struct({
3408
3440
  effortResolution: effect.Schema.optional(effect.Schema.NullOr(effect.Schema.Struct({
3409
3441
  effort: EffortLevelSchema,
3410
3442
  source: effect.Schema.String
3411
- })))
3443
+ }))),
3444
+ /** PAN-4558: present on windowed and paged responses only. */
3445
+ window: effect.Schema.optional(ConversationWindow)
3412
3446
  });
3413
3447
  const ConversationEvent = effect.Schema.Union([
3414
3448
  effect.Schema.Struct({
@@ -3424,7 +3458,9 @@ const ConversationEvent = effect.Schema.Union([
3424
3458
  totalCost: effect.Schema.optional(effect.Schema.Number),
3425
3459
  proposedPlan: effect.Schema.optional(ProposedPlan),
3426
3460
  compactBoundaries: effect.Schema.optional(effect.Schema.Array(CompactBoundary)),
3427
- contextUsage: effect.Schema.optional(effect.Schema.NullOr(ContextUsage))
3461
+ contextUsage: effect.Schema.optional(effect.Schema.NullOr(ContextUsage)),
3462
+ /** PAN-4558: set on windowed snapshots; older history is paged in by `window.cursor`. */
3463
+ window: effect.Schema.optional(ConversationWindow)
3428
3464
  }),
3429
3465
  effect.Schema.Struct({ kind: effect.Schema.Literal("discovering") }),
3430
3466
  effect.Schema.Struct({
@@ -3486,10 +3522,17 @@ const GetSnapshotRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.getSnapshot, {
3486
3522
  success: DashboardSnapshot,
3487
3523
  error: PanRpcError
3488
3524
  });
3525
+ /**
3526
+ * PAN-4559: the server answers this instead of events when the gap after
3527
+ * fromSequence exceeds its replay cap; the client re-bootstraps via getSnapshot.
3528
+ */
3529
+ const ReplayTooFarBehind = effect.Schema.Struct({ tooFarBehind: effect.Schema.Literal(true) });
3530
+ /** Replay result: the missed events (unchanged array shape), or ReplayTooFarBehind. */
3531
+ const ReplayEventsResult = effect.Schema.Union([effect.Schema.Array(DomainEvent), ReplayTooFarBehind]);
3489
3532
  /** 5. Replay events since a given sequence number (unary) */
3490
3533
  const ReplayEventsRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.replayEvents, {
3491
3534
  payload: effect.Schema.Struct({ fromSequence: SequenceNumber }),
3492
- success: effect.Schema.Array(DomainEvent),
3535
+ success: ReplayEventsResult,
3493
3536
  error: PanRpcError
3494
3537
  });
3495
3538
  /** 6. Open a terminal session / attach PTY (unary) */
@@ -3547,15 +3590,20 @@ const ReadFileAtPathResult = effect.Schema.Struct({
3547
3590
  text: effect.Schema.String,
3548
3591
  lang: effect.Schema.String,
3549
3592
  mtimeMs: effect.Schema.Number,
3550
- totalLines: effect.Schema.Number
3593
+ totalLines: effect.Schema.Number,
3594
+ /** True when the resolved file is inside a registered project root or OVERDECK_HOME, so writeFileAtPath will accept it (PAN-4583). */
3595
+ writable: effect.Schema.Boolean
3551
3596
  });
3552
3597
  /**
3553
3598
  * 10b-2. Read an allowlisted markdown file by absolute path (PAN-3260).
3554
3599
  *
3555
3600
  * Unlike ReadWorkspaceFileRpc this takes no issueId — the internal markdown
3556
3601
  * editor pane opens files reached from surfaces with no workspace context
3557
- * (e.g. a repo-root file chip inside a conversation). The server validates
3558
- * `path` against registered project roots + OVERDECK_HOME before reading.
3602
+ * (e.g. a repo-root file chip inside a conversation). The server reads any
3603
+ * existing markdown file whose realpath is inside the operator's home
3604
+ * directory or a write root (registered project roots + OVERDECK_HOME), and
3605
+ * sets `writable` to whether it is inside a write root (PAN-4583). Writes
3606
+ * stay limited to the write roots — see WriteFileAtPathRpc.
3559
3607
  */
3560
3608
  const ReadFileAtPathRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.readFileAtPath, {
3561
3609
  payload: ReadFileAtPathInput,
@@ -3574,6 +3622,8 @@ const WriteFileAtPathResult = effect.Schema.Struct({ mtimeMs: effect.Schema.Numb
3574
3622
  * `expectedMtimeMs` enables optimistic concurrency: a stale value is
3575
3623
  * rejected with a PanRpcError code of WRITE_CONFLICT and nothing is
3576
3624
  * written. Omitting it (e.g. an explicit Overwrite action) skips the check.
3625
+ * The path must resolve inside a registered project root or OVERDECK_HOME;
3626
+ * anything else rejects with PATH_NOT_ALLOWED.
3577
3627
  */
3578
3628
  const WriteFileAtPathRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.writeFileAtPath, {
3579
3629
  payload: WriteFileAtPathInput,
@@ -3657,7 +3707,9 @@ const ResizeTerminalRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.resizeTerminal
3657
3707
  const SubscribeConversationMessagesRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.subscribeConversationMessages, {
3658
3708
  payload: effect.Schema.Struct({
3659
3709
  conversationName: effect.Schema.String,
3660
- agentId: effect.Schema.optional(effect.Schema.String)
3710
+ agentId: effect.Schema.optional(effect.Schema.String),
3711
+ /** PAN-4558: what the client already holds; the server sends only newer or newly settled rows. */
3712
+ resume: effect.Schema.optional(ConversationResume)
3661
3713
  }),
3662
3714
  success: ConversationEvent,
3663
3715
  error: PanRpcError,
@@ -3997,23 +4049,6 @@ function removeAgentFromSessionIndex(agentIdBySessionId, agentId) {
3997
4049
  for (const [sessionId, id] of Object.entries(agentIdBySessionId ?? {})) if (id !== agentId) next[sessionId] = id;
3998
4050
  return next;
3999
4051
  }
4000
- /**
4001
- * Bump runtimeSnapshotSequence on the corresponding AgentSnapshot (if present)
4002
- * so low-frequency subscribers can cheaply detect a runtime change. No-op if
4003
- * the agent has no lifecycle snapshot yet (a runtime event arrived before
4004
- * agent.created — unusual but defensive).
4005
- */
4006
- function bumpRuntimeSnapshotSequence(agentsById, agentId, sequence) {
4007
- const agent = agentsById[agentId];
4008
- if (!agent) return agentsById;
4009
- return {
4010
- ...agentsById,
4011
- [agentId]: {
4012
- ...agent,
4013
- runtimeSnapshotSequence: sequence
4014
- }
4015
- };
4016
- }
4017
4052
  function syncSnapshot(state, snapshot) {
4018
4053
  const agentsById = {};
4019
4054
  for (const agent of snapshot.agents) agentsById[agent.id] = agent;
@@ -4755,8 +4790,7 @@ function applyEvent(state, event) {
4755
4790
  agentRuntimeById: {
4756
4791
  ...state.agentRuntimeById,
4757
4792
  [agentId]: next
4758
- },
4759
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence)
4793
+ }
4760
4794
  };
4761
4795
  }
4762
4796
  case "agent.thinking_started": {
@@ -4781,8 +4815,7 @@ function applyEvent(state, event) {
4781
4815
  agentRuntimeById: {
4782
4816
  ...state.agentRuntimeById,
4783
4817
  [agentId]: next
4784
- },
4785
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence)
4818
+ }
4786
4819
  };
4787
4820
  }
4788
4821
  case "agent.thinking_stopped": {
@@ -4804,8 +4837,7 @@ function applyEvent(state, event) {
4804
4837
  agentRuntimeById: {
4805
4838
  ...state.agentRuntimeById,
4806
4839
  [agentId]: next
4807
- },
4808
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence)
4840
+ }
4809
4841
  };
4810
4842
  }
4811
4843
  case "agent.waiting_started": {
@@ -4830,8 +4862,7 @@ function applyEvent(state, event) {
4830
4862
  agentRuntimeById: {
4831
4863
  ...state.agentRuntimeById,
4832
4864
  [agentId]: next
4833
- },
4834
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence)
4865
+ }
4835
4866
  };
4836
4867
  }
4837
4868
  case "agent.waiting_cleared": {
@@ -4853,8 +4884,7 @@ function applyEvent(state, event) {
4853
4884
  agentRuntimeById: {
4854
4885
  ...state.agentRuntimeById,
4855
4886
  [agentId]: next
4856
- },
4857
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence)
4887
+ }
4858
4888
  };
4859
4889
  }
4860
4890
  case "agent.permission_requested": {
@@ -4931,8 +4961,7 @@ function applyEvent(state, event) {
4931
4961
  agentRuntimeById: {
4932
4962
  ...state.agentRuntimeById,
4933
4963
  [agentId]: next
4934
- },
4935
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence)
4964
+ }
4936
4965
  };
4937
4966
  }
4938
4967
  case "agent.channel_reply": {
@@ -4955,8 +4984,7 @@ function applyEvent(state, event) {
4955
4984
  agentRuntimeById: {
4956
4985
  ...state.agentRuntimeById,
4957
4986
  [agentId]: next
4958
- },
4959
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence)
4987
+ }
4960
4988
  };
4961
4989
  }
4962
4990
  case "agent.model_set": {
@@ -4990,7 +5018,6 @@ function applyEvent(state, event) {
4990
5018
  ...state.agentRuntimeById,
4991
5019
  [agentId]: next
4992
5020
  },
4993
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence),
4994
5021
  agentIdBySessionId: nextAgentIdBySessionId
4995
5022
  };
4996
5023
  }
@@ -5008,8 +5035,7 @@ function applyEvent(state, event) {
5008
5035
  agentRuntimeById: {
5009
5036
  ...state.agentRuntimeById,
5010
5037
  [agentId]: next
5011
- },
5012
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence)
5038
+ }
5013
5039
  };
5014
5040
  }
5015
5041
  case "agent.context_saturation_changed": {
@@ -5025,8 +5051,7 @@ function applyEvent(state, event) {
5025
5051
  agentRuntimeById: {
5026
5052
  ...state.agentRuntimeById,
5027
5053
  [agentId]: next
5028
- },
5029
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence)
5054
+ }
5030
5055
  };
5031
5056
  }
5032
5057
  case "agent.resolution_changed": {
@@ -5045,8 +5070,7 @@ function applyEvent(state, event) {
5045
5070
  agentRuntimeById: {
5046
5071
  ...state.agentRuntimeById,
5047
5072
  [agentId]: next
5048
- },
5049
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence)
5073
+ }
5050
5074
  };
5051
5075
  }
5052
5076
  case "agent.state_restored": {
@@ -5061,8 +5085,7 @@ function applyEvent(state, event) {
5061
5085
  agentRuntimeById: {
5062
5086
  ...state.agentRuntimeById,
5063
5087
  [agentId]: next
5064
- },
5065
- agentsById: bumpRuntimeSnapshotSequence(state.agentsById, agentId, event.sequence)
5088
+ }
5066
5089
  };
5067
5090
  }
5068
5091
  case "activity.entry": {
@@ -6073,6 +6096,170 @@ const FeatureRegistryEntry = effect.Schema.Struct({
6073
6096
  tags: effect.Schema.Array(effect.Schema.String)
6074
6097
  });
6075
6098
  //#endregion
6099
+ //#region src/harness-capabilities.ts
6100
+ const HARNESS_CAPABILITY_KEYS = [
6101
+ "contextChannel",
6102
+ "initialPromptMustLand",
6103
+ "stopRuntimeOnStartFailure",
6104
+ "resumeContractMustLand",
6105
+ "reapsPrivateDaemonOnStop",
6106
+ "attachmentDelivery",
6107
+ "nativeManualCompact",
6108
+ "paneInputGuard",
6109
+ "transcriptDeliveryReceipt",
6110
+ "hostEffortFlag",
6111
+ "binaryLabel",
6112
+ "installHint",
6113
+ "binaryConfigKey",
6114
+ "launchPreflight",
6115
+ "workspaceResolution",
6116
+ "correlatesBySessionId"
6117
+ ];
6118
+ const CLAUDE_CODE_CAPABILITIES = {
6119
+ contextChannel: "append-system-prompt-file",
6120
+ initialPromptMustLand: false,
6121
+ stopRuntimeOnStartFailure: false,
6122
+ resumeContractMustLand: false,
6123
+ reapsPrivateDaemonOnStop: false,
6124
+ attachmentDelivery: "native",
6125
+ nativeManualCompact: true,
6126
+ paneInputGuard: true,
6127
+ transcriptDeliveryReceipt: true,
6128
+ hostEffortFlag: false,
6129
+ binaryLabel: "Claude Code",
6130
+ installHint: "curl -fsSL https://claude.ai/install.sh | bash",
6131
+ binaryConfigKey: null,
6132
+ launchPreflight: "claude-code-model-minimum",
6133
+ workspaceResolution: "claude-project-hash",
6134
+ correlatesBySessionId: false
6135
+ };
6136
+ const OHMYPI_CAPABILITIES = {
6137
+ contextChannel: "append-system-prompt",
6138
+ initialPromptMustLand: false,
6139
+ stopRuntimeOnStartFailure: false,
6140
+ resumeContractMustLand: false,
6141
+ reapsPrivateDaemonOnStop: false,
6142
+ attachmentDelivery: "inline-paths",
6143
+ nativeManualCompact: false,
6144
+ paneInputGuard: false,
6145
+ transcriptDeliveryReceipt: false,
6146
+ hostEffortFlag: false,
6147
+ binaryLabel: "OhMyPi",
6148
+ installHint: null,
6149
+ binaryConfigKey: null,
6150
+ launchPreflight: null,
6151
+ workspaceResolution: "first-message-only",
6152
+ correlatesBySessionId: true
6153
+ };
6154
+ const CODEX_CAPABILITIES = {
6155
+ contextChannel: "developer_instructions",
6156
+ initialPromptMustLand: false,
6157
+ stopRuntimeOnStartFailure: false,
6158
+ resumeContractMustLand: false,
6159
+ reapsPrivateDaemonOnStop: false,
6160
+ attachmentDelivery: "inline-paths",
6161
+ nativeManualCompact: false,
6162
+ paneInputGuard: false,
6163
+ transcriptDeliveryReceipt: false,
6164
+ hostEffortFlag: false,
6165
+ binaryLabel: "Codex CLI",
6166
+ installHint: null,
6167
+ binaryConfigKey: null,
6168
+ launchPreflight: null,
6169
+ workspaceResolution: "agent-dir",
6170
+ correlatesBySessionId: true
6171
+ };
6172
+ const ACP_CAPABILITIES = {
6173
+ contextChannel: "acp-initial-context",
6174
+ initialPromptMustLand: true,
6175
+ stopRuntimeOnStartFailure: true,
6176
+ resumeContractMustLand: false,
6177
+ reapsPrivateDaemonOnStop: false,
6178
+ attachmentDelivery: "inline-paths",
6179
+ nativeManualCompact: false,
6180
+ paneInputGuard: false,
6181
+ transcriptDeliveryReceipt: false,
6182
+ hostEffortFlag: false,
6183
+ binaryLabel: "Kimi Code CLI",
6184
+ installHint: null,
6185
+ binaryConfigKey: "acp.kimi.binaryPath",
6186
+ launchPreflight: null,
6187
+ workspaceResolution: "agent-dir",
6188
+ correlatesBySessionId: true
6189
+ };
6190
+ const KIMI_CODE_CAPABILITIES = {
6191
+ contextChannel: "initial-message-envelope",
6192
+ initialPromptMustLand: true,
6193
+ stopRuntimeOnStartFailure: true,
6194
+ resumeContractMustLand: true,
6195
+ reapsPrivateDaemonOnStop: false,
6196
+ attachmentDelivery: "inline-paths",
6197
+ nativeManualCompact: false,
6198
+ paneInputGuard: false,
6199
+ transcriptDeliveryReceipt: false,
6200
+ hostEffortFlag: false,
6201
+ binaryLabel: "Kimi Code CLI",
6202
+ installHint: null,
6203
+ binaryConfigKey: "kimiCode.binaryPath",
6204
+ launchPreflight: null,
6205
+ workspaceResolution: "first-message-only",
6206
+ correlatesBySessionId: true
6207
+ };
6208
+ const OPENCODE_CAPABILITIES = {
6209
+ contextChannel: "acp-initial-context",
6210
+ initialPromptMustLand: true,
6211
+ stopRuntimeOnStartFailure: true,
6212
+ resumeContractMustLand: false,
6213
+ reapsPrivateDaemonOnStop: false,
6214
+ attachmentDelivery: "inline-paths",
6215
+ nativeManualCompact: false,
6216
+ paneInputGuard: false,
6217
+ transcriptDeliveryReceipt: false,
6218
+ hostEffortFlag: true,
6219
+ binaryLabel: "OpenCode",
6220
+ installHint: null,
6221
+ binaryConfigKey: null,
6222
+ launchPreflight: null,
6223
+ workspaceResolution: "agent-dir",
6224
+ correlatesBySessionId: true
6225
+ };
6226
+ const MUSE_CAPABILITIES = {
6227
+ contextChannel: "append-system-prompt-file",
6228
+ initialPromptMustLand: false,
6229
+ stopRuntimeOnStartFailure: true,
6230
+ resumeContractMustLand: false,
6231
+ reapsPrivateDaemonOnStop: false,
6232
+ attachmentDelivery: "inline-paths",
6233
+ nativeManualCompact: false,
6234
+ paneInputGuard: false,
6235
+ transcriptDeliveryReceipt: false,
6236
+ hostEffortFlag: false,
6237
+ binaryLabel: "Muse Code",
6238
+ installHint: null,
6239
+ binaryConfigKey: null,
6240
+ launchPreflight: null,
6241
+ workspaceResolution: "first-message-only",
6242
+ correlatesBySessionId: true
6243
+ };
6244
+ const PRIME_AGENT_CAPABILITIES = {
6245
+ contextChannel: "prime-agent-append-system-prompt",
6246
+ initialPromptMustLand: true,
6247
+ stopRuntimeOnStartFailure: true,
6248
+ resumeContractMustLand: false,
6249
+ reapsPrivateDaemonOnStop: true,
6250
+ attachmentDelivery: "inline-paths",
6251
+ nativeManualCompact: false,
6252
+ paneInputGuard: false,
6253
+ transcriptDeliveryReceipt: false,
6254
+ hostEffortFlag: false,
6255
+ binaryLabel: "Prime Agent",
6256
+ installHint: null,
6257
+ binaryConfigKey: null,
6258
+ launchPreflight: null,
6259
+ workspaceResolution: "first-message-only",
6260
+ correlatesBySessionId: true
6261
+ };
6262
+ //#endregion
6076
6263
  //#region src/harness-behavior.ts
6077
6264
  const AGENT_SESSION_PREFIXES = [
6078
6265
  "agent-",
@@ -6088,6 +6275,7 @@ function isAgentSessionName(name) {
6088
6275
  }
6089
6276
  const CLAUDE_CODE_BEHAVIOR = {
6090
6277
  displayName: "Claude Code",
6278
+ capabilities: CLAUDE_CODE_CAPABILITIES,
6091
6279
  nativeCommands: [
6092
6280
  {
6093
6281
  name: "/model",
@@ -6132,6 +6320,7 @@ const CLAUDE_CODE_BEHAVIOR = {
6132
6320
  };
6133
6321
  const OHMYPI_BEHAVIOR = {
6134
6322
  displayName: "Pi",
6323
+ capabilities: OHMYPI_CAPABILITIES,
6135
6324
  nativeCommands: [],
6136
6325
  executableName: "omp",
6137
6326
  processNames: ["omp"],
@@ -6161,6 +6350,7 @@ const OHMYPI_BEHAVIOR = {
6161
6350
  };
6162
6351
  const CODEX_BEHAVIOR = {
6163
6352
  displayName: "Codex",
6353
+ capabilities: CODEX_CAPABILITIES,
6164
6354
  nativeCommands: [],
6165
6355
  executableName: "codex",
6166
6356
  processNames: ["codex"],
@@ -6184,6 +6374,7 @@ const CODEX_BEHAVIOR = {
6184
6374
  };
6185
6375
  const ACP_BEHAVIOR = {
6186
6376
  displayName: "ACP",
6377
+ capabilities: ACP_CAPABILITIES,
6187
6378
  nativeCommands: [],
6188
6379
  executableName: "acp-host",
6189
6380
  processNames: ["acp-host", "kimi"],
@@ -6207,6 +6398,7 @@ const ACP_BEHAVIOR = {
6207
6398
  };
6208
6399
  const KIMI_CODE_BEHAVIOR = {
6209
6400
  displayName: "Kimi Code",
6401
+ capabilities: KIMI_CODE_CAPABILITIES,
6210
6402
  nativeCommands: [],
6211
6403
  executableName: "kimi",
6212
6404
  processNames: ["kimi"],
@@ -6231,12 +6423,14 @@ const KIMI_CODE_BEHAVIOR = {
6231
6423
  const OPENCODE_BEHAVIOR = {
6232
6424
  ...ACP_BEHAVIOR,
6233
6425
  displayName: "OpenCode",
6426
+ capabilities: OPENCODE_CAPABILITIES,
6234
6427
  contextLayerKind: "opencode",
6235
6428
  executableName: "opencode",
6236
6429
  processNames: ["acp-host", "opencode"]
6237
6430
  };
6238
6431
  const MUSE_BEHAVIOR = {
6239
6432
  displayName: "Muse Code",
6433
+ capabilities: MUSE_CAPABILITIES,
6240
6434
  nativeCommands: [],
6241
6435
  executableName: "muse",
6242
6436
  processNames: ["muse", "muse-bin"],
@@ -6266,6 +6460,7 @@ const MUSE_BEHAVIOR = {
6266
6460
  };
6267
6461
  const PRIME_AGENT_BEHAVIOR = {
6268
6462
  displayName: "Prime Agent",
6463
+ capabilities: PRIME_AGENT_CAPABILITIES,
6269
6464
  nativeCommands: [],
6270
6465
  executableName: "prime-agent",
6271
6466
  processNames: ["prime-agent"],
@@ -6297,15 +6492,18 @@ const BEHAVIORS = {
6297
6492
  muse: MUSE_BEHAVIOR,
6298
6493
  "prime-agent": PRIME_AGENT_BEHAVIOR
6299
6494
  };
6495
+ const LEGACY_PI_HARNESS = "pi";
6496
+ /** True for the legacy stored harness alias `pi` (PAN-1989), which now means ohmypi. */
6497
+ function isLegacyPiHarnessName(raw) {
6498
+ return raw === LEGACY_PI_HARNESS;
6499
+ }
6500
+ /** Map a stored or requested harness string to a RuntimeName; legacy `pi` → `ohmypi`; anything else → null. */
6501
+ function normalizeHarnessName(raw) {
6502
+ if (isLegacyPiHarnessName(raw)) return "ohmypi";
6503
+ return typeof raw === "string" && KNOWN_HARNESSES.has(raw) ? raw : null;
6504
+ }
6300
6505
  function getHarnessBehavior(harness) {
6301
- if (harness === "ohmypi" || harness === "pi") return OHMYPI_BEHAVIOR;
6302
- if (harness === "codex") return CODEX_BEHAVIOR;
6303
- if (harness === "opencode") return OPENCODE_BEHAVIOR;
6304
- if (harness === "acp") return ACP_BEHAVIOR;
6305
- if (harness === "kimi-code") return KIMI_CODE_BEHAVIOR;
6306
- if (harness === "muse") return MUSE_BEHAVIOR;
6307
- if (harness === "prime-agent") return PRIME_AGENT_BEHAVIOR;
6308
- return CLAUDE_CODE_BEHAVIOR;
6506
+ return BEHAVIORS[normalizeHarnessName(harness) ?? "claude-code"];
6309
6507
  }
6310
6508
  function getRuntimeBehavior(runtime) {
6311
6509
  return BEHAVIORS[runtime];
@@ -6550,6 +6748,7 @@ const TELEMETRY_PROPERTY_DOMAINS = {
6550
6748
  "app_rest",
6551
6749
  "quota_sampler",
6552
6750
  "agent",
6751
+ "pr_adoption",
6553
6752
  "other"
6554
6753
  ],
6555
6754
  harness: [
@@ -6624,7 +6823,8 @@ const TELEMETRY_EVENT_CATALOG = {
6624
6823
  fork_intent: "fork_kind",
6625
6824
  fork_mode: "fork_kind",
6626
6825
  fast_summary: "boolean",
6627
- launch_harness: "harness"
6826
+ launch_harness: "harness",
6827
+ fresh_start: "boolean"
6628
6828
  },
6629
6829
  plan_approved: { subject_kind: "decision_subject" },
6630
6830
  plan_changes_requested: { subject_kind: "decision_subject" },
@@ -8143,6 +8343,12 @@ const COMPOSER_COMMAND_MANIFEST = [
8143
8343
  "description": "Create and launch the new conversation without sending the kickoff; start it with Send in the dashboard or pan handoff start <conv>",
8144
8344
  "required": false,
8145
8345
  "valueHint": null
8346
+ },
8347
+ {
8348
+ "flags": "--fresh",
8349
+ "description": "Start a clean conversation: no handoff document, no summary, no parent link; the focus is its first message. Project, cwd, model and effort still default from the source",
8350
+ "required": false,
8351
+ "valueHint": null
8146
8352
  }
8147
8353
  ],
8148
8354
  "aliases": [],
@@ -10897,6 +11103,328 @@ const COMPOSER_COMMAND_MANIFEST = [
10897
11103
  "aliases": [],
10898
11104
  "category": "Observation"
10899
11105
  },
11106
+ {
11107
+ "id": "pan-memory-show",
11108
+ "path": ["memory", "show"],
11109
+ "display": "/pan memory show",
11110
+ "description": "Print a curated memory fact",
11111
+ "args": [{
11112
+ "name": "id",
11113
+ "required": true,
11114
+ "variadic": false
11115
+ }],
11116
+ "options": [
11117
+ {
11118
+ "flags": "--project <key>",
11119
+ "description": "Project key (defaults to the project owning the cwd)",
11120
+ "required": true,
11121
+ "valueHint": "key"
11122
+ },
11123
+ {
11124
+ "flags": "--user",
11125
+ "description": "Read from the operator store (travels with you; synced when set up)",
11126
+ "required": false,
11127
+ "valueHint": null
11128
+ },
11129
+ {
11130
+ "flags": "--machine",
11131
+ "description": "Read from the machine store (this machine only)",
11132
+ "required": false,
11133
+ "valueHint": null
11134
+ },
11135
+ {
11136
+ "flags": "--here",
11137
+ "description": "Read from the cwd checkout's store instead of the primary checkout",
11138
+ "required": false,
11139
+ "valueHint": null
11140
+ }
11141
+ ],
11142
+ "aliases": [],
11143
+ "category": "Observation"
11144
+ },
11145
+ {
11146
+ "id": "pan-memory-list",
11147
+ "path": ["memory", "list"],
11148
+ "display": "/pan memory list",
11149
+ "description": "List curated memory facts",
11150
+ "args": [],
11151
+ "options": [
11152
+ {
11153
+ "flags": "--type <type>",
11154
+ "description": "Filter by fact type (feedback|project|reference|user)",
11155
+ "required": true,
11156
+ "valueHint": "type"
11157
+ },
11158
+ {
11159
+ "flags": "--query <q>",
11160
+ "description": "Filter by a fact-matching query (see pan memory search)",
11161
+ "required": true,
11162
+ "valueHint": "q"
11163
+ },
11164
+ {
11165
+ "flags": "--review",
11166
+ "description": "Show only facts carrying a review marker (default: active facts only)",
11167
+ "required": false,
11168
+ "valueHint": null
11169
+ },
11170
+ {
11171
+ "flags": "--project <key>",
11172
+ "description": "Project key (defaults to the project owning the cwd)",
11173
+ "required": true,
11174
+ "valueHint": "key"
11175
+ },
11176
+ {
11177
+ "flags": "--user",
11178
+ "description": "List the operator store (travels with you; synced when set up)",
11179
+ "required": false,
11180
+ "valueHint": null
11181
+ },
11182
+ {
11183
+ "flags": "--machine",
11184
+ "description": "List the machine store (this machine only)",
11185
+ "required": false,
11186
+ "valueHint": null
11187
+ },
11188
+ {
11189
+ "flags": "--here",
11190
+ "description": "List the cwd checkout's store instead of the primary checkout",
11191
+ "required": false,
11192
+ "valueHint": null
11193
+ },
11194
+ {
11195
+ "flags": "--json",
11196
+ "description": "Output JSON",
11197
+ "required": false,
11198
+ "valueHint": null
11199
+ }
11200
+ ],
11201
+ "aliases": [],
11202
+ "category": "Observation"
11203
+ },
11204
+ {
11205
+ "id": "pan-memory-add",
11206
+ "path": ["memory", "add"],
11207
+ "display": "/pan memory add",
11208
+ "description": "Add a curated memory fact",
11209
+ "args": [{
11210
+ "name": "id",
11211
+ "required": true,
11212
+ "variadic": false
11213
+ }],
11214
+ "options": [
11215
+ {
11216
+ "flags": "--type <type>",
11217
+ "description": "Fact type (feedback|project|reference|user)",
11218
+ "required": true,
11219
+ "valueHint": "type"
11220
+ },
11221
+ {
11222
+ "flags": "--description <text>",
11223
+ "description": "One-line index description (<= 200 chars)",
11224
+ "required": true,
11225
+ "valueHint": "text"
11226
+ },
11227
+ {
11228
+ "flags": "--title <text>",
11229
+ "description": "Fact title (defaults to the id, dashes as spaces, capitalized)",
11230
+ "required": true,
11231
+ "valueHint": "text"
11232
+ },
11233
+ {
11234
+ "flags": "--body <text>",
11235
+ "description": "Fact body",
11236
+ "required": true,
11237
+ "valueHint": "text"
11238
+ },
11239
+ {
11240
+ "flags": "--body-file <path>",
11241
+ "description": "Read the fact body from a file",
11242
+ "required": true,
11243
+ "valueHint": "path"
11244
+ },
11245
+ {
11246
+ "flags": "--tags <a,b>",
11247
+ "description": "Comma-separated tags",
11248
+ "required": true,
11249
+ "valueHint": "a,b"
11250
+ },
11251
+ {
11252
+ "flags": "--project <key>",
11253
+ "description": "Project key (defaults to the project owning the cwd)",
11254
+ "required": true,
11255
+ "valueHint": "key"
11256
+ },
11257
+ {
11258
+ "flags": "--user",
11259
+ "description": "Write to the operator store (travels with you; synced when set up)",
11260
+ "required": false,
11261
+ "valueHint": null
11262
+ },
11263
+ {
11264
+ "flags": "--machine",
11265
+ "description": "Write to the machine store (this machine only)",
11266
+ "required": false,
11267
+ "valueHint": null
11268
+ },
11269
+ {
11270
+ "flags": "--json",
11271
+ "description": "Output JSON",
11272
+ "required": false,
11273
+ "valueHint": null
11274
+ }
11275
+ ],
11276
+ "aliases": [],
11277
+ "category": "Observation"
11278
+ },
11279
+ {
11280
+ "id": "pan-memory-edit",
11281
+ "path": ["memory", "edit"],
11282
+ "display": "/pan memory edit",
11283
+ "description": "Edit a curated memory fact",
11284
+ "args": [{
11285
+ "name": "id",
11286
+ "required": true,
11287
+ "variadic": false
11288
+ }],
11289
+ "options": [
11290
+ {
11291
+ "flags": "--type <type>",
11292
+ "description": "Fact type (feedback|project|reference|user)",
11293
+ "required": true,
11294
+ "valueHint": "type"
11295
+ },
11296
+ {
11297
+ "flags": "--title <text>",
11298
+ "description": "Fact title",
11299
+ "required": true,
11300
+ "valueHint": "text"
11301
+ },
11302
+ {
11303
+ "flags": "--description <text>",
11304
+ "description": "One-line index description (<= 200 chars)",
11305
+ "required": true,
11306
+ "valueHint": "text"
11307
+ },
11308
+ {
11309
+ "flags": "--body <text>",
11310
+ "description": "Fact body",
11311
+ "required": true,
11312
+ "valueHint": "text"
11313
+ },
11314
+ {
11315
+ "flags": "--body-file <path>",
11316
+ "description": "Read the fact body from a file",
11317
+ "required": true,
11318
+ "valueHint": "path"
11319
+ },
11320
+ {
11321
+ "flags": "--tags <a,b>",
11322
+ "description": "Comma-separated tags",
11323
+ "required": true,
11324
+ "valueHint": "a,b"
11325
+ },
11326
+ {
11327
+ "flags": "--clear-review",
11328
+ "description": "Remove the review marker, re-activating the fact",
11329
+ "required": false,
11330
+ "valueHint": null
11331
+ },
11332
+ {
11333
+ "flags": "--project <key>",
11334
+ "description": "Project key (defaults to the project owning the cwd)",
11335
+ "required": true,
11336
+ "valueHint": "key"
11337
+ },
11338
+ {
11339
+ "flags": "--user",
11340
+ "description": "Edit the operator store (travels with you; synced when set up)",
11341
+ "required": false,
11342
+ "valueHint": null
11343
+ },
11344
+ {
11345
+ "flags": "--machine",
11346
+ "description": "Edit the machine store (this machine only)",
11347
+ "required": false,
11348
+ "valueHint": null
11349
+ },
11350
+ {
11351
+ "flags": "--json",
11352
+ "description": "Output JSON",
11353
+ "required": false,
11354
+ "valueHint": null
11355
+ }
11356
+ ],
11357
+ "aliases": [],
11358
+ "category": "Observation"
11359
+ },
11360
+ {
11361
+ "id": "pan-memory-retire",
11362
+ "path": ["memory", "retire"],
11363
+ "display": "/pan memory retire",
11364
+ "description": "Remove a curated memory fact (git history is the archive)",
11365
+ "args": [{
11366
+ "name": "id",
11367
+ "required": true,
11368
+ "variadic": false
11369
+ }],
11370
+ "options": [
11371
+ {
11372
+ "flags": "--project <key>",
11373
+ "description": "Project key (defaults to the project owning the cwd)",
11374
+ "required": true,
11375
+ "valueHint": "key"
11376
+ },
11377
+ {
11378
+ "flags": "--user",
11379
+ "description": "Retire from the operator store (travels with you; synced when set up)",
11380
+ "required": false,
11381
+ "valueHint": null
11382
+ },
11383
+ {
11384
+ "flags": "--machine",
11385
+ "description": "Retire from the machine store (this machine only)",
11386
+ "required": false,
11387
+ "valueHint": null
11388
+ },
11389
+ {
11390
+ "flags": "--json",
11391
+ "description": "Output JSON",
11392
+ "required": false,
11393
+ "valueHint": null
11394
+ }
11395
+ ],
11396
+ "aliases": [],
11397
+ "category": "Observation"
11398
+ },
11399
+ {
11400
+ "id": "pan-memory-sync",
11401
+ "path": ["memory", "sync"],
11402
+ "display": "/pan memory sync",
11403
+ "description": "Sync the operator memory store with your private git remote",
11404
+ "args": [],
11405
+ "options": [
11406
+ {
11407
+ "flags": "--setup <git-url>",
11408
+ "description": "Turn on sync: use this private git repository as the remote, then sync",
11409
+ "required": true,
11410
+ "valueHint": "git-url"
11411
+ },
11412
+ {
11413
+ "flags": "--status",
11414
+ "description": "Show sync state without touching the network",
11415
+ "required": false,
11416
+ "valueHint": null
11417
+ },
11418
+ {
11419
+ "flags": "--json",
11420
+ "description": "Output JSON",
11421
+ "required": false,
11422
+ "valueHint": null
11423
+ }
11424
+ ],
11425
+ "aliases": [],
11426
+ "category": "Observation"
11427
+ },
10900
11428
  {
10901
11429
  "id": "pan-briefing",
10902
11430
  "path": ["briefing"],
@@ -15799,6 +16327,83 @@ function laneActivityOf(row, now) {
15799
16327
  return "stopped";
15800
16328
  }
15801
16329
  //#endregion
16330
+ //#region src/conversation-window.ts
16331
+ /**
16332
+ * Conversation window contract shared by the dashboard server and the
16333
+ * frontend (PAN-4558). A cold open carries only the newest slice of a
16334
+ * transcript; older history is paged in by cursor. The constants bound every
16335
+ * open, and the timeline key gives entries one total order on both sides.
16336
+ */
16337
+ /** Most timeline rows a window or page carries. */
16338
+ const CONVERSATION_WINDOW_MAX_ROWS = 75;
16339
+ /** Most encoded entry bytes a window carries (960 KiB, leaving 64 KiB for metadata). */
16340
+ const CONVERSATION_WINDOW_MAX_BYTES = 983040;
16341
+ /** Whole-payload ceiling for an initial HTTP body or first WS event. */
16342
+ const CONVERSATION_PAYLOAD_BUDGET_BYTES = 1048576;
16343
+ /** Default `limit` for a paged read. */
16344
+ const CONVERSATION_PAGE_DEFAULT_LIMIT = 75;
16345
+ /** Largest `limit` a paged read accepts; larger values clamp to it. */
16346
+ const CONVERSATION_PAGE_MAX_LIMIT = 200;
16347
+ /** A tool `result` (or `detail`/`toolInput` string) above this many UTF-8 bytes leaves the wire. */
16348
+ const TOOL_BODY_INLINE_MAX_BYTES = 4096;
16349
+ /** Characters kept from an oversized `detail`/`toolInput` string. */
16350
+ const TOOL_BODY_PREVIEW_CHARS = 512;
16351
+ /** Most open entry ids a resume may name. */
16352
+ const RESUME_OPEN_IDS_MAX = 200;
16353
+ /** Most open tool calls pinned into a window beyond its contiguous slice. */
16354
+ const WINDOW_PINNED_OPEN_TOOLS_MAX = 10;
16355
+ function timelineKeyOfMessage(m) {
16356
+ return [
16357
+ m.createdAt,
16358
+ m.sequence ?? 0,
16359
+ 0,
16360
+ m.id
16361
+ ];
16362
+ }
16363
+ function timelineKeyOfWork(e) {
16364
+ return [
16365
+ e.createdAt,
16366
+ e.sequence ?? 0,
16367
+ 1,
16368
+ e.id
16369
+ ];
16370
+ }
16371
+ function compareStrings(a, b) {
16372
+ return a < b ? -1 : a > b ? 1 : 0;
16373
+ }
16374
+ /** Total order: createdAt (string compare), then sequence, then message before work, then id. */
16375
+ function compareTimelineKeys(a, b) {
16376
+ return compareStrings(a[0], b[0]) || a[1] - b[1] || a[2] - b[2] || compareStrings(a[3], b[3]);
16377
+ }
16378
+ function encodeTimelineCursor(key) {
16379
+ return JSON.stringify(key);
16380
+ }
16381
+ /** Returns null for anything that is not an encoded 4-tuple of string, finite number, 0|1, string. */
16382
+ function decodeTimelineCursor(cursor) {
16383
+ let value;
16384
+ try {
16385
+ value = JSON.parse(cursor);
16386
+ } catch {
16387
+ return null;
16388
+ }
16389
+ if (!Array.isArray(value) || value.length !== 4) return null;
16390
+ const [createdAt, sequence, kindRank, id] = value;
16391
+ if (typeof createdAt !== "string") return null;
16392
+ if (typeof sequence !== "number" || !Number.isFinite(sequence)) return null;
16393
+ if (kindRank !== 0 && kindRank !== 1) return null;
16394
+ if (typeof id !== "string") return null;
16395
+ return [
16396
+ createdAt,
16397
+ sequence,
16398
+ kindRank,
16399
+ id
16400
+ ];
16401
+ }
16402
+ /** A tool entry has a result when it carries one inline or the wire projection elided it. */
16403
+ function hasToolResult(e) {
16404
+ return !!e.result || (e.resultBytes ?? 0) > 0;
16405
+ }
16406
+ //#endregion
15802
16407
  //#region src/environment.ts
15803
16408
  /** Wire protocol version a client and server must agree on. */
15804
16409
  const ENVIRONMENT_PROTOCOL_VERSION = 1;
@@ -15841,6 +16446,7 @@ function isProtocolCompatible(descriptor, clientProtocolVersion) {
15841
16446
  }
15842
16447
  //#endregion
15843
16448
  exports.ACP_BEHAVIOR = ACP_BEHAVIOR;
16449
+ exports.ACP_CAPABILITIES = ACP_CAPABILITIES;
15844
16450
  exports.AGENT_ROLES = AGENT_ROLES;
15845
16451
  exports.Activity = Activity;
15846
16452
  exports.ActivityDetailedEvent = ActivityDetailedEvent;
@@ -15907,7 +16513,9 @@ exports.BackendPaneRemovedEvent = BackendPaneRemovedEvent;
15907
16513
  exports.BeadsFreshnessChangedEvent = BeadsFreshnessChangedEvent;
15908
16514
  exports.CHANNEL_REPLY_KIND_VALUES = CHANNEL_REPLY_KIND_VALUES;
15909
16515
  exports.CLAUDE_CODE_BEHAVIOR = CLAUDE_CODE_BEHAVIOR;
16516
+ exports.CLAUDE_CODE_CAPABILITIES = CLAUDE_CODE_CAPABILITIES;
15910
16517
  exports.CODEX_BEHAVIOR = CODEX_BEHAVIOR;
16518
+ exports.CODEX_CAPABILITIES = CODEX_CAPABILITIES;
15911
16519
  exports.COMPANION_TERMINAL_CLOSE_BODY_KEYS = COMPANION_TERMINAL_CLOSE_BODY_KEYS;
15912
16520
  exports.COMPANION_TERMINAL_OPEN_BODY_KEYS = COMPANION_TERMINAL_OPEN_BODY_KEYS;
15913
16521
  exports.COMPOSER_COMMAND_INSERT_OVERRIDES = COMPOSER_COMMAND_INSERT_OVERRIDES;
@@ -15915,6 +16523,11 @@ exports.COMPOSER_COMMAND_MANIFEST = COMPOSER_COMMAND_MANIFEST;
15915
16523
  exports.COMPOSER_COMMAND_VARIANTS = COMPOSER_COMMAND_VARIANTS;
15916
16524
  exports.CONTEXT_LAYER_KINDS = CONTEXT_LAYER_KINDS;
15917
16525
  exports.CONTEXT_PREVIEW_HARNESSES = CONTEXT_PREVIEW_HARNESSES;
16526
+ exports.CONVERSATION_PAGE_DEFAULT_LIMIT = CONVERSATION_PAGE_DEFAULT_LIMIT;
16527
+ exports.CONVERSATION_PAGE_MAX_LIMIT = CONVERSATION_PAGE_MAX_LIMIT;
16528
+ exports.CONVERSATION_PAYLOAD_BUDGET_BYTES = CONVERSATION_PAYLOAD_BUDGET_BYTES;
16529
+ exports.CONVERSATION_WINDOW_MAX_BYTES = CONVERSATION_WINDOW_MAX_BYTES;
16530
+ exports.CONVERSATION_WINDOW_MAX_ROWS = CONVERSATION_WINDOW_MAX_ROWS;
15918
16531
  exports.ChannelPermissionRequestSnapshot = ChannelPermissionRequestSnapshot;
15919
16532
  exports.ChannelReplyArtifactRef = ChannelReplyArtifactRef;
15920
16533
  exports.ChannelReplyKind = ChannelReplyKind;
@@ -15949,7 +16562,9 @@ exports.ConversationPermissionChangedEvent = ConversationPermissionChangedEvent;
15949
16562
  exports.ConversationPullRequests = ConversationPullRequests;
15950
16563
  exports.ConversationPullRequestsChangedEvent = ConversationPullRequestsChangedEvent;
15951
16564
  exports.ConversationResponse = ConversationResponse;
16565
+ exports.ConversationResume = ConversationResume;
15952
16566
  exports.ConversationTitleChangedEvent = ConversationTitleChangedEvent;
16567
+ exports.ConversationWindow = ConversationWindow;
15953
16568
  exports.CostEventRecordedEvent = CostEventRecordedEvent;
15954
16569
  exports.DEFAULT_EFFORT = DEFAULT_EFFORT;
15955
16570
  exports.DEFAULT_MAX_MEMORY_OBSERVATIONS_PER_ISSUE = DEFAULT_MAX_MEMORY_OBSERVATIONS_PER_ISSUE;
@@ -15962,6 +16577,7 @@ exports.DeepWipeRpc = DeepWipeRpc;
15962
16577
  exports.DeployStalenessSnapshot = DeployStalenessSnapshot;
15963
16578
  exports.DerivedBranchState = DerivedBranchState;
15964
16579
  exports.DerivedIssueState = DerivedIssueState;
16580
+ exports.DerivedPrOutsidePipeline = DerivedPrOutsidePipeline;
15965
16581
  exports.DerivedPrState = DerivedPrState;
15966
16582
  exports.DerivedWorkStart = DerivedWorkStart;
15967
16583
  exports.DirectoryEntry = DirectoryEntry;
@@ -16058,6 +16674,7 @@ exports.GitHubQuotaUsage = GitHubQuotaUsage;
16058
16674
  exports.GitHubRateLimitKind = GitHubRateLimitKind;
16059
16675
  exports.GlobalContextLayerRecord = GlobalContextLayerRecord;
16060
16676
  exports.GlobalContextLayerTarget = GlobalContextLayerTarget;
16677
+ exports.HARNESS_CAPABILITY_KEYS = HARNESS_CAPABILITY_KEYS;
16061
16678
  exports.HOOK_INVENTORY = HOOK_INVENTORY;
16062
16679
  exports.HealthReason = HealthReason;
16063
16680
  exports.HealthState = HealthState;
@@ -16080,6 +16697,7 @@ exports.IssuesDeltaEvent = IssuesDeltaEvent;
16080
16697
  exports.IssuesSnapshotEvent = IssuesSnapshotEvent;
16081
16698
  exports.IssuesUpdatedEvent = IssuesUpdatedEvent;
16082
16699
  exports.KIMI_CODE_BEHAVIOR = KIMI_CODE_BEHAVIOR;
16700
+ exports.KIMI_CODE_CAPABILITIES = KIMI_CODE_CAPABILITIES;
16083
16701
  exports.KNOWN_HARNESSES = KNOWN_HARNESSES;
16084
16702
  exports.LANE_STARTING_GRACE_MS = LANE_STARTING_GRACE_MS;
16085
16703
  exports.LegacySystemHealthSummary = LegacySystemHealthSummary;
@@ -16096,6 +16714,7 @@ exports.MAX_CHANNEL_REPLY_ARTIFACT_URI_LENGTH = MAX_CHANNEL_REPLY_ARTIFACT_URI_L
16096
16714
  exports.MAX_CHANNEL_REPLY_SUMMARY_LENGTH = MAX_CHANNEL_REPLY_SUMMARY_LENGTH;
16097
16715
  exports.MEMBERSHIP_UNAVAILABLE_REASONS = MEMBERSHIP_UNAVAILABLE_REASONS;
16098
16716
  exports.MUSE_BEHAVIOR = MUSE_BEHAVIOR;
16717
+ exports.MUSE_CAPABILITIES = MUSE_CAPABILITIES;
16099
16718
  exports.MemoryAgentRole = MemoryAgentRole;
16100
16719
  exports.MemoryHealthChangedEvent = MemoryHealthChangedEvent;
16101
16720
  exports.MemoryIdentity = MemoryIdentity;
@@ -16112,7 +16731,9 @@ exports.ModelOrigin = ModelOrigin;
16112
16731
  exports.ModelOriginEntry = ModelOriginEntry;
16113
16732
  exports.NON_ESSENTIAL_GITHUB_CALLERS = NON_ESSENTIAL_GITHUB_CALLERS;
16114
16733
  exports.OHMYPI_BEHAVIOR = OHMYPI_BEHAVIOR;
16734
+ exports.OHMYPI_CAPABILITIES = OHMYPI_CAPABILITIES;
16115
16735
  exports.OPENCODE_BEHAVIOR = OPENCODE_BEHAVIOR;
16736
+ exports.OPENCODE_CAPABILITIES = OPENCODE_CAPABILITIES;
16116
16737
  exports.OVERDECK_AGENT_PROTOCOL_VERSION = OVERDECK_AGENT_PROTOCOL_VERSION;
16117
16738
  exports.OVERDECK_DASHBOARD_PROTOCOL_VERSION = OVERDECK_DASHBOARD_PROTOCOL_VERSION;
16118
16739
  exports.OpenInEditorInput = OpenInEditorInput;
@@ -16126,6 +16747,7 @@ exports.OrderBookSettings = OrderBookSettings;
16126
16747
  exports.OrderBookStatus = OrderBookStatus;
16127
16748
  exports.PIPELINE_MEMBERSHIP_LOADING_CODE = PIPELINE_MEMBERSHIP_LOADING_CODE;
16128
16749
  exports.PRIME_AGENT_BEHAVIOR = PRIME_AGENT_BEHAVIOR;
16750
+ exports.PRIME_AGENT_CAPABILITIES = PRIME_AGENT_CAPABILITIES;
16129
16751
  exports.PanRpcError = PanRpcError;
16130
16752
  exports.PanRpcGroup = PanRpcGroup;
16131
16753
  exports.PendingTurn = PendingTurn;
@@ -16161,6 +16783,7 @@ exports.PullRequestLinkSource = PullRequestLinkSource;
16161
16783
  exports.PullRequestLinkedConversation = PullRequestLinkedConversation;
16162
16784
  exports.PullRequestSnapshot = PullRequestSnapshot;
16163
16785
  exports.PullRequestState = PullRequestState;
16786
+ exports.RESUME_OPEN_IDS_MAX = RESUME_OPEN_IDS_MAX;
16164
16787
  exports.RagDecision = RagDecision;
16165
16788
  exports.RagDecisionSource = RagDecisionSource;
16166
16789
  exports.ReadFileAtPathInput = ReadFileAtPathInput;
@@ -16169,7 +16792,9 @@ exports.ReadFileAtPathRpc = ReadFileAtPathRpc;
16169
16792
  exports.ReadWorkspaceFileInput = ReadWorkspaceFileInput;
16170
16793
  exports.ReadWorkspaceFileResult = ReadWorkspaceFileResult;
16171
16794
  exports.ReadWorkspaceFileRpc = ReadWorkspaceFileRpc;
16795
+ exports.ReplayEventsResult = ReplayEventsResult;
16172
16796
  exports.ReplayEventsRpc = ReplayEventsRpc;
16797
+ exports.ReplayTooFarBehind = ReplayTooFarBehind;
16173
16798
  exports.ResetMarker = ResetMarker;
16174
16799
  exports.ResetMarkerScope = ResetMarkerScope;
16175
16800
  exports.ResizeTerminalRpc = ResizeTerminalRpc;
@@ -16249,6 +16874,8 @@ exports.TELEMETRY_EVENT_CATALOG = TELEMETRY_EVENT_CATALOG;
16249
16874
  exports.TELEMETRY_EVENT_NAMES = TELEMETRY_EVENT_NAMES;
16250
16875
  exports.TELEMETRY_PROPERTY_DOMAINS = TELEMETRY_PROPERTY_DOMAINS;
16251
16876
  exports.TERMINAL_BACKEND_NAMES = TERMINAL_BACKEND_NAMES;
16877
+ exports.TOOL_BODY_INLINE_MAX_BYTES = TOOL_BODY_INLINE_MAX_BYTES;
16878
+ exports.TOOL_BODY_PREVIEW_CHARS = TOOL_BODY_PREVIEW_CHARS;
16252
16879
  exports.TerminalCloseRpc = TerminalCloseRpc;
16253
16880
  exports.TerminalOpenRpc = TerminalOpenRpc;
16254
16881
  exports.TerminalOutput = TerminalOutput;
@@ -16261,6 +16888,7 @@ exports.TickMarkerPhase = TickMarkerPhase;
16261
16888
  exports.TurnDiffFileChange = TurnDiffFileChange;
16262
16889
  exports.TurnDiffSummary = TurnDiffSummary;
16263
16890
  exports.TurnEndAssessment = TurnEndAssessment;
16891
+ exports.WINDOW_PINNED_OPEN_TOOLS_MAX = WINDOW_PINNED_OPEN_TOOLS_MAX;
16264
16892
  exports.WIRED_HOOK_INVENTORY = WIRED_HOOK_INVENTORY;
16265
16893
  exports.WIRED_HOOK_NAMES = WIRED_HOOK_NAMES;
16266
16894
  exports.WS_METHODS = WS_METHODS;
@@ -16288,16 +16916,20 @@ exports.canonicalPullRequestUrl = canonicalPullRequestUrl;
16288
16916
  exports.companionTerminalKindFor = companionTerminalKindFor;
16289
16917
  exports.compareEffort = compareEffort;
16290
16918
  exports.compareIssueIds = compareIssueIds;
16919
+ exports.compareTimelineKeys = compareTimelineKeys;
16291
16920
  exports.createIssueDelta = createIssueDelta;
16292
16921
  exports.decodeFlywheelDerivedStatus = decodeFlywheelDerivedStatus;
16293
16922
  exports.decodeFlywheelStats = decodeFlywheelStats;
16923
+ exports.decodeTimelineCursor = decodeTimelineCursor;
16294
16924
  exports.deriveProjectCi = deriveProjectCi;
16295
16925
  exports.encodeFlywheelStats = encodeFlywheelStats;
16926
+ exports.encodeTimelineCursor = encodeTimelineCursor;
16296
16927
  exports.getHarness = getHarness;
16297
16928
  exports.getHarnessBehavior = getHarnessBehavior;
16298
16929
  exports.getMaxMemoryObservationsPerIssue = getMaxMemoryObservationsPerIssue;
16299
16930
  exports.getMaxTurnDiffSummariesPerAgent = getMaxTurnDiffSummariesPerAgent;
16300
16931
  exports.getRuntimeBehavior = getRuntimeBehavior;
16932
+ exports.hasToolResult = hasToolResult;
16301
16933
  exports.indexPanesByAgentKey = indexPanesByAgentKey;
16302
16934
  exports.isAgentRole = isAgentRole;
16303
16935
  exports.isAgentSessionName = isAgentSessionName;
@@ -16306,12 +16938,14 @@ exports.isConfiguredPullRequestRepo = isConfiguredPullRequestRepo;
16306
16938
  exports.isEffortLevel = isEffortLevel;
16307
16939
  exports.isIssueAttention = isIssueAttention;
16308
16940
  exports.isIssueState = isIssueState;
16941
+ exports.isLegacyPiHarnessName = isLegacyPiHarnessName;
16309
16942
  exports.isProtocolCompatible = isProtocolCompatible;
16310
16943
  exports.isSingletonConversation = isSingletonConversation;
16311
16944
  exports.isTerminalBackendName = isTerminalBackendName;
16312
16945
  exports.isTerminalTurnDiffSummaryStatus = isTerminalTurnDiffSummaryStatus;
16313
16946
  exports.laneActivityOf = laneActivityOf;
16314
16947
  exports.normalizeChannelReplyPayload = normalizeChannelReplyPayload;
16948
+ exports.normalizeHarnessName = normalizeHarnessName;
16315
16949
  exports.omitTurnDiffSummariesForAgent = omitTurnDiffSummariesForAgent;
16316
16950
  exports.paneAgentKey = paneAgentKey;
16317
16951
  exports.parsePullRequestRef = parsePullRequestRef;
@@ -16319,6 +16953,8 @@ exports.projectLegacySystemHealthSummary = projectLegacySystemHealthSummary;
16319
16953
  exports.repoFromRemoteUrl = repoFromRemoteUrl;
16320
16954
  exports.resolveEffectivePullRequest = resolveEffectivePullRequest;
16321
16955
  exports.syncSnapshot = syncSnapshot;
16956
+ exports.timelineKeyOfMessage = timelineKeyOfMessage;
16957
+ exports.timelineKeyOfWork = timelineKeyOfWork;
16322
16958
  exports.trimMemoryObservations = trimMemoryObservations;
16323
16959
  exports.trimTurnDiffSummaries = trimTurnDiffSummaries;
16324
16960
  exports.withPaneLivenessAlias = withPaneLivenessAlias;