ai-spend-agent 0.2.2 → 0.4.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/index.d.ts CHANGED
@@ -5,4 +5,10 @@ export type CliResult = {
5
5
  stderr: string;
6
6
  };
7
7
  export declare function runCli(argv?: string[]): Promise<CliResult>;
8
+ /**
9
+ * Full bin entrypoint (node guard, spinner, error voice, exit code).
10
+ * Exported so the thin alias packages (`aispend`, `aireceipt`) run the EXACT
11
+ * same path without duplicating it — one CLI, several names.
12
+ */
13
+ export declare function runMain(): Promise<void>;
8
14
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ export async function runCli(argv = process.argv.slice(2)) {
41
41
  if (args.command === "report-card") {
42
42
  return reportCardCommand(args);
43
43
  }
44
- if (args.command === "apply-artifact") {
44
+ if (args.command === "apply-artifact" || args.command === "apply") {
45
45
  return applyArtifactCommand(args);
46
46
  }
47
47
  if (args.command === "add-source") {
@@ -68,7 +68,9 @@ export async function runCli(argv = process.argv.slice(2)) {
68
68
  async function quickstartCommand(args) {
69
69
  const { records, mode, warnings } = await loadInstantReadData(args);
70
70
  const summary = analyzeSpend(records);
71
- const groupBy = args.groupBy ?? "model";
71
+ // For real local-log users the by-project view is the flagship table
72
+ // ("which project burns my plan"); demo/connected keep by-model.
73
+ const groupBy = args.groupBy ?? (mode === "local-logs" ? "project" : "model");
72
74
  const color = args.noColor ? false : undefined;
73
75
  // Persona: --plan override wins; otherwise read the plans the coding agents
74
76
  // themselves persisted locally (read-only, whitelisted fields, no network).
@@ -1327,7 +1329,8 @@ function helpText() {
1327
1329
  " [--group-by source|model|client|project|agent|user|workspace|apiKey] Default: model",
1328
1330
  " report [--out <name>] Generate local Markdown and HTML reports",
1329
1331
  " report-card [--out f.svg] Write your AI Receipt — a redacted, shareable SVG + caption",
1330
- " apply-artifact Generate coding prompt, action plan, policy/config, verification, demo package",
1332
+ " apply Print the paste-ready coding-agent prompt + write action/policy/verification plans",
1333
+ " apply-artifact Same as `apply` (long form)",
1331
1334
  "",
1332
1335
  "Cron (production watch): add a crontab entry such as:",
1333
1336
  " 0 * * * * cd /path/to/workspace && ai-spend-agent watch --interval 3600 --cycles 1 >> ai-spend-watch.log 2>&1",
@@ -1350,7 +1353,12 @@ const invokedAsMain = (() => {
1350
1353
  return false;
1351
1354
  }
1352
1355
  })();
1353
- if (invokedAsMain) {
1356
+ /**
1357
+ * Full bin entrypoint (node guard, spinner, error voice, exit code).
1358
+ * Exported so the thin alias packages (`aispend`, `aireceipt`) run the EXACT
1359
+ * same path without duplicating it — one CLI, several names.
1360
+ */
1361
+ export async function runMain() {
1354
1362
  // Fail with a clear message on old Node instead of a cryptic module/syntax
1355
1363
  // error deep in a dependency. npm warns on engines but never blocks install.
1356
1364
  const major = Number(process.versions.node.split(".")[0]);
@@ -1403,4 +1411,7 @@ if (invokedAsMain) {
1403
1411
  }
1404
1412
  process.exitCode = result.exitCode;
1405
1413
  }
1414
+ if (invokedAsMain) {
1415
+ await runMain();
1416
+ }
1406
1417
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-spend-agent",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
4
  "description": "Your AI spend in one view, in 90 seconds — local-first CLI for OpenAI, Anthropic, Cursor, Copilot + Claude Code/Codex session logs, with a ranked savings cut list, and flags the tools your agent loads but never uses (dead context).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -49,8 +49,8 @@
49
49
  "prepack": "npm run build"
50
50
  },
51
51
  "dependencies": {
52
- "@agent-finops/core": "0.2.2",
53
- "@agent-finops/report": "0.2.2",
52
+ "@agent-finops/core": "0.4.0",
53
+ "@agent-finops/report": "0.4.0",
54
54
  "yocto-spinner": "^1.2.0"
55
55
  }
56
56
  }