@cleocode/cleo 2026.4.158 → 2026.5.0
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/dist/backfill/audit-columns.d.ts +105 -0
- package/dist/backfill/audit-columns.d.ts.map +1 -0
- package/dist/backfill/audit-columns.js +258 -0
- package/dist/backfill/audit-columns.js.map +1 -0
- package/dist/cli/commands/adapter.d.ts +28 -0
- package/dist/cli/commands/adapter.d.ts.map +1 -0
- package/dist/cli/commands/adapter.js +119 -0
- package/dist/cli/commands/adapter.js.map +1 -0
- package/dist/cli/commands/add-batch.d.ts +33 -0
- package/dist/cli/commands/add-batch.d.ts.map +1 -0
- package/dist/cli/commands/add-batch.js +148 -0
- package/dist/cli/commands/add-batch.js.map +1 -0
- package/dist/cli/commands/add.d.ts +162 -0
- package/dist/cli/commands/add.d.ts.map +1 -0
- package/dist/cli/commands/add.js +279 -0
- package/dist/cli/commands/add.js.map +1 -0
- package/dist/cli/commands/admin.d.ts +24 -0
- package/dist/cli/commands/admin.d.ts.map +1 -0
- package/dist/cli/commands/admin.js +283 -0
- package/dist/cli/commands/admin.js.map +1 -0
- package/dist/cli/commands/adr.d.ts +33 -0
- package/dist/cli/commands/adr.d.ts.map +1 -0
- package/dist/cli/commands/adr.js +147 -0
- package/dist/cli/commands/adr.js.map +1 -0
- package/dist/cli/commands/agent-profile-status.d.ts +98 -0
- package/dist/cli/commands/agent-profile-status.d.ts.map +1 -0
- package/dist/cli/commands/agent-profile-status.js +71 -0
- package/dist/cli/commands/agent-profile-status.js.map +1 -0
- package/dist/cli/commands/agent.d.ts +47 -0
- package/dist/cli/commands/agent.d.ts.map +1 -0
- package/dist/cli/commands/agent.js +2976 -0
- package/dist/cli/commands/agent.js.map +1 -0
- package/dist/cli/commands/analyze.d.ts +21 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +32 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/archive-stats.d.ts +66 -0
- package/dist/cli/commands/archive-stats.d.ts.map +1 -0
- package/dist/cli/commands/archive-stats.js +93 -0
- package/dist/cli/commands/archive-stats.js.map +1 -0
- package/dist/cli/commands/archive.d.ts +42 -0
- package/dist/cli/commands/archive.d.ts.map +1 -0
- package/dist/cli/commands/archive.js +59 -0
- package/dist/cli/commands/archive.js.map +1 -0
- package/dist/cli/commands/audit.d.ts +22 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +137 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/backfill.d.ts +56 -0
- package/dist/cli/commands/backfill.d.ts.map +1 -0
- package/dist/cli/commands/backfill.js +161 -0
- package/dist/cli/commands/backfill.js.map +1 -0
- package/dist/cli/commands/backup-inspect.d.ts +33 -0
- package/dist/cli/commands/backup-inspect.d.ts.map +1 -0
- package/dist/cli/commands/backup-inspect.js +430 -0
- package/dist/cli/commands/backup-inspect.js.map +1 -0
- package/dist/cli/commands/backup.d.ts +23 -0
- package/dist/cli/commands/backup.d.ts.map +1 -0
- package/dist/cli/commands/backup.js +564 -0
- package/dist/cli/commands/backup.js.map +1 -0
- package/dist/cli/commands/blockers.d.ts +20 -0
- package/dist/cli/commands/blockers.d.ts.map +1 -0
- package/dist/cli/commands/blockers.js +31 -0
- package/dist/cli/commands/blockers.js.map +1 -0
- package/dist/cli/commands/brain.d.ts +37 -0
- package/dist/cli/commands/brain.d.ts.map +1 -0
- package/dist/cli/commands/brain.js +445 -0
- package/dist/cli/commands/brain.js.map +1 -0
- package/dist/cli/commands/briefing.d.ts +52 -0
- package/dist/cli/commands/briefing.d.ts.map +1 -0
- package/dist/cli/commands/briefing.js +69 -0
- package/dist/cli/commands/briefing.js.map +1 -0
- package/dist/cli/commands/bug.d.ts +61 -0
- package/dist/cli/commands/bug.d.ts.map +1 -0
- package/dist/cli/commands/bug.js +198 -0
- package/dist/cli/commands/bug.js.map +1 -0
- package/dist/cli/commands/cancel.d.ts +26 -0
- package/dist/cli/commands/cancel.d.ts.map +1 -0
- package/dist/cli/commands/cancel.js +40 -0
- package/dist/cli/commands/cancel.js.map +1 -0
- package/dist/cli/commands/cant.d.ts +13 -0
- package/dist/cli/commands/cant.d.ts.map +1 -0
- package/dist/cli/commands/cant.js +245 -0
- package/dist/cli/commands/cant.js.map +1 -0
- package/dist/cli/commands/chain.d.ts +24 -0
- package/dist/cli/commands/chain.d.ts.map +1 -0
- package/dist/cli/commands/chain.js +116 -0
- package/dist/cli/commands/chain.js.map +1 -0
- package/dist/cli/commands/check.d.ts +18 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +280 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/checkpoint.d.ts +27 -0
- package/dist/cli/commands/checkpoint.d.ts.map +1 -0
- package/dist/cli/commands/checkpoint.js +105 -0
- package/dist/cli/commands/checkpoint.js.map +1 -0
- package/dist/cli/commands/claim.d.ts +35 -0
- package/dist/cli/commands/claim.d.ts.map +1 -0
- package/dist/cli/commands/claim.js +35 -0
- package/dist/cli/commands/claim.js.map +1 -0
- package/dist/cli/commands/code.d.ts +22 -0
- package/dist/cli/commands/code.d.ts.map +1 -0
- package/dist/cli/commands/code.js +161 -0
- package/dist/cli/commands/code.js.map +1 -0
- package/dist/cli/commands/complete.d.ts +49 -0
- package/dist/cli/commands/complete.d.ts.map +1 -0
- package/dist/cli/commands/complete.js +83 -0
- package/dist/cli/commands/complete.js.map +1 -0
- package/dist/cli/commands/complexity.d.ts +13 -0
- package/dist/cli/commands/complexity.d.ts.map +1 -0
- package/dist/cli/commands/complexity.js +32 -0
- package/dist/cli/commands/complexity.js.map +1 -0
- package/dist/cli/commands/compliance.d.ts +27 -0
- package/dist/cli/commands/compliance.d.ts.map +1 -0
- package/dist/cli/commands/compliance.js +233 -0
- package/dist/cli/commands/compliance.js.map +1 -0
- package/dist/cli/commands/conduit.d.ts +28 -0
- package/dist/cli/commands/conduit.d.ts.map +1 -0
- package/dist/cli/commands/conduit.js +279 -0
- package/dist/cli/commands/conduit.js.map +1 -0
- package/dist/cli/commands/config.d.ts +25 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +132 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/consensus.d.ts +21 -0
- package/dist/cli/commands/consensus.d.ts.map +1 -0
- package/dist/cli/commands/consensus.js +100 -0
- package/dist/cli/commands/consensus.js.map +1 -0
- package/dist/cli/commands/context.d.ts +19 -0
- package/dist/cli/commands/context.d.ts.map +1 -0
- package/dist/cli/commands/context.js +111 -0
- package/dist/cli/commands/context.js.map +1 -0
- package/dist/cli/commands/contribution.d.ts +21 -0
- package/dist/cli/commands/contribution.d.ts.map +1 -0
- package/dist/cli/commands/contribution.js +90 -0
- package/dist/cli/commands/contribution.js.map +1 -0
- package/dist/cli/commands/current.d.ts +18 -0
- package/dist/cli/commands/current.d.ts.map +1 -0
- package/dist/cli/commands/current.js +28 -0
- package/dist/cli/commands/current.js.map +1 -0
- package/dist/cli/commands/daemon.d.ts +36 -0
- package/dist/cli/commands/daemon.d.ts.map +1 -0
- package/dist/cli/commands/daemon.js +223 -0
- package/dist/cli/commands/daemon.js.map +1 -0
- package/dist/cli/commands/dash.d.ts +23 -0
- package/dist/cli/commands/dash.d.ts.map +1 -0
- package/dist/cli/commands/dash.js +38 -0
- package/dist/cli/commands/dash.js.map +1 -0
- package/dist/cli/commands/decomposition.d.ts +13 -0
- package/dist/cli/commands/decomposition.d.ts.map +1 -0
- package/dist/cli/commands/decomposition.js +92 -0
- package/dist/cli/commands/decomposition.js.map +1 -0
- package/dist/cli/commands/delete.d.ts +29 -0
- package/dist/cli/commands/delete.d.ts.map +1 -0
- package/dist/cli/commands/delete.js +55 -0
- package/dist/cli/commands/delete.js.map +1 -0
- package/dist/cli/commands/deps.d.ts +45 -0
- package/dist/cli/commands/deps.d.ts.map +1 -0
- package/dist/cli/commands/deps.js +170 -0
- package/dist/cli/commands/deps.js.map +1 -0
- package/dist/cli/commands/detect-drift.d.ts +23 -0
- package/dist/cli/commands/detect-drift.d.ts.map +1 -0
- package/dist/cli/commands/detect-drift.js +440 -0
- package/dist/cli/commands/detect-drift.js.map +1 -0
- package/dist/cli/commands/detect.d.ts +3 -0
- package/dist/cli/commands/detect.d.ts.map +1 -0
- package/dist/cli/commands/detect.js +14 -0
- package/dist/cli/commands/detect.js.map +1 -0
- package/dist/cli/commands/diagnostics.d.ts +19 -0
- package/dist/cli/commands/diagnostics.d.ts.map +1 -0
- package/dist/cli/commands/diagnostics.js +109 -0
- package/dist/cli/commands/diagnostics.js.map +1 -0
- package/dist/cli/commands/docs.d.ts +25 -0
- package/dist/cli/commands/docs.d.ts.map +1 -0
- package/dist/cli/commands/docs.js +798 -0
- package/dist/cli/commands/docs.js.map +1 -0
- package/dist/cli/commands/doctor-projects.d.ts +101 -0
- package/dist/cli/commands/doctor-projects.d.ts.map +1 -0
- package/dist/cli/commands/doctor-projects.js +188 -0
- package/dist/cli/commands/doctor-projects.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +66 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +178 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/dynamic.d.ts +15 -0
- package/dist/cli/commands/dynamic.d.ts.map +1 -0
- package/dist/cli/commands/dynamic.js +21 -0
- package/dist/cli/commands/dynamic.js.map +1 -0
- package/dist/cli/commands/exists.d.ts +13 -0
- package/dist/cli/commands/exists.d.ts.map +1 -0
- package/dist/cli/commands/exists.js +40 -0
- package/dist/cli/commands/exists.js.map +1 -0
- package/dist/cli/commands/export-tasks.d.ts +46 -0
- package/dist/cli/commands/export-tasks.d.ts.map +1 -0
- package/dist/cli/commands/export-tasks.js +81 -0
- package/dist/cli/commands/export-tasks.js.map +1 -0
- package/dist/cli/commands/export.d.ts +35 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +68 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/find.d.ts +54 -0
- package/dist/cli/commands/find.d.ts.map +1 -0
- package/dist/cli/commands/find.js +92 -0
- package/dist/cli/commands/find.js.map +1 -0
- package/dist/cli/commands/gc.d.ts +25 -0
- package/dist/cli/commands/gc.d.ts.map +1 -0
- package/dist/cli/commands/gc.js +165 -0
- package/dist/cli/commands/gc.js.map +1 -0
- package/dist/cli/commands/generate-changelog.d.ts +30 -0
- package/dist/cli/commands/generate-changelog.d.ts.map +1 -0
- package/dist/cli/commands/generate-changelog.js +270 -0
- package/dist/cli/commands/generate-changelog.js.map +1 -0
- package/dist/cli/commands/grade.d.ts +13 -0
- package/dist/cli/commands/grade.d.ts.map +1 -0
- package/dist/cli/commands/grade.js +27 -0
- package/dist/cli/commands/grade.js.map +1 -0
- package/dist/cli/commands/history.d.ts +13 -0
- package/dist/cli/commands/history.d.ts.map +1 -0
- package/dist/cli/commands/history.js +65 -0
- package/dist/cli/commands/history.js.map +1 -0
- package/dist/cli/commands/import-tasks.d.ts +60 -0
- package/dist/cli/commands/import-tasks.d.ts.map +1 -0
- package/dist/cli/commands/import-tasks.js +83 -0
- package/dist/cli/commands/import-tasks.js.map +1 -0
- package/dist/cli/commands/import.d.ts +42 -0
- package/dist/cli/commands/import.d.ts.map +1 -0
- package/dist/cli/commands/import.js +64 -0
- package/dist/cli/commands/import.js.map +1 -0
- package/dist/cli/commands/init.d.ts +65 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +122 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/inject.d.ts +41 -0
- package/dist/cli/commands/inject.d.ts.map +1 -0
- package/dist/cli/commands/inject.js +56 -0
- package/dist/cli/commands/inject.js.map +1 -0
- package/dist/cli/commands/install-global.d.ts +48 -0
- package/dist/cli/commands/install-global.d.ts.map +1 -0
- package/dist/cli/commands/install-global.js +104 -0
- package/dist/cli/commands/install-global.js.map +1 -0
- package/dist/cli/commands/intelligence.d.ts +21 -0
- package/dist/cli/commands/intelligence.d.ts.map +1 -0
- package/dist/cli/commands/intelligence.js +145 -0
- package/dist/cli/commands/intelligence.js.map +1 -0
- package/dist/cli/commands/issue.d.ts +23 -0
- package/dist/cli/commands/issue.d.ts.map +1 -0
- package/dist/cli/commands/issue.js +152 -0
- package/dist/cli/commands/issue.js.map +1 -0
- package/dist/cli/commands/labels.d.ts +21 -0
- package/dist/cli/commands/labels.d.ts.map +1 -0
- package/dist/cli/commands/labels.js +65 -0
- package/dist/cli/commands/labels.js.map +1 -0
- package/dist/cli/commands/lifecycle.d.ts +25 -0
- package/dist/cli/commands/lifecycle.d.ts.map +1 -0
- package/dist/cli/commands/lifecycle.js +221 -0
- package/dist/cli/commands/lifecycle.js.map +1 -0
- package/dist/cli/commands/list.d.ts +28 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +81 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/log.d.ts +36 -0
- package/dist/cli/commands/log.d.ts.map +1 -0
- package/dist/cli/commands/log.js +50 -0
- package/dist/cli/commands/log.js.map +1 -0
- package/dist/cli/commands/manifest.d.ts +15 -0
- package/dist/cli/commands/manifest.d.ts.map +1 -0
- package/dist/cli/commands/manifest.js +334 -0
- package/dist/cli/commands/manifest.js.map +1 -0
- package/dist/cli/commands/map.d.ts +25 -0
- package/dist/cli/commands/map.d.ts.map +1 -0
- package/dist/cli/commands/map.js +37 -0
- package/dist/cli/commands/map.js.map +1 -0
- package/dist/cli/commands/memory.d.ts +48 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +2439 -0
- package/dist/cli/commands/memory.js.map +1 -0
- package/dist/cli/commands/migrate-claude-mem.d.ts +23 -0
- package/dist/cli/commands/migrate-claude-mem.d.ts.map +1 -0
- package/dist/cli/commands/migrate-claude-mem.js +181 -0
- package/dist/cli/commands/migrate-claude-mem.js.map +1 -0
- package/dist/cli/commands/next.d.ts +27 -0
- package/dist/cli/commands/next.d.ts.map +1 -0
- package/dist/cli/commands/next.js +40 -0
- package/dist/cli/commands/next.js.map +1 -0
- package/dist/cli/commands/nexus.d.ts +15 -0
- package/dist/cli/commands/nexus.d.ts.map +1 -0
- package/dist/cli/commands/nexus.js +3377 -0
- package/dist/cli/commands/nexus.js.map +1 -0
- package/dist/cli/commands/ops.d.ts +23 -0
- package/dist/cli/commands/ops.d.ts.map +1 -0
- package/dist/cli/commands/ops.js +35 -0
- package/dist/cli/commands/ops.js.map +1 -0
- package/dist/cli/commands/orchestrate.d.ts +48 -0
- package/dist/cli/commands/orchestrate.d.ts.map +1 -0
- package/dist/cli/commands/orchestrate.js +774 -0
- package/dist/cli/commands/orchestrate.js.map +1 -0
- package/dist/cli/commands/otel.d.ts +30 -0
- package/dist/cli/commands/otel.d.ts.map +1 -0
- package/dist/cli/commands/otel.js +193 -0
- package/dist/cli/commands/otel.js.map +1 -0
- package/dist/cli/commands/phase.d.ts +29 -0
- package/dist/cli/commands/phase.d.ts.map +1 -0
- package/dist/cli/commands/phase.js +189 -0
- package/dist/cli/commands/phase.js.map +1 -0
- package/dist/cli/commands/pivot.d.ts +34 -0
- package/dist/cli/commands/pivot.d.ts.map +1 -0
- package/dist/cli/commands/pivot.js +50 -0
- package/dist/cli/commands/pivot.js.map +1 -0
- package/dist/cli/commands/plan.d.ts +17 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +27 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/playbook.d.ts +26 -0
- package/dist/cli/commands/playbook.d.ts.map +1 -0
- package/dist/cli/commands/playbook.js +220 -0
- package/dist/cli/commands/playbook.js.map +1 -0
- package/dist/cli/commands/promote.d.ts +19 -0
- package/dist/cli/commands/promote.d.ts.map +1 -0
- package/dist/cli/commands/promote.js +27 -0
- package/dist/cli/commands/promote.js.map +1 -0
- package/dist/cli/commands/provider.d.ts +23 -0
- package/dist/cli/commands/provider.d.ts.map +1 -0
- package/dist/cli/commands/provider.js +168 -0
- package/dist/cli/commands/provider.js.map +1 -0
- package/dist/cli/commands/reason.d.ts +18 -0
- package/dist/cli/commands/reason.d.ts.map +1 -0
- package/dist/cli/commands/reason.js +102 -0
- package/dist/cli/commands/reason.js.map +1 -0
- package/dist/cli/commands/reconcile.d.ts +35 -0
- package/dist/cli/commands/reconcile.d.ts.map +1 -0
- package/dist/cli/commands/reconcile.js +102 -0
- package/dist/cli/commands/reconcile.js.map +1 -0
- package/dist/cli/commands/refresh-memory.d.ts +16 -0
- package/dist/cli/commands/refresh-memory.d.ts.map +1 -0
- package/dist/cli/commands/refresh-memory.js +34 -0
- package/dist/cli/commands/refresh-memory.js.map +1 -0
- package/dist/cli/commands/relates.d.ts +19 -0
- package/dist/cli/commands/relates.d.ts.map +1 -0
- package/dist/cli/commands/relates.js +129 -0
- package/dist/cli/commands/relates.js.map +1 -0
- package/dist/cli/commands/release.d.ts +27 -0
- package/dist/cli/commands/release.d.ts.map +1 -0
- package/dist/cli/commands/release.js +300 -0
- package/dist/cli/commands/release.js.map +1 -0
- package/dist/cli/commands/remote.d.ts +49 -0
- package/dist/cli/commands/remote.d.ts.map +1 -0
- package/dist/cli/commands/remote.js +265 -0
- package/dist/cli/commands/remote.js.map +1 -0
- package/dist/cli/commands/reorder.d.ts +31 -0
- package/dist/cli/commands/reorder.d.ts.map +1 -0
- package/dist/cli/commands/reorder.js +57 -0
- package/dist/cli/commands/reorder.js.map +1 -0
- package/dist/cli/commands/reparent.d.ts +27 -0
- package/dist/cli/commands/reparent.d.ts.map +1 -0
- package/dist/cli/commands/reparent.js +36 -0
- package/dist/cli/commands/reparent.js.map +1 -0
- package/dist/cli/commands/req.d.ts +37 -0
- package/dist/cli/commands/req.d.ts.map +1 -0
- package/dist/cli/commands/req.js +121 -0
- package/dist/cli/commands/req.js.map +1 -0
- package/dist/cli/commands/research.d.ts +25 -0
- package/dist/cli/commands/research.d.ts.map +1 -0
- package/dist/cli/commands/research.js +327 -0
- package/dist/cli/commands/research.js.map +1 -0
- package/dist/cli/commands/restore.d.ts +64 -0
- package/dist/cli/commands/restore.d.ts.map +1 -0
- package/dist/cli/commands/restore.js +539 -0
- package/dist/cli/commands/restore.js.map +1 -0
- package/dist/cli/commands/revert.d.ts +79 -0
- package/dist/cli/commands/revert.d.ts.map +1 -0
- package/dist/cli/commands/revert.js +300 -0
- package/dist/cli/commands/revert.js.map +1 -0
- package/dist/cli/commands/roadmap.d.ts +29 -0
- package/dist/cli/commands/roadmap.d.ts.map +1 -0
- package/dist/cli/commands/roadmap.js +43 -0
- package/dist/cli/commands/roadmap.js.map +1 -0
- package/dist/cli/commands/safestop.d.ts +41 -0
- package/dist/cli/commands/safestop.d.ts.map +1 -0
- package/dist/cli/commands/safestop.js +62 -0
- package/dist/cli/commands/safestop.js.map +1 -0
- package/dist/cli/commands/schema.d.ts +44 -0
- package/dist/cli/commands/schema.d.ts.map +1 -0
- package/dist/cli/commands/schema.js +177 -0
- package/dist/cli/commands/schema.js.map +1 -0
- package/dist/cli/commands/self-update.d.ts +81 -0
- package/dist/cli/commands/self-update.d.ts.map +1 -0
- package/dist/cli/commands/self-update.js +483 -0
- package/dist/cli/commands/self-update.js.map +1 -0
- package/dist/cli/commands/sentient.d.ts +44 -0
- package/dist/cli/commands/sentient.d.ts.map +1 -0
- package/dist/cli/commands/sentient.js +687 -0
- package/dist/cli/commands/sentient.js.map +1 -0
- package/dist/cli/commands/sequence.d.ts +15 -0
- package/dist/cli/commands/sequence.d.ts.map +1 -0
- package/dist/cli/commands/sequence.js +68 -0
- package/dist/cli/commands/sequence.js.map +1 -0
- package/dist/cli/commands/session.d.ts +32 -0
- package/dist/cli/commands/session.d.ts.map +1 -0
- package/dist/cli/commands/session.js +583 -0
- package/dist/cli/commands/session.js.map +1 -0
- package/dist/cli/commands/show.d.ts +21 -0
- package/dist/cli/commands/show.d.ts.map +1 -0
- package/dist/cli/commands/show.js +37 -0
- package/dist/cli/commands/show.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +31 -0
- package/dist/cli/commands/skills.d.ts.map +1 -0
- package/dist/cli/commands/skills.js +303 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/commands/snapshot.d.ts +17 -0
- package/dist/cli/commands/snapshot.d.ts.map +1 -0
- package/dist/cli/commands/snapshot.js +95 -0
- package/dist/cli/commands/snapshot.js.map +1 -0
- package/dist/cli/commands/start.d.ts +21 -0
- package/dist/cli/commands/start.d.ts.map +1 -0
- package/dist/cli/commands/start.js +32 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/stats.d.ts +30 -0
- package/dist/cli/commands/stats.d.ts.map +1 -0
- package/dist/cli/commands/stats.js +71 -0
- package/dist/cli/commands/stats.js.map +1 -0
- package/dist/cli/commands/sticky.d.ts +23 -0
- package/dist/cli/commands/sticky.d.ts.map +1 -0
- package/dist/cli/commands/sticky.js +315 -0
- package/dist/cli/commands/sticky.js.map +1 -0
- package/dist/cli/commands/stop.d.ts +15 -0
- package/dist/cli/commands/stop.d.ts.map +1 -0
- package/dist/cli/commands/stop.js +25 -0
- package/dist/cli/commands/stop.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +25 -0
- package/dist/cli/commands/sync.d.ts.map +1 -0
- package/dist/cli/commands/sync.js +125 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/commands/testing.d.ts +22 -0
- package/dist/cli/commands/testing.d.ts.map +1 -0
- package/dist/cli/commands/testing.js +111 -0
- package/dist/cli/commands/testing.js.map +1 -0
- package/dist/cli/commands/token.d.ts +22 -0
- package/dist/cli/commands/token.d.ts.map +1 -0
- package/dist/cli/commands/token.js +197 -0
- package/dist/cli/commands/token.js.map +1 -0
- package/dist/cli/commands/transcript.d.ts +32 -0
- package/dist/cli/commands/transcript.d.ts.map +1 -0
- package/dist/cli/commands/transcript.js +526 -0
- package/dist/cli/commands/transcript.js.map +1 -0
- package/dist/cli/commands/update.d.ts +164 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +234 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/commands/upgrade.d.ts +76 -0
- package/dist/cli/commands/upgrade.d.ts.map +1 -0
- package/dist/cli/commands/upgrade.js +154 -0
- package/dist/cli/commands/upgrade.js.map +1 -0
- package/dist/cli/commands/verify.d.ts +83 -0
- package/dist/cli/commands/verify.d.ts.map +1 -0
- package/dist/cli/commands/verify.js +108 -0
- package/dist/cli/commands/verify.js.map +1 -0
- package/dist/cli/commands/web.d.ts +27 -0
- package/dist/cli/commands/web.d.ts.map +1 -0
- package/dist/cli/commands/web.js +414 -0
- package/dist/cli/commands/web.js.map +1 -0
- package/dist/cli/field-context.d.ts +32 -0
- package/dist/cli/field-context.d.ts.map +1 -0
- package/dist/cli/field-context.js +47 -0
- package/dist/cli/field-context.js.map +1 -0
- package/dist/cli/format-context.d.ts +32 -0
- package/dist/cli/format-context.d.ts.map +1 -0
- package/dist/cli/format-context.js +50 -0
- package/dist/cli/format-context.js.map +1 -0
- package/dist/cli/help-renderer.d.ts +40 -0
- package/dist/cli/help-renderer.d.ts.map +1 -0
- package/dist/cli/help-renderer.js +325 -0
- package/dist/cli/help-renderer.js.map +1 -0
- package/dist/cli/index.d.ts +14 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +1535 -9704
- package/dist/cli/index.js.map +4 -4
- package/dist/cli/infer-files-via-gitnexus.d.ts +12 -0
- package/dist/cli/infer-files-via-gitnexus.d.ts.map +1 -0
- package/dist/cli/infer-files-via-gitnexus.js +12 -0
- package/dist/cli/infer-files-via-gitnexus.js.map +1 -0
- package/dist/cli/lib/did-you-mean.d.ts +30 -0
- package/dist/cli/lib/did-you-mean.d.ts.map +1 -0
- package/dist/cli/lib/did-you-mean.js +63 -0
- package/dist/cli/lib/did-you-mean.js.map +1 -0
- package/dist/cli/lib/registry-args.d.ts +36 -0
- package/dist/cli/lib/registry-args.d.ts.map +1 -0
- package/dist/cli/lib/registry-args.js +37 -0
- package/dist/cli/lib/registry-args.js.map +1 -0
- package/dist/cli/lib/subcommand-guard.d.ts +45 -0
- package/dist/cli/lib/subcommand-guard.d.ts.map +1 -0
- package/dist/cli/lib/subcommand-guard.js +55 -0
- package/dist/cli/lib/subcommand-guard.js.map +1 -0
- package/dist/cli/logger-bootstrap.d.ts +6 -0
- package/dist/cli/logger-bootstrap.d.ts.map +1 -0
- package/dist/cli/logger-bootstrap.js +10 -0
- package/dist/cli/logger-bootstrap.js.map +1 -0
- package/dist/cli/middleware/output-format.d.ts +30 -0
- package/dist/cli/middleware/output-format.d.ts.map +1 -0
- package/dist/cli/middleware/output-format.js +35 -0
- package/dist/cli/middleware/output-format.js.map +1 -0
- package/dist/cli/paths.d.ts +85 -0
- package/dist/cli/paths.d.ts.map +1 -0
- package/dist/cli/paths.js +108 -0
- package/dist/cli/paths.js.map +1 -0
- package/dist/cli/progress.d.ts +89 -0
- package/dist/cli/progress.d.ts.map +1 -0
- package/dist/cli/progress.js +185 -0
- package/dist/cli/progress.js.map +1 -0
- package/dist/cli/renderers/colors.d.ts +32 -0
- package/dist/cli/renderers/colors.d.ts.map +1 -0
- package/dist/cli/renderers/colors.js +141 -0
- package/dist/cli/renderers/colors.js.map +1 -0
- package/dist/cli/renderers/error.d.ts +13 -0
- package/dist/cli/renderers/error.d.ts.map +1 -0
- package/dist/cli/renderers/error.js +42 -0
- package/dist/cli/renderers/error.js.map +1 -0
- package/dist/cli/renderers/index.d.ts +90 -0
- package/dist/cli/renderers/index.d.ts.map +1 -0
- package/dist/cli/renderers/index.js +268 -0
- package/dist/cli/renderers/index.js.map +1 -0
- package/dist/cli/renderers/lafs-validator.d.ts +91 -0
- package/dist/cli/renderers/lafs-validator.d.ts.map +1 -0
- package/dist/cli/renderers/lafs-validator.js +176 -0
- package/dist/cli/renderers/lafs-validator.js.map +1 -0
- package/dist/cli/renderers/normalizer.d.ts +21 -0
- package/dist/cli/renderers/normalizer.d.ts.map +1 -0
- package/dist/cli/renderers/normalizer.js +106 -0
- package/dist/cli/renderers/normalizer.js.map +1 -0
- package/dist/cli/renderers/system.d.ts +110 -0
- package/dist/cli/renderers/system.d.ts.map +1 -0
- package/dist/cli/renderers/system.js +662 -0
- package/dist/cli/renderers/system.js.map +1 -0
- package/dist/cli/renderers/tasks.d.ts +28 -0
- package/dist/cli/renderers/tasks.d.ts.map +1 -0
- package/dist/cli/renderers/tasks.js +306 -0
- package/dist/cli/renderers/tasks.js.map +1 -0
- package/dist/cli/tree-context.d.ts +53 -0
- package/dist/cli/tree-context.d.ts.map +1 -0
- package/dist/cli/tree-context.js +43 -0
- package/dist/cli/tree-context.js.map +1 -0
- package/dist/dispatch/adapters/cli.d.ts +67 -0
- package/dist/dispatch/adapters/cli.d.ts.map +1 -0
- package/dist/dispatch/adapters/cli.js +331 -0
- package/dist/dispatch/adapters/cli.js.map +1 -0
- package/dist/dispatch/adapters/typed.d.ts +362 -0
- package/dist/dispatch/adapters/typed.d.ts.map +1 -0
- package/dist/dispatch/adapters/typed.js +278 -0
- package/dist/dispatch/adapters/typed.js.map +1 -0
- package/dist/dispatch/context/session-context.d.ts +108 -0
- package/dist/dispatch/context/session-context.d.ts.map +1 -0
- package/dist/dispatch/context/session-context.js +111 -0
- package/dist/dispatch/context/session-context.js.map +1 -0
- package/dist/dispatch/dispatcher.d.ts +37 -0
- package/dist/dispatch/dispatcher.d.ts.map +1 -0
- package/dist/dispatch/dispatcher.js +172 -0
- package/dist/dispatch/dispatcher.js.map +1 -0
- package/dist/dispatch/domains/_base.d.ts +104 -0
- package/dist/dispatch/domains/_base.d.ts.map +1 -0
- package/dist/dispatch/domains/_base.js +147 -0
- package/dist/dispatch/domains/_base.js.map +1 -0
- package/dist/dispatch/domains/_meta.d.ts +23 -0
- package/dist/dispatch/domains/_meta.d.ts.map +1 -0
- package/dist/dispatch/domains/_meta.js +25 -0
- package/dist/dispatch/domains/_meta.js.map +1 -0
- package/dist/dispatch/domains/_routing.d.ts +8 -0
- package/dist/dispatch/domains/_routing.d.ts.map +1 -0
- package/dist/dispatch/domains/_routing.js +20 -0
- package/dist/dispatch/domains/_routing.js.map +1 -0
- package/dist/dispatch/domains/admin/smoke-provider.d.ts +54 -0
- package/dist/dispatch/domains/admin/smoke-provider.d.ts.map +1 -0
- package/dist/dispatch/domains/admin/smoke-provider.js +309 -0
- package/dist/dispatch/domains/admin/smoke-provider.js.map +1 -0
- package/dist/dispatch/domains/admin.d.ts +51 -0
- package/dist/dispatch/domains/admin.d.ts.map +1 -0
- package/dist/dispatch/domains/admin.js +1163 -0
- package/dist/dispatch/domains/admin.js.map +1 -0
- package/dist/dispatch/domains/check/canon.d.ts +65 -0
- package/dist/dispatch/domains/check/canon.d.ts.map +1 -0
- package/dist/dispatch/domains/check/canon.js +193 -0
- package/dist/dispatch/domains/check/canon.js.map +1 -0
- package/dist/dispatch/domains/check.d.ts +37 -0
- package/dist/dispatch/domains/check.d.ts.map +1 -0
- package/dist/dispatch/domains/check.js +562 -0
- package/dist/dispatch/domains/check.js.map +1 -0
- package/dist/dispatch/domains/conduit.d.ts +61 -0
- package/dist/dispatch/domains/conduit.d.ts.map +1 -0
- package/dist/dispatch/domains/conduit.js +609 -0
- package/dist/dispatch/domains/conduit.js.map +1 -0
- package/dist/dispatch/domains/diagnostics.d.ts +25 -0
- package/dist/dispatch/domains/diagnostics.d.ts.map +1 -0
- package/dist/dispatch/domains/diagnostics.js +82 -0
- package/dist/dispatch/domains/diagnostics.js.map +1 -0
- package/dist/dispatch/domains/docs.d.ts +63 -0
- package/dist/dispatch/domains/docs.d.ts.map +1 -0
- package/dist/dispatch/domains/docs.js +539 -0
- package/dist/dispatch/domains/docs.js.map +1 -0
- package/dist/dispatch/domains/index.d.ts +33 -0
- package/dist/dispatch/domains/index.d.ts.map +1 -0
- package/dist/dispatch/domains/index.js +58 -0
- package/dist/dispatch/domains/index.js.map +1 -0
- package/dist/dispatch/domains/intelligence.d.ts +26 -0
- package/dist/dispatch/domains/intelligence.d.ts.map +1 -0
- package/dist/dispatch/domains/intelligence.js +154 -0
- package/dist/dispatch/domains/intelligence.js.map +1 -0
- package/dist/dispatch/domains/ivtr.d.ts +182 -0
- package/dist/dispatch/domains/ivtr.d.ts.map +1 -0
- package/dist/dispatch/domains/ivtr.js +430 -0
- package/dist/dispatch/domains/ivtr.js.map +1 -0
- package/dist/dispatch/domains/memory.d.ts +22 -0
- package/dist/dispatch/domains/memory.d.ts.map +1 -0
- package/dist/dispatch/domains/memory.js +1281 -0
- package/dist/dispatch/domains/memory.js.map +1 -0
- package/dist/dispatch/domains/nexus.d.ts +78 -0
- package/dist/dispatch/domains/nexus.d.ts.map +1 -0
- package/dist/dispatch/domains/nexus.js +938 -0
- package/dist/dispatch/domains/nexus.js.map +1 -0
- package/dist/dispatch/domains/orchestrate.d.ts +307 -0
- package/dist/dispatch/domains/orchestrate.d.ts.map +1 -0
- package/dist/dispatch/domains/orchestrate.js +986 -0
- package/dist/dispatch/domains/orchestrate.js.map +1 -0
- package/dist/dispatch/domains/pipeline.d.ts +276 -0
- package/dist/dispatch/domains/pipeline.d.ts.map +1 -0
- package/dist/dispatch/domains/pipeline.js +689 -0
- package/dist/dispatch/domains/pipeline.js.map +1 -0
- package/dist/dispatch/domains/playbook.d.ts +131 -0
- package/dist/dispatch/domains/playbook.d.ts.map +1 -0
- package/dist/dispatch/domains/playbook.js +633 -0
- package/dist/dispatch/domains/playbook.js.map +1 -0
- package/dist/dispatch/domains/release.d.ts +97 -0
- package/dist/dispatch/domains/release.d.ts.map +1 -0
- package/dist/dispatch/domains/release.js +177 -0
- package/dist/dispatch/domains/release.js.map +1 -0
- package/dist/dispatch/domains/sentient.d.ts +60 -0
- package/dist/dispatch/domains/sentient.d.ts.map +1 -0
- package/dist/dispatch/domains/sentient.js +270 -0
- package/dist/dispatch/domains/sentient.js.map +1 -0
- package/dist/dispatch/domains/session.d.ts +49 -0
- package/dist/dispatch/domains/session.d.ts.map +1 -0
- package/dist/dispatch/domains/session.js +459 -0
- package/dist/dispatch/domains/session.js.map +1 -0
- package/dist/dispatch/domains/sticky.d.ts +82 -0
- package/dist/dispatch/domains/sticky.d.ts.map +1 -0
- package/dist/dispatch/domains/sticky.js +287 -0
- package/dist/dispatch/domains/sticky.js.map +1 -0
- package/dist/dispatch/domains/tasks.d.ts +58 -0
- package/dist/dispatch/domains/tasks.d.ts.map +1 -0
- package/dist/dispatch/domains/tasks.js +497 -0
- package/dist/dispatch/domains/tasks.js.map +1 -0
- package/dist/dispatch/domains/tools.d.ts +37 -0
- package/dist/dispatch/domains/tools.d.ts.map +1 -0
- package/dist/dispatch/domains/tools.js +481 -0
- package/dist/dispatch/domains/tools.js.map +1 -0
- package/dist/dispatch/engines/_error.d.ts +114 -0
- package/dist/dispatch/engines/_error.d.ts.map +1 -0
- package/dist/dispatch/engines/_error.js +290 -0
- package/dist/dispatch/engines/_error.js.map +1 -0
- package/dist/dispatch/engines/admin-engine.d.ts +386 -0
- package/dist/dispatch/engines/admin-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/admin-engine.js +270 -0
- package/dist/dispatch/engines/admin-engine.js.map +1 -0
- package/dist/dispatch/engines/code-engine.d.ts +14 -0
- package/dist/dispatch/engines/code-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/code-engine.js +14 -0
- package/dist/dispatch/engines/code-engine.js.map +1 -0
- package/dist/dispatch/engines/codebase-map-engine.d.ts +31 -0
- package/dist/dispatch/engines/codebase-map-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/codebase-map-engine.js +43 -0
- package/dist/dispatch/engines/codebase-map-engine.js.map +1 -0
- package/dist/dispatch/engines/config-engine.d.ts +14 -0
- package/dist/dispatch/engines/config-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/config-engine.js +14 -0
- package/dist/dispatch/engines/config-engine.js.map +1 -0
- package/dist/dispatch/engines/diagnostics-engine.d.ts +13 -0
- package/dist/dispatch/engines/diagnostics-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/diagnostics-engine.js +12 -0
- package/dist/dispatch/engines/diagnostics-engine.js.map +1 -0
- package/dist/dispatch/engines/hooks-engine.d.ts +13 -0
- package/dist/dispatch/engines/hooks-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/hooks-engine.js +12 -0
- package/dist/dispatch/engines/hooks-engine.js.map +1 -0
- package/dist/dispatch/engines/init-engine.d.ts +14 -0
- package/dist/dispatch/engines/init-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/init-engine.js +14 -0
- package/dist/dispatch/engines/init-engine.js.map +1 -0
- package/dist/dispatch/engines/lifecycle-engine.d.ts +13 -0
- package/dist/dispatch/engines/lifecycle-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/lifecycle-engine.js +12 -0
- package/dist/dispatch/engines/lifecycle-engine.js.map +1 -0
- package/dist/dispatch/engines/memory-engine.d.ts +10 -0
- package/dist/dispatch/engines/memory-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/memory-engine.js +10 -0
- package/dist/dispatch/engines/memory-engine.js.map +1 -0
- package/dist/dispatch/engines/nexus-engine.d.ts +603 -0
- package/dist/dispatch/engines/nexus-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/nexus-engine.js +1438 -0
- package/dist/dispatch/engines/nexus-engine.js.map +1 -0
- package/dist/dispatch/engines/orchestrate-engine.d.ts +252 -0
- package/dist/dispatch/engines/orchestrate-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/orchestrate-engine.js +1526 -0
- package/dist/dispatch/engines/orchestrate-engine.js.map +1 -0
- package/dist/dispatch/engines/pipeline-engine.d.ts +13 -0
- package/dist/dispatch/engines/pipeline-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/pipeline-engine.js +12 -0
- package/dist/dispatch/engines/pipeline-engine.js.map +1 -0
- package/dist/dispatch/engines/release-engine.d.ts +13 -0
- package/dist/dispatch/engines/release-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/release-engine.js +13 -0
- package/dist/dispatch/engines/release-engine.js.map +1 -0
- package/dist/dispatch/engines/session-engine.d.ts +15 -0
- package/dist/dispatch/engines/session-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/session-engine.js +12 -0
- package/dist/dispatch/engines/session-engine.js.map +1 -0
- package/dist/dispatch/engines/sticky-engine.d.ts +13 -0
- package/dist/dispatch/engines/sticky-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/sticky-engine.js +12 -0
- package/dist/dispatch/engines/sticky-engine.js.map +1 -0
- package/dist/dispatch/engines/system-engine.d.ts +543 -0
- package/dist/dispatch/engines/system-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/system-engine.js +1278 -0
- package/dist/dispatch/engines/system-engine.js.map +1 -0
- package/dist/dispatch/engines/task-engine.d.ts +1161 -0
- package/dist/dispatch/engines/task-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/task-engine.js +1599 -0
- package/dist/dispatch/engines/task-engine.js.map +1 -0
- package/dist/dispatch/engines/template-parser.d.ts +85 -0
- package/dist/dispatch/engines/template-parser.d.ts.map +1 -0
- package/dist/dispatch/engines/template-parser.js +114 -0
- package/dist/dispatch/engines/template-parser.js.map +1 -0
- package/dist/dispatch/engines/tools-engine.d.ts +13 -0
- package/dist/dispatch/engines/tools-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/tools-engine.js +12 -0
- package/dist/dispatch/engines/tools-engine.js.map +1 -0
- package/dist/dispatch/engines/validate-engine.d.ts +13 -0
- package/dist/dispatch/engines/validate-engine.d.ts.map +1 -0
- package/dist/dispatch/engines/validate-engine.js +13 -0
- package/dist/dispatch/engines/validate-engine.js.map +1 -0
- package/dist/dispatch/index.d.ts +20 -0
- package/dist/dispatch/index.d.ts.map +1 -0
- package/dist/dispatch/index.js +19 -0
- package/dist/dispatch/index.js.map +1 -0
- package/dist/dispatch/lib/background-jobs.d.ts +162 -0
- package/dist/dispatch/lib/background-jobs.d.ts.map +1 -0
- package/dist/dispatch/lib/background-jobs.js +360 -0
- package/dist/dispatch/lib/background-jobs.js.map +1 -0
- package/dist/dispatch/lib/budget.d.ts +36 -0
- package/dist/dispatch/lib/budget.d.ts.map +1 -0
- package/dist/dispatch/lib/budget.js +109 -0
- package/dist/dispatch/lib/budget.js.map +1 -0
- package/dist/dispatch/lib/capability-matrix.d.ts +11 -0
- package/dist/dispatch/lib/capability-matrix.d.ts.map +1 -0
- package/dist/dispatch/lib/capability-matrix.js +10 -0
- package/dist/dispatch/lib/capability-matrix.js.map +1 -0
- package/dist/dispatch/lib/config-loader.d.ts +42 -0
- package/dist/dispatch/lib/config-loader.d.ts.map +1 -0
- package/dist/dispatch/lib/config-loader.js +218 -0
- package/dist/dispatch/lib/config-loader.js.map +1 -0
- package/dist/dispatch/lib/config.d.ts +11 -0
- package/dist/dispatch/lib/config.d.ts.map +1 -0
- package/dist/dispatch/lib/config.js +10 -0
- package/dist/dispatch/lib/config.js.map +1 -0
- package/dist/dispatch/lib/defaults.d.ts +115 -0
- package/dist/dispatch/lib/defaults.d.ts.map +1 -0
- package/dist/dispatch/lib/defaults.js +61 -0
- package/dist/dispatch/lib/defaults.js.map +1 -0
- package/dist/dispatch/lib/engine.d.ts +17 -0
- package/dist/dispatch/lib/engine.d.ts.map +1 -0
- package/dist/dispatch/lib/engine.js +36 -0
- package/dist/dispatch/lib/engine.js.map +1 -0
- package/dist/dispatch/lib/exit-codes.d.ts +35 -0
- package/dist/dispatch/lib/exit-codes.d.ts.map +1 -0
- package/dist/dispatch/lib/exit-codes.js +60 -0
- package/dist/dispatch/lib/exit-codes.js.map +1 -0
- package/dist/dispatch/lib/gateway-meta.d.ts +37 -0
- package/dist/dispatch/lib/gateway-meta.d.ts.map +1 -0
- package/dist/dispatch/lib/gateway-meta.js +50 -0
- package/dist/dispatch/lib/gateway-meta.js.map +1 -0
- package/dist/dispatch/lib/job-manager-accessor.d.ts +9 -0
- package/dist/dispatch/lib/job-manager-accessor.d.ts.map +1 -0
- package/dist/dispatch/lib/job-manager-accessor.js +13 -0
- package/dist/dispatch/lib/job-manager-accessor.js.map +1 -0
- package/dist/dispatch/lib/meta.d.ts +26 -0
- package/dist/dispatch/lib/meta.d.ts.map +1 -0
- package/dist/dispatch/lib/meta.js +37 -0
- package/dist/dispatch/lib/meta.js.map +1 -0
- package/dist/dispatch/lib/param-utils.d.ts +11 -0
- package/dist/dispatch/lib/param-utils.d.ts.map +1 -0
- package/dist/dispatch/lib/param-utils.js +10 -0
- package/dist/dispatch/lib/param-utils.js.map +1 -0
- package/dist/dispatch/lib/projections.d.ts +56 -0
- package/dist/dispatch/lib/projections.d.ts.map +1 -0
- package/dist/dispatch/lib/projections.js +65 -0
- package/dist/dispatch/lib/projections.js.map +1 -0
- package/dist/dispatch/lib/proto-envelope.d.ts +56 -0
- package/dist/dispatch/lib/proto-envelope.d.ts.map +1 -0
- package/dist/dispatch/lib/proto-envelope.js +17 -0
- package/dist/dispatch/lib/proto-envelope.js.map +1 -0
- package/dist/dispatch/lib/schema-utils.d.ts +39 -0
- package/dist/dispatch/lib/schema-utils.d.ts.map +1 -0
- package/dist/dispatch/lib/schema-utils.js +88 -0
- package/dist/dispatch/lib/schema-utils.js.map +1 -0
- package/dist/dispatch/lib/security.d.ts +11 -0
- package/dist/dispatch/lib/security.d.ts.map +1 -0
- package/dist/dispatch/lib/security.js +10 -0
- package/dist/dispatch/lib/security.js.map +1 -0
- package/dist/dispatch/middleware/audit.d.ts +23 -0
- package/dist/dispatch/middleware/audit.d.ts.map +1 -0
- package/dist/dispatch/middleware/audit.js +169 -0
- package/dist/dispatch/middleware/audit.js.map +1 -0
- package/dist/dispatch/middleware/field-filter.d.ts +25 -0
- package/dist/dispatch/middleware/field-filter.d.ts.map +1 -0
- package/dist/dispatch/middleware/field-filter.js +70 -0
- package/dist/dispatch/middleware/field-filter.js.map +1 -0
- package/dist/dispatch/middleware/pipeline.d.ts +33 -0
- package/dist/dispatch/middleware/pipeline.d.ts.map +1 -0
- package/dist/dispatch/middleware/pipeline.js +60 -0
- package/dist/dispatch/middleware/pipeline.js.map +1 -0
- package/dist/dispatch/middleware/projection.d.ts +35 -0
- package/dist/dispatch/middleware/projection.d.ts.map +1 -0
- package/dist/dispatch/middleware/projection.js +146 -0
- package/dist/dispatch/middleware/projection.js.map +1 -0
- package/dist/dispatch/middleware/protocol-enforcement.d.ts +30 -0
- package/dist/dispatch/middleware/protocol-enforcement.d.ts.map +1 -0
- package/dist/dispatch/middleware/protocol-enforcement.js +56 -0
- package/dist/dispatch/middleware/protocol-enforcement.js.map +1 -0
- package/dist/dispatch/middleware/rate-limiter.d.ts +72 -0
- package/dist/dispatch/middleware/rate-limiter.d.ts.map +1 -0
- package/dist/dispatch/middleware/rate-limiter.js +127 -0
- package/dist/dispatch/middleware/rate-limiter.js.map +1 -0
- package/dist/dispatch/middleware/sanitizer.d.ts +24 -0
- package/dist/dispatch/middleware/sanitizer.d.ts.map +1 -0
- package/dist/dispatch/middleware/sanitizer.js +56 -0
- package/dist/dispatch/middleware/sanitizer.js.map +1 -0
- package/dist/dispatch/middleware/session-resolver.d.ts +26 -0
- package/dist/dispatch/middleware/session-resolver.d.ts.map +1 -0
- package/dist/dispatch/middleware/session-resolver.js +65 -0
- package/dist/dispatch/middleware/session-resolver.js.map +1 -0
- package/dist/dispatch/middleware/telemetry.d.ts +21 -0
- package/dist/dispatch/middleware/telemetry.d.ts.map +1 -0
- package/dist/dispatch/middleware/telemetry.js +50 -0
- package/dist/dispatch/middleware/telemetry.js.map +1 -0
- package/dist/dispatch/middleware/verification-gates.d.ts +22 -0
- package/dist/dispatch/middleware/verification-gates.d.ts.map +1 -0
- package/dist/dispatch/middleware/verification-gates.js +59 -0
- package/dist/dispatch/middleware/verification-gates.js.map +1 -0
- package/dist/dispatch/registry.d.ts +91 -0
- package/dist/dispatch/registry.d.ts.map +1 -0
- package/dist/dispatch/registry.js +6430 -0
- package/dist/dispatch/registry.js.map +1 -0
- package/dist/dispatch/types.d.ts +150 -0
- package/dist/dispatch/types.d.ts.map +1 -0
- package/dist/dispatch/types.js +38 -0
- package/dist/dispatch/types.js.map +1 -0
- package/dist/migrations/2026-04-25-t991-parent-link-repair.d.ts +88 -0
- package/dist/migrations/2026-04-25-t991-parent-link-repair.d.ts.map +1 -0
- package/dist/migrations/2026-04-25-t991-parent-link-repair.js +76 -0
- package/dist/migrations/2026-04-25-t991-parent-link-repair.js.map +1 -0
- package/package.json +9 -9
- package/templates/HANDOFF-REDIRECT-STUB.md +37 -0
- package/templates/hooks/commit-msg +146 -6
|
@@ -0,0 +1,1163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin Domain Handler (Dispatch Layer)
|
|
3
|
+
*
|
|
4
|
+
* Consolidates system domain operations into the canonical "admin"
|
|
5
|
+
* domain. Handles version, health, config, stats, context, job management,
|
|
6
|
+
* dashboard, log, sequence, init, backup, restore, migrate, cleanup,
|
|
7
|
+
* safestop, inject.generate, token, adr, export, import, install.global,
|
|
8
|
+
* and context.inject.
|
|
9
|
+
*
|
|
10
|
+
* All operations delegate to native engine functions from system-engine,
|
|
11
|
+
* config-engine, and init-engine.
|
|
12
|
+
*
|
|
13
|
+
* Param extraction is type-safe via OpsFromCore<typeof coreAdmin.adminCoreOps>.
|
|
14
|
+
* Zero `as any` / `as X` param casts.
|
|
15
|
+
*
|
|
16
|
+
* @epic T4820
|
|
17
|
+
* @task T5671
|
|
18
|
+
* @task T1426 — typed-dispatch migration
|
|
19
|
+
* @task T1437 — Core-derived OpsFromCore inference
|
|
20
|
+
*/
|
|
21
|
+
import { checkSequence, cleanupSystem, clearTokenUsage, computeHelp, coreDoctorReport, deleteTokenUsage, ensureCleoOsHub, exportSnapshot, exportTasks, exportTasksPackage, fileRestore, findAdrs, generateInjection, getAccessor, getContextWindow, getDashboard, getDefaultSnapshotPath, getLogger, getMigrationStatus, getProjectRoot, getProjectStatsExtended, getRoadmap, getRuntimeDiagnostics, getSystemHealth, getSystemPaths, importSnapshot, importTasks, importTasksPackage, listAdrs, listSystemBackups, listTokenUsage, mapCodebase, paginate, queryAuditLog, readSnapshot, recordTokenExchange, restoreBackup, runDoctorFixes, safestop, showAdr, showSequence, showTokenUsage, summarizeTokenUsage, syncAdrsToDb, systemCreateBackup, validateAllAdrs, writeSnapshot, } from '@cleocode/core/internal';
|
|
22
|
+
import { defineTypedHandler, lafsError, lafsSuccess, typedDispatch, } from '../adapters/typed.js';
|
|
23
|
+
import { configGet, configListPresets, configSet, configSetPreset, getVersion, initProject, sessionContextInject, systemHooksMatrix, } from '../lib/engine.js';
|
|
24
|
+
import { OPERATIONS } from '../registry.js';
|
|
25
|
+
import { getListParams, handleErrorResult, unsupportedOp, wrapResult } from './_base.js';
|
|
26
|
+
import { dispatchMeta } from './_meta.js';
|
|
27
|
+
const SMOKE_PROBES = [
|
|
28
|
+
{ domain: 'admin', operation: 'version' },
|
|
29
|
+
{ domain: 'tasks', operation: 'find', params: { query: '__smoke_probe__', limit: 1 } },
|
|
30
|
+
{ domain: 'session', operation: 'status' },
|
|
31
|
+
{ domain: 'memory', operation: 'find', params: { query: '__smoke_probe__' } },
|
|
32
|
+
{ domain: 'pipeline', operation: 'list' },
|
|
33
|
+
{ domain: 'check', operation: 'schema' },
|
|
34
|
+
{ domain: 'tools', operation: 'list', params: { limit: 1 } },
|
|
35
|
+
{ domain: 'sticky', operation: 'list', params: { limit: 1 } },
|
|
36
|
+
{ domain: 'nexus', operation: 'status' },
|
|
37
|
+
{ domain: 'orchestrate', operation: 'status' },
|
|
38
|
+
{ domain: 'adapter', operation: 'list' },
|
|
39
|
+
];
|
|
40
|
+
/**
|
|
41
|
+
* Run operational smoke tests across all domains.
|
|
42
|
+
*
|
|
43
|
+
* Inlined from system-engine.ts (Q3 decision: cannot move to core because
|
|
44
|
+
* it imports `dispatchRaw` from the cleo adapter layer, which would create
|
|
45
|
+
* a core→cleo circular dependency).
|
|
46
|
+
*
|
|
47
|
+
* @returns Aggregate smoke result with per-domain probe outcomes
|
|
48
|
+
*/
|
|
49
|
+
async function runSystemSmoke() {
|
|
50
|
+
const { dispatchRaw } = await import('../adapters/cli.js');
|
|
51
|
+
const totalStart = Date.now();
|
|
52
|
+
const probes = [];
|
|
53
|
+
for (const probe of SMOKE_PROBES) {
|
|
54
|
+
const start = Date.now();
|
|
55
|
+
try {
|
|
56
|
+
const response = await dispatchRaw('query', probe.domain, probe.operation, probe.params);
|
|
57
|
+
const elapsed = Date.now() - start;
|
|
58
|
+
if (response.success) {
|
|
59
|
+
probes.push({
|
|
60
|
+
domain: probe.domain,
|
|
61
|
+
operation: probe.operation,
|
|
62
|
+
status: 'pass',
|
|
63
|
+
timeMs: elapsed,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const code = response.error?.code ?? '';
|
|
68
|
+
const isCrash = code === 'E_INTERNAL' || code === 'E_NO_HANDLER';
|
|
69
|
+
probes.push({
|
|
70
|
+
domain: probe.domain,
|
|
71
|
+
operation: probe.operation,
|
|
72
|
+
status: isCrash ? 'fail' : 'pass',
|
|
73
|
+
timeMs: elapsed,
|
|
74
|
+
...(isCrash ? { error: response.error?.message } : {}),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
probes.push({
|
|
80
|
+
domain: probe.domain,
|
|
81
|
+
operation: probe.operation,
|
|
82
|
+
status: 'fail',
|
|
83
|
+
timeMs: Date.now() - start,
|
|
84
|
+
error: err instanceof Error ? `${err.constructor.name}: ${err.message}` : String(err),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const dbChecks = [];
|
|
89
|
+
// tasks.db connectivity + integrity
|
|
90
|
+
{
|
|
91
|
+
const start = Date.now();
|
|
92
|
+
try {
|
|
93
|
+
const { getDb, getNativeDb } = await import('@cleocode/core/internal');
|
|
94
|
+
const projectRoot = getProjectRoot();
|
|
95
|
+
await getDb(projectRoot);
|
|
96
|
+
const nativeDb = getNativeDb();
|
|
97
|
+
if (nativeDb) {
|
|
98
|
+
const result = nativeDb.prepare('PRAGMA integrity_check').get();
|
|
99
|
+
const ok = result?.integrity_check === 'ok';
|
|
100
|
+
dbChecks.push({
|
|
101
|
+
domain: 'db',
|
|
102
|
+
operation: 'tasks.db',
|
|
103
|
+
status: ok ? 'pass' : 'fail',
|
|
104
|
+
timeMs: Date.now() - start,
|
|
105
|
+
...(!ok ? { error: 'SQLite integrity check failed' } : {}),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
dbChecks.push({
|
|
110
|
+
domain: 'db',
|
|
111
|
+
operation: 'tasks.db',
|
|
112
|
+
status: 'fail',
|
|
113
|
+
timeMs: Date.now() - start,
|
|
114
|
+
error: 'Native DB handle unavailable',
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
dbChecks.push({
|
|
120
|
+
domain: 'db',
|
|
121
|
+
operation: 'tasks.db',
|
|
122
|
+
status: 'fail',
|
|
123
|
+
timeMs: Date.now() - start,
|
|
124
|
+
error: err instanceof Error ? err.message : String(err),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// brain.db connectivity
|
|
129
|
+
{
|
|
130
|
+
const start = Date.now();
|
|
131
|
+
try {
|
|
132
|
+
const { getBrainDb } = await import('@cleocode/core/internal');
|
|
133
|
+
const projectRoot = getProjectRoot();
|
|
134
|
+
const brainDb = await getBrainDb(projectRoot);
|
|
135
|
+
if (brainDb) {
|
|
136
|
+
dbChecks.push({
|
|
137
|
+
domain: 'db',
|
|
138
|
+
operation: 'brain.db',
|
|
139
|
+
status: 'pass',
|
|
140
|
+
timeMs: Date.now() - start,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
dbChecks.push({
|
|
145
|
+
domain: 'db',
|
|
146
|
+
operation: 'brain.db',
|
|
147
|
+
status: 'fail',
|
|
148
|
+
timeMs: Date.now() - start,
|
|
149
|
+
error: 'brain.db not initialized',
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
catch (err) {
|
|
154
|
+
dbChecks.push({
|
|
155
|
+
domain: 'db',
|
|
156
|
+
operation: 'brain.db',
|
|
157
|
+
status: 'fail',
|
|
158
|
+
timeMs: Date.now() - start,
|
|
159
|
+
error: err instanceof Error ? err.message : String(err),
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// Migration state validation
|
|
164
|
+
{
|
|
165
|
+
const start = Date.now();
|
|
166
|
+
try {
|
|
167
|
+
const migrationStatus = await getMigrationStatus(getProjectRoot());
|
|
168
|
+
const hasPending = migrationStatus.migrations.some((m) => !m.applied);
|
|
169
|
+
dbChecks.push({
|
|
170
|
+
domain: 'db',
|
|
171
|
+
operation: 'migrations',
|
|
172
|
+
status: hasPending ? 'fail' : 'pass',
|
|
173
|
+
timeMs: Date.now() - start,
|
|
174
|
+
...(hasPending
|
|
175
|
+
? {
|
|
176
|
+
error: `Unapplied migrations detected (${migrationStatus.from} → ${migrationStatus.to}). Run: cleo upgrade`,
|
|
177
|
+
}
|
|
178
|
+
: {}),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
catch (err) {
|
|
182
|
+
dbChecks.push({
|
|
183
|
+
domain: 'db',
|
|
184
|
+
operation: 'migrations',
|
|
185
|
+
status: 'fail',
|
|
186
|
+
timeMs: Date.now() - start,
|
|
187
|
+
error: err instanceof Error ? err.message : String(err),
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const allProbes = [...probes, ...dbChecks];
|
|
192
|
+
const totalMs = Date.now() - totalStart;
|
|
193
|
+
const passed = allProbes.filter((p) => p.status === 'pass').length;
|
|
194
|
+
const failed = allProbes.filter((p) => p.status === 'fail').length;
|
|
195
|
+
const skipped = allProbes.filter((p) => p.status === 'skip').length;
|
|
196
|
+
return { probes, dbChecks, passed, failed, skipped, totalMs };
|
|
197
|
+
}
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
// Typed inner handler (Wave D · T1426, Core-derived · T1437)
|
|
200
|
+
//
|
|
201
|
+
// The typed handler holds all per-op logic with fully-narrowed params.
|
|
202
|
+
// The outer DomainHandler class delegates to it so the registry sees the
|
|
203
|
+
// expected query/mutate interface while every param access is type-safe.
|
|
204
|
+
// ---------------------------------------------------------------------------
|
|
205
|
+
const _adminTypedHandler = defineTypedHandler('admin', {
|
|
206
|
+
// -------------------------------------------------------------------------
|
|
207
|
+
// Query ops
|
|
208
|
+
// -------------------------------------------------------------------------
|
|
209
|
+
version: async (_params) => {
|
|
210
|
+
const projectRoot = getProjectRoot();
|
|
211
|
+
const result = await getVersion(projectRoot);
|
|
212
|
+
if (!result.success) {
|
|
213
|
+
return lafsError(String(result.error?.code ?? 'E_INTERNAL'), result.error?.message ?? 'Unknown error', 'version');
|
|
214
|
+
}
|
|
215
|
+
return lafsSuccess(result.data ?? { version: '' }, 'version');
|
|
216
|
+
},
|
|
217
|
+
health: async (params) => {
|
|
218
|
+
const projectRoot = getProjectRoot();
|
|
219
|
+
if (params.mode === 'diagnose') {
|
|
220
|
+
try {
|
|
221
|
+
const data = await coreDoctorReport(projectRoot);
|
|
222
|
+
return lafsSuccess(data ?? { healthy: false, errors: 0, warnings: 0, checks: [] }, 'health');
|
|
223
|
+
}
|
|
224
|
+
catch (err) {
|
|
225
|
+
return lafsError('E_INTERNAL', err instanceof Error ? err.message : String(err), 'health');
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
try {
|
|
229
|
+
const data = await getSystemHealth(projectRoot, { detailed: params.detailed });
|
|
230
|
+
return lafsSuccess(data ?? { overall: 'error', checks: [], version: '', installation: 'degraded' }, 'health');
|
|
231
|
+
}
|
|
232
|
+
catch (err) {
|
|
233
|
+
return lafsError('E_INTERNAL', err instanceof Error ? err.message : String(err), 'health');
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
'config.show': async (params) => {
|
|
237
|
+
const projectRoot = getProjectRoot();
|
|
238
|
+
const result = await configGet(projectRoot, params.key);
|
|
239
|
+
if (!result.success) {
|
|
240
|
+
return lafsError(String(result.error?.code ?? 'E_INTERNAL'), result.error?.message ?? 'Unknown error', 'config.show');
|
|
241
|
+
}
|
|
242
|
+
return lafsSuccess(result.data ?? {}, 'config.show');
|
|
243
|
+
},
|
|
244
|
+
'config.presets': async (_params) => {
|
|
245
|
+
const result = configListPresets();
|
|
246
|
+
if (!result.success) {
|
|
247
|
+
return lafsError(String(result.error?.code ?? 'E_INTERNAL'), result.error?.message ?? 'Unknown error', 'config.presets');
|
|
248
|
+
}
|
|
249
|
+
return lafsSuccess(result.data ?? { presets: [] }, 'config.presets');
|
|
250
|
+
},
|
|
251
|
+
stats: async (params) => {
|
|
252
|
+
const projectRoot = getProjectRoot();
|
|
253
|
+
try {
|
|
254
|
+
const data = await getProjectStatsExtended(projectRoot, { period: params.period });
|
|
255
|
+
return lafsSuccess(data, 'stats');
|
|
256
|
+
}
|
|
257
|
+
catch (err) {
|
|
258
|
+
return lafsError('E_INTERNAL', err instanceof Error ? err.message : String(err), 'stats');
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
context: async (params) => {
|
|
262
|
+
const projectRoot = getProjectRoot();
|
|
263
|
+
try {
|
|
264
|
+
const data = getContextWindow(projectRoot, params.session !== undefined ? { session: params.session } : undefined);
|
|
265
|
+
return lafsSuccess(data, 'context');
|
|
266
|
+
}
|
|
267
|
+
catch (err) {
|
|
268
|
+
return lafsError('E_INTERNAL', err instanceof Error ? err.message : String(err), 'context');
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
'context.pull': async (params) => {
|
|
272
|
+
const projectRoot = getProjectRoot();
|
|
273
|
+
const taskId = params.taskId;
|
|
274
|
+
try {
|
|
275
|
+
const { getAccessor, getLastHandoff, retrieveWithBudget } = await import('@cleocode/core/internal');
|
|
276
|
+
const accessor = await getAccessor(projectRoot);
|
|
277
|
+
const task = await accessor.loadSingleTask(taskId);
|
|
278
|
+
if (!task) {
|
|
279
|
+
return lafsError('E_NOT_FOUND', `Task ${taskId} not found`, 'context.pull');
|
|
280
|
+
}
|
|
281
|
+
const queryParts = [task.title, task.description].filter((v) => typeof v === 'string' && v.trim().length > 0);
|
|
282
|
+
const query = queryParts.join(' ');
|
|
283
|
+
const TOKEN_BUDGET = 800;
|
|
284
|
+
const [memoriesResult, lastHandoffResult] = await Promise.all([
|
|
285
|
+
retrieveWithBudget(projectRoot, query, TOKEN_BUDGET).catch(() => ({
|
|
286
|
+
entries: [],
|
|
287
|
+
tokensUsed: 0,
|
|
288
|
+
tokensRemaining: TOKEN_BUDGET,
|
|
289
|
+
excluded: 0,
|
|
290
|
+
})),
|
|
291
|
+
getLastHandoff(projectRoot).catch(() => null),
|
|
292
|
+
]);
|
|
293
|
+
const topMemories = memoriesResult.entries.slice(0, 5);
|
|
294
|
+
return lafsSuccess({
|
|
295
|
+
task: {
|
|
296
|
+
id: task.id,
|
|
297
|
+
title: task.title,
|
|
298
|
+
status: task.status,
|
|
299
|
+
acceptance: task.acceptance ?? [],
|
|
300
|
+
},
|
|
301
|
+
relevantMemory: topMemories.map((e) => ({
|
|
302
|
+
id: e.id,
|
|
303
|
+
type: e.memoryType ?? 'unknown',
|
|
304
|
+
summary: e.title,
|
|
305
|
+
})),
|
|
306
|
+
lastHandoff: lastHandoffResult?.handoff?.note?.substring(0, 200) ?? null,
|
|
307
|
+
meta: {
|
|
308
|
+
memoryTokensUsed: memoriesResult.tokensUsed,
|
|
309
|
+
memoryEntriesExcluded: memoriesResult.excluded,
|
|
310
|
+
},
|
|
311
|
+
}, 'context.pull');
|
|
312
|
+
}
|
|
313
|
+
catch (err) {
|
|
314
|
+
return lafsError('E_INTERNAL', err instanceof Error ? err.message : String(err), 'context.pull');
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
runtime: async (params) => {
|
|
318
|
+
try {
|
|
319
|
+
const data = await getRuntimeDiagnostics({ detailed: params.detailed ?? false });
|
|
320
|
+
return lafsSuccess(data, 'runtime');
|
|
321
|
+
}
|
|
322
|
+
catch (err) {
|
|
323
|
+
return lafsError('E_INTERNAL', err instanceof Error ? err.message : String(err), 'runtime');
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
paths: async (_params) => {
|
|
327
|
+
const projectRoot = getProjectRoot();
|
|
328
|
+
try {
|
|
329
|
+
const data = getSystemPaths(projectRoot);
|
|
330
|
+
return lafsSuccess(data, 'paths');
|
|
331
|
+
}
|
|
332
|
+
catch (err) {
|
|
333
|
+
return lafsError('E_PATHS_RESOLVE_FAILED', err instanceof Error ? err.message : String(err), 'paths');
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
job: async (params) => {
|
|
337
|
+
const { getJobManager } = await import('../lib/job-manager-accessor.js');
|
|
338
|
+
const action = params.action ?? 'status';
|
|
339
|
+
if (action === 'list') {
|
|
340
|
+
const mgr = getJobManager();
|
|
341
|
+
if (!mgr) {
|
|
342
|
+
return lafsError('E_NOT_AVAILABLE', 'Job manager not available. Background jobs require a running CLEO daemon or long-lived process.', 'job');
|
|
343
|
+
}
|
|
344
|
+
const allJobs = mgr.listJobs();
|
|
345
|
+
const filteredJobs = params.status ? mgr.listJobs(params.status) : allJobs;
|
|
346
|
+
const { limit, offset } = getListParams({ limit: params.limit, offset: params.offset });
|
|
347
|
+
const page = paginate(filteredJobs, limit, offset);
|
|
348
|
+
return lafsSuccess({
|
|
349
|
+
jobs: page.items,
|
|
350
|
+
count: filteredJobs.length,
|
|
351
|
+
total: allJobs.length,
|
|
352
|
+
filtered: filteredJobs.length,
|
|
353
|
+
}, 'job');
|
|
354
|
+
}
|
|
355
|
+
// Default: status action
|
|
356
|
+
const manager = getJobManager();
|
|
357
|
+
if (!manager) {
|
|
358
|
+
return lafsError('E_NOT_AVAILABLE', 'Job manager not available. Background jobs require a running CLEO daemon or long-lived process.', 'job');
|
|
359
|
+
}
|
|
360
|
+
const jobId = params.jobId;
|
|
361
|
+
if (!jobId) {
|
|
362
|
+
return lafsError('E_INVALID_INPUT', 'jobId is required', 'job');
|
|
363
|
+
}
|
|
364
|
+
const job = manager.getJob(jobId);
|
|
365
|
+
if (!job) {
|
|
366
|
+
return lafsError('E_NOT_FOUND', `Job ${jobId} not found`, 'job');
|
|
367
|
+
}
|
|
368
|
+
return lafsSuccess(job, 'job');
|
|
369
|
+
},
|
|
370
|
+
dash: async (params) => {
|
|
371
|
+
const projectRoot = getProjectRoot();
|
|
372
|
+
try {
|
|
373
|
+
const accessor = await getAccessor(projectRoot);
|
|
374
|
+
const raw = await getDashboard({ cwd: projectRoot, blockedTasksLimit: params.blockedTasksLimit }, accessor);
|
|
375
|
+
const data = raw;
|
|
376
|
+
const summary = data.summary;
|
|
377
|
+
return lafsSuccess({
|
|
378
|
+
project: data.project,
|
|
379
|
+
currentPhase: data.currentPhase,
|
|
380
|
+
summary: {
|
|
381
|
+
pending: summary.pending,
|
|
382
|
+
active: summary.active,
|
|
383
|
+
blocked: summary.blocked,
|
|
384
|
+
done: summary.done,
|
|
385
|
+
cancelled: summary.cancelled ?? 0,
|
|
386
|
+
total: summary.total,
|
|
387
|
+
archived: summary.archived ?? 0,
|
|
388
|
+
grandTotal: summary.grandTotal ?? summary.total,
|
|
389
|
+
},
|
|
390
|
+
taskWork: (data.focus ?? data.taskWork),
|
|
391
|
+
activeSession: data.activeSession ?? null,
|
|
392
|
+
highPriority: data.highPriority,
|
|
393
|
+
blockedTasks: data.blockedTasks,
|
|
394
|
+
recentCompletions: (data.recentCompletions ?? []),
|
|
395
|
+
topLabels: data.topLabels,
|
|
396
|
+
}, 'dash');
|
|
397
|
+
}
|
|
398
|
+
catch (err) {
|
|
399
|
+
return lafsError('E_NOT_INITIALIZED', err instanceof Error ? err.message : String(err), 'dash');
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
log: async (params) => {
|
|
403
|
+
const projectRoot = getProjectRoot();
|
|
404
|
+
try {
|
|
405
|
+
const data = await queryAuditLog(projectRoot, {
|
|
406
|
+
operation: params.operation,
|
|
407
|
+
taskId: params.taskId,
|
|
408
|
+
since: params.since,
|
|
409
|
+
until: params.until,
|
|
410
|
+
limit: params.limit,
|
|
411
|
+
offset: params.offset,
|
|
412
|
+
});
|
|
413
|
+
return lafsSuccess(data, 'log');
|
|
414
|
+
}
|
|
415
|
+
catch (err) {
|
|
416
|
+
return lafsError('E_FILE_ERROR', err instanceof Error ? err.message : String(err), 'log');
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
sequence: async (params) => {
|
|
420
|
+
const projectRoot = getProjectRoot();
|
|
421
|
+
const action = params.action;
|
|
422
|
+
if (action && action !== 'show' && action !== 'check') {
|
|
423
|
+
return lafsError('E_INVALID_INPUT', 'action must be show or check', 'sequence');
|
|
424
|
+
}
|
|
425
|
+
try {
|
|
426
|
+
if (action === 'check') {
|
|
427
|
+
const data = await checkSequence(projectRoot);
|
|
428
|
+
return lafsSuccess(data, 'sequence');
|
|
429
|
+
}
|
|
430
|
+
const seq = await showSequence(projectRoot);
|
|
431
|
+
return lafsSuccess({
|
|
432
|
+
counter: Number(seq.counter ?? 0),
|
|
433
|
+
lastId: String(seq.lastId ?? ''),
|
|
434
|
+
checksum: String(seq.checksum ?? ''),
|
|
435
|
+
nextId: String(seq.nextId ?? ''),
|
|
436
|
+
}, 'sequence');
|
|
437
|
+
}
|
|
438
|
+
catch (err) {
|
|
439
|
+
return lafsError('E_NOT_FOUND', err instanceof Error ? err.message : String(err), 'sequence');
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
help: async (params) => {
|
|
443
|
+
const tier = params.tier ?? 0;
|
|
444
|
+
const verbose = params.verbose === true;
|
|
445
|
+
const helpResult = computeHelp(OPERATIONS, tier, verbose);
|
|
446
|
+
return lafsSuccess(helpResult, 'help');
|
|
447
|
+
},
|
|
448
|
+
'adr.find': async (params) => {
|
|
449
|
+
const projectRoot = getProjectRoot();
|
|
450
|
+
if (params.query) {
|
|
451
|
+
const result = await findAdrs(projectRoot, params);
|
|
452
|
+
return lafsSuccess(result, 'adr.find');
|
|
453
|
+
}
|
|
454
|
+
// No query — list all ADRs
|
|
455
|
+
const { limit, offset } = getListParams({ limit: params.limit, offset: params.offset });
|
|
456
|
+
const result = await listAdrs(projectRoot, { ...params, limit, offset });
|
|
457
|
+
return lafsSuccess({
|
|
458
|
+
...result,
|
|
459
|
+
page: paginate(Array.from({ length: result.filtered }), limit, offset).page,
|
|
460
|
+
}, 'adr.find');
|
|
461
|
+
},
|
|
462
|
+
'adr.show': async (params) => {
|
|
463
|
+
const projectRoot = getProjectRoot();
|
|
464
|
+
const adr = await showAdr(projectRoot, params);
|
|
465
|
+
if (!adr) {
|
|
466
|
+
return lafsError('E_NOT_FOUND', `ADR not found: ${params.adrId}`, 'adr.show');
|
|
467
|
+
}
|
|
468
|
+
return lafsSuccess(adr, 'adr.show');
|
|
469
|
+
},
|
|
470
|
+
token: async (params) => {
|
|
471
|
+
const projectRoot = getProjectRoot();
|
|
472
|
+
const action = params.action ?? 'summary';
|
|
473
|
+
if (action === 'show') {
|
|
474
|
+
const tokenId = params.tokenId;
|
|
475
|
+
if (!tokenId) {
|
|
476
|
+
return lafsError('E_INVALID_INPUT', 'tokenId is required', 'token');
|
|
477
|
+
}
|
|
478
|
+
const result = await showTokenUsage(projectRoot, { id: tokenId });
|
|
479
|
+
if (!result) {
|
|
480
|
+
return lafsError('E_NOT_FOUND', `Token usage record not found: ${tokenId}`, 'token');
|
|
481
|
+
}
|
|
482
|
+
return lafsSuccess(result, 'token');
|
|
483
|
+
}
|
|
484
|
+
if (action === 'list') {
|
|
485
|
+
const { limit, offset } = getListParams({ limit: params.limit, offset: params.offset });
|
|
486
|
+
const result = await listTokenUsage(projectRoot, {
|
|
487
|
+
provider: params.provider,
|
|
488
|
+
transport: params.transport,
|
|
489
|
+
gateway: params.gateway,
|
|
490
|
+
domain: params.domain,
|
|
491
|
+
operation: params.operationName,
|
|
492
|
+
sessionId: params.sessionId,
|
|
493
|
+
taskId: params.taskId,
|
|
494
|
+
method: params.method,
|
|
495
|
+
confidence: params.confidence,
|
|
496
|
+
requestId: params.requestId,
|
|
497
|
+
since: params.since,
|
|
498
|
+
until: params.until,
|
|
499
|
+
limit,
|
|
500
|
+
offset,
|
|
501
|
+
});
|
|
502
|
+
return lafsSuccess({
|
|
503
|
+
records: result.records,
|
|
504
|
+
total: result.total,
|
|
505
|
+
filtered: result.filtered,
|
|
506
|
+
}, 'token');
|
|
507
|
+
}
|
|
508
|
+
// Default: summary
|
|
509
|
+
const result = await summarizeTokenUsage(projectRoot, {
|
|
510
|
+
provider: params.provider,
|
|
511
|
+
transport: params.transport,
|
|
512
|
+
gateway: params.gateway,
|
|
513
|
+
domain: params.domain,
|
|
514
|
+
operation: params.operationName,
|
|
515
|
+
sessionId: params.sessionId,
|
|
516
|
+
taskId: params.taskId,
|
|
517
|
+
method: params.method,
|
|
518
|
+
confidence: params.confidence,
|
|
519
|
+
requestId: params.requestId,
|
|
520
|
+
since: params.since,
|
|
521
|
+
until: params.until,
|
|
522
|
+
});
|
|
523
|
+
return lafsSuccess(result, 'token');
|
|
524
|
+
},
|
|
525
|
+
backup: async (_params) => {
|
|
526
|
+
const projectRoot = getProjectRoot();
|
|
527
|
+
try {
|
|
528
|
+
const backups = listSystemBackups(projectRoot);
|
|
529
|
+
return lafsSuccess({ backups, count: backups.length }, 'backup');
|
|
530
|
+
}
|
|
531
|
+
catch (err) {
|
|
532
|
+
return lafsError('E_GENERAL', err instanceof Error ? err.message : String(err), 'backup');
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
export: async (params) => {
|
|
536
|
+
const projectRoot = getProjectRoot();
|
|
537
|
+
if (params.scope === 'snapshot') {
|
|
538
|
+
const snapshot = await exportSnapshot(projectRoot);
|
|
539
|
+
const outputPath = params.output ?? getDefaultSnapshotPath(projectRoot);
|
|
540
|
+
await writeSnapshot(snapshot, outputPath);
|
|
541
|
+
return lafsSuccess({
|
|
542
|
+
exported: true,
|
|
543
|
+
taskCount: snapshot._meta.taskCount,
|
|
544
|
+
outputPath,
|
|
545
|
+
checksum: snapshot._meta.checksum,
|
|
546
|
+
}, 'export');
|
|
547
|
+
}
|
|
548
|
+
if (params.scope === 'tasks') {
|
|
549
|
+
const result = await exportTasksPackage(projectRoot, params);
|
|
550
|
+
return lafsSuccess(result, 'export');
|
|
551
|
+
}
|
|
552
|
+
// Default: standard export
|
|
553
|
+
const result = await exportTasks(projectRoot, params);
|
|
554
|
+
return lafsSuccess(result, 'export');
|
|
555
|
+
},
|
|
556
|
+
map: async (params) => {
|
|
557
|
+
const projectRoot = getProjectRoot();
|
|
558
|
+
try {
|
|
559
|
+
const data = await mapCodebase(projectRoot, { focus: params.focus, storeToBrain: false });
|
|
560
|
+
return lafsSuccess(data, 'map');
|
|
561
|
+
}
|
|
562
|
+
catch (err) {
|
|
563
|
+
return lafsError('E_GENERAL', err instanceof Error ? err.message : String(err), 'map');
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
roadmap: async (params) => {
|
|
567
|
+
const projectRoot = getProjectRoot();
|
|
568
|
+
try {
|
|
569
|
+
const accessor = await getAccessor(projectRoot);
|
|
570
|
+
const data = await getRoadmap({
|
|
571
|
+
includeHistory: params.includeHistory,
|
|
572
|
+
upcomingOnly: params.upcomingOnly,
|
|
573
|
+
cwd: projectRoot,
|
|
574
|
+
}, accessor);
|
|
575
|
+
return lafsSuccess(data, 'roadmap');
|
|
576
|
+
}
|
|
577
|
+
catch (err) {
|
|
578
|
+
return lafsError('E_NOT_INITIALIZED', err instanceof Error ? err.message : String(err), 'roadmap');
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
smoke: async (_params) => {
|
|
582
|
+
const smokeResult = await runSystemSmoke();
|
|
583
|
+
if (smokeResult.failed === 0) {
|
|
584
|
+
return lafsSuccess(smokeResult, 'smoke');
|
|
585
|
+
}
|
|
586
|
+
return lafsError('E_SMOKE_FAILURES', `${smokeResult.failed} probe(s) failed smoke test`, 'smoke');
|
|
587
|
+
},
|
|
588
|
+
'smoke.provider': async (params) => {
|
|
589
|
+
const { smokeProvider } = await import('./admin/smoke-provider.js');
|
|
590
|
+
const result = await smokeProvider(params.provider);
|
|
591
|
+
if (!result.success) {
|
|
592
|
+
return lafsError(String(result.error?.code ?? 'E_INTERNAL'), result.error?.message ?? 'Unknown error', 'smoke.provider');
|
|
593
|
+
}
|
|
594
|
+
return lafsSuccess(result.data, 'smoke.provider');
|
|
595
|
+
},
|
|
596
|
+
'hooks.matrix': async (params) => {
|
|
597
|
+
const result = await systemHooksMatrix({
|
|
598
|
+
providerIds: params.providerIds,
|
|
599
|
+
detectProvider: params.detectProvider !== false,
|
|
600
|
+
});
|
|
601
|
+
if (!result.success) {
|
|
602
|
+
return lafsError(String(result.error?.code ?? 'E_INTERNAL'), result.error?.message ?? 'Unknown error', 'hooks.matrix');
|
|
603
|
+
}
|
|
604
|
+
return lafsSuccess(result.data, 'hooks.matrix');
|
|
605
|
+
},
|
|
606
|
+
// -------------------------------------------------------------------------
|
|
607
|
+
// Mutate ops
|
|
608
|
+
// -------------------------------------------------------------------------
|
|
609
|
+
init: async (params) => {
|
|
610
|
+
const projectRoot = getProjectRoot();
|
|
611
|
+
const result = await initProject(projectRoot, {
|
|
612
|
+
projectName: params.projectName,
|
|
613
|
+
force: params.force,
|
|
614
|
+
mapCodebase: params.mapCodebase,
|
|
615
|
+
});
|
|
616
|
+
if (!result.success) {
|
|
617
|
+
return lafsError(String(result.error?.code ?? 'E_INTERNAL'), result.error?.message ?? 'Unknown error', 'init');
|
|
618
|
+
}
|
|
619
|
+
return lafsSuccess(result.data, 'init');
|
|
620
|
+
},
|
|
621
|
+
'scaffold-hub': async (_params) => {
|
|
622
|
+
try {
|
|
623
|
+
const data = await ensureCleoOsHub();
|
|
624
|
+
return lafsSuccess(data, 'scaffold-hub');
|
|
625
|
+
}
|
|
626
|
+
catch (err) {
|
|
627
|
+
return lafsError('E_SCAFFOLD_HUB_FAILED', err instanceof Error ? err.message : String(err), 'scaffold-hub');
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
'health.mutate': async (params) => {
|
|
631
|
+
const projectRoot = getProjectRoot();
|
|
632
|
+
if (params.mode === 'diagnose') {
|
|
633
|
+
try {
|
|
634
|
+
const data = await coreDoctorReport(projectRoot);
|
|
635
|
+
return lafsSuccess(data ?? { healthy: false, errors: 0, warnings: 0, checks: [] }, 'health.mutate');
|
|
636
|
+
}
|
|
637
|
+
catch (err) {
|
|
638
|
+
return lafsError('E_INTERNAL', err instanceof Error ? err.message : String(err), 'health.mutate');
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
try {
|
|
642
|
+
const data = await runDoctorFixes(projectRoot);
|
|
643
|
+
return lafsSuccess(data, 'health.mutate');
|
|
644
|
+
}
|
|
645
|
+
catch (err) {
|
|
646
|
+
return lafsError('E_INTERNAL', err instanceof Error ? err.message : String(err), 'health.mutate');
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
'config.set': async (params) => {
|
|
650
|
+
const projectRoot = getProjectRoot();
|
|
651
|
+
// Runtime guard: key is declared required in the contract but the dispatcher
|
|
652
|
+
// may pass an empty object when the caller omits it; validate defensively.
|
|
653
|
+
if (!params.key) {
|
|
654
|
+
return lafsError('E_INVALID_INPUT', 'key is required', 'config.set');
|
|
655
|
+
}
|
|
656
|
+
const result = await configSet(projectRoot, params.key, params.value);
|
|
657
|
+
if (!result.success) {
|
|
658
|
+
return lafsError(String(result.error?.code ?? 'E_INTERNAL'), result.error?.message ?? 'Unknown error', 'config.set');
|
|
659
|
+
}
|
|
660
|
+
return lafsSuccess(result.data, 'config.set');
|
|
661
|
+
},
|
|
662
|
+
'config.set-preset': async (params) => {
|
|
663
|
+
const projectRoot = getProjectRoot();
|
|
664
|
+
const result = await configSetPreset(projectRoot, params.preset);
|
|
665
|
+
if (!result.success) {
|
|
666
|
+
return lafsError(String(result.error?.code ?? 'E_INTERNAL'), result.error?.message ?? 'Unknown error', 'config.set-preset');
|
|
667
|
+
}
|
|
668
|
+
return lafsSuccess(result.data, 'config.set-preset');
|
|
669
|
+
},
|
|
670
|
+
'backup.mutate': async (params) => {
|
|
671
|
+
const projectRoot = getProjectRoot();
|
|
672
|
+
const action = params.action;
|
|
673
|
+
if (action === 'restore') {
|
|
674
|
+
const backupId = params.backupId;
|
|
675
|
+
if (!backupId) {
|
|
676
|
+
return lafsError('E_INVALID_INPUT', 'backupId is required', 'backup.mutate');
|
|
677
|
+
}
|
|
678
|
+
try {
|
|
679
|
+
const data = restoreBackup(projectRoot, { backupId, force: params.force });
|
|
680
|
+
return lafsSuccess(data, 'backup.mutate');
|
|
681
|
+
}
|
|
682
|
+
catch (err) {
|
|
683
|
+
return lafsError('E_RESTORE_FAILED', err instanceof Error ? err.message : String(err), 'backup.mutate');
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
if (action === 'restore.file') {
|
|
687
|
+
const file = params.file;
|
|
688
|
+
if (!file) {
|
|
689
|
+
return lafsError('E_INVALID_INPUT', 'file is required', 'backup.mutate');
|
|
690
|
+
}
|
|
691
|
+
try {
|
|
692
|
+
const data = await fileRestore(projectRoot, file, { dryRun: params.dryRun });
|
|
693
|
+
return lafsSuccess(data, 'backup.mutate');
|
|
694
|
+
}
|
|
695
|
+
catch (err) {
|
|
696
|
+
return lafsError('E_GENERAL', err instanceof Error ? err.message : String(err), 'backup.mutate');
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
// Default: create backup
|
|
700
|
+
try {
|
|
701
|
+
const data = await systemCreateBackup(projectRoot, { type: params.type, note: params.note });
|
|
702
|
+
return lafsSuccess(data, 'backup.mutate');
|
|
703
|
+
}
|
|
704
|
+
catch (err) {
|
|
705
|
+
return lafsError('E_GENERAL', err instanceof Error ? err.message : String(err), 'backup.mutate');
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
migrate: async (params) => {
|
|
709
|
+
const projectRoot = getProjectRoot();
|
|
710
|
+
try {
|
|
711
|
+
const data = await getMigrationStatus(projectRoot, {
|
|
712
|
+
target: params.target,
|
|
713
|
+
dryRun: params.dryRun,
|
|
714
|
+
});
|
|
715
|
+
return lafsSuccess(data, 'migrate');
|
|
716
|
+
}
|
|
717
|
+
catch (err) {
|
|
718
|
+
return lafsError('E_MIGRATE_FAILED', err instanceof Error ? err.message : String(err), 'migrate');
|
|
719
|
+
}
|
|
720
|
+
},
|
|
721
|
+
cleanup: async (params) => {
|
|
722
|
+
const projectRoot = getProjectRoot();
|
|
723
|
+
// Runtime guard: target is declared required in the contract but the
|
|
724
|
+
// dispatcher may pass an empty object when the caller omits it.
|
|
725
|
+
if (!params.target) {
|
|
726
|
+
return lafsError('E_INVALID_INPUT', 'target is required', 'cleanup');
|
|
727
|
+
}
|
|
728
|
+
try {
|
|
729
|
+
const data = await cleanupSystem(projectRoot, {
|
|
730
|
+
target: params.target,
|
|
731
|
+
olderThan: params.olderThan,
|
|
732
|
+
dryRun: params.dryRun,
|
|
733
|
+
});
|
|
734
|
+
return lafsSuccess(data, 'cleanup');
|
|
735
|
+
}
|
|
736
|
+
catch (err) {
|
|
737
|
+
return lafsError('E_CLEANUP_FAILED', err instanceof Error ? err.message : String(err), 'cleanup');
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
'job.cancel': async (params) => {
|
|
741
|
+
const { getJobManager } = await import('../lib/job-manager-accessor.js');
|
|
742
|
+
const mgr = getJobManager();
|
|
743
|
+
if (!mgr) {
|
|
744
|
+
return lafsError('E_NOT_AVAILABLE', 'Job manager not available. Background jobs require a running CLEO daemon or long-lived process.', 'job.cancel');
|
|
745
|
+
}
|
|
746
|
+
const cancelled = mgr.cancelJob(params.jobId);
|
|
747
|
+
if (!cancelled) {
|
|
748
|
+
return lafsError('E_NOT_FOUND', `Job ${params.jobId} not found or not running`, 'job.cancel');
|
|
749
|
+
}
|
|
750
|
+
return lafsSuccess({ jobId: params.jobId, cancelled: true }, 'job.cancel');
|
|
751
|
+
},
|
|
752
|
+
safestop: async (params) => {
|
|
753
|
+
const projectRoot = getProjectRoot();
|
|
754
|
+
try {
|
|
755
|
+
const data = await safestop(projectRoot, {
|
|
756
|
+
reason: params.reason,
|
|
757
|
+
commit: params.commit,
|
|
758
|
+
handoff: params.handoff,
|
|
759
|
+
noSessionEnd: params.noSessionEnd,
|
|
760
|
+
dryRun: params.dryRun,
|
|
761
|
+
});
|
|
762
|
+
return lafsSuccess(data, 'safestop');
|
|
763
|
+
}
|
|
764
|
+
catch (err) {
|
|
765
|
+
return lafsError('E_GENERAL', err instanceof Error ? err.message : String(err), 'safestop');
|
|
766
|
+
}
|
|
767
|
+
},
|
|
768
|
+
'inject.generate': async (_params) => {
|
|
769
|
+
const projectRoot = getProjectRoot();
|
|
770
|
+
try {
|
|
771
|
+
const accessor = await getAccessor(projectRoot);
|
|
772
|
+
const data = await generateInjection(projectRoot, accessor);
|
|
773
|
+
return lafsSuccess(data, 'inject.generate');
|
|
774
|
+
}
|
|
775
|
+
catch (err) {
|
|
776
|
+
return lafsError('E_GENERAL', err instanceof Error ? err.message : String(err), 'inject.generate');
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
'adr.sync': async (params) => {
|
|
780
|
+
const projectRoot = getProjectRoot();
|
|
781
|
+
if (params.validate) {
|
|
782
|
+
const result = await validateAllAdrs(projectRoot);
|
|
783
|
+
return lafsSuccess(result, 'adr.sync');
|
|
784
|
+
}
|
|
785
|
+
const result = await syncAdrsToDb(projectRoot);
|
|
786
|
+
return lafsSuccess(result, 'adr.sync');
|
|
787
|
+
},
|
|
788
|
+
import: async (params) => {
|
|
789
|
+
const projectRoot = getProjectRoot();
|
|
790
|
+
const file = params.file;
|
|
791
|
+
if (params.scope === 'snapshot') {
|
|
792
|
+
const snapshot = await readSnapshot(file);
|
|
793
|
+
if (params.dryRun) {
|
|
794
|
+
return lafsSuccess({
|
|
795
|
+
dryRun: true,
|
|
796
|
+
source: snapshot._meta.source,
|
|
797
|
+
taskCount: snapshot._meta.taskCount,
|
|
798
|
+
createdAt: snapshot._meta.createdAt,
|
|
799
|
+
}, 'import');
|
|
800
|
+
}
|
|
801
|
+
const result = await importSnapshot(snapshot, projectRoot);
|
|
802
|
+
return lafsSuccess({
|
|
803
|
+
imported: true,
|
|
804
|
+
added: result.added,
|
|
805
|
+
updated: result.updated,
|
|
806
|
+
skipped: result.skipped,
|
|
807
|
+
conflicts: result.conflicts.length > 0 ? result.conflicts : undefined,
|
|
808
|
+
}, 'import');
|
|
809
|
+
}
|
|
810
|
+
if (params.scope === 'tasks') {
|
|
811
|
+
const result = await importTasksPackage(projectRoot, params);
|
|
812
|
+
return lafsSuccess(result, 'import');
|
|
813
|
+
}
|
|
814
|
+
// Default: standard import
|
|
815
|
+
const result = await importTasks(projectRoot, params);
|
|
816
|
+
return lafsSuccess(result, 'import');
|
|
817
|
+
},
|
|
818
|
+
detect: async (_params) => {
|
|
819
|
+
const projectRoot = getProjectRoot();
|
|
820
|
+
const { ensureProjectContext, ensureContributorMcp: ensureContributorDev } = await import('@cleocode/core/internal');
|
|
821
|
+
const contextResult = await ensureProjectContext(projectRoot, { force: true });
|
|
822
|
+
const devResult = await ensureContributorDev(projectRoot);
|
|
823
|
+
return lafsSuccess({ context: contextResult, devChannel: devResult }, 'detect');
|
|
824
|
+
},
|
|
825
|
+
'token.mutate': async (params) => {
|
|
826
|
+
const projectRoot = getProjectRoot();
|
|
827
|
+
const action = params.action ?? 'record';
|
|
828
|
+
if (action === 'delete') {
|
|
829
|
+
const tokenId = params.tokenId;
|
|
830
|
+
if (!tokenId) {
|
|
831
|
+
return lafsError('E_INVALID_INPUT', 'tokenId is required', 'token.mutate');
|
|
832
|
+
}
|
|
833
|
+
const result = await deleteTokenUsage(projectRoot, { id: tokenId });
|
|
834
|
+
return lafsSuccess(result, 'token.mutate');
|
|
835
|
+
}
|
|
836
|
+
if (action === 'clear') {
|
|
837
|
+
const result = await clearTokenUsage(projectRoot, {
|
|
838
|
+
provider: params.provider,
|
|
839
|
+
transport: params.transport,
|
|
840
|
+
gateway: params.gateway,
|
|
841
|
+
domain: params.domain,
|
|
842
|
+
operation: params.operationName,
|
|
843
|
+
sessionId: params.sessionId,
|
|
844
|
+
taskId: params.taskId,
|
|
845
|
+
method: params.method,
|
|
846
|
+
confidence: params.confidence,
|
|
847
|
+
requestId: params.requestId,
|
|
848
|
+
since: params.since,
|
|
849
|
+
until: params.until,
|
|
850
|
+
});
|
|
851
|
+
return lafsSuccess(result, 'token.mutate');
|
|
852
|
+
}
|
|
853
|
+
// Default: record
|
|
854
|
+
const result = await recordTokenExchange(projectRoot, {
|
|
855
|
+
provider: params.provider,
|
|
856
|
+
model: params.model,
|
|
857
|
+
transport: params.transport,
|
|
858
|
+
gateway: params.gateway,
|
|
859
|
+
domain: params.domain,
|
|
860
|
+
operation: params.operationName,
|
|
861
|
+
sessionId: params.sessionId,
|
|
862
|
+
taskId: params.taskId,
|
|
863
|
+
requestId: params.requestId,
|
|
864
|
+
requestPayload: params.requestPayload,
|
|
865
|
+
responsePayload: params.responsePayload,
|
|
866
|
+
metadata: params.metadata,
|
|
867
|
+
});
|
|
868
|
+
return lafsSuccess(result, 'token.mutate');
|
|
869
|
+
},
|
|
870
|
+
'context.inject': async (params) => {
|
|
871
|
+
const projectRoot = getProjectRoot();
|
|
872
|
+
const result = sessionContextInject(params.protocolType, {
|
|
873
|
+
taskId: params.taskId,
|
|
874
|
+
variant: params.variant,
|
|
875
|
+
}, projectRoot);
|
|
876
|
+
if (!result.success) {
|
|
877
|
+
return lafsError(String(result.error?.code ?? 'E_INTERNAL'), result.error?.message ?? 'Unknown error', 'context.inject');
|
|
878
|
+
}
|
|
879
|
+
return lafsSuccess(result.data, 'context.inject');
|
|
880
|
+
},
|
|
881
|
+
'map.mutate': async (params) => {
|
|
882
|
+
const projectRoot = getProjectRoot();
|
|
883
|
+
try {
|
|
884
|
+
const data = await mapCodebase(projectRoot, { focus: params.focus, storeToBrain: true });
|
|
885
|
+
return lafsSuccess(data, 'map.mutate');
|
|
886
|
+
}
|
|
887
|
+
catch (err) {
|
|
888
|
+
return lafsError('E_GENERAL', err instanceof Error ? err.message : String(err), 'map.mutate');
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
'install.global': async (_params) => {
|
|
892
|
+
const { ensureGlobalScaffold, ensureGlobalTemplates } = await import('@cleocode/core/internal');
|
|
893
|
+
const scaffoldResult = await ensureGlobalScaffold();
|
|
894
|
+
const templateResult = await ensureGlobalTemplates();
|
|
895
|
+
return lafsSuccess({ scaffold: scaffoldResult, templates: templateResult }, 'install.global');
|
|
896
|
+
},
|
|
897
|
+
});
|
|
898
|
+
// ---------------------------------------------------------------------------
|
|
899
|
+
// Envelope-to-EngineResult adapter
|
|
900
|
+
//
|
|
901
|
+
// Converts a LafsEnvelope into the minimal EngineResult shape accepted by
|
|
902
|
+
// wrapResult. The error.code is coerced to string since LafsErrorDetail.code
|
|
903
|
+
// is typed as `number | string` but EngineResult.error.code requires string.
|
|
904
|
+
// ---------------------------------------------------------------------------
|
|
905
|
+
/**
|
|
906
|
+
* Convert a LAFS envelope into the minimal EngineResult shape expected by
|
|
907
|
+
* {@link wrapResult}.
|
|
908
|
+
*
|
|
909
|
+
* @param envelope - The LAFS envelope returned by the typed op function.
|
|
910
|
+
* @returns An object compatible with the `EngineResult` type in `_base.ts`.
|
|
911
|
+
*
|
|
912
|
+
* @internal
|
|
913
|
+
*/
|
|
914
|
+
function envelopeToEngineResult(envelope) {
|
|
915
|
+
if (envelope.success) {
|
|
916
|
+
return { success: true, data: envelope.data };
|
|
917
|
+
}
|
|
918
|
+
return {
|
|
919
|
+
success: false,
|
|
920
|
+
error: {
|
|
921
|
+
code: String(envelope.error?.code ?? 'E_INTERNAL'),
|
|
922
|
+
message: envelope.error?.message ?? 'Unknown error',
|
|
923
|
+
},
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
// ---------------------------------------------------------------------------
|
|
927
|
+
// Op sets — validated before dispatch to prevent unsupported-op errors
|
|
928
|
+
// ---------------------------------------------------------------------------
|
|
929
|
+
const QUERY_OPS = new Set([
|
|
930
|
+
'version',
|
|
931
|
+
'health',
|
|
932
|
+
'config.show',
|
|
933
|
+
'config.presets',
|
|
934
|
+
'stats',
|
|
935
|
+
'context',
|
|
936
|
+
'context.pull',
|
|
937
|
+
'runtime',
|
|
938
|
+
'paths',
|
|
939
|
+
'job',
|
|
940
|
+
'dash',
|
|
941
|
+
'log',
|
|
942
|
+
'sequence',
|
|
943
|
+
'help',
|
|
944
|
+
'token',
|
|
945
|
+
'adr.find',
|
|
946
|
+
'adr.show',
|
|
947
|
+
'backup',
|
|
948
|
+
'export',
|
|
949
|
+
'map',
|
|
950
|
+
'roadmap',
|
|
951
|
+
'smoke',
|
|
952
|
+
'smoke.provider',
|
|
953
|
+
'hooks.matrix',
|
|
954
|
+
]);
|
|
955
|
+
const MUTATE_OPS = new Set([
|
|
956
|
+
'init',
|
|
957
|
+
'scaffold-hub',
|
|
958
|
+
'health',
|
|
959
|
+
'config.set',
|
|
960
|
+
'config.set-preset',
|
|
961
|
+
'backup',
|
|
962
|
+
'migrate',
|
|
963
|
+
'cleanup',
|
|
964
|
+
'job.cancel',
|
|
965
|
+
'safestop',
|
|
966
|
+
'inject.generate',
|
|
967
|
+
'adr.sync',
|
|
968
|
+
'import',
|
|
969
|
+
'detect',
|
|
970
|
+
'token',
|
|
971
|
+
'context.inject',
|
|
972
|
+
'map',
|
|
973
|
+
'install.global',
|
|
974
|
+
]);
|
|
975
|
+
// ---------------------------------------------------------------------------
|
|
976
|
+
// Typed handler key maps
|
|
977
|
+
//
|
|
978
|
+
// Some operations have the same name in both query and mutate gateways (e.g.
|
|
979
|
+
// "health", "backup", "map", "token"). The typed handler uses distinct keys
|
|
980
|
+
// for the mutate variants (e.g. "health.mutate", "backup.mutate",
|
|
981
|
+
// "map.mutate", "token.mutate") to avoid key collisions in AdminOps.
|
|
982
|
+
// These maps translate the incoming operation name to the correct handler key.
|
|
983
|
+
// ---------------------------------------------------------------------------
|
|
984
|
+
/** Query gateway: operation name → AdminOps key. Defaults to identity. */
|
|
985
|
+
function queryKey(operation) {
|
|
986
|
+
// All query ops map directly (no suffix needed for query side)
|
|
987
|
+
return operation;
|
|
988
|
+
}
|
|
989
|
+
/** Mutate gateway: operation name → AdminOps key. */
|
|
990
|
+
function mutateKey(operation) {
|
|
991
|
+
// Ops that share a name with their query counterpart use a ".mutate" suffix
|
|
992
|
+
// in the typed handler so AdminOps has distinct keys for each.
|
|
993
|
+
switch (operation) {
|
|
994
|
+
case 'health':
|
|
995
|
+
return 'health.mutate';
|
|
996
|
+
case 'backup':
|
|
997
|
+
return 'backup.mutate';
|
|
998
|
+
case 'map':
|
|
999
|
+
return 'map.mutate';
|
|
1000
|
+
case 'token':
|
|
1001
|
+
return 'token.mutate';
|
|
1002
|
+
default:
|
|
1003
|
+
return operation;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
// ---------------------------------------------------------------------------
|
|
1007
|
+
// AdminHandler — DomainHandler-compatible wrapper for the registry
|
|
1008
|
+
// ---------------------------------------------------------------------------
|
|
1009
|
+
/**
|
|
1010
|
+
* Domain handler for the `admin` domain.
|
|
1011
|
+
*
|
|
1012
|
+
* Delegates all per-op logic to the typed inner handler
|
|
1013
|
+
* `_adminTypedHandler` (a `TypedDomainHandler<AdminOps>`). This
|
|
1014
|
+
* satisfies the registry's `DomainHandler` interface while keeping every
|
|
1015
|
+
* param access fully type-safe via the T1426 Wave D adapter.
|
|
1016
|
+
*/
|
|
1017
|
+
export class AdminHandler {
|
|
1018
|
+
// -----------------------------------------------------------------------
|
|
1019
|
+
// Query
|
|
1020
|
+
// -----------------------------------------------------------------------
|
|
1021
|
+
/**
|
|
1022
|
+
* Execute a read-only admin query operation.
|
|
1023
|
+
*
|
|
1024
|
+
* @param operation - The admin query op name (e.g. 'version', 'health').
|
|
1025
|
+
* @param params - Raw params from the dispatcher (narrowed internally).
|
|
1026
|
+
*/
|
|
1027
|
+
async query(operation, params) {
|
|
1028
|
+
const startTime = Date.now();
|
|
1029
|
+
if (!QUERY_OPS.has(operation)) {
|
|
1030
|
+
return unsupportedOp('query', 'admin', operation, startTime);
|
|
1031
|
+
}
|
|
1032
|
+
// Special case: 'adr.find' returns an envelope with a page property that
|
|
1033
|
+
// the typed handler embeds in data; 'help' also needs raw meta passthrough.
|
|
1034
|
+
// These are handled in the typed handler itself via lafsSuccess.
|
|
1035
|
+
// For 'adr.find' and 'help' we still route through the typed path and
|
|
1036
|
+
// let the wrapResult call handle the envelope.
|
|
1037
|
+
try {
|
|
1038
|
+
// operation is validated above — cast to the typed key is safe.
|
|
1039
|
+
// This is the single documented trust boundary: the registry guarantees
|
|
1040
|
+
// `operation` is a valid admin query op name at this point.
|
|
1041
|
+
const envelope = await typedDispatch(_adminTypedHandler, queryKey(operation), params ?? {});
|
|
1042
|
+
return wrapResult(envelopeToEngineResult(envelope), 'query', 'admin', operation, startTime);
|
|
1043
|
+
}
|
|
1044
|
+
catch (error) {
|
|
1045
|
+
getLogger('domain:admin').error({ gateway: 'query', domain: 'admin', operation, err: error }, error instanceof Error ? error.message : String(error));
|
|
1046
|
+
return handleErrorResult('query', 'admin', operation, error, startTime);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
// -----------------------------------------------------------------------
|
|
1050
|
+
// Mutate
|
|
1051
|
+
// -----------------------------------------------------------------------
|
|
1052
|
+
/**
|
|
1053
|
+
* Execute a state-modifying admin mutation operation.
|
|
1054
|
+
*
|
|
1055
|
+
* @param operation - The admin mutate op name (e.g. 'init', 'backup').
|
|
1056
|
+
* @param params - Raw params from the dispatcher (narrowed internally).
|
|
1057
|
+
*/
|
|
1058
|
+
async mutate(operation, params) {
|
|
1059
|
+
const startTime = Date.now();
|
|
1060
|
+
if (!MUTATE_OPS.has(operation)) {
|
|
1061
|
+
return unsupportedOp('mutate', 'admin', operation, startTime);
|
|
1062
|
+
}
|
|
1063
|
+
// Special cases that need non-standard response shapes.
|
|
1064
|
+
// 'adr.sync' may return a success:false response for validation errors
|
|
1065
|
+
// but we still want the data; handle it after the typed dispatch.
|
|
1066
|
+
try {
|
|
1067
|
+
// operation is validated above — cast to the typed key is safe.
|
|
1068
|
+
// This is the single documented trust boundary: the registry guarantees
|
|
1069
|
+
// `operation` is a valid admin mutate op name at this point.
|
|
1070
|
+
const envelope = await typedDispatch(_adminTypedHandler, mutateKey(operation), params ?? {});
|
|
1071
|
+
// 'adr.sync' validation mode returns success:false with data on failure
|
|
1072
|
+
// The original handler preserved this semantics; we replicate it here.
|
|
1073
|
+
if (operation === 'adr.sync') {
|
|
1074
|
+
// T1434: LafsEnvelope is a discriminated union — `data` only exists
|
|
1075
|
+
// on the success arm. Narrow before reading.
|
|
1076
|
+
const data = (envelope.success ? envelope.data : undefined);
|
|
1077
|
+
if (data && 'valid' in data && !data.valid) {
|
|
1078
|
+
const errors = Array.isArray(data.errors) ? data.errors : [];
|
|
1079
|
+
return {
|
|
1080
|
+
meta: dispatchMeta('mutate', 'admin', operation, startTime),
|
|
1081
|
+
success: false,
|
|
1082
|
+
data,
|
|
1083
|
+
error: {
|
|
1084
|
+
code: 'E_ADR_VALIDATION',
|
|
1085
|
+
message: `${errors.length} ADR validation error(s) found`,
|
|
1086
|
+
},
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
if (data && 'errors' in data && Array.isArray(data.errors) && data.errors.length > 0) {
|
|
1090
|
+
return {
|
|
1091
|
+
meta: dispatchMeta('mutate', 'admin', operation, startTime),
|
|
1092
|
+
success: false,
|
|
1093
|
+
data,
|
|
1094
|
+
error: {
|
|
1095
|
+
code: 'E_ADR_SYNC',
|
|
1096
|
+
message: `${data.errors.length} ADR sync error(s) occurred`,
|
|
1097
|
+
},
|
|
1098
|
+
};
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
return wrapResult(envelopeToEngineResult(envelope), 'mutate', 'admin', operation, startTime);
|
|
1102
|
+
}
|
|
1103
|
+
catch (error) {
|
|
1104
|
+
getLogger('domain:admin').error({ gateway: 'mutate', domain: 'admin', operation, err: error }, error instanceof Error ? error.message : String(error));
|
|
1105
|
+
return handleErrorResult('mutate', 'admin', operation, error, startTime);
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
// -----------------------------------------------------------------------
|
|
1109
|
+
// Supported operations
|
|
1110
|
+
// -----------------------------------------------------------------------
|
|
1111
|
+
/** Declared operations for introspection and validation. */
|
|
1112
|
+
getSupportedOperations() {
|
|
1113
|
+
return {
|
|
1114
|
+
query: [
|
|
1115
|
+
'version',
|
|
1116
|
+
'health',
|
|
1117
|
+
'config.show',
|
|
1118
|
+
'config.presets',
|
|
1119
|
+
'stats',
|
|
1120
|
+
'context',
|
|
1121
|
+
'context.pull',
|
|
1122
|
+
'runtime',
|
|
1123
|
+
'paths',
|
|
1124
|
+
'job',
|
|
1125
|
+
'dash',
|
|
1126
|
+
'log',
|
|
1127
|
+
'sequence',
|
|
1128
|
+
'help',
|
|
1129
|
+
'token',
|
|
1130
|
+
'adr.show',
|
|
1131
|
+
'adr.find',
|
|
1132
|
+
'backup',
|
|
1133
|
+
'export',
|
|
1134
|
+
'map',
|
|
1135
|
+
'roadmap',
|
|
1136
|
+
'smoke',
|
|
1137
|
+
'smoke.provider',
|
|
1138
|
+
'hooks.matrix',
|
|
1139
|
+
],
|
|
1140
|
+
mutate: [
|
|
1141
|
+
'init',
|
|
1142
|
+
'scaffold-hub',
|
|
1143
|
+
'config.set',
|
|
1144
|
+
'config.set-preset',
|
|
1145
|
+
'backup',
|
|
1146
|
+
'migrate',
|
|
1147
|
+
'cleanup',
|
|
1148
|
+
'job.cancel',
|
|
1149
|
+
'safestop',
|
|
1150
|
+
'inject.generate',
|
|
1151
|
+
'install.global',
|
|
1152
|
+
'token',
|
|
1153
|
+
'adr.sync',
|
|
1154
|
+
'health',
|
|
1155
|
+
'context.inject',
|
|
1156
|
+
'import',
|
|
1157
|
+
'detect',
|
|
1158
|
+
'map',
|
|
1159
|
+
],
|
|
1160
|
+
};
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
//# sourceMappingURL=admin.js.map
|