@cruxy/cli 1.5.0 → 1.6.0
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/agent/session.js +75 -2
- package/dist/budget/index.js +9 -0
- package/dist/budget/session-budget.js +223 -0
- package/dist/checkpoint/diff.js +130 -0
- package/dist/checkpoint/git-store.js +52 -0
- package/dist/checkpoint/index.js +2 -0
- package/dist/checkpoint/run-rollback.js +100 -0
- package/dist/cli/command-catalog.js +144 -0
- package/dist/cli/commands/hooks.js +1 -1
- package/dist/cli/commands/rollback.js +21 -57
- package/dist/cli/commands/run.js +9 -2
- package/dist/cli/commands/test.js +28 -16
- package/dist/cli/session-commands.js +315 -69
- package/dist/cli/session-factory.js +13 -0
- package/dist/errors/constructors.js +22 -0
- package/dist/errors/types.js +15 -0
- package/dist/hooks/config.js +18 -0
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/router.js +1 -1
- package/dist/hooks/service.js +4 -4
- package/dist/hooks/slash.js +10 -26
- package/dist/memory/secrets.js +43 -0
- package/dist/render/context-view.js +2 -2
- package/dist/render/plan-view.js +1 -1
- package/dist/render/status-view.js +5 -5
- package/dist/render/units.js +22 -0
- package/dist/session/index.js +1 -0
- package/dist/session/log.js +19 -0
- package/dist/session/redact.js +74 -0
- package/dist/session/replay.js +16 -0
- package/dist/session/resume.js +8 -0
- package/dist/session/types.js +38 -0
- package/dist/subagent/orchestrator.js +82 -5
- package/dist/theme/resolve.js +1 -0
- package/dist/tui/app.js +7 -4
- package/dist/tui/approval-overlay.js +7 -1
- package/dist/tui/layout.js +7 -2
- package/dist/tui/limits-panel.js +6 -14
- package/dist/tui/palette.js +11 -19
- package/dist/usage/weighted.js +14 -0
- package/dist/utils/disk.js +11 -3
- package/package.json +2 -2
package/dist/usage/weighted.js
CHANGED
|
@@ -41,6 +41,20 @@ export const TIER_MULTIPLIERS = {
|
|
|
41
41
|
export function multiplierForTier(tier) {
|
|
42
42
|
return TIER_MULTIPLIERS[tier];
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* The heaviest multiplier any chat tier carries.
|
|
46
|
+
*
|
|
47
|
+
* FOR ADMISSION ONLY, never for accounting. A request routed `auto` has no tier
|
|
48
|
+
* until the gateway answers, so an admission check that must decide BEFORE the
|
|
49
|
+
* request has to assume something — and the only safe assumption is the most
|
|
50
|
+
* expensive one. Assuming the cheapest (or skipping the check) admits a batch
|
|
51
|
+
* that then trips a sliding window which refills by trickle over twelve hours.
|
|
52
|
+
*
|
|
53
|
+
* {@link weightedFor} deliberately does NOT use this: after the fact the tier is
|
|
54
|
+
* known, and substituting a guess there would be exactly the confidently-wrong
|
|
55
|
+
* number that function's doc comment refuses to produce.
|
|
56
|
+
*/
|
|
57
|
+
export const MAX_TIER_MULTIPLIER = Math.max(...Object.values(TIER_MULTIPLIERS));
|
|
44
58
|
/**
|
|
45
59
|
* Weighted tokens for one request's figures, or `undefined` when the request
|
|
46
60
|
* cannot be weighed honestly.
|
package/dist/utils/disk.js
CHANGED
|
@@ -89,7 +89,15 @@ export function formatBytes(bytes) {
|
|
|
89
89
|
const digits = unit > 0 && value < 10 ? 1 : 0;
|
|
90
90
|
return `${value.toFixed(digits)} ${UNITS[unit]}`;
|
|
91
91
|
}
|
|
92
|
-
/**
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
/**
|
|
93
|
+
* `2% free · 8.1 GiB of 465 GiB` — the percentage first, since that's the read.
|
|
94
|
+
*
|
|
95
|
+
* The joiner is a PARAMETER rather than a literal: this module has no theme (it
|
|
96
|
+
* is a `statfs` reader, not a renderer), and a hardcoded `·` would survive
|
|
97
|
+
* `CRUXY_ASCII` and `TERM=dumb` on a terminal that renders it as mojibake, and
|
|
98
|
+
* announce as noise to a screen reader. Callers pass `theme.glyph.sep`; the
|
|
99
|
+
* default keeps every existing caller and every log line unchanged.
|
|
100
|
+
*/
|
|
101
|
+
export function formatCapacity(capacity, sep = "·") {
|
|
102
|
+
return `${capacity.freePercent}% free ${sep} ${formatBytes(capacity.freeBytes)} of ${formatBytes(capacity.totalBytes)}`;
|
|
95
103
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cruxy/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "an agentic coding CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"build": "tsc -p tsconfig.json",
|
|
53
53
|
"dev": "tsx src/index.ts",
|
|
54
54
|
"start": "node dist/index.js",
|
|
55
|
-
"typecheck": "tsc
|
|
55
|
+
"typecheck": "tsc -p tsconfig.typecheck.json",
|
|
56
56
|
"clean": "rm -rf dist",
|
|
57
57
|
"test": "vitest run"
|
|
58
58
|
}
|