@tempad-dev/mcp 1.0.3 → 1.0.4

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 (108) hide show
  1. package/dist/{acquire-TEiVy85j.mjs → acquire-BtKFZ9Lz.mjs} +1 -1
  2. package/dist/{acquire-DkkzoJ5Z.mjs → acquire-DHwsqq0j.mjs} +6 -7
  3. package/dist/{acquire-DkkzoJ5Z.mjs.map → acquire-DHwsqq0j.mjs.map} +1 -1
  4. package/dist/{bootstrap-Cz9cxf6f.mjs → bootstrap-B9-RyWlM.mjs} +14 -15
  5. package/dist/{bootstrap-Cz9cxf6f.mjs.map → bootstrap-B9-RyWlM.mjs.map} +1 -1
  6. package/dist/cli.mjs +12 -13
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/{client-binding-CuHY1-__.mjs → client-binding-CvSSv9JC.mjs} +4 -5
  9. package/dist/{client-binding-CuHY1-__.mjs.map → client-binding-CvSSv9JC.mjs.map} +1 -1
  10. package/dist/{cold-start-DnlXxs4o.mjs → cold-start-DOy9JsIQ.mjs} +11 -12
  11. package/dist/{cold-start-DnlXxs4o.mjs.map → cold-start-DOy9JsIQ.mjs.map} +1 -1
  12. package/dist/{cold-start-r07QQPSK.mjs → cold-start-U3cW0q9T.mjs} +1 -1
  13. package/dist/{config-CM4LsvW5.mjs → config-Busa_Dqv.mjs} +42 -31
  14. package/dist/config-Busa_Dqv.mjs.map +1 -0
  15. package/dist/{design-task-store-C9DJ_EQq.mjs → design-task-store-BHR54v8-.mjs} +8 -10
  16. package/dist/{design-task-store-C9DJ_EQq.mjs.map → design-task-store-BHR54v8-.mjs.map} +1 -1
  17. package/dist/{durable-json-dsqpwT93.mjs → durable-json-_WKesGDj.mjs} +2 -3
  18. package/dist/{durable-json-dsqpwT93.mjs.map → durable-json-_WKesGDj.mjs.map} +1 -1
  19. package/dist/{edge-DBOKhsN4.mjs → edge-BUf7gs4J.mjs} +14 -15
  20. package/dist/{edge-DBOKhsN4.mjs.map → edge-BUf7gs4J.mjs.map} +1 -1
  21. package/dist/{edge-C5SyBEy3.mjs → edge-CHzaTUFt.mjs} +1 -1
  22. package/dist/{hook-receipts-DcO9rRhi.mjs → hook-receipts-QJU3AMoY.mjs} +4 -5
  23. package/dist/{hook-receipts-DcO9rRhi.mjs.map → hook-receipts-QJU3AMoY.mjs.map} +1 -1
  24. package/dist/{host-context-CRMK5AI5.mjs → host-context-9TVtjsSm.mjs} +3 -4
  25. package/dist/{host-context-CRMK5AI5.mjs.map → host-context-9TVtjsSm.mjs.map} +1 -1
  26. package/dist/{hub-control-591ZGr_p.mjs → hub-control-UlA4Fncg.mjs} +7 -9
  27. package/dist/{hub-control-591ZGr_p.mjs.map → hub-control-UlA4Fncg.mjs.map} +1 -1
  28. package/dist/{hub-runtime-_GWa0RDc.mjs → hub-runtime-DjdqIgGl.mjs} +1 -1
  29. package/dist/{hub-runtime-j_CZJnWz.mjs → hub-runtime-DsEO9zvX.mjs} +130 -150
  30. package/dist/hub-runtime-DsEO9zvX.mjs.map +1 -0
  31. package/dist/hub.mjs +3 -4
  32. package/dist/{identity-BgzOQE2L.mjs → identity-CCaDEwgc.mjs} +4 -5
  33. package/dist/{identity-BgzOQE2L.mjs.map → identity-CCaDEwgc.mjs.map} +1 -1
  34. package/dist/{indexes-CCA-CTcL.mjs → indexes-zYqwqnU6.mjs} +10 -12
  35. package/dist/{indexes-CCA-CTcL.mjs.map → indexes-zYqwqnU6.mjs.map} +1 -1
  36. package/dist/log-transport.mjs +234 -143
  37. package/dist/log-transport.mjs.map +1 -1
  38. package/dist/managed-runtime.mjs +15 -17
  39. package/dist/managed-runtime.mjs.map +1 -1
  40. package/dist/{on-exit-leak-free-BvimJ0rP.mjs → on-exit-leak-free-By20-eFK.mjs} +6 -8
  41. package/dist/{on-exit-leak-free-BvimJ0rP.mjs.map → on-exit-leak-free-By20-eFK.mjs.map} +1 -1
  42. package/dist/{pino-CLoB7tK6.mjs → pino-BiEyUxFF.mjs} +56 -82
  43. package/dist/pino-BiEyUxFF.mjs.map +1 -0
  44. package/dist/{pino-abstract-transport-B0ISte63.mjs → pino-abstract-transport-BBwCGDga.mjs} +4 -6
  45. package/dist/{pino-abstract-transport-B0ISte63.mjs.map → pino-abstract-transport-BBwCGDga.mjs.map} +1 -1
  46. package/dist/pino-file.mjs +3 -4
  47. package/dist/pino-worker.mjs +6 -8
  48. package/dist/pino-worker.mjs.map +1 -1
  49. package/dist/{probe-B6KQJxXU.mjs → probe-BeWkMbzQ.mjs} +40 -55
  50. package/dist/probe-BeWkMbzQ.mjs.map +1 -0
  51. package/dist/{process-environment-DJDtCcdv.mjs → process-environment-DRRIdoL8.mjs} +2 -3
  52. package/dist/{process-environment-DJDtCcdv.mjs.map → process-environment-DRRIdoL8.mjs.map} +1 -1
  53. package/dist/{processes-CQvuh1Sl.mjs → processes-BCCE8As7.mjs} +17 -23
  54. package/dist/{processes-CQvuh1Sl.mjs.map → processes-BCCE8As7.mjs.map} +1 -1
  55. package/dist/{processes-n0G2xAWb.mjs → processes-CBoalzSk.mjs} +1 -1
  56. package/dist/{proper-lockfile-CisPoFAZ.mjs → proper-lockfile-BgKrOq5D.mjs} +19 -32
  57. package/dist/{proper-lockfile-CisPoFAZ.mjs.map → proper-lockfile-BgKrOq5D.mjs.map} +1 -1
  58. package/dist/{protocol-DNswG6F2.mjs → protocol-7m-E_iFu.mjs} +57 -108
  59. package/dist/protocol-7m-E_iFu.mjs.map +1 -0
  60. package/dist/{protocol-0jvK718o.mjs → protocol-COK3rM6m.mjs} +1 -1
  61. package/dist/{rolldown-runtime-CLlik3RS.mjs → rolldown-runtime-BH1-_iVd.mjs} +2 -3
  62. package/dist/{runtime-identity-BiWIlGgw.mjs → runtime-identity-D9V-g5M-.mjs} +2 -3
  63. package/dist/{runtime-identity-BiWIlGgw.mjs.map → runtime-identity-D9V-g5M-.mjs.map} +1 -1
  64. package/dist/runtime-installer.mjs +4 -5
  65. package/dist/runtime-manifest.json +107 -107
  66. package/dist/{runtime-platform-EULgJm_w.mjs → runtime-platform-C-Yk9F3L.mjs} +2 -3
  67. package/dist/{runtime-platform-EULgJm_w.mjs.map → runtime-platform-C-Yk9F3L.mjs.map} +1 -1
  68. package/dist/{runtime-recovery-Dq3hD3IT.mjs → runtime-recovery-DAYSaVV2.mjs} +1 -1
  69. package/dist/{runtime-recovery-DpqftTl9.mjs → runtime-recovery-DaRaQ8qY.mjs} +5 -6
  70. package/dist/{runtime-recovery-DpqftTl9.mjs.map → runtime-recovery-DaRaQ8qY.mjs.map} +1 -1
  71. package/dist/runtime-verification.mjs +6 -6
  72. package/dist/{schemas-BgOH6OcJ.mjs → schemas-ZDdPV7RQ.mjs} +23 -39
  73. package/dist/schemas-ZDdPV7RQ.mjs.map +1 -0
  74. package/dist/{server-C-tcoOT7.mjs → server-CsCpY0Ft.mjs} +645 -287
  75. package/dist/server-CsCpY0Ft.mjs.map +1 -0
  76. package/dist/{shared--CO_WPTx.mjs → shared--othnF1c.mjs} +16 -21
  77. package/dist/{shared--CO_WPTx.mjs.map → shared--othnF1c.mjs.map} +1 -1
  78. package/dist/{state-3mPLv7lh.mjs → shared-S0dtOYq8.mjs} +1 -1
  79. package/dist/{src-BGNQgTr6.mjs → src-BSnzZMvK.mjs} +3 -4
  80. package/dist/{src-BGNQgTr6.mjs.map → src-BSnzZMvK.mjs.map} +1 -1
  81. package/dist/{stable-edge-DQmYi4Mf.mjs → stable-edge-VAAxSYSS.mjs} +10 -14
  82. package/dist/stable-edge-VAAxSYSS.mjs.map +1 -0
  83. package/dist/{startup-log-iSoBU74r.mjs → startup-log-CYlFgdy5.mjs} +3 -4
  84. package/dist/{startup-log-iSoBU74r.mjs.map → startup-log-CYlFgdy5.mjs.map} +1 -1
  85. package/dist/{startup-log-C4DVL-6M.mjs → startup-log-DqK2uwBd.mjs} +1 -1
  86. package/dist/{state-CnkSwi5E.mjs → state-6qFcvi-I.mjs} +5 -6
  87. package/dist/{state-CnkSwi5E.mjs.map → state-6qFcvi-I.mjs.map} +1 -1
  88. package/dist/{shared-B8lb63iG.mjs → state-BrWBtYNG.mjs} +1 -1
  89. package/dist/{stdio-CZb1NNIa.mjs → stdio-20SBFdww.mjs} +3 -4
  90. package/dist/{stdio-CZb1NNIa.mjs.map → stdio-20SBFdww.mjs.map} +1 -1
  91. package/dist/{supervisor-B9lkK4ey.mjs → supervisor-CesT-H5_.mjs} +23 -27
  92. package/dist/{supervisor-B9lkK4ey.mjs.map → supervisor-CesT-H5_.mjs.map} +1 -1
  93. package/dist/{task-storage-recovery-_JdAWD5X.mjs → task-storage-recovery-I9lpYYX6.mjs} +6 -7
  94. package/dist/{task-storage-recovery-_JdAWD5X.mjs.map → task-storage-recovery-I9lpYYX6.mjs.map} +1 -1
  95. package/dist/thread-stream-worker.mjs +5 -6
  96. package/dist/thread-stream-worker.mjs.map +1 -1
  97. package/dist/{types-BEqvvpHh.mjs → types-C8GH0osr.mjs} +1 -1
  98. package/dist/{types-gJ5HkL66.mjs → types-kNTSQOnR.mjs} +4 -6
  99. package/dist/{types-gJ5HkL66.mjs.map → types-kNTSQOnR.mjs.map} +1 -1
  100. package/package.json +1 -1
  101. package/dist/config-CM4LsvW5.mjs.map +0 -1
  102. package/dist/hub-runtime-j_CZJnWz.mjs.map +0 -1
  103. package/dist/pino-CLoB7tK6.mjs.map +0 -1
  104. package/dist/probe-B6KQJxXU.mjs.map +0 -1
  105. package/dist/protocol-DNswG6F2.mjs.map +0 -1
  106. package/dist/schemas-BgOH6OcJ.mjs.map +0 -1
  107. package/dist/server-C-tcoOT7.mjs.map +0 -1
  108. package/dist/stable-edge-DQmYi4Mf.mjs.map +0 -1
@@ -4,4 +4,4 @@ globalThis.__bundlerPathsOverrides = {
4
4
  'pino-worker': runtimeFilePath(new URL('./pino-worker.mjs', import.meta.url)),
5
5
  'pino/file': runtimeFilePath(new URL('./pino-file.mjs', import.meta.url))
6
6
  };
7
- export { n as ControlPeer, f as SocketTransport } from "./protocol-DNswG6F2.mjs";
7
+ export { n as ControlPeer, f as SocketTransport } from "./protocol-7m-E_iFu.mjs";
@@ -5,7 +5,7 @@ globalThis.__bundlerPathsOverrides = {
5
5
  'pino/file': runtimeFilePath(new URL('./pino-file.mjs', import.meta.url))
6
6
  };
7
7
  import { createRequire } from "node:module";
8
- //#region \0rolldown/runtime.js
8
+ // \0rolldown/runtime.js
9
9
  var __create = Object.create;
10
10
  var __defProp = Object.defineProperty;
11
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -20,7 +20,7 @@ var __esmMin = (fn, res, err) => () => {
20
20
  throw err = [e], e;
21
21
  }
22
22
  };
23
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
23
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
24
24
  var __copyProps = (to, from, except, desc) => {
25
25
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
26
26
  key = keys[i];
@@ -36,5 +36,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  enumerable: true
37
37
  }) : target, mod));
38
38
  var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
39
- //#endregion
40
39
  export { __toESM as i, __esmMin as n, __require as r, __commonJSMin as t };
@@ -7,7 +7,7 @@ globalThis.__bundlerPathsOverrides = {
7
7
  import { resolve } from "node:path";
8
8
  import { readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
9
9
  import { createHash } from "node:crypto";
10
- //#region src/runtime-identity.ts
10
+ // src/runtime-identity.ts
11
11
  function fingerprintRuntimeFile(path) {
12
12
  return createHash("sha256").update(readFileSync(path)).digest("hex");
13
13
  }
@@ -69,7 +69,6 @@ function getExtensionRuntimeIssues(runtime) {
69
69
  if (!runtime) return ["Extension did not publish a runtime identity handshake"];
70
70
  return [];
71
71
  }
72
- //#endregion
73
72
  export { removeHubRuntimeIdentityIfOwned as a, readHubRuntimeIdentity as i, getExtensionRuntimeIssues as n, writeHubRuntimeIdentity as o, parseHubRuntimeIdentity as r, createHubRuntimeIdentity as t };
74
73
 
75
- //# sourceMappingURL=runtime-identity-BiWIlGgw.mjs.map
74
+ //# sourceMappingURL=runtime-identity-D9V-g5M-.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-identity-BiWIlGgw.mjs","names":[],"sources":["../src/runtime-identity.ts"],"sourcesContent":["import { createHash } from 'node:crypto'\nimport { readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\nexport interface HubRuntimeIdentity {\n schemaVersion: 1\n packageVersion: string\n runtimeFingerprint: string\n entryPath: string\n startedAt: string\n processId: number\n activeExtension: ActiveExtensionRuntimeIdentity | null\n wsPort?: number\n}\n\nexport interface ActiveExtensionRuntimeIdentity {\n id: string\n connectedAt: string\n version: string | null\n fingerprint: string | null\n}\n\nexport interface ExtensionRuntimeSnapshot {\n version: string\n fingerprint: string\n}\n\nexport function fingerprintRuntimeFile(path: string): string {\n return createHash('sha256').update(readFileSync(path)).digest('hex')\n}\n\nexport function createHubRuntimeIdentity(\n entryPath: string,\n packageVersion: string,\n options: { now?: Date; processId?: number } = {}\n): HubRuntimeIdentity {\n return {\n schemaVersion: 1,\n packageVersion,\n runtimeFingerprint: fingerprintRuntimeFile(entryPath),\n entryPath: resolve(entryPath),\n startedAt: (options.now ?? new Date()).toISOString(),\n processId: options.processId ?? process.pid,\n activeExtension: null\n }\n}\n\nfunction isSha256(value: unknown): value is string {\n return typeof value === 'string' && /^[a-f0-9]{64}$/.test(value)\n}\n\nexport function parseHubRuntimeIdentity(value: unknown): HubRuntimeIdentity | null {\n if (!value || typeof value !== 'object') return null\n const candidate = value as Partial<HubRuntimeIdentity>\n const activeExtension = parseActiveExtensionRuntimeIdentity(candidate.activeExtension)\n if (\n candidate.schemaVersion !== 1 ||\n typeof candidate.packageVersion !== 'string' ||\n !isSha256(candidate.runtimeFingerprint) ||\n typeof candidate.entryPath !== 'string' ||\n typeof candidate.startedAt !== 'string' ||\n !Number.isFinite(Date.parse(candidate.startedAt)) ||\n typeof candidate.processId !== 'number' ||\n !Number.isInteger(candidate.processId) ||\n (candidate.wsPort !== undefined &&\n (!Number.isInteger(candidate.wsPort) || candidate.wsPort < 1 || candidate.wsPort > 65535)) ||\n activeExtension === undefined\n ) {\n return null\n }\n return { ...candidate, activeExtension } as HubRuntimeIdentity\n}\n\nfunction parseActiveExtensionRuntimeIdentity(\n value: unknown\n): ActiveExtensionRuntimeIdentity | null | undefined {\n // Keep runtime records from before active-extension publication readable for diagnostics.\n if (value === undefined || value === null) return null\n if (!value || typeof value !== 'object') return undefined\n const candidate = value as Partial<ActiveExtensionRuntimeIdentity>\n if (\n typeof candidate.id !== 'string' ||\n typeof candidate.connectedAt !== 'string' ||\n !Number.isFinite(Date.parse(candidate.connectedAt)) ||\n (candidate.version !== null && typeof candidate.version !== 'string') ||\n (candidate.fingerprint !== null && !isSha256(candidate.fingerprint))\n ) {\n return undefined\n }\n return candidate as ActiveExtensionRuntimeIdentity\n}\n\nexport function readHubRuntimeIdentity(path: string): HubRuntimeIdentity | null {\n try {\n return parseHubRuntimeIdentity(JSON.parse(readFileSync(path, 'utf8')))\n } catch {\n return null\n }\n}\n\nexport function writeHubRuntimeIdentity(path: string, identity: HubRuntimeIdentity): void {\n const temporaryPath = `${path}.${identity.processId}.tmp`\n try {\n writeFileSync(temporaryPath, `${JSON.stringify(identity, null, 2)}\\n`, { mode: 0o600 })\n renameSync(temporaryPath, path)\n } catch (error) {\n try {\n rmSync(temporaryPath, { force: true })\n } catch {\n // Preserve the original write error when cleanup also fails.\n }\n throw error\n }\n}\n\nexport function removeHubRuntimeIdentityIfOwned(path: string, processId: number): void {\n if (readHubRuntimeIdentity(path)?.processId !== processId) return\n rmSync(path, { force: true })\n}\n\nexport function getExtensionRuntimeIssues(runtime: ExtensionRuntimeSnapshot | undefined): string[] {\n if (!runtime) return ['Extension did not publish a runtime identity handshake']\n return []\n}\n"],"mappings":";;;;;;;;;;AA2BA,SAAgB,uBAAuB,MAAsB;CAC3D,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,aAAa,IAAI,CAAC,CAAC,CAAC,OAAO,KAAK;AACrE;AAEA,SAAgB,yBACd,WACA,gBACA,UAA8C,CAAC,GAC3B;CACpB,OAAO;EACL,eAAe;EACf;EACA,oBAAoB,uBAAuB,SAAS;EACpD,WAAW,QAAQ,SAAS;EAC5B,YAAY,QAAQ,uBAAO,IAAI,KAAK,EAAA,CAAG,YAAY;EACnD,WAAW,QAAQ,aAAa,QAAQ;EACxC,iBAAiB;CACnB;AACF;AAEA,SAAS,SAAS,OAAiC;CACjD,OAAO,OAAO,UAAU,YAAY,iBAAiB,KAAK,KAAK;AACjE;AAEA,SAAgB,wBAAwB,OAA2C;CACjF,IAAI,CAAC,SAAS,OAAO,UAAU,UAAU,OAAO;CAChD,MAAM,YAAY;CAClB,MAAM,kBAAkB,oCAAoC,UAAU,eAAe;CACrF,IACE,UAAU,kBAAkB,KAC5B,OAAO,UAAU,mBAAmB,YACpC,CAAC,SAAS,UAAU,kBAAkB,KACtC,OAAO,UAAU,cAAc,YAC/B,OAAO,UAAU,cAAc,YAC/B,CAAC,OAAO,SAAS,KAAK,MAAM,UAAU,SAAS,CAAC,KAChD,OAAO,UAAU,cAAc,YAC/B,CAAC,OAAO,UAAU,UAAU,SAAS,KACpC,UAAU,WAAW,KAAA,MACnB,CAAC,OAAO,UAAU,UAAU,MAAM,KAAK,UAAU,SAAS,KAAK,UAAU,SAAS,UACrF,oBAAoB,KAAA,GAEpB,OAAO;CAET,OAAO;EAAE,GAAG;EAAW;CAAgB;AACzC;AAEA,SAAS,oCACP,OACmD;CAEnD,IAAI,UAAU,KAAA,KAAa,UAAU,MAAM,OAAO;CAClD,IAAI,CAAC,SAAS,OAAO,UAAU,UAAU,OAAO,KAAA;CAChD,MAAM,YAAY;CAClB,IACE,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,gBAAgB,YACjC,CAAC,OAAO,SAAS,KAAK,MAAM,UAAU,WAAW,CAAC,KACjD,UAAU,YAAY,QAAQ,OAAO,UAAU,YAAY,YAC3D,UAAU,gBAAgB,QAAQ,CAAC,SAAS,UAAU,WAAW,GAElE;CAEF,OAAO;AACT;AAEA,SAAgB,uBAAuB,MAAyC;CAC9E,IAAI;EACF,OAAO,wBAAwB,KAAK,MAAM,aAAa,MAAM,MAAM,CAAC,CAAC;CACvE,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,wBAAwB,MAAc,UAAoC;CACxF,MAAM,gBAAgB,GAAG,KAAK,GAAG,SAAS,UAAU;CACpD,IAAI;EACF,cAAc,eAAe,GAAG,KAAK,UAAU,UAAU,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,IAAM,CAAC;EACtF,WAAW,eAAe,IAAI;CAChC,SAAS,OAAO;EACd,IAAI;GACF,OAAO,eAAe,EAAE,OAAO,KAAK,CAAC;EACvC,QAAQ,CAER;EACA,MAAM;CACR;AACF;AAEA,SAAgB,gCAAgC,MAAc,WAAyB;CACrF,IAAI,uBAAuB,IAAI,CAAC,EAAE,cAAc,WAAW;CAC3D,OAAO,MAAM,EAAE,OAAO,KAAK,CAAC;AAC9B;AAEA,SAAgB,0BAA0B,SAAyD;CACjG,IAAI,CAAC,SAAS,OAAO,CAAC,wDAAwD;CAC9E,OAAO,CAAC;AACV"}
1
+ {"version":3,"file":"runtime-identity-D9V-g5M-.mjs","names":[],"sources":["../src/runtime-identity.ts"],"sourcesContent":["import { createHash } from 'node:crypto'\nimport { readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\nexport interface HubRuntimeIdentity {\n schemaVersion: 1\n packageVersion: string\n runtimeFingerprint: string\n entryPath: string\n startedAt: string\n processId: number\n activeExtension: ActiveExtensionRuntimeIdentity | null\n wsPort?: number\n}\n\nexport interface ActiveExtensionRuntimeIdentity {\n id: string\n connectedAt: string\n version: string | null\n fingerprint: string | null\n}\n\nexport interface ExtensionRuntimeSnapshot {\n version: string\n fingerprint: string\n}\n\nexport function fingerprintRuntimeFile(path: string): string {\n return createHash('sha256').update(readFileSync(path)).digest('hex')\n}\n\nexport function createHubRuntimeIdentity(\n entryPath: string,\n packageVersion: string,\n options: { now?: Date; processId?: number } = {}\n): HubRuntimeIdentity {\n return {\n schemaVersion: 1,\n packageVersion,\n runtimeFingerprint: fingerprintRuntimeFile(entryPath),\n entryPath: resolve(entryPath),\n startedAt: (options.now ?? new Date()).toISOString(),\n processId: options.processId ?? process.pid,\n activeExtension: null\n }\n}\n\nfunction isSha256(value: unknown): value is string {\n return typeof value === 'string' && /^[a-f0-9]{64}$/.test(value)\n}\n\nexport function parseHubRuntimeIdentity(value: unknown): HubRuntimeIdentity | null {\n if (!value || typeof value !== 'object') return null\n const candidate = value as Partial<HubRuntimeIdentity>\n const activeExtension = parseActiveExtensionRuntimeIdentity(candidate.activeExtension)\n if (\n candidate.schemaVersion !== 1 ||\n typeof candidate.packageVersion !== 'string' ||\n !isSha256(candidate.runtimeFingerprint) ||\n typeof candidate.entryPath !== 'string' ||\n typeof candidate.startedAt !== 'string' ||\n !Number.isFinite(Date.parse(candidate.startedAt)) ||\n typeof candidate.processId !== 'number' ||\n !Number.isInteger(candidate.processId) ||\n (candidate.wsPort !== undefined &&\n (!Number.isInteger(candidate.wsPort) || candidate.wsPort < 1 || candidate.wsPort > 65535)) ||\n activeExtension === undefined\n ) {\n return null\n }\n return { ...candidate, activeExtension } as HubRuntimeIdentity\n}\n\nfunction parseActiveExtensionRuntimeIdentity(\n value: unknown\n): ActiveExtensionRuntimeIdentity | null | undefined {\n // Keep runtime records from before active-extension publication readable for diagnostics.\n if (value === undefined || value === null) return null\n if (!value || typeof value !== 'object') return undefined\n const candidate = value as Partial<ActiveExtensionRuntimeIdentity>\n if (\n typeof candidate.id !== 'string' ||\n typeof candidate.connectedAt !== 'string' ||\n !Number.isFinite(Date.parse(candidate.connectedAt)) ||\n (candidate.version !== null && typeof candidate.version !== 'string') ||\n (candidate.fingerprint !== null && !isSha256(candidate.fingerprint))\n ) {\n return undefined\n }\n return candidate as ActiveExtensionRuntimeIdentity\n}\n\nexport function readHubRuntimeIdentity(path: string): HubRuntimeIdentity | null {\n try {\n return parseHubRuntimeIdentity(JSON.parse(readFileSync(path, 'utf8')))\n } catch {\n return null\n }\n}\n\nexport function writeHubRuntimeIdentity(path: string, identity: HubRuntimeIdentity): void {\n const temporaryPath = `${path}.${identity.processId}.tmp`\n try {\n writeFileSync(temporaryPath, `${JSON.stringify(identity, null, 2)}\\n`, { mode: 0o600 })\n renameSync(temporaryPath, path)\n } catch (error) {\n try {\n rmSync(temporaryPath, { force: true })\n } catch {\n // Preserve the original write error when cleanup also fails.\n }\n throw error\n }\n}\n\nexport function removeHubRuntimeIdentityIfOwned(path: string, processId: number): void {\n if (readHubRuntimeIdentity(path)?.processId !== processId) return\n rmSync(path, { force: true })\n}\n\nexport function getExtensionRuntimeIssues(runtime: ExtensionRuntimeSnapshot | undefined): string[] {\n if (!runtime) return ['Extension did not publish a runtime identity handshake']\n return []\n}\n"],"mappings":";;;;;;;;;;AA2BA,SAAgB,uBAAuB,MAAsB;CAC3D,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,aAAa,IAAI,CAAC,CAAC,CAAC,OAAO,KAAK;AACrE;AAEA,SAAgB,yBACd,WACA,gBACA,UAA8C,CAAC,GAC3B;CACpB,OAAO;EACL,eAAe;EACf;EACA,oBAAoB,uBAAuB,SAAS;EACpD,WAAW,QAAQ,SAAS;EAC5B,YAAY,QAAQ,uBAAO,IAAI,KAAK,EAAA,CAAG,YAAY;EACnD,WAAW,QAAQ,aAAa,QAAQ;EACxC,iBAAiB;CACnB;AACF;AAEA,SAAS,SAAS,OAAiC;CACjD,OAAO,OAAO,UAAU,YAAY,iBAAiB,KAAK,KAAK;AACjE;AAEA,SAAgB,wBAAwB,O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C;EACtF,WAAW,eAAe,IAAI;CAChC,SAAS,OAAO;EACd,IAAI;GACF,OAAO,eAAe,EAAE,OAAO,KAAK,CAAC;EACvC,QAAQ,CAER;EACA,MAAM;CACR;AACF;AAEA,SAAgB,gCAAgC,MAAc,WAAyB;CACrF,IAAI,uBAAuB,IAAI,CAAC,EAAE,cAAc,WAAW;CAC3D,OAAO,MAAM,EAAE,OAAO,KAAK,CAAC;AAC9B;AAEA,SAAgB,0BAA0B,SAAyD;CACjG,IAAI,CAAC,SAAS,OAAO,CAAC,wDAAwD;CAC9E,OAAO,CAAC;AACV"}
@@ -5,10 +5,10 @@ globalThis.__bundlerPathsOverrides = {
5
5
  'pino-worker': runtimeFilePath(new URL('./pino-worker.mjs', import.meta.url)),
6
6
  'pino/file': runtimeFilePath(new URL('./pino-file.mjs', import.meta.url))
7
7
  };
8
- import { a as createPrivateTempDirectory } from "./runtime-platform-EULgJm_w.mjs";
8
+ import { a as createPrivateTempDirectory } from "./runtime-platform-C-Yk9F3L.mjs";
9
9
  import { isAbsolute, join } from "node:path";
10
10
  import { rmSync } from "node:fs";
11
- //#region src/runtime-installer.ts
11
+ // src/runtime-installer.ts
12
12
  const [flag, cache, versionFlag, selector, contextFlag, context, cursorFlag, cursor] = process.argv.slice(2);
13
13
  if (process.env.TEMPAD_MCP_DEV_CHECKOUT || flag !== "--cache" || !cache || !isAbsolute(cache) || versionFlag !== "--version" || !selector || contextFlag !== "--context" || !context || process.argv.length !== 8 && !(process.argv.length === 10 && cursorFlag === "--cursor" && cursor)) throw new Error("Release acquisition requires an explicit private release cache and version; checkout acquisition is forbidden.");
14
14
  const isolation = createPrivateTempDirectory("tp-acquire-");
@@ -18,9 +18,9 @@ for (const [key, directory] of Object.entries({
18
18
  TEMPAD_MCP_ASSET_DIR: "assets",
19
19
  TEMPAD_MCP_LOG_DIR: "logs"
20
20
  })) process.env[key] = join(isolation, directory);
21
- const { endLogging } = await import("./shared-B8lb63iG.mjs");
21
+ const { endLogging } = await import("./shared-S0dtOYq8.mjs");
22
22
  try {
23
- const { AcquisitionContextSchema, SelectionCursorSchema, stageRelease } = await import("./acquire-TEiVy85j.mjs");
23
+ const { AcquisitionContextSchema, SelectionCursorSchema, stageRelease } = await import("./acquire-BtKFZ9Lz.mjs");
24
24
  const staged = await stageRelease(cache, selector, AcquisitionContextSchema.parse(JSON.parse(context)), cursor ? SelectionCursorSchema.parse(JSON.parse(cursor)) : void 0);
25
25
  process.stdout.write(JSON.stringify(staged) + "\n");
26
26
  } catch (error) {
@@ -33,7 +33,6 @@ try {
33
33
  force: true
34
34
  });
35
35
  }
36
- //#endregion
37
36
  export {};
38
37
 
39
38
  //# sourceMappingURL=runtime-installer.mjs.map
@@ -2,14 +2,14 @@
2
2
  "version": 1,
3
3
  "guidanceEpoch": 1,
4
4
  "guidanceReview": {
5
- "version": "1.0.3",
6
- "sourceHash": "d2f50c20944b8de3c2ddebfd4bb9060155345bbb2408ae66563feedf06e2791b",
5
+ "version": "1.0.4",
6
+ "sourceHash": "3a47046453b0c5983adae278017387d904d7e022e2944eca1a3abf4c972c2745",
7
7
  "decision": "compatible",
8
8
  "baseline": {
9
- "version": "1.0.2",
10
- "integrity": "sha512-gL6ehWZHF645i8JVQqhjH2xYVGMiU76MhlQYuNaP5ltwOOf65mfP2YYmasSWofGMejqatl8UCxPGgCLDImRmkw=="
9
+ "version": "1.0.3",
10
+ "integrity": "sha512-37KVcCNMBqbWu9lxKtv+isqgihMGsjngDZynrGYx768s9QmMvg+T++j1cydrSOirIqAnbsRUqgHvLnNUR0+piQ=="
11
11
  },
12
- "rationale": "Resumes Hub recovery after control loss during a runtime update, cancels background recovery when its last client exits, and publishes supervisor status atomically. Interrupted switches are not replayed. Tool guidance, control and extension protocols, and durable state remain compatible with 1.0.2 and earlier epoch-1 releases."
12
+ "rationale": "Adds get_structure guidance for sparse native 3D readback, retaining configured disabled states and distinguishing omitted defaults or unavailable fields from verified clears. Published 1.0.3 already transports these native fields; older epoch-1 tool guidance remains valid and does not promise default 3D values. Argument and result wire contracts, control and extension protocols, and durable state remain compatible with 1.0.3 and earlier epoch-1 releases."
13
13
  },
14
14
  "controlProtocols": [
15
15
  2
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "hookProtocol": 2,
32
32
  "name": "@tempad-dev/mcp",
33
- "packageVersion": "1.0.3",
33
+ "packageVersion": "1.0.4",
34
34
  "entry": "dist/managed-runtime.mjs",
35
35
  "node": "^22 || ^24 || >=26",
36
36
  "platforms": [
@@ -39,113 +39,113 @@
39
39
  "win32"
40
40
  ],
41
41
  "wireHash": "69ce843d3119c820cf73e05e94ee121dfbe1884acbe93b6bbffd2ca6fe0deaa6",
42
- "presentationHash": "6d9b1ed342941f5dec95bb68f782fda95b02624eae8066d494da4400e38e9498",
43
- "lockHash": "229dbd3b329aba174adcfb122eb04467a9edfb0ecd94ad52d261df47932bff1a",
42
+ "presentationHash": "bf6b6b8c069d519bdd1fc037bac87e64f7adc25998b9ec34112c4714e2e419b5",
43
+ "lockHash": "9a11acc5b99f2d9be57d8029ef9cf73d07ff2c2ea086254502759152c3e87ace",
44
44
  "files": {
45
- "package.json": "352768809e3f8330f7e410d973fd7f9148fb3a4642491058a6c3bf5b55688025",
46
- "dist/acquire-DkkzoJ5Z.mjs.map": "ce23748d530de5bd616bbf40579fe57d4348f99f8f9deed3d16cdd3ac4f379a2",
47
- "dist/bootstrap-Cz9cxf6f.mjs.map": "92e0fea0f32dd7062701c3da02afa8d633bd3d3fa76f8144b77b8ad2a8d7607a",
48
- "dist/cli.mjs.map": "9d5fa267917cef93d1853222fe20e4ce98214d3ecacf042fcfc7610b8ccb5815",
49
- "dist/client-binding-CuHY1-__.mjs.map": "dfd55c66ecc4471838f91ba8dbad5d8b3676bb12ccca5e0acdbcfcebccf9f7c1",
50
- "dist/cold-start-DnlXxs4o.mjs.map": "2eaf36dcfdcc85b6c817a17ea27f99206099863ddd520b47eb91b1b329df5b90",
51
- "dist/config-CM4LsvW5.mjs.map": "811b971dc5f783521750c42d956af0f3f638d7b1e8ab5078cddef31661d1cdd4",
52
- "dist/design-task-store-C9DJ_EQq.mjs.map": "b03acb5e2f5e5c252136520f84f83a2ac13f1946daca7261fbe641bc5b421dc7",
53
- "dist/durable-json-dsqpwT93.mjs.map": "d36d5ad00fd4d1f8dc81e87179685a6c4df18a105c4e20fc5527858fdeb53104",
54
- "dist/edge-DBOKhsN4.mjs.map": "df5e4c9a56498b6273a5664729b7062f5de9053b827c89418958df8f8bad74a7",
55
- "dist/hook-receipts-DcO9rRhi.mjs.map": "54ea2cad0e1afccfbb97b1239b65dbda58830197ca88e466240b630da3c3106e",
56
- "dist/host-context-CRMK5AI5.mjs.map": "f78c56c033c0a7425f4c33ac86022cc9f950903b195e7de0623903aca43df232",
57
- "dist/hub-control-591ZGr_p.mjs.map": "4f62f4d3a508257fc88af5b4aed3aa76ae568570e8692bb5a46e2d79f8ac7ff9",
58
- "dist/hub-runtime-j_CZJnWz.mjs.map": "70b6e93d0ba6787caa187d3d1707f8ab87301df18b44b44f31c8c454f49331ca",
45
+ "package.json": "1bc138f9e61ad8a50c502bb4122061ed721991e2efc040237b32785fb4fdeec1",
46
+ "dist/acquire-DHwsqq0j.mjs.map": "83a76e5d06884db86809fa95110cb2199bc3ecbe24c3e4604c584b679ae62eab",
47
+ "dist/bootstrap-B9-RyWlM.mjs.map": "984e21b1c1b83ecd1bdf1b85d0d348474479afcb81e5e58ac8e58d6d642c3000",
48
+ "dist/cli.mjs.map": "2bf807e0883d0e72e87c8f7c6acd11832a5645098454c489feceefa22291bee8",
49
+ "dist/client-binding-CvSSv9JC.mjs.map": "d456b6509e789c0e92c6fc7537ec4557a120c9d7696e859d809ed6b3b04b7c34",
50
+ "dist/cold-start-DOy9JsIQ.mjs.map": "8180688a175c9e26698e63a1b236bba07fa44a5ab75f08cabe5ab8a5ad2819b3",
51
+ "dist/config-Busa_Dqv.mjs.map": "86218ef53aa1575457c5f03755fa33ca3f5947e9bb5dc7155088ba3a17e42da0",
52
+ "dist/design-task-store-BHR54v8-.mjs.map": "df570a04fd59100201d8e08bf7a573a2b0e807f1a025fecb23a49256561bebf3",
53
+ "dist/durable-json-_WKesGDj.mjs.map": "3eba481b696b42c471bd6c5389a9d4c53f32fa26c6af7960e0f1d2f3f60dab9f",
54
+ "dist/edge-BUf7gs4J.mjs.map": "cb7961d14e3614021ca7e3ae47583b9c8896579557c328e86ffe1e88b53ec531",
55
+ "dist/hook-receipts-QJU3AMoY.mjs.map": "374617279267a5edc5574ea89858022a9e742fb5ed784d9997d4cc68264e8adf",
56
+ "dist/host-context-9TVtjsSm.mjs.map": "95cce40474055242948fce44b39cdf00097edddf230024f3327e0a2206ddd76f",
57
+ "dist/hub-control-UlA4Fncg.mjs.map": "7010085d64c62c495a036bad7fd1fc9f1ece492830715e4841cb7850dbd9c8bd",
58
+ "dist/hub-runtime-DsEO9zvX.mjs.map": "3f9ea73b2d3c757941871336a796291fb304fda7e8032cab0ef5cecd0c157e47",
59
59
  "dist/hub.mjs.map": "f628e4878d30786b4d0b821a05c1b76de42290c9829831b766b70d9f1e971101",
60
- "dist/identity-BgzOQE2L.mjs.map": "6aebf3b278507989433c59e7ea243357b699ea342c86217be3e62205346e5225",
61
- "dist/indexes-CCA-CTcL.mjs.map": "b9e7f6ce0c344e1fad6639d0123234a2e218e449e1d9e3969c135f135acfcb4e",
62
- "dist/log-transport.mjs.map": "5a3cb5f071dc556f917d50742ad3922779e14089ff01620e2a7c9efddbc09b31",
63
- "dist/managed-runtime.mjs.map": "eb826253394daa5cb59f352795a21ba0398f3203ae6cc1d1b1d5ae2e486ca775",
64
- "dist/on-exit-leak-free-BvimJ0rP.mjs.map": "a27e2c9f0c2d6c7fc97bd1ea176bd07db1d2945ca13743547ef3a68a80d29b73",
65
- "dist/pino-abstract-transport-B0ISte63.mjs.map": "bfc55eaddd1fa7740424056e78ffaf9f4c647a3e936b53e5476662c8a3bbd649",
66
- "dist/pino-CLoB7tK6.mjs.map": "8f109f1b6eeb1cb99ddd8d74d34720580080ae287730130117c30baae3f4a980",
60
+ "dist/identity-CCaDEwgc.mjs.map": "d65c390d733decb20ae92a2ba1328b383ef653d926637613facb8e8699726749",
61
+ "dist/indexes-zYqwqnU6.mjs.map": "5c571737e6aad3d9332d685fb148eac6cdeccbd3d39939190244fa8d8d2c4a58",
62
+ "dist/log-transport.mjs.map": "ae18a30ab64212405d9dee7749c295acf329fb1b6d77fef19985a017da662563",
63
+ "dist/managed-runtime.mjs.map": "e4f49122ef80e8bcfcbaf28fc019847580cffaa417824e663688d40626ac0b92",
64
+ "dist/on-exit-leak-free-By20-eFK.mjs.map": "f9be83cb488e21c451ceb574fdbeba6cc14faef26cdeb9991c9e1f4b0a50dc75",
65
+ "dist/pino-abstract-transport-BBwCGDga.mjs.map": "4e5973828ac22ea412fc2a427ce9b65866a2f09fa743c108c0904142d6edd26f",
66
+ "dist/pino-BiEyUxFF.mjs.map": "e99f5a29c6e2b673965fba1f1d950d49ff4e934b44ccd87f682a7c45346b5fd1",
67
67
  "dist/pino-file.mjs.map": "4453be483f7f8e1bc531faf7842b13096b24bb9779c57756ad859a7cd94e1de7",
68
- "dist/pino-worker.mjs.map": "1513219b1737e290945531aacb3408031413aba8de11839f831d9adb49677544",
69
- "dist/probe-B6KQJxXU.mjs.map": "a540607f751a064fd317408a705b6c20501ff27b813ea3e4e9fbfcdd843ba11d",
70
- "dist/process-environment-DJDtCcdv.mjs.map": "76ed9ae25eb6bb0872587bc92315713f8991bbb8038ad752d16beb6e9628fbd1",
71
- "dist/processes-CQvuh1Sl.mjs.map": "272906a0a34917d214300a5e45581c9871a721353394d1fbcb95ca7e4e319d0b",
72
- "dist/proper-lockfile-CisPoFAZ.mjs.map": "584c65d0292be904290682fa38835b4896d00befa162a67a35eff4c1c4deac2a",
73
- "dist/protocol-DNswG6F2.mjs.map": "36827f7bf5e30a1566338462a6de4ddf11282ac8b26fd2fe3f78edeb86583da7",
74
- "dist/runtime-identity-BiWIlGgw.mjs.map": "93755c4687510a7ddb95616bdc5100c6619b869f7894ccd5a6d2ceec07ce3c9d",
68
+ "dist/pino-worker.mjs.map": "feae1a98a96a5da539880724b7f2a76adfc60a9dae27089155fe29b4f4c4f253",
69
+ "dist/probe-BeWkMbzQ.mjs.map": "feeeae66361fdafe934a00cf68faec006457852fd6951c09a96525c1ae6319f3",
70
+ "dist/process-environment-DRRIdoL8.mjs.map": "81d6f26950a040f04abeac6e4150d8b66c6a3f901ac2e4a168d197bdba7da883",
71
+ "dist/processes-BCCE8As7.mjs.map": "19a026ab41b90c1bcfe3bdc2536403a9052eac827f1949240cff074072be0acb",
72
+ "dist/proper-lockfile-BgKrOq5D.mjs.map": "8c804947e4eb72f6b35f73d7d89e88708d5c8e379fd8f6f6b08e79307cca59ca",
73
+ "dist/protocol-7m-E_iFu.mjs.map": "5781bfc324ecae5962dc2449972696fd3466c093eb1bd78da0f82f6df39d9585",
74
+ "dist/runtime-identity-D9V-g5M-.mjs.map": "27f591281c33927633d997b336a47eaf59bcc91f1eae0c35043e5a7a980afe08",
75
75
  "dist/runtime-installer.mjs.map": "3232f475e73350f7d46298489926ac05b3861cdef0f446dfa4c122097be1ccea",
76
- "dist/runtime-platform-EULgJm_w.mjs.map": "3e439987b2e763869dd3b0ca0b915a6a701b1e603c94bda68f6322d058e0785b",
77
- "dist/runtime-recovery-DpqftTl9.mjs.map": "9fed0faf58258842c89992e6f9e8dccb68a50e8787c4d9d55434aa4dd134bf35",
78
- "dist/schemas-BgOH6OcJ.mjs.map": "4303e28c1d6c707ac8c16c74fd4fd190118675b5d4f3c73a10c2d2c647adcf8f",
79
- "dist/server-C-tcoOT7.mjs.map": "9b0e559c990833c0d954f988f6ae91a86538fd44e46d48bcd974446699962fd5",
80
- "dist/shared--CO_WPTx.mjs.map": "9136f4b7ba285572a59d866695480318c4ce27e4d9350f515504b0800c0f9ac1",
81
- "dist/src-BGNQgTr6.mjs.map": "05a3f021ddd2d9c849b71454e6b47a9595638cbb79c1fce615e8af105ff9cee9",
82
- "dist/stable-edge-DQmYi4Mf.mjs.map": "f79beb68c50740640cb4063cb298ac260a46fb8c44b9a0c26b3daefb05561c39",
83
- "dist/startup-log-iSoBU74r.mjs.map": "c78ebda860c0e79910dbcfcc68618599a6266fc6c712e0976c5ee8bf2474d4c8",
84
- "dist/state-CnkSwi5E.mjs.map": "6aa55a1b81b27199e558df6fb78c5497b884927abcc9171aa50f33960a44729b",
85
- "dist/stdio-CZb1NNIa.mjs.map": "79db0955aa04a40a18f8a83f0168cd9a7829f6f86b206a44c75c518c8593bf27",
86
- "dist/supervisor-B9lkK4ey.mjs.map": "61c9b338a56f5b214ef62daea1aa85c4febf416db20db768e09a3ca3becb5aa6",
87
- "dist/task-storage-recovery-_JdAWD5X.mjs.map": "fd9c0968b7c3da28aa4007a1cc88d3442c042b7cb7891020cc58501a46491e68",
88
- "dist/thread-stream-worker.mjs.map": "7e805890feb6f180abe6e62947f3211e87e21fd1bca6fe6819cc6864bf16e340",
89
- "dist/types-gJ5HkL66.mjs.map": "acbd175f26bc706a2ff9a4772d332db71a3f2d9aa8f62666f02ba1dc307577de",
76
+ "dist/runtime-platform-C-Yk9F3L.mjs.map": "c5abb488be0268850fffa2b7542f37358854642df804645ca4aac3c172663cc2",
77
+ "dist/runtime-recovery-DaRaQ8qY.mjs.map": "d8c7258d91db904bfccf7c2929b3f4f4f38f2ef1c0c569116fe0cdbd2047866a",
78
+ "dist/schemas-ZDdPV7RQ.mjs.map": "1809fdc7690d425cb61e0f7ed6963b1ef530deb13c83e80b2c98df880735abc3",
79
+ "dist/server-CsCpY0Ft.mjs.map": "f39c2945fafbce5be11c06c6216a8f142b98bae5e8c840da207d474f4ac9916f",
80
+ "dist/shared--othnF1c.mjs.map": "cb3af43723abaeb945ec7b6c6c2edca94347fccc2963aff2532d2192db1bb2cd",
81
+ "dist/src-BSnzZMvK.mjs.map": "d9f28a6a6bc7aa8d7cbdc2b07f3e8a8e5e045cef1120ceda19de327eb28415f7",
82
+ "dist/stable-edge-VAAxSYSS.mjs.map": "0bd09f0fae1663baac9e965b0a580d0fbcb5ae4dd71a75c90745b6ed7931c94d",
83
+ "dist/startup-log-CYlFgdy5.mjs.map": "2971520b9c22b7ec9f98631eb76668f044852a14736ba4922a2884af72c783d9",
84
+ "dist/state-6qFcvi-I.mjs.map": "a24696af66d46d69a321e643183adb1e435d9b66562d497f127aa38c65560900",
85
+ "dist/stdio-20SBFdww.mjs.map": "119236e3521dbd72b242c5bbe4b5c34b99d21eb21e86da0b49100576aadbd42d",
86
+ "dist/supervisor-CesT-H5_.mjs.map": "da2a13b4bc25e665948bc33a758ad92b57dfc0baa4d517bcf97512476e1400d5",
87
+ "dist/task-storage-recovery-I9lpYYX6.mjs.map": "e3f6e8b00d1bd110629ce050965c7d75a41c1b144d091ad63357f51bd2bde6c0",
88
+ "dist/thread-stream-worker.mjs.map": "c7e0ab45241464f73756309e4f26b7f3e707058162b278fc84b82022222c24da",
89
+ "dist/types-kNTSQOnR.mjs.map": "5c5de9b12b5f42e473aba779827a2fe96ed053310c45e8e38eae377e13e726a7",
90
90
  "README.md": "f7238f393a98b8cd0df30230ef1b1d1f300243e9d5b555ad422c4e441ef37c1a",
91
91
  "README.zh-Hans.md": "7d21b5340464209bec3162ddd98ca2788734dd5121ce434b6a775edaffe46bad",
92
- "dist/acquire-DkkzoJ5Z.mjs": "29ed2d9660a0b3efe3f3087d0a58bb153c5e48aae0c943c6f3be5e6f1e7878f1",
93
- "dist/acquire-TEiVy85j.mjs": "f2107beefb0670e8b30e29c598e9ea010bd5551d8c4d0202710afd2474fb41a1",
94
- "dist/bootstrap-Cz9cxf6f.mjs": "de570fcec09edddf8990bbfef7d09a7c9262efcfbc4251e3083c090335e90b1c",
95
- "dist/cli.mjs": "80d411fd5e873fac83e4de1172f9612df59f66e15124b7c6c5d78c920f1b7c81",
96
- "dist/client-binding-CuHY1-__.mjs": "508e31e93f2243723ee2b30a3d6e380de2e0d5213e342449c8336a501f557adc",
97
- "dist/cold-start-DnlXxs4o.mjs": "549e958c0a6f29ee20f99a1aa4ceb23ef0d868e15906559401989970c885001a",
98
- "dist/cold-start-r07QQPSK.mjs": "ba9ab11c53fee53c8442f78ce170f4bca0fb0d06af58ae73042dc818d9885b30",
99
- "dist/config-CM4LsvW5.mjs": "0145e66788e694ee174d5f6a7470f661ba1752669cabf2f927658a856beba6fb",
100
- "dist/design-task-store-C9DJ_EQq.mjs": "9ae1995288111d8d78affacbcc8a8bb318bac2579a255e764ac0020e9f6e9ebb",
101
- "dist/durable-json-dsqpwT93.mjs": "295fe42b2507caea668a1f50c2b8e01954c6cda3b761d200a696005543ee30eb",
102
- "dist/edge-C5SyBEy3.mjs": "de3a51170258fd1771c111780753b222ed750c31e9859dc2738a446c2e17553f",
103
- "dist/edge-DBOKhsN4.mjs": "dd8987c52784ac6cbacddb363390e0ddd8c86bb2932bd1c465786c40fa84534c",
104
- "dist/hook-receipts-DcO9rRhi.mjs": "88d199f92bfff496d2b03d08b5848e2919416ff5d965bdfeb86dd5eaa8644ea2",
105
- "dist/host-context-CRMK5AI5.mjs": "4ddfbe561f57df5badf6dbc2f8495546f5817a1e3c6644e1209b01f5b385d969",
106
- "dist/hub-control-591ZGr_p.mjs": "3025f8e30ddb5e55231d9ddf23c317353c4d525e0cc38b68ebb75108bb84ff44",
107
- "dist/hub-runtime-_GWa0RDc.mjs": "749ea5bec0155c1c0554a063265eeff6211c30169f3034067aa6a39d37077560",
108
- "dist/hub-runtime-j_CZJnWz.mjs": "faca4cbb40fd99f5d15e6e2f67f13365e15b50539d7d1b1ede6374370cb2b035",
109
- "dist/hub.mjs": "f1c9990ecaaa32fedf375f3d4c69dbcd5b3ba2b4bc0e109bbde7f947dbc4f51b",
110
- "dist/identity-BgzOQE2L.mjs": "1b231e9e15327c5519e5e54ef0fe65bb5587f6b30082286e06868559083f3778",
111
- "dist/indexes-CCA-CTcL.mjs": "5f7456a32c44c50fca7eb0170b1c164c5c9b57a529d9b05135498f484b5aac75",
112
- "dist/log-transport.mjs": "f04c80a734cb56e4268103abfac75da5d4b93a836ff09cb11bb576f9bb4080a3",
113
- "dist/managed-runtime.mjs": "97835a9f1cc302b1f4626cfc8972ba030492d6312241ccb99410ca154f15b5c9",
114
- "dist/on-exit-leak-free-BvimJ0rP.mjs": "2b6fcc000936fc006178bbae92eeed44d0318e68581fd2fb19b45f57949e48cb",
115
- "dist/pino-abstract-transport-B0ISte63.mjs": "fd136b5438043026f5f5324bb1c90741a291617d4e56602d6e71d09b8135bf14",
116
- "dist/pino-CLoB7tK6.mjs": "593ba805a82807c7989b53a77914fffc12f97f74d02b1e319b8478dc55675ee1",
117
- "dist/pino-file.mjs": "78a7c886f5c2227adb05cdaab179560dcd176a067c3c202966002c3fd2d9bced",
118
- "dist/pino-worker.mjs": "33869e105c85e196873136d00c12ea9bb3936d5461d63f87337d663332c3249f",
119
- "dist/probe-B6KQJxXU.mjs": "30f0711a2a2a8d718c36be67bd67a013a445630c7c7384da4b7f511450231b72",
120
- "dist/process-environment-DJDtCcdv.mjs": "7d41e35af70ee415a86a1b0062ac2de2c770c7637957decb2e860faa790b57d3",
121
- "dist/processes-CQvuh1Sl.mjs": "bbee9a6d3188d7b8500728e9dbaf5609c019a7c7ae8c7faaafa12af7fe4c664a",
122
- "dist/processes-n0G2xAWb.mjs": "308d3203c1b8fd74034f9bb4c2ff08277ace0135b9a004fe5417df1292703e17",
123
- "dist/proper-lockfile-CisPoFAZ.mjs": "c2cbf53823f586879203f3eb6a3240c5ead193b5d17bd15173f718f1e21908c1",
124
- "dist/protocol-0jvK718o.mjs": "7dc2e161ca937ae1eaa869c1242c7c68617b5a12ff71cfbc2fa95662dc409f4a",
125
- "dist/protocol-DNswG6F2.mjs": "790079437756e6b2d2a468d34905bf7000330ccf6b2dc648d8304e390188b4dc",
126
- "dist/rolldown-runtime-CLlik3RS.mjs": "dcefb4689ae07d918a692cfb309252eee80d2f8242fcc9c6efc67c92a53f9c11",
127
- "dist/runtime-identity-BiWIlGgw.mjs": "c5a94adc21701f91467c44912957ec69451953cc55b635b714fee3318d5277d2",
128
- "dist/runtime-installer.mjs": "be7ce13228132246f9c6fb1580e8538c3b0331e6fda8c7a2f6d0590dcc93958c",
129
- "dist/runtime-platform-EULgJm_w.mjs": "5ec16e4eec1683c2e8dec1d75012d64f842f5933dbb2874eef548b1ee536d279",
130
- "dist/runtime-recovery-DpqftTl9.mjs": "25f5a8794cff0d42c2e8ca1fca0268c929b4e235860c6a0f33e0408babd2b206",
131
- "dist/runtime-recovery-Dq3hD3IT.mjs": "50b5d8b8095edcbbe10ed7e92e2944b9bf9d0e17807c6eaa143310cd59a6374c",
132
- "dist/runtime-verification.mjs": "f81ccd77ca20b67868e8e601f4fa61175d5727084d008cb90f8120e0524590d5",
133
- "dist/schemas-BgOH6OcJ.mjs": "f9fe9fb18497c1d52dd1cf34f73f99dcac9adda4c173e17a54141516384c92b5",
134
- "dist/server-C-tcoOT7.mjs": "49b8efd2ee1115372ca895ea5b49a57bef8469680effaff53947226eca944f6e",
135
- "dist/shared--CO_WPTx.mjs": "d902310dcbe0635481352e2cdd0f28ce1e9eed9e2ba0731e4ab0d65dc29d2d6e",
136
- "dist/shared-B8lb63iG.mjs": "19f52205551e505de0ca1691c88b00c0052e6b700709fe7369966f337c0b65b4",
137
- "dist/src-BGNQgTr6.mjs": "89b2a06faea8f8437bf09873da80d1ff9f312f56d280d35771cd244d68154597",
138
- "dist/stable-edge-DQmYi4Mf.mjs": "ce331ed2b6175cd7ec968de509a6099c5e724423bbd66e26db61d00253d7f439",
139
- "dist/startup-log-C4DVL-6M.mjs": "ad34a8e2447b456c3400d08b7a11c75e2273b6f8258b405a75973de47ce4072b",
140
- "dist/startup-log-iSoBU74r.mjs": "cbc8f3360c42675fd1a9064c2744b90e6577bb11bb66997d4030725af7642f81",
141
- "dist/state-3mPLv7lh.mjs": "dddea9040064e4df486b7826b54f4d72f7d0e7e7c0a66c3a77c4bc19a3ffbc53",
142
- "dist/state-CnkSwi5E.mjs": "b1384a589df330ca907a9e0bcb39a39d792579761c35d52112941e4e0f009822",
143
- "dist/stdio-CZb1NNIa.mjs": "f74cc01adafd54efe603c6a6c79e2efc4a3cc5972585b02ced3e21351e445f98",
144
- "dist/supervisor-B9lkK4ey.mjs": "4e5b194e57460609e9d5cf60923e1b22d1a15054d82e13e3668491aa55374fd7",
145
- "dist/task-storage-recovery-_JdAWD5X.mjs": "3ffb84e4d9c95fb26d812cfb61ce4cdcf2f1f52b77c9037b78f90284235ff1f8",
146
- "dist/thread-stream-worker.mjs": "4abf47121b1744e5c16db64f083a84c71d1e11ae6d9792e2714d645651fb2c73",
147
- "dist/types-BEqvvpHh.mjs": "96ff81685d5d682cb64cc29ed368c4f33520bbc192c53b8945c89b331755f1c4",
148
- "dist/types-gJ5HkL66.mjs": "9701ef76f223a0993c3a3f6e4f2f20f66087f2003dc1dfb7eb1a045aa0f1a9ee",
92
+ "dist/acquire-BtKFZ9Lz.mjs": "eab5912cb9e60a3d97d6b8e1a8282081f88ea81fc05174007cd19e9589e83e99",
93
+ "dist/acquire-DHwsqq0j.mjs": "616c1bf3819c90a9bd20c516ef1dbf2bd3b3af20cfcabd82f1e26c5c2176c3ef",
94
+ "dist/bootstrap-B9-RyWlM.mjs": "2e55c9fd66f378df8ae7d2190d8aaf1deb6776e26ff9d355b0e6aba2b6eb1c19",
95
+ "dist/cli.mjs": "078c6a95b711703354ea302854f5f94634b5a1219886bbaa145fa2fea2dbdd47",
96
+ "dist/client-binding-CvSSv9JC.mjs": "770504f9b3d18352e4d142cf6360f8f98026eec692e3961460e4a7a9d9b47791",
97
+ "dist/cold-start-DOy9JsIQ.mjs": "9a461fc1d6beb0f7b000c1ecae193875cb588568c38f1627b276d3f019336261",
98
+ "dist/cold-start-U3cW0q9T.mjs": "c8ebe634813d88e3b41b13dc85140b613f7541a7415ed84047f95507baa9b987",
99
+ "dist/config-Busa_Dqv.mjs": "38cf59f385b801ddedeccc80f7ba9d442b6cdd7714b1940278ef4ee354e2177e",
100
+ "dist/design-task-store-BHR54v8-.mjs": "949048ec2e93659de57ab3544146059e0059f89632b60ed4292e0cdaf4bfb655",
101
+ "dist/durable-json-_WKesGDj.mjs": "33267092b143d3c44cd3583e05bf45952a6ee78e42ec337fdda771837362c797",
102
+ "dist/edge-BUf7gs4J.mjs": "4eb54ac80b304229f01592ac68de976a6dd8045fff24139f0484bd45117915c9",
103
+ "dist/edge-CHzaTUFt.mjs": "9babcfc3436729921d3039825e26ab5cf20bfb0b0040fb7f61399b973a5fee6b",
104
+ "dist/hook-receipts-QJU3AMoY.mjs": "b04d0990946ea31c174202650d57bb9480e86aea903848f1a7dc19012b08a533",
105
+ "dist/host-context-9TVtjsSm.mjs": "aa2cc5c74ca2e07ff4fcd343bf4eaa027ee9d99206f19eff0b4d4cee1524b909",
106
+ "dist/hub-control-UlA4Fncg.mjs": "e9310dac7c9d9aeed98df1f2987c92ed52a05461f477c285f9fabafe834c6a58",
107
+ "dist/hub-runtime-DjdqIgGl.mjs": "c068aa3871f428d32f8ec2da821f9a11a161fcfcb7de0975dc68e61d5ae3081a",
108
+ "dist/hub-runtime-DsEO9zvX.mjs": "d96dca0bf87ea3dc08a3e260f1ff9341d8a6a0488fe2d51e12b30191aa9d9a28",
109
+ "dist/hub.mjs": "d6a7c4fea24362828dbef9d635783c8bbd0a294e34eb698d2fabe148757a75ed",
110
+ "dist/identity-CCaDEwgc.mjs": "614338e0232c5b230a525613e94d4c9a711231b3f945f90b2847332e30b51f47",
111
+ "dist/indexes-zYqwqnU6.mjs": "772b9ee86e0b8e563300a5d5f6b0c5fcd498ff8e35615fb4059792cc80553cb1",
112
+ "dist/log-transport.mjs": "f2009436b62134db8984d106d52e289f6fa56f4cfd6e3975cd93ac4a35dbe418",
113
+ "dist/managed-runtime.mjs": "c5248ece8d1eb6138f7eef2c81f5f9332bf81dff69a5b25f7ecaf01932b13bf8",
114
+ "dist/on-exit-leak-free-By20-eFK.mjs": "6a99d8b674f927a89b9f9e6391a61bd8c58e0091cec659a8ea152a9791825206",
115
+ "dist/pino-abstract-transport-BBwCGDga.mjs": "7565530d114115f52b122f8264765681db28dcc733ca6903385e5ba56c3e4d7e",
116
+ "dist/pino-BiEyUxFF.mjs": "78595b087d117d1c29820776781967b21acc5ccbb8a1f8f7176ec56acbebe0e1",
117
+ "dist/pino-file.mjs": "c33844b468afbe4d31479ca4385df7de80bc09e87739e0108281e5ae41f0e371",
118
+ "dist/pino-worker.mjs": "c8779ed51c5fe5dd54d3c0961a8ac5e85d7239c31bfdeaa38ea56e31b76bfe04",
119
+ "dist/probe-BeWkMbzQ.mjs": "5c1a081f8f69e371fedc85615cab562924d0e7bd5f4d16315bb0b119d9c3f93b",
120
+ "dist/process-environment-DRRIdoL8.mjs": "e66efd3064c2ce120627b678f5ef986c27970dd939f5b5171c72c2443632f08c",
121
+ "dist/processes-BCCE8As7.mjs": "549eb5222522a20ebc94dd3ddc11dae1cf6ed613e217353cebe88f36dba0cd7f",
122
+ "dist/processes-CBoalzSk.mjs": "369c663fb2d1803e85f5986472375d8a6f443911a1529c2040cb68a66deed2da",
123
+ "dist/proper-lockfile-BgKrOq5D.mjs": "21a63cfc0912890c85460bda663bf6a05f896fa49ba3698b8940cba1af60f82b",
124
+ "dist/protocol-7m-E_iFu.mjs": "ace90bb0ee0a5213d6da4f1bf3c46cb5d2143a839887a9c017089096be3f9764",
125
+ "dist/protocol-COK3rM6m.mjs": "e000d6b7d1463c6f2d1120ac494ddbd7fef8c909c9d6202eee569195384ded04",
126
+ "dist/rolldown-runtime-BH1-_iVd.mjs": "bf41b502587fce9fe094a7a7a8c7696110e0b00516f289255cdfb1fe96e2d627",
127
+ "dist/runtime-identity-D9V-g5M-.mjs": "f23eeffc2e7c0cbf947938b0ba76a3f400f1edae42851c94e8ce726528e49894",
128
+ "dist/runtime-installer.mjs": "5b8fc5c5eb1e14043705b91042c628a5118d7d902ba5611f4ca41d101de5cfec",
129
+ "dist/runtime-platform-C-Yk9F3L.mjs": "252391175c2106bc475d5ea57c0481e48f0ab623419db5d534d84ed071a7f5df",
130
+ "dist/runtime-recovery-DaRaQ8qY.mjs": "05c0bc5fe9424155b4f9df5f64d632baf22205ac01e9a13c073494a22eda86e6",
131
+ "dist/runtime-recovery-DAYSaVV2.mjs": "36316ffda4ae910a6b9b8e5119fa158addec620fa93265b533189df79bfbf979",
132
+ "dist/runtime-verification.mjs": "f6973fda5bc15b3ad959d59cd5300dad78fedfc490d0ee22b72f041ed67e3543",
133
+ "dist/schemas-ZDdPV7RQ.mjs": "ae06f277fbe961fe19c4e316d6970ff7c8b9a05542d9385c2c0e3632ca3582f0",
134
+ "dist/server-CsCpY0Ft.mjs": "4d73ef86ec784f41fe6a46503d03d16c309691b117ae690aff3402c5a6f9501b",
135
+ "dist/shared--othnF1c.mjs": "a444732e069000c509c39df921ad43494035489b9a1b2fc24ce60751454703f0",
136
+ "dist/shared-S0dtOYq8.mjs": "d97ee346c0f83e81c48822dd7fb7b5a2e8ab333588cd095923e6ae4d57f9e329",
137
+ "dist/src-BSnzZMvK.mjs": "48351419408f10a559a3805590b61e000f3d67f385dac3d1901b5034c557db31",
138
+ "dist/stable-edge-VAAxSYSS.mjs": "08df7f784d08b248313005a6ec73453f2a98106907c7c407ee1d9c073e66677d",
139
+ "dist/startup-log-CYlFgdy5.mjs": "b1a650b370b059708b501c7c9d72bf1840df63d0f53bd3d9a92331aff04fe948",
140
+ "dist/startup-log-DqK2uwBd.mjs": "9cbbc49d2846649d000d756ae6aafe7ab29e13dfef7622d4fefe8d7138a0759b",
141
+ "dist/state-6qFcvi-I.mjs": "3171ab0c0b271fd5976b70eb104ba1346b5d62224e9bba6d982d141d384981ef",
142
+ "dist/state-BrWBtYNG.mjs": "90aeeb53af65337d41bb170ec08019345f2f24619111a67f8a5f427ff8f04bba",
143
+ "dist/stdio-20SBFdww.mjs": "f70a7690dd90e6d78ceba86475d8aabc637740f834858ac560d10b1d7884b487",
144
+ "dist/supervisor-CesT-H5_.mjs": "d354d784a08e060a5d0c4e16ca46334ac296c92068d81c8d586b2fed4ed6c504",
145
+ "dist/task-storage-recovery-I9lpYYX6.mjs": "1a33a5b0f77dcb88508c68aa24cef1a3b4f74ae4192102ed8ae7432667264826",
146
+ "dist/thread-stream-worker.mjs": "f3df7d8ea2000178e226631a8ad1045192e78d6d3d11c28038519b9d0b1b9013",
147
+ "dist/types-C8GH0osr.mjs": "648494aac9f2a10734ae65304b2ce9e30dadb34521598e654ea86d808a45e7ff",
148
+ "dist/types-kNTSQOnR.mjs": "e7af0bee3122607d2729e7e2808589b1c768459f12198db8ca76794394b57b98",
149
149
  "dist/THIRD-PARTY-LICENSES.txt": "27ee41d1da9bc7ad6cfaeeacb8c830ac91c8ec6f6d38c79082f2d8b65c326148"
150
150
  }
151
151
  }
@@ -9,7 +9,7 @@ import { isAbsolute, join, resolve } from "node:path";
9
9
  import { tmpdir, userInfo } from "node:os";
10
10
  import { lstatSync, mkdirSync, realpathSync, rmSync } from "node:fs";
11
11
  import { createHash, randomUUID } from "node:crypto";
12
- //#region src/runtime-platform.ts
12
+ // src/runtime-platform.ts
13
13
  const PIPE_PREFIX = "\\\\.\\pipe\\";
14
14
  const checkedPermissions = /* @__PURE__ */ new Map();
15
15
  /** Runtime overrides must isolate pipes as well as files, including on one Windows account. */
@@ -323,7 +323,6 @@ public static class TempadPipeSecurity {
323
323
  exit 1
324
324
  }
325
325
  `;
326
- //#endregion
327
326
  export { createPrivateTempDirectory as a, isPipe as c, cleanupEndpoint as i, protectPipeAsync as l, assertPrivatePath as n, ensurePrivateDirectory as o, assertPrivatePathAsync as r, ensurePrivateDirectoryAsync as s, assertPrivateEndpointAsync as t, runtimeEndpoint as u };
328
327
 
329
- //# sourceMappingURL=runtime-platform-EULgJm_w.mjs.map
328
+ //# sourceMappingURL=runtime-platform-C-Yk9F3L.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-platform-EULgJm_w.mjs","names":[],"sources":["../src/runtime-platform.ts"],"sourcesContent":["import { execFile, execFileSync } from 'node:child_process'\nimport { createHash, randomUUID } from 'node:crypto'\nimport { lstatSync, mkdirSync, realpathSync, rmSync } from 'node:fs'\nimport { tmpdir, userInfo } from 'node:os'\nimport { isAbsolute, join, resolve } from 'node:path'\n\nconst PIPE_PREFIX = '\\\\\\\\.\\\\pipe\\\\'\nconst checkedPermissions = new Map<string, ReturnType<typeof inspectPath>>()\n\n/** Runtime overrides must isolate pipes as well as files, including on one Windows account. */\nexport function runtimeEndpoint(\n directory: string,\n name: string,\n platform: NodeJS.Platform = process.platform,\n user = userInfo().username\n) {\n if (platform !== 'win32') return join(directory, name)\n const identity = createHash('sha256')\n .update(user)\n .update('\\0')\n .update(directory.replaceAll('/', '\\\\').toLowerCase())\n .update('\\0')\n .update(name)\n .digest('hex')\n .slice(0, 32)\n return `${PIPE_PREFIX}tempad-runtime-${identity}`\n}\n\nexport function isPipe(path: string) {\n return path.startsWith(PIPE_PREFIX)\n}\n\nfunction canonical(path: string) {\n const actual = realpathSync(path)\n return process.platform === 'win32'\n ? actual.toLowerCase() === resolve(path).toLowerCase()\n : actual === path\n}\n\n/** Check real Windows ACLs; chmod and stat.mode do not establish Windows privacy. */\nfunction inspectPath(path: string, kind: 'file' | 'directory') {\n if (!isAbsolute(path)) throw new Error('Runtime path must be absolute.')\n const stat = lstatSync(path, { bigint: true })\n if (\n stat.isSymbolicLink() ||\n !(kind === 'file' ? stat.isFile() : stat.isDirectory()) ||\n !canonical(path) ||\n (process.platform !== 'win32' && (stat.uid !== BigInt(process.getuid!()) || stat.mode & 0o077n))\n )\n throw new Error(`Refusing untrusted runtime ${kind}: ${path}`)\n return {\n identity: `${stat.dev}:${stat.ino}:${stat.birthtimeNs}:${kind}`,\n revision: stat.ctimeNs\n }\n}\n\nfunction rememberPermissions(path: string, state: ReturnType<typeof inspectPath>) {\n if (checkedPermissions.size >= 1024) checkedPermissions.clear()\n checkedPermissions.set(path, state)\n}\n\nfunction uncheckedPath(path: string, kind: 'file' | 'directory') {\n const state = inspectPath(path, kind)\n if (process.platform !== 'win32') return\n const cached = checkedPermissions.get(path)\n if (cached?.identity === state.identity && cached.revision === state.revision) return\n checkedPermissions.delete(path)\n return state\n}\n\nfunction checkedPath(\n path: string,\n kind: 'file' | 'directory',\n state: ReturnType<typeof inspectPath>\n) {\n const next = inspectPath(path, kind)\n if (next.identity !== state.identity)\n throw Object.assign(new Error(`Runtime ${kind} changed during its permission check: ${path}`), {\n code: 'ERUNTIMEPATHCHANGED'\n })\n if (next.revision === state.revision) {\n rememberPermissions(path, next)\n return\n }\n return next\n}\n\nexport function assertPrivatePath(path: string, kind: 'file' | 'directory') {\n let state = uncheckedPath(path, kind)\n if (!state) return\n for (let attempt = 0; attempt < 2; attempt++) {\n windowsSecurity('inspect', path, kind)\n // ChangeTime covers ACL edits and ordinary child creation. Recheck once when it\n // changes, rejecting replacement but leaving an actively changing object uncached.\n state = checkedPath(path, kind, state)\n if (!state) return\n }\n}\n\n/** Serving processes must let control leases renew while Windows checks permissions. */\nexport async function assertPrivatePathAsync(path: string, kind: 'file' | 'directory') {\n let state = uncheckedPath(path, kind)\n if (!state) return\n for (let attempt = 0; attempt < 2; attempt++) {\n await windowsSecurityAsync('inspect', path, kind)\n state = checkedPath(path, kind, state)\n if (!state) return\n }\n}\n\nexport function ensurePrivateDirectory(path: string) {\n if (!isAbsolute(path)) throw new Error('Runtime directory must be absolute.')\n if (process.platform !== 'win32') {\n mkdirSync(path, { recursive: true, mode: 0o700 })\n assertPrivatePath(path, 'directory')\n return\n }\n try {\n assertPrivatePath(path, 'directory')\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error\n windowsSecurity('ensure', path, 'directory')\n rememberPermissions(path, inspectPath(path, 'directory'))\n }\n}\n\nexport async function ensurePrivateDirectoryAsync(path: string) {\n if (process.platform !== 'win32') return ensurePrivateDirectory(path)\n try {\n await assertPrivatePathAsync(path, 'directory')\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error\n await windowsSecurityAsync('ensure', path, 'directory')\n rememberPermissions(path, inspectPath(path, 'directory'))\n }\n}\n\nexport function createPrivateTempDirectory(prefix: string) {\n // macOS's per-user temp path leaves too little room for Unix socket names.\n const directory = process.platform === 'win32' ? tmpdir() : '/tmp'\n const path = join(realpathSync(directory), `${prefix}${randomUUID()}`)\n ensurePrivateDirectory(path)\n return path\n}\n\nexport function cleanupEndpoint(path: string) {\n if (!isPipe(path)) rmSync(path, { force: true })\n}\n\nexport function assertPrivateEndpoint(path: string) {\n if (!isPipe(path)) throw new Error('Expected a Windows runtime pipe.')\n windowsSecurity('inspect', path, 'pipe')\n}\n\nexport function protectPipe(path: string) {\n if (!isPipe(path)) throw new Error('Expected a Windows runtime pipe.')\n windowsSecurity('protect', path, 'pipe')\n}\n\nexport async function assertPrivateEndpointAsync(path: string, signal?: AbortSignal) {\n if (!isPipe(path)) throw new Error('Expected a Windows runtime pipe.')\n await windowsSecurityAsync('inspect', path, 'pipe', signal)\n}\n\nexport async function protectPipeAsync(path: string, signal?: AbortSignal) {\n if (!isPipe(path)) throw new Error('Expected a Windows runtime pipe.')\n await windowsSecurityAsync('protect', path, 'pipe', signal)\n}\n\nexport function windowsPowerShellEnvironment(env: NodeJS.ProcessEnv = process.env) {\n // PowerShell 7's module paths can load incompatible modules in Windows PowerShell 5.\n return Object.fromEntries(\n Object.entries(env).filter(([key]) => key.toLowerCase() !== 'psmodulepath')\n )\n}\n\n// Built-in Windows PowerShell supplies the platform ACL API without an npm/native dependency.\n// JSON stays in a child-only environment value, never executable source or shell arguments.\n// Helper input is independent of host stdio and the Windows console's input code page.\nfunction securityCommand(action: 'ensure' | 'inspect' | 'protect', path: string, kind: string) {\n const systemRoot = process.env.SystemRoot\n if (!systemRoot || !isAbsolute(systemRoot))\n throw new Error('Windows SystemRoot is required to verify private runtime storage.')\n return {\n file: join(systemRoot, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe'),\n args: [\n '-NoLogo',\n '-NoProfile',\n '-NonInteractive',\n '-EncodedCommand',\n Buffer.from(SECURITY_SCRIPT, 'utf16le').toString('base64')\n ],\n options: {\n encoding: 'utf8' as const,\n timeout: 15_000,\n maxBuffer: 64 * 1024,\n windowsHide: true,\n env: {\n ...windowsPowerShellEnvironment(),\n TEMPAD_RUNTIME_ACL_REQUEST: JSON.stringify({ action, path, kind })\n }\n }\n }\n}\n\nfunction windowsSecurity(action: 'ensure' | 'inspect' | 'protect', path: string, kind: string) {\n const { file, args, options } = securityCommand(action, path, kind)\n try {\n execFileSync(file, args, { ...options, stdio: ['ignore', 'pipe', 'pipe'] })\n } catch (cause) {\n throw securityFailure(cause, path, kind)\n }\n}\n\nasync function windowsSecurityAsync(\n action: 'ensure' | 'inspect' | 'protect',\n path: string,\n kind: string,\n signal?: AbortSignal\n) {\n const { file, args, options } = securityCommand(action, path, kind)\n await new Promise<void>((resolve, reject) => {\n const child = execFile(file, args, { ...options, signal }, (error, stdout, stderr) => {\n if (error) reject(securityFailure(Object.assign(error, { stdout, stderr }), path, kind))\n else resolve()\n })\n child.stdin?.end()\n })\n}\n\nfunction securityFailure(cause: unknown, path: string, kind: string) {\n const error = cause as { stdout?: string; stderr?: string }\n const detail = [error.stdout, error.stderr].filter(Boolean).join('\\n').trim()\n let code: number | string | undefined\n let reportedFailure = false\n try {\n const report = JSON.parse(error.stderr ?? '{}')\n code = report.code\n reportedFailure = typeof report.message === 'string'\n } catch {\n // Startup and policy failures need not be JSON; they still fail closed.\n }\n const failure = new Error(\n `Refusing untrusted Windows runtime ${kind}: ${path}${detail ? ` (${detail})` : ''}`,\n {\n cause\n }\n ) as NodeJS.ErrnoException\n if (code === 2 || code === 3) failure.code = 'ENOENT'\n if (code === 231) failure.code = 'EBUSY'\n if (code === 'EPIPEUNPROTECTED') failure.code = code\n if (!failure.code && kind === 'pipe' && reportedFailure) failure.code = 'EPIPEUNTRUSTED'\n return failure\n}\n\nconst SECURITY_SCRIPT = String.raw`\n$ErrorActionPreference = 'Stop'\n$ProgressPreference = 'SilentlyContinue'\n[Console]::OutputEncoding = [Text.UTF8Encoding]::new($false)\n# Module autoload can stall with a filtered host environment. Use the trusted\n# built-in modules directly, without scanning host/user module locations.\nImport-Module \"$PSHOME\\Modules\\Microsoft.PowerShell.Utility\\Microsoft.PowerShell.Utility.psd1\" -ErrorAction Stop\nImport-Module \"$PSHOME\\Modules\\Microsoft.PowerShell.Security\\Microsoft.PowerShell.Security.psd1\" -ErrorAction Stop\n$PSModuleAutoloadingPreference = 'None'\n$failureCode = $null\ntry {\n $request = $env:TEMPAD_RUNTIME_ACL_REQUEST | ConvertFrom-Json\n $user = [System.Security.Principal.WindowsIdentity]::GetCurrent().User\n $allowed = @($user.Value, 'S-1-5-18', 'S-1-5-32-544')\n if ($request.kind -eq 'pipe') {\n Add-Type -TypeDefinition @'\nusing System;\nusing System.ComponentModel;\nusing System.Runtime.InteropServices;\nusing Microsoft.Win32.SafeHandles;\npublic static class TempadPipeSecurity {\n [DllImport(\"kernel32.dll\", CharSet=CharSet.Unicode, SetLastError=true)]\n static extern SafeFileHandle CreateFile(string name, uint access, uint share, IntPtr security, uint creation, uint flags, IntPtr template);\n [DllImport(\"advapi32.dll\", SetLastError=true)]\n static extern uint GetSecurityInfo(SafeFileHandle handle, uint type, uint info, out IntPtr owner, out IntPtr group, out IntPtr dacl, out IntPtr sacl, out IntPtr descriptor);\n [DllImport(\"advapi32.dll\", SetLastError=true)]\n static extern uint SetSecurityInfo(SafeFileHandle handle, uint type, uint info, IntPtr owner, IntPtr group, IntPtr dacl, IntPtr sacl);\n [DllImport(\"advapi32.dll\", CharSet=CharSet.Unicode, SetLastError=true)]\n static extern bool ConvertStringSecurityDescriptorToSecurityDescriptor(string value, uint revision, out IntPtr descriptor, out uint length);\n [DllImport(\"advapi32.dll\", SetLastError=true)]\n static extern bool GetSecurityDescriptorDacl(IntPtr descriptor, out bool present, out IntPtr dacl, out bool defaulted);\n [DllImport(\"advapi32.dll\")]\n static extern uint GetSecurityDescriptorLength(IntPtr descriptor);\n [DllImport(\"kernel32.dll\")]\n static extern IntPtr LocalFree(IntPtr memory);\n public static byte[] Inspect(string path, string sddl) {\n // PowerShell converts a null string argument to an empty string.\n bool protect = !String.IsNullOrEmpty(sddl);\n SafeFileHandle opened = CreateFile(path, 0x20000u | (protect ? 0x40000u : 0u), 7, IntPtr.Zero, 3, 0x40000000, IntPtr.Zero);\n int openError = Marshal.GetLastWin32Error();\n using (SafeFileHandle handle = opened) {\n if (handle.IsInvalid) throw new Win32Exception(openError, \"CreateFile failed for the runtime pipe.\");\n if (protect) {\n IntPtr replacement; uint length;\n if (!ConvertStringSecurityDescriptorToSecurityDescriptor(sddl, 1, out replacement, out length)) throw new Win32Exception(Marshal.GetLastWin32Error(), \"ConvertStringSecurityDescriptorToSecurityDescriptor failed.\");\n try {\n bool present, defaulted; IntPtr acl;\n if (!GetSecurityDescriptorDacl(replacement, out present, out acl, out defaulted)) throw new Win32Exception(Marshal.GetLastWin32Error(), \"GetSecurityDescriptorDacl failed.\");\n if (!present || acl == IntPtr.Zero) throw new InvalidOperationException(\"The replacement pipe descriptor has no discretionary ACL.\");\n uint changed = SetSecurityInfo(handle, 6, 4u | 0x80000000u, IntPtr.Zero, IntPtr.Zero, acl, IntPtr.Zero);\n if (changed != 0) throw new Win32Exception((int)changed, \"SetSecurityInfo failed for the runtime pipe.\");\n } finally { LocalFree(replacement); }\n }\n IntPtr owner, group, dacl, sacl, descriptor;\n uint result = GetSecurityInfo(handle, 6, 5, out owner, out group, out dacl, out sacl, out descriptor);\n if (result != 0) throw new Win32Exception((int)result, \"GetSecurityInfo failed for the runtime pipe.\");\n try {\n byte[] bytes = new byte[GetSecurityDescriptorLength(descriptor)];\n Marshal.Copy(descriptor, bytes, 0, bytes.Length);\n return bytes;\n } finally { LocalFree(descriptor); }\n }\n }\n}\n'@\n $sddl = $null\n if ($request.action -eq 'protect') {\n $sddl = 'D:P(D;;GA;;;NU)(A;;GA;;;' + $user.Value + ')(A;;GA;;;SY)(A;;GA;;;BA)'\n }\n $bytes = [TempadPipeSecurity]::Inspect($request.path, $sddl)\n $descriptor = New-Object System.Security.AccessControl.RawSecurityDescriptor($bytes, 0)\n } else {\n if ($request.action -eq 'ensure' -and ![IO.Directory]::Exists($request.path)) {\n $security = New-Object System.Security.AccessControl.DirectorySecurity\n $security.SetOwner($user)\n $security.SetAccessRuleProtection($true, $false)\n foreach ($sid in $allowed) {\n $principal = New-Object System.Security.Principal.SecurityIdentifier($sid)\n $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($principal, 'FullControl', 'ContainerInherit,ObjectInherit', 'None', 'Allow')\n $security.AddAccessRule($rule)\n }\n [void][IO.Directory]::CreateDirectory($request.path, $security)\n }\n try {\n $acl = Get-Acl -LiteralPath $request.path\n } catch [System.Management.Automation.ItemNotFoundException], [IO.FileNotFoundException], [IO.DirectoryNotFoundException] {\n $failureCode = 2\n throw\n }\n $descriptor = New-Object System.Security.AccessControl.RawSecurityDescriptor($acl.Sddl)\n }\n if ($allowed -notcontains $descriptor.Owner.Value -or $null -eq $descriptor.DiscretionaryAcl) {\n throw 'Unexpected owner or absent discretionary ACL.'\n }\n $ownAccess = $false\n $foreignAccess = $false\n $pendingProtection = $request.kind -eq 'pipe' -and $request.action -eq 'inspect'\n foreach ($ace in $descriptor.DiscretionaryAcl) {\n if ($ace.AceType -eq 'AccessAllowed') {\n if ($allowed -notcontains $ace.SecurityIdentifier.Value) {\n $foreignAccess = $true\n # Windows' initial pipe descriptor can be owned by Administrators and omit\n # the user's ACE. Only its default reader grants are retryable, never trusted.\n $defaultReader = @('S-1-1-0', 'S-1-5-7') -contains $ace.SecurityIdentifier.Value\n $readOnly = ($ace.AccessMask -band 0x7fedff76) -eq 0\n $pendingProtection = $pendingProtection -and $defaultReader -and $readOnly\n }\n if ($ace.SecurityIdentifier.Value -eq $user.Value) { $ownAccess = $true }\n } elseif ($ace.AceType -ne 'AccessDenied') {\n throw 'Unsupported ACL entry.'\n }\n }\n if ($foreignAccess -and $pendingProtection) { $failureCode = 'EPIPEUNPROTECTED' }\n if (!$ownAccess) { throw 'ACL does not explicitly grant the current user access.' }\n if ($foreignAccess) {\n throw 'ACL grants another account access.'\n }\n} catch {\n $failure = $_.Exception\n while ($failure.InnerException) { $failure = $failure.InnerException }\n if (!$failureCode) { $failureCode = $failure.NativeErrorCode }\n [Console]::Error.WriteLine((@{ message = $failure.Message; code = $failureCode } | ConvertTo-Json -Compress))\n exit 1\n}\n`\n"],"mappings":";;;;;;;;;;;;AAMA,MAAM,cAAc;AACpB,MAAM,qCAAqB,IAAI,IAA4C;;AAG3E,SAAgB,gBACd,WACA,MACA,WAA4B,QAAQ,UACpC,OAAO,SAAS,CAAC,CAAC,UAClB;CACA,IAAI,aAAa,SAAS,OAAO,KAAK,WAAW,IAAI;CACrD,MAAM,WAAW,WAAW,QAAQ,CAAC,CAClC,OAAO,IAAI,CAAC,CACZ,OAAO,IAAI,CAAC,CACZ,OAAO,UAAU,WAAW,KAAK,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CACrD,OAAO,IAAI,CAAC,CACZ,OAAO,IAAI,CAAC,CACZ,OAAO,KAAK,CAAC,CACb,MAAM,GAAG,EAAE;CACd,OAAO,GAAG,YAAY,iBAAiB;AACzC;AAEA,SAAgB,OAAO,MAAc;CACnC,OAAO,KAAK,WAAW,WAAW;AACpC;AAEA,SAAS,UAAU,MAAc;CAC/B,MAAM,SAAS,aAAa,IAAI;CAChC,OAAO,QAAQ,aAAa,UACxB,OAAO,YAAY,MAAM,QAAQ,IAAI,CAAC,CAAC,YAAY,IACnD,WAAW;AACjB;;AAGA,SAAS,YAAY,MAAc,MAA4B;CAC7D,IAAI,CAAC,WAAW,IAAI,GAAG,MAAM,IAAI,MAAM,gCAAgC;CACvE,MAAM,OAAO,UAAU,MAAM,EAAE,QAAQ,KAAK,CAAC;CAC7C,IACE,KAAK,eAAe,KACpB,EAAE,SAAS,SAAS,KAAK,OAAO,IAAI,KAAK,YAAY,MACrD,CAAC,UAAU,IAAI,KACd,QAAQ,aAAa,YAAY,KAAK,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AE,GAAG;GAAS;EAAO,IAAI,OAAO,QAAQ,WAAW;GACpF,IAAI,OAAO,OAAO,gBAAgB,OAAO,OAAO,OAAO;IAAE;IAAQ;GAAO,CAAC,GAAG,MAAM,IAAI,CAAC;QAClF,QAAQ;EACf,CACI,CAAC,CAAC,OAAO,IAAI;CACnB,CAAC;AACH;AAEA,SAAS,gBAAgB,OAAgB,MAAc,MAAc;CACnE,MAAM,QAAQ;CACd,MAAM,SAAS,CAAC,MAAM,QAAQ,MAAM,MAAM,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK;CAC5E,IAAI;CACJ,IAAI,kBAAkB;CACtB,IAAI;EACF,MAAM,SAAS,KAAK,MAAM,MAAM,UAAU,IAAI;EAC9C,OAAO,OAAO;EACd,kBAAkB,OAAO,OAAO,YAAY;CAC9C,QAAQ,CAER;CACA,MAAM,UAAU,IAAI,MAClB,sCAAsC,KAAK,IAAI,OAAO,SAAS,KAAK,OAAO,KAAK,MAChF,EACE,MACF,CACF;CACA,IAAI,SAAS,KAAK,SAAS,GAAG,QAAQ,OAAO;CAC7C,IAAI,SAAS,KAAK,QAAQ,OAAO;CACjC,IAAI,SAAS,oBAAoB,QAAQ,OAAO;CAChD,IAAI,CAAC,QAAQ,QAAQ,SAAS,UAAU,iBAAiB,QAAQ,OAAO;CACxE,OAAO;AACT;AAEA,MAAM,kBAAkB,OAAO,GAAG"}
1
+ {"version":3,"file":"runtime-platform-C-Yk9F3L.mjs","names":[],"sources":["../src/runtime-platform.ts"],"sourcesContent":["import { execFile, execFileSync } from 'node:child_process'\nimport { createHash, randomUUID } from 'node:crypto'\nimport { lstatSync, mkdirSync, realpathSync, rmSync } from 'node:fs'\nimport { tmpdir, userInfo } from 'node:os'\nimport { isAbsolute, join, resolve } from 'node:path'\n\nconst PIPE_PREFIX = '\\\\\\\\.\\\\pipe\\\\'\nconst checkedPermissions = new Map<string, ReturnType<typeof inspectPath>>()\n\n/** Runtime overrides must isolate pipes as well as files, including on one Windows account. */\nexport function runtimeEndpoint(\n directory: string,\n name: string,\n platform: NodeJS.Platform = process.platform,\n user = userInfo().username\n) {\n if (platform !== 'win32') return join(directory, name)\n const identity = createHash('sha256')\n .update(user)\n .update('\\0')\n .update(directory.replaceAll('/', '\\\\').toLowerCase())\n .update('\\0')\n .update(name)\n .digest('hex')\n .slice(0, 32)\n return `${PIPE_PREFIX}tempad-runtime-${identity}`\n}\n\nexport function isPipe(path: string) {\n return path.startsWith(PIPE_PREFIX)\n}\n\nfunction canonical(path: string) {\n const actual = realpathSync(path)\n return process.platform === 'win32'\n ? actual.toLowerCase() === resolve(path).toLowerCase()\n : actual === path\n}\n\n/** Check real Windows ACLs; chmod and stat.mode do not establish Windows privacy. */\nfunction inspectPath(path: string, kind: 'file' | 'directory') {\n if (!isAbsolute(path)) throw new Error('Runtime path must be absolute.')\n const stat = lstatSync(path, { bigint: true })\n if (\n stat.isSymbolicLink() ||\n !(kind === 'file' ? stat.isFile() : stat.isDirectory()) ||\n !canonical(path) ||\n (process.platform !== 'win32' && (stat.uid !== BigInt(process.getuid!()) || stat.mode & 0o077n))\n )\n throw new Error(`Refusing untrusted runtime ${kind}: ${path}`)\n return {\n identity: `${stat.dev}:${stat.ino}:${stat.birthtimeNs}:${kind}`,\n revision: stat.ctimeNs\n }\n}\n\nfunction rememberPermissions(path: string, state: ReturnType<typeof inspectPath>) {\n if (checkedPermissions.size >= 1024) checkedPermissions.clear()\n checkedPermissions.set(path, state)\n}\n\nfunction uncheckedPath(path: string, kind: 'file' | 'directory') {\n const state = inspectPath(path, kind)\n if (process.platform !== 'win32') return\n const cached = checkedPermissions.get(path)\n if (cached?.identity === state.identity && cached.revision === state.revision) return\n checkedPermissions.delete(path)\n return state\n}\n\nfunction checkedPath(\n path: string,\n kind: 'file' | 'directory',\n state: ReturnType<typeof inspectPath>\n) {\n const next = inspectPath(path, kind)\n if (next.identity !== state.identity)\n throw Object.assign(new Error(`Runtime ${kind} changed during its permission check: ${path}`), {\n code: 'ERUNTIMEPATHCHANGED'\n })\n if (next.revision === state.revision) {\n rememberPermissions(path, next)\n return\n }\n return next\n}\n\nexport function assertPrivatePath(path: string, kind: 'file' | 'directory') {\n let state = uncheckedPath(path, kind)\n if (!state) return\n for (let attempt = 0; attempt < 2; attempt++) {\n windowsSecurity('inspect', path, kind)\n // ChangeTime covers ACL edits and ordinary child creation. Recheck once when it\n // changes, rejecting replacement but leaving an actively changing object uncached.\n state = checkedPath(path, kind, state)\n if (!state) return\n }\n}\n\n/** Serving processes must let control leases renew while Windows checks permissions. */\nexport async function assertPrivatePathAsync(path: string, kind: 'file' | 'directory') {\n let state = uncheckedPath(path, kind)\n if (!state) return\n for (let attempt = 0; attempt < 2; attempt++) {\n await windowsSecurityAsync('inspect', path, kind)\n state = checkedPath(path, kind, state)\n if (!state) return\n }\n}\n\nexport function ensurePrivateDirectory(path: string) {\n if (!isAbsolute(path)) throw new Error('Runtime directory must be absolute.')\n if (process.platform !== 'win32') {\n mkdirSync(path, { recursive: true, mode: 0o700 })\n assertPrivatePath(path, 'directory')\n return\n }\n try {\n assertPrivatePath(path, 'directory')\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error\n windowsSecurity('ensure', path, 'directory')\n rememberPermissions(path, inspectPath(path, 'directory'))\n }\n}\n\nexport async function ensurePrivateDirectoryAsync(path: string) {\n if (process.platform !== 'win32') return ensurePrivateDirectory(path)\n try {\n await assertPrivatePathAsync(path, 'directory')\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error\n await windowsSecurityAsync('ensure', path, 'directory')\n rememberPermissions(path, inspectPath(path, 'directory'))\n }\n}\n\nexport function createPrivateTempDirectory(prefix: string) {\n // macOS's per-user temp path leaves too little room for Unix socket names.\n const directory = process.platform === 'win32' ? tmpdir() : '/tmp'\n const path = join(realpathSync(directory), `${prefix}${randomUUID()}`)\n ensurePrivateDirectory(path)\n return path\n}\n\nexport function cleanupEndpoint(path: string) {\n if (!isPipe(path)) rmSync(path, { force: true })\n}\n\nexport function assertPrivateEndpoint(path: string) {\n if (!isPipe(path)) throw new Error('Expected a Windows runtime pipe.')\n windowsSecurity('inspect', path, 'pipe')\n}\n\nexport function protectPipe(path: string) {\n if (!isPipe(path)) throw new Error('Expected a Windows runtime pipe.')\n windowsSecurity('protect', path, 'pipe')\n}\n\nexport async function assertPrivateEndpointAsync(path: string, signal?: AbortSignal) {\n if (!isPipe(path)) throw new Error('Expected a Windows runtime pipe.')\n await windowsSecurityAsync('inspect', path, 'pipe', signal)\n}\n\nexport async function protectPipeAsync(path: string, signal?: AbortSignal) {\n if (!isPipe(path)) throw new Error('Expected a Windows runtime pipe.')\n await windowsSecurityAsync('protect', path, 'pipe', signal)\n}\n\nexport function windowsPowerShellEnvironment(env: NodeJS.ProcessEnv = process.env) {\n // PowerShell 7's module paths can load incompatible modules in Windows PowerShell 5.\n return Object.fromEntries(\n Object.entries(env).filter(([key]) => key.toLowerCase() !== 'psmodulepath')\n )\n}\n\n// Built-in Windows PowerShell supplies the platform ACL API without an npm/native dependency.\n// JSON stays in a child-only environment value, never executable source or shell arguments.\n// Helper input is independent of host stdio and the Windows console's input code page.\nfunction securityCommand(action: 'ensure' | 'inspect' | 'protect', path: string, kind: string) {\n const systemRoot = process.env.SystemRoot\n if (!systemRoot || !isAbsolute(systemRoot))\n throw new Error('Windows SystemRoot is required to verify private runtime storage.')\n return {\n file: join(systemRoot, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe'),\n args: [\n '-NoLogo',\n '-NoProfile',\n '-NonInteractive',\n '-EncodedCommand',\n Buffer.from(SECURITY_SCRIPT, 'utf16le').toString('base64')\n ],\n options: {\n encoding: 'utf8' as const,\n timeout: 15_000,\n maxBuffer: 64 * 1024,\n windowsHide: true,\n env: {\n ...windowsPowerShellEnvironment(),\n TEMPAD_RUNTIME_ACL_REQUEST: JSON.stringify({ action, path, kind })\n }\n }\n }\n}\n\nfunction windowsSecurity(action: 'ensure' | 'inspect' | 'protect', path: string, kind: string) {\n const { file, args, options } = securityCommand(action, path, kind)\n try {\n execFileSync(file, args, { ...options, stdio: ['ignore', 'pipe', 'pipe'] })\n } catch (cause) {\n throw securityFailure(cause, path, kind)\n }\n}\n\nasync function windowsSecurityAsync(\n action: 'ensure' | 'inspect' | 'protect',\n path: string,\n kind: string,\n signal?: AbortSignal\n) {\n const { file, args, options } = securityCommand(action, path, kind)\n await new Promise<void>((resolve, reject) => {\n const child = execFile(file, args, { ...options, signal }, (error, stdout, stderr) => {\n if (error) reject(securityFailure(Object.assign(error, { stdout, stderr }), path, kind))\n else resolve()\n })\n child.stdin?.end()\n })\n}\n\nfunction securityFailure(cause: unknown, path: string, kind: string) {\n const error = cause as { stdout?: string; stderr?: string }\n const detail = [error.stdout, error.stderr].filter(Boolean).join('\\n').trim()\n let code: number | string | undefined\n let reportedFailure = false\n try {\n const report = JSON.parse(error.stderr ?? '{}')\n code = report.code\n reportedFailure = typeof report.message === 'string'\n } catch {\n // Startup and policy failures need not be JSON; they still fail closed.\n }\n const failure = new Error(\n `Refusing untrusted Windows runtime ${kind}: ${path}${detail ? ` (${detail})` : ''}`,\n {\n cause\n }\n ) as NodeJS.ErrnoException\n if (code === 2 || code === 3) failure.code = 'ENOENT'\n if (code === 231) failure.code = 'EBUSY'\n if (code === 'EPIPEUNPROTECTED') failure.code = code\n if (!failure.code && kind === 'pipe' && reportedFailure) failure.code = 'EPIPEUNTRUSTED'\n return failure\n}\n\nconst SECURITY_SCRIPT = String.raw`\n$ErrorActionPreference = 'Stop'\n$ProgressPreference = 'SilentlyContinue'\n[Console]::OutputEncoding = [Text.UTF8Encoding]::new($false)\n# Module autoload can stall with a filtered host environment. Use the trusted\n# built-in modules directly, without scanning host/user module locations.\nImport-Module \"$PSHOME\\Modules\\Microsoft.PowerShell.Utility\\Microsoft.PowerShell.Utility.psd1\" -ErrorAction Stop\nImport-Module \"$PSHOME\\Modules\\Microsoft.PowerShell.Security\\Microsoft.PowerShell.Security.psd1\" -ErrorAction Stop\n$PSModuleAutoloadingPreference = 'None'\n$failureCode = $null\ntry {\n $request = $env:TEMPAD_RUNTIME_ACL_REQUEST | ConvertFrom-Json\n $user = [System.Security.Principal.WindowsIdentity]::GetCurrent().User\n $allowed = @($user.Value, 'S-1-5-18', 'S-1-5-32-544')\n if ($request.kind -eq 'pipe') {\n Add-Type -TypeDefinition @'\nusing System;\nusing System.ComponentModel;\nusing System.Runtime.InteropServices;\nusing Microsoft.Win32.SafeHandles;\npublic static class TempadPipeSecurity {\n [DllImport(\"kernel32.dll\", CharSet=CharSet.Unicode, SetLastError=true)]\n static extern SafeFileHandle CreateFile(string name, uint access, uint share, IntPtr security, uint creation, uint flags, IntPtr template);\n [DllImport(\"advapi32.dll\", SetLastError=true)]\n static extern uint GetSecurityInfo(SafeFileHandle handle, uint type, uint info, out IntPtr owner, out IntPtr group, out IntPtr dacl, out IntPtr sacl, out IntPtr descriptor);\n [DllImport(\"advapi32.dll\", SetLastError=true)]\n static extern uint SetSecurityInfo(SafeFileHandle handle, uint type, uint info, IntPtr owner, IntPtr group, IntPtr dacl, IntPtr sacl);\n [DllImport(\"advapi32.dll\", CharSet=CharSet.Unicode, SetLastError=true)]\n static extern bool ConvertStringSecurityDescriptorToSecurityDescriptor(string value, uint revision, out IntPtr descriptor, out uint length);\n [DllImport(\"advapi32.dll\", SetLastError=true)]\n static extern bool GetSecurityDescriptorDacl(IntPtr descriptor, out bool present, out IntPtr dacl, out bool defaulted);\n [DllImport(\"advapi32.dll\")]\n static extern uint GetSecurityDescriptorLength(IntPtr descriptor);\n [DllImport(\"kernel32.dll\")]\n static extern IntPtr LocalFree(IntPtr memory);\n public static byte[] Inspect(string path, string sddl) {\n // PowerShell converts a null string argument to an empty string.\n bool protect = !String.IsNullOrEmpty(sddl);\n SafeFileHandle opened = CreateFile(path, 0x20000u | (protect ? 0x40000u : 0u), 7, IntPtr.Zero, 3, 0x40000000, IntPtr.Zero);\n int openError = Marshal.GetLastWin32Error();\n using (SafeFileHandle handle = opened) {\n if (handle.IsInvalid) throw new Win32Exception(openError, \"CreateFile failed for the runtime pipe.\");\n if (protect) {\n IntPtr replacement; uint length;\n if (!ConvertStringSecurityDescriptorToSecurityDescriptor(sddl, 1, out replacement, out length)) throw new Win32Exception(Marshal.GetLastWin32Error(), \"ConvertStringSecurityDescriptorToSecurityDescriptor failed.\");\n try {\n bool present, defaulted; IntPtr acl;\n if (!GetSecurityDescriptorDacl(replacement, out present, out acl, out defaulted)) throw new Win32Exception(Marshal.GetLastWin32Error(), \"GetSecurityDescriptorDacl failed.\");\n if (!present || acl == IntPtr.Zero) throw new InvalidOperationException(\"The replacement pipe descriptor has no discretionary ACL.\");\n uint changed = SetSecurityInfo(handle, 6, 4u | 0x80000000u, IntPtr.Zero, IntPtr.Zero, acl, IntPtr.Zero);\n if (changed != 0) throw new Win32Exception((int)changed, \"SetSecurityInfo failed for the runtime pipe.\");\n } finally { LocalFree(replacement); }\n }\n IntPtr owner, group, dacl, sacl, descriptor;\n uint result = GetSecurityInfo(handle, 6, 5, out owner, out group, out dacl, out sacl, out descriptor);\n if (result != 0) throw new Win32Exception((int)result, \"GetSecurityInfo failed for the runtime pipe.\");\n try {\n byte[] bytes = new byte[GetSecurityDescriptorLength(descriptor)];\n Marshal.Copy(descriptor, bytes, 0, bytes.Length);\n return bytes;\n } finally { LocalFree(descriptor); }\n }\n }\n}\n'@\n $sddl = $null\n if ($request.action -eq 'protect') {\n $sddl = 'D:P(D;;GA;;;NU)(A;;GA;;;' + $user.Value + ')(A;;GA;;;SY)(A;;GA;;;BA)'\n }\n $bytes = [TempadPipeSecurity]::Inspect($request.path, $sddl)\n $descriptor = New-Object System.Security.AccessControl.RawSecurityDescriptor($bytes, 0)\n } else {\n if ($request.action -eq 'ensure' -and ![IO.Directory]::Exists($request.path)) {\n $security = New-Object System.Security.AccessControl.DirectorySecurity\n $security.SetOwner($user)\n $security.SetAccessRuleProtection($true, $false)\n foreach ($sid in $allowed) {\n $principal = New-Object System.Security.Principal.SecurityIdentifier($sid)\n $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($principal, 'FullControl', 'ContainerInherit,ObjectInherit', 'None', 'Allow')\n $security.AddAccessRule($rule)\n }\n [void][IO.Directory]::CreateDirectory($request.path, $security)\n }\n try {\n $acl = Get-Acl -LiteralPath $request.path\n } catch [System.Management.Automation.ItemNotFoundException], [IO.FileNotFoundException], [IO.DirectoryNotFoundException] {\n $failureCode = 2\n throw\n }\n $descriptor = New-Object System.Security.AccessControl.RawSecurityDescriptor($acl.Sddl)\n }\n if ($allowed -notcontains $descriptor.Owner.Value -or $null -eq $descriptor.DiscretionaryAcl) {\n throw 'Unexpected owner or absent discretionary ACL.'\n }\n $ownAccess = $false\n $foreignAccess = $false\n $pendingProtection = $request.kind -eq 'pipe' -and $request.action -eq 'inspect'\n foreach ($ace in $descriptor.DiscretionaryAcl) {\n if ($ace.AceType -eq 'AccessAllowed') {\n if ($allowed -notcontains $ace.SecurityIdentifier.Value) {\n $foreignAccess = $true\n # Windows' initial pipe descriptor can be owned by Administrators and omit\n # the user's ACE. Only its default reader grants are retryable, never trusted.\n $defaultReader = @('S-1-1-0', 'S-1-5-7') -contains $ace.SecurityIdentifier.Value\n $readOnly = ($ace.AccessMask -band 0x7fedff76) -eq 0\n $pendingProtection = $pendingProtection -and $defaultReader -and $readOnly\n }\n if ($ace.SecurityIdentifier.Value -eq $user.Value) { $ownAccess = $true }\n } elseif ($ace.AceType -ne 'AccessDenied') {\n throw 'Unsupported ACL entry.'\n }\n }\n if ($foreignAccess -and $pendingProtection) { $failureCode = 'EPIPEUNPROTECTED' }\n if (!$ownAccess) { throw 'ACL does not explicitly grant the current user access.' }\n if ($foreignAccess) {\n throw 'ACL grants another account access.'\n }\n} catch {\n $failure = $_.Exception\n while ($failure.InnerException) { $failure = $failure.InnerException }\n if (!$failureCode) { $failureCode = $failure.NativeErrorCode }\n [Console]::Error.WriteLine((@{ message = $failure.Message; code = $failureCode }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AEA,SAAS,gBAAgB,OAAgB,MAAc,MAAc;CACnE,MAAM,QAAQ;CACd,MAAM,SAAS,CAAC,MAAM,QAAQ,MAAM,MAAM,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK;CAC5E,IAAI;CACJ,IAAI,kBAAkB;CACtB,IAAI;EACF,MAAM,SAAS,KAAK,MAAM,MAAM,UAAU,IAAI;EAC9C,OAAO,OAAO;EACd,kBAAkB,OAAO,OAAO,YAAY;CAC9C,QAAQ,CAER;CACA,MAAM,UAAU,IAAI,MAClB,sCAAsC,KAAK,IAAI,OAAO,SAAS,KAAK,OAAO,KAAK,MAChF,EACE,MACF,CACF;CACA,IAAI,SAAS,KAAK,SAAS,GAAG,QAAQ,OAAO;CAC7C,IAAI,SAAS,KAAK,QAAQ,OAAO;CACjC,IAAI,SAAS,oBAAoB,QAAQ,OAAO;CAChD,IAAI,CAAC,QAAQ,QAAQ,SAAS,UAAU,iBAAiB,QAAQ,OAAO;CACxE,OAAO;AACT;AAEA,MAAM,kBAAkB,OAAO,GAAG"}
@@ -4,4 +4,4 @@ globalThis.__bundlerPathsOverrides = {
4
4
  'pino-worker': runtimeFilePath(new URL('./pino-worker.mjs', import.meta.url)),
5
5
  'pino/file': runtimeFilePath(new URL('./pino-file.mjs', import.meta.url))
6
6
  };
7
- export { r as runRuntimeRecovery } from "./runtime-recovery-DpqftTl9.mjs";
7
+ export { r as runRuntimeRecovery } from "./runtime-recovery-DaRaQ8qY.mjs";
@@ -4,12 +4,12 @@ globalThis.__bundlerPathsOverrides = {
4
4
  'pino-worker': runtimeFilePath(new URL('./pino-worker.mjs', import.meta.url)),
5
5
  'pino/file': runtimeFilePath(new URL('./pino-file.mjs', import.meta.url))
6
6
  };
7
- import { S as uuid, d as literal, m as object, o as array, p as number, v as string } from "./schemas-BgOH6OcJ.mjs";
8
- import { tn as ResultSchema } from "./types-gJ5HkL66.mjs";
9
- import { f as SocketTransport, n as ControlPeer } from "./protocol-DNswG6F2.mjs";
7
+ import { S as uuid, d as literal, m as object, o as array, p as number, v as string } from "./schemas-ZDdPV7RQ.mjs";
8
+ import { tn as ResultSchema } from "./types-kNTSQOnR.mjs";
9
+ import { f as SocketTransport, n as ControlPeer } from "./protocol-7m-E_iFu.mjs";
10
10
  import { randomUUID } from "node:crypto";
11
11
  import { createInterface } from "node:readline/promises";
12
- //#region src/runtime-recovery.ts
12
+ // src/runtime-recovery.ts
13
13
  const BlockSchema = object({
14
14
  id: string(),
15
15
  revision: uuid(),
@@ -120,7 +120,6 @@ async function runRuntimeRecovery(args, connect, io = {
120
120
  await peer.close();
121
121
  }
122
122
  }
123
- //#endregion
124
123
  export { attachRuntimeRecovery as n, runRuntimeRecovery as r, RECOVERY_METHODS as t };
125
124
 
126
- //# sourceMappingURL=runtime-recovery-DpqftTl9.mjs.map
125
+ //# sourceMappingURL=runtime-recovery-DaRaQ8qY.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-recovery-DpqftTl9.mjs","names":["z.object","z.string","z.uuid","z.number","z.array","z.literal"],"sources":["../src/runtime-recovery.ts"],"sourcesContent":["import type { Socket } from 'node:net'\n\nimport { ResultSchema } from '@modelcontextprotocol/sdk/types.js'\nimport { randomUUID } from 'node:crypto'\nimport { createInterface } from 'node:readline/promises'\nimport { z } from 'zod'\n\nimport type { TerminalReceipts } from './terminal-receipts'\n\nimport { ControlPeer, SocketTransport } from './runtime-prototype/protocol'\n\nconst BlockSchema = z.object({\n id: z.string(),\n revision: z.uuid(),\n fileKey: z.string(),\n browserId: z.string(),\n tabId: z.number().optional(),\n documentId: z.string().optional(),\n recordedAt: z.number()\n})\nconst StatusSchema = ResultSchema.extend({ blocks: z.array(BlockSchema) })\nconst PreparedSchema = ResultSchema.extend({ block: BlockSchema, challenge: z.uuid() })\nexport const RECOVERY_METHODS = ['tempad/runtime-status', 'tempad/runtime-prepare-resolution']\n\n/** Private same-user socket only; never registered in the MCP tool catalog. */\nexport async function attachRuntimeRecovery(\n socket: Socket,\n receipts: TerminalReceipts,\n resolved: (record: NonNullable<ReturnType<TerminalReceipts['abandon']>>) => void\n) {\n const peer = new ControlPeer()\n let confirmation: { id: string; revision: string; challenge: string; expires: number } | undefined\n const timeout = setTimeout(() => void peer.close(), 120_000)\n timeout.unref()\n peer.onclose = () => {\n clearTimeout(timeout)\n confirmation = undefined\n }\n peer.onerror = () => void peer.close()\n peer.setRequestHandler(z.object({ method: z.literal('tempad/runtime-status') }), () => ({\n blocks: receipts.status()\n }))\n peer.setRequestHandler(\n z.object({\n method: z.literal('tempad/runtime-prepare-resolution'),\n params: z.object({ id: z.string() }).strict()\n }),\n ({ params }) => {\n const block = receipts.status().find((record) => record.id === params.id)\n if (!block)\n throw new Error('No unresolved execution with this ID. Inspect --runtime-status again.')\n confirmation = {\n id: block.id,\n revision: block.revision,\n challenge: randomUUID(),\n expires: performance.now() + 120_000\n }\n return { block, challenge: confirmation.challenge }\n }\n )\n peer.setRequestHandler(\n z.object({\n method: z.literal('tempad/runtime-resolve-block'),\n params: z.object({ challenge: z.uuid(), stopped: z.literal(true) }).strict()\n }),\n ({ params }) => {\n const selected = confirmation\n confirmation = undefined\n if (\n !selected ||\n selected.challenge !== params.challenge ||\n performance.now() >= selected.expires\n )\n throw new Error('Recovery confirmation expired or was already used.')\n const record = receipts.abandon(selected.id, selected.revision)\n if (record) resolved(record)\n return { resolved: selected.id, readRequired: true }\n }\n )\n await peer.connect(new SocketTransport(socket))\n return peer\n}\n\nexport async function runRuntimeRecovery(\n args: string[],\n connect: () => Promise<Socket>,\n io = {\n interactive: !!process.stdin.isTTY && !!process.stdout.isTTY,\n write: (value: string) => process.stdout.write(value),\n confirm: async (prompt: string) => {\n const terminal = createInterface({ input: process.stdin, output: process.stdout })\n try {\n return await terminal.question(prompt)\n } finally {\n terminal.close()\n }\n }\n }\n): Promise<void> {\n const status = args.length === 1 && args[0] === '--runtime-status'\n const id = args.length === 2 && args[0] === '--resolve-runtime-block' ? args[1] : undefined\n if (!status && !id) throw new Error('Use --runtime-status or --resolve-runtime-block <block-id>.')\n if (id && !io.interactive)\n throw new Error(\n 'Runtime recovery requires an interactive terminal and confirmation that the original execution environment has stopped.'\n )\n const peer = new ControlPeer()\n peer.onerror = () => void peer.close()\n try {\n await peer.connect(new SocketTransport(await connect()))\n if (status) {\n const result = await peer.request({ method: 'tempad/runtime-status' }, StatusSchema)\n io.write(JSON.stringify(result, null, 2) + '\\n')\n return\n }\n const prepared = await peer.request(\n { method: 'tempad/runtime-prepare-resolution', params: { id } },\n PreparedSchema\n )\n io.write(JSON.stringify(prepared.block, null, 2) + '\\n')\n const answer = await io.confirm(\n 'This cannot stop remote code. Close the original Figma page/browser first. Type the exact block ID to attest that its execution environment has stopped: '\n )\n if (answer !== id) throw new Error('Recovery cancelled; execution remains blocked.')\n await peer.request(\n {\n method: 'tempad/runtime-resolve-block',\n params: { challenge: prepared.challenge, stopped: true }\n },\n ResultSchema\n )\n io.write(\n 'Execution retired. Stop fences remain; explicitly resume an eligible task and reread the original target before writing.\\n'\n )\n } finally {\n await peer.close()\n }\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAM,cAAcA,OAAS;CAC3B,IAAIC,OAAS;CACb,UAAUC,KAAO;CACjB,SAASD,OAAS;CAClB,WAAWA,OAAS;CACpB,OAAOE,OAAS,CAAC,CAAC,SAAS;CAC3B,YAAYF,OAAS,CAAC,CAAC,SAAS;CAChC,YAAYE,OAAS;AACvB,CAAC;AACD,MAAM,eAAe,aAAa,OAAO,EAAE,QAAQC,MAAQ,WAAW,EAAE,CAAC;AACzE,MAAM,iBAAiB,aAAa,OAAO;CAAE,OAAO;CAAa,WAAWF,KAAO;AAAE,CAAC;AACtF,MAAa,mBAAmB,CAAC,yBAAyB,mCAAmC;;AAG7F,eAAsB,sBACpB,QACA,UACA,UACA;CACA,MAAM,OAAO,IAAI,YAAY;CAC7B,IAAI;CACJ,MAAM,UAAU,iBAAiB,KAAK,KAAK,MAAM,GAAG,IAAO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M,KAAK,MAAM;CACnB;AACF"}
1
+ {"version":3,"file":"runtime-recovery-DaRaQ8qY.mjs","names":["z.object","z.string","z.uuid","z.number","z.array","z.literal"],"sources":["../src/runtime-recovery.ts"],"sourcesContent":["import type { Socket } from 'node:net'\n\nimport { ResultSchema } from '@modelcontextprotocol/sdk/types.js'\nimport { randomUUID } from 'node:crypto'\nimport { createInterface } from 'node:readline/promises'\nimport { z } from 'zod'\n\nimport type { TerminalReceipts } from './terminal-receipts'\n\nimport { ControlPeer, SocketTransport } from './runtime-prototype/protocol'\n\nconst BlockSchema = z.object({\n id: z.string(),\n revision: z.uuid(),\n fileKey: z.string(),\n browserId: z.string(),\n tabId: z.number().optional(),\n documentId: z.string().optional(),\n recordedAt: z.number()\n})\nconst StatusSchema = ResultSchema.extend({ blocks: z.array(BlockSchema) })\nconst PreparedSchema = ResultSchema.extend({ block: BlockSchema, challenge: z.uuid() })\nexport const RECOVERY_METHODS = ['tempad/runtime-status', 'tempad/runtime-prepare-resolution']\n\n/** Private same-user socket only; never registered in the MCP tool catalog. */\nexport async function attachRuntimeRecovery(\n socket: Socket,\n receipts: TerminalReceipts,\n resolved: (record: NonNullable<ReturnType<TerminalReceipts['abandon']>>) => void\n) {\n const peer = new ControlPeer()\n let confirmation: { id: string; revision: string; challenge: string; expires: number } | undefined\n const timeout = setTimeout(() => void peer.close(), 120_000)\n timeout.unref()\n peer.onclose = () => {\n clearTimeout(timeout)\n confirmation = undefined\n }\n peer.onerror = () => void peer.close()\n peer.setRequestHandler(z.object({ method: z.literal('tempad/runtime-status') }), () => ({\n blocks: receipts.status()\n }))\n peer.setRequestHandler(\n z.object({\n method: z.literal('tempad/runtime-prepare-resolution'),\n params: z.object({ id: z.string() }).strict()\n }),\n ({ params }) => {\n const block = receipts.status().find((record) => record.id === params.id)\n if (!block)\n throw new Error('No unresolved execution with this ID. Inspect --runtime-status again.')\n confirmation = {\n id: block.id,\n revision: block.revision,\n challenge: randomUUID(),\n expires: performance.now() + 120_000\n }\n return { block, challenge: confirmation.challenge }\n }\n )\n peer.setRequestHandler(\n z.object({\n method: z.literal('tempad/runtime-resolve-block'),\n params: z.object({ challenge: z.uuid(), stopped: z.literal(true) }).strict()\n }),\n ({ params }) => {\n const selected = confirmation\n confirmation = undefined\n if (\n !selected ||\n selected.challenge !== params.challenge ||\n performance.now() >= selected.expires\n )\n throw new Error('Recovery confirmation expired or was already used.')\n const record = receipts.abandon(selected.id, selected.revision)\n if (record) resolved(record)\n return { resolved: selected.id, readRequired: true }\n }\n )\n await peer.connect(new SocketTransport(socket))\n return peer\n}\n\nexport async function runRuntimeRecovery(\n args: string[],\n connect: () => Promise<Socket>,\n io = {\n interactive: !!process.stdin.isTTY && !!process.stdout.isTTY,\n write: (value: string) => process.stdout.write(value),\n confirm: async (prompt: string) => {\n const terminal = createInterface({ input: process.stdin, output: process.stdout })\n try {\n return await terminal.question(prompt)\n } finally {\n terminal.close()\n }\n }\n }\n): Promise<void> {\n const status = args.length === 1 && args[0] === '--runtime-status'\n const id = args.length === 2 && args[0] === '--resolve-runtime-block' ? args[1] : undefined\n if (!status && !id) throw new Error('Use --runtime-status or --resolve-runtime-block <block-id>.')\n if (id && !io.interactive)\n throw new Error(\n 'Runtime recovery requires an interactive terminal and confirmation that the original execution environment has stopped.'\n )\n const peer = new ControlPeer()\n peer.onerror = () => void peer.close()\n try {\n await peer.connect(new SocketTransport(await connect()))\n if (status) {\n const result = await peer.request({ method: 'tempad/runtime-status' }, StatusSchema)\n io.write(JSON.stringify(result, null, 2) + '\\n')\n return\n }\n const prepared = await peer.request(\n { method: 'tempad/runtime-prepare-resolution', params: { id } },\n PreparedSchema\n )\n io.write(JSON.stringify(prepared.block, null, 2) + '\\n')\n const answer = await io.confirm(\n 'This cannot stop remote code. Close the original Figma page/browser first. Type the exact block ID to attest that its execution environment has stopped: '\n )\n if (answer !== id) throw new Error('Recovery cancelled; execution remains blocked.')\n await peer.request(\n {\n method: 'tempad/runtime-resolve-block',\n params: { challenge: prepared.challenge, stopped: true }\n },\n ResultSchema\n )\n io.write(\n 'Execution retired. Stop fences remain; explicitly resume an eligible task and reread the original target before writing.\\n'\n )\n } finally {\n await peer.close()\n }\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAM,cAAcA,OAAS;CAC3B,IAAIC,OAAS;CACb,UAAUC,KAAO;CACjB,SAASD,OAAS;CAClB,WAAWA,OAAS;CACpB,OAAOE,OAAS,CAAC,CAAC,SAAS;CAC3B,YAAYF,OAAS,CAAC,CAAC,SAAS;CAChC,YAAYE,OAAS;AACvB,CAAC;AACD,MAAM,eAAe,aAAa,OAAO,EAAE,QAAQC,MAAQ,WAAW,EAAE,CAAC;AACzE,MAAM,iBAAiB,aAAa,OAAO;CAAE,OAAO;CAAa,WAAWF,KAAO;AAAE,CAAC;AACtF,MAAa,mBAAmB,CAAC,yBAAyB,mCAAmC;;AAG7F,eAAsB,sBACpB,QACA,UACA,UACA;CACA,MAAM,OAAO,IAAI,YAAY;CAC7B,IAAI;CACJ,MAAM,UAAU,iBAAiB,KAAK,KAAK,MAAM,GAAG,IAAO;CAC3D,QAAQ,MAAM;CACd,KAAK,gBAAgB;EACnB,aAAa,OAAO;EACpB,eAAe,KAAA;CACjB;CACA,KAAK,gBAAgB,KAAK,KAAK,MAAM;CACrC,KAAK,kBAAkBF,OAAS,EAAE,QAAQK,QAAU,uBAAuB,EAAE,CAAC,UAAU,EACtF,QAAQ,SAAS,OAAO,EAC1B,EAAE;CACF,KAAK,kBACHL,OAAS;EACP,QAAQK,QAAU,mCAAmC;EACrD,QAAQL,OAAS,EAAE,IAAIC,OAAS,EAAE,CAAC,CAAC,CAAC,OAAO;CAC9C,CAAC,IACA,EAAE,aAAa;EACd,MAAM,QAAQ,SAAS,OAAO,CAAC,CAAC,MAAM,WAAW,OAAO,OAAO,OAAO,EAAE;EACxE,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,uEAAuE;EACzF,eAAe;GACb,IAAI,MAAM;GACV,UAAU,MAAM;GAChB,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