orizu 0.5.20 → 0.5.22

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 (269) hide show
  1. package/README.md +9 -6
  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 +3 -0
  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 +67 -2
  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-paths.d.ts +6 -0
  45. package/dist/gepa-python-paths.d.ts.map +1 -0
  46. package/dist/gepa-python-paths.js +26 -4
  47. package/dist/git-credential.d.ts +69 -0
  48. package/dist/git-credential.d.ts.map +1 -0
  49. package/dist/git-recovery-environment.d.ts +31 -0
  50. package/dist/git-recovery-environment.d.ts.map +1 -0
  51. package/dist/github-setup.d.ts +122 -0
  52. package/dist/github-setup.d.ts.map +1 -0
  53. package/dist/global-flags.d.ts +12 -0
  54. package/dist/global-flags.d.ts.map +1 -0
  55. package/dist/help.d.ts +46 -0
  56. package/dist/help.d.ts.map +1 -0
  57. package/dist/help.js +125 -35
  58. package/dist/hosted-boot.d.ts +273 -0
  59. package/dist/hosted-boot.d.ts.map +1 -0
  60. package/dist/hosted-bootstrap-rehearsal.d.ts +86 -0
  61. package/dist/hosted-bootstrap-rehearsal.d.ts.map +1 -0
  62. package/dist/hosted-bootstrap.d.ts +188 -0
  63. package/dist/hosted-bootstrap.d.ts.map +1 -0
  64. package/dist/hosted-broker-server.d.ts +50 -0
  65. package/dist/hosted-broker-server.d.ts.map +1 -0
  66. package/dist/hosted-git-http-server.d.ts +36 -0
  67. package/dist/hosted-git-http-server.d.ts.map +1 -0
  68. package/dist/hosted-harness-claude.d.ts +195 -0
  69. package/dist/hosted-harness-claude.d.ts.map +1 -0
  70. package/dist/hosted-harness-opencode.d.ts +227 -0
  71. package/dist/hosted-harness-opencode.d.ts.map +1 -0
  72. package/dist/hosted-harness.d.ts +118 -0
  73. package/dist/hosted-harness.d.ts.map +1 -0
  74. package/dist/hosted-harvest.d.ts +68 -0
  75. package/dist/hosted-harvest.d.ts.map +1 -0
  76. package/dist/hosted-headless.d.ts +72 -0
  77. package/dist/hosted-headless.d.ts.map +1 -0
  78. package/dist/hosted-loop-lifecycle.d.ts +206 -0
  79. package/dist/hosted-loop-lifecycle.d.ts.map +1 -0
  80. package/dist/hosted-loop.d.ts +170 -0
  81. package/dist/hosted-loop.d.ts.map +1 -0
  82. package/dist/hosted-run-event-sink.d.ts +222 -0
  83. package/dist/hosted-run-event-sink.d.ts.map +1 -0
  84. package/dist/hosted-runtime-assets.d.ts +186 -0
  85. package/dist/hosted-runtime-assets.d.ts.map +1 -0
  86. package/dist/hosted-session-cli.d.ts +258 -0
  87. package/dist/hosted-session-cli.d.ts.map +1 -0
  88. package/dist/hosted-skill-staging.d.ts +73 -0
  89. package/dist/hosted-skill-staging.d.ts.map +1 -0
  90. package/dist/http.d.ts +8 -0
  91. package/dist/http.d.ts.map +1 -0
  92. package/dist/index.d.ts +22 -0
  93. package/dist/index.d.ts.map +1 -0
  94. package/dist/index.js +86 -125
  95. package/dist/instruction-set-gepa-launch.d.ts +3 -0
  96. package/dist/instruction-set-gepa-launch.d.ts.map +1 -0
  97. package/dist/instruction-set-gepa-launch.js +15 -0
  98. package/dist/instruction-set-loader.d.ts +6 -0
  99. package/dist/instruction-set-loader.d.ts.map +1 -0
  100. package/dist/instruction-set-loader.js +111 -0
  101. package/dist/instruction-set-manifest.d.ts +14 -0
  102. package/dist/instruction-set-manifest.d.ts.map +1 -0
  103. package/dist/instruction-set-manifest.js +162 -0
  104. package/dist/instruction-sets-cli.d.ts +43 -0
  105. package/dist/instruction-sets-cli.d.ts.map +1 -0
  106. package/dist/instruction-sets-cli.js +471 -0
  107. package/dist/json-response.d.ts +4 -0
  108. package/dist/json-response.d.ts.map +1 -0
  109. package/dist/jsonl-stream.d.ts +8 -0
  110. package/dist/jsonl-stream.d.ts.map +1 -0
  111. package/dist/kill-switch-cli.d.ts +30 -0
  112. package/dist/kill-switch-cli.d.ts.map +1 -0
  113. package/dist/loopback-serve.d.ts +25 -0
  114. package/dist/loopback-serve.d.ts.map +1 -0
  115. package/dist/manifests-cli.d.ts +22 -0
  116. package/dist/manifests-cli.d.ts.map +1 -0
  117. package/dist/markdown-report-input.d.ts +7 -0
  118. package/dist/markdown-report-input.d.ts.map +1 -0
  119. package/dist/merge-job.d.ts +155 -0
  120. package/dist/merge-job.d.ts.map +1 -0
  121. package/dist/model-configs-cli.d.ts +19 -0
  122. package/dist/model-configs-cli.d.ts.map +1 -0
  123. package/dist/model-configs-cli.js +104 -0
  124. package/dist/optimization-export-cli.d.ts +19 -0
  125. package/dist/optimization-export-cli.d.ts.map +1 -0
  126. package/dist/optimizations-list-cli.d.ts +20 -0
  127. package/dist/optimizations-list-cli.d.ts.map +1 -0
  128. package/dist/optimizations-promote-cli.d.ts +8 -0
  129. package/dist/optimizations-promote-cli.d.ts.map +1 -0
  130. package/dist/optimizations-promote-cli.js +34 -0
  131. package/dist/option-validation.d.ts +15 -0
  132. package/dist/option-validation.d.ts.map +1 -0
  133. package/dist/preview-runtime.d.ts +63 -0
  134. package/dist/preview-runtime.d.ts.map +1 -0
  135. package/dist/prompt-draft-push.d.ts +60 -0
  136. package/dist/prompt-draft-push.d.ts.map +1 -0
  137. package/dist/prompt-label-cli.d.ts +11 -0
  138. package/dist/prompt-label-cli.d.ts.map +1 -0
  139. package/dist/prompt-label-cli.js +29 -0
  140. package/dist/prompt-length-wire.d.ts +28 -0
  141. package/dist/prompt-length-wire.d.ts.map +1 -0
  142. package/dist/prompt-report-cli.d.ts +10 -0
  143. package/dist/prompt-report-cli.d.ts.map +1 -0
  144. package/dist/prompt-summary-table.d.ts +15 -0
  145. package/dist/prompt-summary-table.d.ts.map +1 -0
  146. package/dist/prompt-summary-table.js +6 -0
  147. package/dist/registration-tag-warning.d.ts +32 -0
  148. package/dist/registration-tag-warning.d.ts.map +1 -0
  149. package/dist/report-comments-cli.d.ts +16 -0
  150. package/dist/report-comments-cli.d.ts.map +1 -0
  151. package/dist/report-markdown-blankness.d.ts +2 -0
  152. package/dist/report-markdown-blankness.d.ts.map +1 -0
  153. package/dist/report-replacement-warning.d.ts +17 -0
  154. package/dist/report-replacement-warning.d.ts.map +1 -0
  155. package/dist/repository-backup-core.d.ts +225 -0
  156. package/dist/repository-backup-core.d.ts.map +1 -0
  157. package/dist/repository-recovery-manifest.d.ts +83 -0
  158. package/dist/repository-recovery-manifest.d.ts.map +1 -0
  159. package/dist/run-event-digest.d.ts +74 -0
  160. package/dist/run-event-digest.d.ts.map +1 -0
  161. package/dist/runner-dir-verify.d.ts +66 -0
  162. package/dist/runner-dir-verify.d.ts.map +1 -0
  163. package/dist/runner-instruction-set-contract.d.ts +24 -0
  164. package/dist/runner-instruction-set-contract.d.ts.map +1 -0
  165. package/dist/runner-instruction-set-contract.js +50 -0
  166. package/dist/sandbox-hygiene.d.ts +45 -0
  167. package/dist/sandbox-hygiene.d.ts.map +1 -0
  168. package/dist/sandbox-provider.d.ts +193 -0
  169. package/dist/sandbox-provider.d.ts.map +1 -0
  170. package/dist/scorer-draft-push.d.ts +50 -0
  171. package/dist/scorer-draft-push.d.ts.map +1 -0
  172. package/dist/scorers-cli.d.ts +20 -0
  173. package/dist/scorers-cli.d.ts.map +1 -0
  174. package/dist/scorers-cli.js +22 -0
  175. package/dist/scorers-verify-parity-bridge.d.ts +16 -0
  176. package/dist/scorers-verify-parity-bridge.d.ts.map +1 -0
  177. package/dist/scorers-verify-parity-bridge.js +90 -0
  178. package/dist/scorers-verify-parity.d.ts +81 -0
  179. package/dist/scorers-verify-parity.d.ts.map +1 -0
  180. package/dist/scorers-verify-parity.js +502 -0
  181. package/dist/scores-accept-cli.d.ts +21 -0
  182. package/dist/scores-accept-cli.d.ts.map +1 -0
  183. package/dist/secret-redaction.d.ts +47 -0
  184. package/dist/secret-redaction.d.ts.map +1 -0
  185. package/dist/session-timeline.d.ts +54 -0
  186. package/dist/session-timeline.d.ts.map +1 -0
  187. package/dist/setup-prompt.d.ts +5 -0
  188. package/dist/setup-prompt.d.ts.map +1 -0
  189. package/dist/skill-installer.d.ts +68 -0
  190. package/dist/skill-installer.d.ts.map +1 -0
  191. package/dist/skilled-proposer-config.d.ts +2 -0
  192. package/dist/skilled-proposer-config.d.ts.map +1 -0
  193. package/dist/skilled-proposer-config.js +212 -0
  194. package/dist/skilled-proposer-launch.d.ts +11 -0
  195. package/dist/skilled-proposer-launch.d.ts.map +1 -0
  196. package/dist/skilled-proposer-launch.js +124 -0
  197. package/dist/smoke.d.ts +102 -0
  198. package/dist/smoke.d.ts.map +1 -0
  199. package/dist/start-intent.d.ts +12 -0
  200. package/dist/start-intent.d.ts.map +1 -0
  201. package/dist/task-assignment-manifest.d.ts +15 -0
  202. package/dist/task-assignment-manifest.d.ts.map +1 -0
  203. package/dist/task-create-error.d.ts +18 -0
  204. package/dist/task-create-error.d.ts.map +1 -0
  205. package/dist/team-connectors-cli.d.ts +29 -0
  206. package/dist/team-connectors-cli.d.ts.map +1 -0
  207. package/dist/types.d.ts +39 -0
  208. package/dist/types.d.ts.map +1 -0
  209. package/dist/vercel-sandbox-provider.d.ts +156 -0
  210. package/dist/vercel-sandbox-provider.d.ts.map +1 -0
  211. package/dist/workbench-cli.d.ts +233 -0
  212. package/dist/workbench-cli.d.ts.map +1 -0
  213. package/dist/workspace-sync.d.ts +207 -0
  214. package/dist/workspace-sync.d.ts.map +1 -0
  215. package/dist/workspace.d.ts +92 -0
  216. package/dist/workspace.d.ts.map +1 -0
  217. package/dist/zip-draft-push.d.ts +55 -0
  218. package/dist/zip-draft-push.d.ts.map +1 -0
  219. package/package.json +14 -1
  220. package/requirements/README.md +138 -0
  221. package/requirements/skilled-proposer.in +66 -0
  222. package/requirements/skilled-proposer.lock +265 -0
  223. package/scripts/ensure-skilled-proposer-venv.mjs +5 -0
  224. package/scripts/refresh-skilled-proposer-lock.mjs +256 -0
  225. package/src/diff-comments-cli.ts +4 -0
  226. package/src/gepa-engine-dispatch.ts +62 -2
  227. package/src/gepa-python-paths.ts +25 -4
  228. package/src/help.ts +127 -35
  229. package/src/index.ts +90 -164
  230. package/src/instruction-set-gepa-launch.ts +28 -0
  231. package/src/instruction-set-loader.ts +87 -0
  232. package/src/instruction-set-manifest.ts +120 -0
  233. package/src/instruction-sets-cli.ts +460 -0
  234. package/src/model-configs-cli.ts +119 -0
  235. package/src/optimizations-promote-cli.ts +41 -0
  236. package/src/prompt-label-cli.ts +55 -0
  237. package/src/prompt-summary-table.ts +12 -0
  238. package/src/runner-instruction-set-contract.ts +64 -0
  239. package/src/scorers-cli.ts +40 -0
  240. package/src/scorers-verify-parity-bridge.ts +90 -0
  241. package/src/scorers-verify-parity.ts +564 -0
  242. package/src/skilled-proposer-config.ts +191 -0
  243. package/src/skilled-proposer-launch.ts +147 -0
  244. package/src/skilled-proposer-venv-manager.mjs +757 -0
  245. package/tsconfig.json +2 -0
  246. package/vendor/orizu-gepa/src/orizu_gepa_connector/__init__.py +2 -1
  247. package/vendor/orizu-gepa/src/orizu_gepa_connector/adapter.py +8 -2
  248. package/vendor/orizu-gepa/src/orizu_gepa_connector/callbacks.py +17 -3
  249. package/vendor/orizu-gepa/src/orizu_gepa_connector/engine.py +133 -8
  250. package/vendor/orizu-gepa/src/orizu_gepa_connector/instruction_set_loader.py +80 -0
  251. package/vendor/orizu-gepa/src/orizu_gepa_connector/reflection.py +92 -12
  252. package/vendor/orizu-gepa/src/orizu_gepa_connector/runtime.py +100 -22
  253. package/vendor/orizu-gepa/src/orizu_gepa_connector/skilled_proposer_bridge.py +730 -0
  254. package/vendor/orizu-gepa/src/orizu_gepa_connector/stop_conditions.py +17 -0
  255. package/vendor/orizu-gepa/src/orizu_gepa_connector/translator.py +2 -1
  256. package/vendor/orizu-gepa-python/src/orizu_gepa/client.py +52 -7
  257. package/vendor/orizu-gepa-python/src/orizu_gepa/local_log.py +4 -1
  258. package/vendor/orizu-gepa-python/src/orizu_gepa/optimizer.py +10 -5
  259. package/vendor/orizu-gepa-python/src/orizu_gepa/reflection.py +323 -68
  260. package/vendor/orizu-gepa-python/src/orizu_gepa/runner.py +207 -13
  261. package/vendor/skills/orizu-cli/SKILL.md +51 -15
  262. package/vendor/skills/orizu-cli/references/building-judges.md +2 -2
  263. package/vendor/skills/orizu-cli/references/cli-reference.md +116 -3
  264. package/vendor/skills/orizu-cli/references/instructions-after-prompts.md +120 -0
  265. package/vendor/skills/orizu-cli/references/migrate-existing-gepa-setup.md +363 -0
  266. package/vendor/skills/orizu-cli/references/optimization-reports.md +16 -11
  267. package/vendor/skills/orizu-cli/references/optimization-with-gepa.md +50 -24
  268. package/vendor/skills/orizu-cli/references/primer.md +21 -5
  269. package/vendor/skills/orizu-cli/references/prompt-control-plane.md +208 -61
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Transport-agnostic deploy-key merge core (ALI-1084, merge-sandbox-job
3
+ * Phase 0). Extracted VERBATIM from `lib/git-ssh-merge.ts` so both the server
4
+ * (`lib/`) and the published CLI (`orizu internal merge-job`, Phase 2) run the
5
+ * EXACT SAME merge logic — no forked implementations, one place where the
6
+ * ADR-007 §4 `--no-ff` invariant is asserted on the exact argv.
7
+ *
8
+ * DELIBERATELY NO `import 'server-only'`: this module runs inside the one-shot
9
+ * merge sandbox (a plain Node process) as well as on the server. It must not
10
+ * import anything outside the CLI package root (bun-bundled) — node builtins
11
+ * only. `lib/git-ssh-merge.ts` re-exports everything here so every existing
12
+ * server import path and test keeps working unchanged.
13
+ *
14
+ * SECURITY PROPERTIES (unchanged from the lib original):
15
+ * - throwaway temp worktree + isolated SSH identity (key file mode 0600);
16
+ * - pinned GitHub host keys (StrictHostKeyChecking=yes, own known_hosts);
17
+ * - expected-head verification: the merge targets the REVIEWED SHA, never a
18
+ * branch name;
19
+ * - `merge-base --is-ancestor` alreadyMerged idempotency check;
20
+ * - argv-asserted commit-preserving `--no-ff` merge (ADR-007 §4).
21
+ */
22
+ export interface MergeBranchWithDeployKeyInput {
23
+ base: string;
24
+ sourceBranch: string;
25
+ expectedHeadSha: string;
26
+ commitMessage: string;
27
+ privateKeyPem: string;
28
+ }
29
+ export interface GitCommandResult {
30
+ exitCode: number;
31
+ stdout: string;
32
+ stderr: string;
33
+ }
34
+ export type GitCommandRunner = (args: string[], options: {
35
+ cwd: string;
36
+ env: NodeJS.ProcessEnv;
37
+ }) => Promise<GitCommandResult>;
38
+ export interface MergeBranchWithDeployKeyDeps {
39
+ runGit?: GitCommandRunner;
40
+ /**
41
+ * D8 pre-push gate (merge-sandbox-job Phase 2): called IMMEDIATELY before
42
+ * `git push`, after the merge commit exists locally. Returning `false`
43
+ * aborts WITHOUT pushing (`superseded: true` in the result) — a manifest
44
+ * rejected while the job was in flight must never reach `main`. Absent
45
+ * (the local/server executor), the merge pushes unconditionally as before.
46
+ */
47
+ prePushGate?: () => Promise<boolean>;
48
+ }
49
+ /**
50
+ * The merge outcome contract. Structurally identical to `MergeResult` in
51
+ * `lib/github-repo-ops.ts` (which cannot be imported from the CLI package —
52
+ * it is server-only); TypeScript's structural typing keeps the two
53
+ * assignable, and `lib/git-ssh-merge.ts` continues to expose the lib-side
54
+ * type to server callers.
55
+ */
56
+ export interface DeployKeyMergeResult {
57
+ merged: boolean;
58
+ sha: string | null;
59
+ /** true when the base already contained head (GitHub 204 equivalent). */
60
+ alreadyMerged: boolean;
61
+ /** true when git reported a merge conflict (409 equivalent). */
62
+ conflict: boolean;
63
+ /** true when the D8 pre-push gate refused the push (manifest no longer
64
+ * appliable) — the merge commit was built but NEVER pushed. */
65
+ superseded?: boolean;
66
+ status: number;
67
+ }
68
+ /**
69
+ * Assert a git invocation is the commit-preserving seal merge ADR-007 §4
70
+ * requires. Called on the exact argv the merge runs with, so the invariant is
71
+ * enforced where the merge happens rather than by reviewer vigilance.
72
+ */
73
+ export declare function assertCommitPreservingMergeArgs(args: readonly string[]): void;
74
+ /**
75
+ * Strip git's repo-context env vars from a child git's environment. Git
76
+ * EXPORTS these into hook subprocesses (from a linked worktree, GIT_DIR is an
77
+ * ABSOLUTE path into the shared .git), so any descendant git command that
78
+ * inherits the parent env operates on THAT repo instead of its own cwd —
79
+ * `git config` writes land in the shared .git/config and `git init` flips it
80
+ * to core.bare=true (both observed when the pre-push hook ran the test suite
81
+ * from a worktree). Every real-git spawn must build its env through this.
82
+ */
83
+ export declare function scrubGitRepoContextEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
84
+ export declare function defaultRunGit(args: string[], options: {
85
+ cwd: string;
86
+ env: NodeJS.ProcessEnv;
87
+ }): Promise<GitCommandResult>;
88
+ export declare function sshRemote(repoFullName: string): string;
89
+ /**
90
+ * The SSH-over-the-HTTPS-port remote (GitHub-supported: `ssh.github.com:443`
91
+ * speaks the same SSH protocol, same auth, same host-key set). The MERGE core
92
+ * uses this endpoint because the merge sandbox's egress firewall enforces at
93
+ * the SNI/CIDR layer and reset raw SSH on :22 in the first live run
94
+ * (ALI-1084); :443 within GitHub's published git CIDRs is the compatible
95
+ * path. Equivalent from dev machines, so local/sandbox parity holds (D6).
96
+ * The push/read paths (D9/Phase 6) keep `sshRemote` untouched.
97
+ */
98
+ export declare function sshRemoteOverHttpsPort(repoFullName: string): string;
99
+ /** Exported for `lib/git-ssh-merge.ts` (pushFilesWithDeployKey keeps living
100
+ * there — D9 scopes the push path as a follow-on, not part of the core). */
101
+ export declare function assertGitOk(result: GitCommandResult, operation: string): void;
102
+ export interface DeployKeyGitContext {
103
+ dir: string;
104
+ git: (args: string[]) => Promise<GitCommandResult>;
105
+ gitOk: (args: string[], operation: string) => Promise<GitCommandResult>;
106
+ }
107
+ /**
108
+ * Run a callback inside a throwaway git worktree wired to the repo's merge
109
+ * deploy key (isolated SSH identity + pinned GitHub host keys). Exported for
110
+ * the ADR-007 read path (lib/artifact-git-read.ts), which reuses the same
111
+ * clone/pack infrastructure for bulk artifact reads.
112
+ */
113
+ export declare function withDeployKeyGit<T>(privateKeyPem: string, runGit: GitCommandRunner, tempPrefix: string, callback: (context: DeployKeyGitContext) => Promise<T>): Promise<T>;
114
+ /**
115
+ * Merge a reviewed session/revert branch head into the default branch using the
116
+ * server-only merge deploy key. The source branch is fetched only so GitHub can
117
+ * prove the reviewed SHA is still the branch tip; the merge itself targets the
118
+ * expected SHA, preserving the manifest CAS guarantee.
119
+ */
120
+ export declare function mergeBranchWithDeployKey(repoFullName: string, input: MergeBranchWithDeployKeyInput, deps?: MergeBranchWithDeployKeyDeps): Promise<DeployKeyMergeResult>;
121
+ //# sourceMappingURL=deploy-key-merge-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-key-merge-core.d.ts","sourceRoot":"","sources":["../src/deploy-key-merge-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,gBAAgB,GAAG,CAC7B,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,KAC7C,OAAO,CAAC,gBAAgB,CAAC,CAAA;AAE9B,MAAM,WAAW,4BAA4B;IAC3C,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CACrC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAA;IACf,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,yEAAyE;IACzE,aAAa,EAAE,OAAO,CAAA;IACtB,gEAAgE;IAChE,QAAQ,EAAE,OAAO,CAAA;IACjB;oEACgE;IAChE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;CACf;AAaD;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAgB7E;AA0BD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAAC,UAAU,CAS9F;AAID,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,GAC/C,OAAO,CAAC,gBAAgB,CAAC,CAgB3B;AAED,wBAAgB,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAKnE;AAMD;6EAC6E;AAC7E,wBAAgB,WAAW,CAAC,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAI7E;AAOD,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAClD,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;CACxE;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,CAAC,CAAC,GACrD,OAAO,CAAC,CAAC,CAAC,CAwCZ;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,6BAA6B,EACpC,IAAI,GAAE,4BAAiC,GACtC,OAAO,CAAC,oBAAoB,CAAC,CAsE/B"}
@@ -0,0 +1,12 @@
1
+ export interface DiffCommentsCliContext {
2
+ getArg: (name: string) => string | null;
3
+ rejectDashPrefixedOptionValue: (name: string, value: string | null) => void;
4
+ authedFetch: (path: string, init?: RequestInit) => Promise<Response>;
5
+ parseJsonResponse: <T>(response: Response, context: string) => Promise<T>;
6
+ hasJsonFlag: () => boolean;
7
+ printJson: (value: Record<string, unknown>) => void;
8
+ printLine: (message?: string) => void;
9
+ sanitizeTerminalText: (value: unknown) => string;
10
+ }
11
+ export declare function diffCommentsCommand(ctx: DiffCommentsCliContext): Promise<void>;
12
+ //# sourceMappingURL=diff-comments-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-comments-cli.d.ts","sourceRoot":"","sources":["../src/diff-comments-cli.ts"],"names":[],"mappings":"AAyFA,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAA;IACvC,6BAA6B,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC3E,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpE,iBAAiB,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;IACzE,WAAW,EAAE,MAAM,OAAO,CAAA;IAC1B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IACnD,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,oBAAoB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAA;CACjD;AAwTD,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,sBAAsB,iBAiBpE"}
@@ -198,6 +198,9 @@ function printDiffComments(ctx, payload) {
198
198
  `${sanitizeHumanInlineText(ctx.sanitizeTerminalText, comment.anchor.side)} line ` +
199
199
  `${sanitizeHumanInlineText(ctx.sanitizeTerminalText, String(comment.anchor.line + 1))}`);
200
200
  printHumanTextBlock(ctx, comment.body);
201
+ if (typeof comment.componentKey === 'string' && comment.componentKey) {
202
+ ctx.printLine(` Component: ${sanitizeHumanInlineText(ctx.sanitizeTerminalText, comment.componentKey)}`);
203
+ }
201
204
  if (comment.contextUnavailableReason) {
202
205
  ctx.printLine(` Context unavailable: ${sanitizeHumanInlineText(ctx.sanitizeTerminalText, comment.contextUnavailableReason)}`);
203
206
  if (comment.context) {
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Per-team ADDITIVE egress allowlist CLI (ALI-1006 / G5):
3
+ * orizu team egress-allowlist <team> # show extra domains
4
+ * orizu team egress-allowlist <team> --add <domain>
5
+ * orizu team egress-allowlist <team> --remove <domain>
6
+ * orizu team egress-allowlist <team> --set a.com,b.com
7
+ * orizu team egress-allowlist <team> --clear
8
+ *
9
+ * The BASE allowlist (Orizu API + model provider + git host) is code-owned and
10
+ * NOT shown/managed here — this surface only widens a team's egress with domains
11
+ * a customer workflow needs. Human ADMIN only: the server rejects agent bearers
12
+ * and non-admins (the definer RPC gates on is_team_admin). Pure command logic
13
+ * with an injected fetcher.
14
+ */
15
+ export type CliFetcher = (path: string, init?: RequestInit) => Promise<Response>;
16
+ export interface EgressAllowlistCommandIo {
17
+ json: boolean;
18
+ print: (line: string) => void;
19
+ printErr?: (line: string) => void;
20
+ fetcher?: CliFetcher;
21
+ }
22
+ export declare function egressAllowlistCommand(args: string[], io: EgressAllowlistCommandIo): Promise<number>;
23
+ //# sourceMappingURL=egress-allowlist-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"egress-allowlist-cli.d.ts","sourceRoot":"","sources":["../src/egress-allowlist-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAWH,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEhF,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,OAAO,CAAC,EAAE,UAAU,CAAA;CACrB;AAiID,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4D1G"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * G5 — sandbox egress policy builder (ALI-1006, per the hosted-agent threat
3
+ * model T1). Owns the ALLOWLIST CONTENT the `SandboxProvider` seam plumbs to the
4
+ * sandbox firewall at create (`packages/cli/src/vercel-sandbox-provider.ts` →
5
+ * Vercel `networkPolicy`). The Vercel adapter is a pass-through; this file is
6
+ * where "default-deny with a per-team allowlist (Orizu API, model providers, git
7
+ * host); blocked attempts logged" is actually decided.
8
+ *
9
+ * The policy is DEFAULT-DENY: the record form `{ allow: { host: rules } }` denies
10
+ * everything NOT explicitly listed, so the correctness invariant is simply that
11
+ * we NEVER emit a `"*"` allow entry (which would re-open the sandbox). The
12
+ * model-key credential broker (G3 / `buildModelKeyBrokerPolicy`) is COMPOSED onto
13
+ * the model host's rule here so brokering + allowlisting are ONE coherent policy,
14
+ * not two policies that could disagree.
15
+ *
16
+ * SNI matching (verified against @vercel/sandbox@1.10.2 `NetworkPolicy`): an
17
+ * allow entry matches the exact SNI host; a LEADING-wildcard entry (`*.orizu.ai`)
18
+ * matches any single-or-multi-label subdomain but NOT the apex — so a host that
19
+ * must serve BOTH apex and subdomains is listed twice (`orizu.ai` +
20
+ * `*.orizu.ai`). Domains are hostnames only — never a protocol, path, or port.
21
+ *
22
+ * The BASE allowlist (Orizu API + model provider + git host) is CODE-OWNED and
23
+ * non-negotiable: `buildEgressPolicy` always includes it and per-team config can
24
+ * only ADD to it, never remove a base host. See
25
+ * docs/requirements/hosted-customer-workbench/sandbox-egress-policy.md for the
26
+ * rationale per host and the honest statement of what Vercel enforces (firewall,
27
+ * SNI-level) vs. what we generate (blocked-attempt evidence via the canary).
28
+ */
29
+ import type { SandboxEgressPolicy } from './sandbox-provider.js';
30
+ /** Default model-provider endpoint (Anthropic) the broker injects a key for. */
31
+ export declare const ANTHROPIC_API_HOST = "api.anthropic.com";
32
+ /** Anthropic authenticates with `x-api-key` (not a Bearer Authorization). */
33
+ export declare const ANTHROPIC_API_KEY_HEADER = "x-api-key";
34
+ /** GitHub git-over-HTTPS SNIs. `git clone`/`git push` over the smart HTTP
35
+ * protocol connect to `github.com`; `codeload.github.com` serves repository
36
+ * archive/tarball fetches (release assets, `pip`/`go` github-archive installs).
37
+ * Both are allowed so the agent's git work AND any archive fetch its workflow
38
+ * triggers succeed — everything else on github's infra stays denied. */
39
+ export declare const GIT_HOST_DOMAINS: readonly ["github.com", "codeload.github.com"];
40
+ /** Default host the startup canary probes to PROVE the policy is live (a known
41
+ * non-allowlisted host: reaching it means egress is NOT enforced). */
42
+ export declare const DEFAULT_EGRESS_CANARY_HOST = "example.com";
43
+ /**
44
+ * Resolve the Orizu control-plane host from a base URL and CONSERVATIVELY
45
+ * wildcard its registrable base domain so the policy survives the API moving to
46
+ * a subdomain (e.g. `api.orizu.ai`) without re-opening egress. Returns the apex
47
+ * PLUS a leading-wildcard for its subdomains: `orizu.ai` + `*.orizu.ai`. A
48
+ * loopback/localhost base (rehearsal) yields just the bare host (no wildcard —
49
+ * there is nothing to broaden and the firewall does not enforce it anyway).
50
+ */
51
+ export declare function orizuEgressDomains(baseUrl: string | undefined): string[];
52
+ /**
53
+ * Normalize a per-team extra domain to a bare hostname (or leading-wildcard).
54
+ * Strips protocol/path/port, lowercases, and validates the SNI shape. Returns
55
+ * null for anything that is not a plausible hostname so a bad config entry is
56
+ * dropped rather than silently widening the policy in an unexpected way.
57
+ */
58
+ export declare function normalizeEgressDomain(input: string): string | null;
59
+ export interface EgressModelKeyBroker {
60
+ /** The raw model API key. It lives ONLY in the policy the host sends to the
61
+ * firewall control plane; it never enters the sandbox env/disk/run events. */
62
+ apiKey: string;
63
+ /** Domain to inject the key for (default api.anthropic.com). */
64
+ host?: string;
65
+ /** Header the endpoint authenticates with (default x-api-key). */
66
+ headerName?: string;
67
+ }
68
+ export interface BuildEgressPolicyOptions {
69
+ /** Orizu control-plane base URL (default env ORIZU_BASE_URL / orizu.ai). */
70
+ orizuBaseUrl?: string;
71
+ /** Additional model-provider hosts to allow WITHOUT a key transform. The broker
72
+ * host (below) is added automatically; list only extra providers here. */
73
+ modelHosts?: readonly string[];
74
+ /** Compose the G3 model-key broker transform onto its host's allow rule, so
75
+ * brokering and the allowlist are one policy. */
76
+ modelKeyBroker?: EgressModelKeyBroker;
77
+ /** Per-team ADDITIVE domains (a customer's own API a workflow needs). Base
78
+ * hosts can never be removed; these only widen. Invalid entries are dropped. */
79
+ extraDomains?: readonly string[];
80
+ /** Exact server-derived Git remote hosts needed in addition to the legacy
81
+ * GitHub migration hosts. Artifacts account hosts are passed here only after
82
+ * strict remote validation; never use a broad wildcard. */
83
+ repositoryHosts?: readonly string[];
84
+ }
85
+ /**
86
+ * Compute the ordered list of BASE (code-owned, non-removable) allow domains for
87
+ * an Orizu base URL: the Orizu control-plane host(s), the model provider host,
88
+ * and the git host(s). Exported so tests and the policy doc assert the exact set.
89
+ */
90
+ export declare function baseEgressDomains(opts?: {
91
+ orizuBaseUrl?: string;
92
+ modelHost?: string;
93
+ modelHosts?: readonly string[];
94
+ repositoryHosts?: readonly string[];
95
+ }): string[];
96
+ /**
97
+ * Build a DEFAULT-DENY Vercel network policy whose allowlist is exactly the base
98
+ * hosts (Orizu API + model provider + git) plus any valid per-team extra domains,
99
+ * with the model-key broker transform COMPOSED onto the model host's rule.
100
+ *
101
+ * Correctness invariants (unit-tested):
102
+ * - record form → default-deny (no `"*"` key is EVER emitted);
103
+ * - every base host is present;
104
+ * - the broker transform sits on the model host's rule (one coherent policy);
105
+ * - base hosts survive regardless of `extraDomains` (cannot be removed).
106
+ */
107
+ export declare function buildEgressPolicy(opts?: BuildEgressPolicyOptions): SandboxEgressPolicy;
108
+ //# sourceMappingURL=egress-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"egress-policy.d.ts","sourceRoot":"","sources":["../src/egress-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAqB,MAAM,uBAAuB,CAAA;AAEnF,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,sBAAsB,CAAA;AACrD,6EAA6E;AAC7E,eAAO,MAAM,wBAAwB,cAAc,CAAA;AAEnD;;;;yEAIyE;AACzE,eAAO,MAAM,gBAAgB,gDAAiD,CAAA;AAE9E;uEACuE;AACvE,eAAO,MAAM,0BAA0B,gBAAgB,CAAA;AAKvD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAwBxE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAelE;AAED,MAAM,WAAW,oBAAoB;IACnC;mFAC+E;IAC/E,MAAM,EAAE,MAAM,CAAA;IACd,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;+EAC2E;IAC3E,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9B;sDACkD;IAClD,cAAc,CAAC,EAAE,oBAAoB,CAAA;IACrC;qFACiF;IACjF,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC;;+DAE2D;IAC3D,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACpC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE;IACtC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9B,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC/B,GAAG,MAAM,EAAE,CAuBhB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,wBAA6B,GAAG,mBAAmB,CA6B1F"}
@@ -0,0 +1,9 @@
1
+ interface ErrorResponsePayload {
2
+ error?: string;
3
+ }
4
+ export declare function isJsonErrorResponsePayload(response: Response, payload: unknown): payload is ErrorResponsePayload & {
5
+ error: string;
6
+ };
7
+ export declare function extractErrorMessage(response: Response): Promise<string>;
8
+ export {};
9
+ //# sourceMappingURL=error-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-response.d.ts","sourceRoot":"","sources":["../src/error-response.ts"],"names":[],"mappings":"AAEA,UAAU,oBAAoB;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAID,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,oBAAoB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CASrD;AAMD,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAa7E"}
@@ -0,0 +1,5 @@
1
+ export declare function parseDatasetFile(filePath: string): {
2
+ rows: Array<Record<string, unknown>>;
3
+ sourceType: 'csv' | 'json' | 'jsonl';
4
+ };
5
+ //# sourceMappingURL=file-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-parser.d.ts","sourceRoot":"","sources":["../src/file-parser.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG;IAClD,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACpC,UAAU,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAA;CACrC,CA6DA"}
@@ -0,0 +1,9 @@
1
+ export type GepaEngine = 'official' | 'legacy';
2
+ export interface GepaEngineDispatch {
3
+ engine: GepaEngine;
4
+ args: string[];
5
+ environment: NodeJS.ProcessEnv;
6
+ module: string;
7
+ }
8
+ export declare function dispatchGepaEngine(args: string[], project: string, environment: NodeJS.ProcessEnv): GepaEngineDispatch;
9
+ //# sourceMappingURL=gepa-engine-dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gepa-engine-dispatch.d.ts","sourceRoot":"","sources":["../src/gepa-engine-dispatch.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAA;AAE9C,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,UAAU,CAAA;IAClB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,WAAW,EAAE,MAAM,CAAC,UAAU,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;CACf;AAyUD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,UAAU,GAAG,kBAAkB,CAmBtH"}
@@ -1,4 +1,5 @@
1
1
  import { existsSync, readFileSync } from 'fs';
2
+ import { normalizedSkilledProposerConfig } from './skilled-proposer-config.js';
2
3
  const VALUE_OPTIONS = [
3
4
  { flag: '--optimizer-version-id', environment: 'ORIZU_OPTIMIZER_VERSION_ID' },
4
5
  { flag: '--candidate-version-id', environment: 'ORIZU_PROMPT_VERSION_ID' },
@@ -16,6 +17,8 @@ const VALUE_OPTIONS = [
16
17
  { flag: '--budget', environment: 'ORIZU_BUDGET' },
17
18
  { flag: '--max-iterations', environment: 'ORIZU_MAX_ITERATIONS' },
18
19
  { flag: '--max-candidate-proposals', environment: 'ORIZU_MAX_CANDIDATE_PROPOSALS' },
20
+ { flag: '--proposal-max-calls', environment: 'ORIZU_PROPOSAL_MAX_CALLS' },
21
+ { flag: '--proposal-max-tokens', environment: 'ORIZU_PROPOSAL_MAX_TOKENS' },
19
22
  { flag: '--max-full-evals', environment: 'ORIZU_MAX_FULL_EVALS' },
20
23
  { flag: '--max-metric-calls', environment: 'ORIZU_MAX_METRIC_CALLS' },
21
24
  { flag: '--minibatch-size', environment: 'ORIZU_MINIBATCH_SIZE' },
@@ -33,6 +36,8 @@ const VALUE_OPTIONS = [
33
36
  { flag: '--seed', environment: 'ORIZU_SEED' },
34
37
  { flag: '--promotion-label', environment: 'ORIZU_PROMOTION_LABEL', allowEmpty: true },
35
38
  { flag: '--log-dir', environment: 'ORIZU_LOCAL_LOG_DIR' },
39
+ { flag: '--instruction-set', environment: 'ORIZU_INSTRUCTION_SET_NAME' },
40
+ { flag: '--model-config', environment: 'ORIZU_MODEL_CONFIG_IDENTITY' },
36
41
  ];
37
42
  const BOOLEAN_OPTIONS = [
38
43
  ['--allow-degenerate-seed', 'ORIZU_ALLOW_DEGENERATE_SEED', '1'],
@@ -139,6 +144,13 @@ const CONTROLLED_ENVIRONMENT_NAMES = new Set([
139
144
  'ORIZU_SAMPLING_STRATEGY',
140
145
  'ORIZU_SELECTION_STRATEGY',
141
146
  'ORIZU_MAX_PAYLOAD_CHARS',
147
+ 'ORIZU_INSTRUCTION_SET_PROFILE_VERSION_ID',
148
+ // Candidate selection is an explicit opt-in. Clearing it before option
149
+ // translation prevents an inherited environment from selecting a proposer
150
+ // on an otherwise byte-for-byte normal official-GEPA launch.
151
+ 'ORIZU_CANDIDATE_PROPOSER',
152
+ 'ORIZU_SKILLED_PROPOSER_CONFIG',
153
+ 'ORIZU_COMPONENT_SELECTOR',
142
154
  ]);
143
155
  function optionValueOrThrow(args, index, flag, allowEmpty = false) {
144
156
  const argument = args[index];
@@ -163,6 +175,9 @@ function translateOfficialOptions(args, project, environment) {
163
175
  }
164
176
  connectorEnvironment.ORIZU_PROJECT = project;
165
177
  let metadata;
178
+ let candidateProposerConfig;
179
+ let hasInstructionSet = false;
180
+ let hasCandidateVersion = false;
166
181
  const budgetFlags = [];
167
182
  for (let index = 0; index < args.length; index += 1) {
168
183
  const argument = args[index];
@@ -170,6 +185,8 @@ function translateOfficialOptions(args, project, environment) {
170
185
  throw new Error(`Unexpected run-gepa argument ${argument}`);
171
186
  }
172
187
  const flag = argument.includes('=') ? argument.slice(0, argument.indexOf('=')) : argument;
188
+ if (flag === '--candidate-version-id')
189
+ hasCandidateVersion = true;
173
190
  if (flag === '--project') {
174
191
  const parsed = optionValueOrThrow(args, index, flag);
175
192
  connectorEnvironment.ORIZU_PROJECT = parsed.value;
@@ -182,6 +199,21 @@ function translateOfficialOptions(args, project, environment) {
182
199
  index = parsed.nextIndex;
183
200
  continue;
184
201
  }
202
+ if (flag === '--candidate-proposer') {
203
+ const parsed = optionValueOrThrow(args, index, flag);
204
+ if (parsed.value !== 'skilled-proposer') {
205
+ throw new Error('--candidate-proposer must be skilled-proposer');
206
+ }
207
+ connectorEnvironment.ORIZU_CANDIDATE_PROPOSER = parsed.value;
208
+ index = parsed.nextIndex;
209
+ continue;
210
+ }
211
+ if (flag === '--candidate-proposer-config') {
212
+ const parsed = optionValueOrThrow(args, index, flag);
213
+ candidateProposerConfig = parsed.value;
214
+ index = parsed.nextIndex;
215
+ continue;
216
+ }
185
217
  const option = VALUE_OPTIONS_BY_FLAG.get(flag);
186
218
  if (option) {
187
219
  const parsed = optionValueOrThrow(args, index, flag, option.allowEmpty);
@@ -203,6 +235,16 @@ function translateOfficialOptions(args, project, environment) {
203
235
  connectorEnvironment[option.environment] = option.json
204
236
  ? jsonObjectValue(parsed.value, option.flag)
205
237
  : option.readFile ? textValue(parsed.value) : parsed.value;
238
+ if (flag === '--instruction-set')
239
+ hasInstructionSet = true;
240
+ index = parsed.nextIndex;
241
+ continue;
242
+ }
243
+ if (flag === '--component-selector') {
244
+ const parsed = optionValueOrThrow(args, index, flag);
245
+ if (!['round-robin', 'all'].includes(parsed.value))
246
+ throw new Error('--component-selector must be one of round-robin, all');
247
+ connectorEnvironment.ORIZU_COMPONENT_SELECTOR = parsed.value.replace('-', '_');
206
248
  index = parsed.nextIndex;
207
249
  continue;
208
250
  }
@@ -222,6 +264,27 @@ function translateOfficialOptions(args, project, environment) {
222
264
  if (budgetFlags.length > 1) {
223
265
  throw new Error('Budget options are mutually exclusive; choose at most one of --budget, --max-metric-calls, --max-full-evals, --max-iterations, --max-candidate-proposals');
224
266
  }
267
+ if (hasInstructionSet && hasCandidateVersion)
268
+ throw new Error('--instruction-set and --candidate-version-id are mutually exclusive');
269
+ if (hasInstructionSet && connectorEnvironment.ORIZU_MODEL_CONFIG_IDENTITY === undefined)
270
+ throw new Error('--instruction-set requires --model-config');
271
+ if (hasInstructionSet && connectorEnvironment.ORIZU_COMPONENT_SELECTOR === undefined)
272
+ connectorEnvironment.ORIZU_COMPONENT_SELECTOR = 'round_robin';
273
+ if ((connectorEnvironment.ORIZU_PROPOSAL_MAX_CALLS !== undefined
274
+ || connectorEnvironment.ORIZU_PROPOSAL_MAX_TOKENS !== undefined)
275
+ && connectorEnvironment.ORIZU_CANDIDATE_PROPOSER !== 'skilled-proposer') {
276
+ throw new Error('--proposal-max-calls and --proposal-max-tokens require --candidate-proposer skilled-proposer');
277
+ }
278
+ if (candidateProposerConfig !== undefined) {
279
+ if (connectorEnvironment.ORIZU_CANDIDATE_PROPOSER !== 'skilled-proposer') {
280
+ throw new Error('--candidate-proposer-config requires --candidate-proposer skilled-proposer');
281
+ }
282
+ connectorEnvironment.ORIZU_SKILLED_PROPOSER_CONFIG = normalizedSkilledProposerConfig(candidateProposerConfig);
283
+ }
284
+ if (connectorEnvironment.ORIZU_CANDIDATE_PROPOSER === 'skilled-proposer'
285
+ && connectorEnvironment.ORIZU_REFLECTION_PROMPT_TEMPLATE !== undefined) {
286
+ throw new Error('--reflection-prompt-template is incompatible with --candidate-proposer skilled-proposer');
287
+ }
225
288
  const reflectionModel = connectorEnvironment.ORIZU_REFLECTION_MODEL ?? 'anthropic/claude-opus-4-7';
226
289
  if (!reflectionModel.startsWith('openai/') && connectorEnvironment.ORIZU_REFLECTION_MAX_TOKENS === undefined) {
227
290
  throw new Error('--reflection-max-tokens is required for Anthropic reflection models');
@@ -245,8 +308,10 @@ function validatedMetadata(raw) {
245
308
  export function dispatchGepaEngine(args, project, environment) {
246
309
  const selected = removeEngine(args);
247
310
  if (selected.engine === 'legacy') {
248
- if (selected.args.some(argument => argument === '--max-candidate-proposals' || argument.startsWith('--max-candidate-proposals='))) {
249
- throw new Error('--max-candidate-proposals is supported by the official GEPA engine only');
311
+ for (const flag of ['--instruction-set', '--model-config', '--component-selector', '--max-candidate-proposals', '--candidate-proposer', '--candidate-proposer-config', '--proposal-max-calls', '--proposal-max-tokens']) {
312
+ if (selected.args.some(argument => argument === flag || argument.startsWith(`${flag}=`))) {
313
+ throw new Error(`${flag} is supported by the official GEPA engine only`);
314
+ }
250
315
  }
251
316
  validateLegacyMetadata(selected.args);
252
317
  return {
@@ -0,0 +1,6 @@
1
+ export interface GepaPythonCommand {
2
+ python: string;
3
+ args: string[];
4
+ }
5
+ export declare function getGepaPythonCommand(args: string[], environment: NodeJS.ProcessEnv): GepaPythonCommand;
6
+ //# sourceMappingURL=gepa-python-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gepa-python-command.d.ts","sourceRoot":"","sources":["../src/gepa-python-command.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,EAAE,CAAA;CACf;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,CAAC,UAAU,GAAG,iBAAiB,CAyBtG"}
@@ -0,0 +1,6 @@
1
+ export declare function resolveGepaPythonPath(candidates: string[], pathExists?: (candidate: string) => boolean): string | null;
2
+ export declare function bundledOrizuGepaPythonPath(): string | null;
3
+ export declare function bundledOrizuGepaConnectorPythonPath(): string | null;
4
+ export declare function bundledOfficialGepaPythonPath(): string | null;
5
+ export declare function getGepaPythonPathEntries(existingPythonPath: string | undefined): string[];
6
+ //# sourceMappingURL=gepa-python-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gepa-python-paths.d.ts","sourceRoot":"","sources":["../src/gepa-python-paths.ts"],"names":[],"mappings":"AAaA,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAAE,EACpB,UAAU,GAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAoB,GACtD,MAAM,GAAG,IAAI,CAEf;AAED,wBAAgB,0BAA0B,IAAI,MAAM,GAAG,IAAI,CAM1D;AAED,wBAAgB,mCAAmC,IAAI,MAAM,GAAG,IAAI,CAMnE;AAED,wBAAgB,6BAA6B,IAAI,MAAM,GAAG,IAAI,CA0B7D;AAED,wBAAgB,wBAAwB,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CASzF"}
@@ -1,4 +1,5 @@
1
1
  import { existsSync } from 'fs';
2
+ import { execFileSync } from 'child_process';
2
3
  import { fileURLToPath } from 'url';
3
4
  import { isOrizuSourceCheckout } from '../scripts/orizu-source-checkout.mjs';
4
5
  function prefersLiveSource() {
@@ -23,10 +24,31 @@ export function bundledOrizuGepaConnectorPythonPath() {
23
24
  return resolveGepaPythonPath(candidates);
24
25
  }
25
26
  export function bundledOfficialGepaPythonPath() {
26
- const candidates = [
27
- fileURLToPath(new URL('../vendor/gepa-python/src', import.meta.url)),
28
- ];
29
- return resolveGepaPythonPath(candidates);
27
+ const vendor = fileURLToPath(new URL('../vendor/gepa-python/src', import.meta.url));
28
+ if (prefersLiveSource()) {
29
+ const requiredVendorFiles = [
30
+ fileURLToPath(new URL('../vendor/gepa-python/manifest.json', import.meta.url)),
31
+ fileURLToPath(new URL('../vendor/gepa-python/src/gepa/__init__.py', import.meta.url)),
32
+ fileURLToPath(new URL('../vendor/gepa-python/src/gepa/adapters/optimize_anything_adapter/optimize_anything_adapter.py', import.meta.url)),
33
+ ];
34
+ if (!requiredVendorFiles.every(existsSync)) {
35
+ const vendoringScript = fileURLToPath(new URL('../scripts/vendor-gepa-python.mjs', import.meta.url));
36
+ try {
37
+ execFileSync(process.execPath, [vendoringScript], { stdio: 'pipe' });
38
+ }
39
+ catch (error) {
40
+ const details = error instanceof Error ? error.message : String(error);
41
+ throw new Error(`Unable to materialize bundled official GEPA: ${details}`);
42
+ }
43
+ if (!requiredVendorFiles.every(existsSync)) {
44
+ throw new Error('Unable to materialize bundled official GEPA: extracted tree is incomplete');
45
+ }
46
+ }
47
+ }
48
+ // zipimport cannot resolve GEPA's namespace-package adapters on every
49
+ // supported Python minor. Both source and published CLIs execute only the
50
+ // verified tree materialized from the pinned wheel.
51
+ return resolveGepaPythonPath([vendor]);
30
52
  }
31
53
  export function getGepaPythonPathEntries(existingPythonPath) {
32
54
  const pythonPathEntries = [
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Git credential helper (ALI-971 / WS-D).
3
+ *
4
+ * Implements git's credential-helper protocol on stdin/stdout so teammates can
5
+ * `git pull`/`git push` the hosted workbench repo with NO GitHub identity: git
6
+ * asks this helper for a credential, we broker a short-lived, downscoped
7
+ * installation token from Orizu and hand it back as `x-access-token:<token>`.
8
+ * The token is never written to disk (60-min TTL is the backstop).
9
+ *
10
+ * Protocol: git runs `orizu git-credential <op>` where op is get|store|erase
11
+ * and feeds `key=value` lines on stdin terminated by a blank line. Only `get`
12
+ * does work; `store`/`erase` are no-ops. For `get` we respond only when the
13
+ * host is github.com AND the cwd resolves to an attached Orizu workspace —
14
+ * otherwise we stay silent so git falls through to its normal handling.
15
+ *
16
+ * Purpose selection: git does not tell us read-vs-write intent, so we mint
17
+ * `write` first (the common push case for curators) and fall back to `read` on
18
+ * a 403 (plain members). Pure logic + injected fetcher/io: index.ts stays thin.
19
+ */
20
+ export type GitCredentialFetcher = (path: string, init?: RequestInit) => Promise<Response>;
21
+ export interface GitCredentialIo {
22
+ stdin: string;
23
+ cwd: string;
24
+ print: (line: string) => void;
25
+ printErr: (line: string) => void;
26
+ fetcher?: GitCredentialFetcher;
27
+ /** Explicit workspace id (tests / clone-time). Overrides env + cwd lookup. */
28
+ workspaceId?: string;
29
+ /**
30
+ * Exact logical capability configured for this remote. Artifacts credentials
31
+ * require this value because Git's helper protocol does not identify whether
32
+ * an operation is a fetch or push and host-only selection is unsafe.
33
+ */
34
+ purpose?: RepoTokenPurpose;
35
+ /** Injectable clock for strict provider credential expiry validation. */
36
+ nowMs?: () => number;
37
+ }
38
+ export declare const REPO_TOKEN_PURPOSES: readonly ["read", "write"];
39
+ export type RepoTokenPurpose = (typeof REPO_TOKEN_PURPOSES)[number];
40
+ export interface GitCredentialInvocation {
41
+ readonly operation: 'get' | 'store' | 'erase';
42
+ readonly purpose: RepoTokenPurpose | null;
43
+ }
44
+ /**
45
+ * Git appends get/store/erase after the configured helper command, so an
46
+ * explicit path-aware configuration looks like:
47
+ * `!orizu git-credential --purpose=write`.
48
+ *
49
+ * Session credentials use the hosted runtime helper, which carries the
50
+ * server-bound session ID. This local helper deliberately accepts only
51
+ * sessionless developer read/write purposes.
52
+ */
53
+ export declare function parseGitCredentialInvocation(args: readonly string[]): GitCredentialInvocation | null;
54
+ export declare function runGitCredentialInvocation(args: readonly string[], io: GitCredentialIo): Promise<number>;
55
+ export declare function parseCredentialInput(stdin: string): Record<string, string>;
56
+ /**
57
+ * Walk up from `cwd` to the workspace root (the dir holding orizu.team.json) and
58
+ * return its bound workspace id, or null if this is not an attached workspace.
59
+ */
60
+ export declare function resolveAttachedWorkspaceId(cwd: string): string | null;
61
+ /**
62
+ * Resolve the workspace id, preferring an explicit override, then the
63
+ * `ORIZU_WORKSPACE_ID` env var (set during `git clone` so the helper works
64
+ * before the working tree — and thus orizu.team.json — exists), then the cwd
65
+ * manifest walk for steady-state pull/push.
66
+ */
67
+ export declare function resolveWorkspaceId(io: GitCredentialIo): string | null;
68
+ export declare function runGitCredential(op: string, io: GitCredentialIo): Promise<number>;
69
+ //# sourceMappingURL=git-credential.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-credential.d.ts","sourceRoot":"","sources":["../src/git-credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAE1F,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,OAAO,CAAC,EAAE,oBAAoB,CAAA;IAC9B,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,MAAM,CAAA;CACrB;AAmBD,eAAO,MAAM,mBAAmB,4BAGtB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEtC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,CAAA;IAC7C,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAC1C;AAQD;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,uBAAuB,GAAG,IAAI,CA8BhC;AAED,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,EAAE,eAAe,GAClB,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU1E;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA0BrE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAKrE;AA0RD,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CA+FvF"}