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,309 @@
|
|
|
1
|
+
// /permissions — display the effective permission surface and manage the
|
|
2
|
+
// session's allow/deny rules.
|
|
3
|
+
//
|
|
4
|
+
// The rules live in the session state bag and the host's permission gate
|
|
5
|
+
// enforces them at each tool call (shared/application/permission-rules.ts): every
|
|
6
|
+
// change is written to the bag, then the gate is cleared and handed the whole
|
|
7
|
+
// list again, as it has no per-rule removal. A rule names a tool, and optionally
|
|
8
|
+
// an argument pattern: `allow shell_command command=npm test*`. The catalogue
|
|
9
|
+
// reads one kind of rule only — a deny covering every call of a tool removes the
|
|
10
|
+
// tool (agent-policy/permission.ts). A rule may name a built-in tool or one of
|
|
11
|
+
// the extra tools of `tools.extra`, registered by the host or not; a stored rule
|
|
12
|
+
// whose tool `tools.extra` no longer lists stays, dormant, until it lists it again
|
|
13
|
+
// or the rule is removed. The gate itself runs only when the host turned it on
|
|
14
|
+
// (Orkeon:Security:PermissionGate:Enabled); the host says whether it did
|
|
15
|
+
// (PermissionRules.enabled, Orkeon #128, which the runtime always reports) and the
|
|
16
|
+
// view says on or off. The last case of gateStateLines - no value - is for a fake
|
|
17
|
+
// or a port that says nothing: it names the setting and the launcher instead.
|
|
18
|
+
|
|
19
|
+
import type { PermissionRules, ToolCatalogue } from "../../../shared/application/ports.ts";
|
|
20
|
+
import { USER_CONFIG_FILE_PATH } from "../../../shared/application/config-store.ts";
|
|
21
|
+
import type { ConfigStore } from "../../../shared/application/config-store.ts";
|
|
22
|
+
import type { SessionIo } from "../../../shared/application/session-io.ts";
|
|
23
|
+
import { configuredNames, resolveExtraTools } from "../../../shared/application/extra-tools.ts";
|
|
24
|
+
import type { ExtraToolsResolution } from "../../../shared/application/extra-tools.ts";
|
|
25
|
+
import {
|
|
26
|
+
addPermissionRule, clearPermissionRules, readPermissionRules, removePermissionRule, syncPermissionRules,
|
|
27
|
+
} from "../../../shared/application/permission-rules.ts";
|
|
28
|
+
import type { StoredRules } from "../../../shared/application/permission-rules.ts";
|
|
29
|
+
import { readMemoryDir } from "../../../shared/application/shared-memory/memory-settings.ts";
|
|
30
|
+
import { memoryWriteRules } from "../../../shared/domain/shared-memory/layout.ts";
|
|
31
|
+
import { PERMISSION_FALLBACK_CONFIG_KEY, PERMISSION_MODES } from "../../../shared/domain/permission-modes.ts";
|
|
32
|
+
import { EXTRA_TOOLS_CONFIG_KEY } from "../../../shared/domain/agent-policy/extra-tools.ts";
|
|
33
|
+
import {
|
|
34
|
+
catalogueFor, checkRule, formatRule, gateLine, isReadOnly, readRule, sameCalls, toolsetFor, RULE_SYNTAX,
|
|
35
|
+
ACT_TOOLS,
|
|
36
|
+
MEMORY_TOOLS,
|
|
37
|
+
RULEABLE_TOOLS,
|
|
38
|
+
scriptToolAccess,
|
|
39
|
+
scriptToolsFor,
|
|
40
|
+
} from "../../../shared/domain/agent-policy/permission.ts";
|
|
41
|
+
import type { ExtraTool, PermissionRule } from "../../../shared/domain/agent-policy/permission.ts";
|
|
42
|
+
import { heldRuleSets } from "../../../shared/domain/agent-policy/rule-sets.ts";
|
|
43
|
+
import { nestedConfigKeys } from "../../../shared/domain/config-schema.ts";
|
|
44
|
+
import type { CommandView } from "../view.ts";
|
|
45
|
+
|
|
46
|
+
export const PERMISSIONS_USAGE =
|
|
47
|
+
`usage: /permissions [show] | add ${RULE_SYNTAX} | remove ${RULE_SYNTAX} | list | clear`;
|
|
48
|
+
|
|
49
|
+
/** Said when the host keeps no session rules: a rule is stored, nothing enforces it. */
|
|
50
|
+
const NO_GATE_RULES =
|
|
51
|
+
"⚠ the host keeps no session rules (orkeon-repl does): the gate decides each call from the mode alone.";
|
|
52
|
+
|
|
53
|
+
export interface PermissionsDeps {
|
|
54
|
+
session: Pick<SessionIo, "readDefaultPermissionMode" | "resolveSessionFallbackMode" | "readState" | "writeState">;
|
|
55
|
+
gate: PermissionRules;
|
|
56
|
+
/** Reads `tools.extra`, the extra tools a rule may name, and what the project file
|
|
57
|
+
* could not widen (QL-06). */
|
|
58
|
+
config: Pick<ConfigStore, "readValue" | "readFile" | "readUserFile">;
|
|
59
|
+
/** The tools the host registers: the catalogue offers the extra tools it has. */
|
|
60
|
+
catalogue: Pick<ToolCatalogue, "find">;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The mode a turn without a `mode:` prefix runs in: /mode's, else the fallback. */
|
|
64
|
+
async function sessionMode(session: PermissionsDeps["session"]): Promise<string> {
|
|
65
|
+
return (await session.readDefaultPermissionMode()) ?? (await session.resolveSessionFallbackMode()).mode;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** An extra tool as `/permissions` shows it: `search_issues (write)`. */
|
|
69
|
+
function describeExtra(tool: ExtraTool): string {
|
|
70
|
+
return `${tool.name} (${tool.access})`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** The scope of a rule, for the `list` table. */
|
|
74
|
+
function callsOf(rule: PermissionRule): string {
|
|
75
|
+
return rule.argument === undefined ? "every call" : `${rule.argument}=${rule.pattern}`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** What the stored rules hold that the gate does not get, and a setting that could not be read. */
|
|
79
|
+
function storedNotes(stored: StoredRules, extras: ExtraToolsResolution): string[] {
|
|
80
|
+
return [
|
|
81
|
+
...(extras.unreadable === undefined
|
|
82
|
+
? []
|
|
83
|
+
: [`⚠ ${EXTRA_TOOLS_CONFIG_KEY} could not be read (${extras.unreadable}): no extra tool is known, and the ` +
|
|
84
|
+
"rules on extra tools are dormant."]),
|
|
85
|
+
...stored.dormant.map((rule) =>
|
|
86
|
+
`⚠ rule ${rule} is dormant: its tool is neither built in nor listed in ${EXTRA_TOOLS_CONFIG_KEY}. It is ` +
|
|
87
|
+
"kept, not handed to the gate, and applies again once the tool is listed (/permissions remove deletes it)."),
|
|
88
|
+
...(stored.invalid.length > 0
|
|
89
|
+
? [`⚠ ${stored.invalid.length} stored entr${stored.invalid.length === 1 ? "y is" : "ies are"} not a rule ` +
|
|
90
|
+
`(${stored.invalid.join(", ")}): kept as written, ignored; /permissions clear removes them.`]
|
|
91
|
+
: []),
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** What a sync must report: a gate that holds none, rules it did not get. */
|
|
96
|
+
function syncNotes(sync: StoredRules & { applied: boolean }, extras: ExtraToolsResolution): string[] {
|
|
97
|
+
return [...(sync.applied ? [] : [NO_GATE_RULES]), ...storedNotes(sync, extras)];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** What the project file set and could not widen (QL-06), and user settings that could not be read. */
|
|
101
|
+
async function widenedNotes(config: PermissionsDeps["config"]): Promise<{ fallback: string[]; notes: string[] }> {
|
|
102
|
+
const [fallback, extra, user, project] = await Promise.all([
|
|
103
|
+
config.readValue(PERMISSION_FALLBACK_CONFIG_KEY).catch(() => undefined),
|
|
104
|
+
config.readValue(EXTRA_TOOLS_CONFIG_KEY).catch(() => undefined),
|
|
105
|
+
config.readUserFile().catch(() => ({ malformed: true, map: {} })),
|
|
106
|
+
config.readFile().catch(() => ({ map: {} })),
|
|
107
|
+
]);
|
|
108
|
+
const nested = [...new Set([project.map, user.map].flatMap(nestedConfigKeys))]
|
|
109
|
+
.filter((key) => key === PERMISSION_FALLBACK_CONFIG_KEY || key === EXTRA_TOOLS_CONFIG_KEY);
|
|
110
|
+
return {
|
|
111
|
+
fallback: fallback?.ignored === undefined
|
|
112
|
+
? []
|
|
113
|
+
: [` ↳ ignored : the project file sets ${PERMISSION_FALLBACK_CONFIG_KEY} '${fallback.ignored.value}': ` +
|
|
114
|
+
fallback.ignored.reason],
|
|
115
|
+
notes: [
|
|
116
|
+
...(user.malformed
|
|
117
|
+
? [`⚠ the user settings (${USER_CONFIG_FILE_PATH}) could not be read or parsed: no user setting applies.`]
|
|
118
|
+
: []),
|
|
119
|
+
...nested.map((key) =>
|
|
120
|
+
`⚠ ${key} is written nested in a settings file ({"${key.split(".")[0]}": {…}}), so nothing reads it: ` +
|
|
121
|
+
`write it flat, "${key}": ….`),
|
|
122
|
+
...(extra?.ignored === undefined
|
|
123
|
+
? []
|
|
124
|
+
: [`⚠ ${EXTRA_TOOLS_CONFIG_KEY} of the project file names ${extra.ignored.value}, which ${extra.ignored.reason}: ` +
|
|
125
|
+
"not offered."]),
|
|
126
|
+
],
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** The effective surface: mode, catalogue, rules and what the gate holds. */
|
|
131
|
+
async function renderShow(deps: PermissionsDeps, extras: ExtraToolsResolution): Promise<string> {
|
|
132
|
+
const { session, gate } = deps;
|
|
133
|
+
const sessionDefault = await session.readDefaultPermissionMode();
|
|
134
|
+
const fallback = await session.resolveSessionFallbackMode();
|
|
135
|
+
const mode = sessionDefault ?? fallback.mode;
|
|
136
|
+
const widened = await widenedNotes(deps.config);
|
|
137
|
+
const stored = await readPermissionRules(session, configuredNames(extras));
|
|
138
|
+
const { rules } = stored;
|
|
139
|
+
const decision = catalogueFor(mode, rules, extras.present);
|
|
140
|
+
const gateOn = gate.enabled();
|
|
141
|
+
// What the gate holds beyond the session's rules: the shared memory's guard every sync adds, then the
|
|
142
|
+
// built-in rule sets (a dev step's), grouped.
|
|
143
|
+
const sessionLines = rules.map(gateLine);
|
|
144
|
+
const memoryDir = (await readMemoryDir(deps.config)).dir;
|
|
145
|
+
const memoryLines = memoryWriteRules(memoryDir).map(gateLine);
|
|
146
|
+
const all = gate.available() ? gate.list() : null;
|
|
147
|
+
const guarded = all === null ? [] : all.filter((l) => memoryLines.includes(l) && !sessionLines.includes(l));
|
|
148
|
+
const held = all === null ? null : all.filter((l) => !guarded.includes(l));
|
|
149
|
+
const grouped = held === null ? null : heldRuleSets(held.filter((l) => !sessionLines.includes(l)));
|
|
150
|
+
const setLines = new Set(held === null || grouped === null
|
|
151
|
+
? []
|
|
152
|
+
: held.filter((l) => !sessionLines.includes(l) && !grouped.rest.includes(l)));
|
|
153
|
+
const plain = held === null ? null : held.filter((l) => !setLines.has(l));
|
|
154
|
+
const setParts = grouped !== null && grouped.sets.length > 0
|
|
155
|
+
? [`rule sets of the last dev step: ${grouped.sets.map((g) => `${g.id} (${g.count} rules)`).join(", ")}`]
|
|
156
|
+
: [];
|
|
157
|
+
const guardParts = guarded.length > 0
|
|
158
|
+
? [`the shared memory's guard: no tool of the model writes under ${memoryDir}/candidates or ${memoryDir}/entries (${guarded.length} rules)`]
|
|
159
|
+
: [];
|
|
160
|
+
const heldParts = plain === null ? [] : [...(plain.length > 0 ? [plain.join(", ")] : []), ...setParts, ...guardParts];
|
|
161
|
+
|
|
162
|
+
// The shared memory's tools are the main loop's, offered by mode (memory_recall always, memory_push where the
|
|
163
|
+
// mode edits) less a deny rule on the whole tool; Orkeon Code's other tools (SCRIPT_TOOLS) belong to the dev
|
|
164
|
+
// crews that attach them, never to the session.
|
|
165
|
+
const memoryByMode = scriptToolsFor(mode, MEMORY_TOOLS);
|
|
166
|
+
const memory = scriptToolsFor(mode, MEMORY_TOOLS, rules);
|
|
167
|
+
const offered = [...toolsetFor(mode, extras.present), ...memoryByMode];
|
|
168
|
+
// The host offers the ACT_TOOLS to every act, and its gate refuses them in the read-only modes only.
|
|
169
|
+
const withheld = (t: string) => MEMORY_TOOLS.includes(t)
|
|
170
|
+
|| ((isReadOnly(mode) || !ACT_TOOLS.includes(t)) && scriptToolAccess(t) === undefined);
|
|
171
|
+
const vocabulary = [...RULEABLE_TOOLS.filter(withheld), ...extras.present.map((t) => t.name)];
|
|
172
|
+
const lines = [
|
|
173
|
+
`session default mode : ${mode} ${isReadOnly(mode) ? "(read-only)" : ""}`,
|
|
174
|
+
` ↳ source : ${sessionDefault ? "set by /mode (session state)" : fallback.explanation}`,
|
|
175
|
+
...widened.fallback,
|
|
176
|
+
`modes : ${PERMISSION_MODES.join(", ")} (bare /mode cycles)`,
|
|
177
|
+
`tool catalogue : ${[...decision.tools, ...memory].join(", ") || "(empty)"}`,
|
|
178
|
+
` ↳ withheld by mode : ${vocabulary.filter((t) => !offered.includes(t)).join(", ") || "(none)"}`,
|
|
179
|
+
` ↳ removed by rule : ${[...decision.deniedByRule, ...memoryByMode.filter((t) => !memory.includes(t))].join(", ") || "(none)"}`,
|
|
180
|
+
...(extras.present.length + extras.missing.length + extras.invalid.length > 0
|
|
181
|
+
? [
|
|
182
|
+
` ↳ extra tools : ${extras.present.map(describeExtra).join(", ") || "(none registered)"}` +
|
|
183
|
+
(extras.missing.length > 0 ? `; not registered: ${extras.missing.map(describeExtra).join(", ")}` : "") +
|
|
184
|
+
(extras.invalid.length > 0 ? `; ignored: ${extras.invalid.join(", ")}` : ""),
|
|
185
|
+
]
|
|
186
|
+
: []),
|
|
187
|
+
`session rules : ${rules.map(formatRule).join(", ") || "(none)"}` +
|
|
188
|
+
(stored.dormant.length > 0 ? `; dormant: ${stored.dormant.join(", ")}` : ""),
|
|
189
|
+
`in the host gate : ${plain === null ? "(the host keeps no session rules)" : heldParts.join("; ") || "(none)"}`,
|
|
190
|
+
"enforcement : 1) catalogue: what the mode offers, less the tools a deny rule covers whole",
|
|
191
|
+
" 2) host gate, at each call: a matching deny refuses; a matching allow runs",
|
|
192
|
+
" without asking (not in plan); else the mode decides, and default and",
|
|
193
|
+
" acceptEdits ask you: [y] once / [s] session / [n] no; a background",
|
|
194
|
+
" command's question names its task (for [t1]), answered from the main prompt",
|
|
195
|
+
" 3) dev crews' callback (/dev-spec, /dev-plan, /dev-batches, a /tasks repair),",
|
|
196
|
+
" after the gate allowed a call:",
|
|
197
|
+
" the step's rule sets and a role's roots again, glob/grep/count_pattern by",
|
|
198
|
+
" their whole input, the act's mode when the host has no gate, then the",
|
|
199
|
+
" pre-tool and post-tool hooks (/hooks); it can refuse, never allow more",
|
|
200
|
+
...gateStateLines(gateOn),
|
|
201
|
+
];
|
|
202
|
+
|
|
203
|
+
for (const r of decision.inert) {
|
|
204
|
+
lines.push(`⚠ rule ${formatRule(r.rule)} has NO effect in '${mode}': ${r.reason}`);
|
|
205
|
+
}
|
|
206
|
+
if (plain !== null && plain.join("\n") !== sessionLines.join("\n")) {
|
|
207
|
+
lines.push("⚠ the gate holds other rules than the session: the next change or /assistant hands it these.");
|
|
208
|
+
} else if (setParts.length > 0) {
|
|
209
|
+
lines.push(
|
|
210
|
+
"⚠ the gate also holds the rule sets of the last dev step: the next /assistant turn or rule change hands it the session's rules alone.",
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
lines.push(...widened.notes, ...storedNotes(stored, extras));
|
|
214
|
+
return lines.join("\n");
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** The closing lines of the enforcement block: what the host says of its gate. */
|
|
218
|
+
function gateStateLines(on: boolean | undefined): string[] {
|
|
219
|
+
if (on === true) {
|
|
220
|
+
return [
|
|
221
|
+
" the gate is on (Orkeon:Security:PermissionGate:Enabled, the host says): the rules",
|
|
222
|
+
" and the modes above hold at each call",
|
|
223
|
+
];
|
|
224
|
+
}
|
|
225
|
+
if (on === false) {
|
|
226
|
+
return [
|
|
227
|
+
"⚠ the gate is OFF (Orkeon:Security:PermissionGate:Enabled is not true, the host says): no rule above",
|
|
228
|
+
" is enforced and nothing asks",
|
|
229
|
+
];
|
|
230
|
+
}
|
|
231
|
+
return [
|
|
232
|
+
" the gate runs only when Orkeon:Security:PermissionGate:Enabled is true, which",
|
|
233
|
+
" the launcher sets: off, no rule above is enforced and nothing asks",
|
|
234
|
+
];
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** `/permissions [show|list|add|remove|clear] …`, from the command's raw tokens. */
|
|
238
|
+
export async function runPermissions(tokens: string[], deps: PermissionsDeps): Promise<CommandView> {
|
|
239
|
+
const { session, gate } = deps;
|
|
240
|
+
const [sub, ...ruleTokens] = tokens;
|
|
241
|
+
const ruleText = ruleTokens.join(" ");
|
|
242
|
+
const extras = await resolveExtraTools(deps);
|
|
243
|
+
const extraNames = configuredNames(extras);
|
|
244
|
+
const builtIn = memoryWriteRules((await readMemoryDir(deps.config)).dir);
|
|
245
|
+
const sync = () => syncPermissionRules({ session, gate, extraNames, builtIn });
|
|
246
|
+
switch ((sub ?? "show").toLowerCase()) {
|
|
247
|
+
case "show":
|
|
248
|
+
return { text: await renderShow(deps, extras) };
|
|
249
|
+
|
|
250
|
+
case "list": {
|
|
251
|
+
const stored = await readPermissionRules(session, extraNames);
|
|
252
|
+
const dormant = stored.dormant.map(readRule).filter((r): r is PermissionRule => r !== null);
|
|
253
|
+
if (stored.rules.length + dormant.length === 0) {
|
|
254
|
+
return { text: [`no permission rules set. ${PERMISSIONS_USAGE}`, ...storedNotes(stored, extras)].join("\n") };
|
|
255
|
+
}
|
|
256
|
+
const notes = storedNotes({ ...stored, dormant: [] }, extras);
|
|
257
|
+
return {
|
|
258
|
+
table: [
|
|
259
|
+
...stored.rules.map((r) => ({ effect: r.effect, tool: r.tool, calls: callsOf(r), state: "enforced" })),
|
|
260
|
+
...dormant.map((r) => ({
|
|
261
|
+
effect: r.effect, tool: r.tool, calls: callsOf(r), state: `dormant: not in ${EXTRA_TOOLS_CONFIG_KEY}`,
|
|
262
|
+
})),
|
|
263
|
+
],
|
|
264
|
+
text: notes.length > 0 ? notes.join("\n") : undefined,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
case "add": {
|
|
269
|
+
const check = checkRule(ruleText, extraNames);
|
|
270
|
+
if (!check.ok) return { text: `invalid rule: ${check.reason}.\n${PERMISSIONS_USAGE}` };
|
|
271
|
+
const { rule } = check;
|
|
272
|
+
await addPermissionRule(session, rule);
|
|
273
|
+
const synced = await sync();
|
|
274
|
+
const mode = await sessionMode(session);
|
|
275
|
+
const decision = catalogueFor(mode, synced.rules, extras.present);
|
|
276
|
+
const inert = decision.inert.find((r) => r.rule.effect === rule.effect && sameCalls(r.rule, rule));
|
|
277
|
+
return {
|
|
278
|
+
text: [
|
|
279
|
+
`rule ${formatRule(rule)} added.`,
|
|
280
|
+
...(check.warning ? [`⚠ ${check.warning}`] : []),
|
|
281
|
+
...(inert ? [`⚠ it has NO effect in '${mode}': ${inert.reason}`] : []),
|
|
282
|
+
`catalogue for '${mode}': ${decision.tools.join(", ") || "(empty)"}`,
|
|
283
|
+
...syncNotes(synced, extras),
|
|
284
|
+
].join("\n"),
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
case "remove": {
|
|
289
|
+
// Read by the grammar alone: a dormant rule, whose tool is not known now, is removed too.
|
|
290
|
+
const rule = readRule(ruleText);
|
|
291
|
+
if (!rule) return { text: `invalid rule: expected ${RULE_SYNTAX}.\n${PERMISSIONS_USAGE}` };
|
|
292
|
+
const removed = await removePermissionRule(session, rule);
|
|
293
|
+
if (removed.length === 0) return { text: `no such rule: ${formatRule(rule)}.` };
|
|
294
|
+
const synced = await sync();
|
|
295
|
+
return { text: [`rule ${formatRule(removed[0])} removed.`, ...syncNotes(synced, extras)].join("\n") };
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
case "clear": {
|
|
299
|
+
await clearPermissionRules(session);
|
|
300
|
+
const synced = await sync();
|
|
301
|
+
return {
|
|
302
|
+
text: ["all permission rules cleared (the mode decides alone).", ...syncNotes(synced, extras)].join("\n"),
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
default:
|
|
307
|
+
return { text: PERMISSIONS_USAGE };
|
|
308
|
+
}
|
|
309
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Session-scoped toggles shared by the slash commands (/fast, /proactive). Values
|
|
2
|
+
// live in the session state bag (session_store
|
|
3
|
+
// get_state/set_state) so they survive crew runs and are cleared by
|
|
4
|
+
// /clear. Each helper takes the session it works on, so a test runs it
|
|
5
|
+
// over FakeSessionStore; the entry points pass orkeonSessionIo(). Lives under
|
|
6
|
+
// commands/_lib/ — the loader's SearchPattern is "*.cmd.ts", so this file is
|
|
7
|
+
// never loaded as a command.
|
|
8
|
+
|
|
9
|
+
import type { SessionStore } from "../../../shared/application/ports.ts";
|
|
10
|
+
import { rawTokens } from "../args.ts";
|
|
11
|
+
|
|
12
|
+
/** Read a boolean flag ("true"/"false" strings in the bag; default false). */
|
|
13
|
+
async function readFlag(session: Pick<SessionStore, "readState">, key: string): Promise<boolean> {
|
|
14
|
+
try {
|
|
15
|
+
return (await session.readState(key)) === "true";
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** A toggle command's descriptor, for its entry point to register with defineCommand. */
|
|
22
|
+
export interface ToggleCommand {
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
handler<R>(args: { readonly raw?: unknown }, ctx: { continue(message: string): R }): Promise<R>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A `/name [on|off]` toggle command over one boolean state key — bare
|
|
30
|
+
* invocation flips the flag, `on`/`off` set it explicitly. `note` is appended
|
|
31
|
+
* to the confirmation so each command states what consumes the flag. The entry
|
|
32
|
+
* point registers it: `defineCommand(toggleCommand(spec, session))`.
|
|
33
|
+
*/
|
|
34
|
+
export function toggleCommand(
|
|
35
|
+
spec: { name: string; description: string; key: string; note: string },
|
|
36
|
+
session: Pick<SessionStore, "readState" | "writeState">,
|
|
37
|
+
): ToggleCommand {
|
|
38
|
+
return {
|
|
39
|
+
name: spec.name,
|
|
40
|
+
description: spec.description,
|
|
41
|
+
async handler(args, ctx) {
|
|
42
|
+
const token = String(rawTokens(args)[0] ?? "").toLowerCase();
|
|
43
|
+
const current = await readFlag(session, spec.key);
|
|
44
|
+
const next = token === "on" ? true : token === "off" ? false : !current;
|
|
45
|
+
await session.writeState(spec.key, String(next));
|
|
46
|
+
return ctx.continue(`${spec.name}: ${next ? "on" : "off"} (${spec.note}; /clear clears it).`);
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// /skills (E-1) — manage skill attachments (baseline 04 §/skills). Skills in
|
|
2
|
+
// Orkeon Code are workspace markdown files whose PATH is registered here; attached
|
|
3
|
+
// skills are restorable context (the post-compaction restore, E-4, re-injects
|
|
4
|
+
// path-mentioned files). DEVIATION (recorded in RESULTS.md): no autonomous
|
|
5
|
+
// skill triggering — attachment is explicit.
|
|
6
|
+
|
|
7
|
+
import type { Files, SessionStore } from "../../../shared/application/ports.ts";
|
|
8
|
+
import { readJsonArray, writeJson } from "../../../shared/application/session-state.ts";
|
|
9
|
+
import { SKILLS_STATE_KEY } from "../../../shared/domain/session-keys.ts";
|
|
10
|
+
import type { CommandView } from "../view.ts";
|
|
11
|
+
|
|
12
|
+
export interface SkillsDeps {
|
|
13
|
+
session: Pick<SessionStore, "readState" | "writeState">;
|
|
14
|
+
files: Pick<Files, "read">;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** `/skills [list|attach <path>|detach <n>]`, from the command's raw tokens. */
|
|
18
|
+
export async function runSkills(tokens: string[], deps: SkillsDeps): Promise<CommandView> {
|
|
19
|
+
const { session, files } = deps;
|
|
20
|
+
const [sub, arg] = tokens;
|
|
21
|
+
const skills = await readJsonArray(session, SKILLS_STATE_KEY);
|
|
22
|
+
switch ((sub ?? "list").toLowerCase()) {
|
|
23
|
+
case "list":
|
|
24
|
+
if (skills.length === 0) {
|
|
25
|
+
return { text: "no skills attached. usage: /skills attach <workspace path to a .md playbook>" };
|
|
26
|
+
}
|
|
27
|
+
return { table: skills.map((p, i) => ({ n: i + 1, path: String(p) })) };
|
|
28
|
+
case "attach": {
|
|
29
|
+
if (!arg) return { text: "usage: /skills attach <path>" };
|
|
30
|
+
try {
|
|
31
|
+
await files.read(arg, 1);
|
|
32
|
+
} catch {
|
|
33
|
+
return { text: `cannot attach '${arg}' — the file is not readable in the mounted workspace.` };
|
|
34
|
+
}
|
|
35
|
+
if (!skills.includes(arg)) skills.push(arg);
|
|
36
|
+
await writeJson(session, SKILLS_STATE_KEY, skills);
|
|
37
|
+
return { text: `skill attached: ${arg} (${skills.length} attached; /clear clears).` };
|
|
38
|
+
}
|
|
39
|
+
case "detach": {
|
|
40
|
+
const n = Number(arg);
|
|
41
|
+
if (!Number.isInteger(n) || n < 1 || n > skills.length) {
|
|
42
|
+
return { text: `usage: /skills detach <1-${skills.length || 1}>` };
|
|
43
|
+
}
|
|
44
|
+
const [removed] = skills.splice(n - 1, 1);
|
|
45
|
+
await writeJson(session, SKILLS_STATE_KEY, skills);
|
|
46
|
+
return { text: `skill detached: ${removed}` };
|
|
47
|
+
}
|
|
48
|
+
default:
|
|
49
|
+
return { text: "usage: /skills [list|attach <path>|detach <n>]" };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// /say: read a text aloud through the speech MCP server (mcp/whisper), or the
|
|
2
|
+
// assistant's last answer when no text is given. The server cleans the Markdown
|
|
3
|
+
// off, synthesizes the text (Piper, OpenAI's API or a compatible server) and
|
|
4
|
+
// plays it on the speaker when the launcher ran with ORKEON_CODE_VOICE=1;
|
|
5
|
+
// otherwise it writes /transcripts/speech.wav and says it played nothing.
|
|
6
|
+
//
|
|
7
|
+
// The reading is the command's call, made by the speech crew: synthesizing a
|
|
8
|
+
// long answer can outlast the 10 s a handler may wait. --stop is a quick call,
|
|
9
|
+
// made here.
|
|
10
|
+
import type { ConfigStore } from "../../../shared/application/config-store.ts";
|
|
11
|
+
import type { ToolCatalogue } from "../../../shared/application/ports.ts";
|
|
12
|
+
import type { SessionIo } from "../../../shared/application/session-io.ts";
|
|
13
|
+
import { errorText } from "../../../shared/domain/prelude.ts";
|
|
14
|
+
import { SPEAK_TOOL } from "../../../shared/domain/speech.ts";
|
|
15
|
+
import { commandLine, isOption, optionValue, splitWords } from "../args.ts";
|
|
16
|
+
import { launchCrew, withLlmProfile } from "../dispatch.ts";
|
|
17
|
+
import type { CommandLog, LaunchDeps, LaunchResult } from "../dispatch.ts";
|
|
18
|
+
import { missingToolMessage } from "./transcribe.ts";
|
|
19
|
+
|
|
20
|
+
export const STOP_TOOL = "stop_speaking";
|
|
21
|
+
|
|
22
|
+
export const SAY_USAGE = "usage: /say [<text>] [--voice <voice>]\n /say --stop";
|
|
23
|
+
|
|
24
|
+
export type SayRequest = { kind: "stop" } | { kind: "say"; text: string; voice: string };
|
|
25
|
+
|
|
26
|
+
export type ParsedSay = { ok: true; request: SayRequest } | { ok: false; error: string };
|
|
27
|
+
|
|
28
|
+
/** The arguments of /say: --stop alone, or a text (empty: the last answer; quoted, it may start
|
|
29
|
+
* with --) and a voice. */
|
|
30
|
+
export function parseSayArgs(tokens: readonly string[]): ParsedSay {
|
|
31
|
+
const words = splitWords(commandLine(tokens));
|
|
32
|
+
if (words.length === 1 && isOption(words[0]) && words[0].text === "--stop") return { ok: true, request: { kind: "stop" } };
|
|
33
|
+
const text: string[] = [];
|
|
34
|
+
let voice = "";
|
|
35
|
+
for (let i = 0; i < words.length; i++) {
|
|
36
|
+
const word = words[i].text;
|
|
37
|
+
if (!isOption(words[i])) {
|
|
38
|
+
text.push(word);
|
|
39
|
+
} else if (word === "--voice") {
|
|
40
|
+
const value = optionValue(words, i++);
|
|
41
|
+
if (value === null) return { ok: false, error: "--voice needs a voice name (fr_FR-siwis-medium, en_US-lessac-medium...)" };
|
|
42
|
+
voice = value;
|
|
43
|
+
} else if (word === "--stop") {
|
|
44
|
+
return { ok: false, error: "--stop takes nothing else" };
|
|
45
|
+
} else {
|
|
46
|
+
return { ok: false, error: `unknown option ${word}` };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return { ok: true, request: { kind: "say", text: text.join(" ").trim(), voice } };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The content of the assistant's last message in the session, or "" when there is none. */
|
|
53
|
+
export function lastAnswer(messages: ReadonlyArray<{ role: string; content: unknown }>): string {
|
|
54
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
55
|
+
const message = messages[i];
|
|
56
|
+
if (message.role === "assistant" && typeof message.content === "string" && message.content.trim()) return message.content;
|
|
57
|
+
}
|
|
58
|
+
return "";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** What /say reads and drives: the registered tools, the session (for the last answer), the crew launch. */
|
|
62
|
+
export type SayDeps = LaunchDeps & {
|
|
63
|
+
catalogue: Pick<ToolCatalogue, "find" | "callText">;
|
|
64
|
+
session: Pick<SessionIo, "readMessages">;
|
|
65
|
+
config: Pick<ConfigStore, "readValue" | "readFile">;
|
|
66
|
+
log: Pick<CommandLog, "info" | "warn">;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** Launch the reading and return its ticket, or the message to show when it launches nothing. */
|
|
70
|
+
export async function dispatchSay(tokens: readonly string[], deps: SayDeps): Promise<LaunchResult | { message: string }> {
|
|
71
|
+
const parsed = parseSayArgs(tokens);
|
|
72
|
+
if (!parsed.ok) return { message: `${parsed.error}\n${SAY_USAGE}` };
|
|
73
|
+
const { request } = parsed;
|
|
74
|
+
if (request.kind === "stop") {
|
|
75
|
+
const stop = deps.catalogue.find(STOP_TOOL);
|
|
76
|
+
if (stop === undefined) return { message: missingToolMessage(STOP_TOOL) };
|
|
77
|
+
const outcome = await deps.catalogue.callText(stop, {});
|
|
78
|
+
return { message: outcome.ok ? (outcome.text || "stopped") : `✗ ${STOP_TOOL}: ${outcome.failure}` };
|
|
79
|
+
}
|
|
80
|
+
const speak = deps.catalogue.find(SPEAK_TOOL);
|
|
81
|
+
if (speak === undefined) return { message: missingToolMessage(SPEAK_TOOL) };
|
|
82
|
+
let text = request.text;
|
|
83
|
+
if (!text) {
|
|
84
|
+
try {
|
|
85
|
+
text = lastAnswer((await deps.session.readMessages()).messages);
|
|
86
|
+
} catch (error) {
|
|
87
|
+
return { message: `cannot read the session's last answer: ${errorText(error)}` };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (!text) return { message: "nothing to read: give a text, or ask the assistant first (/say alone reads its last answer)" };
|
|
91
|
+
const args: Record<string, unknown> = { text };
|
|
92
|
+
if (request.voice) args.voice = request.voice;
|
|
93
|
+
return launchCrew(await withLlmProfile(deps, deps.config), "speech", { tool: speak, args, label: request.text ? "text read aloud" : "last answer read aloud" }, {
|
|
94
|
+
characters: text.length, ...(request.voice ? { voice: request.voice } : {}),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// /transcribe: speech-to-text through the Whisper MCP server (mcp/whisper),
|
|
2
|
+
// whose tools the launcher declares when ORKEON_CODE_AUDIO_DIR is set.
|
|
3
|
+
//
|
|
4
|
+
// The call is the command's: the gate does not ask, and no `tools.extra` entry is
|
|
5
|
+
// needed. It is made by a crew, never by this command's handler: a transcription
|
|
6
|
+
// lasts minutes, and the engine bounds the promise a handler awaits at 10 s.
|
|
7
|
+
// Without --then, the speech crew makes the call and /transcribe prints its
|
|
8
|
+
// text; with --then, the main loop makes it before the turn (a prelude) and the
|
|
9
|
+
// model reads the instruction, then the transcription.
|
|
10
|
+
import type { ToolCatalogue } from "../../../shared/application/ports.ts";
|
|
11
|
+
import type { PreludeCall } from "../../../shared/domain/prelude.ts";
|
|
12
|
+
import { commandLine, isOption, optionValue, parseAssistantInput, splitWords } from "../args.ts";
|
|
13
|
+
import { launchCrew, launchMainLoop, withLlmProfile } from "../dispatch.ts";
|
|
14
|
+
import type { LaunchResult, MainLoopLaunchDeps } from "../dispatch.ts";
|
|
15
|
+
|
|
16
|
+
export const TRANSCRIBE_TOOL = "transcribe_audio";
|
|
17
|
+
export const LIST_AUDIO_TOOL = "list_audio";
|
|
18
|
+
export const AUDIO_ROOT = "/audio";
|
|
19
|
+
|
|
20
|
+
export const TRANSCRIBE_USAGE =
|
|
21
|
+
'usage: /transcribe <file> [--lang <code>] [--prompt "<words>"] [--then "<instruction>"]\n' +
|
|
22
|
+
" /transcribe --list";
|
|
23
|
+
|
|
24
|
+
/** What /transcribe was asked: the listing of /audio, or one file. */
|
|
25
|
+
export type TranscribeRequest =
|
|
26
|
+
| { kind: "list" }
|
|
27
|
+
| { kind: "file"; path: string; language: string; vocabulary: string; then: string | null };
|
|
28
|
+
|
|
29
|
+
export type ParsedTranscribe = { ok: true; request: TranscribeRequest } | { ok: false; error: string };
|
|
30
|
+
|
|
31
|
+
/** A file name under /audio, or a path given as /audio/<file>, as the virtual path. */
|
|
32
|
+
export function audioPath(file: string): string {
|
|
33
|
+
const trimmed = file.trim();
|
|
34
|
+
return trimmed.startsWith(AUDIO_ROOT + "/") ? trimmed : `${AUDIO_ROOT}/${trimmed.replace(/^\/+/, "")}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The arguments of /transcribe. `--lang` and `--prompt` take one argument (quoted
|
|
39
|
+
* when it holds spaces), `--then` the rest of the line as typed (it comes last); the
|
|
40
|
+
* file is the one argument that is not an option's.
|
|
41
|
+
*/
|
|
42
|
+
export function parseTranscribeArgs(tokens: readonly string[]): ParsedTranscribe {
|
|
43
|
+
const line = commandLine(tokens);
|
|
44
|
+
const words = splitWords(line);
|
|
45
|
+
let list = false;
|
|
46
|
+
let file: string | null = null;
|
|
47
|
+
let language = "";
|
|
48
|
+
let vocabulary = "";
|
|
49
|
+
let then: string | null = null;
|
|
50
|
+
for (let i = 0; i < words.length; i++) {
|
|
51
|
+
const word = words[i].text;
|
|
52
|
+
if (!isOption(words[i])) {
|
|
53
|
+
if (word.trim().length === 0) return { ok: false, error: "name a file under /audio (/transcribe --list shows them)" };
|
|
54
|
+
if (file !== null) return { ok: false, error: `one file at a time (${file}, ${word}): quote a name that holds a space` };
|
|
55
|
+
file = word;
|
|
56
|
+
} else if (word === "--list") {
|
|
57
|
+
list = true;
|
|
58
|
+
} else if (word === "--lang" || word === "--language") {
|
|
59
|
+
const value = optionValue(words, i++);
|
|
60
|
+
if (value === null) return { ok: false, error: `${word} needs a language code (fr, en...)` };
|
|
61
|
+
language = value;
|
|
62
|
+
} else if (word === "--prompt") {
|
|
63
|
+
const value = optionValue(words, i++);
|
|
64
|
+
if (value === null) return { ok: false, error: '--prompt needs the words the speech may contain, quoted ("Orkeon, Jint, MCP")' };
|
|
65
|
+
vocabulary = value;
|
|
66
|
+
} else if (word === "--then") {
|
|
67
|
+
// One quoted instruction loses its quotes; otherwise the rest is kept as typed, quotes included.
|
|
68
|
+
const rest = words.slice(i + 1);
|
|
69
|
+
then = (rest.length === 1 ? rest[0].text : line.slice(words[i].end)).trim();
|
|
70
|
+
if (then.length === 0) return { ok: false, error: "--then needs an instruction" };
|
|
71
|
+
break;
|
|
72
|
+
} else {
|
|
73
|
+
return { ok: false, error: `unknown option ${word}` };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (list) {
|
|
77
|
+
if (file !== null || then !== null || language || vocabulary) return { ok: false, error: "--list takes no file and no option" };
|
|
78
|
+
return { ok: true, request: { kind: "list" } };
|
|
79
|
+
}
|
|
80
|
+
if (file === null) return { ok: false, error: "name a file under /audio (/transcribe --list shows them)" };
|
|
81
|
+
return { ok: true, request: { kind: "file", path: audioPath(file), language, vocabulary, then } };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** The line that says what to do when the server's tools are not registered. */
|
|
85
|
+
export function missingToolMessage(tool: string): string {
|
|
86
|
+
return (
|
|
87
|
+
`no registered tool '${tool}': the Whisper MCP server is not connected. Start orkeon-code with ` +
|
|
88
|
+
"ORKEON_CODE_AUDIO_DIR set (docs/configuration.md, Speech-to-text); /debug-tool-call list shows what this host registers."
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** The arguments of transcribe_audio for a file request (the server's parameter names). */
|
|
93
|
+
export function transcribeCall(registered: string, request: Extract<TranscribeRequest, { kind: "file" }>, label: string): PreludeCall {
|
|
94
|
+
const args: Record<string, unknown> = { path: request.path };
|
|
95
|
+
if (request.language) args.language = request.language;
|
|
96
|
+
if (request.vocabulary) args.vocabulary = request.vocabulary;
|
|
97
|
+
return { tool: registered, args, label };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** What /transcribe reads and drives: the registered tools, the crew launch and, for --then, the main loop's launch. */
|
|
101
|
+
export type TranscribeDeps = MainLoopLaunchDeps & { catalogue: Pick<ToolCatalogue, "find"> };
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Launch what the request asks and return the ticket: the speech crew for a
|
|
105
|
+
* listing or a file, the main loop with the transcription as its prelude for
|
|
106
|
+
* --then (a `mode:` prefix in the instruction picks the mode, as for /assistant).
|
|
107
|
+
* A bad line, or a server that is not connected, launches nothing and returns
|
|
108
|
+
* the message the REPL prints.
|
|
109
|
+
*/
|
|
110
|
+
export async function dispatchTranscribe(
|
|
111
|
+
tokens: readonly string[],
|
|
112
|
+
deps: TranscribeDeps,
|
|
113
|
+
): Promise<LaunchResult | { message: string }> {
|
|
114
|
+
const parsed = parseTranscribeArgs(tokens);
|
|
115
|
+
if (!parsed.ok) return { message: `${parsed.error}\n${TRANSCRIBE_USAGE}` };
|
|
116
|
+
const { request } = parsed;
|
|
117
|
+
const wanted = request.kind === "list" ? LIST_AUDIO_TOOL : TRANSCRIBE_TOOL;
|
|
118
|
+
const registered = deps.catalogue.find(wanted);
|
|
119
|
+
if (registered === undefined) return { message: missingToolMessage(wanted) };
|
|
120
|
+
if (request.kind === "list") {
|
|
121
|
+
return launchCrew(await withLlmProfile(deps, deps.config), "speech", { tool: registered, args: {}, label: `the files under ${AUDIO_ROOT}` });
|
|
122
|
+
}
|
|
123
|
+
if (request.then === null) {
|
|
124
|
+
const call = transcribeCall(registered, request, `transcription of ${request.path}`);
|
|
125
|
+
return launchCrew(await withLlmProfile(deps, deps.config), "speech", { ...call }, call.args);
|
|
126
|
+
}
|
|
127
|
+
const { prompt, permissionMode } = parseAssistantInput(request.then);
|
|
128
|
+
const prelude = transcribeCall(registered, request, `Transcription of ${request.path}, made by /transcribe before this request`);
|
|
129
|
+
return await launchMainLoop(deps, { prompt, permissionMode, prelude });
|
|
130
|
+
}
|