@tonyclaw/agent-inspector 2.0.33 → 2.0.35

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 (54) hide show
  1. package/.output/cli.js +19 -1
  2. package/.output/nitro.json +1 -1
  3. package/.output/public/assets/{CompareDrawer-ClTJxdoU.js → CompareDrawer-Cin0_f71.js} +1 -1
  4. package/.output/public/assets/{ProxyViewerContainer--Pes01q2.js → ProxyViewerContainer-BVlcRirf.js} +9 -9
  5. package/.output/public/assets/{ReplayDialog-iuzfh85b.js → ReplayDialog-C6nOMhjx.js} +1 -1
  6. package/.output/public/assets/{RequestAnatomy-FZnnP9Gx.js → RequestAnatomy-DenWbdqV.js} +1 -1
  7. package/.output/public/assets/{ResponseView-MZ6ZWvbL.js → ResponseView-BsalZiZ5.js} +1 -1
  8. package/.output/public/assets/{StreamingChunkSequence-B8mZMdzs.js → StreamingChunkSequence-Cla2X13P.js} +1 -1
  9. package/.output/public/assets/_sessionId-DkhHqlzB.js +1 -0
  10. package/.output/public/assets/index-AiQY20d7.js +1 -0
  11. package/.output/public/assets/index-BfGJEb-2.css +1 -0
  12. package/.output/public/assets/{main-B797Hnge.js → main-eD8hEOHT.js} +2 -2
  13. package/.output/server/_libs/ajv.mjs +827 -6191
  14. package/.output/server/_libs/cookie-es.mjs +7 -21
  15. package/.output/server/_libs/h3-v2.mjs +18 -7
  16. package/.output/server/_libs/json-schema-traverse.mjs +1 -90
  17. package/.output/server/_libs/seroval-plugins.mjs +5 -5
  18. package/.output/server/_libs/seroval.mjs +606 -596
  19. package/.output/server/_libs/srvx.mjs +10 -5
  20. package/.output/server/_libs/tanstack__history.mjs +55 -38
  21. package/.output/server/_libs/tanstack__router-core.mjs +4366 -4075
  22. package/.output/server/{_sessionId-DD05qd8d.mjs → _sessionId-URSu2XsA.mjs} +4 -4
  23. package/.output/server/_ssr/{CompareDrawer-oGOG5-kQ.mjs → CompareDrawer-BbBPKdVc.mjs} +4 -4
  24. package/.output/server/_ssr/{ProxyViewerContainer-Bbl5tqT1.mjs → ProxyViewerContainer-DtQxtOpi.mjs} +15 -7
  25. package/.output/server/_ssr/{ReplayDialog-BegfwWIy.mjs → ReplayDialog-BU20cMGd.mjs} +5 -5
  26. package/.output/server/_ssr/{RequestAnatomy-BW_X2DyZ.mjs → RequestAnatomy-a5ySAAG1.mjs} +4 -4
  27. package/.output/server/_ssr/{ResponseView-Bx_uJ4RS.mjs → ResponseView-CA_QM1fM.mjs} +4 -4
  28. package/.output/server/_ssr/{StreamingChunkSequence-CQp5QQnB.mjs → StreamingChunkSequence-DJjITqM7.mjs} +4 -4
  29. package/.output/server/_ssr/{index-ODSKeDD8.mjs → index-DIFzLUAV.mjs} +4 -4
  30. package/.output/server/_ssr/index.mjs +20 -11
  31. package/.output/server/_ssr/{router-QcI4GOvo.mjs → router-aVeuM_1d.mjs} +5193 -5269
  32. package/.output/server/{_tanstack-start-manifest_v-dEujKJ3-.mjs → _tanstack-start-manifest_v-BNlafGbl.mjs} +1 -1
  33. package/.output/server/index.mjs +65 -65
  34. package/README.md +28 -0
  35. package/package.json +6 -2
  36. package/src/cli/templates/codex-skill-onboard.ts +19 -1
  37. package/src/components/providers/SettingsDialog.tsx +10 -0
  38. package/src/lib/groupContract.ts +0 -2
  39. package/src/lib/runContract.ts +0 -3
  40. package/src/mcp/server.ts +101 -164
  41. package/src/mcp/toolHandlers.ts +80 -177
  42. package/src/routes/api/groups.$groupId.evidence.ts +14 -33
  43. package/src/routes/api/groups.$groupId.sessions.ts +9 -9
  44. package/src/routes/api/groups.$groupId.ts +19 -13
  45. package/src/routes/api/groups.ts +3 -3
  46. package/src/routes/api/runs.$runId.evidence.ts +14 -21
  47. package/src/routes/api/runs.$runId.ts +9 -9
  48. package/src/routes/api/runs.ts +9 -5
  49. package/src/services/groups.ts +110 -0
  50. package/src/services/result.ts +17 -0
  51. package/src/services/runs.ts +76 -0
  52. package/.output/public/assets/_sessionId-Bc26Rfxs.js +0 -1
  53. package/.output/public/assets/index-C6AiRPsJ.js +0 -1
  54. package/.output/public/assets/index-C_8PFAm2.css +0 -1
@@ -1,10 +1,6 @@
1
1
  function splitSetCookieString(cookiesString) {
2
- if (Array.isArray(cookiesString)) {
3
- return cookiesString.flatMap((c) => splitSetCookieString(c));
4
- }
5
- if (typeof cookiesString !== "string") {
6
- return [];
7
- }
2
+ if (Array.isArray(cookiesString)) return cookiesString.flatMap((c) => splitSetCookieString(c));
3
+ if (typeof cookiesString !== "string") return [];
8
4
  const cookiesStrings = [];
9
5
  let pos = 0;
10
6
  let start;
@@ -13,9 +9,7 @@ function splitSetCookieString(cookiesString) {
13
9
  let nextStart;
14
10
  let cookiesSeparatorFound;
15
11
  const skipWhitespace = () => {
16
- while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
17
- pos += 1;
18
- }
12
+ while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) pos += 1;
19
13
  return pos < cookiesString.length;
20
14
  };
21
15
  const notSpecialChar = () => {
@@ -32,24 +26,16 @@ function splitSetCookieString(cookiesString) {
32
26
  pos += 1;
33
27
  skipWhitespace();
34
28
  nextStart = pos;
35
- while (pos < cookiesString.length && notSpecialChar()) {
36
- pos += 1;
37
- }
29
+ while (pos < cookiesString.length && notSpecialChar()) pos += 1;
38
30
  if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
39
31
  cookiesSeparatorFound = true;
40
32
  pos = nextStart;
41
33
  cookiesStrings.push(cookiesString.slice(start, lastComma));
42
34
  start = pos;
43
- } else {
44
- pos = lastComma + 1;
45
- }
46
- } else {
47
- pos += 1;
48
- }
49
- }
50
- if (!cookiesSeparatorFound || pos >= cookiesString.length) {
51
- cookiesStrings.push(cookiesString.slice(start));
35
+ } else pos = lastComma + 1;
36
+ } else pos += 1;
52
37
  }
38
+ if (!cookiesSeparatorFound || pos >= cookiesString.length) cookiesStrings.push(cookiesString.slice(start));
53
39
  }
54
40
  return cookiesStrings;
55
41
  }
@@ -1,8 +1,12 @@
1
1
  import { a as NullProtoObj } from "./rou3.mjs";
2
2
  import { a as FastURL, b as NodeResponse } from "./srvx.mjs";
3
+ function decodePathname(pathname) {
4
+ return decodeURI(pathname.includes("%25") ? pathname.replace(/%25/g, "%2525") : pathname);
5
+ }
3
6
  const kEventNS = "h3.internal.event.";
4
7
  const kEventRes = /* @__PURE__ */ Symbol.for(`${kEventNS}res`);
5
8
  const kEventResHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.headers`);
9
+ const kEventResErrHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.err.headers`);
6
10
  var H3Event = class {
7
11
  app;
8
12
  req;
@@ -14,7 +18,9 @@ var H3Event = class {
14
18
  this.req = req;
15
19
  this.app = app;
16
20
  const _url = req._url;
17
- this.url = _url && _url instanceof URL ? _url : new FastURL(req.url);
21
+ const url = _url && _url instanceof URL ? _url : new FastURL(req.url);
22
+ if (url.pathname.includes("%")) url.pathname = decodePathname(url.pathname);
23
+ this.url = url;
18
24
  }
19
25
  get res() {
20
26
  return this[kEventRes] ||= new H3EventResponse();
@@ -50,6 +56,9 @@ var H3EventResponse = class {
50
56
  get headers() {
51
57
  return this[kEventResHeaders] ||= new Headers();
52
58
  }
59
+ get errHeaders() {
60
+ return this[kEventResErrHeaders] ||= new Headers();
61
+ }
53
62
  };
54
63
  const DISALLOWED_STATUS_CHARS = /[^\u0009\u0020-\u007E]/g;
55
64
  function sanitizeStatusMessage(statusMessage = "") {
@@ -89,8 +98,8 @@ var HTTPError = class HTTPError2 extends Error {
89
98
  messageInput = arg1;
90
99
  details = arg2;
91
100
  } else details = arg1;
92
- const status = sanitizeStatusCode(details?.status || details?.cause?.status || details?.status || details?.statusCode, 500);
93
- const statusText = sanitizeStatusMessage(details?.statusText || details?.cause?.statusText || details?.statusText || details?.statusMessage);
101
+ const status = sanitizeStatusCode(details?.status || details?.statusCode || details?.cause?.status || details?.cause?.statusCode, 500);
102
+ const statusText = sanitizeStatusMessage(details?.statusText || details?.statusMessage || details?.cause?.statusText || details?.cause?.statusMessage);
94
103
  const message = messageInput || details?.message || details?.cause?.message || details?.statusText || details?.statusMessage || [
95
104
  "HTTPError",
96
105
  status,
@@ -176,7 +185,8 @@ function prepareResponse(val, event, config, nested) {
176
185
  }
177
186
  if (error.unhandled && !config.silent) console.error(error);
178
187
  const { onError } = config;
179
- return onError && !nested ? Promise.resolve(onError(error, event)).catch((error2) => error2).then((newVal) => prepareResponse(newVal ?? val, event, config, true)) : errorResponse(error, config.debug);
188
+ const errHeaders = event[kEventRes]?.[kEventResErrHeaders];
189
+ return onError && !nested ? Promise.resolve(onError(error, event)).catch((error2) => error2).then((newVal) => prepareResponse(newVal ?? val, event, config, true)) : errorResponse(error, config.debug, errHeaders);
180
190
  }
181
191
  const preparedRes = event[kEventRes];
182
192
  const preparedHeaders = preparedRes?.[kEventResHeaders];
@@ -259,17 +269,18 @@ function prepareResponseBody(val, event, config) {
259
269
  function nullBody(method, status) {
260
270
  return method === "HEAD" || status === 100 || status === 101 || status === 102 || status === 204 || status === 205 || status === 304;
261
271
  }
262
- function errorResponse(error, debug) {
272
+ function errorResponse(error, debug, errHeaders) {
273
+ let headers = error.headers ? mergeHeaders$1(jsonHeaders, error.headers) : new Headers(jsonHeaders);
274
+ if (errHeaders) headers = mergeHeaders$1(headers, errHeaders);
263
275
  return new NodeResponse(JSON.stringify({
264
276
  ...error.toJSON(),
265
277
  stack: debug && error.stack ? error.stack.split("\n").map((l) => l.trim()) : void 0
266
278
  }, void 0, debug ? 2 : void 0), {
267
279
  status: error.status,
268
280
  statusText: error.statusText,
269
- headers: error.headers ? mergeHeaders$1(jsonHeaders, error.headers) : new Headers(jsonHeaders)
281
+ headers
270
282
  });
271
283
  }
272
- new TextEncoder();
273
284
  export {
274
285
  H3Event as H,
275
286
  toResponse as t
@@ -1,91 +1,3 @@
1
- var jsonSchemaTraverse$1 = { exports: {} };
2
- var hasRequiredJsonSchemaTraverse$1;
3
- function requireJsonSchemaTraverse$1() {
4
- if (hasRequiredJsonSchemaTraverse$1) return jsonSchemaTraverse$1.exports;
5
- hasRequiredJsonSchemaTraverse$1 = 1;
6
- var traverse = jsonSchemaTraverse$1.exports = function(schema, opts, cb) {
7
- if (typeof opts == "function") {
8
- cb = opts;
9
- opts = {};
10
- }
11
- cb = opts.cb || cb;
12
- var pre = typeof cb == "function" ? cb : cb.pre || function() {
13
- };
14
- var post = cb.post || function() {
15
- };
16
- _traverse(opts, pre, post, schema, "", schema);
17
- };
18
- traverse.keywords = {
19
- additionalItems: true,
20
- items: true,
21
- contains: true,
22
- additionalProperties: true,
23
- propertyNames: true,
24
- not: true,
25
- if: true,
26
- then: true,
27
- else: true
28
- };
29
- traverse.arrayKeywords = {
30
- items: true,
31
- allOf: true,
32
- anyOf: true,
33
- oneOf: true
34
- };
35
- traverse.propsKeywords = {
36
- $defs: true,
37
- definitions: true,
38
- properties: true,
39
- patternProperties: true,
40
- dependencies: true
41
- };
42
- traverse.skipKeywords = {
43
- default: true,
44
- enum: true,
45
- const: true,
46
- required: true,
47
- maximum: true,
48
- minimum: true,
49
- exclusiveMaximum: true,
50
- exclusiveMinimum: true,
51
- multipleOf: true,
52
- maxLength: true,
53
- minLength: true,
54
- pattern: true,
55
- format: true,
56
- maxItems: true,
57
- minItems: true,
58
- uniqueItems: true,
59
- maxProperties: true,
60
- minProperties: true
61
- };
62
- function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
63
- if (schema && typeof schema == "object" && !Array.isArray(schema)) {
64
- pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
65
- for (var key in schema) {
66
- var sch = schema[key];
67
- if (Array.isArray(sch)) {
68
- if (key in traverse.arrayKeywords) {
69
- for (var i = 0; i < sch.length; i++)
70
- _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema, jsonPtr, key, schema, i);
71
- }
72
- } else if (key in traverse.propsKeywords) {
73
- if (sch && typeof sch == "object") {
74
- for (var prop in sch)
75
- _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
76
- }
77
- } else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) {
78
- _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema);
79
- }
80
- }
81
- post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
82
- }
83
- }
84
- function escapeJsonPtr(str) {
85
- return str.replace(/~/g, "~0").replace(/\//g, "~1");
86
- }
87
- return jsonSchemaTraverse$1.exports;
88
- }
89
1
  var jsonSchemaTraverse = { exports: {} };
90
2
  var hasRequiredJsonSchemaTraverse;
91
3
  function requireJsonSchemaTraverse() {
@@ -175,6 +87,5 @@ function requireJsonSchemaTraverse() {
175
87
  return jsonSchemaTraverse.exports;
176
88
  }
177
89
  export {
178
- requireJsonSchemaTraverse as a,
179
- requireJsonSchemaTraverse$1 as r
90
+ requireJsonSchemaTraverse as r
180
91
  };
@@ -1,4 +1,4 @@
1
- import { n as ni, t as te } from "./seroval.mjs";
1
+ import { a as ai, r as re } from "./seroval.mjs";
2
2
  var n = {}, P = (e) => new ReadableStream({ start: (r) => {
3
3
  e.on({ next: (a) => {
4
4
  try {
@@ -13,7 +13,7 @@ var n = {}, P = (e) => new ReadableStream({ start: (r) => {
13
13
  } catch (a) {
14
14
  }
15
15
  } });
16
- } }), x = ni({ tag: "seroval-plugins/web/ReadableStreamFactory", test(e) {
16
+ } }), x = ai({ tag: "seroval-plugins/web/ReadableStreamFactory", test(e) {
17
17
  return e === n;
18
18
  }, parse: { sync() {
19
19
  return n;
@@ -27,7 +27,7 @@ var n = {}, P = (e) => new ReadableStream({ start: (r) => {
27
27
  return n;
28
28
  } });
29
29
  function w(e) {
30
- let r = te(), a = e.getReader();
30
+ let r = re(), a = e.getReader();
31
31
  async function t() {
32
32
  try {
33
33
  let s = await a.read();
@@ -39,10 +39,10 @@ function w(e) {
39
39
  return t().catch(() => {
40
40
  }), r;
41
41
  }
42
- var ee = ni({ tag: "seroval/plugins/web/ReadableStream", extends: [x], test(e) {
42
+ var ee = ai({ tag: "seroval/plugins/web/ReadableStream", extends: [x], test(e) {
43
43
  return typeof ReadableStream == "undefined" ? false : e instanceof ReadableStream;
44
44
  }, parse: { sync(e, r) {
45
- return { factory: r.parse(n), stream: r.parse(te()) };
45
+ return { factory: r.parse(n), stream: r.parse(re()) };
46
46
  }, async async(e, r) {
47
47
  return { factory: await r.parse(n), stream: await r.parse(w(e)) };
48
48
  }, stream(e, r) {