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.
- package/README.md +23 -0
- package/dist/archive-artifacts-cli.d.ts +50 -0
- package/dist/archive-artifacts-cli.d.ts.map +1 -0
- package/dist/artifact-archive.d.ts +48 -0
- package/dist/artifact-archive.d.ts.map +1 -0
- package/dist/artifact-pull.d.ts +22 -0
- package/dist/artifact-pull.d.ts.map +1 -0
- package/dist/banner.d.ts +3 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/connectors-cli.d.ts +31 -0
- package/dist/connectors-cli.d.ts.map +1 -0
- package/dist/credentials.d.ts +46 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/csv.d.ts +49 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/dataset-download.d.ts +6 -0
- package/dist/dataset-download.d.ts.map +1 -0
- package/dist/dataset-edit-rows.d.ts +10 -0
- package/dist/dataset-edit-rows.d.ts.map +1 -0
- package/dist/dataset-upload-snapshot.d.ts +13 -0
- package/dist/dataset-upload-snapshot.d.ts.map +1 -0
- package/dist/daytona-slice-rehearsal.d.ts +89 -0
- package/dist/daytona-slice-rehearsal.d.ts.map +1 -0
- package/dist/daytona-slice.d.ts +106 -0
- package/dist/daytona-slice.d.ts.map +1 -0
- package/dist/deploy-key-merge-core.d.ts +121 -0
- package/dist/deploy-key-merge-core.d.ts.map +1 -0
- package/dist/diff-comments-cli.d.ts +12 -0
- package/dist/diff-comments-cli.d.ts.map +1 -0
- package/dist/diff-comments-cli.js +21 -2
- package/dist/egress-allowlist-cli.d.ts +23 -0
- package/dist/egress-allowlist-cli.d.ts.map +1 -0
- package/dist/egress-policy.d.ts +108 -0
- package/dist/egress-policy.d.ts.map +1 -0
- package/dist/error-response.d.ts +9 -0
- package/dist/error-response.d.ts.map +1 -0
- package/dist/file-parser.d.ts +5 -0
- package/dist/file-parser.d.ts.map +1 -0
- package/dist/gepa-engine-dispatch.d.ts +9 -0
- package/dist/gepa-engine-dispatch.d.ts.map +1 -0
- package/dist/gepa-engine-dispatch.js +307 -0
- package/dist/gepa-python-command.d.ts +6 -0
- package/dist/gepa-python-command.d.ts.map +1 -0
- package/dist/gepa-python-command.js +26 -0
- package/dist/gepa-python-paths.d.ts +6 -0
- package/dist/gepa-python-paths.d.ts.map +1 -0
- package/dist/gepa-python-paths.js +42 -0
- package/dist/git-credential.d.ts +69 -0
- package/dist/git-credential.d.ts.map +1 -0
- package/dist/git-recovery-environment.d.ts +31 -0
- package/dist/git-recovery-environment.d.ts.map +1 -0
- package/dist/github-setup.d.ts +122 -0
- package/dist/github-setup.d.ts.map +1 -0
- package/dist/global-flags.d.ts +12 -0
- package/dist/global-flags.d.ts.map +1 -0
- package/dist/help.d.ts +46 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +93 -25
- package/dist/hosted-boot.d.ts +273 -0
- package/dist/hosted-boot.d.ts.map +1 -0
- package/dist/hosted-bootstrap-rehearsal.d.ts +86 -0
- package/dist/hosted-bootstrap-rehearsal.d.ts.map +1 -0
- package/dist/hosted-bootstrap.d.ts +188 -0
- package/dist/hosted-bootstrap.d.ts.map +1 -0
- package/dist/hosted-broker-server.d.ts +50 -0
- package/dist/hosted-broker-server.d.ts.map +1 -0
- package/dist/hosted-git-http-server.d.ts +36 -0
- package/dist/hosted-git-http-server.d.ts.map +1 -0
- package/dist/hosted-harness-claude.d.ts +195 -0
- package/dist/hosted-harness-claude.d.ts.map +1 -0
- package/dist/hosted-harness-opencode.d.ts +227 -0
- package/dist/hosted-harness-opencode.d.ts.map +1 -0
- package/dist/hosted-harness.d.ts +118 -0
- package/dist/hosted-harness.d.ts.map +1 -0
- package/dist/hosted-harvest.d.ts +68 -0
- package/dist/hosted-harvest.d.ts.map +1 -0
- package/dist/hosted-headless.d.ts +72 -0
- package/dist/hosted-headless.d.ts.map +1 -0
- package/dist/hosted-loop-lifecycle.d.ts +206 -0
- package/dist/hosted-loop-lifecycle.d.ts.map +1 -0
- package/dist/hosted-loop.d.ts +170 -0
- package/dist/hosted-loop.d.ts.map +1 -0
- package/dist/hosted-run-event-sink.d.ts +222 -0
- package/dist/hosted-run-event-sink.d.ts.map +1 -0
- package/dist/hosted-runtime-assets.d.ts +186 -0
- package/dist/hosted-runtime-assets.d.ts.map +1 -0
- package/dist/hosted-session-cli.d.ts +258 -0
- package/dist/hosted-session-cli.d.ts.map +1 -0
- package/dist/hosted-skill-staging.d.ts +73 -0
- package/dist/hosted-skill-staging.d.ts.map +1 -0
- package/dist/http.d.ts +8 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -129
- package/dist/instruction-set-gepa-launch.d.ts +3 -0
- package/dist/instruction-set-gepa-launch.d.ts.map +1 -0
- package/dist/instruction-set-gepa-launch.js +15 -0
- package/dist/instruction-set-loader.d.ts +6 -0
- package/dist/instruction-set-loader.d.ts.map +1 -0
- package/dist/instruction-set-loader.js +59 -0
- package/dist/instruction-set-manifest.d.ts +14 -0
- package/dist/instruction-set-manifest.d.ts.map +1 -0
- package/dist/instruction-set-manifest.js +162 -0
- package/dist/instruction-sets-cli.d.ts +40 -0
- package/dist/instruction-sets-cli.d.ts.map +1 -0
- package/dist/instruction-sets-cli.js +361 -0
- package/dist/json-response.d.ts +4 -0
- package/dist/json-response.d.ts.map +1 -0
- package/dist/jsonl-stream.d.ts +8 -0
- package/dist/jsonl-stream.d.ts.map +1 -0
- package/dist/kill-switch-cli.d.ts +30 -0
- package/dist/kill-switch-cli.d.ts.map +1 -0
- package/dist/loopback-serve.d.ts +25 -0
- package/dist/loopback-serve.d.ts.map +1 -0
- package/dist/manifests-cli.d.ts +22 -0
- package/dist/manifests-cli.d.ts.map +1 -0
- package/dist/markdown-report-input.d.ts +7 -0
- package/dist/markdown-report-input.d.ts.map +1 -0
- package/dist/markdown-report-input.js +15 -1
- package/dist/merge-job.d.ts +155 -0
- package/dist/merge-job.d.ts.map +1 -0
- package/dist/model-configs-cli.d.ts +19 -0
- package/dist/model-configs-cli.d.ts.map +1 -0
- package/dist/model-configs-cli.js +104 -0
- package/dist/optimization-export-cli.d.ts +19 -0
- package/dist/optimization-export-cli.d.ts.map +1 -0
- package/dist/optimizations-list-cli.d.ts +20 -0
- package/dist/optimizations-list-cli.d.ts.map +1 -0
- package/dist/optimizations-promote-cli.d.ts +8 -0
- package/dist/optimizations-promote-cli.d.ts.map +1 -0
- package/dist/optimizations-promote-cli.js +34 -0
- package/dist/option-validation.d.ts +15 -0
- package/dist/option-validation.d.ts.map +1 -0
- package/dist/preview-runtime.d.ts +63 -0
- package/dist/preview-runtime.d.ts.map +1 -0
- package/dist/prompt-draft-push.d.ts +60 -0
- package/dist/prompt-draft-push.d.ts.map +1 -0
- package/dist/prompt-label-cli.d.ts +11 -0
- package/dist/prompt-label-cli.d.ts.map +1 -0
- package/dist/prompt-label-cli.js +29 -0
- package/dist/prompt-length-wire.d.ts +28 -0
- package/dist/prompt-length-wire.d.ts.map +1 -0
- package/dist/prompt-length-wire.js +2 -2
- package/dist/prompt-report-cli.d.ts +10 -0
- package/dist/prompt-report-cli.d.ts.map +1 -0
- package/dist/prompt-report-cli.js +2 -2
- package/dist/prompt-summary-table.d.ts +15 -0
- package/dist/prompt-summary-table.d.ts.map +1 -0
- package/dist/prompt-summary-table.js +6 -0
- package/dist/registration-tag-warning.d.ts +32 -0
- package/dist/registration-tag-warning.d.ts.map +1 -0
- package/dist/report-comments-cli.d.ts +16 -0
- package/dist/report-comments-cli.d.ts.map +1 -0
- package/dist/report-markdown-blankness.d.ts +2 -0
- package/dist/report-markdown-blankness.d.ts.map +1 -0
- package/dist/report-markdown-blankness.js +6 -0
- package/dist/report-replacement-warning.d.ts +17 -0
- package/dist/report-replacement-warning.d.ts.map +1 -0
- package/dist/report-replacement-warning.js +31 -0
- package/dist/repository-backup-core.d.ts +225 -0
- package/dist/repository-backup-core.d.ts.map +1 -0
- package/dist/repository-recovery-manifest.d.ts +83 -0
- package/dist/repository-recovery-manifest.d.ts.map +1 -0
- package/dist/run-event-digest.d.ts +74 -0
- package/dist/run-event-digest.d.ts.map +1 -0
- package/dist/runner-dir-verify.d.ts +66 -0
- package/dist/runner-dir-verify.d.ts.map +1 -0
- package/dist/runner-instruction-set-contract.d.ts +24 -0
- package/dist/runner-instruction-set-contract.d.ts.map +1 -0
- package/dist/runner-instruction-set-contract.js +50 -0
- package/dist/sandbox-hygiene.d.ts +45 -0
- package/dist/sandbox-hygiene.d.ts.map +1 -0
- package/dist/sandbox-provider.d.ts +193 -0
- package/dist/sandbox-provider.d.ts.map +1 -0
- package/dist/scorer-draft-push.d.ts +50 -0
- package/dist/scorer-draft-push.d.ts.map +1 -0
- package/dist/scorers-cli.d.ts +20 -0
- package/dist/scorers-cli.d.ts.map +1 -0
- package/dist/scorers-cli.js +22 -0
- package/dist/scorers-verify-parity-bridge.d.ts +16 -0
- package/dist/scorers-verify-parity-bridge.d.ts.map +1 -0
- package/dist/scorers-verify-parity-bridge.js +90 -0
- package/dist/scorers-verify-parity.d.ts +81 -0
- package/dist/scorers-verify-parity.d.ts.map +1 -0
- package/dist/scorers-verify-parity.js +502 -0
- package/dist/scores-accept-cli.d.ts +21 -0
- package/dist/scores-accept-cli.d.ts.map +1 -0
- package/dist/secret-redaction.d.ts +47 -0
- package/dist/secret-redaction.d.ts.map +1 -0
- package/dist/session-timeline.d.ts +54 -0
- package/dist/session-timeline.d.ts.map +1 -0
- package/dist/setup-prompt.d.ts +5 -0
- package/dist/setup-prompt.d.ts.map +1 -0
- package/dist/skill-installer.d.ts +68 -0
- package/dist/skill-installer.d.ts.map +1 -0
- package/dist/skilled-proposer-launch.d.ts +7 -0
- package/dist/skilled-proposer-launch.d.ts.map +1 -0
- package/dist/skilled-proposer-launch.js +60 -0
- package/dist/smoke.d.ts +102 -0
- package/dist/smoke.d.ts.map +1 -0
- package/dist/start-intent.d.ts +12 -0
- package/dist/start-intent.d.ts.map +1 -0
- package/dist/task-assignment-manifest.d.ts +15 -0
- package/dist/task-assignment-manifest.d.ts.map +1 -0
- package/dist/task-create-error.d.ts +18 -0
- package/dist/task-create-error.d.ts.map +1 -0
- package/dist/team-connectors-cli.d.ts +29 -0
- package/dist/team-connectors-cli.d.ts.map +1 -0
- package/dist/types.d.ts +39 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/vercel-sandbox-provider.d.ts +156 -0
- package/dist/vercel-sandbox-provider.d.ts.map +1 -0
- package/dist/workbench-cli.d.ts +233 -0
- package/dist/workbench-cli.d.ts.map +1 -0
- package/dist/workspace-sync.d.ts +207 -0
- package/dist/workspace-sync.d.ts.map +1 -0
- package/dist/workspace.d.ts +92 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/zip-draft-push.d.ts +55 -0
- package/dist/zip-draft-push.d.ts.map +1 -0
- package/package.json +15 -2
- package/requirements/README.md +138 -0
- package/requirements/skilled-proposer.in +66 -0
- package/requirements/skilled-proposer.lock +265 -0
- package/scripts/build-cli-dist.mjs +30 -0
- package/scripts/ensure-skilled-proposer-venv.mjs +5 -0
- package/scripts/orizu-source-checkout.d.mts +1 -0
- package/scripts/orizu-source-checkout.mjs +10 -0
- package/scripts/refresh-skilled-proposer-lock.mjs +256 -0
- package/scripts/vendor-gepa-python.mjs +187 -4
- package/src/diff-comments-cli.ts +41 -3
- package/src/gepa-engine-dispatch.ts +340 -0
- package/src/gepa-python-command.ts +31 -0
- package/src/gepa-python-paths.ts +56 -0
- package/src/help.ts +95 -25
- package/src/index.ts +131 -166
- package/src/instruction-set-gepa-launch.ts +28 -0
- package/src/instruction-set-loader.ts +37 -0
- package/src/instruction-set-manifest.ts +120 -0
- package/src/instruction-sets-cli.ts +306 -0
- package/src/markdown-report-input.ts +19 -1
- package/src/model-configs-cli.ts +119 -0
- package/src/optimizations-promote-cli.ts +41 -0
- package/src/prompt-label-cli.ts +55 -0
- package/src/prompt-length-wire.ts +1 -1
- package/src/prompt-report-cli.ts +2 -2
- package/src/prompt-summary-table.ts +12 -0
- package/src/report-markdown-blankness.ts +6 -0
- package/src/report-replacement-warning.ts +35 -0
- package/src/runner-instruction-set-contract.ts +64 -0
- package/src/scorers-cli.ts +40 -0
- package/src/scorers-verify-parity-bridge.ts +90 -0
- package/src/scorers-verify-parity.ts +564 -0
- package/src/skilled-proposer-launch.ts +89 -0
- package/src/skilled-proposer-venv-manager.mjs +757 -0
- package/tsconfig.json +2 -0
- package/vendor/gepa-python/LICENSE +7 -0
- package/vendor/gepa-python/manifest.json +107 -0
- package/vendor/gepa-python/src/gepa/__init__.py +22 -0
- package/vendor/gepa-python/src/gepa/adapters/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/adapters/anymaths_adapter/__init__.py +1 -0
- package/vendor/gepa-python/src/gepa/adapters/anymaths_adapter/anymaths_adapter.py +174 -0
- package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/__init__.py +26 -0
- package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/confidence_adapter.py +618 -0
- package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/scoring.py +206 -0
- package/vendor/gepa-python/src/gepa/adapters/default_adapter/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/adapters/default_adapter/default_adapter.py +206 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/dspy_adapter.py +525 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/instruction_proposal.py +500 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/__init__.py +6 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/dspy_program_proposal_signature.py +137 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/full_program_adapter.py +269 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/__init__.py +56 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/evaluation_metrics.py +226 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/generic_rag_adapter.py +496 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/rag_pipeline.py +238 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_store_interface.py +212 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/__init__.py +2 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/chroma_store.py +196 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/lancedb_store.py +422 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/milvus_store.py +409 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/qdrant_store.py +368 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/weaviate_store.py +418 -0
- package/vendor/gepa-python/src/gepa/adapters/langchain_adapter/__init__.py +11 -0
- package/vendor/gepa-python/src/gepa/adapters/langchain_adapter/langchain_adapter.py +261 -0
- package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/__init__.py +37 -0
- package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/mcp_adapter.py +693 -0
- package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/mcp_client.py +364 -0
- package/vendor/gepa-python/src/gepa/adapters/optimize_anything_adapter/optimize_anything_adapter.py +879 -0
- package/vendor/gepa-python/src/gepa/adapters/terminal_bench_adapter/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/adapters/terminal_bench_adapter/terminal_bench_adapter.py +217 -0
- package/vendor/gepa-python/src/gepa/api.py +468 -0
- package/vendor/gepa-python/src/gepa/core/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/core/adapter.py +227 -0
- package/vendor/gepa-python/src/gepa/core/callbacks.py +551 -0
- package/vendor/gepa-python/src/gepa/core/data_loader.py +74 -0
- package/vendor/gepa-python/src/gepa/core/engine.py +1025 -0
- package/vendor/gepa-python/src/gepa/core/result.py +271 -0
- package/vendor/gepa-python/src/gepa/core/state.py +706 -0
- package/vendor/gepa-python/src/gepa/examples/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/examples/aime.py +24 -0
- package/vendor/gepa-python/src/gepa/examples/anymaths-bench/eval_default.py +111 -0
- package/vendor/gepa-python/src/gepa/examples/anymaths-bench/train_anymaths.py +177 -0
- package/vendor/gepa-python/src/gepa/examples/mcp_adapter/__init__.py +4 -0
- package/vendor/gepa-python/src/gepa/examples/mcp_adapter/mcp_optimization_example.py +456 -0
- package/vendor/gepa-python/src/gepa/examples/rag_adapter/__init__.py +9 -0
- package/vendor/gepa-python/src/gepa/examples/rag_adapter/rag_optimization.py +824 -0
- package/vendor/gepa-python/src/gepa/examples/terminal-bench/train_terminus.py +161 -0
- package/vendor/gepa-python/src/gepa/gepa_utils.py +117 -0
- package/vendor/gepa-python/src/gepa/gskill/__init__.py +1 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/cost_tracker.py +194 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/claude_code.py +1117 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/claude_code_skills.py +613 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/mini_swe_agent.py +440 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/experiment_logger.py +367 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/swe_fitness_fn.py +209 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/swe_harness.py +352 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/train_optimize_anything.py +830 -0
- package/vendor/gepa-python/src/gepa/image.py +104 -0
- package/vendor/gepa-python/src/gepa/lm.py +261 -0
- package/vendor/gepa-python/src/gepa/logging/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/logging/experiment_tracker.py +457 -0
- package/vendor/gepa-python/src/gepa/logging/logger.py +75 -0
- package/vendor/gepa-python/src/gepa/logging/utils.py +130 -0
- package/vendor/gepa-python/src/gepa/optimize_anything.py +1701 -0
- package/vendor/gepa-python/src/gepa/proposer/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/proposer/base.py +53 -0
- package/vendor/gepa-python/src/gepa/proposer/merge.py +403 -0
- package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/base.py +64 -0
- package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/reflection_lm.py +178 -0
- package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/reflective_mutation.py +641 -0
- package/vendor/gepa-python/src/gepa/py.typed +0 -0
- package/vendor/gepa-python/src/gepa/strategies/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/strategies/acceptance.py +66 -0
- package/vendor/gepa-python/src/gepa/strategies/batch_sampler.py +103 -0
- package/vendor/gepa-python/src/gepa/strategies/candidate_selector.py +82 -0
- package/vendor/gepa-python/src/gepa/strategies/component_selector.py +36 -0
- package/vendor/gepa-python/src/gepa/strategies/eval_policy.py +64 -0
- package/vendor/gepa-python/src/gepa/strategies/instruction_proposal.py +153 -0
- package/vendor/gepa-python/src/gepa/strategies/proposal_sampling.py +128 -0
- package/vendor/gepa-python/src/gepa/strategies/proposal_selection.py +84 -0
- package/vendor/gepa-python/src/gepa/utils/__init__.py +63 -0
- package/vendor/gepa-python/src/gepa/utils/code_execution.py +626 -0
- package/vendor/gepa-python/src/gepa/utils/stdio_capture.py +145 -0
- package/vendor/gepa-python/src/gepa/utils/stop_condition.py +230 -0
- package/vendor/gepa-python/src/gepa/visualization.py +359 -0
- package/vendor/orizu-gepa/pyproject.toml +18 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/__init__.py +9 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/__main__.py +5 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/adapter.py +138 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/callbacks.py +666 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/cli.py +7 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/engine.py +269 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/instruction_set_loader.py +52 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/preflight.py +64 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/reflection.py +186 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/runtime.py +721 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/skilled_proposer_bridge.py +381 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/stop_conditions.py +55 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/translator.py +203 -0
- package/vendor/orizu-gepa-python/pyproject.toml +1 -1
- package/vendor/orizu-gepa-python/src/orizu_gepa/cli.py +1 -0
- package/vendor/orizu-gepa-python/src/orizu_gepa/client.py +52 -7
- package/vendor/orizu-gepa-python/src/orizu_gepa/local_log.py +52 -0
- package/vendor/orizu-gepa-python/src/orizu_gepa/optimizer.py +10 -5
- package/vendor/orizu-gepa-python/src/orizu_gepa/reflection.py +323 -68
- package/vendor/orizu-gepa-python/src/orizu_gepa/runner.py +207 -13
- package/vendor/skills/orizu-cli/SKILL.md +3 -1
- package/vendor/skills/orizu-cli/references/cli-reference.md +85 -1
- package/vendor/skills/orizu-cli/references/migrate-existing-gepa-setup.md +303 -0
- package/vendor/skills/orizu-cli/references/optimization-reports.md +1 -1
- package/vendor/skills/orizu-cli/references/optimization-with-gepa.md +26 -1
- package/vendor/skills/orizu-cli/references/prompt-control-plane.md +113 -10
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Copyright (c) 2025 Lakshya A Agrawal and the GEPA contributors
|
|
2
|
+
# https://github.com/gepa-ai/gepa
|
|
3
|
+
|
|
4
|
+
"""Image wrapper for passing visual data through side_info to reflection VLMs."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import base64
|
|
9
|
+
import os
|
|
10
|
+
from dataclasses import dataclass
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
_MEDIA_TYPE_BY_EXT: dict[str, str] = {
|
|
14
|
+
".png": "image/png",
|
|
15
|
+
".jpg": "image/jpeg",
|
|
16
|
+
".jpeg": "image/jpeg",
|
|
17
|
+
".gif": "image/gif",
|
|
18
|
+
".webp": "image/webp",
|
|
19
|
+
".bmp": "image/bmp",
|
|
20
|
+
".svg": "image/svg+xml",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _guess_media_type(path: str) -> str:
|
|
25
|
+
ext = os.path.splitext(path)[1].lower()
|
|
26
|
+
return _MEDIA_TYPE_BY_EXT.get(ext, "image/png")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass
|
|
30
|
+
class Image:
|
|
31
|
+
"""Image data for inclusion in ``side_info``, enabling VLM-based reflection.
|
|
32
|
+
|
|
33
|
+
Wrap image data in this class and include it as a value (or nested value)
|
|
34
|
+
anywhere inside the ``side_info`` dict returned by your evaluator. When
|
|
35
|
+
GEPA builds the reflection prompt, ``Image`` objects are automatically
|
|
36
|
+
converted to the OpenAI vision content-part format and passed to the
|
|
37
|
+
reflection LM as inline images.
|
|
38
|
+
|
|
39
|
+
This enables a powerful visual feedback loop: your evaluator renders an
|
|
40
|
+
artifact (SVG, 3D model, chart, etc.), passes the rendered image back as
|
|
41
|
+
ASI, and a vision-capable proposer can literally *see* what it's improving.
|
|
42
|
+
Requires a VLM as the ``reflection_lm`` (e.g. ``"vertex_ai/gemini-3-flash-preview"``).
|
|
43
|
+
|
|
44
|
+
Provide **exactly one** of ``url``, ``path``, or ``base64_data``.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
url: A URL pointing to the image, **or** a ``data:`` URI
|
|
48
|
+
(``data:image/png;base64,...``).
|
|
49
|
+
path: A local filesystem path to an image file. The file is read and
|
|
50
|
+
base64-encoded when the reflection prompt is constructed.
|
|
51
|
+
base64_data: Raw base64-encoded image bytes. Requires ``media_type``.
|
|
52
|
+
media_type: MIME type (e.g. ``"image/png"``). Inferred from ``path``
|
|
53
|
+
extension when using *path*; **required** when using *base64_data*.
|
|
54
|
+
|
|
55
|
+
Examples::
|
|
56
|
+
|
|
57
|
+
# Rendered SVG feedback for visual optimization
|
|
58
|
+
image_b64 = render_svg_to_png(candidate["svg_code"])
|
|
59
|
+
side_info = {
|
|
60
|
+
"RenderedSVG": Image(base64_data=image_b64, media_type="image/png"),
|
|
61
|
+
"Feedback": vlm_feedback,
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
# File-based image feedback
|
|
65
|
+
side_info = {
|
|
66
|
+
"Input": "design a logo",
|
|
67
|
+
"RenderedOutput": Image(path="/tmp/logo_v3.png"),
|
|
68
|
+
"Feedback": "The colors are too muted",
|
|
69
|
+
}
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
url: str | None = None
|
|
73
|
+
path: str | None = None
|
|
74
|
+
base64_data: str | None = None
|
|
75
|
+
media_type: str | None = None
|
|
76
|
+
|
|
77
|
+
def __post_init__(self) -> None:
|
|
78
|
+
sources = sum(x is not None for x in [self.url, self.path, self.base64_data])
|
|
79
|
+
if sources != 1:
|
|
80
|
+
raise ValueError("Exactly one of url, path, or base64_data must be provided.")
|
|
81
|
+
if self.base64_data is not None and self.media_type is None:
|
|
82
|
+
raise ValueError("media_type is required when using base64_data.")
|
|
83
|
+
|
|
84
|
+
def to_openai_content_part(self) -> dict[str, Any]:
|
|
85
|
+
"""Convert to an OpenAI-compatible ``image_url`` content-part dict.
|
|
86
|
+
|
|
87
|
+
Returns a dict of the form::
|
|
88
|
+
|
|
89
|
+
{"type": "image_url", "image_url": {"url": "..."}}
|
|
90
|
+
|
|
91
|
+
For *path*-based images the file is read and base64-encoded inline.
|
|
92
|
+
"""
|
|
93
|
+
if self.url is not None:
|
|
94
|
+
return {"type": "image_url", "image_url": {"url": self.url}}
|
|
95
|
+
|
|
96
|
+
if self.path is not None:
|
|
97
|
+
mt = self.media_type or _guess_media_type(self.path)
|
|
98
|
+
with open(self.path, "rb") as f:
|
|
99
|
+
data = base64.b64encode(f.read()).decode("utf-8")
|
|
100
|
+
return {"type": "image_url", "image_url": {"url": f"data:{mt};base64,{data}"}}
|
|
101
|
+
|
|
102
|
+
# base64_data
|
|
103
|
+
assert self.base64_data is not None and self.media_type is not None
|
|
104
|
+
return {"type": "image_url", "image_url": {"url": f"data:{self.media_type};base64,{self.base64_data}"}}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# Copyright (c) 2025 Lakshya A Agrawal and the GEPA contributors
|
|
2
|
+
# https://github.com/gepa-ai/gepa
|
|
3
|
+
|
|
4
|
+
"""Thin LM abstraction over LiteLLM that handles retries, truncation
|
|
5
|
+
warnings, and cross-model compatibility.
|
|
6
|
+
|
|
7
|
+
Usage::
|
|
8
|
+
|
|
9
|
+
from gepa.lm import LM
|
|
10
|
+
|
|
11
|
+
lm = LM("openai/gpt-4.1", temperature=0.7, max_tokens=4096)
|
|
12
|
+
response: str = lm("Solve this problem...")
|
|
13
|
+
|
|
14
|
+
# Also works with chat messages
|
|
15
|
+
response = lm([{"role": "user", "content": "Hello"}])
|
|
16
|
+
|
|
17
|
+
The returned callable conforms to the ``LanguageModel`` protocol
|
|
18
|
+
(``(str | list[dict]) -> str``) used throughout GEPA.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
import logging
|
|
24
|
+
import threading
|
|
25
|
+
from typing import Any
|
|
26
|
+
|
|
27
|
+
logger = logging.getLogger(__name__)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class LM:
|
|
31
|
+
"""A lightweight language model wrapper over LiteLLM.
|
|
32
|
+
|
|
33
|
+
Handles:
|
|
34
|
+
|
|
35
|
+
- **Retries** with exponential backoff via LiteLLM's ``num_retries``.
|
|
36
|
+
- **Truncation detection** — logs a warning when ``finish_reason='length'``.
|
|
37
|
+
- **drop_params=True** so unsupported params are silently ignored
|
|
38
|
+
(with a warning logged for transparency).
|
|
39
|
+
|
|
40
|
+
Conforms to the :class:`~gepa.proposer.reflective_mutation.base.LanguageModel`
|
|
41
|
+
protocol, so it can be used anywhere GEPA expects a ``LanguageModel``.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
model: LiteLLM model identifier, e.g. ``"openai/gpt-4.1"`` or ``"anthropic/claude-sonnet-4-6"``.
|
|
45
|
+
temperature: Sampling temperature.
|
|
46
|
+
max_tokens: Maximum tokens to generate.
|
|
47
|
+
num_retries: Number of retries on transient failures (default 3).
|
|
48
|
+
**kwargs: Extra keyword arguments forwarded to ``litellm.completion``
|
|
49
|
+
(e.g. ``top_p``, ``stop``, ``api_key``, ``api_base``).
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
def __init__(
|
|
53
|
+
self,
|
|
54
|
+
model: str,
|
|
55
|
+
temperature: float | None = None,
|
|
56
|
+
max_tokens: int | None = None,
|
|
57
|
+
num_retries: int = 3,
|
|
58
|
+
**kwargs: Any,
|
|
59
|
+
):
|
|
60
|
+
self.model = model
|
|
61
|
+
self.num_retries = num_retries
|
|
62
|
+
self._total_cost: float = 0.0
|
|
63
|
+
self._total_tokens_in: int = 0
|
|
64
|
+
self._total_tokens_out: int = 0
|
|
65
|
+
self._cost_lock = threading.Lock()
|
|
66
|
+
|
|
67
|
+
self.completion_kwargs: dict[str, Any] = {
|
|
68
|
+
**({"temperature": temperature} if temperature is not None else {}),
|
|
69
|
+
**({"max_tokens": max_tokens} if max_tokens is not None else {}),
|
|
70
|
+
**kwargs,
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@property
|
|
74
|
+
def total_cost(self) -> float:
|
|
75
|
+
"""Cumulative USD cost of all calls made through this LM instance."""
|
|
76
|
+
return self._total_cost
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def total_tokens_in(self) -> int:
|
|
80
|
+
"""Cumulative input (prompt) tokens across all calls."""
|
|
81
|
+
return self._total_tokens_in
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def total_tokens_out(self) -> int:
|
|
85
|
+
"""Cumulative output (completion) tokens across all calls."""
|
|
86
|
+
return self._total_tokens_out
|
|
87
|
+
|
|
88
|
+
def _check_truncation(self, choices: list[Any]) -> None:
|
|
89
|
+
if any(getattr(c, "finish_reason", None) == "length" for c in choices):
|
|
90
|
+
max_tok = self.completion_kwargs.get("max_tokens") or self.completion_kwargs.get("max_completion_tokens")
|
|
91
|
+
logger.warning(
|
|
92
|
+
f"LM response was truncated (finish_reason='length', max_tokens={max_tok}). "
|
|
93
|
+
"Consider increasing max_tokens for better results."
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
def __call__(self, prompt: str | list[dict[str, Any]]) -> str:
|
|
97
|
+
import litellm
|
|
98
|
+
|
|
99
|
+
if isinstance(prompt, str):
|
|
100
|
+
messages: list[dict[str, Any]] = [{"role": "user", "content": prompt}]
|
|
101
|
+
else:
|
|
102
|
+
messages = prompt
|
|
103
|
+
|
|
104
|
+
completion = litellm.completion(
|
|
105
|
+
model=self.model,
|
|
106
|
+
messages=messages,
|
|
107
|
+
num_retries=self.num_retries,
|
|
108
|
+
drop_params=True,
|
|
109
|
+
**self.completion_kwargs,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
# Non-streaming calls always return ModelResponse (not CustomStreamWrapper)
|
|
113
|
+
self._check_truncation(completion.choices) # type: ignore[union-attr]
|
|
114
|
+
|
|
115
|
+
# Accumulate cost
|
|
116
|
+
try:
|
|
117
|
+
cost = litellm.completion_cost(completion_response=completion) or 0.0 # type: ignore[attr-defined]
|
|
118
|
+
except Exception:
|
|
119
|
+
cost = 0.0
|
|
120
|
+
|
|
121
|
+
# Accumulate token usage
|
|
122
|
+
usage = getattr(completion, "usage", None)
|
|
123
|
+
tokens_in = (getattr(usage, "prompt_tokens", 0) or 0) if usage is not None else 0
|
|
124
|
+
tokens_out = (getattr(usage, "completion_tokens", 0) or 0) if usage is not None else 0
|
|
125
|
+
|
|
126
|
+
with self._cost_lock:
|
|
127
|
+
self._total_cost += cost
|
|
128
|
+
self._total_tokens_in += tokens_in
|
|
129
|
+
self._total_tokens_out += tokens_out
|
|
130
|
+
|
|
131
|
+
return completion.choices[0].message.content # type: ignore[union-attr]
|
|
132
|
+
|
|
133
|
+
def batch_complete(
|
|
134
|
+
self, messages_list: list[list[dict[str, Any]]], max_workers: int = 10, **kwargs: Any
|
|
135
|
+
) -> list[str]:
|
|
136
|
+
"""Run multiple completions in parallel using ``litellm.batch_completion``.
|
|
137
|
+
|
|
138
|
+
Args:
|
|
139
|
+
messages_list: List of message lists, one per request.
|
|
140
|
+
max_workers: Maximum concurrent requests.
|
|
141
|
+
**kwargs: Extra keyword arguments forwarded to ``litellm.batch_completion``
|
|
142
|
+
(e.g. ``timeout``, ``api_base``). These override any matching keys
|
|
143
|
+
set during ``__init__``.
|
|
144
|
+
|
|
145
|
+
Returns:
|
|
146
|
+
List of response strings, one per input.
|
|
147
|
+
"""
|
|
148
|
+
import litellm
|
|
149
|
+
|
|
150
|
+
merged = {**self.completion_kwargs, **kwargs}
|
|
151
|
+
responses = litellm.batch_completion(
|
|
152
|
+
model=self.model,
|
|
153
|
+
messages=messages_list,
|
|
154
|
+
max_workers=max_workers,
|
|
155
|
+
num_retries=self.num_retries,
|
|
156
|
+
drop_params=True,
|
|
157
|
+
**merged,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
batch_cost = 0.0
|
|
161
|
+
batch_tokens_in = 0
|
|
162
|
+
batch_tokens_out = 0
|
|
163
|
+
results: list[str] = []
|
|
164
|
+
for resp in responses:
|
|
165
|
+
self._check_truncation(resp.choices)
|
|
166
|
+
results.append(resp.choices[0].message.content.strip())
|
|
167
|
+
try:
|
|
168
|
+
batch_cost += litellm.completion_cost(completion_response=resp) or 0.0 # type: ignore[attr-defined]
|
|
169
|
+
except Exception:
|
|
170
|
+
pass
|
|
171
|
+
usage = getattr(resp, "usage", None)
|
|
172
|
+
if usage is not None:
|
|
173
|
+
batch_tokens_in += getattr(usage, "prompt_tokens", 0) or 0
|
|
174
|
+
batch_tokens_out += getattr(usage, "completion_tokens", 0) or 0
|
|
175
|
+
|
|
176
|
+
with self._cost_lock:
|
|
177
|
+
self._total_cost += batch_cost
|
|
178
|
+
self._total_tokens_in += batch_tokens_in
|
|
179
|
+
self._total_tokens_out += batch_tokens_out
|
|
180
|
+
|
|
181
|
+
return results
|
|
182
|
+
|
|
183
|
+
def __repr__(self) -> str:
|
|
184
|
+
params = [f"model={self.model!r}"]
|
|
185
|
+
for k, v in self.completion_kwargs.items():
|
|
186
|
+
params.append(f"{k}={v!r}")
|
|
187
|
+
return f"LM({', '.join(params)})"
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class TrackingLM:
|
|
191
|
+
"""Wraps an arbitrary callable to track estimated token usage.
|
|
192
|
+
|
|
193
|
+
For callables that don't go through LiteLLM, we can't get real token
|
|
194
|
+
counts or costs. This wrapper estimates tokens from string lengths
|
|
195
|
+
(~4 chars/token) and reports ``total_cost = 0.0``.
|
|
196
|
+
|
|
197
|
+
This ensures that *every* reflection LM — whether an ``LM`` instance
|
|
198
|
+
or a plain callable — exposes ``total_cost``, ``total_tokens_in``,
|
|
199
|
+
and ``total_tokens_out``.
|
|
200
|
+
"""
|
|
201
|
+
|
|
202
|
+
_CHARS_PER_TOKEN = 4
|
|
203
|
+
|
|
204
|
+
def __init__(self, fn: Any):
|
|
205
|
+
self._fn = fn
|
|
206
|
+
self._total_cost: float = 0.0
|
|
207
|
+
self._total_tokens_in: int = 0
|
|
208
|
+
self._total_tokens_out: int = 0
|
|
209
|
+
|
|
210
|
+
@property
|
|
211
|
+
def total_cost(self) -> float:
|
|
212
|
+
return self._total_cost
|
|
213
|
+
|
|
214
|
+
@property
|
|
215
|
+
def total_tokens_in(self) -> int:
|
|
216
|
+
return self._total_tokens_in
|
|
217
|
+
|
|
218
|
+
@property
|
|
219
|
+
def total_tokens_out(self) -> int:
|
|
220
|
+
return self._total_tokens_out
|
|
221
|
+
|
|
222
|
+
def _estimate_tokens(self, text: str) -> int:
|
|
223
|
+
return max(1, len(text) // self._CHARS_PER_TOKEN)
|
|
224
|
+
|
|
225
|
+
def __call__(self, prompt: str | list[dict[str, Any]]) -> str:
|
|
226
|
+
if isinstance(prompt, str):
|
|
227
|
+
self._total_tokens_in += self._estimate_tokens(prompt)
|
|
228
|
+
else:
|
|
229
|
+
self._total_tokens_in += self._estimate_tokens(str(prompt))
|
|
230
|
+
|
|
231
|
+
result = self._fn(prompt)
|
|
232
|
+
|
|
233
|
+
if isinstance(result, str):
|
|
234
|
+
self._total_tokens_out += self._estimate_tokens(result)
|
|
235
|
+
|
|
236
|
+
return result
|
|
237
|
+
|
|
238
|
+
def __getattr__(self, name: str):
|
|
239
|
+
# Conditionally expose batch_complete: hasattr(tracking_lm,
|
|
240
|
+
# "batch_complete") must be True exactly when the wrapped callable
|
|
241
|
+
# provides it, so batched reflection (StatelessReflectionLM) is not
|
|
242
|
+
# silently downgraded to the per-task path by this wrapper.
|
|
243
|
+
if name == "batch_complete":
|
|
244
|
+
inner = getattr(self._fn, "batch_complete", None)
|
|
245
|
+
if inner is None:
|
|
246
|
+
raise AttributeError(name)
|
|
247
|
+
|
|
248
|
+
def tracked_batch_complete(messages_list):
|
|
249
|
+
for messages in messages_list:
|
|
250
|
+
self._total_tokens_in += self._estimate_tokens(str(messages))
|
|
251
|
+
results = list(inner(messages_list))
|
|
252
|
+
for result in results:
|
|
253
|
+
if isinstance(result, str):
|
|
254
|
+
self._total_tokens_out += self._estimate_tokens(result)
|
|
255
|
+
return results
|
|
256
|
+
|
|
257
|
+
return tracked_batch_complete
|
|
258
|
+
raise AttributeError(name)
|
|
259
|
+
|
|
260
|
+
def __repr__(self) -> str:
|
|
261
|
+
return f"TrackingLM({self._fn!r})"
|
|
File without changes
|