orizu 0.5.19 → 0.5.21

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 (378) hide show
  1. package/README.md +23 -0
  2. package/dist/archive-artifacts-cli.d.ts +50 -0
  3. package/dist/archive-artifacts-cli.d.ts.map +1 -0
  4. package/dist/artifact-archive.d.ts +48 -0
  5. package/dist/artifact-archive.d.ts.map +1 -0
  6. package/dist/artifact-pull.d.ts +22 -0
  7. package/dist/artifact-pull.d.ts.map +1 -0
  8. package/dist/banner.d.ts +3 -0
  9. package/dist/banner.d.ts.map +1 -0
  10. package/dist/connectors-cli.d.ts +31 -0
  11. package/dist/connectors-cli.d.ts.map +1 -0
  12. package/dist/credentials.d.ts +46 -0
  13. package/dist/credentials.d.ts.map +1 -0
  14. package/dist/csv.d.ts +49 -0
  15. package/dist/csv.d.ts.map +1 -0
  16. package/dist/dataset-download.d.ts +6 -0
  17. package/dist/dataset-download.d.ts.map +1 -0
  18. package/dist/dataset-edit-rows.d.ts +10 -0
  19. package/dist/dataset-edit-rows.d.ts.map +1 -0
  20. package/dist/dataset-upload-snapshot.d.ts +13 -0
  21. package/dist/dataset-upload-snapshot.d.ts.map +1 -0
  22. package/dist/daytona-slice-rehearsal.d.ts +89 -0
  23. package/dist/daytona-slice-rehearsal.d.ts.map +1 -0
  24. package/dist/daytona-slice.d.ts +106 -0
  25. package/dist/daytona-slice.d.ts.map +1 -0
  26. package/dist/deploy-key-merge-core.d.ts +121 -0
  27. package/dist/deploy-key-merge-core.d.ts.map +1 -0
  28. package/dist/diff-comments-cli.d.ts +12 -0
  29. package/dist/diff-comments-cli.d.ts.map +1 -0
  30. package/dist/diff-comments-cli.js +21 -2
  31. package/dist/egress-allowlist-cli.d.ts +23 -0
  32. package/dist/egress-allowlist-cli.d.ts.map +1 -0
  33. package/dist/egress-policy.d.ts +108 -0
  34. package/dist/egress-policy.d.ts.map +1 -0
  35. package/dist/error-response.d.ts +9 -0
  36. package/dist/error-response.d.ts.map +1 -0
  37. package/dist/file-parser.d.ts +5 -0
  38. package/dist/file-parser.d.ts.map +1 -0
  39. package/dist/gepa-engine-dispatch.d.ts +9 -0
  40. package/dist/gepa-engine-dispatch.d.ts.map +1 -0
  41. package/dist/gepa-engine-dispatch.js +307 -0
  42. package/dist/gepa-python-command.d.ts +6 -0
  43. package/dist/gepa-python-command.d.ts.map +1 -0
  44. package/dist/gepa-python-command.js +26 -0
  45. package/dist/gepa-python-paths.d.ts +6 -0
  46. package/dist/gepa-python-paths.d.ts.map +1 -0
  47. package/dist/gepa-python-paths.js +42 -0
  48. package/dist/git-credential.d.ts +69 -0
  49. package/dist/git-credential.d.ts.map +1 -0
  50. package/dist/git-recovery-environment.d.ts +31 -0
  51. package/dist/git-recovery-environment.d.ts.map +1 -0
  52. package/dist/github-setup.d.ts +122 -0
  53. package/dist/github-setup.d.ts.map +1 -0
  54. package/dist/global-flags.d.ts +12 -0
  55. package/dist/global-flags.d.ts.map +1 -0
  56. package/dist/help.d.ts +46 -0
  57. package/dist/help.d.ts.map +1 -0
  58. package/dist/help.js +93 -25
  59. package/dist/hosted-boot.d.ts +273 -0
  60. package/dist/hosted-boot.d.ts.map +1 -0
  61. package/dist/hosted-bootstrap-rehearsal.d.ts +86 -0
  62. package/dist/hosted-bootstrap-rehearsal.d.ts.map +1 -0
  63. package/dist/hosted-bootstrap.d.ts +188 -0
  64. package/dist/hosted-bootstrap.d.ts.map +1 -0
  65. package/dist/hosted-broker-server.d.ts +50 -0
  66. package/dist/hosted-broker-server.d.ts.map +1 -0
  67. package/dist/hosted-git-http-server.d.ts +36 -0
  68. package/dist/hosted-git-http-server.d.ts.map +1 -0
  69. package/dist/hosted-harness-claude.d.ts +195 -0
  70. package/dist/hosted-harness-claude.d.ts.map +1 -0
  71. package/dist/hosted-harness-opencode.d.ts +227 -0
  72. package/dist/hosted-harness-opencode.d.ts.map +1 -0
  73. package/dist/hosted-harness.d.ts +118 -0
  74. package/dist/hosted-harness.d.ts.map +1 -0
  75. package/dist/hosted-harvest.d.ts +68 -0
  76. package/dist/hosted-harvest.d.ts.map +1 -0
  77. package/dist/hosted-headless.d.ts +72 -0
  78. package/dist/hosted-headless.d.ts.map +1 -0
  79. package/dist/hosted-loop-lifecycle.d.ts +206 -0
  80. package/dist/hosted-loop-lifecycle.d.ts.map +1 -0
  81. package/dist/hosted-loop.d.ts +170 -0
  82. package/dist/hosted-loop.d.ts.map +1 -0
  83. package/dist/hosted-run-event-sink.d.ts +222 -0
  84. package/dist/hosted-run-event-sink.d.ts.map +1 -0
  85. package/dist/hosted-runtime-assets.d.ts +186 -0
  86. package/dist/hosted-runtime-assets.d.ts.map +1 -0
  87. package/dist/hosted-session-cli.d.ts +258 -0
  88. package/dist/hosted-session-cli.d.ts.map +1 -0
  89. package/dist/hosted-skill-staging.d.ts +73 -0
  90. package/dist/hosted-skill-staging.d.ts.map +1 -0
  91. package/dist/http.d.ts +8 -0
  92. package/dist/http.d.ts.map +1 -0
  93. package/dist/index.d.ts +22 -0
  94. package/dist/index.d.ts.map +1 -0
  95. package/dist/index.js +119 -129
  96. package/dist/instruction-set-gepa-launch.d.ts +3 -0
  97. package/dist/instruction-set-gepa-launch.d.ts.map +1 -0
  98. package/dist/instruction-set-gepa-launch.js +15 -0
  99. package/dist/instruction-set-loader.d.ts +6 -0
  100. package/dist/instruction-set-loader.d.ts.map +1 -0
  101. package/dist/instruction-set-loader.js +59 -0
  102. package/dist/instruction-set-manifest.d.ts +14 -0
  103. package/dist/instruction-set-manifest.d.ts.map +1 -0
  104. package/dist/instruction-set-manifest.js +162 -0
  105. package/dist/instruction-sets-cli.d.ts +40 -0
  106. package/dist/instruction-sets-cli.d.ts.map +1 -0
  107. package/dist/instruction-sets-cli.js +361 -0
  108. package/dist/json-response.d.ts +4 -0
  109. package/dist/json-response.d.ts.map +1 -0
  110. package/dist/jsonl-stream.d.ts +8 -0
  111. package/dist/jsonl-stream.d.ts.map +1 -0
  112. package/dist/kill-switch-cli.d.ts +30 -0
  113. package/dist/kill-switch-cli.d.ts.map +1 -0
  114. package/dist/loopback-serve.d.ts +25 -0
  115. package/dist/loopback-serve.d.ts.map +1 -0
  116. package/dist/manifests-cli.d.ts +22 -0
  117. package/dist/manifests-cli.d.ts.map +1 -0
  118. package/dist/markdown-report-input.d.ts +7 -0
  119. package/dist/markdown-report-input.d.ts.map +1 -0
  120. package/dist/markdown-report-input.js +15 -1
  121. package/dist/merge-job.d.ts +155 -0
  122. package/dist/merge-job.d.ts.map +1 -0
  123. package/dist/model-configs-cli.d.ts +19 -0
  124. package/dist/model-configs-cli.d.ts.map +1 -0
  125. package/dist/model-configs-cli.js +104 -0
  126. package/dist/optimization-export-cli.d.ts +19 -0
  127. package/dist/optimization-export-cli.d.ts.map +1 -0
  128. package/dist/optimizations-list-cli.d.ts +20 -0
  129. package/dist/optimizations-list-cli.d.ts.map +1 -0
  130. package/dist/optimizations-promote-cli.d.ts +8 -0
  131. package/dist/optimizations-promote-cli.d.ts.map +1 -0
  132. package/dist/optimizations-promote-cli.js +34 -0
  133. package/dist/option-validation.d.ts +15 -0
  134. package/dist/option-validation.d.ts.map +1 -0
  135. package/dist/preview-runtime.d.ts +63 -0
  136. package/dist/preview-runtime.d.ts.map +1 -0
  137. package/dist/prompt-draft-push.d.ts +60 -0
  138. package/dist/prompt-draft-push.d.ts.map +1 -0
  139. package/dist/prompt-label-cli.d.ts +11 -0
  140. package/dist/prompt-label-cli.d.ts.map +1 -0
  141. package/dist/prompt-label-cli.js +29 -0
  142. package/dist/prompt-length-wire.d.ts +28 -0
  143. package/dist/prompt-length-wire.d.ts.map +1 -0
  144. package/dist/prompt-length-wire.js +2 -2
  145. package/dist/prompt-report-cli.d.ts +10 -0
  146. package/dist/prompt-report-cli.d.ts.map +1 -0
  147. package/dist/prompt-report-cli.js +2 -2
  148. package/dist/prompt-summary-table.d.ts +15 -0
  149. package/dist/prompt-summary-table.d.ts.map +1 -0
  150. package/dist/prompt-summary-table.js +6 -0
  151. package/dist/registration-tag-warning.d.ts +32 -0
  152. package/dist/registration-tag-warning.d.ts.map +1 -0
  153. package/dist/report-comments-cli.d.ts +16 -0
  154. package/dist/report-comments-cli.d.ts.map +1 -0
  155. package/dist/report-markdown-blankness.d.ts +2 -0
  156. package/dist/report-markdown-blankness.d.ts.map +1 -0
  157. package/dist/report-markdown-blankness.js +6 -0
  158. package/dist/report-replacement-warning.d.ts +17 -0
  159. package/dist/report-replacement-warning.d.ts.map +1 -0
  160. package/dist/report-replacement-warning.js +31 -0
  161. package/dist/repository-backup-core.d.ts +225 -0
  162. package/dist/repository-backup-core.d.ts.map +1 -0
  163. package/dist/repository-recovery-manifest.d.ts +83 -0
  164. package/dist/repository-recovery-manifest.d.ts.map +1 -0
  165. package/dist/run-event-digest.d.ts +74 -0
  166. package/dist/run-event-digest.d.ts.map +1 -0
  167. package/dist/runner-dir-verify.d.ts +66 -0
  168. package/dist/runner-dir-verify.d.ts.map +1 -0
  169. package/dist/runner-instruction-set-contract.d.ts +24 -0
  170. package/dist/runner-instruction-set-contract.d.ts.map +1 -0
  171. package/dist/runner-instruction-set-contract.js +50 -0
  172. package/dist/sandbox-hygiene.d.ts +45 -0
  173. package/dist/sandbox-hygiene.d.ts.map +1 -0
  174. package/dist/sandbox-provider.d.ts +193 -0
  175. package/dist/sandbox-provider.d.ts.map +1 -0
  176. package/dist/scorer-draft-push.d.ts +50 -0
  177. package/dist/scorer-draft-push.d.ts.map +1 -0
  178. package/dist/scorers-cli.d.ts +20 -0
  179. package/dist/scorers-cli.d.ts.map +1 -0
  180. package/dist/scorers-cli.js +22 -0
  181. package/dist/scorers-verify-parity-bridge.d.ts +16 -0
  182. package/dist/scorers-verify-parity-bridge.d.ts.map +1 -0
  183. package/dist/scorers-verify-parity-bridge.js +90 -0
  184. package/dist/scorers-verify-parity.d.ts +81 -0
  185. package/dist/scorers-verify-parity.d.ts.map +1 -0
  186. package/dist/scorers-verify-parity.js +502 -0
  187. package/dist/scores-accept-cli.d.ts +21 -0
  188. package/dist/scores-accept-cli.d.ts.map +1 -0
  189. package/dist/secret-redaction.d.ts +47 -0
  190. package/dist/secret-redaction.d.ts.map +1 -0
  191. package/dist/session-timeline.d.ts +54 -0
  192. package/dist/session-timeline.d.ts.map +1 -0
  193. package/dist/setup-prompt.d.ts +5 -0
  194. package/dist/setup-prompt.d.ts.map +1 -0
  195. package/dist/skill-installer.d.ts +68 -0
  196. package/dist/skill-installer.d.ts.map +1 -0
  197. package/dist/skilled-proposer-launch.d.ts +7 -0
  198. package/dist/skilled-proposer-launch.d.ts.map +1 -0
  199. package/dist/skilled-proposer-launch.js +60 -0
  200. package/dist/smoke.d.ts +102 -0
  201. package/dist/smoke.d.ts.map +1 -0
  202. package/dist/start-intent.d.ts +12 -0
  203. package/dist/start-intent.d.ts.map +1 -0
  204. package/dist/task-assignment-manifest.d.ts +15 -0
  205. package/dist/task-assignment-manifest.d.ts.map +1 -0
  206. package/dist/task-create-error.d.ts +18 -0
  207. package/dist/task-create-error.d.ts.map +1 -0
  208. package/dist/team-connectors-cli.d.ts +29 -0
  209. package/dist/team-connectors-cli.d.ts.map +1 -0
  210. package/dist/types.d.ts +39 -0
  211. package/dist/types.d.ts.map +1 -0
  212. package/dist/vercel-sandbox-provider.d.ts +156 -0
  213. package/dist/vercel-sandbox-provider.d.ts.map +1 -0
  214. package/dist/workbench-cli.d.ts +233 -0
  215. package/dist/workbench-cli.d.ts.map +1 -0
  216. package/dist/workspace-sync.d.ts +207 -0
  217. package/dist/workspace-sync.d.ts.map +1 -0
  218. package/dist/workspace.d.ts +92 -0
  219. package/dist/workspace.d.ts.map +1 -0
  220. package/dist/zip-draft-push.d.ts +55 -0
  221. package/dist/zip-draft-push.d.ts.map +1 -0
  222. package/package.json +15 -2
  223. package/requirements/README.md +138 -0
  224. package/requirements/skilled-proposer.in +66 -0
  225. package/requirements/skilled-proposer.lock +265 -0
  226. package/scripts/build-cli-dist.mjs +30 -0
  227. package/scripts/ensure-skilled-proposer-venv.mjs +5 -0
  228. package/scripts/orizu-source-checkout.d.mts +1 -0
  229. package/scripts/orizu-source-checkout.mjs +10 -0
  230. package/scripts/refresh-skilled-proposer-lock.mjs +256 -0
  231. package/scripts/vendor-gepa-python.mjs +187 -4
  232. package/src/diff-comments-cli.ts +41 -3
  233. package/src/gepa-engine-dispatch.ts +340 -0
  234. package/src/gepa-python-command.ts +31 -0
  235. package/src/gepa-python-paths.ts +56 -0
  236. package/src/help.ts +95 -25
  237. package/src/index.ts +131 -166
  238. package/src/instruction-set-gepa-launch.ts +28 -0
  239. package/src/instruction-set-loader.ts +37 -0
  240. package/src/instruction-set-manifest.ts +120 -0
  241. package/src/instruction-sets-cli.ts +306 -0
  242. package/src/markdown-report-input.ts +19 -1
  243. package/src/model-configs-cli.ts +119 -0
  244. package/src/optimizations-promote-cli.ts +41 -0
  245. package/src/prompt-label-cli.ts +55 -0
  246. package/src/prompt-length-wire.ts +1 -1
  247. package/src/prompt-report-cli.ts +2 -2
  248. package/src/prompt-summary-table.ts +12 -0
  249. package/src/report-markdown-blankness.ts +6 -0
  250. package/src/report-replacement-warning.ts +35 -0
  251. package/src/runner-instruction-set-contract.ts +64 -0
  252. package/src/scorers-cli.ts +40 -0
  253. package/src/scorers-verify-parity-bridge.ts +90 -0
  254. package/src/scorers-verify-parity.ts +564 -0
  255. package/src/skilled-proposer-launch.ts +89 -0
  256. package/src/skilled-proposer-venv-manager.mjs +757 -0
  257. package/tsconfig.json +2 -0
  258. package/vendor/gepa-python/LICENSE +7 -0
  259. package/vendor/gepa-python/manifest.json +107 -0
  260. package/vendor/gepa-python/src/gepa/__init__.py +22 -0
  261. package/vendor/gepa-python/src/gepa/adapters/__init__.py +0 -0
  262. package/vendor/gepa-python/src/gepa/adapters/anymaths_adapter/__init__.py +1 -0
  263. package/vendor/gepa-python/src/gepa/adapters/anymaths_adapter/anymaths_adapter.py +174 -0
  264. package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/__init__.py +26 -0
  265. package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/confidence_adapter.py +618 -0
  266. package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/scoring.py +206 -0
  267. package/vendor/gepa-python/src/gepa/adapters/default_adapter/__init__.py +0 -0
  268. package/vendor/gepa-python/src/gepa/adapters/default_adapter/default_adapter.py +206 -0
  269. package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/__init__.py +0 -0
  270. package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/dspy_adapter.py +525 -0
  271. package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/instruction_proposal.py +500 -0
  272. package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/__init__.py +6 -0
  273. package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/dspy_program_proposal_signature.py +137 -0
  274. package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/full_program_adapter.py +269 -0
  275. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/__init__.py +56 -0
  276. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/evaluation_metrics.py +226 -0
  277. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/generic_rag_adapter.py +496 -0
  278. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/rag_pipeline.py +238 -0
  279. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_store_interface.py +212 -0
  280. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/__init__.py +2 -0
  281. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/chroma_store.py +196 -0
  282. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/lancedb_store.py +422 -0
  283. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/milvus_store.py +409 -0
  284. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/qdrant_store.py +368 -0
  285. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/weaviate_store.py +418 -0
  286. package/vendor/gepa-python/src/gepa/adapters/langchain_adapter/__init__.py +11 -0
  287. package/vendor/gepa-python/src/gepa/adapters/langchain_adapter/langchain_adapter.py +261 -0
  288. package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/__init__.py +37 -0
  289. package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/mcp_adapter.py +693 -0
  290. package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/mcp_client.py +364 -0
  291. package/vendor/gepa-python/src/gepa/adapters/optimize_anything_adapter/optimize_anything_adapter.py +879 -0
  292. package/vendor/gepa-python/src/gepa/adapters/terminal_bench_adapter/__init__.py +0 -0
  293. package/vendor/gepa-python/src/gepa/adapters/terminal_bench_adapter/terminal_bench_adapter.py +217 -0
  294. package/vendor/gepa-python/src/gepa/api.py +468 -0
  295. package/vendor/gepa-python/src/gepa/core/__init__.py +0 -0
  296. package/vendor/gepa-python/src/gepa/core/adapter.py +227 -0
  297. package/vendor/gepa-python/src/gepa/core/callbacks.py +551 -0
  298. package/vendor/gepa-python/src/gepa/core/data_loader.py +74 -0
  299. package/vendor/gepa-python/src/gepa/core/engine.py +1025 -0
  300. package/vendor/gepa-python/src/gepa/core/result.py +271 -0
  301. package/vendor/gepa-python/src/gepa/core/state.py +706 -0
  302. package/vendor/gepa-python/src/gepa/examples/__init__.py +0 -0
  303. package/vendor/gepa-python/src/gepa/examples/aime.py +24 -0
  304. package/vendor/gepa-python/src/gepa/examples/anymaths-bench/eval_default.py +111 -0
  305. package/vendor/gepa-python/src/gepa/examples/anymaths-bench/train_anymaths.py +177 -0
  306. package/vendor/gepa-python/src/gepa/examples/mcp_adapter/__init__.py +4 -0
  307. package/vendor/gepa-python/src/gepa/examples/mcp_adapter/mcp_optimization_example.py +456 -0
  308. package/vendor/gepa-python/src/gepa/examples/rag_adapter/__init__.py +9 -0
  309. package/vendor/gepa-python/src/gepa/examples/rag_adapter/rag_optimization.py +824 -0
  310. package/vendor/gepa-python/src/gepa/examples/terminal-bench/train_terminus.py +161 -0
  311. package/vendor/gepa-python/src/gepa/gepa_utils.py +117 -0
  312. package/vendor/gepa-python/src/gepa/gskill/__init__.py +1 -0
  313. package/vendor/gepa-python/src/gepa/gskill/gskill/__init__.py +0 -0
  314. package/vendor/gepa-python/src/gepa/gskill/gskill/cost_tracker.py +194 -0
  315. package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/__init__.py +0 -0
  316. package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/claude_code.py +1117 -0
  317. package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/claude_code_skills.py +613 -0
  318. package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/mini_swe_agent.py +440 -0
  319. package/vendor/gepa-python/src/gepa/gskill/gskill/experiment_logger.py +367 -0
  320. package/vendor/gepa-python/src/gepa/gskill/gskill/swe_fitness_fn.py +209 -0
  321. package/vendor/gepa-python/src/gepa/gskill/gskill/swe_harness.py +352 -0
  322. package/vendor/gepa-python/src/gepa/gskill/gskill/train_optimize_anything.py +830 -0
  323. package/vendor/gepa-python/src/gepa/image.py +104 -0
  324. package/vendor/gepa-python/src/gepa/lm.py +261 -0
  325. package/vendor/gepa-python/src/gepa/logging/__init__.py +0 -0
  326. package/vendor/gepa-python/src/gepa/logging/experiment_tracker.py +457 -0
  327. package/vendor/gepa-python/src/gepa/logging/logger.py +75 -0
  328. package/vendor/gepa-python/src/gepa/logging/utils.py +130 -0
  329. package/vendor/gepa-python/src/gepa/optimize_anything.py +1701 -0
  330. package/vendor/gepa-python/src/gepa/proposer/__init__.py +0 -0
  331. package/vendor/gepa-python/src/gepa/proposer/base.py +53 -0
  332. package/vendor/gepa-python/src/gepa/proposer/merge.py +403 -0
  333. package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/__init__.py +0 -0
  334. package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/base.py +64 -0
  335. package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/reflection_lm.py +178 -0
  336. package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/reflective_mutation.py +641 -0
  337. package/vendor/gepa-python/src/gepa/py.typed +0 -0
  338. package/vendor/gepa-python/src/gepa/strategies/__init__.py +0 -0
  339. package/vendor/gepa-python/src/gepa/strategies/acceptance.py +66 -0
  340. package/vendor/gepa-python/src/gepa/strategies/batch_sampler.py +103 -0
  341. package/vendor/gepa-python/src/gepa/strategies/candidate_selector.py +82 -0
  342. package/vendor/gepa-python/src/gepa/strategies/component_selector.py +36 -0
  343. package/vendor/gepa-python/src/gepa/strategies/eval_policy.py +64 -0
  344. package/vendor/gepa-python/src/gepa/strategies/instruction_proposal.py +153 -0
  345. package/vendor/gepa-python/src/gepa/strategies/proposal_sampling.py +128 -0
  346. package/vendor/gepa-python/src/gepa/strategies/proposal_selection.py +84 -0
  347. package/vendor/gepa-python/src/gepa/utils/__init__.py +63 -0
  348. package/vendor/gepa-python/src/gepa/utils/code_execution.py +626 -0
  349. package/vendor/gepa-python/src/gepa/utils/stdio_capture.py +145 -0
  350. package/vendor/gepa-python/src/gepa/utils/stop_condition.py +230 -0
  351. package/vendor/gepa-python/src/gepa/visualization.py +359 -0
  352. package/vendor/orizu-gepa/pyproject.toml +18 -0
  353. package/vendor/orizu-gepa/src/orizu_gepa_connector/__init__.py +9 -0
  354. package/vendor/orizu-gepa/src/orizu_gepa_connector/__main__.py +5 -0
  355. package/vendor/orizu-gepa/src/orizu_gepa_connector/adapter.py +138 -0
  356. package/vendor/orizu-gepa/src/orizu_gepa_connector/callbacks.py +666 -0
  357. package/vendor/orizu-gepa/src/orizu_gepa_connector/cli.py +7 -0
  358. package/vendor/orizu-gepa/src/orizu_gepa_connector/engine.py +269 -0
  359. package/vendor/orizu-gepa/src/orizu_gepa_connector/instruction_set_loader.py +52 -0
  360. package/vendor/orizu-gepa/src/orizu_gepa_connector/preflight.py +64 -0
  361. package/vendor/orizu-gepa/src/orizu_gepa_connector/reflection.py +186 -0
  362. package/vendor/orizu-gepa/src/orizu_gepa_connector/runtime.py +721 -0
  363. package/vendor/orizu-gepa/src/orizu_gepa_connector/skilled_proposer_bridge.py +381 -0
  364. package/vendor/orizu-gepa/src/orizu_gepa_connector/stop_conditions.py +55 -0
  365. package/vendor/orizu-gepa/src/orizu_gepa_connector/translator.py +203 -0
  366. package/vendor/orizu-gepa-python/pyproject.toml +1 -1
  367. package/vendor/orizu-gepa-python/src/orizu_gepa/cli.py +1 -0
  368. package/vendor/orizu-gepa-python/src/orizu_gepa/client.py +52 -7
  369. package/vendor/orizu-gepa-python/src/orizu_gepa/local_log.py +52 -0
  370. package/vendor/orizu-gepa-python/src/orizu_gepa/optimizer.py +10 -5
  371. package/vendor/orizu-gepa-python/src/orizu_gepa/reflection.py +323 -68
  372. package/vendor/orizu-gepa-python/src/orizu_gepa/runner.py +207 -13
  373. package/vendor/skills/orizu-cli/SKILL.md +3 -1
  374. package/vendor/skills/orizu-cli/references/cli-reference.md +85 -1
  375. package/vendor/skills/orizu-cli/references/migrate-existing-gepa-setup.md +303 -0
  376. package/vendor/skills/orizu-cli/references/optimization-reports.md +1 -1
  377. package/vendor/skills/orizu-cli/references/optimization-with-gepa.md +26 -1
  378. package/vendor/skills/orizu-cli/references/prompt-control-plane.md +113 -10
@@ -0,0 +1,186 @@
1
+ /**
2
+ * In-sandbox runtime assets for the hosted bootstrap (ALI-925, per ADR-005).
3
+ *
4
+ * Ports the DESIGN — not the code — of OpenInspect's
5
+ * `sandbox_runtime/credentials/git_credential_helper.py` into a self-contained
6
+ * script asset that Orizu writes into the sandbox and registers as a git
7
+ * `credential.helper`. On every git op git spawns the script; the script mints a
8
+ * fresh, downscoped, audited token from Orizu's per-repo broker
9
+ * (`POST /api/cli/workspaces/{id}/repo-token`) and hands it to git, caching to a
10
+ * 0600 run-scoped file with an expiry-refresh buffer. It NEVER echoes the token
11
+ * and reads the bearer only from a run-scoped 0600 file (G3): the bearer is
12
+ * never baked into git config, the clone URL, or any long-lived file.
13
+ *
14
+ * Deliberately self-contained (no `orizu` package import) so it works even when
15
+ * the CLI-install step fails — the credential path must not depend on it. The
16
+ * script is emitted as CommonJS (`.cjs`) so it runs unchanged under both `node`
17
+ * (>=18, for global `fetch`) and `bun`, whichever the sandbox image ships.
18
+ *
19
+ * The boot context is split so no secret lands in a value git persists:
20
+ * - `boot.json` — non-secret config + the PATHS of the bearer/cache files;
21
+ * - `<bearer>` — the Orizu bearer, 0600, run-scoped, reaped at teardown;
22
+ * - `<cache>` — the minted repo token, 0600, written by the script itself.
23
+ * git config holds only `credential.helper = !<runtime> <script> <boot.json>`.
24
+ */
25
+ export declare const HELPER_SCRIPT_BASENAME = "orizu-git-credential-helper.cjs";
26
+ export declare const BOOT_CONTEXT_BASENAME = "boot.json";
27
+ export declare const BEARER_BASENAME = "bearer";
28
+ export declare const REPO_CRED_CACHE_BASENAME = "repo-cred.json";
29
+ /** Refresh a cached token this long before its stated expiry (5 minutes). */
30
+ export declare const DEFAULT_CACHE_REFRESH_BUFFER_MS: number;
31
+ /** Customer setup hook path, relative to the repo root (mirrors OpenInspect's
32
+ * `.openinspect/setup.sh` — fresh-boot only, non-fatal, output captured). */
33
+ export declare const SETUP_HOOK_RELATIVE_PATH = ".orizu/setup.sh";
34
+ /**
35
+ * The git author identity for hosted-agent commits. Bootstrap configures it
36
+ * repo-LOCAL in the sandbox clone (never --global) so agent `git commit` works
37
+ * out of the box — the sandbox has no ambient identity and commits died with
38
+ * "Author identity unknown" (ALI-1036, found live in QA-3). The loop uses the
39
+ * same identity for run-event attribution; keep them identical.
40
+ */
41
+ export declare const AGENT_GIT_IDENTITY: {
42
+ readonly name: "Orizu Agent";
43
+ readonly email: "agent@orizu.ai";
44
+ };
45
+ /**
46
+ * Standing preamble wrapped around every hosted task prompt so a NATURAL task
47
+ * ("review X and update the readme") runs unattended with zero magic words. The
48
+ * agent is told to work autonomously (never block on the human), commit as it
49
+ * goes, and treat Orizu — not the repo — as the home for production pointers and
50
+ * run metadata. An end-of-run auto-harvest (ALI-1036, `harvestWorkspace`) is the
51
+ * safety net for anything left uncommitted; the preamble names it so the agent
52
+ * knows partial work is preserved.
53
+ */
54
+ export declare const HOSTED_TASK_PREAMBLE: string;
55
+ /** Delimiter separating the standing preamble from the verbatim user task. */
56
+ export declare const HOSTED_TASK_DELIMITER = "--- YOUR TASK ---";
57
+ /**
58
+ * Compose the full hosted prompt: the standing preamble, a clear delimiter, then
59
+ * the user's task VERBATIM beneath it. Passing an empty preamble yields the task
60
+ * unchanged (an explicit opt-out for tests / callers that scaffold elsewhere).
61
+ */
62
+ export declare function composeHostedTaskPrompt(task: string, preamble?: string): string;
63
+ /**
64
+ * Absolute path of the marker the pre-baked hosted-runtime image writes at build
65
+ * time (see packages/cli/hosted-runtime-image/Dockerfile). Its presence — plus
66
+ * the boot-context `prebaked` flag — tells the runtime the CLI + OpenCode are
67
+ * already on PATH, so the from-scratch install steps must be SKIPPED (they would
68
+ * otherwise fail under G5 default-deny egress).
69
+ */
70
+ export declare const PREBAKED_MARKER_PATH = "/opt/orizu/prebaked.json";
71
+ /**
72
+ * The schema of `/opt/orizu/prebaked.json`. Records the exact versions baked into
73
+ * the image so a run (and audit) can tell WHICH runtime it booted on. `builtFor`
74
+ * is a constant guard so a stray same-named file from another toolchain is not
75
+ * mistaken for our marker.
76
+ */
77
+ export interface PrebakedMarker {
78
+ cliVersion: string;
79
+ opencodeVersion: string;
80
+ claudeSdkVersion: string;
81
+ /**
82
+ * Braintrust eval tooling pins (ALI-1048) — OPTIONAL because pre-ALI-1048
83
+ * markers do not carry them (older snapshots stay valid). Py = the PyPI
84
+ * `braintrust` package (Highlight's python eval harness), Npm = the npm
85
+ * `braintrust` package (TS SDK + `bt` CLI).
86
+ */
87
+ braintrustPyVersion?: string;
88
+ braintrustNpmVersion?: string;
89
+ builtFor: 'vercel-sandbox';
90
+ }
91
+ /**
92
+ * Parse + validate a pre-baked marker file's contents. Returns the typed marker
93
+ * when the JSON is well-formed AND carries the expected `builtFor` guard with
94
+ * string version fields; returns null otherwise (missing file → caller passes an
95
+ * empty/whitespace string; malformed JSON; wrong shape). Never throws, so a
96
+ * belt-and-braces filesystem probe can call it on best-effort file reads.
97
+ */
98
+ export declare function parsePrebakedMarker(raw: string): PrebakedMarker | null;
99
+ /**
100
+ * The non-secret boot context the helper script reads. Paths are ABSOLUTE so
101
+ * the helper resolves them regardless of git's cwd at invocation time.
102
+ */
103
+ export interface HostedBootContext {
104
+ apiBaseUrl: string;
105
+ workspaceId: string;
106
+ sessionId: string;
107
+ runId: string;
108
+ sessionBranch: string;
109
+ repoFullName: string;
110
+ /** VCS host the helper will serve credentials for (default github.com). */
111
+ host: string;
112
+ /** Absolute path to the 0600 file holding the Orizu bearer. */
113
+ bearerFile: string;
114
+ /** Absolute path to the 0600 minted-token cache the script maintains. */
115
+ cacheFile: string;
116
+ /**
117
+ * PULL MODE (ALI-1057, DO-path hosted agent): the coordinator agent-token URL.
118
+ * When SET, the helper GETs a FRESH short-lived Orizu bearer here per mint —
119
+ * `Authorization: Bearer <boot secret read from bootSecretFile>` — instead of
120
+ * reading the host-written 0600 `bearerFile`. Everything downstream (POST the
121
+ * repo-token broker with that bearer → serve the GitHub x-access-token to git)
122
+ * is byte-identical to the operator/file path. When UNSET the helper stays in
123
+ * file mode and reads `bearerFile` exactly as before. This is the ONLY DO-path
124
+ * difference: the bearer SOURCE is HTTP, not a 0600 file.
125
+ */
126
+ agentTokenUrl?: string;
127
+ /**
128
+ * PULL MODE: absolute path to the 0600 file holding the durable BOOT SECRET —
129
+ * the sandbox's bootstrap identity, used to authenticate the agent-token GET.
130
+ * Required when `agentTokenUrl` is set; ignored in file mode.
131
+ */
132
+ bootSecretFile?: string;
133
+ /**
134
+ * Broker purpose vocabulary, INJECTABLE so a later slice can flip the whole
135
+ * script from write/read to session_write/session_read without editing it. The
136
+ * helper POSTs `primary` first and falls back to `fallback` ONLY on a 403
137
+ * (unauthorized-for-primary). A 400 is treated as vocabulary drift and fails
138
+ * loudly — it means the broker does not recognise the requested purpose.
139
+ */
140
+ tokenPurposes: {
141
+ primary: string;
142
+ fallback: string;
143
+ };
144
+ /**
145
+ * Hosts (lowercased) for which the helper may serve credentials over plain
146
+ * HTTP instead of HTTPS. Production leaves this UNSET → https-only. The
147
+ * local-sim rehearsal sets it to the loopback git server's host so the
148
+ * clone-through-helper path can be proven without TLS. Secure by default.
149
+ */
150
+ insecureHttpHosts?: readonly string[];
151
+ /** Refresh buffer in ms (overridable so tests can force a refresh). */
152
+ cacheBufferMs: number;
153
+ }
154
+ export declare function serializeBootContext(ctx: HostedBootContext): string;
155
+ /**
156
+ * The opaque git-password rule, as a pattern SOURCE string.
157
+ *
158
+ * ALI-1285: the Artifacts contract declares the credential opaque
159
+ * (`plaintext: string`), so only transport-usable shape is enforced — bounded,
160
+ * no whitespace, no control characters, at least 16 characters. Mirrors
161
+ * `workers/artifacts-runtime/contracts.ts` GIT_PASSWORD.
162
+ *
163
+ * It is kept as a SOURCE STRING, not a regex literal, because the rendered
164
+ * credential helper must embed the identical rule. A regex literal written
165
+ * inline in the renderer's template has its escapes consumed by the OUTER
166
+ * template literal before emission, which silently produced
167
+ * `[^s<NUL>-<US><DEL>]` — rejecting every credential containing `s` while
168
+ * accepting spaces and NBSP. Emitting via `JSON.stringify` of this constant
169
+ * makes the two layers provably identical, and
170
+ * `test/cli/hosted-credential-helper.test.ts` asserts that at the RENDERED
171
+ * layer by executing the emitted validator.
172
+ */
173
+ export declare const HOSTED_OPAQUE_GIT_PASSWORD_SOURCE = "^[^\\s\\u0000-\\u001f\\u007f]{16,1024}$";
174
+ export declare const HOSTED_OPAQUE_GIT_PASSWORD: RegExp;
175
+ /**
176
+ * The git credential-helper script, as a self-contained CommonJS source string.
177
+ * Implements the `get` action (mint/emit); `store`/`erase` are no-ops because
178
+ * the broker owns credential truth and the script never persists what git hands
179
+ * back. Diagnostics go to stderr only — stdout is reserved for git's protocol.
180
+ *
181
+ * NOTE: this is a rendered ARTIFACT, exercised end-to-end as a subprocess in
182
+ * `test/cli/hosted-credential-helper.test.ts`; that subprocess test is the
183
+ * source of truth for its behavior.
184
+ */
185
+ export declare function renderCredentialHelperScript(): string;
186
+ //# sourceMappingURL=hosted-runtime-assets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-runtime-assets.d.ts","sourceRoot":"","sources":["../src/hosted-runtime-assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,eAAO,MAAM,sBAAsB,oCAAoC,CAAA;AACvE,eAAO,MAAM,qBAAqB,cAAc,CAAA;AAChD,eAAO,MAAM,eAAe,WAAW,CAAA;AACvC,eAAO,MAAM,wBAAwB,mBAAmB,CAAA;AAExD,6EAA6E;AAC7E,eAAO,MAAM,+BAA+B,QAAgB,CAAA;AAE5D;8EAC8E;AAC9E,eAAO,MAAM,wBAAwB,oBAAoB,CAAA;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;CAA4D,CAAA;AAI3F;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,QAK6C,CAAA;AAE9E,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,sBAAsB,CAAA;AAExD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAA6B,GAAG,MAAM,CAGrG;AAID;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,6BAA6B,CAAA;AAE9D;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,EAAE,gBAAgB,CAAA;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAwBtE;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAA;IACZ,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAA;IAClB,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAA;IACjB;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;;OAMG;IACH,aAAa,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IACpD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,uEAAuE;IACvE,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAEnE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iCAAiC,4CACH,CAAA;AAE3C,eAAO,MAAM,0BAA0B,QAEtC,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAsQrD"}
@@ -0,0 +1,258 @@
1
+ /**
2
+ * `orizu session start --hosted` — host-side driver for a CLI-triggered hosted
3
+ * agent session (ALI-928 / P3.5, per ADR-005). Also the thin dispatch home for
4
+ * the in-sandbox `orizu internal hosted-loop` (delegated to `hosted-loop.ts`).
5
+ *
6
+ * A human runs this with their NORMAL login. `startHostedSession` then:
7
+ * (a) opens a workspace session (its own session branch is cut server-side);
8
+ * (b) mints a session-scoped AGENT token (the sandbox's Orizu bearer);
9
+ * (c) starts a workbench run WITH THE AGENT BEARER (actor_type='agent');
10
+ * (d) creates the sandbox via a SandboxProvider (timeout from --duration,
11
+ * default 60m, cap 24h — never Vercel's 5m default);
12
+ * (e) bootstraps the sandbox (agent bearer in a 0600 file; broker purposes
13
+ * session_write/session_read chosen from bearerKind='agent');
14
+ * (f) launches the hosted-loop DETACHED so the CLI can exit;
15
+ * (g) READINESS-GATES on the loop's first event (bounded); on failure it
16
+ * destroys the sandbox + exits non-zero. Detached mode then prints when the
17
+ * sandbox self-terminates (it lives to --duration; session-end reaping is
18
+ * G6/ALI-1007). Attached (--tail) mode rotates + keeps the box alive +
19
+ * streams the tail, and REAPS the sandbox when the run terminates.
20
+ *
21
+ * TOKEN TTL vs LONG SESSIONS (decided): while attached (--tail), the CLI
22
+ * re-mints the agent token before expiry (default 55m) and ATOMICALLY overwrites
23
+ * the 0600 bearer file (temp + mv). Rotation keeps BOTH git ops and event
24
+ * recording alive: the in-sandbox credential helper reads the bearer per-op, AND
25
+ * the loop's RunEventSink resolves it per request (bearer PROVIDER + a one-shot
26
+ * re-resolve-and-retry on 401/403). Each rotation also extendTimeout()s the
27
+ * sandbox by the rotation interval (bounded by the 24h cap). A failed mint
28
+ * fast-retries (60s) and gives up loudly before expiry. If the host disconnects,
29
+ * tokens expire within the TTL (≤60m) and the loop finishes 'failed' cleanly; the
30
+ * sandbox timeout is independent (configurable to 24h). Documented in the
31
+ * secrets-policy doc §8 + the command help.
32
+ *
33
+ * Everything the command needs (provider, fetch, repo resolution, loop launch)
34
+ * is injectable, so the whole flow runs in-process against fakes in the
35
+ * local-sim end-to-end test.
36
+ */
37
+ import { type SandboxEgressPolicy, type SandboxProvider, type SandboxSession } from './sandbox-provider.js';
38
+ import { type HostedFetch, type HostedRuntimePaths } from './hosted-bootstrap.js';
39
+ import { DEFAULT_HOSTED_MODEL, type HostedLoopContext } from './hosted-loop.js';
40
+ import { type StartIntentIdGenerator } from './start-intent.js';
41
+ export { DEFAULT_HOSTED_MODEL };
42
+ export declare const DEFAULT_DURATION_MINUTES = 60;
43
+ export declare const MAX_DURATION_MINUTES: number;
44
+ export declare const DEFAULT_ROTATION_INTERVAL_MS: number;
45
+ /** After a mint failure, retry the rotation on this short interval (not the full
46
+ * 55m) so a transient outage does not silently ride the token to expiry. */
47
+ export declare const ROTATION_FAST_RETRY_MS: number;
48
+ export declare const DEFAULT_AGENT_TOKEN_TTL_MINUTES = 60;
49
+ /** Readiness gate: how long to poll the run's events for the loop's first event
50
+ * before declaring the detached launch a failure. */
51
+ export declare const DEFAULT_READINESS_TIMEOUT_MS: number;
52
+ export declare const DEFAULT_READINESS_POLL_MS = 500;
53
+ /** Must match the coordinator Worker's session-start request ceiling. */
54
+ export declare const MAX_HOSTED_START_BODY_BYTES: number;
55
+ /** Non-secret placeholder OpenCode uses to form requests; the firewall proxy
56
+ * overrides the real Anthropic header (model-key brokering). NEVER a real key. */
57
+ export declare const ANTHROPIC_DUMMY_KEY = "sk-ant-orizu-proxy-broker-placeholder";
58
+ /** The broker currently drains repository lifecycle work once per minute. A
59
+ * durable provider `waiting` response can therefore cost a full cron period;
60
+ * use the server-advertised cadence and retain a five-minute resume window. */
61
+ export declare const REPOSITORY_PROVISIONING_RETRY_MS = 60000;
62
+ export declare const REPOSITORY_PROVISIONING_MAX_WAIT_MS: number;
63
+ /** Backward-compatible names for existing operator-path callers/tests. */
64
+ export declare const OPERATOR_REPOSITORY_PENDING_RETRY_MS = 60000;
65
+ /** @deprecated The runtime is delay-budgeted, not retry-counted. This retains
66
+ * the old exported symbol as the maximum count implied by the 1s wire floor. */
67
+ export declare const OPERATOR_REPOSITORY_PENDING_MAX_RETRIES: number;
68
+ /** A bounded repository wait exhausted without losing the immutable hosted
69
+ * start identity. Both server- and operator-provisioned paths expose the same
70
+ * structured recovery contract. */
71
+ export declare class HostedSessionRepositoryPendingError extends Error {
72
+ readonly sessionId: string;
73
+ readonly startIntentId: string;
74
+ readonly resumeCommand: string;
75
+ constructor(input: {
76
+ readonly sessionId: string;
77
+ readonly startIntentId: string;
78
+ readonly resumeCommand: string;
79
+ });
80
+ }
81
+ /** Base-relative fetch (base already applied) — the host-side human fetcher. */
82
+ export type HostFetcher = (path: string, init?: RequestInit) => Promise<Response>;
83
+ /** Build a base-relative fetcher that authenticates with a specific bearer
84
+ * (used for the AGENT-bearer run-start against the absolute API base). */
85
+ export declare function bearerFetcher(apiBaseUrl: string, bearer: string, rawFetch: HostedFetch): HostFetcher;
86
+ export interface LaunchLoopParams {
87
+ session: SandboxSession;
88
+ context: HostedLoopContext;
89
+ /** Sandbox-relative + absolute paths for the run-scoped loop files. */
90
+ taskRel: string;
91
+ contextRel: string;
92
+ contextAbs: string;
93
+ logRel: string;
94
+ taskPrompt: string;
95
+ /** Agent bearer, handed through so an injected in-process launcher can run
96
+ * the loop without re-reading the 0600 file. */
97
+ bearer: string;
98
+ }
99
+ export interface RepoResolution {
100
+ repoFullName: string;
101
+ cloneUrl: string;
102
+ }
103
+ export interface StartHostedSessionOptions {
104
+ /** Host-side human fetcher (base-relative, authed with the human login). */
105
+ fetcher: HostFetcher;
106
+ /** Absolute Orizu API base — baked into the sandbox boot context. */
107
+ apiBaseUrl: string;
108
+ provider: SandboxProvider;
109
+ workspaceId: string;
110
+ task: string;
111
+ projectSlug?: string | null;
112
+ /** Immutable response-loss identity. Supply both fields to resume the exact
113
+ * pending repository; omitting both creates a fresh UUIDv4 intent. */
114
+ startIntentId?: string;
115
+ reconcileSessionId?: string;
116
+ model?: string;
117
+ reasoningEffort?: string;
118
+ /** Sandbox session length (minutes); default 60, hard-capped at 24h. */
119
+ durationMinutes?: number;
120
+ runtime?: string;
121
+ /**
122
+ * Pre-baked custom VCR image ref (ALI-1017), e.g. 'orizu-hosted-runtime:v1'.
123
+ * When set, it is passed to `Sandbox.create({ image })` AND flips the `prebaked`
124
+ * flag on BOTH the bootstrap and the loop together — so the sandbox image and
125
+ * the install-skip decision can never disagree. When unset, the from-scratch
126
+ * install path runs (local-sim / base runtime). Default: env ORIZU_HOSTED_IMAGE.
127
+ */
128
+ hostedImage?: string;
129
+ /**
130
+ * Pre-baked Vercel Sandbox SNAPSHOT id (ALI-1017, zero-Docker path). Parallel to
131
+ * `hostedImage`: when set it is passed to `Sandbox.create({ source:{ type:'snapshot' }})`
132
+ * AND flips the `prebaked` flag on bootstrap + loop together. Mutually exclusive
133
+ * with `hostedImage` — both set is a hard error. Default: env ORIZU_HOSTED_SNAPSHOT.
134
+ */
135
+ hostedSnapshot?: string;
136
+ title?: string;
137
+ /** Attach: rotate the bearer + stream the run tail until it terminates. */
138
+ tail?: boolean;
139
+ /** Host-side model key; injected at the firewall proxy, never into the sandbox. */
140
+ modelApiKey?: string;
141
+ /** @deprecated The credential-helper host is derived from the resolved clone
142
+ * URL. Kept only as a source-compatible no-op for older library callers. */
143
+ host?: string;
144
+ /** Loopback hosts the helper may serve over plain HTTP (rehearsal only). */
145
+ insecureHttpHosts?: readonly string[];
146
+ rawFetch?: HostedFetch;
147
+ resolveRepo?: (workspaceId: string) => Promise<RepoResolution>;
148
+ launchLoop?: (params: LaunchLoopParams) => Promise<void>;
149
+ /** Build the sandbox egress policy from the resolved inputs. Default: G5
150
+ * `buildEgressPolicy` — DEFAULT-DENY base allowlist (Orizu API + model provider
151
+ * + git) with the model-key broker composed on, plus the per-team additive
152
+ * domains. Injectable for tests. */
153
+ buildEgressPolicy?: (input: {
154
+ modelApiKey?: string;
155
+ extraDomains: readonly string[];
156
+ repositoryHost: string;
157
+ }) => SandboxEgressPolicy | undefined;
158
+ /** Resolve the per-team ADDITIVE egress domains for this workspace's team
159
+ * (base hosts are code-owned and always present). Default: no extra domains —
160
+ * the production CLI injects a route-backed resolver. */
161
+ resolveExtraEgressDomains?: (workspaceId: string) => Promise<readonly string[]>;
162
+ /** Injectable bounded wait used while the server prepares an Artifacts fork. */
163
+ repositorySleep?: (ms: number) => Promise<void>;
164
+ /** Injectable UUIDv4 generator; one value is replayed for every retry. */
165
+ generateStartIntentId?: StartIntentIdGenerator;
166
+ rotationIntervalMs?: number;
167
+ agentTokenTtlMinutes?: number;
168
+ now?: () => number;
169
+ /** Readiness gate bound (ms); default 30s. */
170
+ readinessTimeoutMs?: number;
171
+ /** Readiness poll interval (ms); default 500ms. */
172
+ readinessPollMs?: number;
173
+ /** Test seam: override the readiness probe entirely (resolves ready/not). */
174
+ waitForReady?: (params: ReadinessParams) => Promise<boolean>;
175
+ logLine?: (line: string) => void;
176
+ onTailEvent?: (event: Record<string, unknown>) => void;
177
+ /** Test hook: the live sandbox + its run-scoped paths, after a successful
178
+ * bootstrap (used by the e2e for residue-sweep + bearer-file inspection). */
179
+ onSandboxReady?: (info: {
180
+ session: SandboxSession;
181
+ paths: HostedRuntimePaths;
182
+ }) => void;
183
+ /** Await the tail loop when attached (tests pass a bounded tailer). */
184
+ tailImpl?: (params: TailParams) => Promise<void>;
185
+ }
186
+ export interface TailParams {
187
+ fetcher: HostFetcher;
188
+ runId: string;
189
+ onEvent?: (event: Record<string, unknown>) => void;
190
+ }
191
+ export interface ReadinessParams {
192
+ fetcher: HostFetcher;
193
+ runId: string;
194
+ timeoutMs: number;
195
+ pollMs: number;
196
+ now: () => number;
197
+ sleep: (ms: number) => Promise<void>;
198
+ log: (line: string) => void;
199
+ }
200
+ export interface StartHostedSessionResult {
201
+ ok: boolean;
202
+ sessionId: string;
203
+ runId: string;
204
+ sandboxId: string;
205
+ repoFullName: string;
206
+ sessionBranch: string;
207
+ agentUserId: string | null;
208
+ bootstrapOk: boolean;
209
+ error: string | null;
210
+ }
211
+ export declare function repositoryResolutionFromMint(minted: Record<string, unknown>): RepoResolution;
212
+ export declare function startHostedSession(opts: StartHostedSessionOptions): Promise<StartHostedSessionResult>;
213
+ export interface HostedCommandIo {
214
+ print: (line: string) => void;
215
+ printErr?: (line: string) => void;
216
+ json?: boolean;
217
+ }
218
+ /** Printed on EVERY `--operator` use (founder-locked: deprecate NOW, remove
219
+ * after Phase 6 validation). Loud on purpose. */
220
+ export declare const OPERATOR_DEPRECATION_WARNING: string;
221
+ /**
222
+ * Default hosted path (ALI-1055 cutover): POST the server's hosted-sessions
223
+ * route and let the Durable Object coordinator own the sandbox lifetime. The
224
+ * CLI never reads VERCEL_* or a model key on this path — the server holds them.
225
+ */
226
+ /** Bounded reconcile of a start that the coordinator reported still-in-flight
227
+ * (R7 P4). Each retry re-pokes the SAME session by its returned sessionId, so
228
+ * a race that momentarily answers start_pending never spawns a duplicate.
229
+ *
230
+ * R8 P2 — the retry budget must OUTLIVE a stale start lease. If a start-lease
231
+ * owner crashed WITHOUT running its release, the lease lingers until its TTL
232
+ * (the coordinator's START_LEASE_TTL_MS = 3 × CALLBACK_TIMEOUT_MS = 30s), and
233
+ * every duplicate poke sees it and answers start_pending. So the CLI's OWN
234
+ * cumulative backoff (independent of server-side watch time) must exceed that
235
+ * TTL plus margin, so the CLI keeps polling until the lease expires and a
236
+ * retry then wins — rather than giving up while the crashed owner's lease
237
+ * still lingers. COORDINATOR_START_LEASE_TTL_MS mirrors the worker constant
238
+ * and is pinned to it by a contract test in the CLI suite. */
239
+ export declare const COORDINATOR_START_LEASE_TTL_MS = 30000;
240
+ export declare const HOSTED_START_PENDING_RETRY_MS = 2000;
241
+ export declare const HOSTED_START_PENDING_MAX_RETRIES: number;
242
+ export declare function startHostedViaServer(args: readonly string[], workspaceId: string, task: string, tail: boolean, io: HostedCommandIo, fetcher?: HostFetcher, sleep?: (ms: number) => Promise<void>, generateStartIntentId?: StartIntentIdGenerator): Promise<number>;
243
+ /** Test seams for `hostedCommand` dispatch (server default vs operator hatch). */
244
+ export interface HostedCommandDeps {
245
+ startViaServer?: typeof startHostedViaServer;
246
+ startViaOperator?: (args: string[], workspaceId: string, task: string, tail: boolean, io: HostedCommandIo) => Promise<number>;
247
+ }
248
+ /**
249
+ * Dispatch `orizu internal hosted-loop` (in-sandbox) and `orizu session start
250
+ * --hosted` (host-side). Kept out of index.ts so the CLI entrypoint stays a thin
251
+ * dispatcher (ALI-976 ratchet).
252
+ *
253
+ * ALI-1055 cutover: the DEFAULT is the server path (POST /api/cli/hosted-sessions
254
+ * → DO coordinator). `--operator` keeps the old client-provisioned flow as a
255
+ * DEPRECATED escape hatch (loud warning on every use; removal after Phase 6).
256
+ */
257
+ export declare function hostedCommand(args: string[], io: HostedCommandIo, deps?: HostedCommandDeps): Promise<number>;
258
+ //# sourceMappingURL=hosted-session-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-session-cli.d.ts","sourceRoot":"","sources":["../src/hosted-session-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAIH,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAA;AAK9B,OAAO,EAAE,oBAAoB,EAAqB,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAMlG,OAAO,EAKL,KAAK,sBAAsB,EAC5B,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAC/B,eAAO,MAAM,wBAAwB,KAAK,CAAA;AAC1C,eAAO,MAAM,oBAAoB,QAAU,CAAA;AAC3C,eAAO,MAAM,4BAA4B,QAAiB,CAAA;AAC1D;6EAC6E;AAC7E,eAAO,MAAM,sBAAsB,QAAY,CAAA;AAC/C,eAAO,MAAM,+BAA+B,KAAK,CAAA;AACjD;sDACsD;AACtD,eAAO,MAAM,4BAA4B,QAAY,CAAA;AACrD,eAAO,MAAM,yBAAyB,MAAM,CAAA;AAC5C,yEAAyE;AACzE,eAAO,MAAM,2BAA2B,QAAa,CAAA;AAMrD;mFACmF;AACnF,eAAO,MAAM,mBAAmB,0CAA0C,CAAA;AAK1E;;+EAE+E;AAC/E,eAAO,MAAM,gCAAgC,QAAS,CAAA;AACtD,eAAO,MAAM,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ACvB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE,WAAqD,EAC9D,KAAK,GAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAyD,EAC5F,qBAAqB,CAAC,EAAE,sBAAsB,GAC7C,OAAO,CAAC,MAAM,CAAC,CAkPjB;AAED,kFAAkF;AAClF,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,OAAO,oBAAoB,CAAA;IAC5C,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,eAAe,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAC9H;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,EAAE,eAAe,EACnB,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAkLjB"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Shared orizu-cli skill staging (ALI-1044 / ALI-1059).
3
+ *
4
+ * BOTH hosted boot paths must stage the vendored `orizu-cli` skill into the
5
+ * cloned workspace so the agent discovers the Orizu workflows: the OPERATOR path
6
+ * (hosted-bootstrap.ts) and the DO path (hosted-boot.ts). Before ALI-1059 only the
7
+ * operator path did — the DO path (the default; `--operator` is deprecated) booted
8
+ * an authenticated CLI that never found the skill. This module is the ONE
9
+ * implementation of the resolution chain and the `.git/info/exclude` append; each
10
+ * path adapts its own exec seam and records the outcome its own way (a run-event
11
+ * sink vs. a boot log).
12
+ *
13
+ * Resolution chain (unchanged from the original operator-path block), preferring:
14
+ * (1) $ORIZU_SKILL_SOURCE_DIR — explicit override (also honored by the CLI's
15
+ * skill-installer; the local-sim rehearsal sets it),
16
+ * (2) `orizu skills path` — the packaged vendor/skills/orizu-cli of the
17
+ * globally-installed CLI (the production path),
18
+ * (3) `$(npm root -g)/orizu/vendor/skills/orizu-cli` — belt fallback.
19
+ * Then SYMLINK it under `<workspaceDir>/.claude/skills/orizu-cli`, falling back to
20
+ * a copy if the symlink cannot be created. Resolved paths stay in shell vars
21
+ * (never interpolated), so they cannot inject into the command.
22
+ *
23
+ * HARVEST-SAFE (ALI-1051): the script appends `/.claude/skills/` to the repo-LOCAL
24
+ * `.git/info/exclude` so auto-harvest's `git add -A` cannot sweep the staged
25
+ * symlink into the session branch (hosted-harvest.ts also excludes it by pathspec,
26
+ * belt-and-braces).
27
+ */
28
+ export interface SkillStageExecResult {
29
+ exitCode: number;
30
+ stdout: string;
31
+ stderr: string;
32
+ }
33
+ /**
34
+ * Runs a POSIX shell command string, returning its exit code + captured output.
35
+ * The operator path adapts `SandboxSession.exec`; the DO path adapts its
36
+ * `BootExec` via `sh -c`. Kept as an injected seam so both callers — and tests —
37
+ * share one script and one output parser.
38
+ */
39
+ export type SkillStageExec = (command: string) => Promise<SkillStageExecResult>;
40
+ export interface StageOrizuSkillOptions {
41
+ /**
42
+ * Directory the session branch is cloned into (ABSOLUTE on the DO path,
43
+ * sandbox-root RELATIVE on the operator path). The skill is staged under
44
+ * `<workspaceDir>/.claude/skills/orizu-cli`.
45
+ */
46
+ workspaceDir: string;
47
+ exec: SkillStageExec;
48
+ }
49
+ export interface StageOrizuSkillResult {
50
+ ok: boolean;
51
+ method: 'symlink' | 'copy' | null;
52
+ /** `<workspaceDir>/.claude/skills/orizu-cli`. */
53
+ dest: string;
54
+ exitCode: number;
55
+ stdout: string;
56
+ stderr: string;
57
+ }
58
+ /** The exact staging script — exported for tests that assert its shape. */
59
+ export declare function renderStageOrizuSkillScript(workspaceDir: string): string;
60
+ /**
61
+ * Stage the orizu-cli skill into `<workspaceDir>/.claude/skills/orizu-cli`.
62
+ * Non-throwing (except via the injected exec): resolves to a structured result
63
+ * both callers record their own way. A malformed `workspaceDir` returns a non-ok
64
+ * result rather than throwing, so staging stays non-fatal to the boot.
65
+ *
66
+ * TRUSTED-DIR CONTRACT: `workspaceDir` must be a trusted, internally-constructed
67
+ * non-traversal directory. The shell-safety guard blocks injection metacharacters
68
+ * but deliberately does not reject `..` or a leading `-` — do not pass untrusted
69
+ * input here. Idempotent: safe to re-invoke (e.g. ALI-1060 resume/retry) — the
70
+ * `.git/info/exclude` line is appended only when absent.
71
+ */
72
+ export declare function stageOrizuSkill(opts: StageOrizuSkillOptions): Promise<StageOrizuSkillResult>;
73
+ //# sourceMappingURL=hosted-skill-staging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-skill-staging.d.ts","sourceRoot":"","sources":["../src/hosted-skill-staging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAE/E,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,cAAc,CAAA;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAAA;IACjC,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAUD,2EAA2E;AAC3E,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAmBxE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAqBlG"}
package/dist/http.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { GlobalFlags } from './global-flags.js';
2
+ export declare function setGlobalFlags(flags: GlobalFlags): void;
3
+ export declare function resolveBaseUrl(flags?: GlobalFlags): string;
4
+ export declare function resolveLoginBaseUrl(flags?: GlobalFlags): string;
5
+ export declare function getBaseUrl(): string;
6
+ export declare function assertSecureTokenTransport(baseUrl: string): void;
7
+ export declare function authedFetch(path: string, init?: RequestInit): Promise<Response>;
8
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkB,WAAW,EAAoB,MAAM,mBAAmB,CAAA;AAKjF,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,QAEhD;AAED,wBAAgB,cAAc,CAAC,KAAK,GAAE,WAA0B,GAAG,MAAM,CAiBxE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,GAAE,WAA0B,GAAG,MAAM,CAY7E;AAED,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAWD,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,QAmBzD;AA8CD,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,qBAkDrE"}
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ export { loadInstructionSet } from './instruction-set-loader.js';
3
+ export { parseJsonResponse, sanitizeTerminalText } from './json-response.js';
4
+ export declare function normalizeSlugInput(slug: string): string;
5
+ export declare function expandHomePath(path: string): string;
6
+ export declare function createCodeChallenge(verifier: string): string;
7
+ export declare function validateBrowserUrl(url: string, expectedOrigin?: string): URL;
8
+ export declare function formatTerminalLink(url: string): string;
9
+ export declare function readRunnerManifest(runnerDir: string): {
10
+ command: string[];
11
+ supports_body_kind?: string[];
12
+ };
13
+ export declare const RUNNER_TIMEOUT_MS = 120000;
14
+ export declare const RUNNER_OUTPUT_MAX_BYTES: number;
15
+ export declare const RUNNER_ENV_ALLOWLIST: Set<string>;
16
+ export declare function runnerSubprocessEnv(inputPath: string, outputPath: string, instructionSetDir?: string): NodeJS.ProcessEnv;
17
+ export declare function materializeRunnerVersion(runnerVersionId: string): Promise<{
18
+ runnerDir: string;
19
+ cleanup: () => void;
20
+ }>;
21
+ export declare function main(rawArgs?: string[]): Promise<void>;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AA2FgF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AA8BhJ,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAgU5E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAUD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOnD;AAyBD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE5D;AAcD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,GAAG,CAqB5E;AA6BD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgBtD;AA+jKD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CA0B1G;AAED,eAAO,MAAM,iBAAiB,SAAU,CAAA;AACxC,eAAO,MAAM,uBAAuB,QAAkB,CAAA;AACtD,eAAO,MAAM,oBAAoB,aAgB/B,CAAA;AAEF,wBAAgB,mBAAmB,CAAC,SAAS,E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