ccusage 12.0.0 → 12.1.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.
@@ -1,5 +1,5 @@
1
- import { PricingFetcher, __commonJSMin, __require, __toESM, arrayType, numberType, objectType, require_usingCtx, stringType } from "./pricing-fetcher-3m6_Ejp8.js";
2
- import { logger } from "./logger-CTFDCX5W.js";
1
+ import { PricingFetcher, __commonJSMin, __require, __toESM, arrayType, numberType, objectType, require_usingCtx, stringType } from "./pricing-fetcher-D-PICoFg.js";
2
+ import { logger } from "./logger-D_tmxNpg.js";
3
3
  import a, { readFile } from "node:fs/promises";
4
4
  import F, { homedir } from "node:os";
5
5
  import path from "node:path";
@@ -1,4 +1,4 @@
1
- import "./pricing-fetcher-3m6_Ejp8.js";
2
- import { calculateCostForEntry, createUniqueHash, dailyUsageSchema, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema } from "./data-loader-rsgRy-no.js";
3
- import "./logger-CTFDCX5W.js";
1
+ import "./pricing-fetcher-D-PICoFg.js";
2
+ import { calculateCostForEntry, createUniqueHash, dailyUsageSchema, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema } from "./data-loader-Bw3RIMwp.js";
3
+ import "./logger-D_tmxNpg.js";
4
4
  export { calculateCostForEntry, createUniqueHash, dailyUsageSchema, formatDate, formatDateCompact, getDefaultClaudePath, getEarliestTimestamp, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, usageDataSchema };
@@ -1,6 +1,6 @@
1
- import { PricingFetcher, __toESM, require_usingCtx } from "./pricing-fetcher-3m6_Ejp8.js";
2
- import { glob, usageDataSchema } from "./data-loader-rsgRy-no.js";
3
- import { logger } from "./logger-CTFDCX5W.js";
1
+ import { PricingFetcher, __toESM, require_usingCtx } from "./pricing-fetcher-D-PICoFg.js";
2
+ import { glob, usageDataSchema } from "./data-loader-Bw3RIMwp.js";
3
+ import { logger } from "./logger-D_tmxNpg.js";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import { homedir } from "node:os";
6
6
  import path from "node:path";
package/dist/debug.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./pricing-fetcher-3m6_Ejp8.js";
2
- import "./data-loader-rsgRy-no.js";
3
- import "./logger-CTFDCX5W.js";
4
- import { detectMismatches, printMismatchReport } from "./debug-BhnEVNbA.js";
1
+ import "./pricing-fetcher-D-PICoFg.js";
2
+ import "./data-loader-Bw3RIMwp.js";
3
+ import "./logger-D_tmxNpg.js";
4
+ import { detectMismatches, printMismatchReport } from "./debug-pK9in0EG.js";
5
5
  export { detectMismatches, printMismatchReport };
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { CostModes, SortOrders, __commonJSMin, __require, __toESM, dateSchema } from "./pricing-fetcher-3m6_Ejp8.js";
2
+ import { CostModes, SortOrders, __commonJSMin, __require, __toESM, dateSchema } from "./pricing-fetcher-D-PICoFg.js";
3
3
  import { calculateTotals, createTotalsObject, getTotalTokens } from "./calculate-cost-D3IraeGW.js";
4
- import { DEFAULT_SESSION_DURATION_HOURS, calculateBurnRate, filterRecentBlocks, formatDateCompact, getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, projectBlockUsage } from "./data-loader-rsgRy-no.js";
5
- import { description, log, logger, name, version } from "./logger-CTFDCX5W.js";
6
- import { detectMismatches, printMismatchReport } from "./debug-BhnEVNbA.js";
7
- import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-Cg5potQX.js";
4
+ import { DEFAULT_SESSION_DURATION_HOURS, calculateBurnRate, filterRecentBlocks, formatDateCompact, getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, projectBlockUsage } from "./data-loader-Bw3RIMwp.js";
5
+ import { description, log, logger, name, version } from "./logger-D_tmxNpg.js";
6
+ import { detectMismatches, printMismatchReport } from "./debug-pK9in0EG.js";
7
+ import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-DysXlvnH.js";
8
8
  import process$1 from "node:process";
9
9
  import { createServer } from "http";
10
10
  import { Http2ServerRequest } from "http2";
@@ -951,7 +951,7 @@ function _getDefaultLogLevel() {
951
951
  }
952
952
  const consola = createConsola$1();
953
953
  var name = "ccusage";
954
- var version = "12.0.0";
954
+ var version = "12.1.0";
955
955
  var description = "Usage analysis tool for Claude Code";
956
956
  /**
957
957
  * Application logger instance with package name tag
package/dist/logger.js CHANGED
@@ -1,2 +1,2 @@
1
- import { log, logger } from "./logger-CTFDCX5W.js";
1
+ import { log, logger } from "./logger-D_tmxNpg.js";
2
2
  export { log, logger };
@@ -1,6 +1,6 @@
1
- import { ZodFirstPartyTypeKind, ZodOptional, ZodType, __commonJSMin, __require, __toESM, arrayType, booleanType, dateSchema, discriminatedUnionType, enumType, literalType, numberType, objectType, optionalType, recordType, require_usingCtx, stringType, unionType, unknownType } from "./pricing-fetcher-3m6_Ejp8.js";
2
- import { getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData } from "./data-loader-rsgRy-no.js";
3
- import { logger, name, version } from "./logger-CTFDCX5W.js";
1
+ import { ZodFirstPartyTypeKind, ZodOptional, ZodType, __commonJSMin, __require, __toESM, arrayType, booleanType, dateSchema, discriminatedUnionType, enumType, literalType, numberType, objectType, optionalType, recordType, require_usingCtx, stringType, unionType, unknownType } from "./pricing-fetcher-D-PICoFg.js";
2
+ import { getDefaultClaudePath, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData } from "./data-loader-Bw3RIMwp.js";
3
+ import { logger, name, version } from "./logger-D_tmxNpg.js";
4
4
  import process$1 from "node:process";
5
5
  import util from "node:util";
6
6
  import { randomUUID } from "node:crypto";
@@ -19535,6 +19535,7 @@ var compose = (middleware, onError$2, onNotFound) => {
19535
19535
  }
19536
19536
  };
19537
19537
  };
19538
+ var GET_MATCH_RESULT = Symbol();
19538
19539
  var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
19539
19540
  const { all = false, dot = false } = options;
19540
19541
  const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
@@ -19569,7 +19570,8 @@ function convertFormDataToBodyData(formData, options) {
19569
19570
  var handleParsingAllValues = (form, key$1, value) => {
19570
19571
  if (form[key$1] !== void 0) if (Array.isArray(form[key$1])) form[key$1].push(value);
19571
19572
  else form[key$1] = [form[key$1], value];
19572
- else form[key$1] = value;
19573
+ else if (!key$1.endsWith("[]")) form[key$1] = value;
19574
+ else form[key$1] = [value];
19573
19575
  };
19574
19576
  var handleParsingNestedValues = (form, key$1, value) => {
19575
19577
  let nestedForm = form;
@@ -19582,62 +19584,6 @@ var handleParsingNestedValues = (form, key$1, value) => {
19582
19584
  }
19583
19585
  });
19584
19586
  };
19585
- var splitPath = (path) => {
19586
- const paths = path.split("/");
19587
- if (paths[0] === "") paths.shift();
19588
- return paths;
19589
- };
19590
- var splitRoutingPath = (routePath) => {
19591
- const { groups, path } = extractGroupsFromPath(routePath);
19592
- const paths = splitPath(path);
19593
- return replaceGroupMarks(paths, groups);
19594
- };
19595
- var extractGroupsFromPath = (path) => {
19596
- const groups = [];
19597
- path = path.replace(/\{[^}]+\}/g, (match, index) => {
19598
- const mark = `@${index}`;
19599
- groups.push([mark, match]);
19600
- return mark;
19601
- });
19602
- return {
19603
- groups,
19604
- path
19605
- };
19606
- };
19607
- var replaceGroupMarks = (paths, groups) => {
19608
- for (let i$3 = groups.length - 1; i$3 >= 0; i$3--) {
19609
- const [mark] = groups[i$3];
19610
- for (let j = paths.length - 1; j >= 0; j--) if (paths[j].includes(mark)) {
19611
- paths[j] = paths[j].replace(mark, groups[i$3][1]);
19612
- break;
19613
- }
19614
- }
19615
- return paths;
19616
- };
19617
- var patternCache = {};
19618
- var getPattern = (label, next) => {
19619
- if (label === "*") return "*";
19620
- const match = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
19621
- if (match) {
19622
- const cacheKey = `${label}#${next}`;
19623
- if (!patternCache[cacheKey]) if (match[2]) patternCache[cacheKey] = next && next[0] !== ":" && next[0] !== "*" ? [
19624
- cacheKey,
19625
- match[1],
19626
- new RegExp(`^${match[2]}(?=/${next})`)
19627
- ] : [
19628
- label,
19629
- match[1],
19630
- new RegExp(`^${match[2]}$`)
19631
- ];
19632
- else patternCache[cacheKey] = [
19633
- label,
19634
- match[1],
19635
- true
19636
- ];
19637
- return patternCache[cacheKey];
19638
- }
19639
- return null;
19640
- };
19641
19587
  var tryDecode = (str, decoder) => {
19642
19588
  try {
19643
19589
  return decoder(str);
@@ -19654,7 +19600,7 @@ var tryDecode = (str, decoder) => {
19654
19600
  var tryDecodeURI = (str) => tryDecode(str, decodeURI);
19655
19601
  var getPath = (request) => {
19656
19602
  const url = request.url;
19657
- const start = url.indexOf("/", 8);
19603
+ const start = url.indexOf("/", url.charCodeAt(9) === 58 ? 13 : 8);
19658
19604
  let i$3 = start;
19659
19605
  for (; i$3 < url.length; i$3++) {
19660
19606
  const charCode = url.charCodeAt(i$3);
@@ -19674,27 +19620,10 @@ var mergePath = (base, sub, ...rest) => {
19674
19620
  if (rest.length) sub = mergePath(sub, ...rest);
19675
19621
  return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`;
19676
19622
  };
19677
- var checkOptionalParameter = (path) => {
19678
- if (path.charCodeAt(path.length - 1) !== 63 || !path.includes(":")) return null;
19679
- const segments = path.split("/");
19680
- const results = [];
19681
- let basePath$1 = "";
19682
- segments.forEach((segment) => {
19683
- if (segment !== "" && !/\:/.test(segment)) basePath$1 += "/" + segment;
19684
- else if (/\:/.test(segment)) if (/\?/.test(segment)) {
19685
- if (results.length === 0 && basePath$1 === "") results.push("/");
19686
- else results.push(basePath$1);
19687
- const optionalSegment = segment.replace("?", "");
19688
- basePath$1 += "/" + optionalSegment;
19689
- results.push(basePath$1);
19690
- } else basePath$1 += "/" + segment;
19691
- });
19692
- return results.filter((v, i$3, a) => a.indexOf(v) === i$3);
19693
- };
19694
19623
  var _decodeURI = (value) => {
19695
19624
  if (!/[%+]/.test(value)) return value;
19696
19625
  if (value.indexOf("+") !== -1) value = value.replace(/\+/g, " ");
19697
- return value.indexOf("%") !== -1 ? decodeURIComponent_(value) : value;
19626
+ return value.indexOf("%") !== -1 ? tryDecode(value, decodeURIComponent_) : value;
19698
19627
  };
19699
19628
  var _getQueryParam = (url, key$1, multiple) => {
19700
19629
  let encoded;
@@ -19831,6 +19760,9 @@ var HonoRequest = class {
19831
19760
  get method() {
19832
19761
  return this.raw.method;
19833
19762
  }
19763
+ get [GET_MATCH_RESULT]() {
19764
+ return this.#matchResult;
19765
+ }
19834
19766
  get matchedRoutes() {
19835
19767
  return this.#matchResult[0].map(([[, route]]) => route);
19836
19768
  }
@@ -19867,9 +19799,11 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer$1) =
19867
19799
  else return resStr;
19868
19800
  };
19869
19801
  var TEXT_PLAIN = "text/plain; charset=UTF-8";
19870
- var setHeaders = (headers, map$1 = {}) => {
19871
- for (const key$1 of Object.keys(map$1)) headers.set(key$1, map$1[key$1]);
19872
- return headers;
19802
+ var setDefaultContentType = (contentType$1, headers) => {
19803
+ return {
19804
+ "Content-Type": contentType$1,
19805
+ ...headers
19806
+ };
19873
19807
  };
19874
19808
  var Context = class {
19875
19809
  #rawRequest;
@@ -19878,15 +19812,13 @@ var Context = class {
19878
19812
  #var;
19879
19813
  finalized = false;
19880
19814
  error;
19881
- #status = 200;
19815
+ #status;
19882
19816
  #executionCtx;
19883
- #headers;
19884
- #preparedHeaders;
19885
19817
  #res;
19886
- #isFresh = true;
19887
19818
  #layout;
19888
19819
  #renderer;
19889
19820
  #notFoundHandler;
19821
+ #preparedHeaders;
19890
19822
  #matchResult;
19891
19823
  #path;
19892
19824
  constructor(req, options) {
@@ -19912,11 +19844,9 @@ var Context = class {
19912
19844
  else throw Error("This context has no ExecutionContext");
19913
19845
  }
19914
19846
  get res() {
19915
- this.#isFresh = false;
19916
- return this.#res ||= new Response("404 Not Found", { status: 404 });
19847
+ return this.#res ||= new Response(null, { headers: this.#preparedHeaders ??= new Headers() });
19917
19848
  }
19918
19849
  set res(_res) {
19919
- this.#isFresh = false;
19920
19850
  if (this.#res && _res) {
19921
19851
  _res = new Response(_res.body, _res);
19922
19852
  for (const [k, v] of this.#res.headers.entries()) {
@@ -19942,29 +19872,12 @@ var Context = class {
19942
19872
  };
19943
19873
  header = (name$1, value, options) => {
19944
19874
  if (this.finalized) this.#res = new Response(this.#res.body, this.#res);
19945
- if (value === void 0) {
19946
- if (this.#headers) this.#headers.delete(name$1);
19947
- else if (this.#preparedHeaders) delete this.#preparedHeaders[name$1.toLocaleLowerCase()];
19948
- if (this.finalized) this.res.headers.delete(name$1);
19949
- return;
19950
- }
19951
- if (options?.append) {
19952
- if (!this.#headers) {
19953
- this.#isFresh = false;
19954
- this.#headers = new Headers(this.#preparedHeaders);
19955
- this.#preparedHeaders = {};
19956
- }
19957
- this.#headers.append(name$1, value);
19958
- } else if (this.#headers) this.#headers.set(name$1, value);
19959
- else {
19960
- this.#preparedHeaders ??= {};
19961
- this.#preparedHeaders[name$1.toLowerCase()] = value;
19962
- }
19963
- if (this.finalized) if (options?.append) this.res.headers.append(name$1, value);
19964
- else this.res.headers.set(name$1, value);
19875
+ const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers();
19876
+ if (value === void 0) headers.delete(name$1);
19877
+ else if (options?.append) headers.append(name$1, value);
19878
+ else headers.set(name$1, value);
19965
19879
  };
19966
19880
  status = (status$1) => {
19967
- this.#isFresh = false;
19968
19881
  this.#status = status$1;
19969
19882
  };
19970
19883
  set = (key$1, value) => {
@@ -19979,71 +19892,37 @@ var Context = class {
19979
19892
  return Object.fromEntries(this.#var);
19980
19893
  }
19981
19894
  #newResponse(data, arg, headers) {
19982
- if (this.#isFresh && !headers && !arg && this.#status === 200) return new Response(data, { headers: this.#preparedHeaders });
19983
- if (arg && typeof arg !== "number") {
19984
- const header = new Headers(arg.headers);
19985
- if (this.#headers) this.#headers.forEach((v, k) => {
19986
- if (k === "set-cookie") header.append(k, v);
19987
- else header.set(k, v);
19988
- });
19989
- const headers2 = setHeaders(header, this.#preparedHeaders);
19990
- return new Response(data, {
19991
- headers: headers2,
19992
- status: arg.status ?? this.#status
19993
- });
19994
- }
19995
- const status$1 = typeof arg === "number" ? arg : this.#status;
19996
- this.#preparedHeaders ??= {};
19997
- this.#headers ??= new Headers();
19998
- setHeaders(this.#headers, this.#preparedHeaders);
19999
- if (this.#res) {
20000
- this.#res.headers.forEach((v, k) => {
20001
- if (k === "set-cookie") this.#headers?.append(k, v);
20002
- else this.#headers?.set(k, v);
20003
- });
20004
- setHeaders(this.#headers, this.#preparedHeaders);
19895
+ const responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders ?? new Headers();
19896
+ if (typeof arg === "object" && "headers" in arg) {
19897
+ const argHeaders = arg.headers instanceof Headers ? arg.headers : new Headers(arg.headers);
19898
+ for (const [key$1, value] of argHeaders) if (key$1.toLowerCase() === "set-cookie") responseHeaders.append(key$1, value);
19899
+ else responseHeaders.set(key$1, value);
20005
19900
  }
20006
- headers ??= {};
20007
- for (const [k, v] of Object.entries(headers)) if (typeof v === "string") this.#headers.set(k, v);
19901
+ if (headers) for (const [k, v] of Object.entries(headers)) if (typeof v === "string") responseHeaders.set(k, v);
20008
19902
  else {
20009
- this.#headers.delete(k);
20010
- for (const v2 of v) this.#headers.append(k, v2);
19903
+ responseHeaders.delete(k);
19904
+ for (const v2 of v) responseHeaders.append(k, v2);
20011
19905
  }
19906
+ const status$1 = typeof arg === "number" ? arg : arg?.status ?? this.#status;
20012
19907
  return new Response(data, {
20013
19908
  status: status$1,
20014
- headers: this.#headers
19909
+ headers: responseHeaders
20015
19910
  });
20016
19911
  }
20017
19912
  newResponse = (...args) => this.#newResponse(...args);
20018
- body = (data, arg, headers) => {
20019
- return typeof arg === "number" ? this.#newResponse(data, arg, headers) : this.#newResponse(data, arg);
20020
- };
19913
+ body = (data, arg, headers) => this.#newResponse(data, arg, headers);
20021
19914
  text = (text, arg, headers) => {
20022
- if (!this.#preparedHeaders) {
20023
- if (this.#isFresh && !headers && !arg) return new Response(text);
20024
- this.#preparedHeaders = {};
20025
- }
20026
- this.#preparedHeaders["content-type"] = TEXT_PLAIN;
20027
- if (typeof arg === "number") return this.#newResponse(text, arg, headers);
20028
- return this.#newResponse(text, arg);
19915
+ return !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text) : this.#newResponse(text, arg, setDefaultContentType(TEXT_PLAIN, headers));
20029
19916
  };
20030
19917
  json = (object, arg, headers) => {
20031
- const body = JSON.stringify(object);
20032
- this.#preparedHeaders ??= {};
20033
- this.#preparedHeaders["content-type"] = "application/json";
20034
- return typeof arg === "number" ? this.#newResponse(body, arg, headers) : this.#newResponse(body, arg);
19918
+ return this.#newResponse(JSON.stringify(object), arg, setDefaultContentType("application/json", headers));
20035
19919
  };
20036
19920
  html = (html, arg, headers) => {
20037
- this.#preparedHeaders ??= {};
20038
- this.#preparedHeaders["content-type"] = "text/html; charset=UTF-8";
20039
- if (typeof html === "object") return resolveCallback(html, HtmlEscapedCallbackPhase.Stringify, false, {}).then((html2) => {
20040
- return typeof arg === "number" ? this.#newResponse(html2, arg, headers) : this.#newResponse(html2, arg);
20041
- });
20042
- return typeof arg === "number" ? this.#newResponse(html, arg, headers) : this.#newResponse(html, arg);
19921
+ const res = (html2) => this.#newResponse(html2, arg, setDefaultContentType("text/html; charset=UTF-8", headers));
19922
+ return typeof html === "object" ? resolveCallback(html, HtmlEscapedCallbackPhase.Stringify, false, {}).then(res) : res(html);
20043
19923
  };
20044
19924
  redirect = (location, status$1) => {
20045
- this.#headers ??= new Headers();
20046
- this.#headers.set("Location", String(location));
19925
+ this.header("Location", String(location));
20047
19926
  return this.newResponse(null, status$1 ?? 302);
20048
19927
  };
20049
19928
  notFound = () => {
@@ -20061,7 +19940,6 @@ var METHODS = [
20061
19940
  "options",
20062
19941
  "patch"
20063
19942
  ];
20064
- var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
20065
19943
  var UnsupportedPathError = class extends Error {};
20066
19944
  var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
20067
19945
  var notFoundHandler = (c) => {
@@ -20204,6 +20082,7 @@ var Hono$1 = class {
20204
20082
  method = method.toUpperCase();
20205
20083
  path = mergePath(this._basePath, path);
20206
20084
  const r = {
20085
+ basePath: this._basePath,
20207
20086
  path,
20208
20087
  method,
20209
20088
  handler
@@ -20262,493 +20141,47 @@ var Hono$1 = class {
20262
20141
  });
20263
20142
  };
20264
20143
  };
20265
- var LABEL_REG_EXP_STR = "[^/]+";
20266
- var ONLY_WILDCARD_REG_EXP_STR = ".*";
20267
- var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
20268
- var PATH_ERROR = Symbol();
20269
- var regExpMetaChars = new Set(".\\+*[^]$()");
20270
- function compareKey(a, b) {
20271
- if (a.length === 1) return b.length === 1 ? a < b ? -1 : 1 : -1;
20272
- if (b.length === 1) return 1;
20273
- if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) return 1;
20274
- else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) return -1;
20275
- if (a === LABEL_REG_EXP_STR) return 1;
20276
- else if (b === LABEL_REG_EXP_STR) return -1;
20277
- return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length;
20278
- }
20279
- var Node$1 = class {
20280
- #index;
20281
- #varIndex;
20282
- #children = /* @__PURE__ */ Object.create(null);
20283
- insert(tokens, index, paramMap, context, pathErrorCheckOnly) {
20284
- if (tokens.length === 0) {
20285
- if (this.#index !== void 0) throw PATH_ERROR;
20286
- if (pathErrorCheckOnly) return;
20287
- this.#index = index;
20288
- return;
20289
- }
20290
- const [token, ...restTokens] = tokens;
20291
- const pattern = token === "*" ? restTokens.length === 0 ? [
20292
- "",
20293
- "",
20294
- ONLY_WILDCARD_REG_EXP_STR
20295
- ] : [
20296
- "",
20297
- "",
20298
- LABEL_REG_EXP_STR
20299
- ] : token === "/*" ? [
20300
- "",
20301
- "",
20302
- TAIL_WILDCARD_REG_EXP_STR
20303
- ] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
20304
- let node;
20305
- if (pattern) {
20306
- const name$1 = pattern[1];
20307
- let regexpStr = pattern[2] || LABEL_REG_EXP_STR;
20308
- if (name$1 && pattern[2]) {
20309
- regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:");
20310
- if (/\((?!\?:)/.test(regexpStr)) throw PATH_ERROR;
20311
- }
20312
- node = this.#children[regexpStr];
20313
- if (!node) {
20314
- if (Object.keys(this.#children).some((k) => k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR)) throw PATH_ERROR;
20315
- if (pathErrorCheckOnly) return;
20316
- node = this.#children[regexpStr] = new Node$1();
20317
- if (name$1 !== "") node.#varIndex = context.varIndex++;
20318
- }
20319
- if (!pathErrorCheckOnly && name$1 !== "") paramMap.push([name$1, node.#varIndex]);
20320
- } else {
20321
- node = this.#children[token];
20322
- if (!node) {
20323
- if (Object.keys(this.#children).some((k) => k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR)) throw PATH_ERROR;
20324
- if (pathErrorCheckOnly) return;
20325
- node = this.#children[token] = new Node$1();
20326
- }
20327
- }
20328
- node.insert(restTokens, index, paramMap, context, pathErrorCheckOnly);
20329
- }
20330
- buildRegExpStr() {
20331
- const childKeys = Object.keys(this.#children).sort(compareKey);
20332
- const strList = childKeys.map((k) => {
20333
- const c = this.#children[k];
20334
- return (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + c.buildRegExpStr();
20335
- });
20336
- if (typeof this.#index === "number") strList.unshift(`#${this.#index}`);
20337
- if (strList.length === 0) return "";
20338
- if (strList.length === 1) return strList[0];
20339
- return "(?:" + strList.join("|") + ")";
20340
- }
20341
- };
20342
- var Trie = class {
20343
- #context = { varIndex: 0 };
20344
- #root = new Node$1();
20345
- insert(path, index, pathErrorCheckOnly) {
20346
- const paramAssoc = [];
20347
- const groups = [];
20348
- for (let i$3 = 0;;) {
20349
- let replaced = false;
20350
- path = path.replace(/\{[^}]+\}/g, (m) => {
20351
- const mark = `@\\${i$3}`;
20352
- groups[i$3] = [mark, m];
20353
- i$3++;
20354
- replaced = true;
20355
- return mark;
20356
- });
20357
- if (!replaced) break;
20358
- }
20359
- const tokens = path.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
20360
- for (let i$3 = groups.length - 1; i$3 >= 0; i$3--) {
20361
- const [mark] = groups[i$3];
20362
- for (let j = tokens.length - 1; j >= 0; j--) if (tokens[j].indexOf(mark) !== -1) {
20363
- tokens[j] = tokens[j].replace(mark, groups[i$3][1]);
20364
- break;
20365
- }
20366
- }
20367
- this.#root.insert(tokens, index, paramAssoc, this.#context, pathErrorCheckOnly);
20368
- return paramAssoc;
20369
- }
20370
- buildRegExp() {
20371
- let regexp = this.#root.buildRegExpStr();
20372
- if (regexp === "") return [
20373
- /^$/,
20374
- [],
20375
- []
20376
- ];
20377
- let captureIndex = 0;
20378
- const indexReplacementMap = [];
20379
- const paramReplacementMap = [];
20380
- regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => {
20381
- if (handlerIndex !== void 0) {
20382
- indexReplacementMap[++captureIndex] = Number(handlerIndex);
20383
- return "$()";
20384
- }
20385
- if (paramIndex !== void 0) {
20386
- paramReplacementMap[Number(paramIndex)] = ++captureIndex;
20387
- return "";
20388
- }
20389
- return "";
20390
- });
20391
- return [
20392
- new RegExp(`^${regexp}`),
20393
- indexReplacementMap,
20394
- paramReplacementMap
20395
- ];
20396
- }
20397
- };
20398
- var emptyParam = [];
20399
- var nullMatcher = [
20400
- /^$/,
20401
- [],
20402
- /* @__PURE__ */ Object.create(null)
20403
- ];
20404
- var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
20405
- function buildWildcardRegExp(path) {
20406
- return wildcardRegExpCache[path] ??= new RegExp(path === "*" ? "" : `^${path.replace(/\/\*$|([.\\+*[^\]$()])/g, (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)")}$`);
20407
- }
20408
- function clearWildcardRegExpCache() {
20409
- wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
20410
- }
20411
- function buildMatcherFromPreprocessedRoutes(routes) {
20412
- const trie = new Trie();
20413
- const handlerData = [];
20414
- if (routes.length === 0) return nullMatcher;
20415
- const routesWithStaticPathFlag = routes.map((route) => [!/\*|\/:/.test(route[0]), ...route]).sort(([isStaticA, pathA], [isStaticB, pathB]) => isStaticA ? 1 : isStaticB ? -1 : pathA.length - pathB.length);
20416
- const staticMap = /* @__PURE__ */ Object.create(null);
20417
- for (let i$3 = 0, j = -1, len = routesWithStaticPathFlag.length; i$3 < len; i$3++) {
20418
- const [pathErrorCheckOnly, path, handlers] = routesWithStaticPathFlag[i$3];
20419
- if (pathErrorCheckOnly) staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam];
20420
- else j++;
20421
- let paramAssoc;
20422
- try {
20423
- paramAssoc = trie.insert(path, j, pathErrorCheckOnly);
20424
- } catch (e) {
20425
- throw e === PATH_ERROR ? new UnsupportedPathError(path) : e;
20426
- }
20427
- if (pathErrorCheckOnly) continue;
20428
- handlerData[j] = handlers.map(([h, paramCount]) => {
20429
- const paramIndexMap = /* @__PURE__ */ Object.create(null);
20430
- paramCount -= 1;
20431
- for (; paramCount >= 0; paramCount--) {
20432
- const [key$1, value] = paramAssoc[paramCount];
20433
- paramIndexMap[key$1] = value;
20434
- }
20435
- return [h, paramIndexMap];
20436
- });
20437
- }
20438
- const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
20439
- for (let i$3 = 0, len = handlerData.length; i$3 < len; i$3++) for (let j = 0, len2 = handlerData[i$3].length; j < len2; j++) {
20440
- const map$1 = handlerData[i$3][j]?.[1];
20441
- if (!map$1) continue;
20442
- const keys = Object.keys(map$1);
20443
- for (let k = 0, len3 = keys.length; k < len3; k++) map$1[keys[k]] = paramReplacementMap[map$1[keys[k]]];
20444
- }
20445
- const handlerMap = [];
20446
- for (const i$3 in indexReplacementMap) handlerMap[i$3] = handlerData[indexReplacementMap[i$3]];
20447
- return [
20448
- regexp,
20449
- handlerMap,
20450
- staticMap
20451
- ];
20452
- }
20453
- function findMiddleware(middleware, path) {
20454
- if (!middleware) return void 0;
20455
- for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) if (buildWildcardRegExp(k).test(path)) return [...middleware[k]];
20456
- return void 0;
20457
- }
20458
- var RegExpRouter = class {
20459
- name = "RegExpRouter";
20460
- #middleware;
20461
- #routes;
20462
- constructor() {
20463
- this.#middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
20464
- this.#routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
20465
- }
20144
+ var emptyParams = /* @__PURE__ */ Object.create(null);
20145
+ var PatternRouter = class {
20146
+ name = "PatternRouter";
20147
+ #routes = [];
20466
20148
  add(method, path, handler) {
20467
- const middleware = this.#middleware;
20468
- const routes = this.#routes;
20469
- if (!middleware || !routes) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
20470
- if (!middleware[method]) [middleware, routes].forEach((handlerMap) => {
20471
- handlerMap[method] = /* @__PURE__ */ Object.create(null);
20472
- Object.keys(handlerMap[METHOD_NAME_ALL]).forEach((p) => {
20473
- handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]];
20474
- });
20149
+ const endsWithWildcard = path.at(-1) === "*";
20150
+ if (endsWithWildcard) path = path.slice(0, -2);
20151
+ if (path.at(-1) === "?") {
20152
+ path = path.slice(0, -1);
20153
+ this.add(method, path.replace(/\/[^/]+$/, ""), handler);
20154
+ }
20155
+ const parts = (path.match(/\/?(:\w+(?:{(?:(?:{[\d,]+})|[^}])+})?)|\/?[^\/\?]+/g) || []).map((part) => {
20156
+ const match = part.match(/^\/:([^{]+)(?:{(.*)})?/);
20157
+ return match ? `/(?<${match[1]}>${match[2] || "[^/]+"})` : part === "/*" ? "/[^/]+" : part.replace(/[.\\+*[^\]$()]/g, "\\$&");
20475
20158
  });
20476
- if (path === "/*") path = "*";
20477
- const paramCount = (path.match(/\/:/g) || []).length;
20478
- if (/\*$/.test(path)) {
20479
- const re = buildWildcardRegExp(path);
20480
- if (method === METHOD_NAME_ALL) Object.keys(middleware).forEach((m) => {
20481
- middleware[m][path] ||= findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || [];
20482
- });
20483
- else middleware[method][path] ||= findMiddleware(middleware[method], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || [];
20484
- Object.keys(middleware).forEach((m) => {
20485
- if (method === METHOD_NAME_ALL || method === m) Object.keys(middleware[m]).forEach((p) => {
20486
- re.test(p) && middleware[m][p].push([handler, paramCount]);
20487
- });
20488
- });
20489
- Object.keys(routes).forEach((m) => {
20490
- if (method === METHOD_NAME_ALL || method === m) Object.keys(routes[m]).forEach((p) => re.test(p) && routes[m][p].push([handler, paramCount]));
20491
- });
20492
- return;
20493
- }
20494
- const paths = checkOptionalParameter(path) || [path];
20495
- for (let i$3 = 0, len = paths.length; i$3 < len; i$3++) {
20496
- const path2 = paths[i$3];
20497
- Object.keys(routes).forEach((m) => {
20498
- if (method === METHOD_NAME_ALL || method === m) {
20499
- routes[m][path2] ||= [...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || []];
20500
- routes[m][path2].push([handler, paramCount - len + i$3 + 1]);
20501
- }
20502
- });
20159
+ try {
20160
+ this.#routes.push([
20161
+ new RegExp(`^${parts.join("")}${endsWithWildcard ? "" : "/?$"}`),
20162
+ method,
20163
+ handler
20164
+ ]);
20165
+ } catch {
20166
+ throw new UnsupportedPathError();
20503
20167
  }
20504
20168
  }
20505
20169
  match(method, path) {
20506
- clearWildcardRegExpCache();
20507
- const matchers = this.#buildAllMatchers();
20508
- this.match = (method2, path2) => {
20509
- const matcher = matchers[method2] || matchers[METHOD_NAME_ALL];
20510
- const staticMatch = matcher[2][path2];
20511
- if (staticMatch) return staticMatch;
20512
- const match = path2.match(matcher[0]);
20513
- if (!match) return [[], emptyParam];
20514
- const index = match.indexOf("", 1);
20515
- return [matcher[1][index], match];
20516
- };
20517
- return this.match(method, path);
20518
- }
20519
- #buildAllMatchers() {
20520
- const matchers = /* @__PURE__ */ Object.create(null);
20521
- Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => {
20522
- matchers[method] ||= this.#buildMatcher(method);
20523
- });
20524
- this.#middleware = this.#routes = void 0;
20525
- return matchers;
20526
- }
20527
- #buildMatcher(method) {
20528
- const routes = [];
20529
- let hasOwnRoute = method === METHOD_NAME_ALL;
20530
- [this.#middleware, this.#routes].forEach((r) => {
20531
- const ownRoute = r[method] ? Object.keys(r[method]).map((path) => [path, r[method][path]]) : [];
20532
- if (ownRoute.length !== 0) {
20533
- hasOwnRoute ||= true;
20534
- routes.push(...ownRoute);
20535
- } else if (method !== METHOD_NAME_ALL) routes.push(...Object.keys(r[METHOD_NAME_ALL]).map((path) => [path, r[METHOD_NAME_ALL][path]]));
20536
- });
20537
- if (!hasOwnRoute) return null;
20538
- else return buildMatcherFromPreprocessedRoutes(routes);
20539
- }
20540
- };
20541
- var SmartRouter = class {
20542
- name = "SmartRouter";
20543
- #routers = [];
20544
- #routes = [];
20545
- constructor(init) {
20546
- this.#routers = init.routers;
20547
- }
20548
- add(method, path, handler) {
20549
- if (!this.#routes) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
20550
- this.#routes.push([
20551
- method,
20552
- path,
20553
- handler
20554
- ]);
20555
- }
20556
- match(method, path) {
20557
- if (!this.#routes) throw new Error("Fatal error");
20558
- const routers = this.#routers;
20559
- const routes = this.#routes;
20560
- const len = routers.length;
20561
- let i$3 = 0;
20562
- let res;
20563
- for (; i$3 < len; i$3++) {
20564
- const router = routers[i$3];
20565
- try {
20566
- for (let i2 = 0, len2 = routes.length; i2 < len2; i2++) router.add(...routes[i2]);
20567
- res = router.match(method, path);
20568
- } catch (e) {
20569
- if (e instanceof UnsupportedPathError) continue;
20570
- throw e;
20170
+ const handlers = [];
20171
+ for (let i$3 = 0, len = this.#routes.length; i$3 < len; i$3++) {
20172
+ const [pattern, routeMethod, handler] = this.#routes[i$3];
20173
+ if (routeMethod === method || routeMethod === METHOD_NAME_ALL) {
20174
+ const match = pattern.exec(path);
20175
+ if (match) handlers.push([handler, match.groups || emptyParams]);
20571
20176
  }
20572
- this.match = router.match.bind(router);
20573
- this.#routers = [router];
20574
- this.#routes = void 0;
20575
- break;
20576
20177
  }
20577
- if (i$3 === len) throw new Error("Fatal error");
20578
- this.name = `SmartRouter + ${this.activeRouter.name}`;
20579
- return res;
20580
- }
20581
- get activeRouter() {
20582
- if (this.#routes || this.#routers.length !== 1) throw new Error("No active router has been determined yet.");
20583
- return this.#routers[0];
20584
- }
20585
- };
20586
- var emptyParams = /* @__PURE__ */ Object.create(null);
20587
- var Node = class {
20588
- #methods;
20589
- #children;
20590
- #patterns;
20591
- #order = 0;
20592
- #params = emptyParams;
20593
- constructor(method, handler, children) {
20594
- this.#children = children || /* @__PURE__ */ Object.create(null);
20595
- this.#methods = [];
20596
- if (method && handler) {
20597
- const m = /* @__PURE__ */ Object.create(null);
20598
- m[method] = {
20599
- handler,
20600
- possibleKeys: [],
20601
- score: 0
20602
- };
20603
- this.#methods = [m];
20604
- }
20605
- this.#patterns = [];
20606
- }
20607
- insert(method, path, handler) {
20608
- this.#order = ++this.#order;
20609
- let curNode = this;
20610
- const parts = splitRoutingPath(path);
20611
- const possibleKeys = [];
20612
- for (let i$3 = 0, len = parts.length; i$3 < len; i$3++) {
20613
- const p = parts[i$3];
20614
- const nextP = parts[i$3 + 1];
20615
- const pattern = getPattern(p, nextP);
20616
- const key$1 = Array.isArray(pattern) ? pattern[0] : p;
20617
- if (Object.keys(curNode.#children).includes(key$1)) {
20618
- curNode = curNode.#children[key$1];
20619
- const pattern2 = getPattern(p, nextP);
20620
- if (pattern2) possibleKeys.push(pattern2[1]);
20621
- continue;
20622
- }
20623
- curNode.#children[key$1] = new Node();
20624
- if (pattern) {
20625
- curNode.#patterns.push(pattern);
20626
- possibleKeys.push(pattern[1]);
20627
- }
20628
- curNode = curNode.#children[key$1];
20629
- }
20630
- const m = /* @__PURE__ */ Object.create(null);
20631
- const handlerSet = {
20632
- handler,
20633
- possibleKeys: possibleKeys.filter((v, i$3, a) => a.indexOf(v) === i$3),
20634
- score: this.#order
20635
- };
20636
- m[method] = handlerSet;
20637
- curNode.#methods.push(m);
20638
- return curNode;
20639
- }
20640
- #getHandlerSets(node, method, nodeParams, params) {
20641
- const handlerSets = [];
20642
- for (let i$3 = 0, len = node.#methods.length; i$3 < len; i$3++) {
20643
- const m = node.#methods[i$3];
20644
- const handlerSet = m[method] || m[METHOD_NAME_ALL];
20645
- const processedSet = {};
20646
- if (handlerSet !== void 0) {
20647
- handlerSet.params = /* @__PURE__ */ Object.create(null);
20648
- handlerSets.push(handlerSet);
20649
- if (nodeParams !== emptyParams || params && params !== emptyParams) for (let i2 = 0, len2 = handlerSet.possibleKeys.length; i2 < len2; i2++) {
20650
- const key$1 = handlerSet.possibleKeys[i2];
20651
- const processed = processedSet[handlerSet.score];
20652
- handlerSet.params[key$1] = params?.[key$1] && !processed ? params[key$1] : nodeParams[key$1] ?? params?.[key$1];
20653
- processedSet[handlerSet.score] = true;
20654
- }
20655
- }
20656
- }
20657
- return handlerSets;
20658
- }
20659
- search(method, path) {
20660
- const handlerSets = [];
20661
- this.#params = emptyParams;
20662
- const curNode = this;
20663
- let curNodes = [curNode];
20664
- const parts = splitPath(path);
20665
- const curNodesQueue = [];
20666
- for (let i$3 = 0, len = parts.length; i$3 < len; i$3++) {
20667
- const part = parts[i$3];
20668
- const isLast = i$3 === len - 1;
20669
- const tempNodes = [];
20670
- for (let j = 0, len2 = curNodes.length; j < len2; j++) {
20671
- const node = curNodes[j];
20672
- const nextNode = node.#children[part];
20673
- if (nextNode) {
20674
- nextNode.#params = node.#params;
20675
- if (isLast) {
20676
- if (nextNode.#children["*"]) handlerSets.push(...this.#getHandlerSets(nextNode.#children["*"], method, node.#params));
20677
- handlerSets.push(...this.#getHandlerSets(nextNode, method, node.#params));
20678
- } else tempNodes.push(nextNode);
20679
- }
20680
- for (let k = 0, len3 = node.#patterns.length; k < len3; k++) {
20681
- const pattern = node.#patterns[k];
20682
- const params = node.#params === emptyParams ? {} : { ...node.#params };
20683
- if (pattern === "*") {
20684
- const astNode = node.#children["*"];
20685
- if (astNode) {
20686
- handlerSets.push(...this.#getHandlerSets(astNode, method, node.#params));
20687
- astNode.#params = params;
20688
- tempNodes.push(astNode);
20689
- }
20690
- continue;
20691
- }
20692
- if (part === "") continue;
20693
- const [key$1, name$1, matcher] = pattern;
20694
- const child = node.#children[key$1];
20695
- const restPathString = parts.slice(i$3).join("/");
20696
- if (matcher instanceof RegExp) {
20697
- const m = matcher.exec(restPathString);
20698
- if (m) {
20699
- params[name$1] = m[0];
20700
- handlerSets.push(...this.#getHandlerSets(child, method, node.#params, params));
20701
- if (Object.keys(child.#children).length) {
20702
- child.#params = params;
20703
- const componentCount = m[0].match(/\//)?.length ?? 0;
20704
- const targetCurNodes = curNodesQueue[componentCount] ||= [];
20705
- targetCurNodes.push(child);
20706
- }
20707
- continue;
20708
- }
20709
- }
20710
- if (matcher === true || matcher.test(part)) {
20711
- params[name$1] = part;
20712
- if (isLast) {
20713
- handlerSets.push(...this.#getHandlerSets(child, method, params, node.#params));
20714
- if (child.#children["*"]) handlerSets.push(...this.#getHandlerSets(child.#children["*"], method, params, node.#params));
20715
- } else {
20716
- child.#params = params;
20717
- tempNodes.push(child);
20718
- }
20719
- }
20720
- }
20721
- }
20722
- curNodes = tempNodes.concat(curNodesQueue.shift() ?? []);
20723
- }
20724
- if (handlerSets.length > 1) handlerSets.sort((a, b) => {
20725
- return a.score - b.score;
20726
- });
20727
- return [handlerSets.map(({ handler, params }) => [handler, params])];
20728
- }
20729
- };
20730
- var TrieRouter = class {
20731
- name = "TrieRouter";
20732
- #node;
20733
- constructor() {
20734
- this.#node = new Node();
20735
- }
20736
- add(method, path, handler) {
20737
- const results = checkOptionalParameter(path);
20738
- if (results) {
20739
- for (let i$3 = 0, len = results.length; i$3 < len; i$3++) this.#node.insert(method, results[i$3], handler);
20740
- return;
20741
- }
20742
- this.#node.insert(method, path, handler);
20743
- }
20744
- match(method, path) {
20745
- return this.#node.search(method, path);
20178
+ return [handlers];
20746
20179
  }
20747
20180
  };
20748
20181
  var Hono = class extends Hono$1 {
20749
20182
  constructor(options = {}) {
20750
20183
  super(options);
20751
- this.router = options.router ?? new SmartRouter({ routers: [new RegExpRouter(), new TrieRouter()] });
20184
+ this.router = new PatternRouter();
20752
20185
  }
20753
20186
  };
20754
20187
  var import_usingCtx = __toESM(require_usingCtx(), 1);
package/dist/mcp.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./pricing-fetcher-BkOpRIdx.js";
2
2
  import { LoadOptions } from "./data-loader-CBwn9vk0.js";
3
3
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- import { Hono } from "hono";
4
+ import { Hono } from "hono/tiny";
5
5
 
6
6
  //#region src/mcp.d.ts
7
7
 
package/dist/mcp.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./pricing-fetcher-3m6_Ejp8.js";
2
- import "./data-loader-rsgRy-no.js";
3
- import "./logger-CTFDCX5W.js";
4
- import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-Cg5potQX.js";
1
+ import "./pricing-fetcher-D-PICoFg.js";
2
+ import "./data-loader-Bw3RIMwp.js";
3
+ import "./logger-D_tmxNpg.js";
4
+ import { createMcpHttpApp, createMcpServer, startMcpServerStdio } from "./mcp-DysXlvnH.js";
5
5
  export { createMcpHttpApp, createMcpServer, startMcpServerStdio };
@@ -1,4 +1,4 @@
1
- import { logger } from "./logger-CTFDCX5W.js";
1
+ import { logger } from "./logger-D_tmxNpg.js";
2
2
  import { createRequire } from "node:module";
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
@@ -1,3 +1,3 @@
1
- import { PricingFetcher } from "./pricing-fetcher-3m6_Ejp8.js";
2
- import "./logger-CTFDCX5W.js";
1
+ import { PricingFetcher } from "./pricing-fetcher-D-PICoFg.js";
2
+ import "./logger-D_tmxNpg.js";
3
3
  export { PricingFetcher };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccusage",
3
3
  "type": "module",
4
- "version": "12.0.0",
4
+ "version": "12.1.0",
5
5
  "description": "Usage analysis tool for Claude Code",
6
6
  "author": "ryoppippi",
7
7
  "license": "MIT",