@sideboard-ai/core 0.1.51 → 0.1.52

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 (37) hide show
  1. package/dist/{agents-HIEJL3UV.js → agents-ON6RKKND.js} +1 -1
  2. package/dist/{agents-5ROTZNCX.js → agents-YKSS6VBO.js} +1 -1
  3. package/dist/{chunk-7EUWSBWR.js → chunk-6QTZVJ7A.js} +5 -3
  4. package/dist/chunk-B3SJXYIJ.js +24 -0
  5. package/dist/{chunk-5ZPSH7VI.js → chunk-D3METLRW.js} +5 -3
  6. package/dist/{chunk-ZH5QZ4CR.js → chunk-DZFH2KLT.js} +280 -7
  7. package/dist/chunk-FKOIHGKV.js +21 -0
  8. package/dist/{chunk-E4VVEKAM.js → chunk-GNML24AW.js} +2 -2
  9. package/dist/{chunk-EOYDCKQC.js → chunk-HLEX5AQ6.js} +4 -0
  10. package/dist/{chunk-K3WMKGFY.js → chunk-LRLKJM3O.js} +2 -1
  11. package/dist/chunk-N5PM7HGQ.js +103 -0
  12. package/dist/chunk-QTUESPAW.js +101 -0
  13. package/dist/{chunk-O6W3P7V3.js → chunk-TSRXOSVD.js} +4 -0
  14. package/dist/{chunk-F4Q3IM6V.js → chunk-UEAHMGHW.js} +2 -1
  15. package/dist/{chunk-XRSAGVRW.js → chunk-XOU6HNQJ.js} +245 -7
  16. package/dist/{chunk-O5DOO7DP.js → chunk-XX5BB7NV.js} +3 -3
  17. package/dist/{chunk-QN7XNQAT.js → chunk-YDXQ72MD.js} +2 -2
  18. package/dist/{chunk-YFJ4FG2P.js → chunk-YOWIYAVA.js} +3 -3
  19. package/dist/{coordinator-prompt-7HHJRO7B.js → coordinator-prompt-6FXVTSFN.js} +4 -3
  20. package/dist/{coordinator-prompt-WD7FAMA2.js → coordinator-prompt-S6JZD5EF.js} +4 -3
  21. package/dist/{global-workspace-OJEPGDXA.js → global-workspace-EV4G2WMQ.js} +5 -4
  22. package/dist/{global-workspace-ECYN2MKL.js → global-workspace-MSX2K27Y.js} +5 -4
  23. package/dist/index.cjs +1288 -140
  24. package/dist/index.d.cts +388 -15
  25. package/dist/index.d.ts +388 -15
  26. package/dist/index.js +801 -84
  27. package/dist/mcp/run-stdio.cjs +1059 -132
  28. package/dist/mcp/run-stdio.js +628 -73
  29. package/dist/plan-file-6O7G4VPQ.js +23 -0
  30. package/dist/plan-file-PHVKUAEE.js +25 -0
  31. package/dist/{thread-store-XICUWFNM.js → thread-store-GHOADGL2.js} +1 -1
  32. package/dist/{thread-store-OV2X6PYO.js → thread-store-UJIGMI5J.js} +1 -1
  33. package/dist/{workspaces-MUU7RGVV.js → workspaces-3RQQZQRO.js} +6 -5
  34. package/dist/{workspaces-ZWOOFZUV.js → workspaces-AYTBR6KQ.js} +6 -5
  35. package/dist/{worktree-DVNDMWZ7.js → worktree-5KEQWSAF.js} +5 -2
  36. package/dist/{worktree-GDV56MX4.js → worktree-RWGL7FUV.js} +5 -2
  37. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -113,6 +113,13 @@ interface Thread {
113
113
  prUrl: string | null;
114
114
  /** Cached PR title for Conductor-style sidebar labels (PR title > branch). */
115
115
  prTitle: string | null;
116
+ /**
117
+ * Stable id for a GitHub PR stack this thread belongs to (shared across layer worktrees).
118
+ * Null when not part of a stack.
119
+ */
120
+ stackId: string | null;
121
+ /** 1-based layer position in the stack (bottom = 1), when {@link stackId} is set. */
122
+ stackLayer: number | null;
116
123
  /** When true, `title` is a manual override and is not overwritten by branch/PR sync. */
117
124
  userSetTitle: boolean;
118
125
  createdAt: string;
@@ -266,6 +273,39 @@ interface PrMeta {
266
273
  baseRefName: string;
267
274
  headRefName: string;
268
275
  }
276
+ /** One layer in a GitHub PR stack (bottom = position 1). */
277
+ interface PrStackLayer {
278
+ /** 1-based index from trunk (bottom = 1). */
279
+ position: number;
280
+ branchName: string;
281
+ /** Tip SHA when known from `gh stack view`. */
282
+ headSha?: string;
283
+ /** Parent tip SHA last recorded by gh-stack (may lag). */
284
+ baseSha?: string;
285
+ isCurrent: boolean;
286
+ isMerged: boolean;
287
+ isQueued: boolean;
288
+ needsRebase: boolean;
289
+ prNumber: number | null;
290
+ prUrl: string | null;
291
+ /** OPEN | MERGED | QUEUED when a PR exists. */
292
+ prState: string | null;
293
+ title?: string;
294
+ }
295
+ /** GitHub stacked PRs for a worktree / branch. */
296
+ interface PrStack {
297
+ /** GitHub stack number when known. */
298
+ stackNumber: number | null;
299
+ trunk: string;
300
+ currentBranch: string;
301
+ /** Bottom → top. */
302
+ layers: PrStackLayer[];
303
+ /** Current layer index in `layers` (0-based), or -1. */
304
+ currentIndex: number;
305
+ /** True when every open layer below+including current looks mergeable. */
306
+ readyToMerge: boolean;
307
+ blockedReason: string | null;
308
+ }
269
309
  interface IssueInfo {
270
310
  id: string;
271
311
  identifier: string;
@@ -721,7 +761,7 @@ declare function resolveThreadEffort(raw: {
721
761
  fast?: unknown;
722
762
  }): ThinkingEffort;
723
763
  declare function normalizeThread(raw: Thread): Thread;
724
- declare function createEmptyThread(partial: Omit<Thread, 'id' | 'createdAt' | 'updatedAt' | 'messages' | 'queue' | 'status' | 'devPort' | 'activeRuns' | 'prUrl' | 'prTitle' | 'userSetTitle' | 'sessionId' | 'sourceIsFork' | 'parentThreadId' | 'autonomy' | 'model' | 'effort' | 'fast' | 'planMode' | 'attachments'> & Partial<Pick<Thread, 'sessionId' | 'sourceIsFork' | 'parentThreadId' | 'autonomy' | 'model' | 'effort' | 'fast' | 'planMode' | 'messages' | 'queue' | 'status' | 'devPort' | 'activeRuns' | 'prUrl' | 'prTitle' | 'userSetTitle' | 'attachments'>>): Thread;
764
+ declare function createEmptyThread(partial: Omit<Thread, 'id' | 'createdAt' | 'updatedAt' | 'messages' | 'queue' | 'status' | 'devPort' | 'activeRuns' | 'prUrl' | 'prTitle' | 'stackId' | 'stackLayer' | 'userSetTitle' | 'sessionId' | 'sourceIsFork' | 'parentThreadId' | 'autonomy' | 'model' | 'effort' | 'fast' | 'planMode' | 'attachments'> & Partial<Pick<Thread, 'sessionId' | 'sourceIsFork' | 'parentThreadId' | 'autonomy' | 'model' | 'effort' | 'fast' | 'planMode' | 'messages' | 'queue' | 'status' | 'devPort' | 'activeRuns' | 'prUrl' | 'prTitle' | 'stackId' | 'stackLayer' | 'userSetTitle' | 'attachments'>>): Thread;
725
765
  declare function withThreadLock<T>(id: string, fn: () => Promise<T>): Promise<T>;
726
766
  declare function readThread(id: string): Thread | null;
727
767
  declare function writeThread(thread: Thread): void;
@@ -981,6 +1021,15 @@ declare function createThreadWorktree(opts: {
981
1021
  sourceRef: string;
982
1022
  slug: string;
983
1023
  }): Promise<CreateWorktreeResult>;
1024
+ /**
1025
+ * Attach a worktree to an **existing** branch (stack layers).
1026
+ * Unlike {@link createThreadWorktree}, does not create `thread/<slug>`.
1027
+ */
1028
+ declare function createExistingBranchWorktree(opts: {
1029
+ repoPath: string;
1030
+ branchName: string;
1031
+ slug: string;
1032
+ }): Promise<CreateWorktreeResult>;
984
1033
  declare function removeWorktree(repoPath: string, worktreePath: string, opts?: {
985
1034
  deleteBranch?: string;
986
1035
  }): Promise<void>;
@@ -990,15 +1039,16 @@ declare function listWorktrees(repoPath: string): Promise<Array<{
990
1039
  }>>;
991
1040
  declare function isDirty(worktreePath: string): Promise<boolean>;
992
1041
  /**
993
- * Local Sideboard attachment scratch (review guidelines seed, composer drops).
1042
+ * Local workspace scratch (`.context/attachments`, legacy `.sideboard/attachments`).
994
1043
  * Must not force the right-sidebar primary action to "Commit & push".
995
1044
  */
996
1045
  declare function isSideboardScratchPath(relativePath: string): boolean;
997
1046
  declare function currentBranch(worktreePath: string): Promise<string>;
998
1047
  declare function commitAll(worktreePath: string, message: string): Promise<boolean>;
999
1048
  declare function pushBranch(worktreePath: string, branchName: string): Promise<void>;
1000
- /** Merge an open pull request via `gh pr merge` (squash by default).
1001
- * Draft PRs are marked ready first GitHub rejects merge while still draft. */
1049
+ /** Merge an open pull request.
1050
+ * When the worktree is on a GitHub PR stack, uses `gh stack merge` (atomic through that PR).
1051
+ * Otherwise: draft → ready, then `gh pr merge` (squash by default). */
1002
1052
  declare function mergePr(cwd: string, selector: string, opts?: {
1003
1053
  method?: 'merge' | 'squash' | 'rebase';
1004
1054
  }): Promise<{
@@ -1022,6 +1072,55 @@ declare function collectTakenTeamSlugs(repoPath: string): Set<string>;
1022
1072
  /** Pick an unused soccer team for the worktree directory / branch slug. */
1023
1073
  declare function allocateTeamSlug(repoPath: string): TeamName;
1024
1074
 
1075
+ /**
1076
+ * GitHub stacked PRs via `gh stack` (github/gh-stack extension).
1077
+ * Prefer non-interactive flags — see github/gh-stack SKILL.md.
1078
+ */
1079
+
1080
+ type GhStackStatus = {
1081
+ available: true;
1082
+ } | {
1083
+ available: false;
1084
+ reason: string;
1085
+ };
1086
+ /** Whether `gh stack` is installed and runnable. */
1087
+ declare function detectGhStack(cwd: string): Promise<GhStackStatus>;
1088
+ /** Clear detect cache (tests). */
1089
+ declare function resetGhStackDetectCache(): void;
1090
+ /** Parse `gh stack view --json` stdout into PrStack. */
1091
+ declare function parseGhStackViewJson(raw: string): PrStack | null;
1092
+ /**
1093
+ * Merge readiness for merging through the current (or given) layer:
1094
+ * every unmerged layer from bottom through that index must be open, not needing rebase.
1095
+ */
1096
+ declare function stackMergeReadiness(layers: PrStackLayer[], throughIndex: number): {
1097
+ readyToMerge: boolean;
1098
+ blockedReason: string | null;
1099
+ };
1100
+ /** Load stack for the current worktree branch, or null if not in a stack. */
1101
+ declare function getPrStack(cwd: string): Promise<PrStack | null>;
1102
+ /** True when this cwd's current branch is part of a GitHub stack. */
1103
+ declare function isInPrStack(cwd: string): Promise<boolean>;
1104
+ declare function mergePrStack(cwd: string, opts: {
1105
+ /** PR number (merge through that PR) or stack number. */
1106
+ through: number;
1107
+ method?: 'merge' | 'squash' | 'rebase';
1108
+ }): Promise<{
1109
+ stdout: string;
1110
+ }>;
1111
+ /** Initialize a stack with one or more branch names (bottom → top). */
1112
+ declare function initPrStack(cwd: string, branches: string[], opts?: {
1113
+ base?: string;
1114
+ }): Promise<void>;
1115
+ /** Add a branch on top of the current stack. */
1116
+ declare function addPrStackLayer(cwd: string, branchName: string): Promise<void>;
1117
+ /** Push branches and create/update PRs (`--auto` avoids title prompts). */
1118
+ declare function submitPrStack(cwd: string, opts?: {
1119
+ open?: boolean;
1120
+ }): Promise<void>;
1121
+ /** Check out a stack layer by PR number, stack number, URL, or branch. */
1122
+ declare function checkoutPrStackLayer(cwd: string, target: string | number): Promise<void>;
1123
+
1025
1124
  interface GitHubStatus {
1026
1125
  connected: boolean;
1027
1126
  login: string | null;
@@ -1152,7 +1251,7 @@ interface AgentAdapter {
1152
1251
  labels: string[];
1153
1252
  }>>;
1154
1253
  }
1155
- declare const PLAN_MODE_INSTRUCTION = "Plan mode is active and must remain active until the user turns Plan mode off in the UI (or explicitly asks you to implement). Analyze the codebase, search and read files as needed, and produce or refine a clear implementation plan. Do not modify, create, or delete any files. Do not exit plan mode on your own.";
1254
+ declare const PLAN_MODE_INSTRUCTION = "Plan mode is active and must remain active until the user turns Plan mode off in the UI (or Approves / Hands off the plan). Analyze the codebase, search and read files as needed, and produce or refine a clear implementation plan. Do not modify, create, or delete any project files except via Sideboard MCP present_plan (writes .context/attachments/plan.md). When you need a clarifying decision (approach forks, auth choice, scope): (1) first write a short chat message that explains the decision and what each option means (tradeoffs, when to pick it) \u2014 do not leave the user staring at bare labels; (2) then call Sideboard MCP ask_user with the same options, including a description on every option. Sideboard shows questions in the composer and mirrors them in chat. After ask_user, wait for the user's next message with their answers before finalizing the plan. When the plan is ready for approval: (1) call present_plan with the full markdown plan (title + content) so Sideboard saves .context/attachments/plan.md and shows it in chat for Approve / Hand off / Copy; (2) Claude should also call ExitPlanMode after present_plan. Do not skip present_plan \u2014 the plan must be a markdown file, not only chat prose.";
1156
1255
  declare function permissionMode(thread: Pick<Thread, 'autonomy' | 'planMode'>): {
1157
1256
  claude: string;
1158
1257
  opencodePermission: string;
@@ -1772,7 +1871,7 @@ declare function isImageFilePath(filePath: string): boolean;
1772
1871
  */
1773
1872
  declare function attachmentFromAbsolutePath(absolutePath: string): ThreadAttachment;
1774
1873
  /**
1775
- * Copy absolute paths into `.sideboard/attachments/` and return composer attachments
1874
+ * Copy absolute paths into `.context/attachments/` and return composer attachments
1776
1875
  * with worktree-relative `path` (and image previews when applicable).
1777
1876
  */
1778
1877
  declare function stageAbsolutePathsAsAttachments(worktreePath: string, absolutePaths: string[]): ThreadAttachment[];
@@ -1781,7 +1880,7 @@ interface ComposerFileBuffer {
1781
1880
  dataBase64: string;
1782
1881
  }
1783
1882
  /**
1784
- * Write in-memory file buffers into `.sideboard/attachments/` (renderer drop
1883
+ * Write in-memory file buffers into `.context/attachments/` (renderer drop
1785
1884
  * fallback when Electron does not expose a filesystem path).
1786
1885
  */
1787
1886
  declare function stageBuffersAsAttachments(worktreePath: string, buffers: ComposerFileBuffer[]): ThreadAttachment[];
@@ -1896,7 +1995,7 @@ declare function confirmLand(thread: Thread, opts?: {
1896
1995
  web?: boolean;
1897
1996
  }): Promise<LandResult>;
1898
1997
 
1899
- declare function createThread(input: CreateThreadInput, onSetupLine?: (line: string) => void): Promise<Thread>;
1998
+ declare function createThread(input: CreateThreadInput, _onSetupLine?: (line: string) => void): Promise<Thread>;
1900
1999
  /** @deprecated Prefer listIssues() from integrations/issues — agent-agnostic. */
1901
2000
  declare function listLinearIssues(agent: AgentKind, repoPath: string): Promise<{
1902
2001
  id: string;
@@ -1923,6 +2022,96 @@ declare function forkChatTab(input: ForkChatTabInput): Thread;
1923
2022
  /** Fork into a new git worktree branched from the source thread's branch. */
1924
2023
  declare function forkThreadWorktree(input: ForkThreadWorktreeInput, onSetupLine?: (line: string) => void): Promise<Thread>;
1925
2024
 
2025
+ /**
2026
+ * Materialize one git worktree + Sideboard thread per GitHub stack layer.
2027
+ */
2028
+
2029
+ declare function stackIdFrom(stack: PrStack): string | null;
2030
+ declare function findThreadForStackLayer(repoPath: string, stackId: string, layer: Pick<PrStackLayer, 'position' | 'branchName'>): Thread | null;
2031
+ type OpenStackLayerInput = {
2032
+ repoPath: string;
2033
+ stack: PrStack;
2034
+ layer: PrStackLayer;
2035
+ agent: AgentKind;
2036
+ autonomy?: Autonomy;
2037
+ model?: string | null;
2038
+ effort?: ThinkingEffort;
2039
+ fast?: boolean;
2040
+ planMode?: boolean;
2041
+ parentThreadId?: string | null;
2042
+ /** Prefer this existing worktree when the branch is already checked out. */
2043
+ reuseExistingWorktree?: boolean;
2044
+ };
2045
+ type OpenStackLayerResult = {
2046
+ thread: Thread;
2047
+ /** True when a new git worktree was created (caller should run setup). */
2048
+ createdWorktree: boolean;
2049
+ };
2050
+ /** Open (or return) a thread for one stack layer worktree. */
2051
+ declare function openStackLayer(input: OpenStackLayerInput, _onSetupLine?: (line: string) => void): Promise<OpenStackLayerResult>;
2052
+ type OpenPrStackLayersInput = {
2053
+ /** Any thread already on a stack layer (used for agent defaults + discovery). */
2054
+ threadRef: string;
2055
+ /** When set, only open this 1-based layer; otherwise open all. */
2056
+ layer?: number;
2057
+ };
2058
+ /** Open worktrees/threads for stack layers discovered from a thread's cwd. */
2059
+ declare function openPrStackLayers(input: OpenPrStackLayersInput, onSetupLine?: (line: string) => void): Promise<{
2060
+ stack: PrStack;
2061
+ threads: Thread[];
2062
+ createdThreadIds: string[];
2063
+ }>;
2064
+ type AddStackLayerInput = {
2065
+ threadRef: string;
2066
+ branchName: string;
2067
+ title?: string;
2068
+ };
2069
+ /** `gh stack add` then open a worktree+thread for the new top layer. */
2070
+ declare function addStackLayerFromThread(input: AddStackLayerInput, onSetupLine?: (line: string) => void): Promise<{
2071
+ stack: PrStack;
2072
+ thread: Thread;
2073
+ createdWorktree: boolean;
2074
+ }>;
2075
+ type InitStackFromThreadInput = {
2076
+ threadRef: string;
2077
+ /** Extra layers above the current branch (created empty on top). */
2078
+ additionalBranches?: string[];
2079
+ base?: string;
2080
+ };
2081
+ /**
2082
+ * Initialize a stack from the current thread's branch (bottom),
2083
+ * optionally adding further empty layers, then open worktrees for each.
2084
+ */
2085
+ declare function initStackFromThread(input: InitStackFromThreadInput, onSetupLine?: (line: string) => void): Promise<{
2086
+ stack: PrStack;
2087
+ threads: Thread[];
2088
+ createdThreadIds: string[];
2089
+ }>;
2090
+ type CreateStackInput = {
2091
+ repoPath: string;
2092
+ /** Bottom → top branch names (created or adopted by gh stack init). */
2093
+ branches: string[];
2094
+ base?: string;
2095
+ agent: AgentKind;
2096
+ autonomy?: Autonomy;
2097
+ model?: string | null;
2098
+ effort?: ThinkingEffort;
2099
+ fast?: boolean;
2100
+ planMode?: boolean;
2101
+ title?: string;
2102
+ };
2103
+ /**
2104
+ * Create a new stack from trunk: init branches, then one worktree+thread per layer.
2105
+ * First layer gets an optional title; others use branch names until PRs exist.
2106
+ */
2107
+ declare function createPrStack(input: CreateStackInput, onSetupLine?: (line: string) => void): Promise<{
2108
+ stack: PrStack;
2109
+ threads: Thread[];
2110
+ createdThreadIds: string[];
2111
+ }>;
2112
+ /** Defaults for opening stack layers from CreateThreadInput-shaped callers. */
2113
+ declare function stackAgentDefaultsFrom(input: Pick<CreateThreadInput, 'agent' | 'autonomy' | 'model' | 'effort' | 'fast' | 'planMode'>): Pick<OpenStackLayerInput, 'agent' | 'autonomy' | 'model' | 'effort' | 'fast' | 'planMode'>;
2114
+
1926
2115
  /**
1927
2116
  * Conductor persists Cursor SDK agent IDs under cursor-sdk-store/<hash>/agents.ndjson
1928
2117
  * (not in sessions.claude_session_id). Prefer the newest durable agent for a cwd.
@@ -2034,6 +2223,8 @@ declare class Orchestrator {
2034
2223
  getThreads(includeArchived?: boolean): Thread[];
2035
2224
  getThread(idOrRef: string): Thread | null;
2036
2225
  createThread(input: CreateThreadInput): Promise<Thread>;
2226
+ /** Run workspace setup after a new worktree is created (no-op if none configured). */
2227
+ private runSetupAfterCreate;
2037
2228
  listWorkspaces(): Workspace[];
2038
2229
  addWorkspace(repoPath: string): Promise<Workspace>;
2039
2230
  removeWorkspace(repoPath: string): void;
@@ -2161,6 +2352,45 @@ declare class Orchestrator {
2161
2352
  private withPrSelector;
2162
2353
  getPrChecks(threadRef: string): Promise<PrCheckRun[] | null>;
2163
2354
  getPrMeta(threadRef: string): Promise<PrMeta | null>;
2355
+ getPrStack(threadRef: string): Promise<PrStack | null>;
2356
+ /** Open worktrees for all (or one) stack layers discovered from a thread. */
2357
+ openPrStackLayers(threadRef: string, opts?: {
2358
+ layer?: number;
2359
+ }): Promise<{
2360
+ stack: PrStack;
2361
+ threads: Thread[];
2362
+ }>;
2363
+ /** Add a branch on top of the thread's stack and open its worktree. */
2364
+ addStackLayer(threadRef: string, branchName: string, opts?: {
2365
+ title?: string;
2366
+ }): Promise<{
2367
+ stack: PrStack;
2368
+ thread: Thread;
2369
+ }>;
2370
+ /** Initialize a stack from the current thread branch (optional extra layers). */
2371
+ initStackFromThread(threadRef: string, opts?: {
2372
+ additionalBranches?: string[];
2373
+ base?: string;
2374
+ }): Promise<{
2375
+ stack: PrStack;
2376
+ threads: Thread[];
2377
+ }>;
2378
+ /** Create a new multi-layer stack with one worktree per layer. */
2379
+ createPrStack(input: {
2380
+ repoPath: string;
2381
+ branches: string[];
2382
+ base?: string;
2383
+ agent: AgentKind;
2384
+ autonomy?: Autonomy;
2385
+ model?: string | null;
2386
+ effort?: ThinkingEffort;
2387
+ fast?: boolean;
2388
+ planMode?: boolean;
2389
+ title?: string;
2390
+ }): Promise<{
2391
+ stack: PrStack;
2392
+ threads: Thread[];
2393
+ }>;
2164
2394
  getPrDetails(threadRef: string): Promise<PrDetails | null>;
2165
2395
  setAutonomy(threadRef: string, autonomy: Autonomy): Thread;
2166
2396
  /**
@@ -2197,7 +2427,7 @@ declare class Orchestrator {
2197
2427
  setAttachments(threadRef: string, attachments: Thread['attachments']): Thread;
2198
2428
  /**
2199
2429
  * Stage OS / worktree files into composer attachments (copies external files
2200
- * into `.sideboard/attachments/` so agents can Read images and binaries).
2430
+ * into `.context/attachments/` so agents can Read images and binaries).
2201
2431
  */
2202
2432
  attachComposerFiles(threadRef: string, opts: {
2203
2433
  absolutePaths?: string[];
@@ -2233,10 +2463,11 @@ declare function startOrchestration(opts: {
2233
2463
  declare const REPO_REVIEW_PATH = ".sideboard/review.md";
2234
2464
  declare const REPO_REVIEW_NAME = "review.md";
2235
2465
  /**
2236
- * Local / Conductor-style scratch guidelines (gitignored under attachments/).
2466
+ * Local scratch guidelines (gitignored under `.context/attachments/`).
2237
2467
  * Used as override when no repo file exists, or as the stock seed target.
2238
2468
  */
2239
- declare const REVIEW_REQUEST_PATH = ".sideboard/attachments/Review request.md";
2469
+ declare const REVIEW_REQUEST_PATH = ".context/attachments/Review request.md";
2470
+ declare const LEGACY_REVIEW_REQUEST_PATH = ".sideboard/attachments/Review request.md";
2240
2471
  declare const REVIEW_REQUEST_NAME = "Review request.md";
2241
2472
  /** Short chat message — guidelines live in the attached review file. */
2242
2473
  declare const REVIEW_REQUEST_PREFILL = "Review.";
@@ -2255,8 +2486,9 @@ declare function shouldRefreshReviewRequestTemplate(content: string): boolean;
2255
2486
  /**
2256
2487
  * Resolve which review guidelines to attach:
2257
2488
  * 1. `.sideboard/review.md` (committed, per-repo)
2258
- * 2. `.sideboard/attachments/Review request.md` (local override)
2259
- * 3. Seed stock template into the local attachments path (does not write the repo file)
2489
+ * 2. `.context/attachments/Review request.md` (local override)
2490
+ * 3. Legacy `.sideboard/attachments/Review request.md`
2491
+ * 4. Seed stock template into `.context/attachments/` (does not write the repo file)
2260
2492
  */
2261
2493
  declare function resolveReviewGuidelines(worktreePath: string): ResolvedReviewGuidelines;
2262
2494
  /**
@@ -2287,6 +2519,107 @@ type SendFn = (threadRef: string, prompt: string) => Promise<Thread>;
2287
2519
  */
2288
2520
  declare function requestReview(threadRef: string, send: SendFn): Promise<RequestReviewResult>;
2289
2521
 
2522
+ /**
2523
+ * Workspace-local scratch (Conductor-style `.context/`), not committed.
2524
+ * Repo-owned Sideboard config stays under `.sideboard/` (settings, review.md).
2525
+ */
2526
+ /** Preferred local attachments root (plan, drops, review seed). */
2527
+ declare const ATTACHMENTS_DIR = ".context/attachments";
2528
+ /** Pre-migration Sideboard scratch root — still read for compatibility. */
2529
+ declare const LEGACY_ATTACHMENTS_DIR = ".sideboard/attachments";
2530
+ declare function attachmentsGitignoreBody(): string;
2531
+ /** True when a git status path is local scratch and should not count as dirty. */
2532
+ declare function isWorkspaceScratchPath(relativePath: string): boolean;
2533
+
2534
+ /**
2535
+ * Plan-mode clarifying questions (AskUserQuestion / Sideboard ask_user).
2536
+ * Presented in the composer; answers are sent as a normal user message.
2537
+ */
2538
+ interface PlanQuestionOption {
2539
+ label: string;
2540
+ description?: string;
2541
+ }
2542
+ interface PlanQuestion {
2543
+ /** Full question text. */
2544
+ question: string;
2545
+ /** Short chip label (≤12 chars when from Claude). */
2546
+ header?: string;
2547
+ multiSelect?: boolean;
2548
+ options: PlanQuestionOption[];
2549
+ }
2550
+ interface PendingPlanQuestions {
2551
+ /** Tool call / presentation id (dismiss + dedupe). */
2552
+ id: string;
2553
+ questions: PlanQuestion[];
2554
+ /** Source tool name for debugging. */
2555
+ source: string;
2556
+ }
2557
+ /** Normalize AskUserQuestion / ask_user tool input into questions. */
2558
+ declare function parsePlanQuestionsInput(input: unknown): PlanQuestion[];
2559
+ declare function isAskUserToolName(name: string | undefined | null): boolean;
2560
+ type ToolPartLike = {
2561
+ type: string;
2562
+ id?: string;
2563
+ name?: string;
2564
+ input?: Record<string, unknown>;
2565
+ status?: string;
2566
+ };
2567
+ /** Newest ask-user tool part with parseable questions (live or persisted). */
2568
+ declare function extractPendingPlanQuestions(parts: ToolPartLike[] | undefined | null): PendingPlanQuestions | null;
2569
+ interface PlanQuestionAnswer {
2570
+ questionIndex: number;
2571
+ /** Selected option labels (empty when only Other). */
2572
+ selected: string[];
2573
+ /** Free-text Other response. */
2574
+ other?: string;
2575
+ }
2576
+ /** Format answers as a concise user message for the agent. */
2577
+ declare function formatPlanQuestionAnswers(questions: PlanQuestion[], answers: PlanQuestionAnswer[]): string;
2578
+ /** Markdown brief of questions + option meanings for the chat transcript. */
2579
+ declare function formatPlanQuestionsForChat(questions: PlanQuestion[]): string;
2580
+
2581
+ /**
2582
+ * Pure helpers for plan presentation (safe for renderer bundling).
2583
+ * File I/O lives in plan-file.ts.
2584
+ */
2585
+ /** Canonical relative path inside the worktree (shared by forked chat tabs). */
2586
+ declare const PLAN_FILE_REL = ".context/attachments/plan.md";
2587
+ declare const PLAN_FILE_NAME = "plan.md";
2588
+ /** Legacy path from before plans lived under attachments/. */
2589
+ declare const LEGACY_PLAN_FILE_REL = ".sideboard/plan.md";
2590
+ declare function isPresentPlanToolName(name: string | undefined | null): boolean;
2591
+ type PresentedPlan = {
2592
+ title: string;
2593
+ content: string;
2594
+ path: string;
2595
+ source: 'present_plan' | 'exit_plan' | 'text';
2596
+ };
2597
+ type PlanToolPartLike = {
2598
+ type: string;
2599
+ id?: string;
2600
+ name?: string;
2601
+ input?: Record<string, unknown>;
2602
+ };
2603
+ /** Newest present_plan tool payload with markdown content. */
2604
+ declare function extractPresentedPlan(parts: PlanToolPartLike[] | undefined | null): PresentedPlan | null;
2605
+ /** Best plan markdown from tool parts, then file, then agent text fallback. */
2606
+ declare function resolvePlanMarkdown(opts: {
2607
+ parts?: PlanToolPartLike[] | null;
2608
+ text?: string | null;
2609
+ fileContent?: string | null;
2610
+ }): PresentedPlan | null;
2611
+
2612
+ /**
2613
+ * Worktree plan document I/O (plan mode).
2614
+ * Pure presentation helpers: plan-present.ts
2615
+ */
2616
+
2617
+ declare function planFileAbs(worktreePath: string): string;
2618
+ /** Prefer `.context/attachments/plan.md`; fall back to legacy Sideboard paths. */
2619
+ declare function readPlanFile(worktreePath: string): string | null;
2620
+ /** Write (or overwrite) the worktree plan markdown. Returns relative path. */
2621
+ declare function writePlanFile(worktreePath: string, content: string): string;
2622
+
2290
2623
  type WorkspaceInventoryEntry = Workspace & {
2291
2624
  /** Best-effort GitHub `owner/repo` from remote / gh. */
2292
2625
  githubSlug?: string | null;
@@ -2486,7 +2819,7 @@ interface IpcApi {
2486
2819
  setAttachments(threadRef: string, attachments: ThreadAttachment[]): Promise<Thread>;
2487
2820
  /**
2488
2821
  * Stage dropped/picked files into composer attachments. External files are
2489
- * copied into `.sideboard/attachments/` in the thread worktree.
2822
+ * copied into `.context/attachments/` in the thread worktree.
2490
2823
  */
2491
2824
  attachComposerFiles(threadRef: string, opts: {
2492
2825
  absolutePaths?: string[];
@@ -2555,6 +2888,46 @@ interface IpcApi {
2555
2888
  getPrChecks(threadRef: string): Promise<PrCheckRun[] | null>;
2556
2889
  /** Lightweight PR fields for the sidebar pill (cheap GraphQL). */
2557
2890
  getPrMeta(threadRef: string): Promise<PrMeta | null>;
2891
+ /** GitHub PR stack for the thread worktree, or null if not stacked. */
2892
+ getPrStack(threadRef: string): Promise<PrStack | null>;
2893
+ /** Open worktrees/threads for stack layers (all, or one 1-based position). */
2894
+ openPrStackLayers(threadRef: string, opts?: {
2895
+ layer?: number;
2896
+ }): Promise<{
2897
+ stack: PrStack;
2898
+ threads: Thread[];
2899
+ }>;
2900
+ /** Add a branch on top of the thread's stack and open its worktree. */
2901
+ addStackLayer(threadRef: string, branchName: string, opts?: {
2902
+ title?: string;
2903
+ }): Promise<{
2904
+ stack: PrStack;
2905
+ thread: Thread;
2906
+ }>;
2907
+ /** Turn the current thread branch into a stack (optional extra empty layers). */
2908
+ initStackFromThread(threadRef: string, opts?: {
2909
+ additionalBranches?: string[];
2910
+ base?: string;
2911
+ }): Promise<{
2912
+ stack: PrStack;
2913
+ threads: Thread[];
2914
+ }>;
2915
+ /** Create a new stack with one worktree per layer. */
2916
+ createPrStack(input: {
2917
+ repoPath: string;
2918
+ branches: string[];
2919
+ base?: string;
2920
+ agent: AgentKind;
2921
+ autonomy?: Autonomy;
2922
+ model?: string | null;
2923
+ effort?: ThinkingEffort;
2924
+ fast?: boolean;
2925
+ planMode?: boolean;
2926
+ title?: string;
2927
+ }): Promise<{
2928
+ stack: PrStack;
2929
+ threads: Thread[];
2930
+ }>;
2558
2931
  /** PR description / reviews for the Review tab. */
2559
2932
  getPrDetails(threadRef: string): Promise<PrDetails | null>;
2560
2933
  listFiles(threadRef: string): Promise<string[]>;
@@ -2920,4 +3293,4 @@ declare function writeInjectedMcpConfig(opts: {
2920
3293
  includeBrightsy?: boolean;
2921
3294
  }): Promise<string | null>;
2922
3295
 
2923
- export { type ActiveRun, type AdoptInput, type AdvancedAppSettings, type AgentAdapter, type AgentEvent, type AgentInstructionFile, type AgentKind, type AgentModelCatalog, type AgentModelInfo, type AgentSetupActionResult, type AgentSetupInfo, type AgentSetupKind, type AgentStatus, type AgentTurnInput, type AnthropicCacheControl, type AppSettings, type ApplyIntoMainResult, type AttachCommand, type Autonomy, BRIGHTSY_MCP_ALLOWED_TOOLS, type BranchInfo, type BrightsyAccount, type BrightsyChatTarget, type BrightsyChatTargets, type BrightsyCloudConnectAgent, type BrightsyHarnessSettings, type BrightsySession, BrightsySideboardApi, type BrightsyTeamTargets, CLAUDE_MODEL_CATALOG, CLOUD_COORDINATOR_BUSY_REPLY, CLOUD_COORDINATOR_STOPPED_REPLY, CLOUD_COORDINATOR_TIMEOUT_REPLY, CLOUD_ORCHESTRATOR_GOAL, CONTEXT_COMPACT_CHARS, CONTEXT_KEEP_RECENT_CHARS, CONTEXT_KEEP_RECENT_MESSAGES, CONTEXT_MIN_MESSAGES, COORDINATOR_TOOL_PLAYBOOK, type ClaudeHarnessSettings, type CleanupOrphansResult, type CloudConnectAgent, type CloudConnectOptions, type CloudConnectStatus, type CompactResult, type CompactThresholds, type ComposerFileBuffer, type ConductorSettings, type ConductorWorkspace, type ConnectedBrightsyTeamInfo, type CreateChatTabInput, type CreateGlobalChatOpts, type CreateThreadInput, type CreateWorktreeResult, type CursorModelInfo, type CursorSdkStreamMessage, type CursorTurnRequest, type CursorWorktreesConfig, type DefaultsAppSettings, type DevServerHandle, type DiffCommentInput, type DiffCommentLine, type DiffCommit, type DiffFile, type DiffResult, type DiffScope, type DiffScopeStat, type ExpandResult, FAMOUS_SOCCER_TEAMS, type ForkChatTabInput, type ForkThreadWorktreeInput, type FormatGhLandErrorOptions, GLOBAL_WORKSPACE_ID, type GetDiffOptions, type GitHubStatus, type GitWorktreeStatus, HARNESS_ENV_KEYS, type HarnessId, type IntegrationsSettings, type IpcApi, type IssueInfo, type IssueSource, type LandPreview, type LandResult, type ListIssuesResult, MAX_ANTHROPIC_CACHE_CONTROL_BLOCKS, type McpServerStatus, type MessagePart, ORCHESTRATOR_AGENT_KINDS, type OrchestrationQuotaOnLimit, Orchestrator, type OrchestratorAgentKind, type OrchestratorEvent, type OrchestratorRuntime, type OrphanWorktree, PASTE_ATTACH_MIN_CHARS, PASTE_ATTACH_MIN_LINES, PLAN_MODE_INSTRUCTION, type PrActor, type PrCheckRun, type PrCommentInfo, type PrCommitInfo, type PrDetails, type PrInfo, type PrMeta, type PrReviewInfo, REPO_REVIEW_NAME, REPO_REVIEW_PATH, REVIEW_REQUEST_NAME, REVIEW_REQUEST_PATH, REVIEW_REQUEST_PREFILL, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, type ResolvedReviewGuidelines, type ReviewGuidelinesSource, type RunMode, type RunScript, SIDEBOARD_FORCE_STOP, SIDEBOARD_MCP_ALLOWED_TOOLS, type ScriptHandle, type SkillInfo, type SourceType, type SpawnTurnHandle, type SummarizeResult, THINKING_EFFORTS, type TeamName, type ThinkingEffort, type Thread, type ThreadAttachment, type ThreadMessage, type ThreadOptionsPatch, type ThreadStatus, type TokenUsage, type TranscriptToolDetail, type TurnCommand, type Workspace, type WorkspaceInventoryEntry, type WorkspaceScriptEnvOpts, addWorkspace, adoptThread, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendMessage, applyAgentEvent, applyAppEnvironment, applyCompaction, applyThreadIntoMain, assertOrchestratorCapableAgent, attachmentFromAbsolutePath, attachmentsFromBuffers, attachmentsFromWorktreePaths, autoCleanupOrphansEnabled, autoRenameBranchEnabled, autoRunAfterSetupEnabled, branchDisplayLabel, brightsyAdapter, brightsyCloudConnectAgent, brightsyCloudConnectEnabled, brightsyConfigPath, brightsyMcpAllowedTools, brightsyMcpServerName, buildCachedUserContent, buildClaudeStreamJsonUserMessage, buildDiffCommentAttachment, buildForkTranscriptAttachment, buildPastedTextAttachment, buildReviewRequestAttachment, buildSessionSeed, buildWorkspaceScriptEnv, caffeinateWhileCloudConnectEnabled, caffeinateWhileRunningEnabled, captureLoginEnv, captureTurnBaseline, childEnvWithAppSettings, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, cloneRepoIntoSideboard, codexAdapter, coerceOrchestratorAgent, collectTakenTeamSlugs, commitAll, conductorDbPath, confirmLand, connectBrightsyTeam, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, createChatTab, createEmptyThread, createGlobalChat, createOrUpdatePr, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, deleteBranchOnPurgeEnabled, deleteThreadRecord, detectAgents, detectLocalMergeConflicts, disconnectBrightsyTeam, discoverSkills, encodeBrightsyTarget, enrichWorkspacesWithGithub, ensureAgentPath, ensureCloudCoordinator, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureWorkspace, estimateMessageChars, estimateThreadChars, expandComposerPrompt, extractGhErrorDetail, extractiveSummary, fetchPrHead, finalizeParts, findInvalidCacheControlTtlOrder, findOrphanWorktrees, findThreadByRef, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatGhLandError, formatIpcInvokeError, formatMessagesAsTranscript, formatRateLimitResetHint, formatRenameBranchDirective, formatTranscriptMarkdown, formatWorkspaceInventory, formatWorktreeDirective, getAdapter, getAgentSetupInfo, getBrightsySession, getDefaultAgent, getDefaultEffort, getDefaultFast, getDefaultModel, getDefaultRunScript, getDiff, getDiffSummary, getGitHubStatus, getIssueSource, getLinearApiKey, getOrchestrator, getPr, getPrChecks, getPrDetails, getPrMeta, getRepoSetupInfo, getRunMode, getRunScript, gh, ghHeadRef, ghRepoSelectArgs, git, globalAgentCwd, harnessEnvKey, hasConductorHook, hasCursorWorktreeSetup, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, importConductorWorkspace, importConductorWorkspaceAsync, initializeGitRepository, inspectGitWorktree, installAgent, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isCursorAutoModel, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isImageFilePath, isLinearConnected, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isSessionQuotaLimit, isSideboardScratchPath, isThinkingEffort, listAgentSetupInfo, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearIssues, listLinearIssuesDirect, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergePr, mergeUsage, nextPastedTextName, nextThinkingEffort, normalizeParseResult, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, opencodeAdapter, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, parseCursorRunnerLine, parseForceStopMessage, parseGithubSlugFromRemoteUrl, parseMcpList, parseSessionQuotaResetAt, partsToAssistantText, pastedTextStats, permissionMode, previewLand, pushBranch, readExistingReviewRequestFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, refreshGitHubAuth, removeWorkspace, removeWorktree, repoSlug, requestReview, requireAgent, resolveClaudeExecutable, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGithubRepoSlug, resolvePrSelector, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveThreadDefaults, resolveThreadEffort, resolveWorktreeStartPoint, run, runArchiveScript, runCloudConnect, runCursorWorktreeSetup, runSetupScript, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, setStatus, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, shouldRefreshReviewRequestTemplate, shouldRunWorktreeCleanup, sideboardHomeDir, sideboardReposDir, sideboardWorkspacesDir, slugify, spawnAgentTurn, splitForCompaction, stageAbsolutePathsAsAttachments, stageBuffersAsAttachments, startDevServer, startMcpServer, startOrchestration, stripBrightsyNdjsonNoise, suggestSlug, summarizeConversation, switchBrightsyAccount, syncWorkspacesFromThreads, takenTeamSlugsForChatTab, takenTeamSlugsForOrchestration, taskMessageText, thinkingEffortBars, thinkingEffortLabel, threadDisplayLabel, threadFilePath, threadLockPath, threadsDir, threadsSharingWorktree, toolDescription, toolDetail, toolFilePath, totalTokens, updateAdvancedSettings, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateDefaultsSettings, updateIntegrationsSettings, updateThread, validateLinearApiKey, withAgentInstructions, withThreadLock, workspaceSettingsSourceLabel, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, writeInjectedMcpConfig, writeThread, writeWorktreeFile };
3296
+ export { ATTACHMENTS_DIR, type ActiveRun, type AddStackLayerInput, type AdoptInput, type AdvancedAppSettings, type AgentAdapter, type AgentEvent, type AgentInstructionFile, type AgentKind, type AgentModelCatalog, type AgentModelInfo, type AgentSetupActionResult, type AgentSetupInfo, type AgentSetupKind, type AgentStatus, type AgentTurnInput, type AnthropicCacheControl, type AppSettings, type ApplyIntoMainResult, type AttachCommand, type Autonomy, BRIGHTSY_MCP_ALLOWED_TOOLS, type BranchInfo, type BrightsyAccount, type BrightsyChatTarget, type BrightsyChatTargets, type BrightsyCloudConnectAgent, type BrightsyHarnessSettings, type BrightsySession, BrightsySideboardApi, type BrightsyTeamTargets, CLAUDE_MODEL_CATALOG, CLOUD_COORDINATOR_BUSY_REPLY, CLOUD_COORDINATOR_STOPPED_REPLY, CLOUD_COORDINATOR_TIMEOUT_REPLY, CLOUD_ORCHESTRATOR_GOAL, CONTEXT_COMPACT_CHARS, CONTEXT_KEEP_RECENT_CHARS, CONTEXT_KEEP_RECENT_MESSAGES, CONTEXT_MIN_MESSAGES, COORDINATOR_TOOL_PLAYBOOK, type ClaudeHarnessSettings, type CleanupOrphansResult, type CloudConnectAgent, type CloudConnectOptions, type CloudConnectStatus, type CompactResult, type CompactThresholds, type ComposerFileBuffer, type ConductorSettings, type ConductorWorkspace, type ConnectedBrightsyTeamInfo, type CreateChatTabInput, type CreateGlobalChatOpts, type CreateStackInput, type CreateThreadInput, type CreateWorktreeResult, type CursorModelInfo, type CursorSdkStreamMessage, type CursorTurnRequest, type CursorWorktreesConfig, type DefaultsAppSettings, type DevServerHandle, type DiffCommentInput, type DiffCommentLine, type DiffCommit, type DiffFile, type DiffResult, type DiffScope, type DiffScopeStat, type ExpandResult, FAMOUS_SOCCER_TEAMS, type ForkChatTabInput, type ForkThreadWorktreeInput, type FormatGhLandErrorOptions, GLOBAL_WORKSPACE_ID, type GetDiffOptions, type GhStackStatus, type GitHubStatus, type GitWorktreeStatus, HARNESS_ENV_KEYS, type HarnessId, type InitStackFromThreadInput, type IntegrationsSettings, type IpcApi, type IssueInfo, type IssueSource, LEGACY_ATTACHMENTS_DIR, LEGACY_PLAN_FILE_REL, LEGACY_REVIEW_REQUEST_PATH, type LandPreview, type LandResult, type ListIssuesResult, MAX_ANTHROPIC_CACHE_CONTROL_BLOCKS, type McpServerStatus, type MessagePart, ORCHESTRATOR_AGENT_KINDS, type OpenPrStackLayersInput, type OpenStackLayerInput, type OpenStackLayerResult, type OrchestrationQuotaOnLimit, Orchestrator, type OrchestratorAgentKind, type OrchestratorEvent, type OrchestratorRuntime, type OrphanWorktree, PASTE_ATTACH_MIN_CHARS, PASTE_ATTACH_MIN_LINES, PLAN_FILE_NAME, PLAN_FILE_REL, PLAN_MODE_INSTRUCTION, type PendingPlanQuestions, type PlanQuestion, type PlanQuestionAnswer, type PlanQuestionOption, type PlanToolPartLike, type PrActor, type PrCheckRun, type PrCommentInfo, type PrCommitInfo, type PrDetails, type PrInfo, type PrMeta, type PrReviewInfo, type PrStack, type PrStackLayer, type PresentedPlan, REPO_REVIEW_NAME, REPO_REVIEW_PATH, REVIEW_REQUEST_NAME, REVIEW_REQUEST_PATH, REVIEW_REQUEST_PREFILL, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, type ResolvedReviewGuidelines, type ReviewGuidelinesSource, type RunMode, type RunScript, SIDEBOARD_FORCE_STOP, SIDEBOARD_MCP_ALLOWED_TOOLS, type ScriptHandle, type SkillInfo, type SourceType, type SpawnTurnHandle, type SummarizeResult, THINKING_EFFORTS, type TeamName, type ThinkingEffort, type Thread, type ThreadAttachment, type ThreadMessage, type ThreadOptionsPatch, type ThreadStatus, type TokenUsage, type ToolPartLike, type TranscriptToolDetail, type TurnCommand, type Workspace, type WorkspaceInventoryEntry, type WorkspaceScriptEnvOpts, addPrStackLayer, addStackLayerFromThread, addWorkspace, adoptThread, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendMessage, applyAgentEvent, applyAppEnvironment, applyCompaction, applyThreadIntoMain, assertOrchestratorCapableAgent, attachmentFromAbsolutePath, attachmentsFromBuffers, attachmentsFromWorktreePaths, attachmentsGitignoreBody, autoCleanupOrphansEnabled, autoRenameBranchEnabled, autoRunAfterSetupEnabled, branchDisplayLabel, brightsyAdapter, brightsyCloudConnectAgent, brightsyCloudConnectEnabled, brightsyConfigPath, brightsyMcpAllowedTools, brightsyMcpServerName, buildCachedUserContent, buildClaudeStreamJsonUserMessage, buildDiffCommentAttachment, buildForkTranscriptAttachment, buildPastedTextAttachment, buildReviewRequestAttachment, buildSessionSeed, buildWorkspaceScriptEnv, caffeinateWhileCloudConnectEnabled, caffeinateWhileRunningEnabled, captureLoginEnv, captureTurnBaseline, checkoutPrStackLayer, childEnvWithAppSettings, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, cloneRepoIntoSideboard, codexAdapter, coerceOrchestratorAgent, collectTakenTeamSlugs, commitAll, conductorDbPath, confirmLand, connectBrightsyTeam, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, createChatTab, createEmptyThread, createExistingBranchWorktree, createGlobalChat, createOrUpdatePr, createPrStack, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, deleteBranchOnPurgeEnabled, deleteThreadRecord, detectAgents, detectGhStack, detectLocalMergeConflicts, disconnectBrightsyTeam, discoverSkills, encodeBrightsyTarget, enrichWorkspacesWithGithub, ensureAgentPath, ensureCloudCoordinator, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureWorkspace, estimateMessageChars, estimateThreadChars, expandComposerPrompt, extractGhErrorDetail, extractPendingPlanQuestions, extractPresentedPlan, extractiveSummary, fetchPrHead, finalizeParts, findInvalidCacheControlTtlOrder, findOrphanWorktrees, findThreadByRef, findThreadForStackLayer, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatGhLandError, formatIpcInvokeError, formatMessagesAsTranscript, formatPlanQuestionAnswers, formatPlanQuestionsForChat, formatRateLimitResetHint, formatRenameBranchDirective, formatTranscriptMarkdown, formatWorkspaceInventory, formatWorktreeDirective, getAdapter, getAgentSetupInfo, getBrightsySession, getDefaultAgent, getDefaultEffort, getDefaultFast, getDefaultModel, getDefaultRunScript, getDiff, getDiffSummary, getGitHubStatus, getIssueSource, getLinearApiKey, getOrchestrator, getPr, getPrChecks, getPrDetails, getPrMeta, getPrStack, getRepoSetupInfo, getRunMode, getRunScript, gh, ghHeadRef, ghRepoSelectArgs, git, globalAgentCwd, harnessEnvKey, hasConductorHook, hasCursorWorktreeSetup, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, importConductorWorkspace, importConductorWorkspaceAsync, initPrStack, initStackFromThread, initializeGitRepository, inspectGitWorktree, installAgent, isAskUserToolName, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isCursorAutoModel, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isImageFilePath, isInPrStack, isLinearConnected, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isPresentPlanToolName, isSessionQuotaLimit, isSideboardScratchPath, isThinkingEffort, isWorkspaceScratchPath, listAgentSetupInfo, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearIssues, listLinearIssuesDirect, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergePr, mergePrStack, mergeUsage, nextPastedTextName, nextThinkingEffort, normalizeParseResult, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, openPrStackLayers, openStackLayer, opencodeAdapter, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, parseCursorRunnerLine, parseForceStopMessage, parseGhStackViewJson, parseGithubSlugFromRemoteUrl, parseMcpList, parsePlanQuestionsInput, parseSessionQuotaResetAt, partsToAssistantText, pastedTextStats, permissionMode, planFileAbs, previewLand, pushBranch, readExistingReviewRequestFile, readPlanFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, refreshGitHubAuth, removeWorkspace, removeWorktree, repoSlug, requestReview, requireAgent, resetGhStackDetectCache, resolveClaudeExecutable, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGithubRepoSlug, resolvePlanMarkdown, resolvePrSelector, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveThreadDefaults, resolveThreadEffort, resolveWorktreeStartPoint, run, runArchiveScript, runCloudConnect, runCursorWorktreeSetup, runSetupScript, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, setStatus, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, shouldRefreshReviewRequestTemplate, shouldRunWorktreeCleanup, sideboardHomeDir, sideboardReposDir, sideboardWorkspacesDir, slugify, spawnAgentTurn, splitForCompaction, stackAgentDefaultsFrom, stackIdFrom, stackMergeReadiness, stageAbsolutePathsAsAttachments, stageBuffersAsAttachments, startDevServer, startMcpServer, startOrchestration, stripBrightsyNdjsonNoise, submitPrStack, suggestSlug, summarizeConversation, switchBrightsyAccount, syncWorkspacesFromThreads, takenTeamSlugsForChatTab, takenTeamSlugsForOrchestration, taskMessageText, thinkingEffortBars, thinkingEffortLabel, threadDisplayLabel, threadFilePath, threadLockPath, threadsDir, threadsSharingWorktree, toolDescription, toolDetail, toolFilePath, totalTokens, updateAdvancedSettings, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateDefaultsSettings, updateIntegrationsSettings, updateThread, validateLinearApiKey, withAgentInstructions, withThreadLock, workspaceSettingsSourceLabel, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, writeInjectedMcpConfig, writePlanFile, writeThread, writeWorktreeFile };