@sideboard-ai/core 0.1.199 → 0.1.200
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/{abletime-3CSCNAXU.js → abletime-345SE3B4.js} +2 -2
- package/dist/{abletime-H74RNIKV.js → abletime-KGPD3UUJ.js} +2 -2
- package/dist/{agents-BOYOK56K.js → agents-N7WXOGN6.js} +6 -4
- package/dist/{agents-AVH44CBS.js → agents-ZRIFDXCB.js} +6 -4
- package/dist/{app-settings-MMPLJHWF.js → app-settings-AXCURTZJ.js} +9 -1
- package/dist/{app-settings-FMTDH5RD.js → app-settings-V6IHESEQ.js} +9 -1
- package/dist/{chunk-DU2ICKLA.js → chunk-5XSDGJMP.js} +23 -9
- package/dist/{chunk-CTABTALL.js → chunk-62IMZIIZ.js} +58 -41
- package/dist/{chunk-CA7PWMQ7.js → chunk-7AHAABKN.js} +1 -1
- package/dist/{chunk-2IQ6W47G.js → chunk-CXFW5LIH.js} +40 -3
- package/dist/{chunk-S4EEYOSU.js → chunk-EWDE54OI.js} +2 -2
- package/dist/{chunk-HQKGK4KO.js → chunk-ISV5IFH3.js} +40 -3
- package/dist/{chunk-QFABSE3Q.js → chunk-NXM45OS3.js} +1 -1
- package/dist/{chunk-PPVN3APP.js → chunk-O2DRYD2B.js} +59 -42
- package/dist/{chunk-DU4ID3DA.js → chunk-OSPE25A7.js} +1 -1
- package/dist/{chunk-BLOKJY4U.js → chunk-PDMNYCPL.js} +2 -2
- package/dist/{chunk-PTAMHXBT.js → chunk-PGQGP4FD.js} +1 -1
- package/dist/{chunk-KI4YI72Y.js → chunk-PKUPOVKP.js} +23 -9
- package/dist/{coordinator-prompt-LB3GA3U4.js → coordinator-prompt-2RWBH6W7.js} +3 -3
- package/dist/{coordinator-prompt-ROWPLVQ3.js → coordinator-prompt-AL62H73U.js} +3 -3
- package/dist/{global-workspace-C5XKWCRH.js → global-workspace-VAO3BQP5.js} +3 -3
- package/dist/{global-workspace-V2A4YKZ6.js → global-workspace-Y5KKGXN7.js} +3 -3
- package/dist/index.cjs +113 -29
- package/dist/index.d.cts +42 -14
- package/dist/index.d.ts +42 -14
- package/dist/index.js +18 -8
- package/dist/mcp/run-stdio.cjs +87 -24
- package/dist/mcp/run-stdio.js +8 -8
- package/dist/{orchestrator-AJGDZEAS.js → orchestrator-D2EJ4Z7Z.js} +5 -5
- package/dist/{orchestrator-NCGYNVYN.js → orchestrator-DPHIMK44.js} +5 -5
- package/dist/{workspaces-GWEKIS3B.js → workspaces-DZZQM745.js} +3 -3
- package/dist/{workspaces-WIRJQ6HA.js → workspaces-HEKFQP4B.js} +3 -3
- package/dist/{worktree-UI5WJC3A.js → worktree-ENRMJUI3.js} +2 -2
- package/dist/{worktree-QA4J75FI.js → worktree-IEUSQ63V.js} +2 -2
- package/package.json +1 -1
|
@@ -352,6 +352,24 @@ function normalizeVault(raw) {
|
|
|
352
352
|
return out;
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
+
// src/store/usage-on-limit.ts
|
|
356
|
+
var USAGE_ON_LIMIT_VALUES = [
|
|
357
|
+
"keep_going",
|
|
358
|
+
"confirm",
|
|
359
|
+
"switch_agent",
|
|
360
|
+
"wait_reset"
|
|
361
|
+
];
|
|
362
|
+
function isUsageOnLimit(value) {
|
|
363
|
+
return value === "keep_going" || value === "confirm" || value === "switch_agent" || value === "wait_reset";
|
|
364
|
+
}
|
|
365
|
+
function resolveUsageOnLimit(advanced = {}) {
|
|
366
|
+
if (isUsageOnLimit(advanced.usageOnLimit)) return advanced.usageOnLimit;
|
|
367
|
+
if (advanced.confirmClaudeUsageOverLimit) return "confirm";
|
|
368
|
+
if (advanced.orchestrationQuotaOnLimit === "wait_reset") return "wait_reset";
|
|
369
|
+
if (advanced.orchestrationQuotaOnLimit === "switch_agent") return "switch_agent";
|
|
370
|
+
return "keep_going";
|
|
371
|
+
}
|
|
372
|
+
|
|
355
373
|
// src/store/issue-source-labels.ts
|
|
356
374
|
var ISSUE_SOURCE_LABELS = {
|
|
357
375
|
github: "GitHub",
|
|
@@ -753,6 +771,9 @@ function normalizeAdvanced(raw) {
|
|
|
753
771
|
if (typeof source.showCost === "boolean") {
|
|
754
772
|
out.showCost = source.showCost;
|
|
755
773
|
}
|
|
774
|
+
if (isUsageOnLimit(source.usageOnLimit)) {
|
|
775
|
+
out.usageOnLimit = source.usageOnLimit;
|
|
776
|
+
}
|
|
756
777
|
if (typeof source.confirmClaudeUsageOverLimit === "boolean") {
|
|
757
778
|
out.confirmClaudeUsageOverLimit = source.confirmClaudeUsageOverLimit;
|
|
758
779
|
}
|
|
@@ -1631,8 +1652,16 @@ function updateAdvancedSettings(patch) {
|
|
|
1631
1652
|
if (typeof patch.showCost === "boolean") {
|
|
1632
1653
|
advanced.showCost = patch.showCost;
|
|
1633
1654
|
}
|
|
1634
|
-
if (
|
|
1655
|
+
if (isUsageOnLimit(patch.usageOnLimit)) {
|
|
1656
|
+
advanced.usageOnLimit = patch.usageOnLimit;
|
|
1657
|
+
advanced.confirmClaudeUsageOverLimit = patch.usageOnLimit === "confirm";
|
|
1658
|
+
if (patch.usageOnLimit === "switch_agent" || patch.usageOnLimit === "wait_reset") {
|
|
1659
|
+
advanced.orchestrationQuotaOnLimit = patch.usageOnLimit;
|
|
1660
|
+
}
|
|
1661
|
+
} else if (typeof patch.confirmClaudeUsageOverLimit === "boolean") {
|
|
1635
1662
|
advanced.confirmClaudeUsageOverLimit = patch.confirmClaudeUsageOverLimit;
|
|
1663
|
+
if (patch.confirmClaudeUsageOverLimit) advanced.usageOnLimit = "confirm";
|
|
1664
|
+
else if (advanced.usageOnLimit === "confirm") advanced.usageOnLimit = "keep_going";
|
|
1636
1665
|
}
|
|
1637
1666
|
if (typeof patch.autoArchiveOnMerge === "boolean") {
|
|
1638
1667
|
advanced.autoArchiveOnMerge = patch.autoArchiveOnMerge;
|
|
@@ -1697,7 +1726,7 @@ function showCostEnabled(settings = loadAppSettings()) {
|
|
|
1697
1726
|
return Boolean(settings.advanced.showCost);
|
|
1698
1727
|
}
|
|
1699
1728
|
function confirmClaudeUsageOverLimitEnabled(settings = loadAppSettings()) {
|
|
1700
|
-
return
|
|
1729
|
+
return usageOnLimit(settings) === "confirm";
|
|
1701
1730
|
}
|
|
1702
1731
|
function autoArchiveOnMergeEnabled(settings = loadAppSettings()) {
|
|
1703
1732
|
return Boolean(settings.advanced.autoArchiveOnMerge);
|
|
@@ -1705,8 +1734,12 @@ function autoArchiveOnMergeEnabled(settings = loadAppSettings()) {
|
|
|
1705
1734
|
function autoCleanupOrphansEnabled(settings = loadAppSettings()) {
|
|
1706
1735
|
return Boolean(settings.advanced.autoCleanupOrphans);
|
|
1707
1736
|
}
|
|
1737
|
+
function usageOnLimit(settings = loadAppSettings()) {
|
|
1738
|
+
return resolveUsageOnLimit(settings.advanced);
|
|
1739
|
+
}
|
|
1708
1740
|
function orchestrationQuotaOnLimit(settings = loadAppSettings()) {
|
|
1709
|
-
|
|
1741
|
+
const action = usageOnLimit(settings);
|
|
1742
|
+
return action === "wait_reset" ? "wait_reset" : "switch_agent";
|
|
1710
1743
|
}
|
|
1711
1744
|
function orchestrationQuotaFallbackAgent(settings = loadAppSettings()) {
|
|
1712
1745
|
const preferred = settings.advanced.orchestrationQuotaFallbackAgent;
|
|
@@ -1834,6 +1867,9 @@ export {
|
|
|
1834
1867
|
writeSecureJson,
|
|
1835
1868
|
isSecureFileEncrypted,
|
|
1836
1869
|
secureFileUnlocksWith,
|
|
1870
|
+
USAGE_ON_LIMIT_VALUES,
|
|
1871
|
+
isUsageOnLimit,
|
|
1872
|
+
resolveUsageOnLimit,
|
|
1837
1873
|
ISSUE_SOURCE_LABELS,
|
|
1838
1874
|
issueSourceLabel,
|
|
1839
1875
|
HARNESS_ENV_KEYS,
|
|
@@ -1900,6 +1936,7 @@ export {
|
|
|
1900
1936
|
confirmClaudeUsageOverLimitEnabled,
|
|
1901
1937
|
autoArchiveOnMergeEnabled,
|
|
1902
1938
|
autoCleanupOrphansEnabled,
|
|
1939
|
+
usageOnLimit,
|
|
1903
1940
|
orchestrationQuotaOnLimit,
|
|
1904
1941
|
orchestrationQuotaFallbackAgent,
|
|
1905
1942
|
followUpBehavior,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
resolveRepoRoot,
|
|
8
8
|
takenSlugsFromThread,
|
|
9
9
|
teamSlugFromName
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NXM45OS3.js";
|
|
11
11
|
import {
|
|
12
12
|
ATTACHMENTS_DIR,
|
|
13
13
|
attachmentsGitignoreBody
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
resolveThreadDefaults,
|
|
31
31
|
resolveViewerProfile,
|
|
32
32
|
resolveViewerProfileForRepo
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-ISV5IFH3.js";
|
|
34
34
|
import {
|
|
35
35
|
appDataDir,
|
|
36
36
|
globalAgentCwd,
|
|
@@ -380,6 +380,24 @@ function normalizeVault(raw) {
|
|
|
380
380
|
return out;
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
+
// src/store/usage-on-limit.ts
|
|
384
|
+
var USAGE_ON_LIMIT_VALUES = [
|
|
385
|
+
"keep_going",
|
|
386
|
+
"confirm",
|
|
387
|
+
"switch_agent",
|
|
388
|
+
"wait_reset"
|
|
389
|
+
];
|
|
390
|
+
function isUsageOnLimit(value) {
|
|
391
|
+
return value === "keep_going" || value === "confirm" || value === "switch_agent" || value === "wait_reset";
|
|
392
|
+
}
|
|
393
|
+
function resolveUsageOnLimit(advanced = {}) {
|
|
394
|
+
if (isUsageOnLimit(advanced.usageOnLimit)) return advanced.usageOnLimit;
|
|
395
|
+
if (advanced.confirmClaudeUsageOverLimit) return "confirm";
|
|
396
|
+
if (advanced.orchestrationQuotaOnLimit === "wait_reset") return "wait_reset";
|
|
397
|
+
if (advanced.orchestrationQuotaOnLimit === "switch_agent") return "switch_agent";
|
|
398
|
+
return "keep_going";
|
|
399
|
+
}
|
|
400
|
+
|
|
383
401
|
// src/store/issue-source-labels.ts
|
|
384
402
|
var ISSUE_SOURCE_LABELS = {
|
|
385
403
|
github: "GitHub",
|
|
@@ -781,6 +799,9 @@ function normalizeAdvanced(raw) {
|
|
|
781
799
|
if (typeof source.showCost === "boolean") {
|
|
782
800
|
out.showCost = source.showCost;
|
|
783
801
|
}
|
|
802
|
+
if (isUsageOnLimit(source.usageOnLimit)) {
|
|
803
|
+
out.usageOnLimit = source.usageOnLimit;
|
|
804
|
+
}
|
|
784
805
|
if (typeof source.confirmClaudeUsageOverLimit === "boolean") {
|
|
785
806
|
out.confirmClaudeUsageOverLimit = source.confirmClaudeUsageOverLimit;
|
|
786
807
|
}
|
|
@@ -1659,8 +1680,16 @@ function updateAdvancedSettings(patch) {
|
|
|
1659
1680
|
if (typeof patch.showCost === "boolean") {
|
|
1660
1681
|
advanced.showCost = patch.showCost;
|
|
1661
1682
|
}
|
|
1662
|
-
if (
|
|
1683
|
+
if (isUsageOnLimit(patch.usageOnLimit)) {
|
|
1684
|
+
advanced.usageOnLimit = patch.usageOnLimit;
|
|
1685
|
+
advanced.confirmClaudeUsageOverLimit = patch.usageOnLimit === "confirm";
|
|
1686
|
+
if (patch.usageOnLimit === "switch_agent" || patch.usageOnLimit === "wait_reset") {
|
|
1687
|
+
advanced.orchestrationQuotaOnLimit = patch.usageOnLimit;
|
|
1688
|
+
}
|
|
1689
|
+
} else if (typeof patch.confirmClaudeUsageOverLimit === "boolean") {
|
|
1663
1690
|
advanced.confirmClaudeUsageOverLimit = patch.confirmClaudeUsageOverLimit;
|
|
1691
|
+
if (patch.confirmClaudeUsageOverLimit) advanced.usageOnLimit = "confirm";
|
|
1692
|
+
else if (advanced.usageOnLimit === "confirm") advanced.usageOnLimit = "keep_going";
|
|
1664
1693
|
}
|
|
1665
1694
|
if (typeof patch.autoArchiveOnMerge === "boolean") {
|
|
1666
1695
|
advanced.autoArchiveOnMerge = patch.autoArchiveOnMerge;
|
|
@@ -1725,7 +1754,7 @@ function showCostEnabled(settings = loadAppSettings()) {
|
|
|
1725
1754
|
return Boolean(settings.advanced.showCost);
|
|
1726
1755
|
}
|
|
1727
1756
|
function confirmClaudeUsageOverLimitEnabled(settings = loadAppSettings()) {
|
|
1728
|
-
return
|
|
1757
|
+
return usageOnLimit(settings) === "confirm";
|
|
1729
1758
|
}
|
|
1730
1759
|
function autoArchiveOnMergeEnabled(settings = loadAppSettings()) {
|
|
1731
1760
|
return Boolean(settings.advanced.autoArchiveOnMerge);
|
|
@@ -1733,8 +1762,12 @@ function autoArchiveOnMergeEnabled(settings = loadAppSettings()) {
|
|
|
1733
1762
|
function autoCleanupOrphansEnabled(settings = loadAppSettings()) {
|
|
1734
1763
|
return Boolean(settings.advanced.autoCleanupOrphans);
|
|
1735
1764
|
}
|
|
1765
|
+
function usageOnLimit(settings = loadAppSettings()) {
|
|
1766
|
+
return resolveUsageOnLimit(settings.advanced);
|
|
1767
|
+
}
|
|
1736
1768
|
function orchestrationQuotaOnLimit(settings = loadAppSettings()) {
|
|
1737
|
-
|
|
1769
|
+
const action = usageOnLimit(settings);
|
|
1770
|
+
return action === "wait_reset" ? "wait_reset" : "switch_agent";
|
|
1738
1771
|
}
|
|
1739
1772
|
function orchestrationQuotaFallbackAgent(settings = loadAppSettings()) {
|
|
1740
1773
|
const preferred = settings.advanced.orchestrationQuotaFallbackAgent;
|
|
@@ -1863,6 +1896,9 @@ export {
|
|
|
1863
1896
|
formatWorkspaceProfileSuffix,
|
|
1864
1897
|
formatViewerContextDirective,
|
|
1865
1898
|
formatViewerContextReminder,
|
|
1899
|
+
USAGE_ON_LIMIT_VALUES,
|
|
1900
|
+
isUsageOnLimit,
|
|
1901
|
+
resolveUsageOnLimit,
|
|
1866
1902
|
ISSUE_SOURCE_LABELS,
|
|
1867
1903
|
issueSourceLabel,
|
|
1868
1904
|
HARNESS_ENV_KEYS,
|
|
@@ -1929,6 +1965,7 @@ export {
|
|
|
1929
1965
|
confirmClaudeUsageOverLimitEnabled,
|
|
1930
1966
|
autoArchiveOnMergeEnabled,
|
|
1931
1967
|
autoCleanupOrphansEnabled,
|
|
1968
|
+
usageOnLimit,
|
|
1932
1969
|
orchestrationQuotaOnLimit,
|
|
1933
1970
|
orchestrationQuotaFallbackAgent,
|
|
1934
1971
|
followUpBehavior,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
stripBrightsyNdjsonNoise,
|
|
26
26
|
sumUsageList,
|
|
27
27
|
toolDescription
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-PKUPOVKP.js";
|
|
29
29
|
import {
|
|
30
30
|
SLACK_REPLY_FORMATTING,
|
|
31
31
|
addWorkspace,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
stageAbsolutePathsAsAttachments,
|
|
49
49
|
stageBuffersAsAttachments,
|
|
50
50
|
syncWorkspacesFromThreads
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-PDMNYCPL.js";
|
|
52
52
|
import {
|
|
53
53
|
addPrStackLayer,
|
|
54
54
|
allocateTeamName,
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
worktreeDisplayLabelForGroup,
|
|
99
99
|
worktreeNameFromPath,
|
|
100
100
|
worktreeSlugForTicket
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-OSPE25A7.js";
|
|
102
102
|
import {
|
|
103
103
|
ATTACHMENTS_DIR,
|
|
104
104
|
DETACHED_JOBS_DIR,
|
|
@@ -144,7 +144,6 @@ import {
|
|
|
144
144
|
isSecureFileEncrypted,
|
|
145
145
|
loadAppSettings,
|
|
146
146
|
orchestrationQuotaFallbackAgent,
|
|
147
|
-
orchestrationQuotaOnLimit,
|
|
148
147
|
readSecureJson,
|
|
149
148
|
resolveEffectiveIssueSource,
|
|
150
149
|
resolveNewThreadOptions,
|
|
@@ -153,8 +152,9 @@ import {
|
|
|
153
152
|
resolveViewerProfileForRepo,
|
|
154
153
|
saveAppSettings,
|
|
155
154
|
updateAdvancedSettings,
|
|
155
|
+
usageOnLimit,
|
|
156
156
|
writeSecureJson
|
|
157
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-CXFW5LIH.js";
|
|
158
158
|
import {
|
|
159
159
|
stripNestedElectronEnv
|
|
160
160
|
} from "./chunk-4TR3HZFT.js";
|
|
@@ -473,7 +473,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
473
473
|
await continueOnReply(threadId, prompt);
|
|
474
474
|
return;
|
|
475
475
|
}
|
|
476
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
476
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-DPHIMK44.js");
|
|
477
477
|
await getOrchestrator2().send(threadId, prompt);
|
|
478
478
|
} catch {
|
|
479
479
|
}
|
|
@@ -807,9 +807,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
807
807
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
808
808
|
);
|
|
809
809
|
}
|
|
810
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
810
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-Y5KKGXN7.js");
|
|
811
811
|
if (isGlobalThread2(thread)) {
|
|
812
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
812
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-2RWBH6W7.js");
|
|
813
813
|
ensureGlobalCoordinatorCwd2(
|
|
814
814
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
815
815
|
);
|
|
@@ -3728,7 +3728,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3728
3728
|
});
|
|
3729
3729
|
await requireAgent(resolved.agent);
|
|
3730
3730
|
if (input.cowboy) {
|
|
3731
|
-
const { cowboyModeEnabled } = await import("./app-settings-
|
|
3731
|
+
const { cowboyModeEnabled } = await import("./app-settings-AXCURTZJ.js");
|
|
3732
3732
|
if (!cowboyModeEnabled()) {
|
|
3733
3733
|
throw new Error(
|
|
3734
3734
|
"Cowboy mode is off. Enable it in Settings \u2192 Advanced."
|
|
@@ -3786,7 +3786,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3786
3786
|
let sourceIsFork = false;
|
|
3787
3787
|
if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
|
|
3788
3788
|
if (isAbleTimeConnected() && getIssueSource() === "abletime") {
|
|
3789
|
-
const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-
|
|
3789
|
+
const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-345SE3B4.js");
|
|
3790
3790
|
const task = await ensureAbleTimeTask({
|
|
3791
3791
|
title: title?.trim() || "Untitled work",
|
|
3792
3792
|
description: input.prompt?.trim() || void 0
|
|
@@ -3888,7 +3888,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3888
3888
|
return readThread(thread.id) ?? thread;
|
|
3889
3889
|
}
|
|
3890
3890
|
async function listLinearIssues(agent, repoPath) {
|
|
3891
|
-
const { getAdapter: getAdapter2 } = await import("./agents-
|
|
3891
|
+
const { getAdapter: getAdapter2 } = await import("./agents-ZRIFDXCB.js");
|
|
3892
3892
|
await requireAgent(agent, { requireLinear: true });
|
|
3893
3893
|
const adapter = getAdapter2(agent);
|
|
3894
3894
|
if (!adapter.listLinearIssues) {
|
|
@@ -4110,12 +4110,18 @@ async function forkThreadWorktree(input, onSetupLine) {
|
|
|
4110
4110
|
// src/orchestrator/quota-failover.ts
|
|
4111
4111
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
4112
4112
|
function planOrchestrationQuotaFailover(thread, limitText, opts) {
|
|
4113
|
-
if (!isOrchestratorThread(thread)) return null;
|
|
4114
4113
|
if (!isSessionQuotaLimit(limitText)) return null;
|
|
4115
|
-
const onLimit = opts?.onLimit ??
|
|
4114
|
+
const onLimit = opts?.onLimit ?? usageOnLimit();
|
|
4116
4115
|
const resumeAt = parseSessionQuotaResetAt(limitText, opts?.now);
|
|
4116
|
+
if (onLimit === "keep_going" || onLimit === "confirm") {
|
|
4117
|
+
return {
|
|
4118
|
+
action: "none",
|
|
4119
|
+
reason: onLimit === "confirm" ? "Settings: confirm with user; no automatic continue." : "Settings: keep going; no automatic continue.",
|
|
4120
|
+
limitText
|
|
4121
|
+
};
|
|
4122
|
+
}
|
|
4117
4123
|
if (thread.quotaContinuedFromId) {
|
|
4118
|
-
if (resumeAt) {
|
|
4124
|
+
if (onLimit === "switch_agent" && resumeAt) {
|
|
4119
4125
|
return {
|
|
4120
4126
|
action: "wait_reset",
|
|
4121
4127
|
reason: "Already continued once; waiting for quota reset instead.",
|
|
@@ -4125,7 +4131,7 @@ function planOrchestrationQuotaFailover(thread, limitText, opts) {
|
|
|
4125
4131
|
}
|
|
4126
4132
|
return {
|
|
4127
4133
|
action: "none",
|
|
4128
|
-
reason: "Already continued once; no
|
|
4134
|
+
reason: "Already continued once; no further automatic continue.",
|
|
4129
4135
|
limitText
|
|
4130
4136
|
};
|
|
4131
4137
|
}
|
|
@@ -4162,8 +4168,19 @@ function buildQuotaHandoffAttachment(from, limitText, fallbackAgent) {
|
|
|
4162
4168
|
const text = m.text.trim().replace(/\s+/g, " ").slice(0, 280);
|
|
4163
4169
|
return text ? `- ${role}: ${text}` : null;
|
|
4164
4170
|
}).filter(Boolean);
|
|
4171
|
+
const orch = isOrchestratorThread(from);
|
|
4172
|
+
const instructions = orch ? [
|
|
4173
|
+
"- Continue fleet orchestration from this handoff.",
|
|
4174
|
+
"- Prefer Sideboard MCP (list_board, list_threads, get_thread, send_to_thread, \u2026) for live status.",
|
|
4175
|
+
"- Leave model Auto unless there is a specific reason to pin one.",
|
|
4176
|
+
`- Do not wait on the limited ${from.agent} account; keep going on ${fallbackAgent}.`
|
|
4177
|
+
] : [
|
|
4178
|
+
"- Continue this worktree chat from the handoff.",
|
|
4179
|
+
"- Leave model Auto unless there is a specific reason to pin one.",
|
|
4180
|
+
`- Do not wait on the limited ${from.agent} account; keep going on ${fallbackAgent}.`
|
|
4181
|
+
];
|
|
4165
4182
|
const body = [
|
|
4166
|
-
`# Orchestration handoff`,
|
|
4183
|
+
`# ${orch ? "Orchestration" : "Chat"} handoff`,
|
|
4167
4184
|
"",
|
|
4168
4185
|
`Previous chat: ${from.title} (\`${from.id}\`) on **${from.agent}** hit a session/usage limit.`,
|
|
4169
4186
|
`Limit: ${limitText.trim()}`,
|
|
@@ -4179,23 +4196,20 @@ function buildQuotaHandoffAttachment(from, limitText, fallbackAgent) {
|
|
|
4179
4196
|
recent.length ? recent.join("\n") : "(none)",
|
|
4180
4197
|
"",
|
|
4181
4198
|
`## Instructions`,
|
|
4182
|
-
|
|
4183
|
-
`- Prefer Sideboard MCP (list_board, list_threads, get_thread, send_to_thread, \u2026) for live status.`,
|
|
4184
|
-
`- Leave model Auto unless there is a specific reason to pin one.`,
|
|
4185
|
-
`- Do not wait on the limited ${from.agent} account; keep going on ${fallbackAgent}.`
|
|
4199
|
+
...instructions
|
|
4186
4200
|
].join("\n");
|
|
4187
4201
|
return {
|
|
4188
4202
|
id: randomUUID3(),
|
|
4189
|
-
name: "Orchestration quota handoff.md",
|
|
4203
|
+
name: orch ? "Orchestration quota handoff.md" : "Quota handoff.md",
|
|
4190
4204
|
kind: "transcript",
|
|
4191
4205
|
content: body
|
|
4192
4206
|
};
|
|
4193
4207
|
}
|
|
4194
4208
|
var QUOTA_CONTINUE_PROMPT = (fromAgent, fallback) => [
|
|
4195
|
-
`${fromAgent} hit a session/usage limit. Continue this
|
|
4196
|
-
"
|
|
4209
|
+
`${fromAgent} hit a session/usage limit. Continue this chat on ${fallback} using the attached handoff.`,
|
|
4210
|
+
"Proceed with the goal. Leave model Auto unless needed."
|
|
4197
4211
|
].join(" ");
|
|
4198
|
-
var QUOTA_RESUME_PROMPT = "Session/usage limit window should have reset. Continue
|
|
4212
|
+
var QUOTA_RESUME_PROMPT = "Session/usage limit window should have reset. Continue this chat from where you left off.";
|
|
4199
4213
|
function createQuotaFailoverChat(from, fallbackAgent, limitText) {
|
|
4200
4214
|
const handoff = buildQuotaHandoffAttachment(from, limitText, fallbackAgent);
|
|
4201
4215
|
const tab = createChatTab({
|
|
@@ -4204,12 +4218,15 @@ function createQuotaFailoverChat(from, fallbackAgent, limitText) {
|
|
|
4204
4218
|
model: null,
|
|
4205
4219
|
attachments: [handoff]
|
|
4206
4220
|
});
|
|
4207
|
-
|
|
4208
|
-
parentThreadId: from.id,
|
|
4221
|
+
const patch = {
|
|
4209
4222
|
quotaContinuedFromId: from.id,
|
|
4210
|
-
sourceRef: from.sourceRef
|
|
4211
|
-
|
|
4212
|
-
|
|
4223
|
+
sourceRef: from.sourceRef
|
|
4224
|
+
};
|
|
4225
|
+
if (isOrchestratorThread(from)) {
|
|
4226
|
+
patch.parentThreadId = from.id;
|
|
4227
|
+
patch.sourceType = "orchestration";
|
|
4228
|
+
}
|
|
4229
|
+
return updateThread(tab.id, patch);
|
|
4213
4230
|
}
|
|
4214
4231
|
|
|
4215
4232
|
// src/threads/adopt.ts
|
|
@@ -4310,7 +4327,7 @@ async function adoptThread(input) {
|
|
|
4310
4327
|
messages: input.messages ?? []
|
|
4311
4328
|
});
|
|
4312
4329
|
writeThread(thread);
|
|
4313
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
4330
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-DZZQM745.js");
|
|
4314
4331
|
await ensureWorkspace2(repoPath);
|
|
4315
4332
|
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-X54WSOXM.js");
|
|
4316
4333
|
await ensureWorktreeSideboardIgnored2(input.worktreePath);
|
|
@@ -6894,7 +6911,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
6894
6911
|
${prompt}`;
|
|
6895
6912
|
}
|
|
6896
6913
|
async function defaultDeps() {
|
|
6897
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
6914
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-DPHIMK44.js");
|
|
6898
6915
|
const orch = getOrchestrator2();
|
|
6899
6916
|
return {
|
|
6900
6917
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -7169,7 +7186,7 @@ var Orchestrator = class {
|
|
|
7169
7186
|
orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
|
|
7170
7187
|
});
|
|
7171
7188
|
}
|
|
7172
|
-
const { autoCleanupOrphansEnabled } = await import("./app-settings-
|
|
7189
|
+
const { autoCleanupOrphansEnabled } = await import("./app-settings-AXCURTZJ.js");
|
|
7173
7190
|
if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
|
|
7174
7191
|
await cleanupOrphanWorktrees({ repoPaths });
|
|
7175
7192
|
}
|
|
@@ -7280,8 +7297,8 @@ var Orchestrator = class {
|
|
|
7280
7297
|
await this.send(threadId, QUOTA_RESUME_PROMPT);
|
|
7281
7298
|
}
|
|
7282
7299
|
/**
|
|
7283
|
-
* Host-side continue when
|
|
7284
|
-
*
|
|
7300
|
+
* Host-side continue when any chat hits a provider session/usage limit
|
|
7301
|
+
* (not context size): switch agent (Auto) or wait until reset.
|
|
7285
7302
|
*/
|
|
7286
7303
|
async maybeHandleOrchestrationQuotaFailover(threadId, limitText) {
|
|
7287
7304
|
const thread = findThreadByRef(threadId);
|
|
@@ -7294,7 +7311,7 @@ var Orchestrator = class {
|
|
|
7294
7311
|
setStatus(threadId, "idle", null);
|
|
7295
7312
|
appendMessage(threadId, {
|
|
7296
7313
|
role: "agent",
|
|
7297
|
-
text: `Sideboard will auto-retry this
|
|
7314
|
+
text: `Sideboard will auto-retry this chat around ${plan.resumeAt.toLocaleString()} when the session limit resets.`,
|
|
7298
7315
|
ts: (/* @__PURE__ */ new Date()).toISOString()
|
|
7299
7316
|
});
|
|
7300
7317
|
this.emit({
|
|
@@ -7448,7 +7465,7 @@ var Orchestrator = class {
|
|
|
7448
7465
|
}
|
|
7449
7466
|
await setup;
|
|
7450
7467
|
if (skipSetup) return;
|
|
7451
|
-
const { autoRunAfterSetupEnabled } = await import("./app-settings-
|
|
7468
|
+
const { autoRunAfterSetupEnabled } = await import("./app-settings-AXCURTZJ.js");
|
|
7452
7469
|
if (autoRunAfterSetupEnabled()) {
|
|
7453
7470
|
try {
|
|
7454
7471
|
await this.startDev(threadId);
|
|
@@ -7772,7 +7789,7 @@ var Orchestrator = class {
|
|
|
7772
7789
|
}
|
|
7773
7790
|
const isBrightsy = fresh.agent === "brightsy";
|
|
7774
7791
|
const isOrchestration = isOrchestratorThread(fresh);
|
|
7775
|
-
const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-
|
|
7792
|
+
const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-AXCURTZJ.js");
|
|
7776
7793
|
const gitAuthMode = getGithubGitAuthMode();
|
|
7777
7794
|
const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
|
|
7778
7795
|
githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
|
|
@@ -8757,7 +8774,7 @@ var Orchestrator = class {
|
|
|
8757
8774
|
updateThread(thread.id, { title: meta.title });
|
|
8758
8775
|
}
|
|
8759
8776
|
}
|
|
8760
|
-
const { autoArchiveOnMergeEnabled } = await import("./app-settings-
|
|
8777
|
+
const { autoArchiveOnMergeEnabled } = await import("./app-settings-AXCURTZJ.js");
|
|
8761
8778
|
const latest = this.requireThread(thread.id);
|
|
8762
8779
|
if (!shouldAutoArchiveOnPrMerge({
|
|
8763
8780
|
previousPrState: prevState || null,
|
|
@@ -9049,7 +9066,7 @@ var Orchestrator = class {
|
|
|
9049
9066
|
this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
|
|
9050
9067
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
9051
9068
|
try {
|
|
9052
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
9069
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-DZZQM745.js");
|
|
9053
9070
|
await ensureWorkspace2(thread.repoPath);
|
|
9054
9071
|
} catch {
|
|
9055
9072
|
}
|
|
@@ -9076,7 +9093,7 @@ var Orchestrator = class {
|
|
|
9076
9093
|
await runArchiveScript(thread.repoPath, thread.worktreePath);
|
|
9077
9094
|
} catch {
|
|
9078
9095
|
}
|
|
9079
|
-
const { deleteBranchOnPurgeEnabled } = await import("./app-settings-
|
|
9096
|
+
const { deleteBranchOnPurgeEnabled } = await import("./app-settings-AXCURTZJ.js");
|
|
9080
9097
|
const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
|
|
9081
9098
|
await removeWorktree(thread.repoPath, thread.worktreePath, {
|
|
9082
9099
|
deleteBranch: deleteBranch ? thread.branchName : void 0
|
|
@@ -9103,7 +9120,7 @@ var Orchestrator = class {
|
|
|
9103
9120
|
`Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
|
|
9104
9121
|
);
|
|
9105
9122
|
}
|
|
9106
|
-
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-
|
|
9123
|
+
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-IEUSQ63V.js");
|
|
9107
9124
|
const slug = thread.worktreePath.split("/").pop();
|
|
9108
9125
|
const dest = thread.worktreePath;
|
|
9109
9126
|
await withRepoGitLock(thread.repoPath, async () => {
|
|
@@ -9213,7 +9230,7 @@ async function startOrchestration(opts) {
|
|
|
9213
9230
|
sourceRef: "default",
|
|
9214
9231
|
...createOpts
|
|
9215
9232
|
}).catch(async () => {
|
|
9216
|
-
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-
|
|
9233
|
+
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-IEUSQ63V.js");
|
|
9217
9234
|
const repo = await resolveRepoRoot2(repoPath);
|
|
9218
9235
|
const def = await resolveDefaultBranch2(repo);
|
|
9219
9236
|
return orch.createThread({
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
resolveRepoRoot,
|
|
6
6
|
takenSlugsFromThread,
|
|
7
7
|
teamSlugFromName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OSPE25A7.js";
|
|
9
9
|
import {
|
|
10
10
|
ATTACHMENTS_DIR,
|
|
11
11
|
attachmentsGitignoreBody
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveThreadDefaults,
|
|
23
23
|
resolveViewerProfile,
|
|
24
24
|
resolveViewerProfileForRepo
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-CXFW5LIH.js";
|
|
26
26
|
import {
|
|
27
27
|
createEmptyThread,
|
|
28
28
|
listThreads,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isOrchestratorThread
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PDMNYCPL.js";
|
|
4
4
|
import {
|
|
5
5
|
codexUnattendedGitConfigArgs,
|
|
6
6
|
mergeAgentGitAuthEnv,
|
|
7
7
|
resolveAgentGitAuthEnv,
|
|
8
8
|
resolveCodexGitWritableRoots
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OSPE25A7.js";
|
|
10
10
|
import {
|
|
11
11
|
applyConnectedTeamToCli,
|
|
12
12
|
brightsyMcpServerName,
|
|
@@ -16,6 +16,9 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
loadBrightsyConfig
|
|
18
18
|
} from "./chunk-AN3THU7F.js";
|
|
19
|
+
import {
|
|
20
|
+
httpFetch
|
|
21
|
+
} from "./chunk-N7WZ6NIN.js";
|
|
19
22
|
import {
|
|
20
23
|
applyAgentRunnerHeapEnv,
|
|
21
24
|
applyNodeLaunch,
|
|
@@ -38,7 +41,7 @@ import {
|
|
|
38
41
|
loadAppSettings,
|
|
39
42
|
resolveAgentExecutable,
|
|
40
43
|
resolveClaudeExecutable
|
|
41
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-CXFW5LIH.js";
|
|
42
45
|
import {
|
|
43
46
|
isElectronLikeCommand,
|
|
44
47
|
unwrapStrippedElectronLaunch
|
|
@@ -1934,7 +1937,7 @@ var claudeAdapter = {
|
|
|
1934
1937
|
);
|
|
1935
1938
|
}
|
|
1936
1939
|
const mode = permissionMode(thread);
|
|
1937
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
1940
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-Y5KKGXN7.js");
|
|
1938
1941
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
1939
1942
|
const injectedServers = await buildInjectedMcpServers({
|
|
1940
1943
|
includeSideboard: true,
|
|
@@ -3622,16 +3625,26 @@ function claudeUsageOverLimitWindows(usage) {
|
|
|
3622
3625
|
if (!usage) return [];
|
|
3623
3626
|
return usage.windows.filter(claudeUsageWindowOverLimit);
|
|
3624
3627
|
}
|
|
3625
|
-
function
|
|
3626
|
-
if (windows.length === 0) return "";
|
|
3628
|
+
function formatOverLimitWindowList(windows, now) {
|
|
3627
3629
|
const parts = windows.map((w) => {
|
|
3628
3630
|
const reset = formatClaudeUsageReset(w.resetsAt, now);
|
|
3629
3631
|
return reset ? `${w.label} (${reset})` : w.label;
|
|
3630
3632
|
});
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
+
return {
|
|
3634
|
+
list: parts.join(", "),
|
|
3635
|
+
verb: windows.length === 1 ? "is" : "are"
|
|
3636
|
+
};
|
|
3637
|
+
}
|
|
3638
|
+
function formatClaudeUsageOverLimitConfirm(windows, now = /* @__PURE__ */ new Date()) {
|
|
3639
|
+
if (windows.length === 0) return "";
|
|
3640
|
+
const { list, verb } = formatOverLimitWindowList(windows, now);
|
|
3633
3641
|
return `Claude Code ${list} ${verb} at or over the plan limit. Send this message anyway?`;
|
|
3634
3642
|
}
|
|
3643
|
+
function formatClaudeUsageOverLimitWait(windows, now = /* @__PURE__ */ new Date()) {
|
|
3644
|
+
if (windows.length === 0) return "";
|
|
3645
|
+
const { list, verb } = formatOverLimitWindowList(windows, now);
|
|
3646
|
+
return `Claude Code ${list} ${verb} at or over the plan limit. Sending is paused until the window resets.`;
|
|
3647
|
+
}
|
|
3635
3648
|
|
|
3636
3649
|
// src/agents/claude-usage-client.ts
|
|
3637
3650
|
import { existsSync as existsSync9, readFileSync as readFileSync4 } from "fs";
|
|
@@ -3728,7 +3741,7 @@ async function getClaudePlanUsage(opts = {}) {
|
|
|
3728
3741
|
cache = { at: now, value: null };
|
|
3729
3742
|
return null;
|
|
3730
3743
|
}
|
|
3731
|
-
const fetchFn = opts.fetch ??
|
|
3744
|
+
const fetchFn = opts.fetch ?? httpFetch;
|
|
3732
3745
|
const userAgent = opts.userAgent ?? await resolveClaudeUserAgent();
|
|
3733
3746
|
const ac = new AbortController();
|
|
3734
3747
|
const timer = setTimeout(() => ac.abort(), 8e3);
|
|
@@ -4108,6 +4121,7 @@ export {
|
|
|
4108
4121
|
formatClaudeUsageCompact,
|
|
4109
4122
|
claudeUsageOverLimitWindows,
|
|
4110
4123
|
formatClaudeUsageOverLimitConfirm,
|
|
4124
|
+
formatClaudeUsageOverLimitWait,
|
|
4111
4125
|
getClaudePlanUsage,
|
|
4112
4126
|
getAgentSetupInfo,
|
|
4113
4127
|
listAgentSetupInfo,
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
enrichWorkspacesWithGithub,
|
|
8
8
|
ensureGlobalCoordinatorCwd,
|
|
9
9
|
formatWorkspaceInventory
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-PDMNYCPL.js";
|
|
11
|
+
import "./chunk-OSPE25A7.js";
|
|
12
12
|
import "./chunk-6K64FJDD.js";
|
|
13
13
|
import "./chunk-QQKDGPUI.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-CXFW5LIH.js";
|
|
15
15
|
import "./chunk-4TR3HZFT.js";
|
|
16
16
|
import "./chunk-WDRMZKVB.js";
|
|
17
17
|
import "./chunk-JT7R45JB.js";
|