@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,520 @@
1
+ import { AsyncLocalStorage } from "node:async_hooks";
2
+ import { lstat, mkdir, open, readFile, realpath, rename, rm } from "node:fs/promises";
3
+ import path from "node:path";
4
+ import { randomUUID } from "node:crypto";
5
+ import { resolvePaperclipInstanceRootForAdapter } from "@paperclipai/adapter-utils/server-utils";
6
+ import { withDirectoryMergeLock } from "@paperclipai/adapter-utils/workspace-restore-merge";
7
+ import { toAccountHandle } from "@paperclipai/shared";
8
+ import { USE_SOURCE_EXIT, decideCodexAuthMerge } from "./codex-auth-merge-decision.js";
9
+ import { writeCredentialSeedOrNewer } from "./codex-auth-seed-write.js";
10
+ // The identity-keyed host credential store keeps one usable subscription
11
+ // credential per identity (`account_id`) in a SEPARATE host tree, outside the
12
+ // shared Codex home and outside the symlink allowlist. Each identity's entry
13
+ // directory doubles as that account's addressable home: the device-login
14
+ // promotion writes the durable credential there, and a company secret names the
15
+ // directory by path. The store also still backs the identity-anchored vend: it
16
+ // never changes the copy-back path, the fail-closed decision predicate, or the
17
+ // host default store overwrite, it only refreshes an identity the host already
18
+ // holds, it never seeds an empty host store, and it never picks a credential at
19
+ // random.
20
+ const CACHE_DIR_NAME = "codex-auth-cache";
21
+ const CACHE_ENTRY_FILE = "auth.json";
22
+ // A private directory (owner rwx only). 0o700 has no group/other bits, so a
23
+ // standard umask can never widen it.
24
+ const PRIVATE_DIR_MODE = 0o700;
25
+ // One default-on off-switch. When the flag is an explicit falsy value the cache
26
+ // write and the cache vend become no-ops. The host default overwrite is
27
+ // unchanged in both states.
28
+ export const CODEX_AUTH_CACHE_OFF_SWITCH_ENV = "PAPERCLIP_CODEX_AUTH_CACHE";
29
+ const FALSY_ENV_RE = /^(0|false|no|off)$/i;
30
+ // The cache reuses the same direction-agnostic decision predicate the copy-back
31
+ // and inbound restore run, through the shared `decideCodexAuthMerge` entry point.
32
+ // The predicate answers one question — "should the caller replace `destination`
33
+ // with `source`?" — purely by argument order (first = source, second =
34
+ // destination). Exit 10 = use source; exit 20 = keep destination. The opt-in seed
35
+ // mode fills an ABSENT destination slot from a usable subscription source.
36
+ function nonEmpty(value) {
37
+ return typeof value === "string" && value.trim().length > 0 ? value.trim() : null;
38
+ }
39
+ /**
40
+ * True when the cache is enabled. The cache is on by default. It turns off only
41
+ * when {@link CODEX_AUTH_CACHE_OFF_SWITCH_ENV} is an explicit falsy value
42
+ * (`0`, `false`, `no`, or `off`).
43
+ */
44
+ export function isCodexAuthCacheEnabled(env = process.env) {
45
+ const raw = env[CODEX_AUTH_CACHE_OFF_SWITCH_ENV];
46
+ if (typeof raw !== "string")
47
+ return true;
48
+ return !FALSY_ENV_RE.test(raw.trim());
49
+ }
50
+ /**
51
+ * Sanitizes one raw value to a single safe path segment. Rejects an empty value,
52
+ * a relative segment (`.` or `..`), a path separator (`/` or `\`), and a NUL
53
+ * byte, so the value can never become a path traversal. Returns the trimmed,
54
+ * safe segment. The `label` names the value in the error message. (Security
55
+ * condition 3.)
56
+ */
57
+ function toSafePathSegment(value, label) {
58
+ const trimmed = typeof value === "string" ? value.trim() : "";
59
+ if (trimmed.length === 0) {
60
+ throw new Error(`codex auth cache: ${label} is empty`);
61
+ }
62
+ if (trimmed === "." || trimmed === "..") {
63
+ throw new Error(`codex auth cache: ${label} is a relative path segment`);
64
+ }
65
+ if (trimmed.includes("/") || trimmed.includes("\\") || trimmed.includes("\0")) {
66
+ throw new Error(`codex auth cache: ${label} contains a path separator`);
67
+ }
68
+ // Defense in depth: a safe segment is exactly its own basename. Anything else
69
+ // carries a separator or a relative segment the checks above must have caught.
70
+ if (path.basename(trimmed) !== trimmed) {
71
+ throw new Error(`codex auth cache: ${label} is not a single path segment`);
72
+ }
73
+ return trimmed;
74
+ }
75
+ /**
76
+ * Sanitizes an `account_id` to one safe path segment. Rejects an empty value, a
77
+ * relative segment (`.` or `..`), a path separator, and a NUL byte, so a raw
78
+ * `account_id` can never become a path traversal. Returns the trimmed, safe
79
+ * segment. (Security condition 3.)
80
+ */
81
+ export function toCacheKey(accountId) {
82
+ return toSafePathSegment(accountId, "account_id");
83
+ }
84
+ /**
85
+ * Resolves the company-scoped cache root under the same isolation boundary as
86
+ * the managed Codex home (`resolveManagedCodexHomeDir`). The root is always
87
+ * company-scoped, so a Codex credential can never cross a company boundary.
88
+ * There is no instance-global fallback root: `companyId` is required, and an
89
+ * empty value is a fail-loud error. `companyId` is sanitized to a single safe
90
+ * path segment, so a traversal value (`..`, `/etc`, `a/b`) can never make the
91
+ * cache root escape the `companies/` directory. Every downstream path (the
92
+ * entry path, the vend, and the clear) inherits this guard. (Security
93
+ * condition 1.)
94
+ */
95
+ export function resolveCodexAuthCacheDir(env = process.env, companyId) {
96
+ const safeCompanyId = toSafePathSegment(companyId, "companyId");
97
+ const instanceRoot = resolvePaperclipInstanceRootForAdapter({
98
+ homeDir: nonEmpty(env.PAPERCLIP_HOME) ?? undefined,
99
+ instanceId: nonEmpty(env.PAPERCLIP_INSTANCE_ID) ?? undefined,
100
+ env,
101
+ });
102
+ return path.resolve(instanceRoot, "companies", safeCompanyId, CACHE_DIR_NAME);
103
+ }
104
+ /**
105
+ * True when `homePath` sits inside the per-identity credential store of ANY
106
+ * company: `<instanceRoot>/companies/<id>/codex-auth-cache/…` (or is a store
107
+ * root itself). These directories are identity-anchored slots owned by the
108
+ * device-login promotion, the vend, and the copy-back, each under its own
109
+ * lock. The managed-home seeding pass consults this to refuse to symlink,
110
+ * heal, or overwrite an entry's `auth.json`: an agent may bind `CODEX_HOME`
111
+ * to an entry (through the login's account-home secret), and seeding it like
112
+ * an ordinary managed home would silently swap the bound account's durable
113
+ * credential for the host login.
114
+ */
115
+ export function isCodexAuthCachePath(env, homePath) {
116
+ const instanceRoot = resolvePaperclipInstanceRootForAdapter({
117
+ homeDir: nonEmpty(env.PAPERCLIP_HOME) ?? undefined,
118
+ instanceId: nonEmpty(env.PAPERCLIP_INSTANCE_ID) ?? undefined,
119
+ env,
120
+ });
121
+ const companiesRoot = path.resolve(instanceRoot, "companies");
122
+ const resolved = path.resolve(homePath);
123
+ if (!resolved.startsWith(companiesRoot + path.sep))
124
+ return false;
125
+ const segments = resolved.slice(companiesRoot.length + 1).split(path.sep);
126
+ return segments.length >= 2 && segments[1] === CACHE_DIR_NAME;
127
+ }
128
+ /**
129
+ * Resolves the entry path for one identity: `<cacheRoot>/<safeAccountId>/auth.json`.
130
+ * The `account_id` is validated first by {@link toAccountHandle} (a strict
131
+ * allowlist), the entry point of this function, then sanitized again by
132
+ * {@link toCacheKey} (a denylist) as a second, independent layer. After the
133
+ * join, this verifies the resolved entry path stays under the cache root and
134
+ * ends at exactly `<safeAccountId>/auth.json`. This function does no filesystem
135
+ * work; it is safe for a read path (the vend and the clear). (Security
136
+ * condition 3.)
137
+ */
138
+ export function resolveCodexAuthCacheEntryPath(env = process.env, accountId, companyId) {
139
+ const handle = toAccountHandle(accountId);
140
+ if (!handle) {
141
+ throw new Error("codex auth cache: account_id is not a valid account handle");
142
+ }
143
+ const resolvedRoot = resolveCodexAuthCacheDir(env, companyId);
144
+ const safeKey = toCacheKey(handle);
145
+ const entryDir = path.resolve(resolvedRoot, safeKey);
146
+ const entryPath = path.resolve(entryDir, CACHE_ENTRY_FILE);
147
+ const expectedEntryPath = path.join(resolvedRoot, safeKey, CACHE_ENTRY_FILE);
148
+ if (!entryDir.startsWith(resolvedRoot + path.sep) ||
149
+ path.dirname(entryDir) !== resolvedRoot ||
150
+ entryPath !== expectedEntryPath) {
151
+ throw new Error("codex auth cache: resolved entry path escapes the cache root");
152
+ }
153
+ return entryPath;
154
+ }
155
+ /**
156
+ * Ensures one directory exists and is private (mode 0700). Fails closed with
157
+ * `lstat` (not `stat`) when the existing path is a symlink or a non-directory,
158
+ * so the cache never writes through a planted symlink. (Security condition 3.)
159
+ */
160
+ async function ensurePrivateDir(dir) {
161
+ const existing = await lstat(dir).catch((error) => {
162
+ if (error.code === "ENOENT")
163
+ return null;
164
+ throw error;
165
+ });
166
+ if (existing) {
167
+ if (existing.isSymbolicLink() || !existing.isDirectory()) {
168
+ throw new Error("codex auth cache: cache path is a symlink or a non-directory");
169
+ }
170
+ return;
171
+ }
172
+ await mkdir(dir, { recursive: true, mode: PRIVATE_DIR_MODE });
173
+ }
174
+ /**
175
+ * Resolves the entry path and creates the cache root and the entry directory
176
+ * private (mode 0700), each guarded by `lstat`. The `account_id` is validated
177
+ * at the entry point of this function through {@link resolveCodexAuthCacheEntryPath}.
178
+ * Use this on the write path before the entry is written.
179
+ */
180
+ export async function ensureCodexAuthCacheEntryDir(env = process.env, accountId, companyId) {
181
+ const entryPath = resolveCodexAuthCacheEntryPath(env, accountId, companyId);
182
+ await ensurePrivateDir(resolveCodexAuthCacheDir(env, companyId));
183
+ await ensurePrivateDir(path.dirname(entryPath));
184
+ return entryPath;
185
+ }
186
+ /**
187
+ * Same as {@link ensureCodexAuthCacheEntryDir}, but the absence check and the
188
+ * directory creation run inside one lock keyed to the company-scoped cache
189
+ * root. Two different logins for the SAME Codex account can promote at the
190
+ * same time (each login owns its own promotion slot), so a plain
191
+ * check-then-create sequence lets both concurrent callers see the slot as
192
+ * absent and both report `created: true`. Under this lock, only the caller
193
+ * that truly finds the slot absent gets `created: true`; the other caller
194
+ * correctly reports `created: false` and so never deletes a home the first
195
+ * caller's login already wrote to and named with a company secret.
196
+ */
197
+ export async function ensureCodexAuthCacheEntryDirExclusive(env = process.env, accountId, companyId) {
198
+ const cacheRoot = resolveCodexAuthCacheDir(env, companyId);
199
+ await ensurePrivateDir(cacheRoot);
200
+ return withDirectoryMergeLock(cacheRoot, async () => {
201
+ const entryPath = resolveCodexAuthCacheEntryPath(env, accountId, companyId);
202
+ const entryDir = path.dirname(entryPath);
203
+ const created = await lstat(entryDir)
204
+ .then(() => false)
205
+ .catch((error) => {
206
+ if (error.code === "ENOENT")
207
+ return true;
208
+ throw error;
209
+ });
210
+ await ensurePrivateDir(entryDir);
211
+ return { entryPath, created };
212
+ }, env);
213
+ }
214
+ /**
215
+ * Resolves a per-company, named lock target directory under the same
216
+ * instance-scoped `companies/<companyId>/` tree the cache root and the
217
+ * promotion lock use. Two callers that pass the same `lockName` for the same
218
+ * `companyId` always resolve the same directory, so they share one lock; two
219
+ * different `lockName` values never share a lock key, so a caller that holds
220
+ * one of these named locks can still call {@link ensureCodexAuthCacheEntryDirExclusive}
221
+ * (which locks the cache root) or another named lock without nesting a lock
222
+ * inside itself.
223
+ */
224
+ function resolveCodexAuthCacheNamedLockDir(env = process.env, companyId, lockName) {
225
+ const safeCompanyId = toSafePathSegment(companyId, "companyId");
226
+ const instanceRoot = resolvePaperclipInstanceRootForAdapter({
227
+ homeDir: nonEmpty(env.PAPERCLIP_HOME) ?? undefined,
228
+ instanceId: nonEmpty(env.PAPERCLIP_INSTANCE_ID) ?? undefined,
229
+ env,
230
+ });
231
+ return path.resolve(instanceRoot, "companies", safeCompanyId, lockName);
232
+ }
233
+ /**
234
+ * Serializes one company's whole device-login promotion sequence: the
235
+ * account-home directory create-or-reuse decision, the credential write, and
236
+ * the secret bind or cleanup that follows. Two different logins for the SAME
237
+ * Codex account run this sequence one at a time under this lock, so no login
238
+ * can decide to delete the shared account-home directory while another
239
+ * login's flow is still mid-way through writing its credential or binding
240
+ * its own secret to that same directory.
241
+ *
242
+ * `ensureCodexAuthCacheEntryDirExclusive` alone is not enough: it locks only
243
+ * the short directory-creation step, so its lock is already released by the
244
+ * time a login reaches the secret bind. A second login can then write its
245
+ * credential and be about to bind its own secret while the first login's
246
+ * later, unrelated secret-write failure decides to remove the directory both
247
+ * logins now share, deleting a credential home the second login still needs.
248
+ * Holding this lock across the full sequence for every login closes that
249
+ * window: a login that must clean up its own directory always finishes that
250
+ * cleanup, including the directory-recreation of any later login that lands
251
+ * on the now-empty slot, before the next login's sequence starts.
252
+ */
253
+ export async function withCodexAccountHomePromotionLock(env = process.env, companyId, fn) {
254
+ const lockDir = resolveCodexAuthCacheNamedLockDir(env, companyId, "codex-auth-cache-promotion-lock");
255
+ await ensurePrivateDir(lockDir);
256
+ return withDirectoryMergeLock(lockDir, fn, env);
257
+ }
258
+ /**
259
+ * Serializes one company's writes to the literal value of any
260
+ * `local_encrypted` company secret against the account-home cleanup's
261
+ * claimant scan in {@link withCodexAccountHomePromotionLock}'s caller. Only a
262
+ * `local_encrypted` secret can hold a literal directory path, so this is the
263
+ * one provider a cleanup claimant scan must trust. Without this lock, a
264
+ * secret create or rotation can commit its new value after the scan's last
265
+ * pass finds no claimant but before the cleanup deletes the directory: the
266
+ * scan and the write never observe each other, so the write's new value
267
+ * survives past a directory the delete has already removed.
268
+ *
269
+ * The secrets service holds this lock for the full duration of a
270
+ * `local_encrypted` secret's create or rotate call. A cleanup claimant scan
271
+ * holds it for the full duration of its final check-and-delete step. The two
272
+ * critical sections can then never interleave: a write that starts first
273
+ * finishes (and becomes visible to the scan) before the scan's lock-holding
274
+ * check runs, and a write that starts after the scan's lock-holding check
275
+ * finishes only commits once the scan (and any delete it decided on) is
276
+ * done, so it can never name a directory the delete just removed without the
277
+ * scan having had a chance to see it first.
278
+ *
279
+ * This is a separate lock directory from
280
+ * {@link withCodexAccountHomePromotionLock}'s, so a device-login promotion
281
+ * (which holds that lock for its whole sequence, including its own secret
282
+ * create) can still call into a secrets-service write that takes this lock
283
+ * without deadlocking on itself.
284
+ */
285
+ // An outer credential transaction acquires this lock before database row locks.
286
+ // Nested secret-service writes must share that ownership, not acquire it again.
287
+ // Expire ownership on return so detached work cannot inherit a released lock.
288
+ const secretMutationOwnership = new AsyncLocalStorage();
289
+ export async function withAccountHomeSecretMutationLock(env = process.env, companyId, fn) {
290
+ const lockDir = resolveCodexAuthCacheNamedLockDir(env, companyId, "codex-account-home-secret-mutation-lock");
291
+ await ensurePrivateDir(lockDir);
292
+ const key = await realpath(lockDir);
293
+ const inherited = secretMutationOwnership.getStore();
294
+ if (inherited?.get(key)?.active)
295
+ return fn();
296
+ return withDirectoryMergeLock(lockDir, async () => {
297
+ const ownership = { active: true };
298
+ const scope = new Map(inherited);
299
+ scope.set(key, ownership);
300
+ try {
301
+ return await secretMutationOwnership.run(scope, fn);
302
+ }
303
+ finally {
304
+ ownership.active = false;
305
+ }
306
+ }, env);
307
+ }
308
+ /**
309
+ * Confirms a `local_encrypted` secret value that names a directory under this
310
+ * company's Codex account-home cache root still exists on disk. Call this
311
+ * inside {@link withAccountHomeSecretMutationLock}, before a create or a
312
+ * rotate commits the value.
313
+ *
314
+ * The lock alone stops a write and the account-home cleanup's
315
+ * check-and-delete from interleaving; it does not stop them from running in
316
+ * either order. When the cleanup's check-and-delete runs first — it finds no
317
+ * secret names the directory, because this write had not committed yet, and
318
+ * removes the directory — a write that was only queued behind the lock still
319
+ * goes on, once the lock frees, to commit the very directory the cleanup
320
+ * just removed. That would leave an active secret naming a directory that
321
+ * does not exist. This check closes that window: a write whose value would
322
+ * name a directory the cleanup already removed fails instead of committing.
323
+ *
324
+ * A value outside this company's cache root is left alone. Only a value
325
+ * under the cache root can ever be an account-home directory, so this never
326
+ * rejects an unrelated `local_encrypted` secret write, such as an API key or
327
+ * a hand-typed token.
328
+ */
329
+ export async function assertAccountHomeCacheDirStillValid(env = process.env, companyId, value) {
330
+ const cacheRoot = resolveCodexAuthCacheDir(env, companyId);
331
+ if (!value.startsWith(cacheRoot + path.sep))
332
+ return;
333
+ const exists = await lstat(value)
334
+ .then(() => true)
335
+ .catch((error) => {
336
+ if (error.code === "ENOENT")
337
+ return false;
338
+ throw error;
339
+ });
340
+ if (!exists) {
341
+ throw new Error("codex auth cache: account-home directory no longer exists; refusing to write a secret that names it");
342
+ }
343
+ }
344
+ /**
345
+ * Reads the usable subscription `account_id` from an `auth.json` payload. Returns
346
+ * `null` for an absent, unusable, or api-key credential (no subscription
347
+ * identity). This mirrors `parseAuth` in `codex-auth-merge-decision.cjs`; keep
348
+ * the two in step when the auth format changes.
349
+ *
350
+ * The returned value is the exact, untrimmed `account_id` string. A caller
351
+ * passes it on to {@link toAccountHandle} unchanged: that function is the
352
+ * one place that decides whether surrounding whitespace is acceptable, and it
353
+ * must see the raw value to reject an identifier that differs from another
354
+ * one only by whitespace. Trimming here, before that check runs, would let
355
+ * two distinct identifiers collapse onto the same account handle.
356
+ */
357
+ export function readSubscriptionAccountId(bytes) {
358
+ let parsed;
359
+ try {
360
+ parsed = JSON.parse(bytes.toString("utf8"));
361
+ }
362
+ catch {
363
+ return null;
364
+ }
365
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
366
+ return null;
367
+ }
368
+ const record = parsed;
369
+ const apiKey = record.OPENAI_API_KEY;
370
+ if (typeof apiKey === "string" && apiKey.trim().length > 0) {
371
+ return null;
372
+ }
373
+ const tokens = record.tokens;
374
+ if (tokens === null || typeof tokens !== "object" || Array.isArray(tokens)) {
375
+ return null;
376
+ }
377
+ const tokenRecord = tokens;
378
+ const rawAccountId = typeof tokenRecord.account_id === "string" ? tokenRecord.account_id : "";
379
+ // A blank-or-whitespace-only value is absent; a value with real content
380
+ // keeps its exact, untrimmed form.
381
+ const accountId = rawAccountId.trim().length > 0 ? rawAccountId : "";
382
+ const hasTokenMaterial = ["id_token", "access_token", "refresh_token"].some((key) => {
383
+ const value = tokenRecord[key];
384
+ return typeof value === "string" && value.trim().length > 0;
385
+ });
386
+ if (!accountId || !hasTokenMaterial) {
387
+ return null;
388
+ }
389
+ return accountId;
390
+ }
391
+ /**
392
+ * Writes `sandboxAuthBytes` into its per-identity cache slot when the slot is
393
+ * absent, or when the source is a strictly-newer same-identity subscription
394
+ * credential (seed mode). The mutation runs under the merge lock on the slot
395
+ * directory, through the shared {@link writeCredentialSeedOrNewer} writer. Never
396
+ * logs token bytes or a raw `account_id`.
397
+ */
398
+ export async function writeCodexAuthCacheEntry(input) {
399
+ const outcome = await writeCredentialSeedOrNewer({
400
+ sourceBytes: input.sandboxAuthBytes,
401
+ destinationPath: input.cacheEntryPath,
402
+ seedIfDestAbsent: true,
403
+ log: input.log,
404
+ writtenLine: "[paperclip] Codex auth cache: wrote the per-identity cache slot at mode 0600.",
405
+ keptLine: "[paperclip] Codex auth cache: kept the cache slot (source is not a strictly-newer same-identity subscription credential).",
406
+ tempPrefix: "auth.json.cache-source",
407
+ errorLabel: "codex auth cache",
408
+ env: input.env,
409
+ });
410
+ return outcome === "written" ? "written" : "kept-slot";
411
+ }
412
+ /**
413
+ * Refreshes the identity the host already holds with a strictly-newer cached
414
+ * credential of the same `account_id`. Identity-anchored:
415
+ *
416
+ * 1. Read the host identity from `sharedHomeAuthPath` first.
417
+ * 2. When the host holds no usable subscription identity, do nothing. The vend
418
+ * never picks a credential from the cache at random (matrix rows 3, 4).
419
+ * 3. Resolve ONLY that exact identity's cache slot. The vend never scans the
420
+ * cache root. (Security condition 4.)
421
+ * 4. Run the DEFAULT-mode predicate (cache slot as source, shared home as
422
+ * destination). Install the cache copy only when it is strictly newer for the
423
+ * same identity.
424
+ *
425
+ * The vend never changes identity and never stages a spent single-use refresh
426
+ * token (the strictly-newer rule guards it). Never logs token bytes or a raw
427
+ * `account_id`.
428
+ */
429
+ export async function selectVendCredential(sharedHomeAuthPath, resolveCacheEntryPath, log, env = process.env) {
430
+ const hostBytes = await readFile(sharedHomeAuthPath).catch((error) => {
431
+ if (error.code === "ENOENT")
432
+ return null;
433
+ throw error;
434
+ });
435
+ const hostAccountId = hostBytes ? readSubscriptionAccountId(hostBytes) : null;
436
+ if (!hostAccountId) {
437
+ // No host identity: the vend does nothing (identity-anchor rule).
438
+ return "no-host-identity";
439
+ }
440
+ let cacheEntryPath;
441
+ try {
442
+ cacheEntryPath = resolveCacheEntryPath(hostAccountId);
443
+ }
444
+ catch {
445
+ // A host identity that cannot form a safe cache key never vends.
446
+ return "no-host-identity";
447
+ }
448
+ const hostDir = path.dirname(sharedHomeAuthPath);
449
+ return withDirectoryMergeLock(hostDir, async () => {
450
+ // Read the cached bytes under the lock, then stage exactly those bytes into a
451
+ // private (0600) temp next to the host target. The predicate reads the temp,
452
+ // so the vend installs exactly the bytes the predicate approved. This closes
453
+ // the read-after-validate skew: a separate reader of `cacheEntryPath` could
454
+ // otherwise see different bytes than the ones installed. The rename over the
455
+ // host target stays device-local and atomic.
456
+ const cacheBytes = await readFile(cacheEntryPath).catch((error) => {
457
+ if (error.code === "ENOENT")
458
+ return null;
459
+ throw error;
460
+ });
461
+ if (!cacheBytes) {
462
+ await log("[paperclip] Codex auth cache: no cached credential for the host identity; host credential kept.");
463
+ return "kept-host";
464
+ }
465
+ const stagedTempPath = path.join(hostDir, `.auth.json.vend-${process.pid}-${randomUUID()}.tmp`);
466
+ const handle = await open(stagedTempPath, "wx", 0o600);
467
+ try {
468
+ await handle.writeFile(cacheBytes);
469
+ await handle.close();
470
+ // Default-mode predicate: install the cache copy only when it is strictly
471
+ // newer for the SAME identity. Same-identity + strictly-newer keeps the
472
+ // change additive and semantics-preserving.
473
+ const decision = await decideCodexAuthMerge(stagedTempPath, sharedHomeAuthPath, {
474
+ errorLabel: "codex auth cache",
475
+ });
476
+ if (decision === USE_SOURCE_EXIT) {
477
+ await rename(stagedTempPath, sharedHomeAuthPath);
478
+ await log("[paperclip] Codex auth cache: refreshed the host credential with a strictly-newer cached copy of the same identity at mode 0600.");
479
+ return "vended";
480
+ }
481
+ await log("[paperclip] Codex auth cache: host credential kept (the cached copy is not strictly newer for the same identity).");
482
+ return "kept-host";
483
+ }
484
+ finally {
485
+ await handle.close().catch(() => undefined);
486
+ await rm(stagedTempPath, { force: true }).catch(() => undefined);
487
+ }
488
+ }, env);
489
+ }
490
+ /**
491
+ * Removes exactly one identity slot from the cache. The `account_id` is
492
+ * sanitized by {@link toCacheKey}, so the removal can never escape the cache
493
+ * root. A missing slot is a benign no-op. Any other removal error is fail-loud.
494
+ */
495
+ export async function clearCodexAuthCacheEntry(env = process.env, accountId, companyId) {
496
+ const entryPath = resolveCodexAuthCacheEntryPath(env, accountId, companyId);
497
+ const entryDir = path.dirname(entryPath);
498
+ // A missing slot is a benign no-op. Pre-check before the lock: the merge lock
499
+ // sits next to the slot under the cache root, so locking a slot whose cache
500
+ // root does not exist would fail on the lock directory itself.
501
+ const existing = await lstat(entryDir).catch((error) => {
502
+ if (error.code === "ENOENT")
503
+ return null;
504
+ throw error;
505
+ });
506
+ if (!existing)
507
+ return;
508
+ await withDirectoryMergeLock(entryDir, async () => {
509
+ await rm(entryDir, { recursive: true, force: true });
510
+ }, env);
511
+ }
512
+ /**
513
+ * Removes every slot in the company-scoped cache root. A missing cache root is a
514
+ * benign no-op.
515
+ */
516
+ export async function clearCodexAuthCache(env = process.env, companyId) {
517
+ const cacheDir = resolveCodexAuthCacheDir(env, companyId);
518
+ await rm(cacheDir, { recursive: true, force: true });
519
+ }
520
+ //# sourceMappingURL=codex-auth-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-auth-cache.js","sourceRoot":"","sources":["../../src/server/codex-auth-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,sCAAsC,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAExE,yEAAyE;A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M,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC,EACD,GAAG,CACJ,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,GAAG,GAAsB,OAAO,CAAC,GAAG,EACpC,SAAiB;IAEjB,MAAM,QAAQ,GAAG,wBAAwB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAC1D,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=codex-auth-cache.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-auth-cache.test.d.ts","sourceRoot":"","sources":["../../src/server/codex-auth-cache.test.ts"],"names":[],"mappings":""}