orkeon-code 0.0.0-stage → 1.0.0-rc.1
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/.orkeon-version +1 -0
- package/LICENSE.md +21 -0
- package/NOTICE.md +17 -0
- package/README.fr.md +169 -0
- package/README.md +162 -2
- package/config/appsettings.anthropic.example.json +77 -0
- package/config/appsettings.example.json +71 -0
- package/config/appsettings.jev.example.json +128 -0
- package/config/appsettings.kev.example.json +130 -0
- package/config/appsettings.liquid.example.json +129 -0
- package/config/appsettings.ollama-whisper.example.json +92 -0
- package/config/appsettings.ollama.example.json +70 -0
- package/config/appsettings.whisper.example.json +31 -0
- package/mcp/whisper/README.md +293 -0
- package/mcp/whisper/pyproject.toml +32 -0
- package/mcp/whisper/uv.lock +1641 -0
- package/mcp/whisper/whisper_mcp.py +1053 -0
- package/orkeon-code +897 -0
- package/orkeon-code.mjs +71 -0
- package/orkeon-code.ps1 +837 -0
- package/package.json +57 -4
- package/scripts/install.ps1 +156 -0
- package/scripts/install.sh +148 -0
- package/scripts/session-start.ork.ts +90 -0
- package/scripts/session-start.sh +74 -0
- package/scripts/setup-fixture.sh +88 -0
- package/src/commands/.orkeon/orkeon-cli.d.ts +562 -0
- package/src/commands/_lib/args.ts +193 -0
- package/src/commands/_lib/dev/dev-batches.ts +368 -0
- package/src/commands/_lib/dev/dev-implement.ts +188 -0
- package/src/commands/_lib/dev/dev-source.ts +65 -0
- package/src/commands/_lib/dev/dev.ts +344 -0
- package/src/commands/_lib/dev-step.ts +142 -0
- package/src/commands/_lib/dispatch.ts +231 -0
- package/src/commands/_lib/effort.ts +15 -0
- package/src/commands/_lib/git/branch.ts +95 -0
- package/src/commands/_lib/git/commit.ts +94 -0
- package/src/commands/_lib/git/diff.ts +97 -0
- package/src/commands/_lib/git/review.ts +109 -0
- package/src/commands/_lib/memory/memory-admit.ts +150 -0
- package/src/commands/_lib/memory/memory.ts +51 -0
- package/src/commands/_lib/pr-context.ts +32 -0
- package/src/commands/_lib/project/analyze.ts +24 -0
- package/src/commands/_lib/session/export.ts +104 -0
- package/src/commands/_lib/session/resume.ts +160 -0
- package/src/commands/_lib/session/tasks.ts +184 -0
- package/src/commands/_lib/settings/advisor.ts +80 -0
- package/src/commands/_lib/settings/agents.ts +147 -0
- package/src/commands/_lib/settings/config.ts +141 -0
- package/src/commands/_lib/settings/hooks.ts +58 -0
- package/src/commands/_lib/settings/mode.ts +91 -0
- package/src/commands/_lib/settings/model.ts +146 -0
- package/src/commands/_lib/settings/permissions.ts +309 -0
- package/src/commands/_lib/settings/session-config.ts +49 -0
- package/src/commands/_lib/settings/skills.ts +51 -0
- package/src/commands/_lib/speech/say.ts +96 -0
- package/src/commands/_lib/speech/transcribe.ts +130 -0
- package/src/commands/_lib/speech/voice.ts +146 -0
- package/src/commands/_lib/status/cache.ts +31 -0
- package/src/commands/_lib/status/context.ts +57 -0
- package/src/commands/_lib/status/doctor.ts +186 -0
- package/src/commands/_lib/status/meta.ts +45 -0
- package/src/commands/_lib/status/status.ts +129 -0
- package/src/commands/_lib/status/usage-tools.ts +49 -0
- package/src/commands/_lib/status/usage.ts +139 -0
- package/src/commands/_lib/view.ts +29 -0
- package/src/commands/dev/dev-batches.cmd.ts +108 -0
- package/src/commands/dev/dev-learn.cmd.ts +29 -0
- package/src/commands/dev/dev-plan.cmd.ts +52 -0
- package/src/commands/dev/dev-spec.cmd.ts +55 -0
- package/src/commands/dev/dev-status.cmd.ts +16 -0
- package/src/commands/git/branch.cmd.ts +27 -0
- package/src/commands/git/commit.cmd.ts +48 -0
- package/src/commands/git/diff.cmd.ts +26 -0
- package/src/commands/git/review.cmd.ts +36 -0
- package/src/commands/memory/memory.cmd.ts +48 -0
- package/src/commands/project/analyze.cmd.ts +32 -0
- package/src/commands/project/debug-tool-call.cmd.ts +67 -0
- package/src/commands/project/files.cmd.ts +22 -0
- package/src/commands/project/init-verifiers.cmd.ts +14 -0
- package/src/commands/project/init.cmd.ts +14 -0
- package/src/commands/project/verify.cmd.ts +27 -0
- package/src/commands/session/assistant.cmd.ts +40 -0
- package/src/commands/session/btw.cmd.ts +18 -0
- package/src/commands/session/clear.cmd.ts +19 -0
- package/src/commands/session/compact.cmd.ts +16 -0
- package/src/commands/session/copy.cmd.ts +44 -0
- package/src/commands/session/exit.cmd.ts +9 -0
- package/src/commands/session/export.cmd.ts +28 -0
- package/src/commands/session/rename.cmd.ts +17 -0
- package/src/commands/session/resume.cmd.ts +19 -0
- package/src/commands/session/rewind.cmd.ts +26 -0
- package/src/commands/session/summary.cmd.ts +27 -0
- package/src/commands/session/tasks.cmd.ts +44 -0
- package/src/commands/settings/advisor.cmd.ts +38 -0
- package/src/commands/settings/agents.cmd.ts +19 -0
- package/src/commands/settings/config.cmd.ts +17 -0
- package/src/commands/settings/effort.cmd.ts +40 -0
- package/src/commands/settings/fast.cmd.ts +17 -0
- package/src/commands/settings/hooks.cmd.ts +17 -0
- package/src/commands/settings/mode.cmd.ts +20 -0
- package/src/commands/settings/model.cmd.ts +20 -0
- package/src/commands/settings/output-style.cmd.ts +48 -0
- package/src/commands/settings/permissions.cmd.ts +25 -0
- package/src/commands/settings/proactive.cmd.ts +15 -0
- package/src/commands/settings/skills.cmd.ts +17 -0
- package/src/commands/speech/say.cmd.ts +24 -0
- package/src/commands/speech/transcribe.cmd.ts +29 -0
- package/src/commands/speech/voice.cmd.ts +30 -0
- package/src/commands/status/context.cmd.ts +18 -0
- package/src/commands/status/doctor.cmd.ts +27 -0
- package/src/commands/status/release-notes.cmd.ts +9 -0
- package/src/commands/status/status.cmd.ts +25 -0
- package/src/commands/status/usage.cmd.ts +21 -0
- package/src/crews/.orkeon/orkeon.d.ts +3946 -0
- package/src/crews/_probe-shared-memory/domain/probe-verdict.ts +183 -0
- package/src/crews/_probe-shared-memory/probe.ork.ts +98 -0
- package/src/crews/advisor/application/run-advisor.ts +40 -0
- package/src/crews/advisor/crew.ork.ts +43 -0
- package/src/crews/advisor/domain/advice.ts +135 -0
- package/src/crews/agent-run/application/run-agent-run.ts +42 -0
- package/src/crews/agent-run/crew.ork.ts +67 -0
- package/src/crews/analyze/application/run-analyze.ts +118 -0
- package/src/crews/analyze/crew.ork.ts +40 -0
- package/src/crews/analyze/domain/harvest.ts +301 -0
- package/src/crews/code-review/application/prompts.ts +133 -0
- package/src/crews/code-review/application/review.ts +71 -0
- package/src/crews/code-review/application/run-code-review.ts +123 -0
- package/src/crews/code-review/crew.ork.ts +51 -0
- package/src/crews/code-review/domain/lenses.ts +193 -0
- package/src/crews/code-review/domain/report.ts +59 -0
- package/src/crews/code-review/domain/scope.ts +112 -0
- package/src/crews/dev-batches/application/plan-close.ts +181 -0
- package/src/crews/dev-batches/application/run-dev-batches.ts +669 -0
- package/src/crews/dev-batches/application/run-wave.ts +450 -0
- package/src/crews/dev-batches/application/seed-harvest.ts +162 -0
- package/src/crews/dev-batches/crew.ork.ts +143 -0
- package/src/crews/dev-batches/domain/batch-waves.ts +70 -0
- package/src/crews/dev-batches/domain/batches-budget.ts +52 -0
- package/src/crews/dev-batches/domain/batches-log.ts +54 -0
- package/src/crews/dev-batches/domain/wave-order.ts +43 -0
- package/src/crews/dev-change/application/change-prompt.ts +104 -0
- package/src/crews/dev-change/application/evidence.ts +169 -0
- package/src/crews/dev-change/application/run-dev-change.ts +315 -0
- package/src/crews/dev-change/crew.ork.ts +112 -0
- package/src/crews/dev-change/domain/change-answer.ts +159 -0
- package/src/crews/dev-change/domain/change-render.ts +79 -0
- package/src/crews/dev-implement/application/close.ts +183 -0
- package/src/crews/dev-implement/application/count-open-steps.ts +24 -0
- package/src/crews/dev-implement/application/locate-sheet.ts +80 -0
- package/src/crews/dev-implement/application/observe.ts +50 -0
- package/src/crews/dev-implement/application/report-writes.ts +41 -0
- package/src/crews/dev-implement/application/run-dev-implement.ts +811 -0
- package/src/crews/dev-implement/application/run-role.ts +27 -0
- package/src/crews/dev-implement/application/suite-job.ts +118 -0
- package/src/crews/dev-implement/application/touched.ts +74 -0
- package/src/crews/dev-implement/crew.ork.ts +68 -0
- package/src/crews/dev-implement/domain/contracts.ts +256 -0
- package/src/crews/dev-implement/domain/correction.ts +102 -0
- package/src/crews/dev-implement/domain/cycles.ts +35 -0
- package/src/crews/dev-implement/domain/implement-budget.ts +29 -0
- package/src/crews/dev-implement/domain/roles.ts +53 -0
- package/src/crews/dev-implement/domain/sheet-edits.ts +75 -0
- package/src/crews/dev-implement/domain/sheet-ticks.ts +22 -0
- package/src/crews/dev-implement/domain/step-checks.ts +136 -0
- package/src/crews/dev-implement/domain/step-section.ts +127 -0
- package/src/crews/dev-learn/application/learn-backlog.ts +58 -0
- package/src/crews/dev-learn/application/learn-prompt.ts +140 -0
- package/src/crews/dev-learn/application/run-dev-learn.ts +553 -0
- package/src/crews/dev-learn/crew.ork.ts +52 -0
- package/src/crews/dev-learn/domain/learn-answer.ts +235 -0
- package/src/crews/dev-learn/domain/owner-lines.ts +86 -0
- package/src/crews/dev-learn/domain/proposals-render.ts +96 -0
- package/src/crews/dev-plan/application/anchor-paths.ts +76 -0
- package/src/crews/dev-plan/application/inventory.ts +170 -0
- package/src/crews/dev-plan/application/plan-prompt.ts +159 -0
- package/src/crews/dev-plan/application/run-dev-plan.ts +455 -0
- package/src/crews/dev-plan/crew.ork.ts +109 -0
- package/src/crews/dev-plan/domain/inventory-model.ts +95 -0
- package/src/crews/dev-plan/domain/plan-answer.ts +738 -0
- package/src/crews/dev-plan/domain/plan-render.ts +307 -0
- package/src/crews/dev-spec/application/run-dev-spec.ts +206 -0
- package/src/crews/dev-spec/application/spec-prompt.ts +98 -0
- package/src/crews/dev-spec/crew.ork.ts +108 -0
- package/src/crews/dev-spec/domain/spec-answer.ts +253 -0
- package/src/crews/dev-spec/domain/spec-render.ts +76 -0
- package/src/crews/dev-verify/application/audit.ts +259 -0
- package/src/crews/dev-verify/application/auditor-prompt.ts +323 -0
- package/src/crews/dev-verify/application/capture.ts +303 -0
- package/src/crews/dev-verify/application/run-dev-verify.ts +409 -0
- package/src/crews/dev-verify/application/run-gate.ts +202 -0
- package/src/crews/dev-verify/crew.ork.ts +103 -0
- package/src/crews/dev-verify/domain/audit-answer.ts +150 -0
- package/src/crews/dev-verify/domain/auditor-charter.ts +21 -0
- package/src/crews/dev-verify/domain/capture-sections.ts +137 -0
- package/src/crews/dev-verify/domain/commands.ts +103 -0
- package/src/crews/dev-verify/domain/gate.ts +126 -0
- package/src/crews/dev-verify/domain/mechanical-table.ts +163 -0
- package/src/crews/dev-verify/domain/runtime-cut.ts +13 -0
- package/src/crews/dev-verify/domain/sheet-facts.ts +4 -0
- package/src/crews/dev-verify/domain/text.ts +20 -0
- package/src/crews/dev-verify/domain/verdict.ts +127 -0
- package/src/crews/git-commit/application/draft.ts +154 -0
- package/src/crews/git-commit/application/run-git-commit.ts +116 -0
- package/src/crews/git-commit/crew.ork.ts +52 -0
- package/src/crews/git-commit/domain/commit.ts +220 -0
- package/src/crews/init-verifiers/application/authoring.ts +89 -0
- package/src/crews/init-verifiers/application/prompts.ts +103 -0
- package/src/crews/init-verifiers/application/run-init-verifiers.ts +25 -0
- package/src/crews/init-verifiers/crew.ork.ts +34 -0
- package/src/crews/init-verifiers/domain/commands-section.ts +36 -0
- package/src/crews/init-verifiers/domain/readiness.ts +23 -0
- package/src/crews/main-loop/application/auto-compact.ts +77 -0
- package/src/crews/main-loop/application/context-gather.ts +133 -0
- package/src/crews/main-loop/application/run-main-loop.ts +350 -0
- package/src/crews/main-loop/application/turn-prompt.ts +112 -0
- package/src/crews/main-loop/crew.ork.ts +119 -0
- package/src/crews/main-loop/domain/autocompact.ts +27 -0
- package/src/crews/main-loop/domain/prompt-assembly.ts +521 -0
- package/src/crews/main-loop/domain/turn-chains.ts +129 -0
- package/src/crews/project-init/application/detect.ts +122 -0
- package/src/crews/project-init/application/prompts.ts +101 -0
- package/src/crews/project-init/application/run-project-init.ts +31 -0
- package/src/crews/project-init/crew.ork.ts +35 -0
- package/src/crews/project-init/domain/conventions.ts +36 -0
- package/src/crews/project-init/domain/existing-files.ts +63 -0
- package/src/crews/project-init/domain/package-map.ts +73 -0
- package/src/crews/session-compact/crew.ork.ts +55 -0
- package/src/crews/shared-memory-admit/crew.ork.ts +48 -0
- package/src/crews/speech/application/run-speech.ts +25 -0
- package/src/crews/speech/crew.ork.ts +37 -0
- package/src/shared/application/agents/child-agent.ts +255 -0
- package/src/shared/application/agents/run-sub-agent.ts +96 -0
- package/src/shared/application/answer-language.ts +14 -0
- package/src/shared/application/attached-skills.ts +36 -0
- package/src/shared/application/compaction/compact-session.ts +237 -0
- package/src/shared/application/compaction/extract-memories.ts +38 -0
- package/src/shared/application/compaction/restore-context.ts +78 -0
- package/src/shared/application/config-store.ts +123 -0
- package/src/shared/application/dev/brief-inventory.ts +113 -0
- package/src/shared/application/dev/close-batch.ts +83 -0
- package/src/shared/application/dev/find-repo-pack.ts +77 -0
- package/src/shared/application/dev/learn-decision.ts +252 -0
- package/src/shared/application/dev/load-dev-context.ts +266 -0
- package/src/shared/application/dev/measure-access-cost.ts +68 -0
- package/src/shared/application/dev/plan-source.ts +112 -0
- package/src/shared/application/dev/preflight.ts +71 -0
- package/src/shared/application/dev/project-files.ts +17 -0
- package/src/shared/application/dev/question-round.ts +52 -0
- package/src/shared/application/dev/resolve-work-folder.ts +133 -0
- package/src/shared/application/dev/script-tool-slot.ts +27 -0
- package/src/shared/application/dev/settle-questions.ts +55 -0
- package/src/shared/application/dev/source-review.ts +63 -0
- package/src/shared/application/dev/source-step.ts +150 -0
- package/src/shared/application/dev/spend.ts +42 -0
- package/src/shared/application/dev/step-precedents.ts +89 -0
- package/src/shared/application/dev/tool-call-policy.ts +89 -0
- package/src/shared/application/dev/tool-callbacks.ts +215 -0
- package/src/shared/application/dev/tool-trace-recorder.ts +45 -0
- package/src/shared/application/dev/verdict-sources.ts +48 -0
- package/src/shared/application/dev/wrapped-tools.ts +145 -0
- package/src/shared/application/extra-tools.ts +70 -0
- package/src/shared/application/git/batch-worktree.ts +97 -0
- package/src/shared/application/git/commit-files.ts +186 -0
- package/src/shared/application/git/merge-batch.ts +63 -0
- package/src/shared/application/git/open-pull-request.ts +51 -0
- package/src/shared/application/instructions-file.ts +19 -0
- package/src/shared/application/json-file.ts +34 -0
- package/src/shared/application/llm-profile.ts +35 -0
- package/src/shared/application/permission-rules.ts +159 -0
- package/src/shared/application/ports/approvals.ts +20 -0
- package/src/shared/application/ports/clock.ts +5 -0
- package/src/shared/application/ports/code-index.ts +93 -0
- package/src/shared/application/ports/crew.ts +60 -0
- package/src/shared/application/ports/files.ts +21 -0
- package/src/shared/application/ports/human.ts +13 -0
- package/src/shared/application/ports/llm.ts +54 -0
- package/src/shared/application/ports/memory.ts +30 -0
- package/src/shared/application/ports/progress.ts +23 -0
- package/src/shared/application/ports/runtime.ts +15 -0
- package/src/shared/application/ports/session.ts +74 -0
- package/src/shared/application/ports/shared-memory.ts +26 -0
- package/src/shared/application/ports/shell.ts +40 -0
- package/src/shared/application/ports/telemetry.ts +45 -0
- package/src/shared/application/ports/tools.ts +46 -0
- package/src/shared/application/ports/usage.ts +45 -0
- package/src/shared/application/ports.ts +27 -0
- package/src/shared/application/project-manifests.ts +106 -0
- package/src/shared/application/session-io.ts +84 -0
- package/src/shared/application/session-state.ts +36 -0
- package/src/shared/application/shared-memory/admit-entries.ts +177 -0
- package/src/shared/application/shared-memory/harvest-after-gaps.ts +72 -0
- package/src/shared/application/shared-memory/harvest-mistakes.ts +44 -0
- package/src/shared/application/shared-memory/import-agent-memory.ts +117 -0
- package/src/shared/application/shared-memory/memory-files.ts +110 -0
- package/src/shared/application/shared-memory/memory-settings.ts +93 -0
- package/src/shared/application/shared-memory/push-candidate.ts +146 -0
- package/src/shared/application/shared-memory/recall-precedents.ts +69 -0
- package/src/shared/application/state-snapshot.ts +38 -0
- package/src/shared/application/workflow/workflow-state.ts +135 -0
- package/src/shared/domain/agent-policy/behavior-flags.ts +168 -0
- package/src/shared/domain/agent-policy/extra-tools.ts +69 -0
- package/src/shared/domain/agent-policy/memory-categories.ts +6 -0
- package/src/shared/domain/agent-policy/mode-policy.ts +51 -0
- package/src/shared/domain/agent-policy/output-styles.ts +11 -0
- package/src/shared/domain/agent-policy/permission.ts +623 -0
- package/src/shared/domain/agent-policy/rule-sets.ts +412 -0
- package/src/shared/domain/agent-policy/tool-access.ts +77 -0
- package/src/shared/domain/agent-registry.ts +142 -0
- package/src/shared/domain/agents/built-in-charters.ts +43 -0
- package/src/shared/domain/agents/chain.ts +30 -0
- package/src/shared/domain/agents/charter.ts +61 -0
- package/src/shared/domain/agents/exclusive.ts +24 -0
- package/src/shared/domain/agents/instances.ts +249 -0
- package/src/shared/domain/code-intel-contract.ts +356 -0
- package/src/shared/domain/code-intel-routing.ts +113 -0
- package/src/shared/domain/compact-outcome.ts +44 -0
- package/src/shared/domain/compaction-thresholds.ts +161 -0
- package/src/shared/domain/compaction.ts +379 -0
- package/src/shared/domain/config-schema.ts +421 -0
- package/src/shared/domain/dev/access-cost.ts +226 -0
- package/src/shared/domain/dev/artefacts.ts +50 -0
- package/src/shared/domain/dev/batches-concurrency.ts +36 -0
- package/src/shared/domain/dev/batches-state.ts +49 -0
- package/src/shared/domain/dev/build-commands.ts +44 -0
- package/src/shared/domain/dev/call-guard.ts +341 -0
- package/src/shared/domain/dev/carried-text.ts +49 -0
- package/src/shared/domain/dev/design-rules.ts +100 -0
- package/src/shared/domain/dev/learn-proposals.ts +175 -0
- package/src/shared/domain/dev/learn-state.ts +93 -0
- package/src/shared/domain/dev/path-args.ts +42 -0
- package/src/shared/domain/dev/path-rebase.ts +93 -0
- package/src/shared/domain/dev/plan-checks.ts +190 -0
- package/src/shared/domain/dev/plan-format.ts +180 -0
- package/src/shared/domain/dev/project-files.ts +43 -0
- package/src/shared/domain/dev/questions.ts +249 -0
- package/src/shared/domain/dev/reading-rule.ts +41 -0
- package/src/shared/domain/dev/repo-pack.ts +237 -0
- package/src/shared/domain/dev/review-answer.ts +150 -0
- package/src/shared/domain/dev/review-prompt.ts +221 -0
- package/src/shared/domain/dev/reviewer-charter.ts +31 -0
- package/src/shared/domain/dev/sheet-facts.ts +83 -0
- package/src/shared/domain/dev/spec-format.ts +183 -0
- package/src/shared/domain/dev/step-budget.ts +72 -0
- package/src/shared/domain/dev/step-rules.ts +110 -0
- package/src/shared/domain/dev/test-commands.ts +90 -0
- package/src/shared/domain/dev/test-output.ts +33 -0
- package/src/shared/domain/dev/test-paths.ts +40 -0
- package/src/shared/domain/dev/tool-guards.ts +64 -0
- package/src/shared/domain/dev/trait-pattern.ts +83 -0
- package/src/shared/domain/dev/verdict-format.ts +169 -0
- package/src/shared/domain/dev/whitespace.ts +34 -0
- package/src/shared/domain/dev/work-folder.ts +67 -0
- package/src/shared/domain/dev/yaml-subset.ts +403 -0
- package/src/shared/domain/git/close.ts +273 -0
- package/src/shared/domain/git/pull-request.ts +96 -0
- package/src/shared/domain/git/worktree.ts +46 -0
- package/src/shared/domain/index-languages.ts +16 -0
- package/src/shared/domain/instructions-file.ts +18 -0
- package/src/shared/domain/iso-day.ts +4 -0
- package/src/shared/domain/llm-failure.ts +106 -0
- package/src/shared/domain/llm-profile.ts +25 -0
- package/src/shared/domain/marked-message.ts +33 -0
- package/src/shared/domain/model-catalog.ts +86 -0
- package/src/shared/domain/permission-modes.ts +103 -0
- package/src/shared/domain/prelude.ts +92 -0
- package/src/shared/domain/project-manifests.ts +83 -0
- package/src/shared/domain/search-routing.ts +85 -0
- package/src/shared/domain/secret-patterns.ts +45 -0
- package/src/shared/domain/session-keys.ts +85 -0
- package/src/shared/domain/session-start.ts +60 -0
- package/src/shared/domain/session-summary.ts +13 -0
- package/src/shared/domain/severity.ts +72 -0
- package/src/shared/domain/sha1.ts +61 -0
- package/src/shared/domain/shared-memory/agent-memory-import.ts +143 -0
- package/src/shared/domain/shared-memory/candidates.ts +41 -0
- package/src/shared/domain/shared-memory/entry.ts +145 -0
- package/src/shared/domain/shared-memory/front-matter.ts +183 -0
- package/src/shared/domain/shared-memory/gate.ts +44 -0
- package/src/shared/domain/shared-memory/harvest.ts +61 -0
- package/src/shared/domain/shared-memory/layout.ts +187 -0
- package/src/shared/domain/shared-memory/precedents-block.ts +93 -0
- package/src/shared/domain/shared-memory/refused.ts +84 -0
- package/src/shared/domain/shared-memory/verdict-rows.ts +134 -0
- package/src/shared/domain/snip-turns.ts +45 -0
- package/src/shared/domain/speech.ts +20 -0
- package/src/shared/domain/strip.ts +88 -0
- package/src/shared/domain/tool-trace.ts +122 -0
- package/src/shared/domain/types.ts +67 -0
- package/src/shared/domain/verifiers.ts +37 -0
- package/src/shared/domain/vfs.ts +9 -0
- package/src/shared/domain/workflow/state-file.ts +140 -0
- package/src/shared/infrastructure/globals.ts +52 -0
- package/src/shared/infrastructure/orkeon/approvals.ts +24 -0
- package/src/shared/infrastructure/orkeon/child-agents.ts +127 -0
- package/src/shared/infrastructure/orkeon/code-index.ts +120 -0
- package/src/shared/infrastructure/orkeon/crew-host.ts +27 -0
- package/src/shared/infrastructure/orkeon/crew-memory.ts +12 -0
- package/src/shared/infrastructure/orkeon/dev-deps.ts +172 -0
- package/src/shared/infrastructure/orkeon/files.ts +40 -0
- package/src/shared/infrastructure/orkeon/github-pull-requests.ts +29 -0
- package/src/shared/infrastructure/orkeon/host-provider.ts +22 -0
- package/src/shared/infrastructure/orkeon/human-input.ts +59 -0
- package/src/shared/infrastructure/orkeon/llm-profile.ts +38 -0
- package/src/shared/infrastructure/orkeon/llm.ts +109 -0
- package/src/shared/infrastructure/orkeon/memory-store.ts +41 -0
- package/src/shared/infrastructure/orkeon/memory-tools.ts +131 -0
- package/src/shared/infrastructure/orkeon/permission-rules.ts +42 -0
- package/src/shared/infrastructure/orkeon/progress.ts +24 -0
- package/src/shared/infrastructure/orkeon/run-state.ts +17 -0
- package/src/shared/infrastructure/orkeon/runtime-info.ts +30 -0
- package/src/shared/infrastructure/orkeon/runtime-tools.ts +60 -0
- package/src/shared/infrastructure/orkeon/script-tools.ts +134 -0
- package/src/shared/infrastructure/orkeon/session-store.ts +138 -0
- package/src/shared/infrastructure/orkeon/session-switch.ts +23 -0
- package/src/shared/infrastructure/orkeon/shared-memory.ts +61 -0
- package/src/shared/infrastructure/orkeon/shell-jobs.ts +75 -0
- package/src/shared/infrastructure/orkeon/shell.ts +31 -0
- package/src/shared/infrastructure/orkeon/telemetry.ts +63 -0
- package/src/shared/infrastructure/orkeon/tool-catalogue.ts +75 -0
- package/src/shared/infrastructure/orkeon/tool-results.ts +120 -0
- package/src/shared/infrastructure/orkeon/usage.ts +74 -0
- package/src/shared/infrastructure/orkeon/wiring.ts +118 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// The close of a /dev-batches run, once every batch of the plan is done: one push of the work branch
|
|
2
|
+
// and one pull request for the whole plan (source-space D79: the batches commit, the run pushes once).
|
|
3
|
+
// The pull request's body lists the files of each batch's commit (`merged <hash>` in the log), grouped by
|
|
4
|
+
// the pack's layout roots, each audit's validations and each sheet's assumptions, and is written to
|
|
5
|
+
// `<work>/pr-<slug>/PR.md`; it is opened through the github tool under --pr or dev.prAuto, else its command
|
|
6
|
+
// is handed over. On the default branch nothing is pushed for review, and the close is refused when the pack
|
|
7
|
+
// asks for a work branch (the run's commits are on it). A push that fails leaves the run open: the next
|
|
8
|
+
// /dev-batches tries the close again, and takes a branch already on origin (pushed by hand) as pushed.
|
|
9
|
+
import type { Files, Shell } from "../../../shared/application/ports.ts";
|
|
10
|
+
import type { ConfigStore } from "../../../shared/application/config-store.ts";
|
|
11
|
+
import type { PullRequestOpener } from "../../../shared/application/git/commit-files.ts";
|
|
12
|
+
import { defaultBranch, handOverPullRequest, pushBranch, runGit } from "../../../shared/application/git/commit-files.ts";
|
|
13
|
+
import type { WorkFolder } from "../../../shared/application/dev/resolve-work-folder.ts";
|
|
14
|
+
import type { DevCode } from "../../../shared/application/dev/load-dev-context.ts";
|
|
15
|
+
import { lastVerdict } from "../../../shared/domain/dev/verdict-format.ts";
|
|
16
|
+
import type { RepoPack } from "../../../shared/domain/dev/repo-pack.ts";
|
|
17
|
+
import type { PermissionRule } from "../../../shared/domain/agent-policy/permission.ts";
|
|
18
|
+
import { ruleDecision } from "../../../shared/domain/agent-policy/permission.ts";
|
|
19
|
+
import {
|
|
20
|
+
DEV_PR_AUTO_CONFIG_KEY, GIT_CURRENT_BRANCH_COMMAND, gitPushCommand, gitPushedCheckCommand, isPushed, shellQuote,
|
|
21
|
+
workBranchFromPattern,
|
|
22
|
+
} from "../../../shared/domain/git/close.ts";
|
|
23
|
+
import type { PrSummary } from "../../../shared/domain/git/close.ts";
|
|
24
|
+
import { gitBranchExists } from "../../../shared/domain/git/worktree.ts";
|
|
25
|
+
import { WORKSPACE } from "../../../shared/domain/vfs.ts";
|
|
26
|
+
|
|
27
|
+
export interface MergedBatch { batch: string; hash: string }
|
|
28
|
+
|
|
29
|
+
export interface PlanCloseInput {
|
|
30
|
+
code: string;
|
|
31
|
+
dev: DevCode;
|
|
32
|
+
pack: RepoPack | null;
|
|
33
|
+
work: WorkFolder;
|
|
34
|
+
/** The batches' commits, in the log's order. */
|
|
35
|
+
merged: readonly MergedBatch[];
|
|
36
|
+
/** --pr: open the pull request rather than hand it over. */
|
|
37
|
+
pr: boolean;
|
|
38
|
+
/** The session's rules read at the launch: a deny on the push keeps the commits local. */
|
|
39
|
+
rules: readonly PermissionRule[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface PlanClose { closed: boolean; lines: string[] }
|
|
43
|
+
|
|
44
|
+
const LAYERS = ["domain", "application", "infrastructure", "tests"] as const;
|
|
45
|
+
const MAX_FILES_PER_COMMIT = 200;
|
|
46
|
+
|
|
47
|
+
const under = (path: string, root: string): boolean => {
|
|
48
|
+
const r = root.replace(/\/+$/, "");
|
|
49
|
+
return path === r || path.startsWith(`${r}/`);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** The paths grouped by the pack's layout roots, the others last. */
|
|
53
|
+
export function filesPerLayer(pack: RepoPack | null, paths: readonly string[]): PrSummary["layers"] {
|
|
54
|
+
const left = new Set(paths);
|
|
55
|
+
const out: PrSummary["layers"] = [];
|
|
56
|
+
for (const layer of LAYERS) {
|
|
57
|
+
const root = pack?.layout[layer];
|
|
58
|
+
if (!root) continue;
|
|
59
|
+
const mine = [...left].filter((p) => under(p, root)).sort();
|
|
60
|
+
mine.forEach((p) => left.delete(p));
|
|
61
|
+
out.push({ layer, paths: mine });
|
|
62
|
+
}
|
|
63
|
+
out.push({ layer: "other", paths: [...left].sort() });
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** The files of the batches' commits; a commit git cannot show adds none. */
|
|
68
|
+
async function filesOf(shell: Pick<Shell, "run">, merged: readonly MergedBatch[]): Promise<string[]> {
|
|
69
|
+
const out = new Set<string>();
|
|
70
|
+
for (const m of merged) {
|
|
71
|
+
if (!/^[0-9a-f]{4,40}$/i.test(m.hash)) continue;
|
|
72
|
+
const r = await runGit(shell, `git show --name-only --format= ${shellQuote(m.hash)}`);
|
|
73
|
+
if (r.exitCode !== 0) continue;
|
|
74
|
+
for (const p of r.stdout.split("\n").map((l) => l.trim()).filter((l) => l !== "").slice(0, MAX_FILES_PER_COMMIT)) out.add(p);
|
|
75
|
+
}
|
|
76
|
+
return [...out];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function prAuto(config: Pick<ConfigStore, "readValue">): Promise<boolean> {
|
|
80
|
+
try {
|
|
81
|
+
return (await config.readValue(DEV_PR_AUTO_CONFIG_KEY)).value?.trim() === "true";
|
|
82
|
+
} catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** The pull request's summary for the whole plan. */
|
|
88
|
+
export function planSummary(input: PlanCloseInput, files: readonly string[]): PrSummary {
|
|
89
|
+
const { dev } = input;
|
|
90
|
+
const plan = dev.plan;
|
|
91
|
+
const feature = plan?.plan.feature ?? input.code;
|
|
92
|
+
const ids = input.merged.map((m) => m.batch);
|
|
93
|
+
const validations: string[] = [];
|
|
94
|
+
const audits: string[] = [];
|
|
95
|
+
const notRun: string[] = [];
|
|
96
|
+
const assumptions: NonNullable<PrSummary["assumptions"]> = [];
|
|
97
|
+
for (const batch of ids) {
|
|
98
|
+
const sheet = dev.sheets.find((s) => s.batch === batch)?.sheet;
|
|
99
|
+
assumptions.push(...(sheet?.assumptions ?? []).map((a) => ({ ...a, id: `${batch} ${a.id}` })));
|
|
100
|
+
const verdicts = dev.verdicts.filter((v) => v.batch === batch);
|
|
101
|
+
const verdict = verdicts.length === 0 ? null : lastVerdict(verdicts[verdicts.length - 1].file);
|
|
102
|
+
if (verdict === null) continue;
|
|
103
|
+
validations.push(...verdict.validations.map((v) => `${batch}: ${v}`));
|
|
104
|
+
audits.push(`${batch} ${verdict.verdict ?? "?"}${verdict.when ? ` (${verdict.when})` : ""}, \`${dev.shown}/${verdicts[verdicts.length - 1].name}\``);
|
|
105
|
+
notRun.push(...verdict.notRun.map((v) => `${batch}: ${v}`));
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
batch: `${plan?.plan.prefix ?? input.code.toUpperCase()} — ${feature}: batches ${ids.join(", ") || "none"}, ` +
|
|
109
|
+
`from \`${dev.shown}/${plan?.name ?? "?"}\`, one commit each (${input.merged.map((m) => `${m.batch} ${m.hash || "before this run"}`).join(", ")}).`,
|
|
110
|
+
layers: filesPerLayer(input.pack, files),
|
|
111
|
+
validations,
|
|
112
|
+
assumptions,
|
|
113
|
+
audit: audits.join("; "),
|
|
114
|
+
notRun: notRun.join("; "),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export async function closePlan(
|
|
119
|
+
deps: { files: Pick<Files, "write">; shell: Pick<Shell, "run">; config: Pick<ConfigStore, "readValue">; opener?: PullRequestOpener },
|
|
120
|
+
input: PlanCloseInput,
|
|
121
|
+
): Promise<PlanClose> {
|
|
122
|
+
const current = await runGit(deps.shell, GIT_CURRENT_BRANCH_COMMAND);
|
|
123
|
+
const branch = current.exitCode === 0 ? current.stdout.trim() : "";
|
|
124
|
+
if (branch === "") {
|
|
125
|
+
return { closed: false, lines: [`✗ close: no current branch (a detached HEAD?): check out the work branch, then /dev-batches ${input.code}`] };
|
|
126
|
+
}
|
|
127
|
+
const base = await defaultBranch(deps.shell);
|
|
128
|
+
if (base !== null && base === branch) {
|
|
129
|
+
// The pack asks for a work branch: the run made `<prefix>/<code>` (L7-D7), so HEAD went back to the default one.
|
|
130
|
+
// When that branch does not exist, the commits really are on the default one: the close goes on, said.
|
|
131
|
+
const wanted = input.pack?.contrib.branch?.trim();
|
|
132
|
+
const work = wanted ? workBranchFromPattern(wanted, input.code) : null;
|
|
133
|
+
if (wanted && work !== null && (await runGit(deps.shell, gitBranchExists(work))).exitCode === 0) {
|
|
134
|
+
return {
|
|
135
|
+
closed: false,
|
|
136
|
+
lines: [`✗ close: ${branch} is the default branch and the pack asks for a work branch (${wanted}): ` +
|
|
137
|
+
`git switch ${work}, then /dev-batches ${input.code}`],
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
closed: true,
|
|
142
|
+
lines: [
|
|
143
|
+
...(wanted ? [`⚠ the pack asks for a work branch (${wanted}), but the batches are committed on ${branch}`] : []),
|
|
144
|
+
`✓ every batch is committed on ${branch}, the default branch: no pull request; pushing it is yours (${gitPushCommand(branch)})`,
|
|
145
|
+
],
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const lines: string[] = [];
|
|
149
|
+
const pushCommand = gitPushCommand(branch);
|
|
150
|
+
let pushed = false;
|
|
151
|
+
let closed = true;
|
|
152
|
+
// A confined shell reaches no remote (no network, HOME=/tmp): the user pushes from a terminal, and the
|
|
153
|
+
// remote-tracking ref their push moved, local, tells the next run the branch is on origin.
|
|
154
|
+
const check = await runGit(deps.shell, gitPushedCheckCommand(branch));
|
|
155
|
+
if (check.exitCode === 0 && isPushed(check.stdout)) {
|
|
156
|
+
pushed = true;
|
|
157
|
+
lines.push(`✓ ${branch} is on origin already`);
|
|
158
|
+
} else if (ruleDecision(input.rules, "shell_command", { command: pushCommand, working_directory: WORKSPACE }) === "deny") {
|
|
159
|
+
lines.push(`✗ not pushed: a session rule denies '${pushCommand}'; the commits stay local`);
|
|
160
|
+
} else {
|
|
161
|
+
const push = await pushBranch(deps.shell, branch);
|
|
162
|
+
pushed = push.ok;
|
|
163
|
+
closed = push.ok;
|
|
164
|
+
lines.push(push.ok ? `✓ pushed ${branch} to origin` : `✗ ${push.line}`);
|
|
165
|
+
}
|
|
166
|
+
const files = await filesOf(deps.shell, input.merged);
|
|
167
|
+
const summary = planSummary(input, files);
|
|
168
|
+
const feature = input.dev.plan?.plan.feature ?? input.code;
|
|
169
|
+
lines.push(...await handOverPullRequest(
|
|
170
|
+
{ files: deps.files, opener: deps.opener },
|
|
171
|
+
{
|
|
172
|
+
work: { folder: input.work.folder, vfsPath: input.work.vfsPath }, branch, base, title: `feat(${input.code}): ${feature}`,
|
|
173
|
+
pushed, open: input.pr || (await prAuto(deps.config)), summary,
|
|
174
|
+
},
|
|
175
|
+
));
|
|
176
|
+
if (!closed) {
|
|
177
|
+
lines.push(`the run stays open: /dev-batches ${input.code} tries the push again; a confined shell reaches no ` +
|
|
178
|
+
`remote, so push from a terminal (${pushCommand}), then /dev-batches ${input.code} closes the run`);
|
|
179
|
+
}
|
|
180
|
+
return { closed, lines };
|
|
181
|
+
}
|