@sideboard-ai/core 0.1.325 → 0.1.326
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-VL234MCP.js → abletime-RDHYSZL2.js} +4 -4
- package/dist/{abletime-M7STTMZT.js → abletime-RYYFGKMU.js} +4 -4
- package/dist/{abletime-oauth-LMMGMAPA.js → abletime-oauth-OYGS2DAU.js} +3 -3
- package/dist/{abletime-oauth-P4ZFBEAL.js → abletime-oauth-QR2QDVMK.js} +3 -3
- package/dist/{abletime-rest-GOI7HELR.js → abletime-rest-BKYKNPTC.js} +3 -3
- package/dist/{abletime-rest-DLV7EIWS.js → abletime-rest-QDPTWNS4.js} +3 -3
- package/dist/agents/cursor-runner.cjs +1 -1
- package/dist/agents/cursor-runner.js +1 -1
- package/dist/{agents-LDRM3BTY.js → agents-HANWZNI6.js} +6 -6
- package/dist/{agents-MBIEAETM.js → agents-QO7GKBYT.js} +7 -7
- package/dist/{app-settings-UQHUNOLV.js → app-settings-RXBH7KY4.js} +1 -1
- package/dist/{app-settings-E7DMMEKC.js → app-settings-TUVLZNDE.js} +1 -1
- package/dist/{chunk-GNLKBS3U.js → chunk-2EOLWHXH.js} +18 -18
- package/dist/{chunk-BOFYI6LC.js → chunk-3Q4XNYHY.js} +1 -1
- package/dist/{chunk-WYEST76H.js → chunk-46FECFZU.js} +15 -12
- package/dist/{chunk-SK6NYGPD.js → chunk-4H5MWZ6J.js} +2 -2
- package/dist/{chunk-EO6ZFLG6.js → chunk-75RPUXJS.js} +1 -1
- package/dist/{chunk-2UP3XD2D.js → chunk-B244TJWC.js} +2 -2
- package/dist/{chunk-MFMDZAA6.js → chunk-BBNWKL4I.js} +15 -11
- package/dist/{chunk-ZEUMWHOH.js → chunk-C7HUCBX7.js} +5 -5
- package/dist/{chunk-CI4M54LS.js → chunk-D744HOI5.js} +3 -1
- package/dist/{chunk-APKUI4BP.js → chunk-FWVUGLBG.js} +2 -2
- package/dist/{chunk-SACHHTBJ.js → chunk-GP3RLZ6A.js} +20 -20
- package/dist/{chunk-AQEKPJWU.js → chunk-JM2TGOHP.js} +5 -5
- package/dist/{chunk-A76MKMSF.js → chunk-K7M7MIWL.js} +3 -3
- package/dist/{chunk-BTF3ATST.js → chunk-KECHK3ZT.js} +1 -1
- package/dist/{chunk-H36GKGU2.js → chunk-KXRF6RNL.js} +2 -2
- package/dist/{chunk-EZR6W4B3.js → chunk-LRHUBGEM.js} +1 -1
- package/dist/{chunk-F65JMKUR.js → chunk-MAW7DIG7.js} +2 -2
- package/dist/{chunk-U5WO6MEB.js → chunk-NURZOXGN.js} +1 -1
- package/dist/{chunk-NWGINMEA.js → chunk-PB6HW7SA.js} +3 -3
- package/dist/{chunk-HG6KS7OT.js → chunk-QG4CYRA3.js} +15 -11
- package/dist/{chunk-RZJTGBXY.js → chunk-QPSKQP6E.js} +2 -1
- package/dist/{chunk-SS6CYGLF.js → chunk-RZVOX2MT.js} +3 -3
- package/dist/{chunk-7LUOLYFM.js → chunk-SO7G6O24.js} +1 -1
- package/dist/{chunk-PPTJMBUY.js → chunk-TMCK5TLA.js} +1 -1
- package/dist/{chunk-MBT6WDAB.js → chunk-WUCAVIIP.js} +1 -1
- package/dist/{chunk-7G27TB4M.js → chunk-XLVLMQKN.js} +11 -7
- package/dist/{chunk-ZHDXLDLA.js → chunk-YGVGXQA7.js} +2 -2
- package/dist/{chunk-VAFQS4D2.js → chunk-YWQF7WAG.js} +2 -2
- package/dist/{chunk-SQQBU7Z6.js → chunk-ZUAYA57W.js} +2 -2
- package/dist/{conductor-KB7L7NQN.js → conductor-4GVTHUUB.js} +4 -4
- package/dist/{conductor-D4KFZF54.js → conductor-TGWI6ETZ.js} +4 -4
- package/dist/{coordinator-prompt-OBXEC63K.js → coordinator-prompt-3E6SIDTM.js} +3 -3
- package/dist/{coordinator-prompt-SUO4FRY3.js → coordinator-prompt-WEYJREV6.js} +3 -3
- package/dist/{global-workspace-UHU2FXTY.js → global-workspace-FPDZKUPF.js} +3 -3
- package/dist/{global-workspace-Z2SURNHA.js → global-workspace-UIEXAG2B.js} +3 -3
- package/dist/index.cjs +20 -14
- package/dist/index.d.cts +11 -8
- package/dist/index.d.ts +11 -8
- package/dist/index.js +21 -21
- package/dist/{linear-SIHEBU3X.js → linear-6S7MK5YK.js} +2 -2
- package/dist/{linear-HFUOUJ5H.js → linear-Z2T4KUAQ.js} +2 -2
- package/dist/{linear-list-63I7QUC6.js → linear-list-A37WLUBO.js} +1 -1
- package/dist/{linear-list-JFV3EES6.js → linear-list-Q4M7AZO2.js} +1 -1
- package/dist/mcp/run-stdio.cjs +15 -8
- package/dist/mcp/run-stdio.js +15 -15
- package/dist/{optional-cli-U2GUA2X6.js → optional-cli-AANBL4U5.js} +3 -3
- package/dist/{optional-cli-ULDP3O5S.js → optional-cli-CA4LL322.js} +4 -4
- package/dist/{orchestrator-3H4KNGPN.js → orchestrator-7FVDBE7Y.js} +10 -10
- package/dist/{orchestrator-6ROMEWBP.js → orchestrator-RQXRZW7Z.js} +9 -9
- package/dist/{workspaces-MG5JHRKW.js → workspaces-LEW4UP56.js} +3 -3
- package/dist/{workspaces-QJNKEGEM.js → workspaces-QONNLHNR.js} +3 -3
- package/dist/{worktree-KSJPTHGZ.js → worktree-6GIONDQO.js} +2 -2
- package/dist/{worktree-MYJYUHZM.js → worktree-KFEJAQ2H.js} +2 -2
- package/package.json +1 -1
|
@@ -32,10 +32,10 @@ import {
|
|
|
32
32
|
tryReservePort,
|
|
33
33
|
tryReservePorts,
|
|
34
34
|
worktreeRunPortsPath
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-46FECFZU.js";
|
|
36
36
|
import "./chunk-OOXRMTU6.js";
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-FWVUGLBG.js";
|
|
38
|
+
import "./chunk-KECHK3ZT.js";
|
|
39
39
|
import "./chunk-ZSHS46V5.js";
|
|
40
40
|
import "./chunk-QKHEVSB5.js";
|
|
41
41
|
import "./chunk-F2PVRF3B.js";
|
|
@@ -43,7 +43,7 @@ import "./chunk-OPXEJJBM.js";
|
|
|
43
43
|
import "./chunk-6K64FJDD.js";
|
|
44
44
|
import "./chunk-LG6RJBIY.js";
|
|
45
45
|
import "./chunk-2TUE6JKQ.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-QPSKQP6E.js";
|
|
47
47
|
import "./chunk-77WWLBCI.js";
|
|
48
48
|
import {
|
|
49
49
|
stripNestedElectronEnv
|
|
@@ -34,14 +34,14 @@ import {
|
|
|
34
34
|
tryReservePort,
|
|
35
35
|
tryReservePorts,
|
|
36
36
|
worktreeRunPortsPath
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-XLVLMQKN.js";
|
|
38
38
|
import "./chunk-5MXLDDYF.js";
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-YGVGXQA7.js";
|
|
40
|
+
import "./chunk-75RPUXJS.js";
|
|
41
41
|
import "./chunk-N2WW62LF.js";
|
|
42
42
|
import "./chunk-4YXZOXMT.js";
|
|
43
43
|
import "./chunk-YBTSZ2SW.js";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-D744HOI5.js";
|
|
45
45
|
import "./chunk-NSTQ6QKD.js";
|
|
46
46
|
import {
|
|
47
47
|
stripNestedElectronEnv
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
enrichWorkspacesWithGithub,
|
|
8
8
|
ensureGlobalCoordinatorCwd,
|
|
9
9
|
formatWorkspaceInventory
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-FWVUGLBG.js";
|
|
11
|
+
import "./chunk-KECHK3ZT.js";
|
|
12
12
|
import "./chunk-ZSHS46V5.js";
|
|
13
13
|
import "./chunk-QKHEVSB5.js";
|
|
14
14
|
import "./chunk-F2PVRF3B.js";
|
|
15
15
|
import "./chunk-6K64FJDD.js";
|
|
16
16
|
import "./chunk-LG6RJBIY.js";
|
|
17
17
|
import "./chunk-2TUE6JKQ.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-QPSKQP6E.js";
|
|
19
19
|
import "./chunk-77WWLBCI.js";
|
|
20
20
|
import "./chunk-4TR3HZFT.js";
|
|
21
21
|
import "./chunk-WDRMZKVB.js";
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
enrichWorkspacesWithGithub,
|
|
10
10
|
ensureGlobalCoordinatorCwd,
|
|
11
11
|
formatWorkspaceInventory
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-YGVGXQA7.js";
|
|
13
|
+
import "./chunk-75RPUXJS.js";
|
|
14
14
|
import "./chunk-N2WW62LF.js";
|
|
15
15
|
import "./chunk-4YXZOXMT.js";
|
|
16
16
|
import "./chunk-YBTSZ2SW.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-D744HOI5.js";
|
|
18
18
|
import "./chunk-NSTQ6QKD.js";
|
|
19
19
|
import "./chunk-WWUABK6B.js";
|
|
20
20
|
import "./chunk-FJZWM2ON.js";
|
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
remoteCoordinatorSourceRef,
|
|
21
21
|
slackCoordinatorSourceRef,
|
|
22
22
|
takenTeamSlugsForOrchestration
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-YGVGXQA7.js";
|
|
24
|
+
import "./chunk-75RPUXJS.js";
|
|
25
25
|
import "./chunk-N2WW62LF.js";
|
|
26
26
|
import "./chunk-4YXZOXMT.js";
|
|
27
27
|
import "./chunk-YBTSZ2SW.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-D744HOI5.js";
|
|
29
29
|
import "./chunk-NSTQ6QKD.js";
|
|
30
30
|
import "./chunk-WWUABK6B.js";
|
|
31
31
|
import "./chunk-FJZWM2ON.js";
|
|
@@ -18,15 +18,15 @@ import {
|
|
|
18
18
|
remoteCoordinatorSourceRef,
|
|
19
19
|
slackCoordinatorSourceRef,
|
|
20
20
|
takenTeamSlugsForOrchestration
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-FWVUGLBG.js";
|
|
22
|
+
import "./chunk-KECHK3ZT.js";
|
|
23
23
|
import "./chunk-ZSHS46V5.js";
|
|
24
24
|
import "./chunk-QKHEVSB5.js";
|
|
25
25
|
import "./chunk-F2PVRF3B.js";
|
|
26
26
|
import "./chunk-6K64FJDD.js";
|
|
27
27
|
import "./chunk-LG6RJBIY.js";
|
|
28
28
|
import "./chunk-2TUE6JKQ.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-QPSKQP6E.js";
|
|
30
30
|
import "./chunk-77WWLBCI.js";
|
|
31
31
|
import "./chunk-4TR3HZFT.js";
|
|
32
32
|
import "./chunk-WDRMZKVB.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1796,10 +1796,11 @@ function applyTurnUsage(current, incoming, scope = "request") {
|
|
|
1796
1796
|
...incoming.sessionCostUsd != null ? { sessionCostUsd: incoming.sessionCostUsd } : {}
|
|
1797
1797
|
};
|
|
1798
1798
|
}
|
|
1799
|
+
const explicit = incoming.lastRequestTokens != null && incoming.lastRequestTokens > 0 ? incoming.lastRequestTokens : void 0;
|
|
1799
1800
|
return {
|
|
1800
1801
|
...incoming,
|
|
1801
1802
|
costUsd: incoming.costUsd ?? current?.costUsd,
|
|
1802
|
-
lastRequestTokens: current?.lastRequestTokens ??
|
|
1803
|
+
lastRequestTokens: current?.lastRequestTokens ?? explicit,
|
|
1803
1804
|
...incoming.sessionCostUsd == null && current?.sessionCostUsd != null ? { sessionCostUsd: current.sessionCostUsd } : {}
|
|
1804
1805
|
};
|
|
1805
1806
|
}
|
|
@@ -19535,13 +19536,16 @@ async function listCodexModels() {
|
|
|
19535
19536
|
return cachedCodexModels?.models ?? FALLBACK_CODEX_MODELS;
|
|
19536
19537
|
}
|
|
19537
19538
|
}
|
|
19538
|
-
function usageFromCodex(usage) {
|
|
19539
|
+
function usageFromCodex(usage, asContext = false) {
|
|
19539
19540
|
if (!usage) return null;
|
|
19540
|
-
|
|
19541
|
+
const mapped = fromInclusiveInputUsage({
|
|
19541
19542
|
inputTokens: Number(usage.input_tokens ?? 0),
|
|
19542
19543
|
outputTokens: Number(usage.output_tokens ?? 0),
|
|
19543
19544
|
cachedInputTokens: Number(usage.cached_input_tokens ?? 0)
|
|
19544
19545
|
});
|
|
19546
|
+
if (!mapped || !asContext) return mapped;
|
|
19547
|
+
const occ = requestOccupancy(mapped);
|
|
19548
|
+
return occ > 0 ? { ...mapped, lastRequestTokens: occ } : mapped;
|
|
19545
19549
|
}
|
|
19546
19550
|
function codexHomeDir() {
|
|
19547
19551
|
return process.env.CODEX_HOME?.trim() || (0, import_node_path45.join)((0, import_node_os17.homedir)(), ".codex");
|
|
@@ -19837,7 +19841,7 @@ var init_codex = __esm({
|
|
|
19837
19841
|
}
|
|
19838
19842
|
if (type === "turn.completed" || type === "turn_completed") {
|
|
19839
19843
|
const payload = obj;
|
|
19840
|
-
const usage = usageFromCodex(payload.last_token_usage
|
|
19844
|
+
const usage = payload.last_token_usage ? usageFromCodex(payload.last_token_usage, true) : usageFromCodex(payload.usage);
|
|
19841
19845
|
return usage ? { type: "usage", data: usage, scope: "turn" } : null;
|
|
19842
19846
|
}
|
|
19843
19847
|
if (typeof obj.content === "string" && obj.content.trim()) {
|
|
@@ -20175,7 +20179,7 @@ function cursorSdkMessageToEvents(msg) {
|
|
|
20175
20179
|
}
|
|
20176
20180
|
if (msg.type === "usage") {
|
|
20177
20181
|
const usage = usageFromCursor(msg.usage);
|
|
20178
|
-
if (usage) return [{ type: "usage", data: usage, scope: "
|
|
20182
|
+
if (usage) return [{ type: "usage", data: usage, scope: "turn" }];
|
|
20179
20183
|
}
|
|
20180
20184
|
if (msg.type === "status" && msg.status === "ERROR") {
|
|
20181
20185
|
const rawMessage = msg.message;
|
|
@@ -22812,13 +22816,12 @@ function estimateOccupancyTokens(messages) {
|
|
|
22812
22816
|
function threadHasCompactedContext(messages) {
|
|
22813
22817
|
return messages.some((m) => m.role === "summary");
|
|
22814
22818
|
}
|
|
22815
|
-
function forwardOccupancyTokens(messages, usage, windowTokens = 1e6) {
|
|
22819
|
+
function forwardOccupancyTokens(messages, usage, windowTokens = 1e6, opts) {
|
|
22816
22820
|
const estimated = estimateOccupancyTokens(messages);
|
|
22821
|
+
if (opts?.trustProviderOccupancy === false) return estimated;
|
|
22817
22822
|
if (threadHasCompactedContext(messages) && estimated > 0) return estimated;
|
|
22818
|
-
|
|
22819
|
-
|
|
22820
|
-
if (last > 0 && last <= windowTokens) return last;
|
|
22821
|
-
}
|
|
22823
|
+
const explicit = usage?.lastRequestTokens;
|
|
22824
|
+
if (explicit != null && explicit > 0 && explicit <= windowTokens) return explicit;
|
|
22822
22825
|
return estimated;
|
|
22823
22826
|
}
|
|
22824
22827
|
function forwardContextUsage(usage, messages) {
|
|
@@ -23212,11 +23215,15 @@ function applyCompaction(messages, summaryText, thresholds = {}) {
|
|
|
23212
23215
|
return [summary, ...recent];
|
|
23213
23216
|
}
|
|
23214
23217
|
function lastRequestOccupancy(thread) {
|
|
23218
|
+
if (thread.agent === "cursor") return estimateOccupancyTokens(thread.messages);
|
|
23215
23219
|
for (let i = thread.messages.length - 1; i >= 0; i--) {
|
|
23216
23220
|
const usage = thread.messages[i]?.usage;
|
|
23217
|
-
if (usage)
|
|
23221
|
+
if (!usage) continue;
|
|
23222
|
+
const n = usage.lastRequestTokens;
|
|
23223
|
+
if (n != null && n > 0) return n;
|
|
23224
|
+
if (thread.agent === "codex") return estimateOccupancyTokens(thread.messages);
|
|
23218
23225
|
}
|
|
23219
|
-
return 0;
|
|
23226
|
+
return thread.agent === "codex" ? estimateOccupancyTokens(thread.messages) : 0;
|
|
23220
23227
|
}
|
|
23221
23228
|
function shouldResetSessionForOccupancy(thread, occupancyTokens = SESSION_RESET_OCCUPANCY_TOKENS) {
|
|
23222
23229
|
return lastRequestOccupancy(thread) >= occupancyTokens;
|
|
@@ -23235,7 +23242,7 @@ async function maybeCompactContext(thread, thresholds = {}, summarize2 = summari
|
|
|
23235
23242
|
});
|
|
23236
23243
|
let messages = applyCompaction(thread.messages, summary, thresholds);
|
|
23237
23244
|
const compactedMessages = appendCompactedMessages(thread.compactedMessages, older);
|
|
23238
|
-
const resetSession = shouldResetSessionForOccupancy(
|
|
23245
|
+
const resetSession = shouldResetSessionForOccupancy(thread);
|
|
23239
23246
|
if (resetSession) {
|
|
23240
23247
|
messages = applyForwardOccupancy(messages);
|
|
23241
23248
|
}
|
|
@@ -23260,7 +23267,6 @@ var init_context_compact = __esm({
|
|
|
23260
23267
|
"use strict";
|
|
23261
23268
|
init_message_parts();
|
|
23262
23269
|
init_error_detail();
|
|
23263
|
-
init_usage();
|
|
23264
23270
|
init_context_estimate();
|
|
23265
23271
|
init_summarize();
|
|
23266
23272
|
init_context_estimate();
|
package/dist/index.d.cts
CHANGED
|
@@ -5392,7 +5392,9 @@ declare function threadHasCompactedContext(messages: Array<Pick<ThreadMessage, '
|
|
|
5392
5392
|
* fits the window is preferred (provider-accurate); billed leaks fall back
|
|
5393
5393
|
* to the transcript.
|
|
5394
5394
|
*/
|
|
5395
|
-
declare function forwardOccupancyTokens(messages: ThreadMessage[], usage?: TokenUsage | null, windowTokens?: number
|
|
5395
|
+
declare function forwardOccupancyTokens(messages: ThreadMessage[], usage?: TokenUsage | null, windowTokens?: number, opts?: {
|
|
5396
|
+
trustProviderOccupancy?: boolean;
|
|
5397
|
+
}): number;
|
|
5396
5398
|
/**
|
|
5397
5399
|
* Occupancy the next turn will start from.
|
|
5398
5400
|
* After Sideboard compression the last agent `lastRequestTokens` is still the
|
|
@@ -5515,13 +5517,14 @@ interface CompactResult {
|
|
|
5515
5517
|
method?: 'claude' | 'extractive';
|
|
5516
5518
|
olderCount?: number;
|
|
5517
5519
|
}
|
|
5518
|
-
/**
|
|
5519
|
-
declare function lastRequestOccupancy(thread: Pick<Thread, 'messages'>
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5520
|
+
/** Window occupancy. A Codex session sum must not reuse an older peak. */
|
|
5521
|
+
declare function lastRequestOccupancy(thread: Pick<Thread, 'messages'> & {
|
|
5522
|
+
agent?: Thread['agent'];
|
|
5523
|
+
}): number;
|
|
5524
|
+
/** Reseed when occupancy is near the window. */
|
|
5525
|
+
declare function shouldResetSessionForOccupancy(thread: Pick<Thread, 'messages'> & {
|
|
5526
|
+
agent?: Thread['agent'];
|
|
5527
|
+
}, occupancyTokens?: number): boolean;
|
|
5525
5528
|
/**
|
|
5526
5529
|
* If the thread transcript is oversized, summarize older turns and keep recent
|
|
5527
5530
|
* ones. The CLI session stays unless last-request occupancy is near the window
|
package/dist/index.d.ts
CHANGED
|
@@ -5392,7 +5392,9 @@ declare function threadHasCompactedContext(messages: Array<Pick<ThreadMessage, '
|
|
|
5392
5392
|
* fits the window is preferred (provider-accurate); billed leaks fall back
|
|
5393
5393
|
* to the transcript.
|
|
5394
5394
|
*/
|
|
5395
|
-
declare function forwardOccupancyTokens(messages: ThreadMessage[], usage?: TokenUsage | null, windowTokens?: number
|
|
5395
|
+
declare function forwardOccupancyTokens(messages: ThreadMessage[], usage?: TokenUsage | null, windowTokens?: number, opts?: {
|
|
5396
|
+
trustProviderOccupancy?: boolean;
|
|
5397
|
+
}): number;
|
|
5396
5398
|
/**
|
|
5397
5399
|
* Occupancy the next turn will start from.
|
|
5398
5400
|
* After Sideboard compression the last agent `lastRequestTokens` is still the
|
|
@@ -5515,13 +5517,14 @@ interface CompactResult {
|
|
|
5515
5517
|
method?: 'claude' | 'extractive';
|
|
5516
5518
|
olderCount?: number;
|
|
5517
5519
|
}
|
|
5518
|
-
/**
|
|
5519
|
-
declare function lastRequestOccupancy(thread: Pick<Thread, 'messages'>
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5520
|
+
/** Window occupancy. A Codex session sum must not reuse an older peak. */
|
|
5521
|
+
declare function lastRequestOccupancy(thread: Pick<Thread, 'messages'> & {
|
|
5522
|
+
agent?: Thread['agent'];
|
|
5523
|
+
}): number;
|
|
5524
|
+
/** Reseed when occupancy is near the window. */
|
|
5525
|
+
declare function shouldResetSessionForOccupancy(thread: Pick<Thread, 'messages'> & {
|
|
5526
|
+
agent?: Thread['agent'];
|
|
5527
|
+
}, occupancyTokens?: number): boolean;
|
|
5525
5528
|
/**
|
|
5526
5529
|
* If the thread transcript is oversized, summarize older turns and keep recent
|
|
5527
5530
|
* ones. The CLI session stays unless last-request occupancy is near the window
|
package/dist/index.js
CHANGED
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
toAbleTimeIssueInfo,
|
|
18
18
|
updateAbleTimeTask,
|
|
19
19
|
verifyAbleTimeConnection
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PB6HW7SA.js";
|
|
21
21
|
import {
|
|
22
22
|
clearOptionalCliPresenceCache,
|
|
23
23
|
detectOptionalServiceClis,
|
|
24
24
|
installOptionalServiceCli,
|
|
25
25
|
optionalCliPresence
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ZUAYA57W.js";
|
|
27
27
|
import {
|
|
28
28
|
AGENT_GIT_ACTIONS,
|
|
29
29
|
BOARD_COLUMN_DEFS,
|
|
@@ -238,7 +238,7 @@ import {
|
|
|
238
238
|
worktreeCleanupSettings,
|
|
239
239
|
writeAgentBlock,
|
|
240
240
|
writeWorktreeFile
|
|
241
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-GP3RLZ6A.js";
|
|
242
242
|
import {
|
|
243
243
|
OPTIONAL_SERVICES,
|
|
244
244
|
OPTIONAL_SERVICE_IDS,
|
|
@@ -254,7 +254,7 @@ import {
|
|
|
254
254
|
optionalServiceConnected,
|
|
255
255
|
optionalServiceSpec,
|
|
256
256
|
verifyOptionalService
|
|
257
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-B244TJWC.js";
|
|
258
258
|
import {
|
|
259
259
|
LEGACY_PLAN_FILE_REL,
|
|
260
260
|
PLAN_FILE_NAME,
|
|
@@ -311,7 +311,7 @@ import {
|
|
|
311
311
|
startLinearOAuth,
|
|
312
312
|
updateLinearIssue,
|
|
313
313
|
validateLinearApiKey
|
|
314
|
-
} from "./chunk-
|
|
314
|
+
} from "./chunk-SO7G6O24.js";
|
|
315
315
|
import {
|
|
316
316
|
downloadAuthenticatedFile,
|
|
317
317
|
extractHttpUrls,
|
|
@@ -399,7 +399,7 @@ import {
|
|
|
399
399
|
userMcpNamesToDisable,
|
|
400
400
|
worktreeMcpToolNames,
|
|
401
401
|
writeInjectedMcpConfig
|
|
402
|
-
} from "./chunk-
|
|
402
|
+
} from "./chunk-BBNWKL4I.js";
|
|
403
403
|
import {
|
|
404
404
|
getAgentSetupInfo,
|
|
405
405
|
installAgent,
|
|
@@ -411,7 +411,7 @@ import {
|
|
|
411
411
|
prepareTerminalCommand,
|
|
412
412
|
resolveLoginCommand,
|
|
413
413
|
whichOnPath
|
|
414
|
-
} from "./chunk-
|
|
414
|
+
} from "./chunk-4H5MWZ6J.js";
|
|
415
415
|
import {
|
|
416
416
|
brightsyMcpServerName,
|
|
417
417
|
connectBrightsyTeam,
|
|
@@ -422,7 +422,7 @@ import {
|
|
|
422
422
|
listConnectedBrightsyTeams,
|
|
423
423
|
switchBrightsyAccount
|
|
424
424
|
} from "./chunk-S5CJUIPY.js";
|
|
425
|
-
import "./chunk-
|
|
425
|
+
import "./chunk-TMCK5TLA.js";
|
|
426
426
|
import {
|
|
427
427
|
BRIGHTSY_SUMMARIZE_CONTEXT_TOOL,
|
|
428
428
|
CHARS_PER_CONTEXT_TOKEN,
|
|
@@ -543,7 +543,7 @@ import {
|
|
|
543
543
|
workspaceAgentChatSummaries,
|
|
544
544
|
worktreeRunPortsPath,
|
|
545
545
|
wrapReviewSkillMarkdown
|
|
546
|
-
} from "./chunk-
|
|
546
|
+
} from "./chunk-46FECFZU.js";
|
|
547
547
|
import {
|
|
548
548
|
STDERR_EVENT_MAX_CHARS,
|
|
549
549
|
STDOUT_EVENT_MAX_CHARS,
|
|
@@ -609,10 +609,10 @@ import {
|
|
|
609
609
|
parseAbleTimeOAuthCallbackUrl,
|
|
610
610
|
resolveAbleTimeOAuthHost,
|
|
611
611
|
startAbleTimeOAuth
|
|
612
|
-
} from "./chunk-
|
|
612
|
+
} from "./chunk-RZVOX2MT.js";
|
|
613
613
|
import {
|
|
614
614
|
looksLikeAbleTimeUlid
|
|
615
|
-
} from "./chunk-
|
|
615
|
+
} from "./chunk-KXRF6RNL.js";
|
|
616
616
|
import {
|
|
617
617
|
ABLETIME_MCP_PATH,
|
|
618
618
|
ABLETIME_MCP_PM_PATH,
|
|
@@ -633,7 +633,7 @@ import {
|
|
|
633
633
|
normalizeAbleTimeCredential,
|
|
634
634
|
normalizeAbleTimeHost,
|
|
635
635
|
rewriteAbleTimeError
|
|
636
|
-
} from "./chunk-
|
|
636
|
+
} from "./chunk-C7HUCBX7.js";
|
|
637
637
|
import {
|
|
638
638
|
CLOUD_COORDINATOR_BUSY_REPLY,
|
|
639
639
|
CLOUD_COORDINATOR_CANCELED_REPLY,
|
|
@@ -686,7 +686,7 @@ import {
|
|
|
686
686
|
stageBuffersAsAttachments,
|
|
687
687
|
syncWorkspacesFromThreads,
|
|
688
688
|
takenTeamSlugsForOrchestration
|
|
689
|
-
} from "./chunk-
|
|
689
|
+
} from "./chunk-FWVUGLBG.js";
|
|
690
690
|
import {
|
|
691
691
|
GITHUB_PR_BODY_MAX_CHARS,
|
|
692
692
|
GITHUB_PR_BODY_SAFE_CHARS,
|
|
@@ -775,7 +775,7 @@ import {
|
|
|
775
775
|
suggestSlug,
|
|
776
776
|
switchWorktreeBranch,
|
|
777
777
|
warmGithubAgentAuth
|
|
778
|
-
} from "./chunk-
|
|
778
|
+
} from "./chunk-KECHK3ZT.js";
|
|
779
779
|
import {
|
|
780
780
|
FAMOUS_SOCCER_TEAMS,
|
|
781
781
|
allocateTeamName,
|
|
@@ -866,7 +866,7 @@ import {
|
|
|
866
866
|
trustSystemCertificates,
|
|
867
867
|
turnCostUsdFromCursorUsage,
|
|
868
868
|
withMaxOldSpaceSize
|
|
869
|
-
} from "./chunk-
|
|
869
|
+
} from "./chunk-NURZOXGN.js";
|
|
870
870
|
import "./chunk-OPXEJJBM.js";
|
|
871
871
|
import {
|
|
872
872
|
ATTACHMENTS_DIR,
|
|
@@ -1077,7 +1077,7 @@ import {
|
|
|
1077
1077
|
withTurnScopedCost,
|
|
1078
1078
|
writeSecureJson,
|
|
1079
1079
|
writeViewerContext
|
|
1080
|
-
} from "./chunk-
|
|
1080
|
+
} from "./chunk-QPSKQP6E.js";
|
|
1081
1081
|
import {
|
|
1082
1082
|
THINKING_EFFORTS,
|
|
1083
1083
|
isThinkingEffort,
|
|
@@ -7684,7 +7684,7 @@ async function startHeadlessHost(opts) {
|
|
|
7684
7684
|
};
|
|
7685
7685
|
const refreshRunning = async () => {
|
|
7686
7686
|
try {
|
|
7687
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
7687
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-7FVDBE7Y.js");
|
|
7688
7688
|
agentsRunning = getOrchestrator2().getRuntime().running;
|
|
7689
7689
|
} catch {
|
|
7690
7690
|
agentsRunning = 0;
|
|
@@ -9827,7 +9827,7 @@ async function handleJobStop(params, _ctx) {
|
|
|
9827
9827
|
return stopDetachedJob(jobCwd(rec), id, reason ? { reason } : void 0);
|
|
9828
9828
|
}
|
|
9829
9829
|
async function defaultTurnWait(ref, timeoutMs) {
|
|
9830
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
9830
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-7FVDBE7Y.js");
|
|
9831
9831
|
const orch = getOrchestrator2();
|
|
9832
9832
|
const thread = await orch.waitForTurn(ref, timeoutMs, {
|
|
9833
9833
|
resolveIfStillRunning: true
|
|
@@ -10180,7 +10180,7 @@ async function startMcpServer() {
|
|
|
10180
10180
|
);
|
|
10181
10181
|
}
|
|
10182
10182
|
try {
|
|
10183
|
-
const { maxConcurrentAgents: maxConcurrentAgents2 } = await import("./app-settings-
|
|
10183
|
+
const { maxConcurrentAgents: maxConcurrentAgents2 } = await import("./app-settings-RXBH7KY4.js");
|
|
10184
10184
|
orch.setMaxConcurrent(maxConcurrentAgents2());
|
|
10185
10185
|
} catch {
|
|
10186
10186
|
}
|
|
@@ -10728,7 +10728,7 @@ async function startMcpServer() {
|
|
|
10728
10728
|
if (!worktreeProfile) {
|
|
10729
10729
|
registerConnectedIssueVendorTools(server);
|
|
10730
10730
|
const { getCaffeinateHold: getCaffeinateHold2, setCaffeinateHold: setCaffeinateHold2 } = await import("./caffeinate-hold-ZNUEZGHB.js");
|
|
10731
|
-
const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults: resolveThreadDefaults2 } = await import("./app-settings-
|
|
10731
|
+
const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults: resolveThreadDefaults2 } = await import("./app-settings-RXBH7KY4.js");
|
|
10732
10732
|
const accountDefaults = resolveThreadDefaults2();
|
|
10733
10733
|
const accountDefaultsHint = `Account defaults: agent=${accountDefaults.agent}, model=${accountDefaults.model?.trim() || "Auto"}, effort=${accountDefaults.effort}`;
|
|
10734
10734
|
server.tool(
|
|
@@ -13495,7 +13495,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
13495
13495
|
await continueOnReply(threadId, prompt);
|
|
13496
13496
|
return;
|
|
13497
13497
|
}
|
|
13498
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
13498
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-7FVDBE7Y.js");
|
|
13499
13499
|
await getOrchestrator2().send(threadId, prompt);
|
|
13500
13500
|
} catch {
|
|
13501
13501
|
}
|
|
@@ -27,12 +27,12 @@ import {
|
|
|
27
27
|
rewriteLinearError,
|
|
28
28
|
updateLinearIssue,
|
|
29
29
|
validateLinearApiKey
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-LRHUBGEM.js";
|
|
31
31
|
import "./chunk-OYRN356W.js";
|
|
32
32
|
import "./chunk-F6GE7V3Q.js";
|
|
33
33
|
import "./chunk-N2WW62LF.js";
|
|
34
34
|
import "./chunk-2GPQZZLY.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-D744HOI5.js";
|
|
36
36
|
import "./chunk-NSTQ6QKD.js";
|
|
37
37
|
import "./chunk-WWUABK6B.js";
|
|
38
38
|
import "./chunk-FJZWM2ON.js";
|
|
@@ -25,12 +25,12 @@ import {
|
|
|
25
25
|
rewriteLinearError,
|
|
26
26
|
updateLinearIssue,
|
|
27
27
|
validateLinearApiKey
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-SO7G6O24.js";
|
|
29
29
|
import "./chunk-DBKHL7NC.js";
|
|
30
30
|
import "./chunk-W3ZLE4PO.js";
|
|
31
31
|
import "./chunk-JAT3JFOS.js";
|
|
32
32
|
import "./chunk-6K64FJDD.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-QPSKQP6E.js";
|
|
34
34
|
import "./chunk-77WWLBCI.js";
|
|
35
35
|
import "./chunk-4TR3HZFT.js";
|
|
36
36
|
import "./chunk-WDRMZKVB.js";
|
package/dist/mcp/run-stdio.cjs
CHANGED
|
@@ -4415,10 +4415,11 @@ function applyTurnUsage(current, incoming, scope = "request") {
|
|
|
4415
4415
|
...incoming.sessionCostUsd != null ? { sessionCostUsd: incoming.sessionCostUsd } : {}
|
|
4416
4416
|
};
|
|
4417
4417
|
}
|
|
4418
|
+
const explicit = incoming.lastRequestTokens != null && incoming.lastRequestTokens > 0 ? incoming.lastRequestTokens : void 0;
|
|
4418
4419
|
return {
|
|
4419
4420
|
...incoming,
|
|
4420
4421
|
costUsd: incoming.costUsd ?? current?.costUsd,
|
|
4421
|
-
lastRequestTokens: current?.lastRequestTokens ??
|
|
4422
|
+
lastRequestTokens: current?.lastRequestTokens ?? explicit,
|
|
4422
4423
|
...incoming.sessionCostUsd == null && current?.sessionCostUsd != null ? { sessionCostUsd: current.sessionCostUsd } : {}
|
|
4423
4424
|
};
|
|
4424
4425
|
}
|
|
@@ -16350,13 +16351,16 @@ async function listCodexModels() {
|
|
|
16350
16351
|
return cachedCodexModels?.models ?? FALLBACK_CODEX_MODELS;
|
|
16351
16352
|
}
|
|
16352
16353
|
}
|
|
16353
|
-
function usageFromCodex(usage) {
|
|
16354
|
+
function usageFromCodex(usage, asContext = false) {
|
|
16354
16355
|
if (!usage) return null;
|
|
16355
|
-
|
|
16356
|
+
const mapped = fromInclusiveInputUsage({
|
|
16356
16357
|
inputTokens: Number(usage.input_tokens ?? 0),
|
|
16357
16358
|
outputTokens: Number(usage.output_tokens ?? 0),
|
|
16358
16359
|
cachedInputTokens: Number(usage.cached_input_tokens ?? 0)
|
|
16359
16360
|
});
|
|
16361
|
+
if (!mapped || !asContext) return mapped;
|
|
16362
|
+
const occ = requestOccupancy(mapped);
|
|
16363
|
+
return occ > 0 ? { ...mapped, lastRequestTokens: occ } : mapped;
|
|
16360
16364
|
}
|
|
16361
16365
|
function codexHomeDir() {
|
|
16362
16366
|
return process.env.CODEX_HOME?.trim() || (0, import_node_path39.join)((0, import_node_os16.homedir)(), ".codex");
|
|
@@ -16652,7 +16656,7 @@ var init_codex = __esm({
|
|
|
16652
16656
|
}
|
|
16653
16657
|
if (type === "turn.completed" || type === "turn_completed") {
|
|
16654
16658
|
const payload = obj;
|
|
16655
|
-
const usage = usageFromCodex(payload.last_token_usage
|
|
16659
|
+
const usage = payload.last_token_usage ? usageFromCodex(payload.last_token_usage, true) : usageFromCodex(payload.usage);
|
|
16656
16660
|
return usage ? { type: "usage", data: usage, scope: "turn" } : null;
|
|
16657
16661
|
}
|
|
16658
16662
|
if (typeof obj.content === "string" && obj.content.trim()) {
|
|
@@ -19185,11 +19189,15 @@ function applyCompaction(messages, summaryText, thresholds = {}) {
|
|
|
19185
19189
|
return [summary, ...recent];
|
|
19186
19190
|
}
|
|
19187
19191
|
function lastRequestOccupancy(thread) {
|
|
19192
|
+
if (thread.agent === "cursor") return estimateOccupancyTokens(thread.messages);
|
|
19188
19193
|
for (let i = thread.messages.length - 1; i >= 0; i--) {
|
|
19189
19194
|
const usage = thread.messages[i]?.usage;
|
|
19190
|
-
if (usage)
|
|
19195
|
+
if (!usage) continue;
|
|
19196
|
+
const n = usage.lastRequestTokens;
|
|
19197
|
+
if (n != null && n > 0) return n;
|
|
19198
|
+
if (thread.agent === "codex") return estimateOccupancyTokens(thread.messages);
|
|
19191
19199
|
}
|
|
19192
|
-
return 0;
|
|
19200
|
+
return thread.agent === "codex" ? estimateOccupancyTokens(thread.messages) : 0;
|
|
19193
19201
|
}
|
|
19194
19202
|
function shouldResetSessionForOccupancy(thread, occupancyTokens = SESSION_RESET_OCCUPANCY_TOKENS) {
|
|
19195
19203
|
return lastRequestOccupancy(thread) >= occupancyTokens;
|
|
@@ -19208,7 +19216,7 @@ async function maybeCompactContext(thread, thresholds = {}, summarize = summariz
|
|
|
19208
19216
|
});
|
|
19209
19217
|
let messages = applyCompaction(thread.messages, summary, thresholds);
|
|
19210
19218
|
const compactedMessages = appendCompactedMessages(thread.compactedMessages, older);
|
|
19211
|
-
const resetSession = shouldResetSessionForOccupancy(
|
|
19219
|
+
const resetSession = shouldResetSessionForOccupancy(thread);
|
|
19212
19220
|
if (resetSession) {
|
|
19213
19221
|
messages = applyForwardOccupancy(messages);
|
|
19214
19222
|
}
|
|
@@ -19233,7 +19241,6 @@ var init_context_compact = __esm({
|
|
|
19233
19241
|
"use strict";
|
|
19234
19242
|
init_message_parts();
|
|
19235
19243
|
init_error_detail();
|
|
19236
|
-
init_usage();
|
|
19237
19244
|
init_context_estimate();
|
|
19238
19245
|
init_summarize();
|
|
19239
19246
|
init_context_estimate();
|