@sideboard-ai/core 0.1.349 → 0.1.350

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/{abletime-CGFJZB7L.js → abletime-TX7BTTR2.js} +5 -5
  2. package/dist/{abletime-3HRWLQZJ.js → abletime-URSRZW7P.js} +4 -4
  3. package/dist/{abletime-oauth-QNJQLHR4.js → abletime-oauth-QS3WPSCC.js} +3 -3
  4. package/dist/{abletime-oauth-JQDSH5OL.js → abletime-oauth-SL3NMNEC.js} +4 -4
  5. package/dist/{abletime-rest-TANL5TMY.js → abletime-rest-GGQLUO55.js} +3 -3
  6. package/dist/{abletime-rest-UQA2CRZN.js → abletime-rest-JZU6JJCV.js} +4 -4
  7. package/dist/agents/acp-runner.cjs +491 -0
  8. package/dist/agents/acp-runner.d.cts +46 -0
  9. package/dist/agents/acp-runner.d.ts +46 -0
  10. package/dist/agents/acp-runner.js +323 -0
  11. package/dist/{agents-DMPBFF3F.js → agents-P5QIV24I.js} +37 -7
  12. package/dist/{agents-AZ2PV6XP.js → agents-RGAV5OHD.js} +42 -11
  13. package/dist/{app-settings-SNOPJ7P5.js → app-settings-IA7ZZKWQ.js} +2 -2
  14. package/dist/{app-settings-PPIMYJKS.js → app-settings-XILTSD6L.js} +1 -1
  15. package/dist/{chunk-Q4I6KDOL.js → chunk-2MESZ5XR.js} +60 -39
  16. package/dist/{chunk-RUIHNWRV.js → chunk-37ZBEBP6.js} +6 -6
  17. package/dist/{chunk-WHMLMCPU.js → chunk-5AHWUJRT.js} +1925 -1722
  18. package/dist/{chunk-7B2OUQON.js → chunk-5TCMXEYL.js} +48 -3
  19. package/dist/{chunk-FDYMVJFU.js → chunk-5WF54R3B.js} +5 -5
  20. package/dist/{chunk-PVCECFJK.js → chunk-7ZD4OK6G.js} +1 -1
  21. package/dist/{chunk-RYPD7XWV.js → chunk-B4EFQTMP.js} +5 -5
  22. package/dist/chunk-BF6INES4.js +144 -0
  23. package/dist/{chunk-IVRWRYTH.js → chunk-BZK62VPT.js} +2 -2
  24. package/dist/{chunk-AJMERXZP.js → chunk-CCWQ65VD.js} +2 -2
  25. package/dist/{chunk-62ALWH3T.js → chunk-DL4OHDBV.js} +3 -3
  26. package/dist/{chunk-CATTIFSP.js → chunk-EZ2MUWNW.js} +3 -3
  27. package/dist/{chunk-4NXGVJA6.js → chunk-F4RFFE2H.js} +48 -3
  28. package/dist/{chunk-E77SRVVO.js → chunk-FCKTBE26.js} +1 -1
  29. package/dist/{chunk-3DBL2C45.js → chunk-FQ3JYUKI.js} +2 -2
  30. package/dist/{chunk-CEQ4Z32M.js → chunk-J4EA5SHF.js} +3 -3
  31. package/dist/{chunk-MHSBF3SO.js → chunk-LFSTOECH.js} +3 -3
  32. package/dist/{chunk-OHUAAX3O.js → chunk-M45WGODR.js} +2 -2
  33. package/dist/{chunk-MVFFLU5V.js → chunk-MANERA6F.js} +12 -5
  34. package/dist/{chunk-ZXI5DR5S.js → chunk-NDEVAA34.js} +1624 -1487
  35. package/dist/{chunk-UJMCTGV7.js → chunk-PXSWVZIL.js} +2 -2
  36. package/dist/{chunk-6RIPZ73M.js → chunk-SMSD6U3N.js} +3 -1
  37. package/dist/{chunk-RPHH4FNK.js → chunk-TCEUNSLX.js} +3 -1
  38. package/dist/chunk-TRMPDDVL.js +232 -0
  39. package/dist/{chunk-6WMNIX2U.js → chunk-UFUAIVNV.js} +9 -5
  40. package/dist/{chunk-QHXZKHUL.js → chunk-VHQ6OG3U.js} +2 -2
  41. package/dist/{chunk-WWU4SYZR.js → chunk-VL6F2KRE.js} +5 -1
  42. package/dist/{chunk-IRFBD6GU.js → chunk-W5GHFT7E.js} +71 -47
  43. package/dist/{chunk-5FUAOU3G.js → chunk-WB3G2LQO.js} +1 -1
  44. package/dist/{chunk-JCYGQKER.js → chunk-WFX4ZVSZ.js} +1 -1
  45. package/dist/{chunk-F7WP2U5I.js → chunk-WJURGCBR.js} +1 -1
  46. package/dist/chunk-YE7Z5WH3.js +142 -0
  47. package/dist/{chunk-ROXM6QZV.js → chunk-ZBSEJIOV.js} +12 -5
  48. package/dist/{conductor-NHC6X74J.js → conductor-HVOGBK63.js} +6 -5
  49. package/dist/{conductor-65VPUPOW.js → conductor-VGCXUUG6.js} +7 -6
  50. package/dist/connected-teams-2YDE2EZ2.js +1 -1
  51. package/dist/{coordinator-prompt-5GZWIVSY.js → coordinator-prompt-DPO7L2JO.js} +5 -5
  52. package/dist/{coordinator-prompt-R2PURZL3.js → coordinator-prompt-E736TJBS.js} +4 -4
  53. package/dist/{global-workspace-64KC7PST.js → global-workspace-4RDPAOTT.js} +5 -5
  54. package/dist/{global-workspace-UEECLWSX.js → global-workspace-TG2TVLUF.js} +4 -4
  55. package/dist/index.cjs +1600 -929
  56. package/dist/index.d.cts +132 -891
  57. package/dist/index.d.ts +132 -891
  58. package/dist/index.js +433 -207
  59. package/dist/{linear-PKYJH4WK.js → linear-E3BX5PX5.js} +2 -2
  60. package/dist/{linear-MIJO6DCV.js → linear-WG23LBCX.js} +3 -3
  61. package/dist/{linear-list-JPQ27RXG.js → linear-list-OINZWVV5.js} +1 -1
  62. package/dist/{linear-list-N57PR6JM.js → linear-list-VU47BNUV.js} +1 -1
  63. package/dist/mcp/run-stdio.cjs +1097 -720
  64. package/dist/mcp/run-stdio.js +32 -24
  65. package/dist/{optional-cli-4GTEDEYJ.js → optional-cli-K6HX2X5O.js} +4 -3
  66. package/dist/{optional-cli-RPJIQBDX.js → optional-cli-SA3EQYML.js} +6 -5
  67. package/dist/{orchestrator-Y5PYSMR6.js → orchestrator-3I2FLEZL.js} +17 -15
  68. package/dist/{orchestrator-I5G5A5BV.js → orchestrator-QDHZ56LA.js} +11 -10
  69. package/dist/thread-CJRchYLj.d.cts +856 -0
  70. package/dist/thread-CJRchYLj.d.ts +856 -0
  71. package/dist/{thread-store-HZ4U4OXB.js → thread-store-4YTOV2HL.js} +3 -3
  72. package/dist/{thread-store-QKNU5CHM.js → thread-store-LME2ICZP.js} +2 -2
  73. package/dist/{workspaces-6TIM2TM2.js → workspaces-4PA24IX6.js} +4 -4
  74. package/dist/{workspaces-I2EHNTFE.js → workspaces-6TMYV4N2.js} +5 -5
  75. package/dist/{worktree-7JFYDNUX.js → worktree-4ATMCYIE.js} +3 -3
  76. package/dist/{worktree-M2GJGK2P.js → worktree-DA6SKIU5.js} +4 -4
  77. package/package.json +3 -3
  78. /package/dist/{chunk-XOEKCE6L.js → chunk-OHXNGBC4.js} +0 -0
@@ -0,0 +1,856 @@
1
+ /**
2
+ * Why an agent is waiting on a person. Process liveness stays on
3
+ * `ThreadStatus`; this is the attention flag (Herdr `blocked`).
4
+ * Cleared when the next user message starts a turn. An ask_user highlight
5
+ * stays until the user answers or skips. A later tool in the same turn
6
+ * does not remove it — the tool returns immediately, and the model often
7
+ * keeps going before the person can answer.
8
+ */
9
+ type AgentBlockSource = 'ask_user' | 'plan' | 'reported' | 'permission';
10
+ /** Composer Allow / Deny while a tool waits on the user. */
11
+ interface AgentPermissionPrompt {
12
+ id: string;
13
+ title: string;
14
+ detail: string;
15
+ path?: string;
16
+ /** Offer a remembered allow (a directory, or every tool on an MCP server). */
17
+ allowSession: boolean;
18
+ /** Button label when it is not "Allow for this session". */
19
+ sessionLabel?: string;
20
+ /** Claude asked that a stray keystroke must not approve this. */
21
+ defaultToNo?: boolean;
22
+ }
23
+ interface AgentBlock {
24
+ /** Short reason shown on the sidebar, board, and to orchestrators. */
25
+ reason: string;
26
+ source: AgentBlockSource;
27
+ at: string;
28
+ /** ask_user question-set signature, so a skip can drop this highlight. */
29
+ questionSignature?: string;
30
+ /**
31
+ * Full ask_user payload. The composer reads this when the transcript
32
+ * tool call never stored its input, so the sidebar highlight and the
33
+ * chat picker stay the same question.
34
+ */
35
+ questions?: Array<{
36
+ question: string;
37
+ header?: string;
38
+ multiSelect?: boolean;
39
+ options: Array<{
40
+ label: string;
41
+ description?: string;
42
+ }>;
43
+ }>;
44
+ /**
45
+ * True once ask_user is in the live stream or the finished turn.
46
+ * A mid-turn stamp without this stays off the sidebar / board / phone
47
+ * until the picker is actually on screen. A later tool does not clear it.
48
+ */
49
+ onScreen?: boolean;
50
+ permission?: AgentPermissionPrompt;
51
+ }
52
+
53
+ type ChatFollowUpKind = 'ci' | 'at';
54
+ /** `pending` still running, `done` every check finished, `none` no PR or no rows. */
55
+ /** `unknown` is a failed checks read. It must not count as pending or finished. */
56
+ type CiPhase = 'pending' | 'done' | 'none' | 'unknown';
57
+ type ChatFollowUp = {
58
+ id: string;
59
+ kind: ChatFollowUpKind;
60
+ prompt: string;
61
+ /** When an `at` follow-up should send. */
62
+ at?: string;
63
+ /** Drop a still-pending `ci` follow-up after this without sending. */
64
+ deadline: string;
65
+ createdAt: string;
66
+ /** CI state when this follow-up was registered. */
67
+ ciBaseline?: CiPhase;
68
+ /** True after a later poll saw checks still running. */
69
+ ciSawPending?: boolean;
70
+ };
71
+
72
+ /**
73
+ * Agent thinking / reasoning effort.
74
+ * Matches Claude Code `--effort` and Conductor's 5-rung effort chip:
75
+ * low → medium → high → xhigh → max.
76
+ */
77
+ type ThinkingEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max';
78
+ declare const THINKING_EFFORTS: ThinkingEffort[];
79
+ /** Conductor settings sometimes use `normal` for the mid Claude effort band. */
80
+ declare function normalizeThinkingEffort(value: unknown): ThinkingEffort | null;
81
+ declare function isThinkingEffort(value: unknown): value is ThinkingEffort;
82
+ /** Cycle Low → … → Max → Low (Conductor ⌥T-style). */
83
+ declare function nextThinkingEffort(current: ThinkingEffort): ThinkingEffort;
84
+ /** How many of 5 Conductor-style signal bars are filled. */
85
+ declare function thinkingEffortBars(effort: ThinkingEffort): number;
86
+ declare function thinkingEffortLabel(effort: ThinkingEffort): string;
87
+
88
+ type AgentKind = 'claude' | 'codex' | 'opencode' | 'brightsy' | 'cursor' | 'acp';
89
+ /** CLI the ACP adapter launches. One kind (`acp`); Gemini CLI or Copilot CLI. */
90
+ type AcpHarnessId = 'gemini' | 'copilot';
91
+ type SourceType = 'branch' | 'pr' | 'ticket' | 'orchestration' | 'adopt';
92
+ type ThreadStatus = 'idle' | 'queued' | 'running' | 'stopped' | 'error' | 'broken' | 'archived';
93
+ type Autonomy = 'default' | 'full';
94
+ /** Structured agent turn content (thinking / tools / text). */
95
+ type MessagePart = {
96
+ type: 'text';
97
+ text: string;
98
+ parentId?: string;
99
+ startedAt?: number;
100
+ updatedAt?: number;
101
+ } | {
102
+ type: 'thinking';
103
+ text: string;
104
+ parentId?: string;
105
+ startedAt?: number;
106
+ updatedAt?: number;
107
+ } | {
108
+ type: 'tool';
109
+ id: string;
110
+ name: string;
111
+ input?: Record<string, unknown>;
112
+ /** Short human label (e.g. "Fetch latest from origin"). */
113
+ description?: string;
114
+ /** Command / path shown in the monospace pill. */
115
+ detail?: string;
116
+ result?: string;
117
+ status: 'running' | 'done' | 'error';
118
+ filePath?: string;
119
+ additions?: number;
120
+ deletions?: number;
121
+ /**
122
+ * When set, this part belongs inside a parent tool (Cursor Task / Agent
123
+ * subagent stream). Omitted on top-level parts.
124
+ */
125
+ parentId?: string;
126
+ startedAt?: number;
127
+ updatedAt?: number;
128
+ };
129
+ /** Token usage for a single agent turn, aggregated across the turn's API calls. */
130
+ interface TokenUsage {
131
+ /** Uncached prompt tokens. Adapters must subtract provider cache hits first. */
132
+ inputTokens: number;
133
+ outputTokens: number;
134
+ /** Cache hits, not included in `inputTokens` (Claude-shaped). */
135
+ cacheReadTokens?: number;
136
+ cacheWriteTokens?: number;
137
+ /** Last-request occupancy (input + cache); billed totals sum every tool round. */
138
+ lastRequestTokens?: number;
139
+ /** USD for this turn (not Claude session total). */
140
+ costUsd?: number;
141
+ /** Claude `total_cost_usd` session total; not additive. */
142
+ sessionCostUsd?: number;
143
+ }
144
+ interface ThreadMessage {
145
+ role: 'user' | 'agent' | 'summary';
146
+ text: string;
147
+ /** Structured parts for expandable tool/thinking UI. Optional for older threads. */
148
+ parts?: MessagePart[];
149
+ /** Agent turn duration in milliseconds (from turn start to message persist). */
150
+ durationMs?: number;
151
+ /** Token usage for this turn, when the agent CLI reports it. */
152
+ usage?: TokenUsage;
153
+ /**
154
+ * Snapshot of composer attachments sent with this user turn (chips stay visible
155
+ * in chat history after pending thread.attachments are cleared).
156
+ */
157
+ attachments?: ThreadAttachment[];
158
+ /**
159
+ * Host-queued keep-alive (job still running / crash recover). Shown as a
160
+ * system note — not a user bubble.
161
+ */
162
+ origin?: 'continue';
163
+ ts: string;
164
+ }
165
+ /** Composer / turn attachment (e.g. forked chat transcript). */
166
+ interface ThreadAttachment {
167
+ id: string;
168
+ name: string;
169
+ kind: 'transcript' | 'file' | 'issue' | 'workspace' | 'diff-comment' | 'code-ref';
170
+ content: string;
171
+ /** Worktree-relative path when this attachment is a real file that can be opened in a tab. */
172
+ path?: string;
173
+ /** data: URL thumbnail for image attachments (composer + sent user messages). */
174
+ previewDataUrl?: string;
175
+ }
176
+ /** Persisted chat record (product word: chat). One conversation tab. */
177
+ interface Thread {
178
+ id: string;
179
+ title: string;
180
+ sourceType: SourceType;
181
+ sourceRef: string;
182
+ branchName: string;
183
+ worktreePath: string;
184
+ repoPath: string;
185
+ agent: AgentKind;
186
+ /** Gemini CLI or Copilot CLI when `agent` is `acp`. */
187
+ acpHarness?: AcpHarnessId | null;
188
+ /** Agent model alias (e.g. sonnet, opus). null = Auto / CLI default. */
189
+ model: string | null;
190
+ /**
191
+ * Thinking / reasoning effort (Claude: `--effort`, Cursor: `effort` param).
192
+ * Independent of {@link Thread.fast}.
193
+ */
194
+ effort: ThinkingEffort;
195
+ /**
196
+ * Prefer a faster model variant when the agent supports it (Cursor: `fast` param).
197
+ * Independent of {@link Thread.effort}.
198
+ */
199
+ fast: boolean;
200
+ /** Plan-only turns — analyze and plan without editing files (Conductor-style). */
201
+ planMode: boolean;
202
+ /**
203
+ * After a Codex plugin/App MCP kills `codex exec` (AuthRequired / invalid
204
+ * transport), later turns isolate Apps/plugins so the same fatal error
205
+ * cannot loop. Worktree first tries with plugins on.
206
+ */
207
+ isolateCodexPlugins?: boolean;
208
+ sessionId: string | null;
209
+ /** Pinned Claude/Codex account. `null` = system default. Omitted until the first spawn pins it. */
210
+ accountId?: string | null;
211
+ autonomy: Autonomy;
212
+ /** MCP servers this chat may call without another prompt (`gmail` in `mcp__gmail__search`). */
213
+ approvedMcpServers?: string[];
214
+ sourceIsFork: boolean;
215
+ status: ThreadStatus;
216
+ agentBlock?: AgentBlock | null;
217
+ dismissedQuestionSignature?: string | null;
218
+ queue: string[];
219
+ parentThreadId: string | null;
220
+ /** Port of the default/primary run script (legacy + sidebar). */
221
+ devPort: number | null;
222
+ /** Named run scripts currently tracked for this thread. */
223
+ activeRuns?: ActiveRun[];
224
+ /** MCP/CLI run script or steer for the desktop host to apply in-process. */
225
+ runScriptRequest?: RunScriptRequest | null;
226
+ steerRequest?: SteerRequest | null;
227
+ prUrl: string | null;
228
+ /** Cached PR title for Conductor-style sidebar labels (PR title > branch). */
229
+ prTitle: string | null;
230
+ /** Cached PR state (`OPEN` | `MERGED` | `CLOSED`) for sidebar styling and auto-archive. */
231
+ prState: string | null;
232
+ /** Cached draft flag. Open + draft → Home Draft; open + not draft → Review. */
233
+ prIsDraft?: boolean;
234
+ /** Cached PR author login, compared to `gh` viewer for Mine vs Reviewing. */
235
+ prAuthorLogin?: string | null;
236
+ /** Cached human reviewer logins. Counts as Reviewing when the author is unknown. */
237
+ prReviewerLogins?: string[];
238
+ /** Cached GitHub reviewDecision (APPROVED, CHANGES_REQUESTED, or REVIEW_REQUIRED). */
239
+ prReviewDecision?: string | null;
240
+ /** Cached GitHub `mergeable` (`MERGEABLE` / `CONFLICTING` / `UNKNOWN`). */
241
+ prMergeable?: string | null;
242
+ /** Cached GitHub `mergeStateStatus` (`CLEAN` / `DIRTY` / `BLOCKED` / `UNSTABLE` / …). */
243
+ prMergeStateStatus?: string | null;
244
+ /** Cached GitHub merge-queue flag from the last `getPrMeta`. */
245
+ prIsInMergeQueue?: boolean;
246
+ /** Cached GitHub label names (workflow tags like `eng-review`) for sidebar and board badges. */
247
+ prLabels?: string[];
248
+ /** True when `gh pr checks` reported a failing CI run. */
249
+ prChecksFailed?: boolean;
250
+ /** This checkout opts in to CI / review-request wakes. Off until set. */
251
+ wakeOnGithubEdges?: boolean;
252
+ /** CI or time follow-ups on this chat. A running turn is not interrupted. Cap 10. */
253
+ followUps?: ChatFollowUp[];
254
+ /** Source-ticket blockers. Empty if none; absent until looked up. Not an agent block. */
255
+ issueBlockedBy?: string[];
256
+ /**
257
+ * When true, skip auto-archive if the PR is already MERGED (set on restore
258
+ * so unarchiving a merged workspace does not immediately re-archive).
259
+ * Cleared when `prState` becomes a non-merged open state again.
260
+ */
261
+ skipAutoArchiveOnMerge?: boolean;
262
+ /**
263
+ * Work in the registered project folder on the default branch (no `thread/*`
264
+ * worktree). Land is commit+push to that branch, not a PR. Archive/purge
265
+ * must not delete the project folder.
266
+ */
267
+ cowboy?: boolean;
268
+ /**
269
+ * Stable id for a GitHub PR stack this thread belongs to (shared across layer worktrees).
270
+ * Null when not part of a stack.
271
+ */
272
+ stackId: string | null;
273
+ /** 1-based layer position in the stack (bottom = 1), when {@link stackId} is set. */
274
+ stackLayer: number | null;
275
+ /** When true, `title` is a manual override and is not overwritten by branch/PR sync. */
276
+ userSetTitle: boolean;
277
+ /** Short labels shared by every chat on this workspace. */
278
+ tags?: string[];
279
+ createdAt: string;
280
+ updatedAt: string;
281
+ /** When this chat was archived. History age uses this, not later row updates. */
282
+ archivedAt?: string;
283
+ ephemeralAutomationId?: string;
284
+ messages: ThreadMessage[];
285
+ /**
286
+ * Prose-only turns dropped by auto-compact (user text + agent answers).
287
+ * Chat search / “show earlier” read this. Seed, occupancy, and session
288
+ * resume must keep using {@link messages} only.
289
+ */
290
+ compactedMessages?: ThreadMessage[];
291
+ /** Pending composer attachments (forked transcripts, etc.). */
292
+ attachments: ThreadAttachment[];
293
+ /**
294
+ * Composer attachments consumed on send, waiting for the next user turn.
295
+ * Keeps the chip tray empty after submit while `runTurn` still has the files.
296
+ */
297
+ pendingTurnAttachments?: ThreadAttachment[];
298
+ /**
299
+ * Files parked with each queued prompt (same length as `queue`).
300
+ * Remove / reorder / Send now must move these with the text so a later
301
+ * turn does not inherit images from a discarded follow-up.
302
+ */
303
+ queueAttachments?: ThreadAttachment[][];
304
+ lastError?: string | null;
305
+ /** Live agent pid, and its `ps` lstart so Stop skips a recycled pid. */
306
+ agentPid?: number | null;
307
+ agentPidStartedAt?: string | null;
308
+ /**
309
+ * When set, host auto-retries this chat after a provider session/usage
310
+ * quota reset (ISO timestamp).
311
+ */
312
+ quotaResumeAt?: string | null;
313
+ /**
314
+ * Chat this one was auto-continued from after a session quota limit
315
+ * (prevents infinite agent-switch cascades).
316
+ */
317
+ quotaContinuedFromId?: string | null;
318
+ mcpAppModelContext?: string | null;
319
+ }
320
+ interface CreateChatTabInput {
321
+ /** Existing thread in the worktree to clone workspace metadata from. */
322
+ fromThreadId: string;
323
+ agent?: AgentKind;
324
+ acpHarness?: AcpHarnessId | null;
325
+ model?: string | null;
326
+ autonomy?: Autonomy;
327
+ /** Thinking effort; omit to inherit from source thread. */
328
+ effort?: ThinkingEffort;
329
+ /** Prefer faster model variant; omit to inherit from source thread. */
330
+ fast?: boolean;
331
+ title?: string;
332
+ attachments?: ThreadAttachment[];
333
+ /** Pin a managed Claude/Codex account (`null` = system default). */
334
+ accountId?: string | null;
335
+ }
336
+ interface ForkChatTabInput {
337
+ threadId: string;
338
+ /** Inclusive message index to fork through; default = all messages. */
339
+ throughIndex?: number;
340
+ agent?: AgentKind;
341
+ acpHarness?: AcpHarnessId | null;
342
+ /** Model for the forked chat; omit to inherit or Auto when agent changes. */
343
+ model?: string | null;
344
+ title?: string;
345
+ }
346
+ /** Fork a thread into a new git worktree (new branch + worktree dir). */
347
+ interface ForkThreadWorktreeInput {
348
+ threadId: string;
349
+ /** Inclusive message index to seed transcript through; default = all messages. */
350
+ throughIndex?: number;
351
+ agent?: AgentKind;
352
+ acpHarness?: AcpHarnessId | null;
353
+ /** Model for the forked chat; omit to inherit or Auto when agent changes. */
354
+ model?: string | null;
355
+ title?: string;
356
+ }
357
+ interface ThreadOptionsPatch {
358
+ agent?: AgentKind;
359
+ acpHarness?: AcpHarnessId | null;
360
+ model?: string | null;
361
+ effort?: ThinkingEffort;
362
+ fast?: boolean;
363
+ planMode?: boolean;
364
+ autonomy?: Autonomy;
365
+ }
366
+ interface AgentStatus {
367
+ agent: AgentKind;
368
+ /** Which ACP CLI this detect row is. `agent` stays `acp`. */
369
+ acpHarness?: AcpHarnessId;
370
+ label?: string;
371
+ installed: boolean;
372
+ authenticated: boolean;
373
+ linearMcp: boolean;
374
+ warnings: string[];
375
+ reason?: string;
376
+ }
377
+ interface BranchInfo {
378
+ name: string;
379
+ remote: boolean;
380
+ current: boolean;
381
+ }
382
+ interface PrInfo {
383
+ number: number;
384
+ title: string;
385
+ headRefName: string;
386
+ url: string;
387
+ isCrossRepository: boolean;
388
+ /** Present when listed via `gh pr list --json author`. */
389
+ author?: {
390
+ login: string;
391
+ } | null;
392
+ /** Present when `gh pr view --json isDraft` is requested. */
393
+ isDraft?: boolean;
394
+ /** Present when `gh pr view --json state` is requested. */
395
+ state?: string;
396
+ /** GitHub label names when listed via `gh pr list --json labels`. */
397
+ labels?: string[];
398
+ /** Requested reviewer logins / team slugs (humans and bots). */
399
+ reviewRequests?: string[];
400
+ /** Individual user reviewers only (bots and teams omitted). */
401
+ reviewers?: string[];
402
+ /** Team / group review requests (e.g. `engineering-team`) — not a claim. */
403
+ teams?: string[];
404
+ /** GraphQL `reviewDecision` when requested (`APPROVED`, `CHANGES_REQUESTED`, …). */
405
+ reviewDecision?: string | null;
406
+ /** Assignee logins when listed via `gh pr list --json assignees`. */
407
+ assignees?: string[];
408
+ /** Ticket ids parsed from the title (`ENG-12`, `#44`) when the PR is for assigned work. */
409
+ tickets?: string[];
410
+ }
411
+ /** One CI check from `gh pr checks --json`, or a synthetic merge/review gate. */
412
+ interface PrCheckRun {
413
+ name: string;
414
+ state: string;
415
+ bucket: 'pass' | 'fail' | 'pending' | 'skipping' | 'cancel' | string;
416
+ startedAt: string | null;
417
+ completedAt: string | null;
418
+ link: string | null;
419
+ description: string | null;
420
+ workflow: string | null;
421
+ /**
422
+ * Origin of the row. Omitted / `ci` = GitHub Actions / check suite.
423
+ * `mergeability` / `review` are Sideboard synthetics (conflicts, behind, review).
424
+ */
425
+ kind?: 'ci' | 'mergeability' | 'review';
426
+ }
427
+ interface PrActor {
428
+ login: string;
429
+ name?: string | null;
430
+ }
431
+ interface PrCommitInfo {
432
+ oid: string;
433
+ messageHeadline: string;
434
+ committedDate: string;
435
+ authors: PrActor[];
436
+ }
437
+ interface PrCommentInfo {
438
+ author: PrActor;
439
+ body: string;
440
+ createdAt: string;
441
+ }
442
+ interface PrReviewInfo {
443
+ author: PrActor;
444
+ state: string;
445
+ body: string;
446
+ submittedAt: string | null;
447
+ }
448
+ /** Rich PR payload for Sideboard Review tab (`gh pr view --json`). */
449
+ interface PrDetails {
450
+ number: number;
451
+ title: string;
452
+ body: string;
453
+ url: string;
454
+ state: string;
455
+ isDraft: boolean;
456
+ reviewDecision: string | null;
457
+ author: PrActor;
458
+ /** When the PR was opened (`gh pr view --json createdAt`). */
459
+ createdAt?: string | null;
460
+ baseRefName: string;
461
+ headRefName: string;
462
+ additions: number;
463
+ deletions: number;
464
+ changedFiles: number;
465
+ commits: PrCommitInfo[];
466
+ comments: PrCommentInfo[];
467
+ reviews: PrReviewInfo[];
468
+ /** Assignee logins (`gh pr view --json assignees`). */
469
+ assignees: string[];
470
+ /** Label names (`gh pr view --json labels`). */
471
+ labels: string[];
472
+ /** Requested reviewer logins / team slugs (humans and bots). */
473
+ reviewRequests: string[];
474
+ /** Individual user reviewers only (bots and teams omitted). */
475
+ reviewers: string[];
476
+ /** Team / group review requests (e.g. `engineering-team`). */
477
+ teams: string[];
478
+ /** Prefer `getPrChecks` — kept for callers; often empty to avoid nested GraphQL. */
479
+ checks: PrCheckRun[];
480
+ }
481
+ /** PR lifecycle + mergeability for the sidebar pill (cheap GraphQL + local merge-tree). */
482
+ interface PrMeta {
483
+ number: number;
484
+ title: string;
485
+ url: string;
486
+ state: string;
487
+ isDraft: boolean;
488
+ reviewDecision: string | null;
489
+ baseRefName: string;
490
+ headRefName: string;
491
+ /** True when the PR is sitting in a GitHub merge queue. */
492
+ isInMergeQueue: boolean;
493
+ /** GitHub `mergeable` (MERGEABLE / CONFLICTING / UNKNOWN). */
494
+ mergeable: string | null;
495
+ /** GitHub `mergeStateStatus` (CLEAN / DIRTY / BEHIND / BLOCKED / …). */
496
+ mergeStateStatus: string | null;
497
+ /** GitHub author login when fetched with `--json author`. */
498
+ authorLogin?: string | null;
499
+ /** Human requested-reviewer logins (bots and team slugs omitted). */
500
+ reviewerLogins?: string[];
501
+ /** GitHub label names when fetched with `--json labels`. */
502
+ labels?: string[];
503
+ }
504
+ /** One layer in a GitHub PR stack (bottom = position 1). */
505
+ interface PrStackLayer {
506
+ /** 1-based index from trunk (bottom = 1). */
507
+ position: number;
508
+ branchName: string;
509
+ /** Tip SHA when known from `gh stack view`. */
510
+ headSha?: string;
511
+ /** Parent tip SHA last recorded by gh-stack (may lag). */
512
+ baseSha?: string;
513
+ isCurrent: boolean;
514
+ isMerged: boolean;
515
+ isQueued: boolean;
516
+ needsRebase: boolean;
517
+ prNumber: number | null;
518
+ prUrl: string | null;
519
+ /** OPEN | MERGED | QUEUED when a PR exists. */
520
+ prState: string | null;
521
+ title?: string;
522
+ }
523
+ /** GitHub stacked PRs for a worktree / branch. */
524
+ interface PrStack {
525
+ /** GitHub stack number when known. */
526
+ stackNumber: number | null;
527
+ trunk: string;
528
+ currentBranch: string;
529
+ /** Bottom → top. */
530
+ layers: PrStackLayer[];
531
+ /** Current layer index in `layers` (0-based), or -1. */
532
+ currentIndex: number;
533
+ /** True when every open layer below+including current looks mergeable. */
534
+ readyToMerge: boolean;
535
+ blockedReason: string | null;
536
+ }
537
+ interface IssueCycleInfo {
538
+ id?: string;
539
+ name: string;
540
+ number?: number;
541
+ isActive: boolean;
542
+ }
543
+ interface IssueInfo {
544
+ id: string;
545
+ identifier: string;
546
+ title: string;
547
+ url: string;
548
+ labels: string[];
549
+ /** When set, which tracker produced this issue. */
550
+ provider?: 'linear' | 'github' | 'abletime';
551
+ /** Display name / login of the primary assignee. */
552
+ assignee?: string;
553
+ /** Logins or display names (GitHub assignees; Linear is usually one). */
554
+ assignees?: string[];
555
+ /** Linear cycle (sprint). Absent on GitHub / unscheduled issues. */
556
+ cycle?: IssueCycleInfo | null;
557
+ teamKey?: string;
558
+ projects?: Array<{
559
+ id?: string;
560
+ name?: string;
561
+ }>;
562
+ createdAt?: string;
563
+ updatedAt?: string;
564
+ }
565
+ /** Comment on a listed ticket (inbox / updatedSince). Body is already preview-truncated. */
566
+ interface IssueActivityComment {
567
+ identifier: string;
568
+ title?: string;
569
+ author?: string;
570
+ createdAt?: string;
571
+ body: string;
572
+ url?: string;
573
+ }
574
+ interface DiffFile {
575
+ path: string;
576
+ /** Git name-status letter (M/A/D/R/…). */
577
+ status: string;
578
+ patch: string;
579
+ /** From `git diff --numstat` when available. */
580
+ additions?: number;
581
+ deletions?: number;
582
+ }
583
+ /** Cursor-style Changes panel filters. */
584
+ type DiffScope = 'last_turn' | 'uncommitted' | 'staged' | 'unstaged' | 'commits';
585
+ interface DiffScopeStat {
586
+ files: number;
587
+ additions: number;
588
+ deletions: number;
589
+ }
590
+ /** Sidebar/board dirty glyph — `numstat HEAD` counts + porcelain dirt. Not a Changes payload. */
591
+ interface WorktreeDirtyStat {
592
+ additions: number;
593
+ deletions: number;
594
+ dirty: boolean;
595
+ }
596
+ /** One commit on the branch (for the Changes → Commits submenu). */
597
+ interface DiffCommit {
598
+ sha: string;
599
+ shortSha: string;
600
+ subject: string;
601
+ relativeTime: string;
602
+ }
603
+ interface DiffResult {
604
+ /** Active filter for this result. */
605
+ scope: DiffScope;
606
+ /** When scope is commits and a single commit is selected. */
607
+ commitSha?: string | null;
608
+ base: string;
609
+ files: DiffFile[];
610
+ stat: string;
611
+ dirty: boolean;
612
+ /** Commits on HEAD not yet on the remote tracking branch (0 if none/unknown). */
613
+ unpushed: number;
614
+ /** Counts for each filter option (for the Changes dropdown). */
615
+ scopeStats: Record<DiffScope, DiffScopeStat>;
616
+ /** True when a last-agent-turn baseline is available. */
617
+ hasLastTurnBase: boolean;
618
+ /** Recent commits on the branch (vs merge-base), for the Commits flyout. */
619
+ commits: DiffCommit[];
620
+ /** Resolved merge-base SHA when comparing the branch to the default. */
621
+ mergeBase?: string | null;
622
+ }
623
+ interface LandPreview {
624
+ branch: string;
625
+ target: string;
626
+ diffStat: string;
627
+ dirty: boolean;
628
+ blocked: boolean;
629
+ blockReason?: string;
630
+ isFork: boolean;
631
+ /** Direct push to the default branch (no PR). */
632
+ cowboy?: boolean;
633
+ }
634
+ interface LandResult {
635
+ prUrl: string | null;
636
+ pushed: boolean;
637
+ committed: boolean;
638
+ }
639
+ type AgentEvent = {
640
+ type: 'stdout';
641
+ data: string;
642
+ parentId?: string;
643
+ } | {
644
+ type: 'stderr';
645
+ data: string;
646
+ } | {
647
+ type: 'session_id';
648
+ data: string;
649
+ } | {
650
+ type: 'thinking';
651
+ data: string;
652
+ parentId?: string;
653
+ /** Replace the last thinking part with this parent (status pulses, not token deltas). */
654
+ replace?: boolean;
655
+ } | {
656
+ type: 'tool_use';
657
+ id: string;
658
+ name: string;
659
+ input?: Record<string, unknown>;
660
+ /** Cursor Task / Agent nested stream — inner events set this to the parent call id. */
661
+ parentId?: string;
662
+ } | {
663
+ type: 'tool_result';
664
+ id: string;
665
+ content?: string;
666
+ isError?: boolean;
667
+ parentId?: string;
668
+ /**
669
+ * Update `result` without finishing the tool (live command tail).
670
+ * Codex `command_execution.aggregated_output` while in progress.
671
+ */
672
+ partial?: boolean;
673
+ } | {
674
+ type: 'usage';
675
+ data: TokenUsage;
676
+ /** `request` = one API call; `turn` = billed total for the whole agent turn. */
677
+ scope?: 'request' | 'turn';
678
+ /** Repeated assistant snapshot; spawn replaces the earlier usage. */
679
+ messageId?: string;
680
+ } | {
681
+ type: 'exit';
682
+ data: number | null;
683
+ };
684
+ type OrchestratorEvent = {
685
+ type: 'turn_started';
686
+ threadId: string;
687
+ prompt: string;
688
+ } | {
689
+ type: 'turn_output';
690
+ threadId: string;
691
+ event: AgentEvent;
692
+ } | {
693
+ type: 'turn_finished';
694
+ threadId: string;
695
+ exitCode: number | null;
696
+ routineStop?: boolean;
697
+ } | {
698
+ type: 'status_changed';
699
+ threadId: string;
700
+ status: ThreadStatus;
701
+ } | {
702
+ type: 'queue_changed';
703
+ threadId: string;
704
+ queue: string[];
705
+ } | {
706
+ type: 'context_compacted';
707
+ threadId: string;
708
+ olderCount: number;
709
+ method: 'claude' | 'extractive';
710
+ } | {
711
+ type: 'quota_failover';
712
+ threadId: string;
713
+ action: 'switch_account' | 'switch_agent' | 'wait_reset';
714
+ message: string;
715
+ /** New orchestration chat when action is switch_agent. */
716
+ toThreadId?: string;
717
+ /** When action is wait_reset — ISO resume time. */
718
+ resumeAt?: string;
719
+ } | {
720
+ type: 'dev_server_started';
721
+ threadId: string;
722
+ port: number;
723
+ scriptName?: string;
724
+ } | {
725
+ type: 'dev_server_stopped';
726
+ threadId: string;
727
+ scriptName?: string;
728
+ } | {
729
+ type: 'run_output';
730
+ threadId: string;
731
+ scriptName: string;
732
+ /** One line, or several `\n`-joined lines coalesced within one tick. */
733
+ line: string;
734
+ } | {
735
+ type: 'setup_started';
736
+ threadId: string;
737
+ }
738
+ /** `line` may be a `\n`-joined chunk — consumers append with `\n`. */
739
+ | {
740
+ type: 'setup_output';
741
+ threadId: string;
742
+ line: string;
743
+ } | {
744
+ type: 'setup_finished';
745
+ threadId: string;
746
+ exitCode: number | null;
747
+ } | {
748
+ type: 'orphan_worktrees';
749
+ orphans: Array<{
750
+ path: string;
751
+ repoPath: string;
752
+ }>;
753
+ } | {
754
+ type: 'error';
755
+ threadId: string;
756
+ message: string;
757
+ };
758
+ /** Active named run script (in-memory + mirrored on thread for UI). */
759
+ interface ActiveRun {
760
+ scriptName: string;
761
+ port: number;
762
+ ports: number[];
763
+ startedAt: string;
764
+ /** Detached shell pid. Survives Electron restart so reap can kill the tree. */
765
+ pid?: number;
766
+ }
767
+ /** MCP/CLI → desktop run-script request. Host claims, runs, then fulfills. */
768
+ interface RunScriptRequest {
769
+ op: 'start' | 'stop';
770
+ scriptName?: string | null;
771
+ requestId: string;
772
+ requestedAt: string;
773
+ claimedAt?: string | null;
774
+ fulfilledAt?: string | null;
775
+ error?: string | null;
776
+ }
777
+ /** Unapplied orchestrator steer. Desktop interrupts the live turn and starts it. */
778
+ interface SteerRequest {
779
+ requestId: string;
780
+ requestedAt: string;
781
+ claimedAt?: string | null;
782
+ }
783
+ /** True when desktop should first-claim this persisted request. */
784
+ declare function isUnclaimedRunScriptRequest(req: RunScriptRequest | null | undefined): boolean;
785
+ /**
786
+ * True when desktop should `startDev`/`stopDev` this request — including a
787
+ * claimed-but-unfulfilled row left behind after Electron restarted.
788
+ */
789
+ declare function isAdoptableRunScriptRequest(req: RunScriptRequest | null | undefined): boolean;
790
+ /** Live snapshot for the global orchestrator board. */
791
+ interface OrchestratorRuntime {
792
+ running: number;
793
+ maxConcurrent: number;
794
+ queued: number;
795
+ idle: number;
796
+ error: number;
797
+ stopped: number;
798
+ broken: number;
799
+ totalActive: number;
800
+ }
801
+ interface CreateThreadInput {
802
+ sourceType: Exclude<SourceType, 'orchestration'>;
803
+ sourceRef: string;
804
+ agent: AgentKind;
805
+ /** Gemini CLI or Copilot CLI when `agent` is `acp`. */
806
+ acpHarness?: AcpHarnessId | null;
807
+ repoPath: string;
808
+ autonomy?: Autonomy;
809
+ /** Claude model id, or Brightsy `agent:` / `model:` target encoding. */
810
+ model?: string | null;
811
+ effort?: ThinkingEffort;
812
+ fast?: boolean;
813
+ planMode?: boolean;
814
+ /** Attachments available to the first prompt (and subsequent turns). */
815
+ attachments?: ThreadAttachment[];
816
+ title?: string;
817
+ parentThreadId?: string | null;
818
+ /**
819
+ * Optional first prompt — queued after the thread is created (Conductor-style).
820
+ * Ticket creates with no prompt (and no orchestration parent) imply “Resolve this issue.”
821
+ */
822
+ prompt?: string;
823
+ /**
824
+ * Use the project checkout on the default branch (no isolated worktree).
825
+ * Pushes go to that branch; archive does not remove the folder.
826
+ */
827
+ cowboy?: boolean;
828
+ /** When false, always create a new worktree. Default true reuses a live ticket, PR, or named branch. */
829
+ reuseExisting?: boolean;
830
+ /** Workspace labels. Added when this checkout already exists. */
831
+ tags?: string[];
832
+ }
833
+ interface AdoptInput {
834
+ worktreePath: string;
835
+ agent: AgentKind;
836
+ acpHarness?: AcpHarnessId | null;
837
+ title?: string;
838
+ sessionId?: string | null;
839
+ messages?: ThreadMessage[];
840
+ sourceRef?: string;
841
+ }
842
+ interface ConductorWorkspace {
843
+ id: string;
844
+ workspacePath: string;
845
+ branch: string;
846
+ workspaceName: string;
847
+ prTitle: string | null;
848
+ prDescription: string | null;
849
+ intendedTargetBranch: string | null;
850
+ notes: string | null;
851
+ claudeSessionId: string | null;
852
+ agentType: AgentKind | null;
853
+ messageCount: number;
854
+ }
855
+
856
+ export { isUnclaimedRunScriptRequest as $, type AcpHarnessId as A, type BranchInfo as B, type CreateThreadInput as C, type DiffScope as D, type AgentBlock as E, type ForkChatTabInput as F, type AgentPermissionPrompt as G, type DiffFile as H, type IssueInfo as I, type DiffScopeStat as J, type IssueCycleInfo as K, type LandResult as L, type MessagePart as M, type PrActor as N, type OrchestratorEvent as O, type PrInfo as P, type PrCommentInfo as Q, type PrCommitInfo as R, type PrReviewInfo as S, type Thread as T, type RunScriptRequest as U, type SourceType as V, type WorktreeDirtyStat as W, type SteerRequest as X, THINKING_EFFORTS as Y, isAdoptableRunScriptRequest as Z, isThinkingEffort as _, type AgentEvent as a, nextThinkingEffort as a0, normalizeThinkingEffort as a1, thinkingEffortBars as a2, thinkingEffortLabel as a3, type AgentStatus as b, type AgentKind as c, type ThinkingEffort as d, type Autonomy as e, type ThreadMessage as f, type ThreadStatus as g, type ThreadAttachment as h, type PrCheckRun as i, type PrDetails as j, type PrMeta as k, type PrStack as l, type PrStackLayer as m, type IssueActivityComment as n, type TokenUsage as o, type ActiveRun as p, type DiffResult as q, type DiffCommit as r, type LandPreview as s, type CreateChatTabInput as t, type AgentBlockSource as u, type ForkThreadWorktreeInput as v, type AdoptInput as w, type ConductorWorkspace as x, type ThreadOptionsPatch as y, type OrchestratorRuntime as z };