@microvac/adapter-codex-local 0.0.0-stage → 0.1.0-rc.14

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 (300) hide show
  1. package/dist/cli/format-event.d.ts +2 -0
  2. package/dist/cli/format-event.d.ts.map +1 -0
  3. package/dist/cli/format-event.js +218 -0
  4. package/dist/cli/format-event.js.map +1 -0
  5. package/dist/cli/index.d.ts +2 -0
  6. package/dist/cli/index.d.ts.map +1 -0
  7. package/dist/cli/index.js +2 -0
  8. package/dist/cli/index.js.map +1 -0
  9. package/dist/cli/quota-probe.d.ts +3 -0
  10. package/dist/cli/quota-probe.d.ts.map +1 -0
  11. package/dist/cli/quota-probe.js +104 -0
  12. package/dist/cli/quota-probe.js.map +1 -0
  13. package/dist/index.d.ts +41 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +268 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/index.test.d.ts +2 -0
  18. package/dist/index.test.d.ts.map +1 -0
  19. package/dist/index.test.js +125 -0
  20. package/dist/index.test.js.map +1 -0
  21. package/dist/server/acp.cli-version.test.d.ts +2 -0
  22. package/dist/server/acp.cli-version.test.d.ts.map +1 -0
  23. package/dist/server/acp.cli-version.test.js +151 -0
  24. package/dist/server/acp.cli-version.test.js.map +1 -0
  25. package/dist/server/acp.d.ts +31 -0
  26. package/dist/server/acp.d.ts.map +1 -0
  27. package/dist/server/acp.js +608 -0
  28. package/dist/server/acp.js.map +1 -0
  29. package/dist/server/acp.quota.test.d.ts +2 -0
  30. package/dist/server/acp.quota.test.d.ts.map +1 -0
  31. package/dist/server/acp.quota.test.js +176 -0
  32. package/dist/server/acp.quota.test.js.map +1 -0
  33. package/dist/server/acp.test.d.ts +2 -0
  34. package/dist/server/acp.test.d.ts.map +1 -0
  35. package/dist/server/acp.test.js +1263 -0
  36. package/dist/server/acp.test.js.map +1 -0
  37. package/dist/server/adapter-auth-promotion.d.ts +102 -0
  38. package/dist/server/adapter-auth-promotion.d.ts.map +1 -0
  39. package/dist/server/adapter-auth-promotion.js +210 -0
  40. package/dist/server/adapter-auth-promotion.js.map +1 -0
  41. package/dist/server/adapter-auth-promotion.test.d.ts +2 -0
  42. package/dist/server/adapter-auth-promotion.test.d.ts.map +1 -0
  43. package/dist/server/adapter-auth-promotion.test.js +615 -0
  44. package/dist/server/adapter-auth-promotion.test.js.map +1 -0
  45. package/dist/server/auth-check.d.ts +8 -0
  46. package/dist/server/auth-check.d.ts.map +1 -0
  47. package/dist/server/auth-check.js +8 -0
  48. package/dist/server/auth-check.js.map +1 -0
  49. package/dist/server/auth-precedence.d.ts +16 -0
  50. package/dist/server/auth-precedence.d.ts.map +1 -0
  51. package/dist/server/auth-precedence.js +20 -0
  52. package/dist/server/auth-precedence.js.map +1 -0
  53. package/dist/server/auth-precedence.test.d.ts +2 -0
  54. package/dist/server/auth-precedence.test.d.ts.map +1 -0
  55. package/dist/server/auth-precedence.test.js +100 -0
  56. package/dist/server/auth-precedence.test.js.map +1 -0
  57. package/dist/server/cli-version.d.ts +45 -0
  58. package/dist/server/cli-version.d.ts.map +1 -0
  59. package/dist/server/cli-version.js +95 -0
  60. package/dist/server/cli-version.js.map +1 -0
  61. package/dist/server/codex-args.d.ts +13 -0
  62. package/dist/server/codex-args.d.ts.map +1 -0
  63. package/dist/server/codex-args.js +64 -0
  64. package/dist/server/codex-args.js.map +1 -0
  65. package/dist/server/codex-args.test.d.ts +2 -0
  66. package/dist/server/codex-args.test.d.ts.map +1 -0
  67. package/dist/server/codex-args.test.js +257 -0
  68. package/dist/server/codex-args.test.js.map +1 -0
  69. package/dist/server/codex-auth-cache.d.ts +179 -0
  70. package/dist/server/codex-auth-cache.d.ts.map +1 -0
  71. package/dist/server/codex-auth-cache.js +520 -0
  72. package/dist/server/codex-auth-cache.js.map +1 -0
  73. package/dist/server/codex-auth-cache.test.d.ts +2 -0
  74. package/dist/server/codex-auth-cache.test.d.ts.map +1 -0
  75. package/dist/server/codex-auth-cache.test.js +530 -0
  76. package/dist/server/codex-auth-cache.test.js.map +1 -0
  77. package/dist/server/codex-auth-copyback.d.ts +53 -0
  78. package/dist/server/codex-auth-copyback.d.ts.map +1 -0
  79. package/dist/server/codex-auth-copyback.js +123 -0
  80. package/dist/server/codex-auth-copyback.js.map +1 -0
  81. package/dist/server/codex-auth-copyback.test.d.ts +2 -0
  82. package/dist/server/codex-auth-copyback.test.d.ts.map +1 -0
  83. package/dist/server/codex-auth-copyback.test.js +507 -0
  84. package/dist/server/codex-auth-copyback.test.js.map +1 -0
  85. package/dist/server/codex-auth-merge-decision.cjs +170 -0
  86. package/dist/server/codex-auth-merge-decision.d.ts +22 -0
  87. package/dist/server/codex-auth-merge-decision.d.ts.map +1 -0
  88. package/dist/server/codex-auth-merge-decision.js +58 -0
  89. package/dist/server/codex-auth-merge-decision.js.map +1 -0
  90. package/dist/server/codex-auth-merge-decision.test.d.ts +2 -0
  91. package/dist/server/codex-auth-merge-decision.test.d.ts.map +1 -0
  92. package/dist/server/codex-auth-merge-decision.test.js +215 -0
  93. package/dist/server/codex-auth-merge-decision.test.js.map +1 -0
  94. package/dist/server/codex-auth-merge-extract.sh +73 -0
  95. package/dist/server/codex-auth-merge-scripts.d.ts +21 -0
  96. package/dist/server/codex-auth-merge-scripts.d.ts.map +1 -0
  97. package/dist/server/codex-auth-merge-scripts.js +40 -0
  98. package/dist/server/codex-auth-merge-scripts.js.map +1 -0
  99. package/dist/server/codex-auth-merge.test.d.ts +2 -0
  100. package/dist/server/codex-auth-merge.test.d.ts.map +1 -0
  101. package/dist/server/codex-auth-merge.test.js +714 -0
  102. package/dist/server/codex-auth-merge.test.js.map +1 -0
  103. package/dist/server/codex-auth-seed-write.d.ts +30 -0
  104. package/dist/server/codex-auth-seed-write.d.ts.map +1 -0
  105. package/dist/server/codex-auth-seed-write.js +41 -0
  106. package/dist/server/codex-auth-seed-write.js.map +1 -0
  107. package/dist/server/codex-home.d.ts +169 -0
  108. package/dist/server/codex-home.d.ts.map +1 -0
  109. package/dist/server/codex-home.js +822 -0
  110. package/dist/server/codex-home.js.map +1 -0
  111. package/dist/server/codex-home.test.d.ts +2 -0
  112. package/dist/server/codex-home.test.d.ts.map +1 -0
  113. package/dist/server/codex-home.test.js +1287 -0
  114. package/dist/server/codex-home.test.js.map +1 -0
  115. package/dist/server/config-schema.d.ts +3 -0
  116. package/dist/server/config-schema.d.ts.map +1 -0
  117. package/dist/server/config-schema.js +67 -0
  118. package/dist/server/config-schema.js.map +1 -0
  119. package/dist/server/device-login-export.d.ts +56 -0
  120. package/dist/server/device-login-export.d.ts.map +1 -0
  121. package/dist/server/device-login-export.js +230 -0
  122. package/dist/server/device-login-export.js.map +1 -0
  123. package/dist/server/device-login-export.test.d.ts +2 -0
  124. package/dist/server/device-login-export.test.d.ts.map +1 -0
  125. package/dist/server/device-login-export.test.js +245 -0
  126. package/dist/server/device-login-export.test.js.map +1 -0
  127. package/dist/server/device-login-parse.d.ts +20 -0
  128. package/dist/server/device-login-parse.d.ts.map +1 -0
  129. package/dist/server/device-login-parse.js +155 -0
  130. package/dist/server/device-login-parse.js.map +1 -0
  131. package/dist/server/device-login-parse.test.d.ts +2 -0
  132. package/dist/server/device-login-parse.test.d.ts.map +1 -0
  133. package/dist/server/device-login-parse.test.js +269 -0
  134. package/dist/server/device-login-parse.test.js.map +1 -0
  135. package/dist/server/device-login-runner.d.ts +69 -0
  136. package/dist/server/device-login-runner.d.ts.map +1 -0
  137. package/dist/server/device-login-runner.js +110 -0
  138. package/dist/server/device-login-runner.js.map +1 -0
  139. package/dist/server/device-login-runner.test.d.ts +2 -0
  140. package/dist/server/device-login-runner.test.d.ts.map +1 -0
  141. package/dist/server/device-login-runner.test.js +201 -0
  142. package/dist/server/device-login-runner.test.js.map +1 -0
  143. package/dist/server/engine-availability.test.d.ts +2 -0
  144. package/dist/server/engine-availability.test.d.ts.map +1 -0
  145. package/dist/server/engine-availability.test.js +41 -0
  146. package/dist/server/engine-availability.test.js.map +1 -0
  147. package/dist/server/execute.acp-fallback.test.d.ts +2 -0
  148. package/dist/server/execute.acp-fallback.test.d.ts.map +1 -0
  149. package/dist/server/execute.acp-fallback.test.js +123 -0
  150. package/dist/server/execute.acp-fallback.test.js.map +1 -0
  151. package/dist/server/execute.auth-precedence.test.d.ts +2 -0
  152. package/dist/server/execute.auth-precedence.test.d.ts.map +1 -0
  153. package/dist/server/execute.auth-precedence.test.js +137 -0
  154. package/dist/server/execute.auth-precedence.test.js.map +1 -0
  155. package/dist/server/execute.auth.test.d.ts +2 -0
  156. package/dist/server/execute.auth.test.d.ts.map +1 -0
  157. package/dist/server/execute.auth.test.js +197 -0
  158. package/dist/server/execute.auth.test.js.map +1 -0
  159. package/dist/server/execute.d.ts +40 -0
  160. package/dist/server/execute.d.ts.map +1 -0
  161. package/dist/server/execute.js +1485 -0
  162. package/dist/server/execute.js.map +1 -0
  163. package/dist/server/execute.remote.test.d.ts +2 -0
  164. package/dist/server/execute.remote.test.d.ts.map +1 -0
  165. package/dist/server/execute.remote.test.js +851 -0
  166. package/dist/server/execute.remote.test.js.map +1 -0
  167. package/dist/server/execute.ssh-host-auth.test.d.ts +2 -0
  168. package/dist/server/execute.ssh-host-auth.test.d.ts.map +1 -0
  169. package/dist/server/execute.ssh-host-auth.test.js +214 -0
  170. package/dist/server/execute.ssh-host-auth.test.js.map +1 -0
  171. package/dist/server/execute.stderr-error.test.d.ts +2 -0
  172. package/dist/server/execute.stderr-error.test.d.ts.map +1 -0
  173. package/dist/server/execute.stderr-error.test.js +142 -0
  174. package/dist/server/execute.stderr-error.test.js.map +1 -0
  175. package/dist/server/execute.test.d.ts +2 -0
  176. package/dist/server/execute.test.d.ts.map +1 -0
  177. package/dist/server/execute.test.js +300 -0
  178. package/dist/server/execute.test.js.map +1 -0
  179. package/dist/server/index.d.ts +18 -0
  180. package/dist/server/index.d.ts.map +1 -0
  181. package/dist/server/index.js +84 -0
  182. package/dist/server/index.js.map +1 -0
  183. package/dist/server/output-inactivity-monitor.d.ts +62 -0
  184. package/dist/server/output-inactivity-monitor.d.ts.map +1 -0
  185. package/dist/server/output-inactivity-monitor.integration.test.d.ts +2 -0
  186. package/dist/server/output-inactivity-monitor.integration.test.d.ts.map +1 -0
  187. package/dist/server/output-inactivity-monitor.integration.test.js +136 -0
  188. package/dist/server/output-inactivity-monitor.integration.test.js.map +1 -0
  189. package/dist/server/output-inactivity-monitor.js +112 -0
  190. package/dist/server/output-inactivity-monitor.js.map +1 -0
  191. package/dist/server/output-inactivity-monitor.test.d.ts +2 -0
  192. package/dist/server/output-inactivity-monitor.test.d.ts.map +1 -0
  193. package/dist/server/output-inactivity-monitor.test.js +284 -0
  194. package/dist/server/output-inactivity-monitor.test.js.map +1 -0
  195. package/dist/server/parse.d.ts +69 -0
  196. package/dist/server/parse.d.ts.map +1 -0
  197. package/dist/server/parse.js +278 -0
  198. package/dist/server/parse.js.map +1 -0
  199. package/dist/server/parse.test.d.ts +2 -0
  200. package/dist/server/parse.test.d.ts.map +1 -0
  201. package/dist/server/parse.test.js +203 -0
  202. package/dist/server/parse.test.js.map +1 -0
  203. package/dist/server/process-activity-monitor.d.ts +21 -0
  204. package/dist/server/process-activity-monitor.d.ts.map +1 -0
  205. package/dist/server/process-activity-monitor.js +103 -0
  206. package/dist/server/process-activity-monitor.js.map +1 -0
  207. package/dist/server/process-activity-monitor.test.d.ts +2 -0
  208. package/dist/server/process-activity-monitor.test.d.ts.map +1 -0
  209. package/dist/server/process-activity-monitor.test.js +82 -0
  210. package/dist/server/process-activity-monitor.test.js.map +1 -0
  211. package/dist/server/quota-spawn-error.test.d.ts +2 -0
  212. package/dist/server/quota-spawn-error.test.d.ts.map +1 -0
  213. package/dist/server/quota-spawn-error.test.js +343 -0
  214. package/dist/server/quota-spawn-error.test.js.map +1 -0
  215. package/dist/server/quota.d.ts +66 -0
  216. package/dist/server/quota.d.ts.map +1 -0
  217. package/dist/server/quota.js +577 -0
  218. package/dist/server/quota.js.map +1 -0
  219. package/dist/server/runtime-config.d.ts +11 -0
  220. package/dist/server/runtime-config.d.ts.map +1 -0
  221. package/dist/server/runtime-config.js +389 -0
  222. package/dist/server/runtime-config.js.map +1 -0
  223. package/dist/server/runtime-config.test.d.ts +2 -0
  224. package/dist/server/runtime-config.test.d.ts.map +1 -0
  225. package/dist/server/runtime-config.test.js +389 -0
  226. package/dist/server/runtime-config.test.js.map +1 -0
  227. package/dist/server/skills.d.ts +8 -0
  228. package/dist/server/skills.d.ts.map +1 -0
  229. package/dist/server/skills.js +26 -0
  230. package/dist/server/skills.js.map +1 -0
  231. package/dist/server/ssh-host-runtime.d.ts +24 -0
  232. package/dist/server/ssh-host-runtime.d.ts.map +1 -0
  233. package/dist/server/ssh-host-runtime.js +84 -0
  234. package/dist/server/ssh-host-runtime.js.map +1 -0
  235. package/dist/server/ssh-session-state.d.ts +18 -0
  236. package/dist/server/ssh-session-state.d.ts.map +1 -0
  237. package/dist/server/ssh-session-state.js +11 -0
  238. package/dist/server/ssh-session-state.js.map +1 -0
  239. package/dist/server/test.d.ts +3 -0
  240. package/dist/server/test.d.ts.map +1 -0
  241. package/dist/server/test.js +531 -0
  242. package/dist/server/test.js.map +1 -0
  243. package/dist/server/test.remote.test.d.ts +2 -0
  244. package/dist/server/test.remote.test.d.ts.map +1 -0
  245. package/dist/server/test.remote.test.js +596 -0
  246. package/dist/server/test.remote.test.js.map +1 -0
  247. package/dist/ui/build-config.d.ts +10 -0
  248. package/dist/ui/build-config.d.ts.map +1 -0
  249. package/dist/ui/build-config.js +284 -0
  250. package/dist/ui/build-config.js.map +1 -0
  251. package/dist/ui/build-config.test.d.ts +2 -0
  252. package/dist/ui/build-config.test.d.ts.map +1 -0
  253. package/dist/ui/build-config.test.js +367 -0
  254. package/dist/ui/build-config.test.js.map +1 -0
  255. package/dist/ui/index.d.ts +4 -0
  256. package/dist/ui/index.d.ts.map +1 -0
  257. package/dist/ui/index.js +8 -0
  258. package/dist/ui/index.js.map +1 -0
  259. package/dist/ui/parse-stdout.d.ts +3 -0
  260. package/dist/ui/parse-stdout.d.ts.map +1 -0
  261. package/dist/ui/parse-stdout.js +265 -0
  262. package/dist/ui/parse-stdout.js.map +1 -0
  263. package/dist/ui/parse-stdout.test.d.ts +2 -0
  264. package/dist/ui/parse-stdout.test.d.ts.map +1 -0
  265. package/dist/ui/parse-stdout.test.js +77 -0
  266. package/dist/ui/parse-stdout.test.js.map +1 -0
  267. package/package.json +55 -4
  268. package/skills/agentmail/SKILL.md +70 -0
  269. package/skills/complain/LICENSE +27 -0
  270. package/skills/complain/SKILL.md +68 -0
  271. package/skills/paperclip/SKILL.md +864 -0
  272. package/skills/paperclip/references/api-reference.md +1814 -0
  273. package/skills/paperclip/references/artifacts.md +163 -0
  274. package/skills/paperclip/references/cases.md +570 -0
  275. package/skills/paperclip/references/company-skills.md +266 -0
  276. package/skills/paperclip/references/issue-documents.md +58 -0
  277. package/skills/paperclip/references/issue-workspaces.md +94 -0
  278. package/skills/paperclip/references/routines.md +249 -0
  279. package/skills/paperclip/references/run-diagnostics.md +28 -0
  280. package/skills/paperclip/references/workflows.md +141 -0
  281. package/skills/paperclip/scripts/paperclip-issue-update.sh +166 -0
  282. package/skills/paperclip/scripts/paperclip-upload-artifact.sh +603 -0
  283. package/skills/paperclip/scripts/submit-agent-commentary.mjs +52 -0
  284. package/skills/paperclip-board/SKILL.md +633 -0
  285. package/skills/paperclip-converting-plans-to-tasks/SKILL.md +28 -0
  286. package/skills/paperclip-create-agent/SKILL.md +213 -0
  287. package/skills/paperclip-create-agent/references/agent-instruction-templates.md +24 -0
  288. package/skills/paperclip-create-agent/references/agents/coder.md +18 -0
  289. package/skills/paperclip-create-agent/references/agents/qa.md +18 -0
  290. package/skills/paperclip-create-agent/references/agents/securityengineer.md +26 -0
  291. package/skills/paperclip-create-agent/references/agents/uxdesigner.md +18 -0
  292. package/skills/paperclip-create-agent/references/api-reference.md +110 -0
  293. package/skills/paperclip-create-agent/references/baseline-role-guide.md +22 -0
  294. package/skills/paperclip-create-agent/references/draft-review-checklist.md +29 -0
  295. package/skills/para-memory-files/SKILL.md +100 -0
  296. package/skills/para-memory-files/references/schemas.md +35 -0
  297. package/skills/slack/SKILL.md +92 -0
  298. package/skills/suggestion-box/LICENSE +27 -0
  299. package/skills/suggestion-box/SKILL.md +77 -0
  300. package/README.md +0 -3
@@ -0,0 +1,531 @@
1
+ import { asString, parseObject, ensurePathInEnv, } from "@paperclipai/adapter-utils/server-utils";
2
+ import { ensureAdapterExecutionTargetCommandResolvable, ensureAdapterExecutionTargetDirectory, isAdapterExecutionTargetUnavailableError, maybeRunSandboxInstallCommand, runAdapterExecutionTargetProcess, describeAdapterExecutionTarget, resolveAdapterExecutionTargetCwd, prepareAdapterExecutionTargetRuntime, managedRemoteHomeEnvironment, } from "@paperclipai/adapter-utils/execution-target";
3
+ import fs from "node:fs/promises";
4
+ import path from "node:path";
5
+ import os from "node:os";
6
+ import { copyBackCodexAuth } from "./codex-auth-copyback.js";
7
+ import { parseCodexJsonl } from "./parse.js";
8
+ import { SANDBOX_INSTALL_COMMAND } from "../index.js";
9
+ import { codexHomeDir, readCodexAuthInfo } from "./quota.js";
10
+ import { buildCodexExecArgs } from "./codex-args.js";
11
+ import { isManagedCodexHomePath, prepareManagedCodexHome, resolveSharedCodexHomeDir, seedManagedCodexHome, } from "./codex-home.js";
12
+ import { isCodexAuthCacheEnabled, resolveCodexAuthCacheEntryPath, selectVendCredential, } from "./codex-auth-cache.js";
13
+ import { resolveCodexExecutionEngineForRun, testCodexAcpEnvironment } from "./acp.js";
14
+ import { ADAPTER_AUTH_MISSING_CHECK_CODE } from "./auth-check.js";
15
+ import { checkCodexCliVersionForModel, codexHelloProbeModelRejectionCheck } from "./cli-version.js";
16
+ function summarizeStatus(checks) {
17
+ if (checks.some((check) => check.level === "error"))
18
+ return "fail";
19
+ if (checks.some((check) => check.level === "warn"))
20
+ return "warn";
21
+ return "pass";
22
+ }
23
+ function isNonEmpty(value) {
24
+ return typeof value === "string" && value.trim().length > 0;
25
+ }
26
+ function firstNonEmptyLine(text) {
27
+ return (text
28
+ .split(/\r?\n/)
29
+ .map((line) => line.trim())
30
+ .find(Boolean) ?? "");
31
+ }
32
+ function commandLooksLike(command, expected) {
33
+ const base = path.basename(command).toLowerCase();
34
+ return base === expected || base === `${expected}.cmd` || base === `${expected}.exe`;
35
+ }
36
+ function summarizeProbeDetail(stdout, stderr, parsedError) {
37
+ const raw = parsedError?.trim() || firstNonEmptyLine(stderr) || firstNonEmptyLine(stdout);
38
+ if (!raw)
39
+ return null;
40
+ const clean = raw.replace(/\s+/g, " ").trim();
41
+ const max = 240;
42
+ return clean.length > max ? `${clean.slice(0, max - 1)}…` : clean;
43
+ }
44
+ const CODEX_AUTH_REQUIRED_RE = /(?:not\s+logged\s+in|login\s+required|authentication\s+required|unauthorized|invalid(?:\s+or\s+missing)?\s+api(?:[_\s-]?key)?|openai[_\s-]?api[_\s-]?key|api[_\s-]?key.*required|please\s+run\s+`?codex\s+login`?)/i;
45
+ const PROBE_CLEANUP_WARNING = "[paperclip] Codex probe cleanup incomplete";
46
+ async function prepareCodexHelloProbe(input) {
47
+ if (input.target?.kind === "remote" && input.target.transport === "ssh" && input.target.spec.useHostAuth === true) {
48
+ return { command: input.command, args: input.args, env: { ...input.env }, cleanup: async () => { } };
49
+ }
50
+ let preparedRuntime = null;
51
+ let preparedRuntimeWorkspaceLocalDir = null;
52
+ let probeHomeLocalDir = null;
53
+ const cleanup = async () => {
54
+ try {
55
+ await preparedRuntime?.restoreWorkspace();
56
+ }
57
+ catch (error) {
58
+ if (input.managedAiConnection)
59
+ throw error;
60
+ }
61
+ finally {
62
+ if (preparedRuntimeWorkspaceLocalDir) {
63
+ await fs.rm(preparedRuntimeWorkspaceLocalDir, { recursive: true, force: true }).catch(() => { });
64
+ }
65
+ if (probeHomeLocalDir) {
66
+ await fs.rm(probeHomeLocalDir, { recursive: true, force: true }).catch(() => { });
67
+ }
68
+ }
69
+ };
70
+ if (input.targetIsRemote && !input.probeApiKey) {
71
+ // Prepare the exact home a real run would use, mirroring execute.ts: vend
72
+ // the shared credential's freshest same-identity cached copy, then seed the
73
+ // effective home — the company default when no CODEX_HOME is configured, a
74
+ // Paperclip-managed override (the per-agent home) seeded in place — and
75
+ // stage that home's credentials. A genuine external override manages its
76
+ // own auth: its bytes are staged as-is and it is never seeded or mutated.
77
+ // Without this mirror the probe exercises a different credential than the
78
+ // run, and the Test and real runs can disagree in both directions.
79
+ const configuredCodexHome = isNonEmpty(input.env.CODEX_HOME)
80
+ ? path.resolve(input.env.CODEX_HOME.trim())
81
+ : null;
82
+ const configuredHomeIsManaged = configuredCodexHome != null &&
83
+ isManagedCodexHomePath(process.env, input.companyId, configuredCodexHome);
84
+ if (!input.managedAiConnection && isCodexAuthCacheEnabled(process.env)) {
85
+ // Identity-anchored cache vend, exactly as execute runs it before the
86
+ // seeding below. Best-effort: a vend failure never blocks the probe, and
87
+ // the probe then stages the shared credential as-is.
88
+ const sharedHomeAuthPath = path.join(resolveSharedCodexHomeDir(process.env), "auth.json");
89
+ await selectVendCredential(sharedHomeAuthPath, (accountId) => resolveCodexAuthCacheEntryPath(process.env, accountId, input.companyId), async () => { }).catch(() => undefined);
90
+ }
91
+ let effectiveHome;
92
+ if (configuredCodexHome == null) {
93
+ effectiveHome = await prepareManagedCodexHome(process.env, async () => { }, input.companyId, {
94
+ apiKey: null,
95
+ });
96
+ }
97
+ else {
98
+ if (configuredHomeIsManaged) {
99
+ await seedManagedCodexHome(configuredCodexHome, process.env, async () => { }, {
100
+ apiKey: null,
101
+ });
102
+ }
103
+ effectiveHome = configuredCodexHome;
104
+ }
105
+ // Upload only the credential/config files the login probe needs, not the
106
+ // entire effective CODEX_HOME. A real managed home accumulates hundreds of
107
+ // MB of session/state history (`sessions/`, `state_*.sqlite`, …); tarring
108
+ // and streaming all of it into the sandbox made the environment Test probe
109
+ // take many minutes and look like it hung. The hello probe only needs auth.
110
+ probeHomeLocalDir = await fs.mkdtemp(path.join(os.tmpdir(), `paperclip-codex-probe-home-${input.runId}-`));
111
+ let seededAuth = false;
112
+ for (const file of ["auth.json", "config.toml"]) {
113
+ // `fs.readFile` follows the home's `auth.json` symlink into the host's
114
+ // `~/.codex`, so we copy the resolved bytes as a plain file.
115
+ const contents = await fs.readFile(path.join(effectiveHome, file)).catch(() => null);
116
+ if (contents) {
117
+ await fs.writeFile(path.join(probeHomeLocalDir, file), contents);
118
+ if (file === "auth.json")
119
+ seededAuth = true;
120
+ }
121
+ }
122
+ // When the host has no Codex credentials to seed, don't override CODEX_HOME.
123
+ // Pointing Codex at an empty uploaded home would mask any login already
124
+ // baked into the sandbox (e.g. a captured custom-image snapshot); leaving
125
+ // CODEX_HOME unset lets the probe exercise that in-sandbox login instead.
126
+ if (!seededAuth && !input.managedAiConnection) {
127
+ return {
128
+ command: input.command,
129
+ args: input.args,
130
+ env: { ...input.env },
131
+ cleanup,
132
+ };
133
+ }
134
+ preparedRuntimeWorkspaceLocalDir = await fs.mkdtemp(path.join(os.tmpdir(), `paperclip-codex-envtest-${input.runId}-`));
135
+ preparedRuntime = await prepareAdapterExecutionTargetRuntime({
136
+ privateRuntime: Boolean(input.managedAiConnection),
137
+ runId: input.runId,
138
+ target: input.target,
139
+ adapterKey: "codex",
140
+ workspaceLocalDir: preparedRuntimeWorkspaceLocalDir,
141
+ // Pass `input.cwd` as the base (not a pre-built per-run subdir).
142
+ // `prepareRemoteManagedRuntime` itself appends
143
+ // `.paperclip-runtime/runs/<runId>/workspace` to whatever it gets, so
144
+ // pre-building a per-run path here would double-nest the run ID.
145
+ workspaceRemoteDir: input.cwd,
146
+ installCommand: SANDBOX_INSTALL_COMMAND,
147
+ detectCommand: input.command,
148
+ // The probe workspace is a throwaway temp dir; never wait on copy-back retries.
149
+ workspaceRestoreRetryDelaysMs: [],
150
+ assets: [
151
+ {
152
+ key: "home",
153
+ localDir: probeHomeLocalDir,
154
+ followSymlinks: true,
155
+ restore: input.managedAiConnection
156
+ ? async ({ assetDir, readFile }) => {
157
+ await copyBackCodexAuth({
158
+ readSandboxAuth: () => readFile(path.posix.join(assetDir, "auth.json")),
159
+ hostAuthPath: path.join(effectiveHome, "auth.json"),
160
+ log: async () => { },
161
+ });
162
+ }
163
+ : undefined,
164
+ },
165
+ ],
166
+ });
167
+ return {
168
+ command: input.command,
169
+ args: input.args,
170
+ env: preparedRuntime.assetDirs.home
171
+ ? { ...input.env,
172
+ ...(input.target?.kind === "remote" && input.target.transport === "ssh" && input.target.spec.useHostAuth === false && input.managedAiConnection && preparedRuntime.runtimeRootDir
173
+ ? managedRemoteHomeEnvironment(preparedRuntime.runtimeRootDir) : {}),
174
+ CODEX_HOME: preparedRuntime.assetDirs.home }
175
+ : { ...input.env },
176
+ cleanup,
177
+ };
178
+ }
179
+ if (input.probeApiKey) {
180
+ const probeHome = input.targetIsRemote
181
+ ? path.posix.join(input.cwd, ".paperclip-runtime", "codex", `probe-home-${input.runId}`)
182
+ : path.join(os.tmpdir(), `paperclip-codex-probe-${input.runId}`);
183
+ // The local finally path retries cleanup independently of the model result.
184
+ if (!input.targetIsRemote)
185
+ probeHomeLocalDir = probeHome;
186
+ return {
187
+ command: "sh",
188
+ args: [
189
+ "-c",
190
+ `set -e; umask 077; mkdir -p "$CODEX_HOME"; printf "%s" "$_PAPERCLIP_CODEX_AUTH_JSON" > "$CODEX_HOME/auth.json"; unset _PAPERCLIP_CODEX_AUTH_JSON; cleanup() { result=$?; trap - EXIT; rm -f "$CODEX_HOME/auth.json" || true; rm -rf "$CODEX_HOME" || printf '%s\\n' '${PROBE_CLEANUP_WARNING}' >&2; exit "$result"; }; trap cleanup EXIT; trap 'exit 130' INT; trap 'exit 143' TERM; "$0" "$@"`,
191
+ input.command,
192
+ ...input.args,
193
+ ],
194
+ env: {
195
+ ...input.env,
196
+ CODEX_HOME: probeHome,
197
+ _PAPERCLIP_CODEX_AUTH_JSON: JSON.stringify({ OPENAI_API_KEY: input.probeApiKey }),
198
+ },
199
+ cleanup,
200
+ };
201
+ }
202
+ return {
203
+ command: input.command,
204
+ args: input.args,
205
+ env: { ...input.env },
206
+ cleanup,
207
+ };
208
+ }
209
+ export async function testEnvironment(ctx) {
210
+ const engineSelection = await resolveCodexExecutionEngineForRun({
211
+ config: parseObject(ctx.config),
212
+ executionTarget: ctx.executionTarget,
213
+ });
214
+ if (engineSelection.unavailableReason) {
215
+ return {
216
+ adapterType: "codex_local",
217
+ status: "fail",
218
+ checks: [{
219
+ code: "adapter_engine_unavailable",
220
+ level: "error",
221
+ message: engineSelection.unavailableReason,
222
+ hint: ctx.executionTarget?.kind === "remote"
223
+ ? "In the agent’s runtime settings, select the CLI engine, or use a sandbox image with the Codex ACP server installed."
224
+ : undefined,
225
+ }],
226
+ testedAt: new Date().toISOString(),
227
+ };
228
+ }
229
+ if (engineSelection.engine === "acp") {
230
+ return testCodexAcpEnvironment(ctx);
231
+ }
232
+ const checks = [];
233
+ const config = parseObject(ctx.config);
234
+ const command = asString(config.command, "codex");
235
+ const target = ctx.executionTarget ?? null;
236
+ const targetIsRemote = target?.kind === "remote";
237
+ const targetIsSandbox = target?.kind === "remote" && target.transport === "sandbox";
238
+ const cwd = resolveAdapterExecutionTargetCwd(target, asString(config.cwd, ""), process.cwd());
239
+ const targetLabel = targetIsRemote
240
+ ? ctx.environmentName ?? describeAdapterExecutionTarget(target)
241
+ : null;
242
+ const runId = `codex-envtest-${Date.now()}-${Math.random().toString(16).slice(2)}`;
243
+ if (targetLabel) {
244
+ checks.push({
245
+ code: "codex_environment_target",
246
+ level: "info",
247
+ message: `Probing inside environment: ${targetLabel}`,
248
+ });
249
+ }
250
+ try {
251
+ await ensureAdapterExecutionTargetDirectory(runId, target, cwd, {
252
+ cwd,
253
+ env: {},
254
+ createIfMissing: true,
255
+ });
256
+ checks.push({
257
+ code: "codex_cwd_valid",
258
+ level: "info",
259
+ message: `Working directory is valid: ${cwd}`,
260
+ });
261
+ }
262
+ catch (err) {
263
+ checks.push({
264
+ code: "codex_cwd_invalid",
265
+ ...(isAdapterExecutionTargetUnavailableError(err) ? { retryable: true } : {}),
266
+ level: "error",
267
+ message: err instanceof Error ? err.message : "Invalid working directory",
268
+ detail: cwd,
269
+ });
270
+ }
271
+ const envConfig = parseObject(config.env);
272
+ const env = {};
273
+ for (const [key, value] of Object.entries(envConfig)) {
274
+ if (typeof value === "string")
275
+ env[key] = value;
276
+ }
277
+ const runtimeEnv = ensurePathInEnv({ ...process.env, ...env });
278
+ const installCheck = await maybeRunSandboxInstallCommand({
279
+ runId,
280
+ target,
281
+ adapterKey: "codex",
282
+ installCommand: SANDBOX_INSTALL_COMMAND,
283
+ detectCommand: command,
284
+ env,
285
+ });
286
+ if (installCheck)
287
+ checks.push(installCheck);
288
+ try {
289
+ await ensureAdapterExecutionTargetCommandResolvable(command, target, cwd, runtimeEnv);
290
+ checks.push({
291
+ code: "codex_command_resolvable",
292
+ level: "info",
293
+ message: `Command is executable: ${command}`,
294
+ });
295
+ }
296
+ catch (err) {
297
+ checks.push({
298
+ code: "codex_command_unresolvable",
299
+ ...(isAdapterExecutionTargetUnavailableError(err) ? { retryable: true } : {}),
300
+ level: "error",
301
+ message: err instanceof Error ? err.message : "Command is not executable",
302
+ detail: command,
303
+ });
304
+ }
305
+ const configOpenAiKey = env.OPENAI_API_KEY;
306
+ const hostOpenAiKey = targetIsRemote || Object.hasOwn(env, "OPENAI_API_KEY")
307
+ ? undefined : process.env.OPENAI_API_KEY;
308
+ if (config.managedAiRouting) {
309
+ checks.push({
310
+ code: "codex_managed_provider_configured",
311
+ level: "info",
312
+ message: "Testing the selected connection’s provider and model.",
313
+ });
314
+ }
315
+ else if (isNonEmpty(configOpenAiKey) || isNonEmpty(hostOpenAiKey)) {
316
+ const source = isNonEmpty(configOpenAiKey) ? "adapter config env" : "server environment";
317
+ checks.push({
318
+ code: "codex_openai_api_key_present",
319
+ level: "info",
320
+ message: "OPENAI_API_KEY is set for Codex authentication.",
321
+ detail: `Detected in ${source}.`,
322
+ });
323
+ }
324
+ else if (!targetIsRemote) {
325
+ // Local-only auth file check. On remote targets, the probe will surface
326
+ // any missing-auth errors directly from the remote `codex` invocation.
327
+ const codexHome = isNonEmpty(env.CODEX_HOME) ? env.CODEX_HOME : undefined;
328
+ const codexAuth = await readCodexAuthInfo(codexHome).catch(() => null);
329
+ if (codexAuth) {
330
+ checks.push({
331
+ code: "codex_native_auth_present",
332
+ level: "info",
333
+ message: "Codex is authenticated via its own auth configuration.",
334
+ detail: codexAuth.email ? `Logged in as ${codexAuth.email}.` : `Credentials found in ${path.join(codexHome ?? codexHomeDir(), "auth.json")}.`,
335
+ });
336
+ }
337
+ else {
338
+ checks.push({
339
+ code: "codex_openai_api_key_missing",
340
+ level: "warn",
341
+ message: "OPENAI_API_KEY is not set. Codex runs may fail until authentication is configured.",
342
+ hint: "Set OPENAI_API_KEY in adapter env, shell environment, or run `codex auth` to log in.",
343
+ });
344
+ }
345
+ }
346
+ const canRunProbe = checks.every((check) => check.code !== "codex_cwd_invalid" && check.code !== "codex_command_unresolvable");
347
+ // Models with a verified CLI floor are compared against the installed Codex
348
+ // before the hello probe. A probe on an older CLI only produces the backend's
349
+ // "not supported when using Codex with a ChatGPT account" rejection, which
350
+ // hides the real gap: the CLI (often a stale sandbox image), not the account.
351
+ let detectedCliVersion = null;
352
+ let configuredModelIsCompatible = true;
353
+ if (canRunProbe && commandLooksLike(command, "codex")) {
354
+ const versionCheck = await checkCodexCliVersionForModel({
355
+ runId,
356
+ model: asString(config.model, ""),
357
+ command,
358
+ target,
359
+ cwd,
360
+ env,
361
+ });
362
+ if (versionCheck) {
363
+ checks.push(versionCheck.check);
364
+ configuredModelIsCompatible = versionCheck.compatible;
365
+ detectedCliVersion = versionCheck.detectedVersion;
366
+ }
367
+ }
368
+ if (canRunProbe && !configuredModelIsCompatible) {
369
+ checks.push({
370
+ code: "codex_hello_probe_skipped_cli_version",
371
+ level: "info",
372
+ message: "Skipped hello probe because the installed Codex CLI cannot use the configured model.",
373
+ });
374
+ }
375
+ else if (canRunProbe) {
376
+ if (!commandLooksLike(command, "codex")) {
377
+ checks.push({
378
+ code: "codex_hello_probe_skipped_custom_command",
379
+ level: "info",
380
+ message: "Skipped hello probe because command is not `codex`.",
381
+ detail: command,
382
+ hint: "Use the `codex` CLI command to run the automatic login and installation probe.",
383
+ });
384
+ }
385
+ else {
386
+ const execArgs = buildCodexExecArgs({ ...config, fastMode: false }, { skipGitRepoCheck: targetIsSandbox });
387
+ // A connection test needs one small response, not plugin catalog sync,
388
+ // repository instructions, or a durable session. Keep provider/model
389
+ // configuration intact while removing unrelated startup work.
390
+ const args = [...execArgs.args];
391
+ args.splice(args.length - 1, 0, "-c", "features.plugins=false", "-c", "features.remote_plugin=false", "-c", "project_doc_max_bytes=0", ...(args.includes("--ephemeral") ? [] : ["--ephemeral"]));
392
+ if (execArgs.fastModeIgnoredReason) {
393
+ checks.push({
394
+ code: "codex_fast_mode_unsupported_model",
395
+ level: "warn",
396
+ message: execArgs.fastModeIgnoredReason,
397
+ hint: "Switch the agent model to GPT-5.4 or enter a manual model ID to enable Codex Fast mode.",
398
+ });
399
+ }
400
+ if (targetIsSandbox) {
401
+ checks.push({
402
+ code: "codex_git_repo_check_skipped",
403
+ level: "info",
404
+ message: "Added --skip-git-repo-check for sandbox hello probes.",
405
+ hint: "Codex requires an explicit trust bypass in headless remote sandbox workspaces.",
406
+ });
407
+ }
408
+ // Codex CLI (>= 0.122) ignores the OPENAI_API_KEY env var and only reads
409
+ // credentials from $CODEX_HOME/auth.json. When we have a key available,
410
+ // wrap the probe with a shell that materializes a per-run auth.json so
411
+ // the CLI can authenticate. The key content is passed via env (not on
412
+ // the command line) to avoid leaking it into process listings.
413
+ // Managed connections already contain their exact auth and provider config.
414
+ // Replacing that home with a native-key probe would test another provider.
415
+ const probeApiKey = config.managedAiConnection ? null : isNonEmpty(configOpenAiKey)
416
+ ? configOpenAiKey
417
+ : isNonEmpty(hostOpenAiKey)
418
+ ? hostOpenAiKey
419
+ : null;
420
+ const preparedProbe = await prepareCodexHelloProbe({
421
+ managedAiConnection: Boolean(config.managedAiConnection),
422
+ runId,
423
+ companyId: ctx.companyId,
424
+ target,
425
+ targetIsRemote,
426
+ cwd,
427
+ command,
428
+ args,
429
+ env,
430
+ probeApiKey,
431
+ });
432
+ try {
433
+ const probe = await runAdapterExecutionTargetProcess(runId, target, preparedProbe.command, preparedProbe.args, {
434
+ cwd,
435
+ env: preparedProbe.env,
436
+ timeoutSec: 45,
437
+ graceSec: 5,
438
+ stdin: "Respond with hello.",
439
+ onLog: async () => { },
440
+ });
441
+ const parsed = parseCodexJsonl(probe.stdout);
442
+ // Plugin-catalog login is separate from model authentication. Its
443
+ // warnings must not explain an unrelated provider/process failure.
444
+ const providerStderr = probe.stderr.split(/\r?\n/)
445
+ .filter((line) => !/\bcodex_core_plugins(?:::|:)/.test(line) && !line.includes(PROBE_CLEANUP_WARNING))
446
+ .join("\n");
447
+ const detail = summarizeProbeDetail(probe.stdout, providerStderr, parsed.errorMessage);
448
+ const authEvidence = parsed.errorMessage?.trim() || providerStderr;
449
+ if (probe.stderr.includes(PROBE_CLEANUP_WARNING)) {
450
+ checks.push({
451
+ code: "codex_probe_cleanup_incomplete",
452
+ level: "info",
453
+ message: "Temporary probe files could not be fully removed; this does not change the connection result.",
454
+ });
455
+ }
456
+ if (probe.timedOut) {
457
+ checks.push({
458
+ code: "codex_hello_probe_timed_out",
459
+ level: "warn",
460
+ message: "Codex hello probe timed out.",
461
+ hint: "Retry the probe. If this persists, verify Codex can run `Respond with hello` from this directory manually.",
462
+ });
463
+ }
464
+ else if ((probe.exitCode ?? 1) === 0) {
465
+ const summary = parsed.summary.trim();
466
+ const hasHello = /\bhello\b/i.test(summary);
467
+ checks.push({
468
+ code: hasHello ? "codex_hello_probe_passed" : "codex_hello_probe_unexpected_output",
469
+ level: hasHello ? "info" : "warn",
470
+ message: hasHello
471
+ ? "Codex hello probe succeeded."
472
+ : "Codex probe ran but did not return `hello` as expected.",
473
+ ...(summary ? { detail: summary.replace(/\s+/g, " ").trim().slice(0, 240) } : {}),
474
+ ...(hasHello
475
+ ? {}
476
+ : {
477
+ hint: "Try the probe manually (`codex exec --json -` then prompt: Respond with hello) to inspect full output.",
478
+ }),
479
+ });
480
+ }
481
+ else if (CODEX_AUTH_REQUIRED_RE.test(authEvidence)) {
482
+ checks.push({
483
+ code: "codex_hello_probe_auth_required",
484
+ level: "warn",
485
+ message: "Codex CLI is installed, but authentication is not ready.",
486
+ ...(detail ? { detail } : {}),
487
+ hint: probeApiKey
488
+ ? "OPENAI_API_KEY was provided but Codex still rejected the request. Verify the key is valid for the OpenAI Responses API (e.g. `curl -H \"Authorization: Bearer $OPENAI_API_KEY\" https://api.openai.com/v1/models`), or run `codex login` and seed `~/.codex/auth.json`."
489
+ : "Codex CLI does not read OPENAI_API_KEY from the environment; set OPENAI_API_KEY in this adapter's config (so Paperclip writes it to `$CODEX_HOME/auth.json`) or run `codex login` on the host first.",
490
+ });
491
+ if (targetIsSandbox) {
492
+ // Emit the neutral canonical check so the user interface can decide
493
+ // login eligibility from a stable code. The user interface does not
494
+ // read the message text or the top-level status.
495
+ checks.push({
496
+ code: ADAPTER_AUTH_MISSING_CHECK_CODE,
497
+ level: "warn",
498
+ message: "This environment has no ready authentication for this adapter.",
499
+ ...(detail ? { detail } : {}),
500
+ hint: "Provide credentials for this adapter, or start login in the environment.",
501
+ });
502
+ }
503
+ }
504
+ else {
505
+ const modelRejection = codexHelloProbeModelRejectionCheck({
506
+ evidence: `${parsed.errorMessage ?? ""}\n${providerStderr}\n${probe.stdout}`,
507
+ detectedVersion: detectedCliVersion,
508
+ targetIsSandbox,
509
+ });
510
+ checks.push(modelRejection ?? {
511
+ code: "codex_hello_probe_failed",
512
+ level: "error",
513
+ message: "Codex hello probe failed.",
514
+ ...(detail ? { detail } : {}),
515
+ hint: "Run `codex exec --json -` manually in this working directory and prompt `Respond with hello` to debug.",
516
+ });
517
+ }
518
+ }
519
+ finally {
520
+ await preparedProbe.cleanup();
521
+ }
522
+ }
523
+ }
524
+ return {
525
+ adapterType: ctx.adapterType,
526
+ status: summarizeStatus(checks),
527
+ checks,
528
+ testedAt: new Date().toISOString(),
529
+ };
530
+ }
531
+ //# sourceMappingURL=test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.js","sourceRoot":"","sources":["../../src/server/test.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,QAAQ,EACR,WAAW,EACX,eAAe,GAChB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,6CAA6C,EAC7C,qCAAqC,EACrC,wCAAwC,EACxC,6BAA6B,EAC7B,gCAAgC,EAChC,8BAA8B,EAC9B,gCAAgC,EAChC,oCAAoC,EACpC,4BAA4B,GAC7B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,kCAAkC,EAAE,MAAM,kBAAkB,CAAC;AAEpG,SAAS,eAAe,CAAC,MAAiC;IACx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;QAC/B,MAAM;QACN,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACnC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=test.remote.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.remote.test.d.ts","sourceRoot":"","sources":["../../src/server/test.remote.test.ts"],"names":[],"mappings":""}