@hasna/economy 0.2.2 → 0.2.3

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/cli/index.js CHANGED
@@ -1033,7 +1033,7 @@ import chalk2 from "chalk";
1033
1033
  import { randomUUID as randomUUID2 } from "crypto";
1034
1034
  import { execSync } from "child_process";
1035
1035
  var program = new Command;
1036
- program.name("economy").description("AI coding cost tracker \u2014 Claude Code, Codex, and Gemini").version("0.1.1");
1036
+ program.name("economy").description("AI coding cost tracker \u2014 Claude Code, Codex, and Gemini").version("0.2.2");
1037
1037
  async function autoSync() {
1038
1038
  const db = openDatabase();
1039
1039
  ensurePricingSeeded(db);
@@ -0,0 +1,13 @@
1
+ export interface EconomyConfig {
2
+ port: number;
3
+ 'default-period': string;
4
+ 'auto-sync': boolean;
5
+ 'sync-interval': number;
6
+ 'alert-thresholds': number[];
7
+ 'webhook-url': string | null;
8
+ }
9
+ export declare function loadConfig(): EconomyConfig;
10
+ export declare function saveConfig(config: EconomyConfig): void;
11
+ export declare function getConfigValue(key: string): unknown;
12
+ export declare function setConfigValue(key: string, value: string): void;
13
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAWD,wBAAgB,UAAU,IAAI,aAAa,CAQ1C;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAItD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGnD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAW/D"}
@@ -0,0 +1,3 @@
1
+ import type { Database } from 'bun:sqlite';
2
+ export declare function checkAndFireWebhooks(db: Database): Promise<void>;
3
+ //# sourceMappingURL=webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/lib/webhooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBtE"}
package/dist/mcp/index.js CHANGED
@@ -391,6 +391,7 @@ var init_database = () => {};
391
391
 
392
392
  // src/mcp/index.ts
393
393
  init_database();
394
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
394
395
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
395
396
  import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
396
397
 
@@ -595,6 +596,7 @@ async function ingestCodex(db, verbose = false) {
595
596
  init_pricing();
596
597
  var db = openDatabase();
597
598
  ensurePricingSeeded(db);
599
+ var server = new Server({ name: "economy", version: "0.2.2" }, { capabilities: { tools: {} } });
598
600
  var fmtUsd = (n) => "$" + n.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
599
601
  var fmtTok = (n) => n >= 1e9 ? `${(n / 1e9).toFixed(1)}B` : n >= 1e6 ? `${(n / 1e6).toFixed(1)}M` : n >= 1000 ? `${(n / 1000).toFixed(1)}k` : String(n);
600
602
  function fmtSession(s) {
@@ -1 +1 @@
1
- {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/server/serve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAoC1C,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,IACV,KAAK,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC,CA2I/D;AAED,wBAAgB,WAAW,CAAC,IAAI,SAAO,GAAG,IAAI,CAuC7C"}
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/server/serve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AA0C1C,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,IACV,KAAK,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC,CA6I/D;AAED,wBAAgB,WAAW,CAAC,IAAI,SAAO,GAAG,IAAI,CAuC7C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/economy",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "AI coding cost tracker — CLI + MCP server + REST API + web dashboard for Claude Code, Codex, and Gemini",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",