@ait-co/devtools 0.1.132 → 0.1.133

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 (68) hide show
  1. package/dist/{attach-orchestrator-ca34r46y.js → attach-orchestrator-CE0S09YU.js} +110 -5
  2. package/dist/attach-orchestrator-CE0S09YU.js.map +1 -0
  3. package/dist/{attach-orchestrator-BiaYiNOr.js → attach-orchestrator-CMoDuG2A.js} +110 -5
  4. package/dist/attach-orchestrator-CMoDuG2A.js.map +1 -0
  5. package/dist/cell-BIdSQb9T.js +201 -0
  6. package/dist/cell-BIdSQb9T.js.map +1 -0
  7. package/dist/{cell-Cw4fVOl2.js → cell-D1y4shoV.js} +1 -21
  8. package/dist/cell-D1y4shoV.js.map +1 -0
  9. package/dist/cell-DHA578lX.js +200 -0
  10. package/dist/cell-DHA578lX.js.map +1 -0
  11. package/dist/{debug-server-Ch5p0ryv.js → debug-server-CS1BS2BX.js} +2 -2
  12. package/dist/{debug-server-Ch5p0ryv.js.map → debug-server-CS1BS2BX.js.map} +1 -1
  13. package/dist/{debug-server-DoWAtTNj.js → debug-server-DmzuK2c6.js} +7 -8
  14. package/dist/{debug-server-DoWAtTNj.js.map → debug-server-DmzuK2c6.js.map} +1 -1
  15. package/dist/{debug-server-BBUzxZSf.js → debug-server-DnNCoNiR.js} +7 -7
  16. package/dist/{debug-server-BBUzxZSf.js.map → debug-server-DnNCoNiR.js.map} +1 -1
  17. package/dist/mcp/cli.js +111 -4
  18. package/dist/mcp/cli.js.map +1 -1
  19. package/dist/mcp/server.js +1 -1
  20. package/dist/panel/index.js +1 -1
  21. package/dist/{pool-BtLh7U1y.d.ts → pool-x28Wv1ty.d.ts} +2 -2
  22. package/dist/{pool-BtLh7U1y.d.ts.map → pool-x28Wv1ty.d.ts.map} +1 -1
  23. package/dist/{qr-http-server-KB147M-S.js → qr-http-server-C_DTp9WU.js} +1 -1
  24. package/dist/{qr-http-server-KB147M-S.js.map → qr-http-server-C_DTp9WU.js.map} +1 -1
  25. package/dist/{relay-factory-cNgPfrWg.js → relay-factory-BQfmK7RP.js} +6 -6
  26. package/dist/{relay-factory-cNgPfrWg.js.map → relay-factory-BQfmK7RP.js.map} +1 -1
  27. package/dist/{relay-secret-store-CFc9n0OA.js → relay-secret-store-CLEGyHou.js} +2 -2
  28. package/dist/{relay-secret-store-CFc9n0OA.js.map → relay-secret-store-CLEGyHou.js.map} +1 -1
  29. package/dist/{relay-secret-store-DzxDsK6S.js → relay-secret-store-DGduVJhs.js} +2 -2
  30. package/dist/{relay-secret-store-DzxDsK6S.js.map → relay-secret-store-DGduVJhs.js.map} +1 -1
  31. package/dist/{relay-url-store-D3rY-GJJ.js → relay-url-store-B0X8TsGr.js} +2 -2
  32. package/dist/{relay-url-store-D3rY-GJJ.js.map → relay-url-store-B0X8TsGr.js.map} +1 -1
  33. package/dist/{relay-url-store-DGQ-HPQC.js → relay-url-store-CKW8RQzf.js} +2 -2
  34. package/dist/{relay-url-store-DGQ-HPQC.js.map → relay-url-store-CKW8RQzf.js.map} +1 -1
  35. package/dist/{relay-worker-BMSnlyls.d.ts → relay-worker-DtX_eszH.d.ts} +13 -1
  36. package/dist/relay-worker-DtX_eszH.d.ts.map +1 -0
  37. package/dist/{relay-worker-l34xNuci.js → relay-worker-MZq4fLv8.js} +8 -4
  38. package/dist/{relay-worker-l34xNuci.js.map → relay-worker-MZq4fLv8.js.map} +1 -1
  39. package/dist/rolldown-runtime-DGkTqVfb.js +15 -0
  40. package/dist/rolldown-runtime-DUslC3ob.js +14 -0
  41. package/dist/test-runner/bin.js +15 -101
  42. package/dist/test-runner/bin.js.map +1 -1
  43. package/dist/test-runner/config.d.ts +1 -1
  44. package/dist/test-runner/config.js +1 -1
  45. package/dist/test-runner/pool.d.ts +1 -1
  46. package/dist/test-runner/pool.js +1 -1
  47. package/dist/test-runner/relay-factory.js +3 -3
  48. package/dist/test-runner/relay-worker.d.ts +1 -1
  49. package/dist/test-runner/relay-worker.js +1 -1
  50. package/dist/test-runner/report.d.ts +10 -1
  51. package/dist/test-runner/report.d.ts.map +1 -1
  52. package/dist/test-runner/report.js +1 -0
  53. package/dist/test-runner/report.js.map +1 -1
  54. package/dist/{totp-DvOYkYim.js → totp-CZLLKfOC.js} +2 -14
  55. package/dist/{totp-DvOYkYim.js.map → totp-CZLLKfOC.js.map} +1 -1
  56. package/dist/totp-DAxys-r0.js +199 -0
  57. package/dist/totp-DAxys-r0.js.map +1 -0
  58. package/package.json +1 -1
  59. package/dist/attach-orchestrator-BiaYiNOr.js.map +0 -1
  60. package/dist/attach-orchestrator-ca34r46y.js.map +0 -1
  61. package/dist/cell-Bi8MAPA8.js +0 -88
  62. package/dist/cell-Bi8MAPA8.js.map +0 -1
  63. package/dist/cell-Cw4fVOl2.js.map +0 -1
  64. package/dist/cell-rr6gL9AT.js +0 -89
  65. package/dist/cell-rr6gL9AT.js.map +0 -1
  66. package/dist/log-CUik_tHp.js +0 -95
  67. package/dist/log-CUik_tHp.js.map +0 -1
  68. package/dist/relay-worker-BMSnlyls.d.ts.map +0 -1
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { r as generateTotp } from "../totp-DvOYkYim.js";
2
+ import { m as logInfo } from "../attach-orchestrator-CE0S09YU.js";
3
+ import { r as generateTotp } from "../totp-CZLLKfOC.js";
4
+ import { n as runPermissionPreflight } from "../cell-BIdSQb9T.js";
3
5
  import * as path$1 from "node:path";
4
6
  import path, { basename, isAbsolute, resolve } from "node:path";
5
7
  import { parseArgs } from "node:util";
@@ -117,10 +119,10 @@ function createRelayConnectionFactory(opts) {
117
119
  let manualPrompt = null;
118
120
  return {
119
121
  async open() {
120
- const { prepareAttach, renderAndMaybeWait, mintAttachUrl } = await import("../attach-orchestrator-ca34r46y.js");
121
- const { injectDebugIndicator, injectGlobals } = await import("../cell-rr6gL9AT.js");
122
- const { loadRelaySecretReadOnly } = await import("../relay-secret-store-CFc9n0OA.js");
123
- const { bootRelayFamily, buildRelayVerifyAuth } = await import("../debug-server-BBUzxZSf.js");
122
+ const { prepareAttach, renderAndMaybeWait, mintAttachUrl } = await import("../attach-orchestrator-CE0S09YU.js").then((n) => n.i);
123
+ const { injectDebugIndicator, injectGlobals } = await import("../cell-BIdSQb9T.js").then((n) => n.t);
124
+ const { loadRelaySecretReadOnly } = await import("../relay-secret-store-CLEGyHou.js");
125
+ const { bootRelayFamily, buildRelayVerifyAuth } = await import("../debug-server-DnNCoNiR.js");
124
126
  await loadRelaySecretReadOnly({ projectRoot });
125
127
  let resolveTunnelUp;
126
128
  const tunnelReady = new Promise((resolve) => {
@@ -150,7 +152,7 @@ function createRelayConnectionFactory(opts) {
150
152
  canOpenBrowser: () => !headless
151
153
  };
152
154
  try {
153
- const { startQrHttpServer } = await import("../qr-http-server-KB147M-S.js");
155
+ const { startQrHttpServer } = await import("../qr-http-server-C_DTp9WU.js");
154
156
  const getDashboardState = () => ({
155
157
  tunnel: attachDeps.getTunnelStatus(),
156
158
  pages: null,
@@ -224,7 +226,7 @@ function createRelayConnectionFactory(opts) {
224
226
  qrServer?.notifyStateChange();
225
227
  }
226
228
  try {
227
- const { injectDebugIndicator } = await import("../cell-rr6gL9AT.js");
229
+ const { injectDebugIndicator } = await import("../cell-BIdSQb9T.js").then((n) => n.t);
228
230
  await injectDebugIndicator(connection, { state: "disconnected" });
229
231
  } catch {}
230
232
  family?.stop();
@@ -276,98 +278,6 @@ const RELAY_AUTH_REJECT_CLOSE_CODE = 4401;
276
278
  */
277
279
  const RELAY_AUTH_REJECT_REASON = "totp-rejected";
278
280
  //#endregion
279
- //#region src/mcp/log.ts
280
- /**
281
- * Allowed field keys that may pass through to a log line.
282
- * Unknown keys are dropped. Values are still redact-scanned.
283
- */
284
- const ALLOWED_KEYS = new Set([
285
- "ts",
286
- "level",
287
- "event",
288
- "msg",
289
- "port",
290
- "totpEnabled",
291
- "env",
292
- "tool",
293
- "deploymentId",
294
- "errorKind",
295
- "reason",
296
- "prevTargetId",
297
- "mode",
298
- "fileCount",
299
- "passed",
300
- "failed",
301
- "skipped"
302
- ]);
303
- /**
304
- * Patterns that match secret values.
305
- * Match order matters — more-specific patterns first.
306
- *
307
- * #268 redact script covers: relay=wss://…, at=<TOTP>, _deploymentId=<uuid>.
308
- * Here we extend to in-process value-level patterns used in server logs.
309
- */
310
- const SECRET_PATTERNS = [
311
- /^\d{6}$/,
312
- /^(aitcc_|AITCC_)/i,
313
- /^[A-Za-z0-9_-]+=.{4,}/,
314
- /^wss:\/\//,
315
- /(?:^|[?&])at=[A-Z0-9]{6}/i
316
- ];
317
- /**
318
- * Returns `true` when the string value matches any known-secret pattern.
319
- * Only string values are tested — numbers/booleans are always safe.
320
- */
321
- function isSecretValue(value) {
322
- return SECRET_PATTERNS.some((re) => re.test(value));
323
- }
324
- /**
325
- * Redacts a single scalar value.
326
- * - strings: return "***" if the value matches a secret pattern.
327
- * - other: return as-is.
328
- */
329
- function redactValue(value) {
330
- if (typeof value === "string" && isSecretValue(value)) return "***";
331
- return value;
332
- }
333
- /**
334
- * Builds a safe log payload from raw fields.
335
- *
336
- * - Only keys in `ALLOWED_KEYS` are included.
337
- * - String values are scanned for secret patterns and replaced with "***".
338
- * - `ts` and `level` and `event` are always included (they are injected by the
339
- * logger functions below, not by callers).
340
- */
341
- function buildPayload(level, event, fields) {
342
- const out = {
343
- ts: (/* @__PURE__ */ new Date()).toISOString(),
344
- level,
345
- event
346
- };
347
- for (const [key, value] of Object.entries(fields)) {
348
- if (!ALLOWED_KEYS.has(key)) continue;
349
- if (key === "ts" || key === "level" || key === "event") continue;
350
- out[key] = redactValue(value);
351
- }
352
- return out;
353
- }
354
- /**
355
- * Writes a single JSON log line to stderr.
356
- * MCP stdio transport uses stdout; all diagnostics go to stderr.
357
- */
358
- function writeLog(level, event, fields = {}) {
359
- const payload = buildPayload(level, event, fields);
360
- process.stderr.write(`${JSON.stringify(payload)}\n`);
361
- }
362
- /** Log an informational structured event. */
363
- function logInfo(event, fields = {}) {
364
- writeLog("info", event, fields);
365
- }
366
- /** Log an error structured event. */
367
- function logError(event, fields = {}) {
368
- writeLog("error", event, fields);
369
- }
370
- //#endregion
371
281
  //#region src/mcp/chii-connection.ts
372
282
  /**
373
283
  * Production `CdpConnection` backed by the local Chii relay.
@@ -1451,6 +1361,8 @@ async function runTestFilesOverRelay(connection, files, opts) {
1451
1361
  const manualFiles = opts?.manualFiles;
1452
1362
  const manualTotal = manualFiles?.size ?? 0;
1453
1363
  let manualIndex = 0;
1364
+ let preflightPermissions;
1365
+ if (files.length > 0) preflightPermissions = await runPermissionPreflight(connection);
1454
1366
  try {
1455
1367
  for (const file of files) {
1456
1368
  if (pendingReconnectCheck) {
@@ -1553,7 +1465,8 @@ async function runTestFilesOverRelay(connection, files, opts) {
1553
1465
  duration: Date.now() - wallStart,
1554
1466
  files: fileResults,
1555
1467
  totals,
1556
- captures
1468
+ captures,
1469
+ ...preflightPermissions ? { preflight: { permissions: preflightPermissions } } : {}
1557
1470
  };
1558
1471
  }
1559
1472
  /**
@@ -1636,6 +1549,7 @@ function serializeRelayReport(report, meta) {
1636
1549
  startedAt: report.startedAt,
1637
1550
  duration: report.duration,
1638
1551
  totals: report.totals,
1552
+ ...report.preflight ? { preflight: report.preflight } : {},
1639
1553
  files: report.files.map((f) => {
1640
1554
  const file = relativise(meta.projectRoot, f.file);
1641
1555
  const modeField = f.mode === "manual" ? { mode: "manual" } : {};
@@ -2106,6 +2020,6 @@ main().catch((e) => {
2106
2020
  process.exitCode = 1;
2107
2021
  });
2108
2022
  //#endregion
2109
- export { RELAY_AUTH_REJECT_REASON as a, RELAY_AUTH_REJECT_CLOSE_CODE as i, logError as n, logInfo as r, ChiiCdpConnection as t };
2023
+ export { RELAY_AUTH_REJECT_CLOSE_CODE as n, RELAY_AUTH_REJECT_REASON as r, ChiiCdpConnection as t };
2110
2024
 
2111
2025
  //# sourceMappingURL=bin.js.map