@sideboard-ai/core 0.1.50 → 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 (46) hide show
  1. package/dist/{agents-LUB3Q773.js → agents-ON6RKKND.js} +3 -3
  2. package/dist/{agents-3P4N6KHC.js → agents-YKSS6VBO.js} +3 -3
  3. package/dist/{chunk-RQI4TOXK.js → chunk-6QTZVJ7A.js} +7 -5
  4. package/dist/{chunk-AJ6ROGD7.js → chunk-7LNGIP3X.js} +20 -2
  5. package/dist/chunk-B3SJXYIJ.js +24 -0
  6. package/dist/{chunk-ILQK4P5R.js → chunk-BXJ76RHF.js} +4 -4
  7. package/dist/{chunk-SS34TVSY.js → chunk-D3METLRW.js} +7 -5
  8. package/dist/{chunk-FV6FN6V5.js → chunk-DZFH2KLT.js} +340 -22
  9. package/dist/chunk-FKOIHGKV.js +21 -0
  10. package/dist/{chunk-3NAS4MWH.js → chunk-GNML24AW.js} +2 -2
  11. package/dist/{chunk-E35APBHV.js → chunk-H6GGDLYS.js} +1 -1
  12. package/dist/{chunk-EOYDCKQC.js → chunk-HLEX5AQ6.js} +4 -0
  13. package/dist/{chunk-ZQCQIWIP.js → chunk-LRLKJM3O.js} +2 -1
  14. package/dist/chunk-N5PM7HGQ.js +103 -0
  15. package/dist/chunk-QTUESPAW.js +101 -0
  16. package/dist/{chunk-O6W3P7V3.js → chunk-TSRXOSVD.js} +4 -0
  17. package/dist/{chunk-GZXBYHJC.js → chunk-UEAHMGHW.js} +2 -1
  18. package/dist/{chunk-ZVV5EEQN.js → chunk-XOU6HNQJ.js} +305 -22
  19. package/dist/{chunk-5WYEJ3F3.js → chunk-XX5BB7NV.js} +3 -3
  20. package/dist/{chunk-V4JRXYYU.js → chunk-YDXQ72MD.js} +2 -2
  21. package/dist/{chunk-DF5VQQKA.js → chunk-YOWIYAVA.js} +3 -3
  22. package/dist/{chunk-ISY4EGF6.js → chunk-ZNM4MAN4.js} +20 -2
  23. package/dist/{connected-teams-UBXHZGO4.js → connected-teams-2ANNZCP5.js} +2 -2
  24. package/dist/{connected-teams-GF52Q7LB.js → connected-teams-ONC4666A.js} +2 -2
  25. package/dist/{coordinator-prompt-VG4BZ5JL.js → coordinator-prompt-6FXVTSFN.js} +5 -4
  26. package/dist/{coordinator-prompt-SPGDT7J5.js → coordinator-prompt-S6JZD5EF.js} +5 -4
  27. package/dist/{global-workspace-OJF4ENH4.js → global-workspace-EV4G2WMQ.js} +6 -5
  28. package/dist/{global-workspace-KSR3E63K.js → global-workspace-MSX2K27Y.js} +6 -5
  29. package/dist/index.cjs +1369 -155
  30. package/dist/index.d.cts +397 -14
  31. package/dist/index.d.ts +397 -14
  32. package/dist/index.js +811 -90
  33. package/dist/mcp/run-stdio.cjs +1136 -147
  34. package/dist/mcp/run-stdio.js +635 -79
  35. package/dist/plan-file-6O7G4VPQ.js +23 -0
  36. package/dist/plan-file-PHVKUAEE.js +25 -0
  37. package/dist/{run-HMRSRG3U.js → run-H3IMNOYN.js} +3 -1
  38. package/dist/run-ZJKYHXGN.js +12 -0
  39. package/dist/{thread-store-XICUWFNM.js → thread-store-GHOADGL2.js} +1 -1
  40. package/dist/{thread-store-OV2X6PYO.js → thread-store-UJIGMI5J.js} +1 -1
  41. package/dist/{workspaces-OZE7LRDO.js → workspaces-3RQQZQRO.js} +7 -6
  42. package/dist/{workspaces-UJX7JIGH.js → workspaces-AYTBR6KQ.js} +7 -6
  43. package/dist/{worktree-XG5PCLZY.js → worktree-5KEQWSAF.js} +8 -3
  44. package/dist/{worktree-TEDAJ57S.js → worktree-RWGL7FUV.js} +8 -3
  45. package/package.json +1 -1
  46. package/dist/run-LF6E5IKL.js +0 -10
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;
@@ -800,6 +840,9 @@ declare function run(file: string, args: string[], opts?: {
800
840
  }>;
801
841
  declare function git(args: string[], cwd: string, opts?: {
802
842
  reject?: boolean;
843
+ env?: Record<string, string>;
844
+ /** Passed as `git -c key=value` (e.g. authenticated HTTPS via http.extraHeader). */
845
+ config?: Record<string, string>;
803
846
  }): Promise<{
804
847
  stdout: string;
805
848
  stderr: string;
@@ -812,6 +855,8 @@ declare function gh(args: string[], cwd: string, opts?: {
812
855
  stderr: string;
813
856
  exitCode: number;
814
857
  }>;
858
+ /** GitHub CLI token for non-interactive HTTPS git (GUI apps often lack SSH agent). */
859
+ declare function resolveGhAuthToken(cwd: string): Promise<string | null>;
815
860
 
816
861
  /** Detect GitHub API / GraphQL rate-limit failures in gh CLI output. */
817
862
  declare function isGhRateLimitError(text: string): boolean;
@@ -976,6 +1021,15 @@ declare function createThreadWorktree(opts: {
976
1021
  sourceRef: string;
977
1022
  slug: string;
978
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>;
979
1033
  declare function removeWorktree(repoPath: string, worktreePath: string, opts?: {
980
1034
  deleteBranch?: string;
981
1035
  }): Promise<void>;
@@ -984,11 +1038,17 @@ declare function listWorktrees(repoPath: string): Promise<Array<{
984
1038
  branch: string | null;
985
1039
  }>>;
986
1040
  declare function isDirty(worktreePath: string): Promise<boolean>;
1041
+ /**
1042
+ * Local workspace scratch (`.context/attachments`, legacy `.sideboard/attachments`).
1043
+ * Must not force the right-sidebar primary action to "Commit & push".
1044
+ */
1045
+ declare function isSideboardScratchPath(relativePath: string): boolean;
987
1046
  declare function currentBranch(worktreePath: string): Promise<string>;
988
1047
  declare function commitAll(worktreePath: string, message: string): Promise<boolean>;
989
1048
  declare function pushBranch(worktreePath: string, branchName: string): Promise<void>;
990
- /** Merge an open pull request via `gh pr merge` (squash by default).
991
- * 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). */
992
1052
  declare function mergePr(cwd: string, selector: string, opts?: {
993
1053
  method?: 'merge' | 'squash' | 'rebase';
994
1054
  }): Promise<{
@@ -1012,6 +1072,55 @@ declare function collectTakenTeamSlugs(repoPath: string): Set<string>;
1012
1072
  /** Pick an unused soccer team for the worktree directory / branch slug. */
1013
1073
  declare function allocateTeamSlug(repoPath: string): TeamName;
1014
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
+
1015
1124
  interface GitHubStatus {
1016
1125
  connected: boolean;
1017
1126
  login: string | null;
@@ -1142,7 +1251,7 @@ interface AgentAdapter {
1142
1251
  labels: string[];
1143
1252
  }>>;
1144
1253
  }
1145
- 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.";
1146
1255
  declare function permissionMode(thread: Pick<Thread, 'autonomy' | 'planMode'>): {
1147
1256
  claude: string;
1148
1257
  opencodePermission: string;
@@ -1762,7 +1871,7 @@ declare function isImageFilePath(filePath: string): boolean;
1762
1871
  */
1763
1872
  declare function attachmentFromAbsolutePath(absolutePath: string): ThreadAttachment;
1764
1873
  /**
1765
- * Copy absolute paths into `.sideboard/attachments/` and return composer attachments
1874
+ * Copy absolute paths into `.context/attachments/` and return composer attachments
1766
1875
  * with worktree-relative `path` (and image previews when applicable).
1767
1876
  */
1768
1877
  declare function stageAbsolutePathsAsAttachments(worktreePath: string, absolutePaths: string[]): ThreadAttachment[];
@@ -1771,7 +1880,7 @@ interface ComposerFileBuffer {
1771
1880
  dataBase64: string;
1772
1881
  }
1773
1882
  /**
1774
- * Write in-memory file buffers into `.sideboard/attachments/` (renderer drop
1883
+ * Write in-memory file buffers into `.context/attachments/` (renderer drop
1775
1884
  * fallback when Electron does not expose a filesystem path).
1776
1885
  */
1777
1886
  declare function stageBuffersAsAttachments(worktreePath: string, buffers: ComposerFileBuffer[]): ThreadAttachment[];
@@ -1886,7 +1995,7 @@ declare function confirmLand(thread: Thread, opts?: {
1886
1995
  web?: boolean;
1887
1996
  }): Promise<LandResult>;
1888
1997
 
1889
- declare function createThread(input: CreateThreadInput, onSetupLine?: (line: string) => void): Promise<Thread>;
1998
+ declare function createThread(input: CreateThreadInput, _onSetupLine?: (line: string) => void): Promise<Thread>;
1890
1999
  /** @deprecated Prefer listIssues() from integrations/issues — agent-agnostic. */
1891
2000
  declare function listLinearIssues(agent: AgentKind, repoPath: string): Promise<{
1892
2001
  id: string;
@@ -1913,6 +2022,96 @@ declare function forkChatTab(input: ForkChatTabInput): Thread;
1913
2022
  /** Fork into a new git worktree branched from the source thread's branch. */
1914
2023
  declare function forkThreadWorktree(input: ForkThreadWorktreeInput, onSetupLine?: (line: string) => void): Promise<Thread>;
1915
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
+
1916
2115
  /**
1917
2116
  * Conductor persists Cursor SDK agent IDs under cursor-sdk-store/<hash>/agents.ndjson
1918
2117
  * (not in sessions.claude_session_id). Prefer the newest durable agent for a cwd.
@@ -2024,6 +2223,8 @@ declare class Orchestrator {
2024
2223
  getThreads(includeArchived?: boolean): Thread[];
2025
2224
  getThread(idOrRef: string): Thread | null;
2026
2225
  createThread(input: CreateThreadInput): Promise<Thread>;
2226
+ /** Run workspace setup after a new worktree is created (no-op if none configured). */
2227
+ private runSetupAfterCreate;
2027
2228
  listWorkspaces(): Workspace[];
2028
2229
  addWorkspace(repoPath: string): Promise<Workspace>;
2029
2230
  removeWorkspace(repoPath: string): void;
@@ -2151,6 +2352,45 @@ declare class Orchestrator {
2151
2352
  private withPrSelector;
2152
2353
  getPrChecks(threadRef: string): Promise<PrCheckRun[] | null>;
2153
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
+ }>;
2154
2394
  getPrDetails(threadRef: string): Promise<PrDetails | null>;
2155
2395
  setAutonomy(threadRef: string, autonomy: Autonomy): Thread;
2156
2396
  /**
@@ -2187,7 +2427,7 @@ declare class Orchestrator {
2187
2427
  setAttachments(threadRef: string, attachments: Thread['attachments']): Thread;
2188
2428
  /**
2189
2429
  * Stage OS / worktree files into composer attachments (copies external files
2190
- * into `.sideboard/attachments/` so agents can Read images and binaries).
2430
+ * into `.context/attachments/` so agents can Read images and binaries).
2191
2431
  */
2192
2432
  attachComposerFiles(threadRef: string, opts: {
2193
2433
  absolutePaths?: string[];
@@ -2223,10 +2463,11 @@ declare function startOrchestration(opts: {
2223
2463
  declare const REPO_REVIEW_PATH = ".sideboard/review.md";
2224
2464
  declare const REPO_REVIEW_NAME = "review.md";
2225
2465
  /**
2226
- * Local / Conductor-style scratch guidelines (gitignored under attachments/).
2466
+ * Local scratch guidelines (gitignored under `.context/attachments/`).
2227
2467
  * Used as override when no repo file exists, or as the stock seed target.
2228
2468
  */
2229
- 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";
2230
2471
  declare const REVIEW_REQUEST_NAME = "Review request.md";
2231
2472
  /** Short chat message — guidelines live in the attached review file. */
2232
2473
  declare const REVIEW_REQUEST_PREFILL = "Review.";
@@ -2245,8 +2486,9 @@ declare function shouldRefreshReviewRequestTemplate(content: string): boolean;
2245
2486
  /**
2246
2487
  * Resolve which review guidelines to attach:
2247
2488
  * 1. `.sideboard/review.md` (committed, per-repo)
2248
- * 2. `.sideboard/attachments/Review request.md` (local override)
2249
- * 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)
2250
2492
  */
2251
2493
  declare function resolveReviewGuidelines(worktreePath: string): ResolvedReviewGuidelines;
2252
2494
  /**
@@ -2277,6 +2519,107 @@ type SendFn = (threadRef: string, prompt: string) => Promise<Thread>;
2277
2519
  */
2278
2520
  declare function requestReview(threadRef: string, send: SendFn): Promise<RequestReviewResult>;
2279
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
+
2280
2623
  type WorkspaceInventoryEntry = Workspace & {
2281
2624
  /** Best-effort GitHub `owner/repo` from remote / gh. */
2282
2625
  githubSlug?: string | null;
@@ -2476,7 +2819,7 @@ interface IpcApi {
2476
2819
  setAttachments(threadRef: string, attachments: ThreadAttachment[]): Promise<Thread>;
2477
2820
  /**
2478
2821
  * Stage dropped/picked files into composer attachments. External files are
2479
- * copied into `.sideboard/attachments/` in the thread worktree.
2822
+ * copied into `.context/attachments/` in the thread worktree.
2480
2823
  */
2481
2824
  attachComposerFiles(threadRef: string, opts: {
2482
2825
  absolutePaths?: string[];
@@ -2545,6 +2888,46 @@ interface IpcApi {
2545
2888
  getPrChecks(threadRef: string): Promise<PrCheckRun[] | null>;
2546
2889
  /** Lightweight PR fields for the sidebar pill (cheap GraphQL). */
2547
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
+ }>;
2548
2931
  /** PR description / reviews for the Review tab. */
2549
2932
  getPrDetails(threadRef: string): Promise<PrDetails | null>;
2550
2933
  listFiles(threadRef: string): Promise<string[]>;
@@ -2910,4 +3293,4 @@ declare function writeInjectedMcpConfig(opts: {
2910
3293
  includeBrightsy?: boolean;
2911
3294
  }): Promise<string | null>;
2912
3295
 
2913
- 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, 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, 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 };