ai-spend-agent 0.5.7 → 0.5.8

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 (2) hide show
  1. package/dist/index.js +25 -15
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -94,7 +94,12 @@ async function quickstartCommand(args) {
94
94
  // Persona: --plan override wins; otherwise read the plans the coding agents
95
95
  // themselves persisted locally (read-only, whitelisted fields, no network).
96
96
  let detectedPlans;
97
- if (args.plan) {
97
+ if (args.sample) {
98
+ // An explicit sample run must be deterministic and safe to record/share.
99
+ // Never mix the developer's real local plan into illustrative output.
100
+ detectedPlans = [];
101
+ }
102
+ else if (args.plan) {
98
103
  const override = planOverrideFromFlag(args.plan);
99
104
  if (!override) {
100
105
  return {
@@ -114,7 +119,12 @@ async function quickstartCommand(args) {
114
119
  }
115
120
  // Surface auto-detected credentials so the user knows their next 2-min step,
116
121
  // without ever printing a raw secret.
117
- const detection = await detectLocalCredentials({ cwd: resolve(args.path) });
122
+ // Sample output is designed for demos, docs, and screenshots. Keeping local
123
+ // credential discovery out of that path prevents even redacted machine-
124
+ // specific hints from leaking into a recording.
125
+ const detection = args.sample
126
+ ? { credentials: [], scannedFiles: [] }
127
+ : await detectLocalCredentials({ cwd: resolve(args.path) });
118
128
  const nextSteps = quickstartNextSteps(mode, detection.credentials);
119
129
  // Dead-context cost, globalized across the user's whole Claude Code setup
120
130
  // (all projects' MCP + user-scope skills/agents/commands, vs. every
@@ -399,7 +409,7 @@ async function doctorCommand(args) {
399
409
  ? "your local agent logs (estimated at API-equivalent rates)"
400
410
  : "demo sample (illustrative)";
401
411
  const lines = [
402
- "AI Spend Analyst doctor",
412
+ "aibill doctor",
403
413
  `node version: ${process.version}`,
404
414
  `cli version: ${await cliVersion()}`,
405
415
  "local-first mode: enabled (no cloud upload, no telemetry)",
@@ -437,7 +447,7 @@ async function resetCommand(args) {
437
447
  if (!isNodeError(error, "ENOENT"))
438
448
  throw error;
439
449
  return ok([
440
- "AI Spend Analyst reset",
450
+ "aibill reset",
441
451
  `path: ${rootPath}`,
442
452
  "nothing to clear (no persisted spend state found)",
443
453
  "next run will re-read your real local agent logs (or demo sample if none)."
@@ -457,7 +467,7 @@ async function resetCommand(args) {
457
467
  }
458
468
  }
459
469
  return ok([
460
- "AI Spend Analyst reset",
470
+ "aibill reset",
461
471
  `path: ${rootPath}`,
462
472
  removed.length > 0 ? `cleared: ${removed.join(", ")}` : "nothing to clear (no persisted spend state found)",
463
473
  "next run will re-read your real local agent logs (or demo sample if none)."
@@ -469,7 +479,7 @@ async function initCommand(args) {
469
479
  await mkdir(stateDir, { recursive: true });
470
480
  const registry = createLocalFolderSourceRegistry(rootPath);
471
481
  await writeJson(join(stateDir, "manifest.json"), {
472
- product: "AI Spend Analyst Agent",
482
+ product: "aibill",
473
483
  mode: "local-first-demo",
474
484
  cloudUpload: false,
475
485
  cronJobsEnabled: false,
@@ -493,7 +503,7 @@ async function initCommand(args) {
493
503
  }
494
504
  ]));
495
505
  return ok([
496
- "AI Spend Analyst Agent init",
506
+ "aibill init",
497
507
  `path: ${rootPath}`,
498
508
  "demo mode: local-first sample workflow",
499
509
  "cloud upload: disabled",
@@ -570,7 +580,7 @@ async function scanCommand(args) {
570
580
  await writeJson(join(stateDir, "discovery.json"), discovery);
571
581
  await writeJson(join(stateDir, "missing-sources.json"), missingSourcePrompts);
572
582
  const lines = [
573
- "AI Spend Analyst Agent scan",
583
+ "aibill scan",
574
584
  `path: ${rootPath}`,
575
585
  "source registry: .ai-spend-agent/sources.json",
576
586
  "audit log: .ai-spend-agent/audit-log.json",
@@ -779,7 +789,7 @@ async function addSourceCommand(args) {
779
789
  detail: `${args.sourceType} approved via CLI add-source.`
780
790
  });
781
791
  return ok([
782
- "AI Spend Analyst Agent add-source",
792
+ "aibill add-source",
783
793
  `source added: ${id}`,
784
794
  `type: ${args.sourceType}`,
785
795
  `path: ${sourcePath}`,
@@ -792,7 +802,7 @@ async function listSourcesCommand(args) {
792
802
  const stateDir = join(rootPath, ".ai-spend-agent");
793
803
  const registry = await readSourceRegistry(stateDir, rootPath);
794
804
  const lines = [
795
- "AI Spend Analyst Agent sources",
805
+ "aibill sources",
796
806
  `approved sources: ${registry.approvedSources.length}`
797
807
  ];
798
808
  for (const source of registry.approvedSources) {
@@ -850,7 +860,7 @@ async function connectCommand(args) {
850
860
  const detection = await detectLocalCredentials({ cwd: rootPath });
851
861
  const detected = detection.credentials.find((credential) => credential.provider === provider);
852
862
  const lines = [
853
- "AI Spend Analyst Agent connect",
863
+ "aibill connect",
854
864
  `connector stub: ${source.id}`,
855
865
  `provider: ${provider}`,
856
866
  `type: ${type}`,
@@ -983,7 +993,7 @@ async function syncProviderCommand(args) {
983
993
  detail: `${args.provider} provider connector synced ${result.records.length} evidence records with ${result.coverage} coverage. Auth reference only; no raw secrets stored.`
984
994
  });
985
995
  return ok([
986
- "AI Spend Analyst Agent sync-provider",
996
+ "aibill sync-provider",
987
997
  `provider: ${result.provider}`,
988
998
  `source: ${result.source.id}`,
989
999
  `verification: ${result.source.verification}`,
@@ -1035,7 +1045,7 @@ async function confirmMappingCommand(args) {
1035
1045
  detail: `${args.provider} mapped to ${[args.team, args.project, args.workflow].filter(Boolean).join(" / ")}`
1036
1046
  });
1037
1047
  return ok([
1038
- "AI Spend Analyst Agent confirm-mapping",
1048
+ "aibill confirm-mapping",
1039
1049
  `mapping confirmed: ${mapping.id}`,
1040
1050
  `provider: ${mapping.provider}`,
1041
1051
  `target: ${[mapping.team, mapping.project, mapping.workflow].filter(Boolean).join(" / ")}`,
@@ -1054,7 +1064,7 @@ async function reportCommand(args) {
1054
1064
  await writeLocalReportFile(htmlPath, generateHtmlReport(reportInput), stateDir);
1055
1065
  const artifactPaths = await writeApplyArtifacts(stateDir, reportInput);
1056
1066
  return ok([
1057
- "AI Spend Analyst Agent report",
1067
+ "aibill report",
1058
1068
  `path: ${rootPath}`,
1059
1069
  `markdown: ${markdownPath}`,
1060
1070
  `html: ${htmlPath}`,
@@ -1139,7 +1149,7 @@ async function applyArtifactCommand(args) {
1139
1149
  // user can copy it right here instead of hunting for a file path.
1140
1150
  const codingPrompt = await readFile(artifactPaths.codingPrompt, "utf8");
1141
1151
  return ok([
1142
- "AI Spend Analyst Agent apply-artifact",
1152
+ "aibill apply-artifact",
1143
1153
  `path: ${rootPath}`,
1144
1154
  `action plan: ${artifactPaths.actionPlan}`,
1145
1155
  `policy/config draft: ${artifactPaths.policyConfigDraft}`,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-spend-agent",
3
- "version": "0.5.7",
4
- "description": "Local-first financial intelligence CLI for Claude Code and Codex activity, provider-reported cost, attribution, runway, provenance, and Context Health.",
3
+ "version": "0.5.8",
4
+ "description": "Local-first financial accountability CLI for Claude Code and Codex work, cost evidence, attribution, runway, provenance, and Context Health.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -54,8 +54,8 @@
54
54
  "prepack": "npm run build"
55
55
  },
56
56
  "dependencies": {
57
- "@agent-finops/core": "0.5.7",
58
- "@agent-finops/report": "0.5.7",
57
+ "@agent-finops/core": "0.5.8",
58
+ "@agent-finops/report": "0.5.8",
59
59
  "yocto-spinner": "^1.2.0"
60
60
  }
61
61
  }