tracer-sh 0.3.1 → 0.3.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.
Files changed (24) hide show
  1. package/bin/tracer.mjs +58 -3
  2. package/package.json +6 -2
  3. package/packages/server/dist/{chunk-YL5JSOUN.js → chunk-N2HWGQP2.js} +1 -1
  4. package/packages/server/dist/{chunk-IAWOYD5E.js → chunk-XTJ4UUIY.js} +1 -1
  5. package/packages/server/dist/{chunk-5GQDB6U7.js → chunk-ZAYYPDZP.js} +12 -3
  6. package/packages/server/dist/{dist-ZMUHFP5T.js → dist-L5BLKJXH.js} +1 -1
  7. package/packages/server/dist/{domain-knowledge-B2IREATL.js → domain-knowledge-6MEHHDWL.js} +1 -1
  8. package/packages/server/dist/{domain-knowledge-U2RLSFM2.js → domain-knowledge-HC2HKQB3.js} +1 -1
  9. package/packages/server/dist/{domain-knowledge-K3OB4NDB.js → domain-knowledge-RET7XGI5.js} +1 -1
  10. package/packages/server/dist/index.js +95 -61
  11. package/packages/server/dist/{multipart-parser-ONCUQ5VA.js → multipart-parser-MCEP54QZ.js} +2 -2
  12. package/packages/server/dist/{src-434DTNEL.js → src-TVEEC6CW.js} +3 -3
  13. package/packages/server/dist/{token-4YFRZJYT.js → token-R3E2IC23.js} +2 -2
  14. package/packages/server/dist/{token-util-CTKMWUIG.js → token-util-BJYJMNB3.js} +2 -2
  15. package/packages/web/dist/assets/{SearchableSelect-cW8CAuj_.js → SearchableSelect-BfcFMllA.js} +1 -1
  16. package/packages/web/dist/assets/Settings-BcbW-KcM.js +1 -0
  17. package/packages/web/dist/assets/{highlighted-body-OFNGDK62-C09rPU2r.js → highlighted-body-OFNGDK62-BA7knzgi.js} +1 -1
  18. package/packages/web/dist/assets/index-BMMlPHJO.css +1 -0
  19. package/packages/web/dist/assets/index-L_n_IFmZ.js +48 -0
  20. package/packages/web/dist/assets/{mermaid-GHXKKRXX-fHfNJrVx.js → mermaid-GHXKKRXX-C5BzUoQE.js} +84 -84
  21. package/packages/web/dist/index.html +2 -2
  22. package/packages/web/dist/assets/Settings-CBO58Ysm.js +0 -1
  23. package/packages/web/dist/assets/index-BrLT4CJt.js +0 -48
  24. package/packages/web/dist/assets/index-CZnFdes-.css +0 -1
package/bin/tracer.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { spawnSync } from "node:child_process";
4
- import { existsSync, readdirSync, statSync } from "node:fs";
4
+ import { existsSync, readdirSync, statSync, readFileSync } from "node:fs";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { dirname, join, resolve } from "node:path";
7
7
 
@@ -12,14 +12,68 @@ const serverPath = resolve(repoRoot, "packages/server/dist/index.js");
12
12
  // Must match RESTART_EXIT_CODE in packages/server/src/updater.ts
13
13
  const RESTART_EXIT_CODE = 75;
14
14
 
15
+ const cmd = process.argv[2];
16
+
17
+ // `tracer-sh --help` / `-h` / `help` — usage for every subcommand.
18
+ if (cmd === "--help" || cmd === "-h" || cmd === "help") {
19
+ printHelp();
20
+ process.exit(0);
21
+ }
22
+
23
+ // `tracer-sh --version` / `-v` — print the installed version.
24
+ if (cmd === "--version" || cmd === "-v" || cmd === "version") {
25
+ process.stdout.write(getVersion() + "\n");
26
+ process.exit(0);
27
+ }
28
+
15
29
  // `tracer analyze "<message>" [--session <id>] [--provider <name>] [--json]`
16
30
  // Runs the investigation agent on the already-running local server and prints
17
31
  // the final analysis. Lets other local agents (e.g. Claude Code) drive Tracer.
18
- if (process.argv[2] === "analyze") {
32
+ if (cmd === "analyze") {
19
33
  await runAnalyze(process.argv.slice(3));
20
34
  process.exit(0);
21
35
  }
22
36
 
37
+ /** Read the package version (best-effort; "unknown" if package.json is unreadable). */
38
+ function getVersion() {
39
+ try {
40
+ return JSON.parse(readFileSync(join(repoRoot, "package.json"), "utf8")).version ?? "unknown";
41
+ } catch {
42
+ return "unknown";
43
+ }
44
+ }
45
+
46
+ function printHelp() {
47
+ process.stdout.write(`Tracer ${getVersion()} — local-first AI observability agent
48
+
49
+ Usage:
50
+ tracer-sh Start the Tracer server (default http://127.0.0.1:3579)
51
+ tracer-sh analyze "<message>" [options] Run a headless investigation on a running server
52
+ tracer-sh --help Show this help
53
+ tracer-sh --version Print the version
54
+
55
+ analyze options:
56
+ -s, --session <id> Resume an existing session by id (preserves full context)
57
+ -p, --provider <name> Scope to one provider (newrelic, gcp, posthog); omit for unified mode
58
+ --json Print the full JSON envelope:
59
+ { sessionId, status, analysis, queries, usage, model }.
60
+ The "queries" array holds the FULL raw rows and can be very
61
+ large. Without --json, stdout is just the analysis prose and the
62
+ line "session <id> · <model>" is written to stderr.
63
+
64
+ Environment:
65
+ TRACER_PORT Server port (default 3579)
66
+ TRACER_HOST Bind/target host (default 127.0.0.1)
67
+ TRACER_SKIP_BUILD Skip the source-checkout rebuild-on-launch check
68
+
69
+ Examples:
70
+ tracer-sh
71
+ tracer-sh analyze "Why did checkout error rate spike after 14:00 UTC?"
72
+ tracer-sh analyze "Now break that down by service." --session <id>
73
+ tracer-sh analyze "Top 5 slowest GCP Cloud Run requests." --provider gcp
74
+ `);
75
+ }
76
+
23
77
  async function runAnalyze(args) {
24
78
  let message;
25
79
  let sessionId;
@@ -28,7 +82,8 @@ async function runAnalyze(args) {
28
82
 
29
83
  for (let i = 0; i < args.length; i++) {
30
84
  const a = args[i];
31
- if (a === "--json") asJson = true;
85
+ if (a === "--help" || a === "-h") { printHelp(); process.exit(0); }
86
+ else if (a === "--json") asJson = true;
32
87
  else if (a === "--session" || a === "-s") sessionId = args[++i];
33
88
  else if (a === "--provider" || a === "-p") provider = args[++i];
34
89
  else if (message === undefined) message = a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tracer-sh",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "type": "module",
5
5
  "description": "Local-first debugging & analysis platform",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -39,7 +39,11 @@
39
39
  "overrides": {
40
40
  "mermaid": "^11.15.0",
41
41
  "postcss": "^8.5.10",
42
- "uuid": "^11.1.1"
42
+ "uuid": "^11.1.1",
43
+ "shell-quote": "^1.8.4",
44
+ "dompurify": "^3.4.9",
45
+ "@babel/core": "^7.29.6",
46
+ "esbuild": "^0.28.1"
43
47
  }
44
48
  },
45
49
  "devDependencies": {
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'module'; const require = __cre
2
2
  import {
3
3
  __commonJS,
4
4
  __require
5
- } from "./chunk-5GQDB6U7.js";
5
+ } from "./chunk-ZAYYPDZP.js";
6
6
 
7
7
  // ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-error.js
8
8
  var require_token_error = __commonJS({
@@ -4,7 +4,7 @@ import {
4
4
  __esm,
5
5
  __require,
6
6
  __toESM
7
- } from "./chunk-5GQDB6U7.js";
7
+ } from "./chunk-ZAYYPDZP.js";
8
8
 
9
9
  // ../../node_modules/.pnpm/web-streams-polyfill@3.3.3/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js
10
10
  var require_ponyfill_es2018 = __commonJS({
@@ -11,11 +11,20 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
11
11
  if (typeof require !== "undefined") return require.apply(this, arguments);
12
12
  throw Error('Dynamic require of "' + x + '" is not supported');
13
13
  });
14
- var __esm = (fn, res) => function __init() {
15
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14
+ var __esm = (fn, res, err) => function __init() {
15
+ if (err) throw err[0];
16
+ try {
17
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
18
+ } catch (e) {
19
+ throw err = [e], e;
20
+ }
16
21
  };
17
22
  var __commonJS = (cb, mod) => function __require2() {
18
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
23
+ try {
24
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
25
+ } catch (e) {
26
+ throw mod = 0, e;
27
+ }
19
28
  };
20
29
  var __export = (target, all) => {
21
30
  for (var name in all)
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'module'; const require = __cre
2
2
  import {
3
3
  __commonJS,
4
4
  __require
5
- } from "./chunk-5GQDB6U7.js";
5
+ } from "./chunk-ZAYYPDZP.js";
6
6
 
7
7
  // ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
8
8
  var require_ms = __commonJS({
@@ -5,7 +5,7 @@ import {
5
5
  NR_INSIDE_OUT_DEBUGGING,
6
6
  NR_SERVICE_HEALTH_RUNBOOK
7
7
  } from "./chunk-XFJVNMJI.js";
8
- import "./chunk-5GQDB6U7.js";
8
+ import "./chunk-ZAYYPDZP.js";
9
9
  export {
10
10
  NR_AUTH_STOP_RULE,
11
11
  NR_DOMAIN_KNOWLEDGE,
@@ -7,7 +7,7 @@ import {
7
7
  GCP_PAGE_SIZE_RULE,
8
8
  GCP_TOOL_REFERENCE
9
9
  } from "./chunk-IKD3ICQK.js";
10
- import "./chunk-5GQDB6U7.js";
10
+ import "./chunk-ZAYYPDZP.js";
11
11
  export {
12
12
  GCP_AUTH_STOP_RULE,
13
13
  GCP_CROSS_SIGNAL,
@@ -4,7 +4,7 @@ import {
4
4
  POSTHOG_DOMAIN_KNOWLEDGE,
5
5
  POSTHOG_INSIDE_OUT_DEBUGGING
6
6
  } from "./chunk-L7TO4UJ4.js";
7
- import "./chunk-5GQDB6U7.js";
7
+ import "./chunk-ZAYYPDZP.js";
8
8
  export {
9
9
  POSTHOG_AUTH_STOP_RULE,
10
10
  POSTHOG_DOMAIN_KNOWLEDGE,
@@ -8,7 +8,7 @@ import {
8
8
  require_auth_errors,
9
9
  require_token_error,
10
10
  require_token_util
11
- } from "./chunk-YL5JSOUN.js";
11
+ } from "./chunk-N2HWGQP2.js";
12
12
  import {
13
13
  NR_AUTH_STOP_RULE,
14
14
  NR_DOMAIN_KNOWLEDGE,
@@ -26,7 +26,7 @@ import {
26
26
  __export,
27
27
  __require,
28
28
  __toESM
29
- } from "./chunk-5GQDB6U7.js";
29
+ } from "./chunk-ZAYYPDZP.js";
30
30
 
31
31
  // ../../node_modules/.pnpm/better-sqlite3@12.9.0/node_modules/better-sqlite3/lib/util.js
32
32
  var require_util = __commonJS({
@@ -876,8 +876,8 @@ var require_get_vercel_oidc_token = __commonJS({
876
876
  }
877
877
  try {
878
878
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
879
- await import("./token-util-CTKMWUIG.js"),
880
- await import("./token-4YFRZJYT.js")
879
+ await import("./token-util-BJYJMNB3.js"),
880
+ await import("./token-R3E2IC23.js")
881
881
  ]);
882
882
  if (!token || isExpired(getTokenPayload(token), options?.expirationBufferMs)) {
883
883
  await refreshToken(options);
@@ -1950,12 +1950,12 @@ Content-Type: ${partContentType}\r
1950
1950
  * @returns A proxy agent
1951
1951
  */
1952
1952
  static async #getProxyAgent() {
1953
- this.#proxyAgent ||= (await import("./dist-ZMUHFP5T.js")).HttpsProxyAgent;
1953
+ this.#proxyAgent ||= (await import("./dist-L5BLKJXH.js")).HttpsProxyAgent;
1954
1954
  return this.#proxyAgent;
1955
1955
  }
1956
1956
  static async #getFetch() {
1957
1957
  const hasWindow = typeof window !== "undefined" && !!window;
1958
- this.#fetch ||= hasWindow ? window.fetch : (await import("./src-434DTNEL.js")).default;
1958
+ this.#fetch ||= hasWindow ? window.fetch : (await import("./src-TVEEC6CW.js")).default;
1959
1959
  return this.#fetch;
1960
1960
  }
1961
1961
  /**
@@ -11718,7 +11718,7 @@ var require_src4 = __commonJS({
11718
11718
  }
11719
11719
  });
11720
11720
 
11721
- // ../../node_modules/.pnpm/@hono+node-server@1.19.14_hono@4.12.23/node_modules/@hono/node-server/dist/index.mjs
11721
+ // ../../node_modules/.pnpm/@hono+node-server@1.19.14_hono@4.12.25/node_modules/@hono/node-server/dist/index.mjs
11722
11722
  import { createServer as createServerHTTP } from "http";
11723
11723
  import { Http2ServerRequest as Http2ServerRequest2, constants as h2constants } from "http2";
11724
11724
  import { Http2ServerRequest } from "http2";
@@ -63435,9 +63435,9 @@ function createDeleteMemoryTool(memoryExecute, opts) {
63435
63435
 
63436
63436
  // src/agents/utility/memory-domain-knowledge.ts
63437
63437
  var DOMAIN_LOADERS = {
63438
- newrelic: async () => (await import("./domain-knowledge-B2IREATL.js")).NR_DOMAIN_KNOWLEDGE,
63439
- gcp: async () => (await import("./domain-knowledge-U2RLSFM2.js")).GCP_DOMAIN_KNOWLEDGE,
63440
- posthog: async () => (await import("./domain-knowledge-K3OB4NDB.js")).POSTHOG_DOMAIN_KNOWLEDGE
63438
+ newrelic: async () => (await import("./domain-knowledge-6MEHHDWL.js")).NR_DOMAIN_KNOWLEDGE,
63439
+ gcp: async () => (await import("./domain-knowledge-HC2HKQB3.js")).GCP_DOMAIN_KNOWLEDGE,
63440
+ posthog: async () => (await import("./domain-knowledge-RET7XGI5.js")).POSTHOG_DOMAIN_KNOWLEDGE
63441
63441
  };
63442
63442
  async function getDomainKnowledge(providerType) {
63443
63443
  const loader = DOMAIN_LOADERS[providerType];
@@ -66691,6 +66691,8 @@ var McpProvider = class extends BaseProvider {
66691
66691
  this.name = providerType;
66692
66692
  this.type = providerType;
66693
66693
  }
66694
+ definition;
66695
+ config;
66694
66696
  name;
66695
66697
  type;
66696
66698
  clients = [];
@@ -67760,7 +67762,7 @@ function createContext(deps) {
67760
67762
  };
67761
67763
  }
67762
67764
 
67763
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/compose.js
67765
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/compose.js
67764
67766
  var compose = (middleware, onError, onNotFound) => {
67765
67767
  return (context2, next) => {
67766
67768
  let index2 = -1;
@@ -67804,10 +67806,10 @@ var compose = (middleware, onError, onNotFound) => {
67804
67806
  };
67805
67807
  };
67806
67808
 
67807
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/request/constants.js
67809
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/request/constants.js
67808
67810
  var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
67809
67811
 
67810
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/body.js
67812
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/utils/body.js
67811
67813
  var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
67812
67814
  const { all = false, dot = false } = options;
67813
67815
  const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
@@ -67879,7 +67881,7 @@ var handleParsingNestedValues = (form, key, value) => {
67879
67881
  });
67880
67882
  };
67881
67883
 
67882
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/url.js
67884
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/utils/url.js
67883
67885
  var splitPath = (path) => {
67884
67886
  const paths = path.split("/");
67885
67887
  if (paths[0] === "") {
@@ -68083,7 +68085,7 @@ var getQueryParams = (url2, key) => {
68083
68085
  };
68084
68086
  var decodeURIComponent_ = decodeURIComponent;
68085
68087
 
68086
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/request.js
68088
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/request.js
68087
68089
  var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
68088
68090
  var HonoRequest = class {
68089
68091
  /**
@@ -68366,7 +68368,7 @@ var HonoRequest = class {
68366
68368
  }
68367
68369
  };
68368
68370
 
68369
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/html.js
68371
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/utils/html.js
68370
68372
  var HtmlEscapedCallbackPhase = {
68371
68373
  Stringify: 1,
68372
68374
  BeforeStream: 2,
@@ -68408,7 +68410,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context2, buffer) =>
68408
68410
  }
68409
68411
  };
68410
68412
 
68411
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/context.js
68413
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/context.js
68412
68414
  var TEXT_PLAIN = "text/plain; charset=UTF-8";
68413
68415
  var setDefaultContentType = (contentType, headers) => {
68414
68416
  return {
@@ -68815,7 +68817,7 @@ var Context = class {
68815
68817
  };
68816
68818
  };
68817
68819
 
68818
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router.js
68820
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/router.js
68819
68821
  var METHOD_NAME_ALL = "ALL";
68820
68822
  var METHOD_NAME_ALL_LOWERCASE = "all";
68821
68823
  var METHODS = ["get", "post", "put", "delete", "options", "patch"];
@@ -68823,10 +68825,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
68823
68825
  var UnsupportedPathError = class extends Error {
68824
68826
  };
68825
68827
 
68826
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/constants.js
68828
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/utils/constants.js
68827
68829
  var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
68828
68830
 
68829
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/hono-base.js
68831
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/hono-base.js
68830
68832
  var notFoundHandler = (c) => {
68831
68833
  return c.text("404 Not Found", 404);
68832
68834
  };
@@ -69202,7 +69204,7 @@ var Hono = class _Hono {
69202
69204
  };
69203
69205
  };
69204
69206
 
69205
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/matcher.js
69207
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/router/reg-exp-router/matcher.js
69206
69208
  var emptyParam = [];
69207
69209
  function match(method, path) {
69208
69210
  const matchers = this.buildAllMatchers();
@@ -69223,7 +69225,7 @@ function match(method, path) {
69223
69225
  return match2(method, path);
69224
69226
  }
69225
69227
 
69226
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/node.js
69228
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/router/reg-exp-router/node.js
69227
69229
  var LABEL_REG_EXP_STR = "[^/]+";
69228
69230
  var ONLY_WILDCARD_REG_EXP_STR = ".*";
69229
69231
  var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
@@ -69331,7 +69333,7 @@ var Node = class _Node {
69331
69333
  }
69332
69334
  };
69333
69335
 
69334
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/trie.js
69336
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/router/reg-exp-router/trie.js
69335
69337
  var Trie = class {
69336
69338
  #context = { varIndex: 0 };
69337
69339
  #root = new Node();
@@ -69387,7 +69389,7 @@ var Trie = class {
69387
69389
  }
69388
69390
  };
69389
69391
 
69390
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/reg-exp-router/router.js
69392
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/router/reg-exp-router/router.js
69391
69393
  var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
69392
69394
  var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
69393
69395
  function buildWildcardRegExp(path) {
@@ -69566,7 +69568,7 @@ var RegExpRouter = class {
69566
69568
  }
69567
69569
  };
69568
69570
 
69569
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/smart-router/router.js
69571
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/router/smart-router/router.js
69570
69572
  var SmartRouter = class {
69571
69573
  name = "SmartRouter";
69572
69574
  #routers = [];
@@ -69621,7 +69623,7 @@ var SmartRouter = class {
69621
69623
  }
69622
69624
  };
69623
69625
 
69624
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/trie-router/node.js
69626
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/router/trie-router/node.js
69625
69627
  var emptyParams = /* @__PURE__ */ Object.create(null);
69626
69628
  var hasChildren = (children) => {
69627
69629
  for (const _ in children) {
@@ -69796,7 +69798,7 @@ var Node2 = class _Node2 {
69796
69798
  }
69797
69799
  };
69798
69800
 
69799
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/router/trie-router/router.js
69801
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/router/trie-router/router.js
69800
69802
  var TrieRouter = class {
69801
69803
  name = "TrieRouter";
69802
69804
  #node;
@@ -69818,7 +69820,7 @@ var TrieRouter = class {
69818
69820
  }
69819
69821
  };
69820
69822
 
69821
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/hono.js
69823
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/hono.js
69822
69824
  var Hono2 = class extends Hono {
69823
69825
  /**
69824
69826
  * Creates an instance of the Hono class.
@@ -69833,7 +69835,7 @@ var Hono2 = class extends Hono {
69833
69835
  }
69834
69836
  };
69835
69837
 
69836
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/accept.js
69838
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/utils/accept.js
69837
69839
  var isWhitespace = (char) => char === 32 || char === 9 || char === 10 || char === 13;
69838
69840
  var consumeWhitespace = (acceptHeader, startIndex) => {
69839
69841
  while (startIndex < acceptHeader.length) {
@@ -70054,10 +70056,10 @@ var parseQuality = (qVal) => {
70054
70056
  return num;
70055
70057
  };
70056
70058
 
70057
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/compress.js
70059
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/utils/compress.js
70058
70060
  var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/(?!event-stream(?:[;\s]|$))[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|msgpack|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|vnd\.msgpack|wasm|x-httpd-php|x-javascript|x-msgpack|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml|msgpack))(?:[;\s]|$)/i;
70059
70061
 
70060
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/middleware/compress/index.js
70062
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/middleware/compress/index.js
70061
70063
  var ENCODING_TYPES = ["gzip", "deflate"];
70062
70064
  var cacheControlNoTransformRegExp = /(?:^|,)\s*?no-transform\s*?(?:,|$)/i;
70063
70065
  var selectEncoding = (header, candidates) => {
@@ -72449,14 +72451,14 @@ async function fetchRequestHandler(opts) {
72449
72451
  }));
72450
72452
  }
72451
72453
 
72452
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/helper/route/index.js
72454
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/helper/route/index.js
72453
72455
  var matchedRoutes = (c) => (
72454
72456
  // @ts-expect-error c.req[GET_MATCH_RESULT] is not typed
72455
72457
  c.req[GET_MATCH_RESULT][0].map(([[, route]]) => route)
72456
72458
  );
72457
72459
  var routePath = (c, index2) => matchedRoutes(c).at(index2 ?? c.req.routeIndex)?.path ?? "";
72458
72460
 
72459
- // ../../node_modules/.pnpm/@hono+trpc-server@0.4.2_@trpc+server@11.16.0_typescript@5.9.3__hono@4.12.23/node_modules/@hono/trpc-server/dist/index.js
72461
+ // ../../node_modules/.pnpm/@hono+trpc-server@0.4.2_@trpc+server@11.16.0_typescript@5.9.3__hono@4.12.25/node_modules/@hono/trpc-server/dist/index.js
72460
72462
  var trpcServer = ({ endpoint, createContext: createContext2, ...rest }) => {
72461
72463
  const bodyProps = /* @__PURE__ */ new Set([
72462
72464
  "arrayBuffer",
@@ -74621,6 +74623,7 @@ var updateRouter = router({
74621
74623
  });
74622
74624
 
74623
74625
  // src/integrations/jira/jira.client.ts
74626
+ var ISSUE_FIELDS = "summary,description,status,issuetype,priority,assignee,reporter,labels,components,fixVersions,created,updated,duedate,resolution,comment";
74624
74627
  function normalizeJiraDomain(raw2) {
74625
74628
  return raw2.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").replace(/\.atlassian\.net$/i, "");
74626
74629
  }
@@ -74670,19 +74673,41 @@ var JiraClient = class {
74670
74673
  return { ok: false, error: err instanceof Error ? err.message : String(err) };
74671
74674
  }
74672
74675
  }
74676
+ /** Read a single issue's details (summary, description, status, and the Details
74677
+ * panel fields: type, priority, assignee, reporter, labels, etc.) plus its
74678
+ * comment thread. Read-only. */
74673
74679
  async getIssue(key) {
74674
74680
  const res = await this.request(
74675
- `/rest/api/2/issue/${encodeURIComponent(key)}?fields=summary,description,status`
74681
+ `/rest/api/2/issue/${encodeURIComponent(key)}?fields=${ISSUE_FIELDS}`
74676
74682
  );
74677
74683
  const data = await res.json();
74678
- const fields = data.fields ?? {};
74684
+ const f = data.fields ?? {};
74685
+ const names = (arr) => (arr ?? []).map((x) => x.name).filter((n) => !!n);
74679
74686
  return {
74680
74687
  key: data.key ?? key,
74681
- summary: fields.summary ?? "",
74682
- description: toPlainText(fields.description),
74683
- status: fields.status?.name ?? "Unknown"
74688
+ summary: f.summary ?? "",
74689
+ description: toPlainText(f.description),
74690
+ status: f.status?.name ?? "Unknown",
74691
+ issueType: f.issuetype?.name ?? null,
74692
+ priority: f.priority?.name ?? null,
74693
+ assignee: f.assignee?.displayName ?? null,
74694
+ reporter: f.reporter?.displayName ?? null,
74695
+ labels: f.labels ?? [],
74696
+ components: names(f.components),
74697
+ fixVersions: names(f.fixVersions),
74698
+ created: f.created ?? null,
74699
+ updated: f.updated ?? null,
74700
+ dueDate: f.duedate ?? null,
74701
+ resolution: f.resolution?.name ?? null,
74702
+ comments: (f.comment?.comments ?? []).map((c) => ({
74703
+ id: c.id ?? null,
74704
+ author: c.author?.displayName ?? null,
74705
+ body: toPlainText(c.body),
74706
+ created: c.created ?? null
74707
+ }))
74684
74708
  };
74685
74709
  }
74710
+ /** Post a single plain-text comment to an issue. The only write operation. */
74686
74711
  async addComment(key, body) {
74687
74712
  const res = await this.request(`/rest/api/2/issue/${encodeURIComponent(key)}/comment`, {
74688
74713
  method: "POST",
@@ -74726,6 +74751,10 @@ var integrationsRouter = router({
74726
74751
  }
74727
74752
  };
74728
74753
  }),
74754
+ // Accepts a classic Atlassian API token (email + token). The token authenticates
74755
+ // against the site host with the account's permissions; Tracer constrains what it
74756
+ // can do at the code/tool layer (read one issue, post one comment). Validated with
74757
+ // a /myself call before persisting.
74729
74758
  saveJira: publicProcedure.input(
74730
74759
  external_exports.object({
74731
74760
  domain: external_exports.string().min(1),
@@ -74768,7 +74797,7 @@ var appRouter = router({
74768
74797
  update: updateRouter
74769
74798
  });
74770
74799
 
74771
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/middleware/cors/index.js
74800
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/middleware/cors/index.js
74772
74801
  var cors = (options) => {
74773
74802
  const opts = {
74774
74803
  origin: "*",
@@ -74780,9 +74809,6 @@ var cors = (options) => {
74780
74809
  const findAllowOrigin = ((optsOrigin) => {
74781
74810
  if (typeof optsOrigin === "string") {
74782
74811
  if (optsOrigin === "*") {
74783
- if (opts.credentials) {
74784
- return (origin) => origin || null;
74785
- }
74786
74812
  return () => optsOrigin;
74787
74813
  } else {
74788
74814
  return (origin) => optsOrigin === origin ? origin : null;
@@ -74817,7 +74843,7 @@ var cors = (options) => {
74817
74843
  set2("Access-Control-Expose-Headers", opts.exposeHeaders.join(","));
74818
74844
  }
74819
74845
  if (c.req.method === "OPTIONS") {
74820
- if (opts.origin !== "*" || opts.credentials) {
74846
+ if (opts.origin !== "*") {
74821
74847
  set2("Vary", "Origin");
74822
74848
  }
74823
74849
  if (opts.maxAge != null) {
@@ -74847,13 +74873,13 @@ var cors = (options) => {
74847
74873
  });
74848
74874
  }
74849
74875
  await next();
74850
- if (opts.origin !== "*" || opts.credentials) {
74876
+ if (opts.origin !== "*") {
74851
74877
  c.header("Vary", "Origin", { append: true });
74852
74878
  }
74853
74879
  };
74854
74880
  };
74855
74881
 
74856
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/color.js
74882
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/utils/color.js
74857
74883
  function getColorEnabled() {
74858
74884
  const { process: process3, Deno } = globalThis;
74859
74885
  const isNoColor = typeof Deno?.noColor === "boolean" ? Deno.noColor : process3 !== void 0 ? (
@@ -74875,7 +74901,7 @@ async function getColorEnabledAsync() {
74875
74901
  return !isNoColor;
74876
74902
  }
74877
74903
 
74878
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/middleware/logger/index.js
74904
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/middleware/logger/index.js
74879
74905
  var humanize = (times) => {
74880
74906
  const [delimiter, separator] = [",", "."];
74881
74907
  const orderTimes = times.map((v) => v.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + delimiter));
@@ -74924,7 +74950,7 @@ function applyMiddleware(app) {
74924
74950
  app.use("*", cors({ origin: CONFIG.corsOrigin ?? `http://localhost:${CONFIG.port}` }));
74925
74951
  }
74926
74952
 
74927
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/utils/stream.js
74953
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/utils/stream.js
74928
74954
  var StreamingApi = class {
74929
74955
  writer;
74930
74956
  encoder;
@@ -75003,7 +75029,7 @@ var StreamingApi = class {
75003
75029
  }
75004
75030
  };
75005
75031
 
75006
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/helper/streaming/utils.js
75032
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/helper/streaming/utils.js
75007
75033
  var isOldBunVersion = () => {
75008
75034
  const version3 = typeof Bun !== "undefined" ? Bun.version : void 0;
75009
75035
  if (version3 === void 0) {
@@ -75014,7 +75040,7 @@ var isOldBunVersion = () => {
75014
75040
  return result;
75015
75041
  };
75016
75042
 
75017
- // ../../node_modules/.pnpm/hono@4.12.23/node_modules/hono/dist/helper/streaming/sse.js
75043
+ // ../../node_modules/.pnpm/hono@4.12.25/node_modules/hono/dist/helper/streaming/sse.js
75018
75044
  var SSEStreamingApi = class extends StreamingApi {
75019
75045
  constructor(writable, readable) {
75020
75046
  super(writable, readable);
@@ -75448,7 +75474,7 @@ function getJiraChatTools(db2) {
75448
75474
  const client = new JiraClient(config2);
75449
75475
  const tools = {
75450
75476
  get_jira_issue: tool({
75451
- description: "Read a Jira issue's summary, description, and status by its issue key (e.g. PROJ-123).",
75477
+ description: "Read a Jira issue's details by its issue key (e.g. PROJ-123): summary, description, status, type, priority, assignee, reporter, labels, components, fix versions, resolution, created/updated/due dates, and its comment thread.",
75452
75478
  inputSchema: external_exports.object({
75453
75479
  issueKey: external_exports.string().describe("Jira issue key, e.g. PROJ-123")
75454
75480
  }),
@@ -75841,6 +75867,7 @@ var Parser = class {
75841
75867
  constructor(tokens) {
75842
75868
  this.tokens = tokens;
75843
75869
  }
75870
+ tokens;
75844
75871
  pos = 0;
75845
75872
  peek() {
75846
75873
  return this.tokens[this.pos] ?? { type: "eof", value: "" };
@@ -76334,10 +76361,25 @@ var MAX_RESULT_CHARS = 4e3;
76334
76361
  function renderToolPart(p, queries) {
76335
76362
  const tool3 = p.type.replace(/^tool-/, "");
76336
76363
  const queryParts = (p.output?.parts ?? []).filter((x) => typeof x?.query === "string");
76364
+ for (const qp of queryParts) {
76365
+ queries.push({ tool: tool3, query: qp.query ?? p.input?.query ?? "", results: qp.results });
76366
+ }
76367
+ const queryText = queryParts.map((qp) => qp.query ?? p.input?.query ?? "").filter((q) => !!q).join("\n---\n");
76368
+ if (p.output?.analysis) {
76369
+ if (queryParts.length === 0 && p.input?.query) {
76370
+ queries.push({ tool: tool3, query: p.input.query, results: p.output.analysis });
76371
+ }
76372
+ const displayQuery = queryText || p.input?.query || "";
76373
+ return `Query (${tool3}):${displayQuery ? `
76374
+ \`\`\`
76375
+ ${displayQuery}
76376
+ \`\`\`` : ""}
76377
+ Result:
76378
+ ${p.output.analysis}`;
76379
+ }
76337
76380
  const blocks = [];
76338
76381
  for (const qp of queryParts) {
76339
76382
  const query = qp.query ?? p.input?.query ?? "";
76340
- queries.push({ tool: tool3, query, results: qp.results });
76341
76383
  let resultStr;
76342
76384
  try {
76343
76385
  resultStr = JSON.stringify(qp.results);
@@ -76355,16 +76397,6 @@ Result:
76355
76397
  \`\`\`json
76356
76398
  ${resultStr}
76357
76399
  \`\`\``);
76358
- }
76359
- if (queryParts.length === 0 && p.output?.analysis) {
76360
- const query = p.input?.query;
76361
- if (query) queries.push({ tool: tool3, query, results: p.output.analysis });
76362
- blocks.push(`Query (${tool3}):${query ? `
76363
- \`\`\`
76364
- ${query}
76365
- \`\`\`` : ""}
76366
- Result:
76367
- ${p.output.analysis}`);
76368
76400
  }
76369
76401
  return blocks.join("\n\n");
76370
76402
  }
@@ -76601,6 +76633,8 @@ var MonitorScheduler = class {
76601
76633
  this.db = db2;
76602
76634
  this.providers = providers;
76603
76635
  }
76636
+ db;
76637
+ providers;
76604
76638
  interval = null;
76605
76639
  tickPromise = null;
76606
76640
  start() {