@askexenow/exe-os 0.9.330 → 0.9.332
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/{backfill-metadata-AVWHS332.js → backfill-metadata-FDQVVGRQ.js} +1 -1
- package/dist/{behaviors-ZV6HNI2M.js → behaviors-SAS6JALZ.js} +2 -2
- package/dist/bin/agentic-ontology-backfill.js +1 -1
- package/dist/bin/agentic-reflection-backfill.js +1 -1
- package/dist/bin/agentic-semantic-label.js +1 -1
- package/dist/bin/backfill-conversations.js +1 -1
- package/dist/bin/backfill-responses.js +1 -1
- package/dist/bin/backfill-vectors.js +2 -2
- package/dist/bin/bulk-sync-postgres.js +3 -3
- package/dist/bin/cleanup-stale-review-tasks.js +3 -3
- package/dist/bin/cli.js +6 -6
- package/dist/bin/deferred-daemon-restart.js +35 -35
- package/dist/bin/exe-assign.js +1 -1
- package/dist/bin/exe-boot.js +7 -7
- package/dist/bin/exe-cloud.js +3 -3
- package/dist/bin/exe-config-dump.js +0 -0
- package/dist/bin/exe-dispatch.js +3 -3
- package/dist/bin/exe-doctor.js +2 -2
- package/dist/bin/exe-export-behaviors.js +4 -4
- package/dist/bin/exe-forget.js +3 -3
- package/dist/bin/exe-gateway.js +5 -5
- package/dist/bin/exe-heartbeat.js +3 -3
- package/dist/bin/exe-kill.js +5 -5
- package/dist/bin/exe-launch-agent.js +6 -6
- package/dist/bin/exe-pending-messages.js +4 -4
- package/dist/bin/exe-pending-notifications.js +3 -3
- package/dist/bin/exe-pending-reviews.js +3 -3
- package/dist/bin/exe-review.js +4 -4
- package/dist/bin/exe-search.js +2 -2
- package/dist/bin/exe-session-cleanup.js +5 -5
- package/dist/bin/exe-settings.js +3 -3
- package/dist/bin/exe-start-codex.js +3 -3
- package/dist/bin/exe-start-opencode.js +3 -3
- package/dist/bin/exe-status.js +4 -4
- package/dist/bin/exe-team.js +1 -1
- package/dist/bin/git-sweep.js +3 -3
- package/dist/bin/graph-backfill.js +1 -1
- package/dist/bin/graph-export.js +2 -2
- package/dist/bin/import-history.js +2 -2
- package/dist/bin/install.js +35 -35
- package/dist/bin/intercom-check.js +4 -4
- package/dist/bin/mcp-sessions.js +2 -2
- package/dist/bin/orchestration-metrics.js +1 -1
- package/dist/bin/scan-tasks.js +3 -3
- package/dist/bin/setup.js +1 -1
- package/dist/bin/shard-migrate.js +1 -1
- package/dist/{capacity-monitor-VNAUNTTH.js → capacity-monitor-I6TX3OZA.js} +4 -4
- package/dist/{catchup-brief-2V6WXZGD.js → catchup-brief-RAZTRECT.js} +4 -4
- package/dist/{chunk-LKB2VIIV.js → chunk-267TDVN7.js} +1 -1
- package/dist/{chunk-7RDZDCWY.js → chunk-2ES3ACCO.js} +4 -4
- package/dist/{chunk-ZSMF37M6.js → chunk-3KAYKHVB.js} +64 -4
- package/dist/{chunk-UJRZD77V.js → chunk-3PHTJIC3.js} +1 -1
- package/dist/{chunk-QAYGX7KA.js → chunk-4X3VWI22.js} +1 -1
- package/dist/{chunk-GTCJU2RF.js → chunk-5CZ2ZH6L.js} +1 -1
- package/dist/{chunk-5JILQMRS.js → chunk-6AY7VXSF.js} +6 -6
- package/dist/{chunk-UX5YA6ZY.js → chunk-7YTO3LHB.js} +2 -2
- package/dist/{chunk-RY7UV6CU.js → chunk-B3ZUS3UU.js} +1 -1
- package/dist/{chunk-CPXFQBBN.js → chunk-BST5NSJC.js} +1 -1
- package/dist/{chunk-5IX2ZW6O.js → chunk-E5UHM2KN.js} +107 -0
- package/dist/{chunk-CERY66PJ.js → chunk-EC4O5ITE.js} +1 -1
- package/dist/{chunk-DSL5D3TH.js → chunk-FZQBWOIB.js} +2 -2
- package/dist/{chunk-U7ORCOJH.js → chunk-HG7ZX2UT.js} +75 -53
- package/dist/{chunk-YL5S6I3R.js → chunk-HRUI3Q42.js} +2 -2
- package/dist/{chunk-OR7JFLIL.js → chunk-IVN7UUKK.js} +6 -6
- package/dist/{chunk-JCBQQIUV.js → chunk-J53PHGGC.js} +1 -1
- package/dist/{chunk-TKG6LCSQ.js → chunk-JRRNRSZC.js} +1 -1
- package/dist/{chunk-GSFGVYCG.js → chunk-JRTJKLON.js} +2 -2
- package/dist/{chunk-D5SZ3U5L.js → chunk-KNLQAVLI.js} +37 -6
- package/dist/{chunk-MTX3FQRR.js → chunk-L6CLX2QF.js} +1 -1
- package/dist/{chunk-MNLSPTWM.js → chunk-LB5B4NJ6.js} +1 -1
- package/dist/{chunk-4NGPNH3F.js → chunk-M6E76DMO.js} +1 -1
- package/dist/{chunk-O6RMSGXQ.js → chunk-MPUIO6GF.js} +1 -1
- package/dist/{chunk-QVT4LNHH.js → chunk-N2J6FWMQ.js} +3 -3
- package/dist/{chunk-XDJEPGMF.js → chunk-NUPU7TRA.js} +1 -1
- package/dist/{chunk-N5ACQ7C2.js → chunk-OEA44GCC.js} +1 -1
- package/dist/{chunk-KKZPF6YI.js → chunk-OIMQGA62.js} +1 -1
- package/dist/{chunk-QXXG2MCZ.js → chunk-OXZHAERM.js} +29 -3
- package/dist/{chunk-OV7OFYIR.js → chunk-QGVXUTHX.js} +1 -1
- package/dist/{chunk-KCHIJUYX.js → chunk-QUZ4VK3R.js} +1 -1
- package/dist/{chunk-CCDQ6NIZ.js → chunk-RGBABIFH.js} +21 -3
- package/dist/{chunk-MTHQR76V.js → chunk-T5JJBIUB.js} +4 -4
- package/dist/{chunk-DDA7IAWM.js → chunk-TK7ZDWU3.js} +2 -2
- package/dist/{chunk-QOMCLPQI.js → chunk-TQM7RGOB.js} +2 -2
- package/dist/{chunk-6YONUN6T.js → chunk-TXUSQZLH.js} +11 -1
- package/dist/{chunk-MZ2MBZ3E.js → chunk-YDUS2DFZ.js} +1 -1
- package/dist/{chunk-ZWWHEX3Y.js → chunk-YFYUNROP.js} +1 -1
- package/dist/{chunk-EQCYEYCJ.js → chunk-ZJSH3L6R.js} +1 -1
- package/dist/{cleanup-graph-garbage-FD34BPLR.js → cleanup-graph-garbage-6QGLERF2.js} +1 -1
- package/dist/{crm-webhook-6YDLPLVH.js → crm-webhook-DHFRIRLN.js} +2 -2
- package/dist/{cto-delegation-gate-JMO6VVTO.js → cto-delegation-gate-Z7UVTVYO.js} +2 -2
- package/dist/{daemon-orchestration-U5HW7YT5.js → daemon-orchestration-XWDFUFJG.js} +6 -6
- package/dist/{documents-TXMACEEP.js → documents-OMKCMWR7.js} +2 -2
- package/dist/{dreaming-KJ4P52EC.js → dreaming-SDFWY5FY.js} +3 -3
- package/dist/{exe-export-PH23G3F7.js → exe-export-BY6IFTEP.js} +3 -3
- package/dist/{exe-import-QCAFH4AM.js → exe-import-55UKB2X7.js} +3 -3
- package/dist/{exe-key-XV4VACRP.js → exe-key-F3BM5GEW.js} +35 -35
- package/dist/{exe-snapshot-DDSSZ377.js → exe-snapshot-RGIJJ2ZX.js} +5 -5
- package/dist/{fast-db-init-6KBEZK66.js → fast-db-init-OZDG42SZ.js} +1 -1
- package/dist/gateway/index.js +6 -6
- package/dist/hooks/bug-report-worker.js +5 -5
- package/dist/hooks/codex-stop-task-finalizer.js +5 -5
- package/dist/hooks/commit-complete.js +5 -5
- package/dist/hooks/error-recall.js +7 -4
- package/dist/hooks/ingest.js +2 -2
- package/dist/hooks/instructions-loaded.js +1 -1
- package/dist/hooks/manifest.json +18 -18
- package/dist/hooks/notification.js +1 -1
- package/dist/hooks/post-compact.js +3 -3
- package/dist/hooks/post-tool-combined.js +2 -2
- package/dist/hooks/pre-compact.js +4 -4
- package/dist/hooks/pre-tool-use.js +7 -7
- package/dist/hooks/prompt-submit.js +16 -16
- package/dist/hooks/session-end.js +6 -6
- package/dist/hooks/session-start.js +6 -6
- package/dist/hooks/stop.js +6 -6
- package/dist/hooks/subagent-stop.js +3 -3
- package/dist/hooks/summary-worker.js +6 -6
- package/dist/index.js +10 -10
- package/dist/{intercom-queue-4A7XH72M.js → intercom-queue-JFBMDV6J.js} +2 -2
- package/dist/lib/cloud-sync.js +3 -3
- package/dist/lib/consolidation.js +2 -2
- package/dist/lib/exe-daemon.js +28 -28
- package/dist/lib/hybrid-search.js +2 -2
- package/dist/lib/messaging.js +3 -3
- package/dist/lib/schedules.js +2 -2
- package/dist/lib/skill-learning.js +3 -3
- package/dist/lib/store.js +1 -1
- package/dist/lib/tasks.js +4 -4
- package/dist/lib/tmux-routing.js +2 -2
- package/dist/lib/token-spend.js +9 -3
- package/dist/mcp/register-tools.js +34 -34
- package/dist/mcp/server.js +35 -35
- package/dist/mcp/tools/create-task.js +5 -5
- package/dist/mcp/tools/deactivate-behavior.js +3 -3
- package/dist/mcp/tools/list-tasks.js +5 -5
- package/dist/mcp/tools/send-message.js +4 -4
- package/dist/mcp/tools/update-task.js +5 -5
- package/dist/{memory-cards-7Z66A6AF.js → memory-cards-7YIZUWSJ.js} +1 -1
- package/dist/{memory-pressure-watchdog-Z25XTMNY.js → memory-pressure-watchdog-MZWX4YIA.js} +3 -3
- package/dist/{notifications-3MIUQXX6.js → notifications-42Z4ZRNV.js} +2 -2
- package/dist/{orchestrator-IKRGCGWD.js → orchestrator-ALAA4P6M.js} +3 -3
- package/dist/{pipeline-router-BNKNM454.js → pipeline-router-F226AZRB.js} +1 -1
- package/dist/{projection-worker-RIOEZPKQ.js → projection-worker-UL2HHHPO.js} +1 -1
- package/dist/{reranker-H3TCF74O.js → reranker-G24KWZKH.js} +1 -1
- package/dist/{retrieval-health-3VRJMK47.js → retrieval-health-GFGXNPSN.js} +1 -1
- package/dist/{review-polling-FDHBFWSY.js → review-polling-REHBTRU6.js} +3 -3
- package/dist/runtime/index.js +4 -4
- package/dist/{session-events-GM2OUFON.js → session-events-F3DPBY4P.js} +3 -3
- package/dist/{session-kill-telemetry-XN6LYPWA.js → session-kill-telemetry-USNB6ND7.js} +3 -3
- package/dist/{session-scope-3OGEPOW7.js → session-scope-CJQE4LVB.js} +2 -2
- package/dist/{setup-wizard-ISCAH4EV.js → setup-wizard-S6XYW2WH.js} +1 -1
- package/dist/{skill-refinement-X4HZANPI.js → skill-refinement-XXYCXA2U.js} +1 -1
- package/dist/{task-enforcement-7GXGH6DB.js → task-enforcement-ZKB2VZ6W.js} +3 -3
- package/dist/{task-scope-J3OMPV5A.js → task-scope-CATQQNVX.js} +2 -2
- package/dist/{tasks-crud-NGMRLJH5.js → tasks-crud-RDWLWYWV.js} +2 -2
- package/dist/{tasks-notify-4OZXON6S.js → tasks-notify-CKT5A6WK.js} +3 -3
- package/dist/{tasks-review-U5QEKLNP.js → tasks-review-UXWXJ6H3.js} +2 -2
- package/dist/{telemetry-upload-QCM44FAE.js → telemetry-upload-UUJULBSV.js} +1 -1
- package/dist/tui/App.js +8 -8
- package/dist/{tui-data-YPS2SMWF.js → tui-data-7SQLIY2O.js} +2 -2
- package/dist/{worker-gate-M6OGQF7H.js → worker-gate-2O27EXUE.js} +1 -1
- package/dist/{workflow-engine-OVVJRMD2.js → workflow-engine-QGSEQV2Z.js} +2 -2
- package/package.json +1 -1
- package/release-notes.json +16 -15
- /package/dist/{chunk-ME3WDWL6.js → chunk-26GM62C3.js} +0 -0
- /package/dist/{chunk-KOQ6WZBS.js → chunk-3HIYBZ62.js} +0 -0
- /package/dist/{chunk-BPH6YPHA.js → chunk-BAXNI3A5.js} +0 -0
- /package/dist/{chunk-VV422PGC.js → chunk-CDVA67B2.js} +0 -0
- /package/dist/{chunk-NPAGBSEN.js → chunk-G3UK4TTT.js} +0 -0
- /package/dist/{chunk-N4G4M6LE.js → chunk-VYLDGF4D.js} +0 -0
- /package/dist/{chunk-YOOK5NOZ.js → chunk-YWIOFMHL.js} +0 -0
- /package/dist/{core-memory-YHACNEAS.js → core-memory-KMBRE2HU.js} +0 -0
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
dispatchTaskToEmployee,
|
|
3
3
|
markTaskNotificationsRead,
|
|
4
4
|
notifyTaskDone
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HRUI3Q42.js";
|
|
6
6
|
import {
|
|
7
7
|
cleanupReviewFile,
|
|
8
8
|
createTaskCore,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
sessionScopeFilter,
|
|
12
12
|
updateTaskStatus,
|
|
13
13
|
writeNotification
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-3KAYKHVB.js";
|
|
15
15
|
import {
|
|
16
16
|
orgBus
|
|
17
17
|
} from "./chunk-MP2AFCGL.js";
|
|
@@ -61,7 +61,7 @@ async function cascadeUnblock(taskId, baseDir, now) {
|
|
|
61
61
|
}
|
|
62
62
|
if (unblockedRows.rows.length > 0 && !process.env.VITEST) {
|
|
63
63
|
try {
|
|
64
|
-
const { dispatchTaskToEmployee: dispatchTaskToEmployee2 } = await import("./tasks-notify-
|
|
64
|
+
const { dispatchTaskToEmployee: dispatchTaskToEmployee2 } = await import("./tasks-notify-CKT5A6WK.js");
|
|
65
65
|
const dispatched = /* @__PURE__ */ new Set();
|
|
66
66
|
for (const ur of unblockedRows.rows) {
|
|
67
67
|
const assignee = String(ur.assigned_to);
|
|
@@ -86,7 +86,7 @@ async function cascadeUnblock(taskId, baseDir, now) {
|
|
|
86
86
|
}
|
|
87
87
|
} catch {
|
|
88
88
|
try {
|
|
89
|
-
const { queueIntercom } = await import("./intercom-queue-
|
|
89
|
+
const { queueIntercom } = await import("./intercom-queue-JFBMDV6J.js");
|
|
90
90
|
const dispatched = /* @__PURE__ */ new Set();
|
|
91
91
|
for (const ur of unblockedRows.rows) {
|
|
92
92
|
const assignee = String(ur.assigned_to);
|
|
@@ -289,7 +289,7 @@ async function updateTask(input) {
|
|
|
289
289
|
try {
|
|
290
290
|
process.stderr.write(`[tasks] EVENT: tmux delivery failed for reviewer="${reviewer}". Queueing for daemon delivery.
|
|
291
291
|
`);
|
|
292
|
-
const { queueIntercom } = await import("./intercom-queue-
|
|
292
|
+
const { queueIntercom } = await import("./intercom-queue-JFBMDV6J.js");
|
|
293
293
|
const { resolveExeSession } = await import("./lib/tmux-routing.js");
|
|
294
294
|
const exeSession = row.session_scope ? String(row.session_scope) : resolveExeSession();
|
|
295
295
|
if (exeSession) {
|
|
@@ -333,7 +333,7 @@ async function updateTask(input) {
|
|
|
333
333
|
await markTaskNotificationsRead(taskFile);
|
|
334
334
|
if (isCompletionReviewTransition && !isCoordinator && row.reviewer) {
|
|
335
335
|
try {
|
|
336
|
-
const { writeNotification: writeNotification2 } = await import("./notifications-
|
|
336
|
+
const { writeNotification: writeNotification2 } = await import("./notifications-42Z4ZRNV.js");
|
|
337
337
|
const reviewer = String(row.reviewer);
|
|
338
338
|
await writeNotification2({
|
|
339
339
|
agentId: reviewer,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
recordSessionKill
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LB5B4NJ6.js";
|
|
4
4
|
import {
|
|
5
5
|
sessionScopeFilter,
|
|
6
6
|
verifyPaneAtCapacity,
|
|
7
7
|
writeNotification
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3KAYKHVB.js";
|
|
9
9
|
import {
|
|
10
10
|
listSessions
|
|
11
11
|
} from "./chunk-3HMHSTHQ.js";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient
|
|
3
3
|
} from "./chunk-BIM763ML.js";
|
|
4
|
+
import {
|
|
5
|
+
loadConfigSync
|
|
6
|
+
} from "./chunk-7Y5UDEVM.js";
|
|
4
7
|
|
|
5
8
|
// src/lib/token-spend.ts
|
|
6
9
|
import { readdir, stat } from "fs/promises";
|
|
@@ -8,6 +11,107 @@ import { createReadStream } from "fs";
|
|
|
8
11
|
import { createInterface } from "readline";
|
|
9
12
|
import path from "path";
|
|
10
13
|
import os from "os";
|
|
14
|
+
var DEFAULT_SPEND_WARNING_THRESHOLD = 0.8;
|
|
15
|
+
function asRecord(value) {
|
|
16
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
17
|
+
}
|
|
18
|
+
function finitePositiveNumber(value) {
|
|
19
|
+
if (typeof value === "number" && Number.isFinite(value) && value > 0) return value;
|
|
20
|
+
if (typeof value === "string" && value.trim() !== "") {
|
|
21
|
+
const parsed = Number(value);
|
|
22
|
+
if (Number.isFinite(parsed) && parsed > 0) return parsed;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
function normalizeWarningThreshold(value) {
|
|
27
|
+
const parsed = finitePositiveNumber(value);
|
|
28
|
+
if (parsed === null) return DEFAULT_SPEND_WARNING_THRESHOLD;
|
|
29
|
+
const ratio = parsed > 1 ? parsed / 100 : parsed;
|
|
30
|
+
return ratio > 0 && ratio <= 1 ? ratio : DEFAULT_SPEND_WARNING_THRESHOLD;
|
|
31
|
+
}
|
|
32
|
+
function firstPositiveNumber(records, keys) {
|
|
33
|
+
for (const { source, record } of records) {
|
|
34
|
+
for (const key of keys) {
|
|
35
|
+
const value = finitePositiveNumber(record[key]);
|
|
36
|
+
if (value !== null) return { value, source: `${source}.${key}` };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
function resolveGlobalSpendCapConfig(config, env = process.env) {
|
|
42
|
+
const envCap = finitePositiveNumber(env.EXE_GLOBAL_SPEND_CAP_USD ?? env.EXE_TOKEN_SPEND_CAP_USD ?? env.EXE_SPEND_CAP_USD);
|
|
43
|
+
if (envCap !== null) {
|
|
44
|
+
return {
|
|
45
|
+
capUSD: envCap,
|
|
46
|
+
warningThreshold: normalizeWarningThreshold(
|
|
47
|
+
env.EXE_GLOBAL_SPEND_WARN_THRESHOLD ?? env.EXE_TOKEN_SPEND_WARN_THRESHOLD ?? env.EXE_SPEND_WARN_THRESHOLD
|
|
48
|
+
),
|
|
49
|
+
source: env.EXE_GLOBAL_SPEND_CAP_USD ? "env.EXE_GLOBAL_SPEND_CAP_USD" : env.EXE_TOKEN_SPEND_CAP_USD ? "env.EXE_TOKEN_SPEND_CAP_USD" : "env.EXE_SPEND_CAP_USD"
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const tokenSpend = asRecord(config.tokenSpend);
|
|
53
|
+
const spend = asRecord(config.spend);
|
|
54
|
+
const records = [
|
|
55
|
+
...tokenSpend ? [{ source: "config.tokenSpend", record: tokenSpend }] : [],
|
|
56
|
+
...spend ? [{ source: "config.spend", record: spend }] : [],
|
|
57
|
+
{ source: "config", record: config }
|
|
58
|
+
];
|
|
59
|
+
const cap = firstPositiveNumber(records, [
|
|
60
|
+
"globalCapUSD",
|
|
61
|
+
"globalSpendCapUSD",
|
|
62
|
+
"capUSD",
|
|
63
|
+
"spendCapUSD"
|
|
64
|
+
]);
|
|
65
|
+
if (!cap) return null;
|
|
66
|
+
const warning = firstPositiveNumber(records, [
|
|
67
|
+
"warningThreshold",
|
|
68
|
+
"warningThresholdPercent",
|
|
69
|
+
"warnAt",
|
|
70
|
+
"warnAtPercent"
|
|
71
|
+
]);
|
|
72
|
+
return {
|
|
73
|
+
capUSD: cap.value,
|
|
74
|
+
warningThreshold: normalizeWarningThreshold(warning?.value),
|
|
75
|
+
source: cap.source
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function getConfiguredGlobalSpendCap() {
|
|
79
|
+
try {
|
|
80
|
+
return resolveGlobalSpendCapConfig(loadConfigSync());
|
|
81
|
+
} catch {
|
|
82
|
+
return resolveGlobalSpendCapConfig({});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function evaluateGlobalSpendCap(totalCostUSD, period, config = getConfiguredGlobalSpendCap()) {
|
|
86
|
+
const normalizedCost = Number.isFinite(totalCostUSD) && totalCostUSD > 0 ? totalCostUSD : 0;
|
|
87
|
+
if (!config) {
|
|
88
|
+
return {
|
|
89
|
+
configured: false,
|
|
90
|
+
period,
|
|
91
|
+
capUSD: null,
|
|
92
|
+
totalCostUSD: normalizedCost,
|
|
93
|
+
percentUsed: 0,
|
|
94
|
+
warningThresholdPercent: null,
|
|
95
|
+
status: "unconfigured",
|
|
96
|
+
message: "No global spend cap configured. Set tokenSpend.globalCapUSD in config.json or EXE_GLOBAL_SPEND_CAP_USD to enable spend warnings.",
|
|
97
|
+
source: null
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const percentUsed = Math.round(normalizedCost / config.capUSD * 100);
|
|
101
|
+
const status = normalizedCost >= config.capUSD ? "over_cap" : normalizedCost >= config.capUSD * config.warningThreshold ? "near_cap" : "ok";
|
|
102
|
+
const warningThresholdPercent = Math.round(config.warningThreshold * 100);
|
|
103
|
+
return {
|
|
104
|
+
configured: true,
|
|
105
|
+
period,
|
|
106
|
+
capUSD: config.capUSD,
|
|
107
|
+
totalCostUSD: normalizedCost,
|
|
108
|
+
percentUsed,
|
|
109
|
+
warningThresholdPercent,
|
|
110
|
+
status,
|
|
111
|
+
message: status === "over_cap" ? `Global spend cap exceeded for ${period}: $${normalizedCost.toFixed(2)} / $${config.capUSD.toFixed(2)} (${percentUsed}%).` : status === "near_cap" ? `Global spend is near cap for ${period}: $${normalizedCost.toFixed(2)} / $${config.capUSD.toFixed(2)} (${percentUsed}%, warning at ${warningThresholdPercent}%).` : `Global spend is within cap for ${period}: $${normalizedCost.toFixed(2)} / $${config.capUSD.toFixed(2)} (${percentUsed}%).`,
|
|
112
|
+
source: config.source
|
|
113
|
+
};
|
|
114
|
+
}
|
|
11
115
|
var MODEL_PRICING = {
|
|
12
116
|
// Opus 4.5+ ($5/$25 — Anthropic price drop from original Opus 4)
|
|
13
117
|
"claude-opus-4-7": { input: 5 / 1e6, output: 25 / 1e6, cacheRead: 0.5 / 1e6, cacheWrite: 6.25 / 1e6 },
|
|
@@ -223,6 +327,9 @@ function periodToCutoff(period) {
|
|
|
223
327
|
}
|
|
224
328
|
|
|
225
329
|
export {
|
|
330
|
+
resolveGlobalSpendCapConfig,
|
|
331
|
+
getConfiguredGlobalSpendCap,
|
|
332
|
+
evaluateGlobalSpendCap,
|
|
226
333
|
getPricing,
|
|
227
334
|
getAgentSpend
|
|
228
335
|
};
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
listWorkflowDefinitions,
|
|
3
3
|
runWorkflow,
|
|
4
4
|
startWorkflow
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5CZ2ZH6L.js";
|
|
6
6
|
import {
|
|
7
7
|
ingest
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-26GM62C3.js";
|
|
9
9
|
import {
|
|
10
10
|
initCRMBridge
|
|
11
11
|
} from "./chunk-ML4S5SHZ.js";
|