agent-cost-analyzer 0.0.0 → 0.16.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 (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -5
  3. package/THIRD-PARTY-NOTICES.md +3510 -0
  4. package/bin/agent-cost-analyzer.js +22 -0
  5. package/bin/node-gate.js +41 -0
  6. package/dist/cli.js +315313 -0
  7. package/dist/data/learn-scripts/cache-basics.json +163 -0
  8. package/dist/data/learn-scripts/cache-ttl-1-hour-breakpoint.json +176 -0
  9. package/dist/data/learn-scripts/cache-ttl-smoke-break.json +190 -0
  10. package/dist/data/learn-scripts/cascading-model-switch-then-ttl-lapse.json +121 -0
  11. package/dist/data/learn-scripts/clear.json +133 -0
  12. package/dist/data/learn-scripts/compaction.json +98 -0
  13. package/dist/data/learn-scripts/image-attachment-invalidation.json +108 -0
  14. package/dist/data/learn-scripts/inline-exploration-bloat.json +115 -0
  15. package/dist/data/learn-scripts/instructions-edit.json +99 -0
  16. package/dist/data/learn-scripts/mcp-tool-change.json +93 -0
  17. package/dist/data/learn-scripts/model-switch.json +88 -0
  18. package/dist/data/learn-scripts/reasoning-budget-toggle.json +98 -0
  19. package/dist/data/learn-scripts/rewind.json +139 -0
  20. package/dist/data/learn-scripts/session-forking-multi-branch.json +124 -0
  21. package/dist/data/learn-scripts/session-forking.json +99 -0
  22. package/dist/data/learn-scripts/silent-instructions-pullin.json +104 -0
  23. package/dist/data/learn-scripts/subagent-cheaper-model.json +70 -0
  24. package/dist/data/learn-scripts/subagent-session.json +70 -0
  25. package/dist/data/price-book/anthropic-api.json +662 -0
  26. package/dist/data/price-book/github-copilot.json +1402 -0
  27. package/dist/data/price-book/google-api.json +507 -0
  28. package/dist/data/price-book/openai-api.json +1184 -0
  29. package/dist/data/vendor-profiles/anthropic.json +568 -0
  30. package/dist/data/vendor-profiles/google.json +190 -0
  31. package/dist/data/vendor-profiles/microsoft.json +96 -0
  32. package/dist/data/vendor-profiles/moonshot.json +115 -0
  33. package/dist/data/vendor-profiles/openai.json +442 -0
  34. package/dist/data/vendor-profiles/xai.json +217 -0
  35. package/dist/mcp-apps/views.html +124 -0
  36. package/dist/web/assets/commit-mono-latin-400-normal-s0S3qwFW.woff +0 -0
  37. package/dist/web/assets/commit-mono-latin-400-normal-wzhe4RuD.woff2 +0 -0
  38. package/dist/web/assets/commit-mono-latin-700-normal-1-GU0IUE.woff +0 -0
  39. package/dist/web/assets/commit-mono-latin-700-normal-DU8mrtj2.woff2 +0 -0
  40. package/dist/web/assets/index-DeqVluBu.js +76 -0
  41. package/dist/web/assets/index-EJpifWDV.css +1 -0
  42. package/dist/web/assets/source-serif-4-latin-400-normal-C1O10bxN.woff +0 -0
  43. package/dist/web/assets/source-serif-4-latin-400-normal-DJ5YJwmz.woff2 +0 -0
  44. package/dist/web/assets/source-serif-4-latin-600-normal-DeJomR3S.woff +0 -0
  45. package/dist/web/assets/source-serif-4-latin-600-normal-DouSKlru.woff2 +0 -0
  46. package/dist/web/index.html +32 -0
  47. package/package.json +18 -4
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ // SPDX-FileCopyrightText: 2026 Raul Kivi
3
+ // SPDX-License-Identifier: MIT
4
+ // Unbundled shim: Node version gate, warning filter, then the bundled CLI.
5
+ // Plain ES2017 so it parses on any Node that can load an ES module.
6
+ /* global process */
7
+ import { createWarningFilter, isSupportedNode, unsupportedNodeMessage } from "./node-gate.js";
8
+
9
+ if (!isSupportedNode(process.versions.node)) {
10
+ process.stderr.write(unsupportedNodeMessage(process.versions.node) + "\n");
11
+ process.exit(1);
12
+ } else {
13
+ process.emitWarning = createWarningFilter(process.emitWarning);
14
+ import("../dist/cli.js").catch(function (error) {
15
+ if (error && error.code === "ERR_MODULE_NOT_FOUND" && /dist[\\/]cli\.js/.test(String(error.message))) {
16
+ process.stderr.write("agent-cost-analyzer: dist/cli.js is missing; this package is not built.\n");
17
+ } else {
18
+ process.stderr.write(String((error && error.stack) || error) + "\n");
19
+ }
20
+ process.exit(1);
21
+ });
22
+ }
@@ -0,0 +1,41 @@
1
+ // SPDX-FileCopyrightText: 2026 Raul Kivi
2
+ // SPDX-License-Identifier: MIT
3
+ // Helpers of the bin shim. Ships unbundled and runs before anything else, so
4
+ // it stays ES2017, dependency-free and free of node: imports.
5
+
6
+ var MIN = [22, 18, 0];
7
+
8
+ export function isSupportedNode(version) {
9
+ var match = /^(\d+)\.(\d+)\.(\d+)/.exec(String(version));
10
+ if (!match) return false;
11
+ for (var i = 0; i < 3; i++) {
12
+ var have = Number(match[i + 1]);
13
+ if (have !== MIN[i]) return have > MIN[i];
14
+ }
15
+ return true;
16
+ }
17
+
18
+ export function unsupportedNodeMessage(version) {
19
+ return "Agent Cost Analyzer needs Node.js 22.18 or newer; this is " + version;
20
+ }
21
+
22
+ function warningType(warning, rest) {
23
+ var second = rest[0];
24
+ if (typeof second === "string") return second;
25
+ if (second && typeof second === "object" && typeof second.type === "string") return second.type;
26
+ return warning && typeof warning === "object" ? warning.name : "Warning";
27
+ }
28
+
29
+ function isSqliteExperimentalWarning(warning, rest) {
30
+ var text = typeof warning === "string" ? warning : warning && warning.message;
31
+ return warningType(warning, rest) === "ExperimentalWarning" && typeof text === "string" && /SQLite/.test(text);
32
+ }
33
+
34
+ // Wraps process.emitWarning: only the node:sqlite ExperimentalWarning is
35
+ // dropped; every other warning still reaches the original.
36
+ export function createWarningFilter(original) {
37
+ return function filteredEmitWarning(warning, ...rest) {
38
+ if (isSqliteExperimentalWarning(warning, rest)) return undefined;
39
+ return original.call(this, warning, ...rest);
40
+ };
41
+ }