@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.
Files changed (42) hide show
  1. package/dist/agent/session.js +75 -2
  2. package/dist/budget/index.js +9 -0
  3. package/dist/budget/session-budget.js +223 -0
  4. package/dist/checkpoint/diff.js +130 -0
  5. package/dist/checkpoint/git-store.js +52 -0
  6. package/dist/checkpoint/index.js +2 -0
  7. package/dist/checkpoint/run-rollback.js +100 -0
  8. package/dist/cli/command-catalog.js +144 -0
  9. package/dist/cli/commands/hooks.js +1 -1
  10. package/dist/cli/commands/rollback.js +21 -57
  11. package/dist/cli/commands/run.js +9 -2
  12. package/dist/cli/commands/test.js +28 -16
  13. package/dist/cli/session-commands.js +315 -69
  14. package/dist/cli/session-factory.js +13 -0
  15. package/dist/errors/constructors.js +22 -0
  16. package/dist/errors/types.js +15 -0
  17. package/dist/hooks/config.js +18 -0
  18. package/dist/hooks/index.js +1 -1
  19. package/dist/hooks/router.js +1 -1
  20. package/dist/hooks/service.js +4 -4
  21. package/dist/hooks/slash.js +10 -26
  22. package/dist/memory/secrets.js +43 -0
  23. package/dist/render/context-view.js +2 -2
  24. package/dist/render/plan-view.js +1 -1
  25. package/dist/render/status-view.js +5 -5
  26. package/dist/render/units.js +22 -0
  27. package/dist/session/index.js +1 -0
  28. package/dist/session/log.js +19 -0
  29. package/dist/session/redact.js +74 -0
  30. package/dist/session/replay.js +16 -0
  31. package/dist/session/resume.js +8 -0
  32. package/dist/session/types.js +38 -0
  33. package/dist/subagent/orchestrator.js +82 -5
  34. package/dist/theme/resolve.js +1 -0
  35. package/dist/tui/app.js +7 -4
  36. package/dist/tui/approval-overlay.js +7 -1
  37. package/dist/tui/layout.js +7 -2
  38. package/dist/tui/limits-panel.js +6 -14
  39. package/dist/tui/palette.js +11 -19
  40. package/dist/usage/weighted.js +14 -0
  41. package/dist/utils/disk.js +11 -3
  42. package/package.json +2 -2
@@ -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.
@@ -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
- /** `2% free · 8.1 GiB of 465 GiB` — the percentage first, since that's the read. */
93
- export function formatCapacity(capacity) {
94
- return `${capacity.freePercent}% free · ${formatBytes(capacity.freeBytes)} of ${formatBytes(capacity.totalBytes)}`;
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.5.0",
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 --noEmit",
55
+ "typecheck": "tsc -p tsconfig.typecheck.json",
56
56
  "clean": "rm -rf dist",
57
57
  "test": "vitest run"
58
58
  }