@sideboard-ai/core 0.1.44 → 0.1.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -121,6 +121,16 @@ interface Thread {
121
121
  * Used so other processes (MCP) do not reclaim a live turn as dead.
122
122
  */
123
123
  agentPid?: number | null;
124
+ /**
125
+ * When set, host auto-retries this orchestration chat after a provider
126
+ * session/usage quota reset (ISO timestamp).
127
+ */
128
+ quotaResumeAt?: string | null;
129
+ /**
130
+ * Orchestration chat this one was auto-continued from after a session quota
131
+ * limit (prevents infinite agent-switch cascades).
132
+ */
133
+ quotaContinuedFromId?: string | null;
124
134
  }
125
135
  interface CreateChatTabInput {
126
136
  /** Existing thread in the worktree to clone workspace metadata from. */
@@ -140,6 +150,8 @@ interface ForkChatTabInput {
140
150
  /** Inclusive message index to fork through; default = all messages. */
141
151
  throughIndex?: number;
142
152
  agent?: AgentKind;
153
+ /** Model for the forked chat; omit to inherit or Auto when agent changes. */
154
+ model?: string | null;
143
155
  title?: string;
144
156
  }
145
157
  /** Fork a thread into a new git worktree (new branch + worktree dir). */
@@ -148,6 +160,8 @@ interface ForkThreadWorktreeInput {
148
160
  /** Inclusive message index to seed transcript through; default = all messages. */
149
161
  throughIndex?: number;
150
162
  agent?: AgentKind;
163
+ /** Model for the forked chat; omit to inherit or Auto when agent changes. */
164
+ model?: string | null;
151
165
  title?: string;
152
166
  }
153
167
  interface ThreadOptionsPatch {
@@ -365,6 +379,15 @@ type OrchestratorEvent = {
365
379
  threadId: string;
366
380
  olderCount: number;
367
381
  method: 'claude' | 'extractive';
382
+ } | {
383
+ type: 'quota_failover';
384
+ threadId: string;
385
+ action: 'switch_agent' | 'wait_reset';
386
+ message: string;
387
+ /** New orchestration chat when action is switch_agent. */
388
+ toThreadId?: string;
389
+ /** When action is wait_reset — ISO resume time. */
390
+ resumeAt?: string;
368
391
  } | {
369
392
  type: 'dev_server_started';
370
393
  threadId: string;
@@ -541,6 +564,7 @@ interface IntegrationsSettings {
541
564
  * Conductor-inspired power-user preferences (Settings → Advanced).
542
565
  * Defaults match Conductor where applicable (auto-rename on, others off).
543
566
  */
567
+ type OrchestrationQuotaOnLimit = 'switch_agent' | 'wait_reset';
544
568
  interface AdvancedAppSettings {
545
569
  /**
546
570
  * Ask the agent to rename the temporary `thread/<team>` branch on first send.
@@ -580,6 +604,14 @@ interface AdvancedAppSettings {
580
604
  worktreeLastCleanupAt?: string;
581
605
  /** When true, reconcile auto-removes excess orphan worktrees. */
582
606
  autoCleanupOrphans?: boolean;
607
+ /**
608
+ * When an orchestration chat hits a provider session/usage limit:
609
+ * - `switch_agent` (default): continue on {@link AdvancedAppSettings.orchestrationQuotaFallbackAgent} with Auto
610
+ * - `wait_reset`: schedule auto-retry when the limit message’s reset time arrives
611
+ */
612
+ orchestrationQuotaOnLimit?: OrchestrationQuotaOnLimit;
613
+ /** Agent to continue on after a session limit (default: cursor). Ignored when equal to the limited agent. */
614
+ orchestrationQuotaFallbackAgent?: AgentKind;
583
615
  }
584
616
  interface AppSettings {
585
617
  /** Environment variables injected into agent / hook processes (and process.env). */
@@ -655,6 +687,10 @@ declare function caffeinateWhileRunningEnabled(settings?: AppSettings): boolean;
655
687
  declare function caffeinateWhileCloudConnectEnabled(settings?: AppSettings): boolean;
656
688
  declare function deleteBranchOnPurgeEnabled(settings?: AppSettings): boolean;
657
689
  declare function autoCleanupOrphansEnabled(settings?: AppSettings): boolean;
690
+ /** Default: switch to another agent (Auto) when orchestration hits a session limit. */
691
+ declare function orchestrationQuotaOnLimit(settings?: AppSettings): OrchestrationQuotaOnLimit;
692
+ /** Default fallback agent for orchestration session-limit continue (cursor). */
693
+ declare function orchestrationQuotaFallbackAgent(settings?: AppSettings): AgentKind;
658
694
  declare function maxConcurrentAgents(settings?: AppSettings): number;
659
695
  /** Binary name or absolute path used to spawn Claude Code. */
660
696
  declare function resolveClaudeExecutable(settings?: AppSettings): string;
@@ -1250,6 +1286,28 @@ declare const cursorAdapter: AgentAdapter;
1250
1286
  declare function listOpencodeModels(): Promise<AgentModelInfo[]>;
1251
1287
  declare const opencodeAdapter: AgentAdapter;
1252
1288
 
1289
+ /** Claude Code aliases used by Sideboard (null = Auto / CLI default). */
1290
+ declare const CLAUDE_MODEL_CATALOG: AgentModelInfo[];
1291
+ type AgentModelCatalog = {
1292
+ agent: AgentKind;
1293
+ /** Omit / null model = Auto (provider default). Cursor uses id `default`. */
1294
+ auto: true;
1295
+ models: AgentModelInfo[];
1296
+ note?: string;
1297
+ };
1298
+ /** Models available for one agent (or all when agent omitted). */
1299
+ declare function listModelsForAgent(agent?: AgentKind): Promise<AgentModelCatalog[]>;
1300
+
1301
+ /**
1302
+ * Provider session/usage quota (Claude “session limit”, weekly/opus caps, etc.).
1303
+ * Not context-window overflow and not billing/credits.
1304
+ */
1305
+ declare function isSessionQuotaLimit(text: string): boolean;
1306
+ /** Best-effort parse of “resets 7:10pm (America/Los_Angeles)” / “resets in 2 hours”. */
1307
+ declare function parseSessionQuotaResetAt(text: string, now?: Date): Date | null;
1308
+ /** Pick a different agent for quota failover (preferred first, then stable order). */
1309
+ declare function resolveQuotaFallbackAgent(current: AgentKind, preferred?: AgentKind | null): AgentKind;
1310
+
1253
1311
  /**
1254
1312
  * Electron / GUI apps often inherit a minimal PATH that omits Homebrew and
1255
1313
  * user bin dirs where `claude` / `codex` / `opencode` / `brightsy` live. Call
@@ -1822,7 +1880,9 @@ declare function forkMessageSlice(from: Thread, throughIndex?: number): ThreadMe
1822
1880
  declare function buildForkTranscriptAttachment(baseTitle: string, messages: ThreadMessage[]): ThreadAttachment;
1823
1881
  /** New chat tab in the same worktree (no new git worktree). */
1824
1882
  declare function createChatTab(input: CreateChatTabInput): Thread;
1825
- /** Fork chat into a new tab with transcript attached in the composer. */
1883
+ /** Fork chat into a new tab with transcript attached in the composer.
1884
+ * Works for worktree agents and Global orchestration chats (same global home).
1885
+ */
1826
1886
  declare function forkChatTab(input: ForkChatTabInput): Thread;
1827
1887
 
1828
1888
  /** Fork into a new git worktree branched from the source thread's branch. */
@@ -1901,6 +1961,8 @@ declare class Orchestrator {
1901
1961
  private readonly haltDrain;
1902
1962
  /** WIP snapshot SHA at the start of the latest agent turn (per thread). */
1903
1963
  private readonly turnBaselines;
1964
+ /** Timers for orchestration session-quota auto-resume. */
1965
+ private readonly quotaResumeTimers;
1904
1966
  private maxConcurrent;
1905
1967
  private runningCount;
1906
1968
  constructor(opts?: {
@@ -1924,6 +1986,16 @@ declare class Orchestrator {
1924
1986
  */
1925
1987
  reclaimStaleTurns?: boolean;
1926
1988
  }): Promise<void>;
1989
+ private clearQuotaResumeTimer;
1990
+ /** Schedule (or fire) auto-retry after a provider session/usage limit reset. */
1991
+ private scheduleQuotaResume;
1992
+ private schedulePendingQuotaResumes;
1993
+ private resumeAfterQuotaWait;
1994
+ /**
1995
+ * Host-side continue when an orchestration chat hits a provider session/usage
1996
+ * limit (not context size): switch agent (Auto) or wait until reset.
1997
+ */
1998
+ private maybeHandleOrchestrationQuotaFailover;
1927
1999
  getThreads(includeArchived?: boolean): Thread[];
1928
2000
  getThread(idOrRef: string): Thread | null;
1929
2001
  createThread(input: CreateThreadInput): Promise<Thread>;
@@ -2076,12 +2148,14 @@ declare class Orchestrator {
2076
2148
  threadId: string;
2077
2149
  throughIndex?: number;
2078
2150
  agent?: Thread['agent'];
2151
+ model?: string | null;
2079
2152
  title?: string;
2080
2153
  }): Thread;
2081
2154
  forkThreadWorktree(input: {
2082
2155
  threadId: string;
2083
2156
  throughIndex?: number;
2084
2157
  agent?: Thread['agent'];
2158
+ model?: string | null;
2085
2159
  title?: string;
2086
2160
  }): Promise<Thread>;
2087
2161
  renameThread(threadRef: string, title: string): Thread;
@@ -2777,4 +2851,4 @@ declare function writeInjectedMcpConfig(opts: {
2777
2851
  includeBrightsy?: boolean;
2778
2852
  }): Promise<string | null>;
2779
2853
 
2780
- export { type ActiveRun, type AdoptInput, type AdvancedAppSettings, type AgentAdapter, type AgentEvent, type AgentInstructionFile, type AgentKind, 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, 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, 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, REVIEW_REQUEST_NAME, REVIEW_REQUEST_PATH, REVIEW_REQUEST_PREFILL, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, 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, 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, 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, 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, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isThinkingEffort, listAgentSetupInfo, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearIssues, listLinearIssuesDirect, 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, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, parseCursorRunnerLine, parseForceStopMessage, parseGithubSlugFromRemoteUrl, parseMcpList, 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, resolveRepoRoot, resolveThreadDefaults, resolveThreadEffort, resolveWorktreeStartPoint, run, runArchiveScript, runCloudConnect, runCursorWorktreeSetup, runSetupScript, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, setStatus, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, 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 };
2854
+ 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, type OrchestrationQuotaOnLimit, Orchestrator, 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, REVIEW_REQUEST_NAME, REVIEW_REQUEST_PATH, REVIEW_REQUEST_PREFILL, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, 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, 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, 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, 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, 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, resolveThreadDefaults, resolveThreadEffort, resolveWorktreeStartPoint, run, runArchiveScript, runCloudConnect, runCursorWorktreeSetup, runSetupScript, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, setStatus, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, 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 };
package/dist/index.d.ts CHANGED
@@ -121,6 +121,16 @@ interface Thread {
121
121
  * Used so other processes (MCP) do not reclaim a live turn as dead.
122
122
  */
123
123
  agentPid?: number | null;
124
+ /**
125
+ * When set, host auto-retries this orchestration chat after a provider
126
+ * session/usage quota reset (ISO timestamp).
127
+ */
128
+ quotaResumeAt?: string | null;
129
+ /**
130
+ * Orchestration chat this one was auto-continued from after a session quota
131
+ * limit (prevents infinite agent-switch cascades).
132
+ */
133
+ quotaContinuedFromId?: string | null;
124
134
  }
125
135
  interface CreateChatTabInput {
126
136
  /** Existing thread in the worktree to clone workspace metadata from. */
@@ -140,6 +150,8 @@ interface ForkChatTabInput {
140
150
  /** Inclusive message index to fork through; default = all messages. */
141
151
  throughIndex?: number;
142
152
  agent?: AgentKind;
153
+ /** Model for the forked chat; omit to inherit or Auto when agent changes. */
154
+ model?: string | null;
143
155
  title?: string;
144
156
  }
145
157
  /** Fork a thread into a new git worktree (new branch + worktree dir). */
@@ -148,6 +160,8 @@ interface ForkThreadWorktreeInput {
148
160
  /** Inclusive message index to seed transcript through; default = all messages. */
149
161
  throughIndex?: number;
150
162
  agent?: AgentKind;
163
+ /** Model for the forked chat; omit to inherit or Auto when agent changes. */
164
+ model?: string | null;
151
165
  title?: string;
152
166
  }
153
167
  interface ThreadOptionsPatch {
@@ -365,6 +379,15 @@ type OrchestratorEvent = {
365
379
  threadId: string;
366
380
  olderCount: number;
367
381
  method: 'claude' | 'extractive';
382
+ } | {
383
+ type: 'quota_failover';
384
+ threadId: string;
385
+ action: 'switch_agent' | 'wait_reset';
386
+ message: string;
387
+ /** New orchestration chat when action is switch_agent. */
388
+ toThreadId?: string;
389
+ /** When action is wait_reset — ISO resume time. */
390
+ resumeAt?: string;
368
391
  } | {
369
392
  type: 'dev_server_started';
370
393
  threadId: string;
@@ -541,6 +564,7 @@ interface IntegrationsSettings {
541
564
  * Conductor-inspired power-user preferences (Settings → Advanced).
542
565
  * Defaults match Conductor where applicable (auto-rename on, others off).
543
566
  */
567
+ type OrchestrationQuotaOnLimit = 'switch_agent' | 'wait_reset';
544
568
  interface AdvancedAppSettings {
545
569
  /**
546
570
  * Ask the agent to rename the temporary `thread/<team>` branch on first send.
@@ -580,6 +604,14 @@ interface AdvancedAppSettings {
580
604
  worktreeLastCleanupAt?: string;
581
605
  /** When true, reconcile auto-removes excess orphan worktrees. */
582
606
  autoCleanupOrphans?: boolean;
607
+ /**
608
+ * When an orchestration chat hits a provider session/usage limit:
609
+ * - `switch_agent` (default): continue on {@link AdvancedAppSettings.orchestrationQuotaFallbackAgent} with Auto
610
+ * - `wait_reset`: schedule auto-retry when the limit message’s reset time arrives
611
+ */
612
+ orchestrationQuotaOnLimit?: OrchestrationQuotaOnLimit;
613
+ /** Agent to continue on after a session limit (default: cursor). Ignored when equal to the limited agent. */
614
+ orchestrationQuotaFallbackAgent?: AgentKind;
583
615
  }
584
616
  interface AppSettings {
585
617
  /** Environment variables injected into agent / hook processes (and process.env). */
@@ -655,6 +687,10 @@ declare function caffeinateWhileRunningEnabled(settings?: AppSettings): boolean;
655
687
  declare function caffeinateWhileCloudConnectEnabled(settings?: AppSettings): boolean;
656
688
  declare function deleteBranchOnPurgeEnabled(settings?: AppSettings): boolean;
657
689
  declare function autoCleanupOrphansEnabled(settings?: AppSettings): boolean;
690
+ /** Default: switch to another agent (Auto) when orchestration hits a session limit. */
691
+ declare function orchestrationQuotaOnLimit(settings?: AppSettings): OrchestrationQuotaOnLimit;
692
+ /** Default fallback agent for orchestration session-limit continue (cursor). */
693
+ declare function orchestrationQuotaFallbackAgent(settings?: AppSettings): AgentKind;
658
694
  declare function maxConcurrentAgents(settings?: AppSettings): number;
659
695
  /** Binary name or absolute path used to spawn Claude Code. */
660
696
  declare function resolveClaudeExecutable(settings?: AppSettings): string;
@@ -1250,6 +1286,28 @@ declare const cursorAdapter: AgentAdapter;
1250
1286
  declare function listOpencodeModels(): Promise<AgentModelInfo[]>;
1251
1287
  declare const opencodeAdapter: AgentAdapter;
1252
1288
 
1289
+ /** Claude Code aliases used by Sideboard (null = Auto / CLI default). */
1290
+ declare const CLAUDE_MODEL_CATALOG: AgentModelInfo[];
1291
+ type AgentModelCatalog = {
1292
+ agent: AgentKind;
1293
+ /** Omit / null model = Auto (provider default). Cursor uses id `default`. */
1294
+ auto: true;
1295
+ models: AgentModelInfo[];
1296
+ note?: string;
1297
+ };
1298
+ /** Models available for one agent (or all when agent omitted). */
1299
+ declare function listModelsForAgent(agent?: AgentKind): Promise<AgentModelCatalog[]>;
1300
+
1301
+ /**
1302
+ * Provider session/usage quota (Claude “session limit”, weekly/opus caps, etc.).
1303
+ * Not context-window overflow and not billing/credits.
1304
+ */
1305
+ declare function isSessionQuotaLimit(text: string): boolean;
1306
+ /** Best-effort parse of “resets 7:10pm (America/Los_Angeles)” / “resets in 2 hours”. */
1307
+ declare function parseSessionQuotaResetAt(text: string, now?: Date): Date | null;
1308
+ /** Pick a different agent for quota failover (preferred first, then stable order). */
1309
+ declare function resolveQuotaFallbackAgent(current: AgentKind, preferred?: AgentKind | null): AgentKind;
1310
+
1253
1311
  /**
1254
1312
  * Electron / GUI apps often inherit a minimal PATH that omits Homebrew and
1255
1313
  * user bin dirs where `claude` / `codex` / `opencode` / `brightsy` live. Call
@@ -1822,7 +1880,9 @@ declare function forkMessageSlice(from: Thread, throughIndex?: number): ThreadMe
1822
1880
  declare function buildForkTranscriptAttachment(baseTitle: string, messages: ThreadMessage[]): ThreadAttachment;
1823
1881
  /** New chat tab in the same worktree (no new git worktree). */
1824
1882
  declare function createChatTab(input: CreateChatTabInput): Thread;
1825
- /** Fork chat into a new tab with transcript attached in the composer. */
1883
+ /** Fork chat into a new tab with transcript attached in the composer.
1884
+ * Works for worktree agents and Global orchestration chats (same global home).
1885
+ */
1826
1886
  declare function forkChatTab(input: ForkChatTabInput): Thread;
1827
1887
 
1828
1888
  /** Fork into a new git worktree branched from the source thread's branch. */
@@ -1901,6 +1961,8 @@ declare class Orchestrator {
1901
1961
  private readonly haltDrain;
1902
1962
  /** WIP snapshot SHA at the start of the latest agent turn (per thread). */
1903
1963
  private readonly turnBaselines;
1964
+ /** Timers for orchestration session-quota auto-resume. */
1965
+ private readonly quotaResumeTimers;
1904
1966
  private maxConcurrent;
1905
1967
  private runningCount;
1906
1968
  constructor(opts?: {
@@ -1924,6 +1986,16 @@ declare class Orchestrator {
1924
1986
  */
1925
1987
  reclaimStaleTurns?: boolean;
1926
1988
  }): Promise<void>;
1989
+ private clearQuotaResumeTimer;
1990
+ /** Schedule (or fire) auto-retry after a provider session/usage limit reset. */
1991
+ private scheduleQuotaResume;
1992
+ private schedulePendingQuotaResumes;
1993
+ private resumeAfterQuotaWait;
1994
+ /**
1995
+ * Host-side continue when an orchestration chat hits a provider session/usage
1996
+ * limit (not context size): switch agent (Auto) or wait until reset.
1997
+ */
1998
+ private maybeHandleOrchestrationQuotaFailover;
1927
1999
  getThreads(includeArchived?: boolean): Thread[];
1928
2000
  getThread(idOrRef: string): Thread | null;
1929
2001
  createThread(input: CreateThreadInput): Promise<Thread>;
@@ -2076,12 +2148,14 @@ declare class Orchestrator {
2076
2148
  threadId: string;
2077
2149
  throughIndex?: number;
2078
2150
  agent?: Thread['agent'];
2151
+ model?: string | null;
2079
2152
  title?: string;
2080
2153
  }): Thread;
2081
2154
  forkThreadWorktree(input: {
2082
2155
  threadId: string;
2083
2156
  throughIndex?: number;
2084
2157
  agent?: Thread['agent'];
2158
+ model?: string | null;
2085
2159
  title?: string;
2086
2160
  }): Promise<Thread>;
2087
2161
  renameThread(threadRef: string, title: string): Thread;
@@ -2777,4 +2851,4 @@ declare function writeInjectedMcpConfig(opts: {
2777
2851
  includeBrightsy?: boolean;
2778
2852
  }): Promise<string | null>;
2779
2853
 
2780
- export { type ActiveRun, type AdoptInput, type AdvancedAppSettings, type AgentAdapter, type AgentEvent, type AgentInstructionFile, type AgentKind, 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, 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, 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, REVIEW_REQUEST_NAME, REVIEW_REQUEST_PATH, REVIEW_REQUEST_PREFILL, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, 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, 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, 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, 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, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isThinkingEffort, listAgentSetupInfo, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearIssues, listLinearIssuesDirect, 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, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, parseCursorRunnerLine, parseForceStopMessage, parseGithubSlugFromRemoteUrl, parseMcpList, 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, resolveRepoRoot, resolveThreadDefaults, resolveThreadEffort, resolveWorktreeStartPoint, run, runArchiveScript, runCloudConnect, runCursorWorktreeSetup, runSetupScript, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, setStatus, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, 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 };
2854
+ 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, type OrchestrationQuotaOnLimit, Orchestrator, 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, REVIEW_REQUEST_NAME, REVIEW_REQUEST_PATH, REVIEW_REQUEST_PREFILL, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, 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, 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, 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, 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, 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, resolveThreadDefaults, resolveThreadEffort, resolveWorktreeStartPoint, run, runArchiveScript, runCloudConnect, runCursorWorktreeSetup, runSetupScript, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, setStatus, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, 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 };
package/dist/index.js CHANGED
@@ -108,14 +108,14 @@ import {
108
108
  withAgentInstructions,
109
109
  worktreeCleanupSettings,
110
110
  writeWorktreeFile
111
- } from "./chunk-V3S4NF5F.js";
111
+ } from "./chunk-I6QGZOOS.js";
112
112
  import {
113
113
  addWorkspace,
114
114
  ensureWorkspace,
115
115
  listWorkspaces,
116
116
  removeWorkspace,
117
117
  syncWorkspacesFromThreads
118
- } from "./chunk-TXFJEXFB.js";
118
+ } from "./chunk-U3EQKJHA.js";
119
119
  import {
120
120
  CLOUD_COORDINATOR_BUSY_REPLY,
121
121
  CLOUD_COORDINATOR_STOPPED_REPLY,
@@ -135,7 +135,7 @@ import {
135
135
  orchestratorSessionPoisonedByBuiltins,
136
136
  parseForceStopMessage,
137
137
  takenTeamSlugsForOrchestration
138
- } from "./chunk-I3PKMLFW.js";
138
+ } from "./chunk-ZNSM2DDD.js";
139
139
  import {
140
140
  COORDINATOR_TOOL_PLAYBOOK,
141
141
  coordinatorSystemPrompt,
@@ -143,9 +143,10 @@ import {
143
143
  enrichWorkspacesWithGithub,
144
144
  ensureGlobalCoordinatorCwd,
145
145
  formatWorkspaceInventory
146
- } from "./chunk-JM2TVGNW.js";
146
+ } from "./chunk-6NAPN2N5.js";
147
147
  import {
148
148
  BRIGHTSY_MCP_ALLOWED_TOOLS,
149
+ CLAUDE_MODEL_CATALOG,
149
150
  MAX_ANTHROPIC_CACHE_CONTROL_BLOCKS,
150
151
  PLAN_MODE_INSTRUCTION,
151
152
  SIDEBOARD_MCP_ALLOWED_TOOLS,
@@ -167,10 +168,12 @@ import {
167
168
  installAgent,
168
169
  isBrightsyConnected,
169
170
  isCursorAutoModel,
171
+ isSessionQuotaLimit,
170
172
  listAgentSetupInfo,
171
173
  listBrightsyChatTargets,
172
174
  listCodexModels,
173
175
  listCursorModels,
176
+ listModelsForAgent,
174
177
  listOpencodeModels,
175
178
  loginAgent,
176
179
  mcpAllowTools,
@@ -179,11 +182,13 @@ import {
179
182
  openInSystemTerminal,
180
183
  opencodeAdapter,
181
184
  parseMcpList,
185
+ parseSessionQuotaResetAt,
182
186
  permissionMode,
183
187
  resolveCursorModelId,
188
+ resolveQuotaFallbackAgent,
184
189
  sanitizeMcpServerName,
185
190
  writeInjectedMcpConfig
186
- } from "./chunk-XX26NCB6.js";
191
+ } from "./chunk-ANZ566Z5.js";
187
192
  import {
188
193
  brightsyConfigPath,
189
194
  brightsyMcpServerName,
@@ -199,7 +204,7 @@ import {
199
204
  import {
200
205
  cursorSdkMessageToEvents,
201
206
  parseCursorRunnerLine
202
- } from "./chunk-PU27NUO4.js";
207
+ } from "./chunk-J5JTEJ5O.js";
203
208
  import {
204
209
  HARNESS_ENV_KEYS,
205
210
  appSettingsPath,
@@ -225,6 +230,8 @@ import {
225
230
  isLinearConnected,
226
231
  loadAppSettings,
227
232
  maxConcurrentAgents,
233
+ orchestrationQuotaFallbackAgent,
234
+ orchestrationQuotaOnLimit,
228
235
  resolveClaudeExecutable,
229
236
  resolveEffectiveIssueSource,
230
237
  resolveThreadDefaults,
@@ -235,7 +242,7 @@ import {
235
242
  updateClaudeSettings,
236
243
  updateDefaultsSettings,
237
244
  updateIntegrationsSettings
238
- } from "./chunk-FSIK442J.js";
245
+ } from "./chunk-WYY3J7GR.js";
239
246
  import {
240
247
  FAMOUS_SOCCER_TEAMS,
241
248
  allocateTeamName,
@@ -284,7 +291,7 @@ import {
284
291
  worktreeDisplayLabel,
285
292
  worktreeDisplayLabelForGroup,
286
293
  worktreeNameFromPath
287
- } from "./chunk-7PCTK4WO.js";
294
+ } from "./chunk-FV6FN6V5.js";
288
295
  import {
289
296
  appendMessage,
290
297
  createEmptyThread,
@@ -298,7 +305,7 @@ import {
298
305
  updateThread,
299
306
  withThreadLock,
300
307
  writeThread
301
- } from "./chunk-ENSD62HW.js";
308
+ } from "./chunk-O6W3P7V3.js";
302
309
  import {
303
310
  THINKING_EFFORTS,
304
311
  isThinkingEffort,
@@ -796,6 +803,7 @@ async function runCloudConnect(opts) {
796
803
  export {
797
804
  BRIGHTSY_MCP_ALLOWED_TOOLS,
798
805
  BrightsySideboardApi,
806
+ CLAUDE_MODEL_CATALOG,
799
807
  CLOUD_COORDINATOR_BUSY_REPLY,
800
808
  CLOUD_COORDINATOR_STOPPED_REPLY,
801
809
  CLOUD_COORDINATOR_TIMEOUT_REPLY,
@@ -972,6 +980,7 @@ export {
972
980
  isOrchestratorThread,
973
981
  isPidAlive,
974
982
  isPlaceholderBranch,
983
+ isSessionQuotaLimit,
975
984
  isThinkingEffort,
976
985
  listAgentSetupInfo,
977
986
  listBranchCommits,
@@ -987,6 +996,7 @@ export {
987
996
  listIssues,
988
997
  listLinearIssues,
989
998
  listLinearIssuesDirect,
999
+ listModelsForAgent,
990
1000
  listOpencodeModels,
991
1001
  listPrs,
992
1002
  listRunScripts,
@@ -1018,6 +1028,8 @@ export {
1018
1028
  normalizeWorktreePath,
1019
1029
  openInSystemTerminal,
1020
1030
  opencodeAdapter,
1031
+ orchestrationQuotaFallbackAgent,
1032
+ orchestrationQuotaOnLimit,
1021
1033
  orchestrationTitleNeedsSoccerNickname,
1022
1034
  orchestratorSessionPoisonedByBuiltins,
1023
1035
  originGhRepoEnv,
@@ -1025,6 +1037,7 @@ export {
1025
1037
  parseForceStopMessage,
1026
1038
  parseGithubSlugFromRemoteUrl,
1027
1039
  parseMcpList,
1040
+ parseSessionQuotaResetAt,
1028
1041
  partsToAssistantText,
1029
1042
  pastedTextStats,
1030
1043
  permissionMode,
@@ -1051,6 +1064,7 @@ export {
1051
1064
  resolveFilesToCopy,
1052
1065
  resolveGithubRepoSlug,
1053
1066
  resolvePrSelector,
1067
+ resolveQuotaFallbackAgent,
1054
1068
  resolveRepoRoot,
1055
1069
  resolveThreadDefaults,
1056
1070
  resolveThreadEffort,