@cleocode/cleo 2026.5.3 → 2026.5.5
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/cli/index.js +122 -100
- package/dist/cli/index.js.map +4 -4
- package/package.json +9 -12
- package/dist/backfill/audit-columns.d.ts +0 -105
- package/dist/backfill/audit-columns.d.ts.map +0 -1
- package/dist/backfill/audit-columns.js +0 -258
- package/dist/backfill/audit-columns.js.map +0 -1
- package/dist/cli/commands/adapter.d.ts +0 -28
- package/dist/cli/commands/adapter.d.ts.map +0 -1
- package/dist/cli/commands/adapter.js +0 -119
- package/dist/cli/commands/adapter.js.map +0 -1
- package/dist/cli/commands/add-batch.d.ts +0 -33
- package/dist/cli/commands/add-batch.d.ts.map +0 -1
- package/dist/cli/commands/add-batch.js +0 -148
- package/dist/cli/commands/add-batch.js.map +0 -1
- package/dist/cli/commands/add.d.ts +0 -162
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js +0 -279
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/admin.d.ts +0 -24
- package/dist/cli/commands/admin.d.ts.map +0 -1
- package/dist/cli/commands/admin.js +0 -283
- package/dist/cli/commands/admin.js.map +0 -1
- package/dist/cli/commands/adr.d.ts +0 -33
- package/dist/cli/commands/adr.d.ts.map +0 -1
- package/dist/cli/commands/adr.js +0 -147
- package/dist/cli/commands/adr.js.map +0 -1
- package/dist/cli/commands/agent-profile-status.d.ts +0 -98
- package/dist/cli/commands/agent-profile-status.d.ts.map +0 -1
- package/dist/cli/commands/agent-profile-status.js +0 -71
- package/dist/cli/commands/agent-profile-status.js.map +0 -1
- package/dist/cli/commands/agent.d.ts +0 -47
- package/dist/cli/commands/agent.d.ts.map +0 -1
- package/dist/cli/commands/agent.js +0 -2976
- package/dist/cli/commands/agent.js.map +0 -1
- package/dist/cli/commands/analyze.d.ts +0 -21
- package/dist/cli/commands/analyze.d.ts.map +0 -1
- package/dist/cli/commands/analyze.js +0 -32
- package/dist/cli/commands/analyze.js.map +0 -1
- package/dist/cli/commands/archive-stats.d.ts +0 -66
- package/dist/cli/commands/archive-stats.d.ts.map +0 -1
- package/dist/cli/commands/archive-stats.js +0 -93
- package/dist/cli/commands/archive-stats.js.map +0 -1
- package/dist/cli/commands/archive.d.ts +0 -42
- package/dist/cli/commands/archive.d.ts.map +0 -1
- package/dist/cli/commands/archive.js +0 -59
- package/dist/cli/commands/archive.js.map +0 -1
- package/dist/cli/commands/audit.d.ts +0 -22
- package/dist/cli/commands/audit.d.ts.map +0 -1
- package/dist/cli/commands/audit.js +0 -137
- package/dist/cli/commands/audit.js.map +0 -1
- package/dist/cli/commands/backfill.d.ts +0 -56
- package/dist/cli/commands/backfill.d.ts.map +0 -1
- package/dist/cli/commands/backfill.js +0 -161
- package/dist/cli/commands/backfill.js.map +0 -1
- package/dist/cli/commands/backup-inspect.d.ts +0 -33
- package/dist/cli/commands/backup-inspect.d.ts.map +0 -1
- package/dist/cli/commands/backup-inspect.js +0 -430
- package/dist/cli/commands/backup-inspect.js.map +0 -1
- package/dist/cli/commands/backup.d.ts +0 -23
- package/dist/cli/commands/backup.d.ts.map +0 -1
- package/dist/cli/commands/backup.js +0 -564
- package/dist/cli/commands/backup.js.map +0 -1
- package/dist/cli/commands/blockers.d.ts +0 -20
- package/dist/cli/commands/blockers.d.ts.map +0 -1
- package/dist/cli/commands/blockers.js +0 -31
- package/dist/cli/commands/blockers.js.map +0 -1
- package/dist/cli/commands/brain.d.ts +0 -37
- package/dist/cli/commands/brain.d.ts.map +0 -1
- package/dist/cli/commands/brain.js +0 -445
- package/dist/cli/commands/brain.js.map +0 -1
- package/dist/cli/commands/briefing.d.ts +0 -52
- package/dist/cli/commands/briefing.d.ts.map +0 -1
- package/dist/cli/commands/briefing.js +0 -69
- package/dist/cli/commands/briefing.js.map +0 -1
- package/dist/cli/commands/bug.d.ts +0 -61
- package/dist/cli/commands/bug.d.ts.map +0 -1
- package/dist/cli/commands/bug.js +0 -198
- package/dist/cli/commands/bug.js.map +0 -1
- package/dist/cli/commands/cancel.d.ts +0 -26
- package/dist/cli/commands/cancel.d.ts.map +0 -1
- package/dist/cli/commands/cancel.js +0 -40
- package/dist/cli/commands/cancel.js.map +0 -1
- package/dist/cli/commands/cant.d.ts +0 -13
- package/dist/cli/commands/cant.d.ts.map +0 -1
- package/dist/cli/commands/cant.js +0 -245
- package/dist/cli/commands/cant.js.map +0 -1
- package/dist/cli/commands/chain.d.ts +0 -24
- package/dist/cli/commands/chain.d.ts.map +0 -1
- package/dist/cli/commands/chain.js +0 -116
- package/dist/cli/commands/chain.js.map +0 -1
- package/dist/cli/commands/check.d.ts +0 -18
- package/dist/cli/commands/check.d.ts.map +0 -1
- package/dist/cli/commands/check.js +0 -280
- package/dist/cli/commands/check.js.map +0 -1
- package/dist/cli/commands/checkpoint.d.ts +0 -27
- package/dist/cli/commands/checkpoint.d.ts.map +0 -1
- package/dist/cli/commands/checkpoint.js +0 -105
- package/dist/cli/commands/checkpoint.js.map +0 -1
- package/dist/cli/commands/claim.d.ts +0 -35
- package/dist/cli/commands/claim.d.ts.map +0 -1
- package/dist/cli/commands/claim.js +0 -35
- package/dist/cli/commands/claim.js.map +0 -1
- package/dist/cli/commands/code.d.ts +0 -22
- package/dist/cli/commands/code.d.ts.map +0 -1
- package/dist/cli/commands/code.js +0 -161
- package/dist/cli/commands/code.js.map +0 -1
- package/dist/cli/commands/complete.d.ts +0 -58
- package/dist/cli/commands/complete.d.ts.map +0 -1
- package/dist/cli/commands/complete.js +0 -83
- package/dist/cli/commands/complete.js.map +0 -1
- package/dist/cli/commands/complexity.d.ts +0 -13
- package/dist/cli/commands/complexity.d.ts.map +0 -1
- package/dist/cli/commands/complexity.js +0 -32
- package/dist/cli/commands/complexity.js.map +0 -1
- package/dist/cli/commands/compliance.d.ts +0 -27
- package/dist/cli/commands/compliance.d.ts.map +0 -1
- package/dist/cli/commands/compliance.js +0 -233
- package/dist/cli/commands/compliance.js.map +0 -1
- package/dist/cli/commands/conduit.d.ts +0 -28
- package/dist/cli/commands/conduit.d.ts.map +0 -1
- package/dist/cli/commands/conduit.js +0 -279
- package/dist/cli/commands/conduit.js.map +0 -1
- package/dist/cli/commands/config.d.ts +0 -25
- package/dist/cli/commands/config.d.ts.map +0 -1
- package/dist/cli/commands/config.js +0 -132
- package/dist/cli/commands/config.js.map +0 -1
- package/dist/cli/commands/consensus.d.ts +0 -21
- package/dist/cli/commands/consensus.d.ts.map +0 -1
- package/dist/cli/commands/consensus.js +0 -100
- package/dist/cli/commands/consensus.js.map +0 -1
- package/dist/cli/commands/context.d.ts +0 -19
- package/dist/cli/commands/context.d.ts.map +0 -1
- package/dist/cli/commands/context.js +0 -111
- package/dist/cli/commands/context.js.map +0 -1
- package/dist/cli/commands/contribution.d.ts +0 -21
- package/dist/cli/commands/contribution.d.ts.map +0 -1
- package/dist/cli/commands/contribution.js +0 -90
- package/dist/cli/commands/contribution.js.map +0 -1
- package/dist/cli/commands/current.d.ts +0 -18
- package/dist/cli/commands/current.d.ts.map +0 -1
- package/dist/cli/commands/current.js +0 -28
- package/dist/cli/commands/current.js.map +0 -1
- package/dist/cli/commands/daemon.d.ts +0 -36
- package/dist/cli/commands/daemon.d.ts.map +0 -1
- package/dist/cli/commands/daemon.js +0 -223
- package/dist/cli/commands/daemon.js.map +0 -1
- package/dist/cli/commands/dash.d.ts +0 -23
- package/dist/cli/commands/dash.d.ts.map +0 -1
- package/dist/cli/commands/dash.js +0 -38
- package/dist/cli/commands/dash.js.map +0 -1
- package/dist/cli/commands/decomposition.d.ts +0 -13
- package/dist/cli/commands/decomposition.d.ts.map +0 -1
- package/dist/cli/commands/decomposition.js +0 -92
- package/dist/cli/commands/decomposition.js.map +0 -1
- package/dist/cli/commands/delete.d.ts +0 -29
- package/dist/cli/commands/delete.d.ts.map +0 -1
- package/dist/cli/commands/delete.js +0 -55
- package/dist/cli/commands/delete.js.map +0 -1
- package/dist/cli/commands/deps.d.ts +0 -45
- package/dist/cli/commands/deps.d.ts.map +0 -1
- package/dist/cli/commands/deps.js +0 -170
- package/dist/cli/commands/deps.js.map +0 -1
- package/dist/cli/commands/detect-drift.d.ts +0 -23
- package/dist/cli/commands/detect-drift.d.ts.map +0 -1
- package/dist/cli/commands/detect-drift.js +0 -440
- package/dist/cli/commands/detect-drift.js.map +0 -1
- package/dist/cli/commands/detect.d.ts +0 -3
- package/dist/cli/commands/detect.d.ts.map +0 -1
- package/dist/cli/commands/detect.js +0 -14
- package/dist/cli/commands/detect.js.map +0 -1
- package/dist/cli/commands/diagnostics.d.ts +0 -19
- package/dist/cli/commands/diagnostics.d.ts.map +0 -1
- package/dist/cli/commands/diagnostics.js +0 -109
- package/dist/cli/commands/diagnostics.js.map +0 -1
- package/dist/cli/commands/docs.d.ts +0 -25
- package/dist/cli/commands/docs.d.ts.map +0 -1
- package/dist/cli/commands/docs.js +0 -798
- package/dist/cli/commands/docs.js.map +0 -1
- package/dist/cli/commands/doctor-projects.d.ts +0 -101
- package/dist/cli/commands/doctor-projects.d.ts.map +0 -1
- package/dist/cli/commands/doctor-projects.js +0 -188
- package/dist/cli/commands/doctor-projects.js.map +0 -1
- package/dist/cli/commands/doctor.d.ts +0 -66
- package/dist/cli/commands/doctor.d.ts.map +0 -1
- package/dist/cli/commands/doctor.js +0 -178
- package/dist/cli/commands/doctor.js.map +0 -1
- package/dist/cli/commands/dynamic.d.ts +0 -15
- package/dist/cli/commands/dynamic.d.ts.map +0 -1
- package/dist/cli/commands/dynamic.js +0 -21
- package/dist/cli/commands/dynamic.js.map +0 -1
- package/dist/cli/commands/exists.d.ts +0 -13
- package/dist/cli/commands/exists.d.ts.map +0 -1
- package/dist/cli/commands/exists.js +0 -40
- package/dist/cli/commands/exists.js.map +0 -1
- package/dist/cli/commands/export-tasks.d.ts +0 -46
- package/dist/cli/commands/export-tasks.d.ts.map +0 -1
- package/dist/cli/commands/export-tasks.js +0 -81
- package/dist/cli/commands/export-tasks.js.map +0 -1
- package/dist/cli/commands/export.d.ts +0 -35
- package/dist/cli/commands/export.d.ts.map +0 -1
- package/dist/cli/commands/export.js +0 -68
- package/dist/cli/commands/export.js.map +0 -1
- package/dist/cli/commands/find.d.ts +0 -54
- package/dist/cli/commands/find.d.ts.map +0 -1
- package/dist/cli/commands/find.js +0 -92
- package/dist/cli/commands/find.js.map +0 -1
- package/dist/cli/commands/gc.d.ts +0 -25
- package/dist/cli/commands/gc.d.ts.map +0 -1
- package/dist/cli/commands/gc.js +0 -165
- package/dist/cli/commands/gc.js.map +0 -1
- package/dist/cli/commands/generate-changelog.d.ts +0 -30
- package/dist/cli/commands/generate-changelog.d.ts.map +0 -1
- package/dist/cli/commands/generate-changelog.js +0 -270
- package/dist/cli/commands/generate-changelog.js.map +0 -1
- package/dist/cli/commands/grade.d.ts +0 -13
- package/dist/cli/commands/grade.d.ts.map +0 -1
- package/dist/cli/commands/grade.js +0 -27
- package/dist/cli/commands/grade.js.map +0 -1
- package/dist/cli/commands/history.d.ts +0 -13
- package/dist/cli/commands/history.d.ts.map +0 -1
- package/dist/cli/commands/history.js +0 -65
- package/dist/cli/commands/history.js.map +0 -1
- package/dist/cli/commands/import-tasks.d.ts +0 -60
- package/dist/cli/commands/import-tasks.d.ts.map +0 -1
- package/dist/cli/commands/import-tasks.js +0 -83
- package/dist/cli/commands/import-tasks.js.map +0 -1
- package/dist/cli/commands/import.d.ts +0 -42
- package/dist/cli/commands/import.d.ts.map +0 -1
- package/dist/cli/commands/import.js +0 -64
- package/dist/cli/commands/import.js.map +0 -1
- package/dist/cli/commands/init.d.ts +0 -65
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/init.js +0 -122
- package/dist/cli/commands/init.js.map +0 -1
- package/dist/cli/commands/inject.d.ts +0 -41
- package/dist/cli/commands/inject.d.ts.map +0 -1
- package/dist/cli/commands/inject.js +0 -56
- package/dist/cli/commands/inject.js.map +0 -1
- package/dist/cli/commands/install-global.d.ts +0 -48
- package/dist/cli/commands/install-global.d.ts.map +0 -1
- package/dist/cli/commands/install-global.js +0 -104
- package/dist/cli/commands/install-global.js.map +0 -1
- package/dist/cli/commands/intelligence.d.ts +0 -21
- package/dist/cli/commands/intelligence.d.ts.map +0 -1
- package/dist/cli/commands/intelligence.js +0 -145
- package/dist/cli/commands/intelligence.js.map +0 -1
- package/dist/cli/commands/issue.d.ts +0 -23
- package/dist/cli/commands/issue.d.ts.map +0 -1
- package/dist/cli/commands/issue.js +0 -152
- package/dist/cli/commands/issue.js.map +0 -1
- package/dist/cli/commands/labels.d.ts +0 -21
- package/dist/cli/commands/labels.d.ts.map +0 -1
- package/dist/cli/commands/labels.js +0 -65
- package/dist/cli/commands/labels.js.map +0 -1
- package/dist/cli/commands/lifecycle.d.ts +0 -25
- package/dist/cli/commands/lifecycle.d.ts.map +0 -1
- package/dist/cli/commands/lifecycle.js +0 -221
- package/dist/cli/commands/lifecycle.js.map +0 -1
- package/dist/cli/commands/list.d.ts +0 -28
- package/dist/cli/commands/list.d.ts.map +0 -1
- package/dist/cli/commands/list.js +0 -81
- package/dist/cli/commands/list.js.map +0 -1
- package/dist/cli/commands/log.d.ts +0 -36
- package/dist/cli/commands/log.d.ts.map +0 -1
- package/dist/cli/commands/log.js +0 -50
- package/dist/cli/commands/log.js.map +0 -1
- package/dist/cli/commands/manifest.d.ts +0 -15
- package/dist/cli/commands/manifest.d.ts.map +0 -1
- package/dist/cli/commands/manifest.js +0 -334
- package/dist/cli/commands/manifest.js.map +0 -1
- package/dist/cli/commands/map.d.ts +0 -25
- package/dist/cli/commands/map.d.ts.map +0 -1
- package/dist/cli/commands/map.js +0 -37
- package/dist/cli/commands/map.js.map +0 -1
- package/dist/cli/commands/memory.d.ts +0 -48
- package/dist/cli/commands/memory.d.ts.map +0 -1
- package/dist/cli/commands/memory.js +0 -2439
- package/dist/cli/commands/memory.js.map +0 -1
- package/dist/cli/commands/migrate-claude-mem.d.ts +0 -23
- package/dist/cli/commands/migrate-claude-mem.d.ts.map +0 -1
- package/dist/cli/commands/migrate-claude-mem.js +0 -181
- package/dist/cli/commands/migrate-claude-mem.js.map +0 -1
- package/dist/cli/commands/next.d.ts +0 -27
- package/dist/cli/commands/next.d.ts.map +0 -1
- package/dist/cli/commands/next.js +0 -40
- package/dist/cli/commands/next.js.map +0 -1
- package/dist/cli/commands/nexus.d.ts +0 -15
- package/dist/cli/commands/nexus.d.ts.map +0 -1
- package/dist/cli/commands/nexus.js +0 -3377
- package/dist/cli/commands/nexus.js.map +0 -1
- package/dist/cli/commands/ops.d.ts +0 -23
- package/dist/cli/commands/ops.d.ts.map +0 -1
- package/dist/cli/commands/ops.js +0 -35
- package/dist/cli/commands/ops.js.map +0 -1
- package/dist/cli/commands/orchestrate.d.ts +0 -48
- package/dist/cli/commands/orchestrate.d.ts.map +0 -1
- package/dist/cli/commands/orchestrate.js +0 -774
- package/dist/cli/commands/orchestrate.js.map +0 -1
- package/dist/cli/commands/otel.d.ts +0 -30
- package/dist/cli/commands/otel.d.ts.map +0 -1
- package/dist/cli/commands/otel.js +0 -193
- package/dist/cli/commands/otel.js.map +0 -1
- package/dist/cli/commands/phase.d.ts +0 -29
- package/dist/cli/commands/phase.d.ts.map +0 -1
- package/dist/cli/commands/phase.js +0 -189
- package/dist/cli/commands/phase.js.map +0 -1
- package/dist/cli/commands/pivot.d.ts +0 -34
- package/dist/cli/commands/pivot.d.ts.map +0 -1
- package/dist/cli/commands/pivot.js +0 -50
- package/dist/cli/commands/pivot.js.map +0 -1
- package/dist/cli/commands/plan.d.ts +0 -17
- package/dist/cli/commands/plan.d.ts.map +0 -1
- package/dist/cli/commands/plan.js +0 -27
- package/dist/cli/commands/plan.js.map +0 -1
- package/dist/cli/commands/playbook.d.ts +0 -26
- package/dist/cli/commands/playbook.d.ts.map +0 -1
- package/dist/cli/commands/playbook.js +0 -220
- package/dist/cli/commands/playbook.js.map +0 -1
- package/dist/cli/commands/promote.d.ts +0 -19
- package/dist/cli/commands/promote.d.ts.map +0 -1
- package/dist/cli/commands/promote.js +0 -27
- package/dist/cli/commands/promote.js.map +0 -1
- package/dist/cli/commands/provider.d.ts +0 -23
- package/dist/cli/commands/provider.d.ts.map +0 -1
- package/dist/cli/commands/provider.js +0 -168
- package/dist/cli/commands/provider.js.map +0 -1
- package/dist/cli/commands/reason.d.ts +0 -18
- package/dist/cli/commands/reason.d.ts.map +0 -1
- package/dist/cli/commands/reason.js +0 -102
- package/dist/cli/commands/reason.js.map +0 -1
- package/dist/cli/commands/reconcile.d.ts +0 -35
- package/dist/cli/commands/reconcile.d.ts.map +0 -1
- package/dist/cli/commands/reconcile.js +0 -102
- package/dist/cli/commands/reconcile.js.map +0 -1
- package/dist/cli/commands/refresh-memory.d.ts +0 -16
- package/dist/cli/commands/refresh-memory.d.ts.map +0 -1
- package/dist/cli/commands/refresh-memory.js +0 -34
- package/dist/cli/commands/refresh-memory.js.map +0 -1
- package/dist/cli/commands/relates.d.ts +0 -19
- package/dist/cli/commands/relates.d.ts.map +0 -1
- package/dist/cli/commands/relates.js +0 -129
- package/dist/cli/commands/relates.js.map +0 -1
- package/dist/cli/commands/release.d.ts +0 -27
- package/dist/cli/commands/release.d.ts.map +0 -1
- package/dist/cli/commands/release.js +0 -300
- package/dist/cli/commands/release.js.map +0 -1
- package/dist/cli/commands/remote.d.ts +0 -49
- package/dist/cli/commands/remote.d.ts.map +0 -1
- package/dist/cli/commands/remote.js +0 -265
- package/dist/cli/commands/remote.js.map +0 -1
- package/dist/cli/commands/reorder.d.ts +0 -31
- package/dist/cli/commands/reorder.d.ts.map +0 -1
- package/dist/cli/commands/reorder.js +0 -57
- package/dist/cli/commands/reorder.js.map +0 -1
- package/dist/cli/commands/reparent.d.ts +0 -27
- package/dist/cli/commands/reparent.d.ts.map +0 -1
- package/dist/cli/commands/reparent.js +0 -36
- package/dist/cli/commands/reparent.js.map +0 -1
- package/dist/cli/commands/req.d.ts +0 -37
- package/dist/cli/commands/req.d.ts.map +0 -1
- package/dist/cli/commands/req.js +0 -121
- package/dist/cli/commands/req.js.map +0 -1
- package/dist/cli/commands/research.d.ts +0 -25
- package/dist/cli/commands/research.d.ts.map +0 -1
- package/dist/cli/commands/research.js +0 -327
- package/dist/cli/commands/research.js.map +0 -1
- package/dist/cli/commands/restore.d.ts +0 -64
- package/dist/cli/commands/restore.d.ts.map +0 -1
- package/dist/cli/commands/restore.js +0 -539
- package/dist/cli/commands/restore.js.map +0 -1
- package/dist/cli/commands/revert.d.ts +0 -79
- package/dist/cli/commands/revert.d.ts.map +0 -1
- package/dist/cli/commands/revert.js +0 -300
- package/dist/cli/commands/revert.js.map +0 -1
- package/dist/cli/commands/roadmap.d.ts +0 -29
- package/dist/cli/commands/roadmap.d.ts.map +0 -1
- package/dist/cli/commands/roadmap.js +0 -43
- package/dist/cli/commands/roadmap.js.map +0 -1
- package/dist/cli/commands/safestop.d.ts +0 -41
- package/dist/cli/commands/safestop.d.ts.map +0 -1
- package/dist/cli/commands/safestop.js +0 -62
- package/dist/cli/commands/safestop.js.map +0 -1
- package/dist/cli/commands/schema.d.ts +0 -44
- package/dist/cli/commands/schema.d.ts.map +0 -1
- package/dist/cli/commands/schema.js +0 -177
- package/dist/cli/commands/schema.js.map +0 -1
- package/dist/cli/commands/self-update.d.ts +0 -81
- package/dist/cli/commands/self-update.d.ts.map +0 -1
- package/dist/cli/commands/self-update.js +0 -483
- package/dist/cli/commands/self-update.js.map +0 -1
- package/dist/cli/commands/sentient.d.ts +0 -44
- package/dist/cli/commands/sentient.d.ts.map +0 -1
- package/dist/cli/commands/sentient.js +0 -687
- package/dist/cli/commands/sentient.js.map +0 -1
- package/dist/cli/commands/sequence.d.ts +0 -15
- package/dist/cli/commands/sequence.d.ts.map +0 -1
- package/dist/cli/commands/sequence.js +0 -68
- package/dist/cli/commands/sequence.js.map +0 -1
- package/dist/cli/commands/session.d.ts +0 -32
- package/dist/cli/commands/session.d.ts.map +0 -1
- package/dist/cli/commands/session.js +0 -583
- package/dist/cli/commands/session.js.map +0 -1
- package/dist/cli/commands/show.d.ts +0 -21
- package/dist/cli/commands/show.d.ts.map +0 -1
- package/dist/cli/commands/show.js +0 -37
- package/dist/cli/commands/show.js.map +0 -1
- package/dist/cli/commands/skills.d.ts +0 -31
- package/dist/cli/commands/skills.d.ts.map +0 -1
- package/dist/cli/commands/skills.js +0 -303
- package/dist/cli/commands/skills.js.map +0 -1
- package/dist/cli/commands/snapshot.d.ts +0 -17
- package/dist/cli/commands/snapshot.d.ts.map +0 -1
- package/dist/cli/commands/snapshot.js +0 -95
- package/dist/cli/commands/snapshot.js.map +0 -1
- package/dist/cli/commands/start.d.ts +0 -21
- package/dist/cli/commands/start.d.ts.map +0 -1
- package/dist/cli/commands/start.js +0 -32
- package/dist/cli/commands/start.js.map +0 -1
- package/dist/cli/commands/stats.d.ts +0 -30
- package/dist/cli/commands/stats.d.ts.map +0 -1
- package/dist/cli/commands/stats.js +0 -71
- package/dist/cli/commands/stats.js.map +0 -1
- package/dist/cli/commands/sticky.d.ts +0 -23
- package/dist/cli/commands/sticky.d.ts.map +0 -1
- package/dist/cli/commands/sticky.js +0 -315
- package/dist/cli/commands/sticky.js.map +0 -1
- package/dist/cli/commands/stop.d.ts +0 -15
- package/dist/cli/commands/stop.d.ts.map +0 -1
- package/dist/cli/commands/stop.js +0 -25
- package/dist/cli/commands/stop.js.map +0 -1
- package/dist/cli/commands/sync.d.ts +0 -25
- package/dist/cli/commands/sync.d.ts.map +0 -1
- package/dist/cli/commands/sync.js +0 -125
- package/dist/cli/commands/sync.js.map +0 -1
- package/dist/cli/commands/testing.d.ts +0 -22
- package/dist/cli/commands/testing.d.ts.map +0 -1
- package/dist/cli/commands/testing.js +0 -111
- package/dist/cli/commands/testing.js.map +0 -1
- package/dist/cli/commands/token.d.ts +0 -22
- package/dist/cli/commands/token.d.ts.map +0 -1
- package/dist/cli/commands/token.js +0 -197
- package/dist/cli/commands/token.js.map +0 -1
- package/dist/cli/commands/transcript.d.ts +0 -32
- package/dist/cli/commands/transcript.d.ts.map +0 -1
- package/dist/cli/commands/transcript.js +0 -526
- package/dist/cli/commands/transcript.js.map +0 -1
- package/dist/cli/commands/update.d.ts +0 -164
- package/dist/cli/commands/update.d.ts.map +0 -1
- package/dist/cli/commands/update.js +0 -234
- package/dist/cli/commands/update.js.map +0 -1
- package/dist/cli/commands/upgrade.d.ts +0 -76
- package/dist/cli/commands/upgrade.d.ts.map +0 -1
- package/dist/cli/commands/upgrade.js +0 -154
- package/dist/cli/commands/upgrade.js.map +0 -1
- package/dist/cli/commands/verify.d.ts +0 -83
- package/dist/cli/commands/verify.d.ts.map +0 -1
- package/dist/cli/commands/verify.js +0 -108
- package/dist/cli/commands/verify.js.map +0 -1
- package/dist/cli/commands/web.d.ts +0 -27
- package/dist/cli/commands/web.d.ts.map +0 -1
- package/dist/cli/commands/web.js +0 -414
- package/dist/cli/commands/web.js.map +0 -1
- package/dist/cli/field-context.d.ts +0 -32
- package/dist/cli/field-context.d.ts.map +0 -1
- package/dist/cli/field-context.js +0 -47
- package/dist/cli/field-context.js.map +0 -1
- package/dist/cli/format-context.d.ts +0 -32
- package/dist/cli/format-context.d.ts.map +0 -1
- package/dist/cli/format-context.js +0 -50
- package/dist/cli/format-context.js.map +0 -1
- package/dist/cli/help-renderer.d.ts +0 -40
- package/dist/cli/help-renderer.d.ts.map +0 -1
- package/dist/cli/help-renderer.js +0 -325
- package/dist/cli/help-renderer.js.map +0 -1
- package/dist/cli/index.d.ts +0 -14
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/infer-files-via-gitnexus.d.ts +0 -12
- package/dist/cli/infer-files-via-gitnexus.d.ts.map +0 -1
- package/dist/cli/infer-files-via-gitnexus.js +0 -12
- package/dist/cli/infer-files-via-gitnexus.js.map +0 -1
- package/dist/cli/lib/did-you-mean.d.ts +0 -30
- package/dist/cli/lib/did-you-mean.d.ts.map +0 -1
- package/dist/cli/lib/did-you-mean.js +0 -63
- package/dist/cli/lib/did-you-mean.js.map +0 -1
- package/dist/cli/lib/registry-args.d.ts +0 -36
- package/dist/cli/lib/registry-args.d.ts.map +0 -1
- package/dist/cli/lib/registry-args.js +0 -37
- package/dist/cli/lib/registry-args.js.map +0 -1
- package/dist/cli/lib/subcommand-guard.d.ts +0 -45
- package/dist/cli/lib/subcommand-guard.d.ts.map +0 -1
- package/dist/cli/lib/subcommand-guard.js +0 -55
- package/dist/cli/lib/subcommand-guard.js.map +0 -1
- package/dist/cli/logger-bootstrap.d.ts +0 -6
- package/dist/cli/logger-bootstrap.d.ts.map +0 -1
- package/dist/cli/logger-bootstrap.js +0 -10
- package/dist/cli/logger-bootstrap.js.map +0 -1
- package/dist/cli/middleware/output-format.d.ts +0 -30
- package/dist/cli/middleware/output-format.d.ts.map +0 -1
- package/dist/cli/middleware/output-format.js +0 -35
- package/dist/cli/middleware/output-format.js.map +0 -1
- package/dist/cli/paths.d.ts +0 -85
- package/dist/cli/paths.d.ts.map +0 -1
- package/dist/cli/paths.js +0 -108
- package/dist/cli/paths.js.map +0 -1
- package/dist/cli/progress.d.ts +0 -89
- package/dist/cli/progress.d.ts.map +0 -1
- package/dist/cli/progress.js +0 -185
- package/dist/cli/progress.js.map +0 -1
- package/dist/cli/renderers/colors.d.ts +0 -32
- package/dist/cli/renderers/colors.d.ts.map +0 -1
- package/dist/cli/renderers/colors.js +0 -141
- package/dist/cli/renderers/colors.js.map +0 -1
- package/dist/cli/renderers/error.d.ts +0 -13
- package/dist/cli/renderers/error.d.ts.map +0 -1
- package/dist/cli/renderers/error.js +0 -42
- package/dist/cli/renderers/error.js.map +0 -1
- package/dist/cli/renderers/index.d.ts +0 -90
- package/dist/cli/renderers/index.d.ts.map +0 -1
- package/dist/cli/renderers/index.js +0 -268
- package/dist/cli/renderers/index.js.map +0 -1
- package/dist/cli/renderers/lafs-validator.d.ts +0 -91
- package/dist/cli/renderers/lafs-validator.d.ts.map +0 -1
- package/dist/cli/renderers/lafs-validator.js +0 -176
- package/dist/cli/renderers/lafs-validator.js.map +0 -1
- package/dist/cli/renderers/normalizer.d.ts +0 -21
- package/dist/cli/renderers/normalizer.d.ts.map +0 -1
- package/dist/cli/renderers/normalizer.js +0 -106
- package/dist/cli/renderers/normalizer.js.map +0 -1
- package/dist/cli/renderers/system.d.ts +0 -110
- package/dist/cli/renderers/system.d.ts.map +0 -1
- package/dist/cli/renderers/system.js +0 -662
- package/dist/cli/renderers/system.js.map +0 -1
- package/dist/cli/renderers/tasks.d.ts +0 -28
- package/dist/cli/renderers/tasks.d.ts.map +0 -1
- package/dist/cli/renderers/tasks.js +0 -306
- package/dist/cli/renderers/tasks.js.map +0 -1
- package/dist/cli/tree-context.d.ts +0 -53
- package/dist/cli/tree-context.d.ts.map +0 -1
- package/dist/cli/tree-context.js +0 -43
- package/dist/cli/tree-context.js.map +0 -1
- package/dist/dispatch/adapters/cli.d.ts +0 -67
- package/dist/dispatch/adapters/cli.d.ts.map +0 -1
- package/dist/dispatch/adapters/cli.js +0 -331
- package/dist/dispatch/adapters/cli.js.map +0 -1
- package/dist/dispatch/adapters/typed.d.ts +0 -362
- package/dist/dispatch/adapters/typed.d.ts.map +0 -1
- package/dist/dispatch/adapters/typed.js +0 -278
- package/dist/dispatch/adapters/typed.js.map +0 -1
- package/dist/dispatch/context/session-context.d.ts +0 -108
- package/dist/dispatch/context/session-context.d.ts.map +0 -1
- package/dist/dispatch/context/session-context.js +0 -111
- package/dist/dispatch/context/session-context.js.map +0 -1
- package/dist/dispatch/dispatcher.d.ts +0 -37
- package/dist/dispatch/dispatcher.d.ts.map +0 -1
- package/dist/dispatch/dispatcher.js +0 -172
- package/dist/dispatch/dispatcher.js.map +0 -1
- package/dist/dispatch/domains/_base.d.ts +0 -104
- package/dist/dispatch/domains/_base.d.ts.map +0 -1
- package/dist/dispatch/domains/_base.js +0 -147
- package/dist/dispatch/domains/_base.js.map +0 -1
- package/dist/dispatch/domains/_meta.d.ts +0 -23
- package/dist/dispatch/domains/_meta.d.ts.map +0 -1
- package/dist/dispatch/domains/_meta.js +0 -25
- package/dist/dispatch/domains/_meta.js.map +0 -1
- package/dist/dispatch/domains/_routing.d.ts +0 -8
- package/dist/dispatch/domains/_routing.d.ts.map +0 -1
- package/dist/dispatch/domains/_routing.js +0 -20
- package/dist/dispatch/domains/_routing.js.map +0 -1
- package/dist/dispatch/domains/admin/smoke-provider.d.ts +0 -54
- package/dist/dispatch/domains/admin/smoke-provider.d.ts.map +0 -1
- package/dist/dispatch/domains/admin/smoke-provider.js +0 -309
- package/dist/dispatch/domains/admin/smoke-provider.js.map +0 -1
- package/dist/dispatch/domains/admin.d.ts +0 -51
- package/dist/dispatch/domains/admin.d.ts.map +0 -1
- package/dist/dispatch/domains/admin.js +0 -1163
- package/dist/dispatch/domains/admin.js.map +0 -1
- package/dist/dispatch/domains/check/canon.d.ts +0 -65
- package/dist/dispatch/domains/check/canon.d.ts.map +0 -1
- package/dist/dispatch/domains/check/canon.js +0 -193
- package/dist/dispatch/domains/check/canon.js.map +0 -1
- package/dist/dispatch/domains/check.d.ts +0 -37
- package/dist/dispatch/domains/check.d.ts.map +0 -1
- package/dist/dispatch/domains/check.js +0 -562
- package/dist/dispatch/domains/check.js.map +0 -1
- package/dist/dispatch/domains/conduit.d.ts +0 -61
- package/dist/dispatch/domains/conduit.d.ts.map +0 -1
- package/dist/dispatch/domains/conduit.js +0 -609
- package/dist/dispatch/domains/conduit.js.map +0 -1
- package/dist/dispatch/domains/diagnostics.d.ts +0 -25
- package/dist/dispatch/domains/diagnostics.d.ts.map +0 -1
- package/dist/dispatch/domains/diagnostics.js +0 -82
- package/dist/dispatch/domains/diagnostics.js.map +0 -1
- package/dist/dispatch/domains/docs.d.ts +0 -63
- package/dist/dispatch/domains/docs.d.ts.map +0 -1
- package/dist/dispatch/domains/docs.js +0 -539
- package/dist/dispatch/domains/docs.js.map +0 -1
- package/dist/dispatch/domains/index.d.ts +0 -33
- package/dist/dispatch/domains/index.d.ts.map +0 -1
- package/dist/dispatch/domains/index.js +0 -58
- package/dist/dispatch/domains/index.js.map +0 -1
- package/dist/dispatch/domains/intelligence.d.ts +0 -26
- package/dist/dispatch/domains/intelligence.d.ts.map +0 -1
- package/dist/dispatch/domains/intelligence.js +0 -154
- package/dist/dispatch/domains/intelligence.js.map +0 -1
- package/dist/dispatch/domains/ivtr.d.ts +0 -182
- package/dist/dispatch/domains/ivtr.d.ts.map +0 -1
- package/dist/dispatch/domains/ivtr.js +0 -430
- package/dist/dispatch/domains/ivtr.js.map +0 -1
- package/dist/dispatch/domains/memory.d.ts +0 -22
- package/dist/dispatch/domains/memory.d.ts.map +0 -1
- package/dist/dispatch/domains/memory.js +0 -1281
- package/dist/dispatch/domains/memory.js.map +0 -1
- package/dist/dispatch/domains/nexus.d.ts +0 -78
- package/dist/dispatch/domains/nexus.d.ts.map +0 -1
- package/dist/dispatch/domains/nexus.js +0 -938
- package/dist/dispatch/domains/nexus.js.map +0 -1
- package/dist/dispatch/domains/orchestrate.d.ts +0 -307
- package/dist/dispatch/domains/orchestrate.d.ts.map +0 -1
- package/dist/dispatch/domains/orchestrate.js +0 -986
- package/dist/dispatch/domains/orchestrate.js.map +0 -1
- package/dist/dispatch/domains/pipeline.d.ts +0 -276
- package/dist/dispatch/domains/pipeline.d.ts.map +0 -1
- package/dist/dispatch/domains/pipeline.js +0 -689
- package/dist/dispatch/domains/pipeline.js.map +0 -1
- package/dist/dispatch/domains/playbook.d.ts +0 -131
- package/dist/dispatch/domains/playbook.d.ts.map +0 -1
- package/dist/dispatch/domains/playbook.js +0 -633
- package/dist/dispatch/domains/playbook.js.map +0 -1
- package/dist/dispatch/domains/release.d.ts +0 -97
- package/dist/dispatch/domains/release.d.ts.map +0 -1
- package/dist/dispatch/domains/release.js +0 -177
- package/dist/dispatch/domains/release.js.map +0 -1
- package/dist/dispatch/domains/sentient.d.ts +0 -60
- package/dist/dispatch/domains/sentient.d.ts.map +0 -1
- package/dist/dispatch/domains/sentient.js +0 -270
- package/dist/dispatch/domains/sentient.js.map +0 -1
- package/dist/dispatch/domains/session.d.ts +0 -49
- package/dist/dispatch/domains/session.d.ts.map +0 -1
- package/dist/dispatch/domains/session.js +0 -459
- package/dist/dispatch/domains/session.js.map +0 -1
- package/dist/dispatch/domains/sticky.d.ts +0 -82
- package/dist/dispatch/domains/sticky.d.ts.map +0 -1
- package/dist/dispatch/domains/sticky.js +0 -287
- package/dist/dispatch/domains/sticky.js.map +0 -1
- package/dist/dispatch/domains/tasks.d.ts +0 -58
- package/dist/dispatch/domains/tasks.d.ts.map +0 -1
- package/dist/dispatch/domains/tasks.js +0 -497
- package/dist/dispatch/domains/tasks.js.map +0 -1
- package/dist/dispatch/domains/tools.d.ts +0 -37
- package/dist/dispatch/domains/tools.d.ts.map +0 -1
- package/dist/dispatch/domains/tools.js +0 -481
- package/dist/dispatch/domains/tools.js.map +0 -1
- package/dist/dispatch/engines/_error.d.ts +0 -114
- package/dist/dispatch/engines/_error.d.ts.map +0 -1
- package/dist/dispatch/engines/_error.js +0 -290
- package/dist/dispatch/engines/_error.js.map +0 -1
- package/dist/dispatch/engines/admin-engine.d.ts +0 -386
- package/dist/dispatch/engines/admin-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/admin-engine.js +0 -270
- package/dist/dispatch/engines/admin-engine.js.map +0 -1
- package/dist/dispatch/engines/code-engine.d.ts +0 -14
- package/dist/dispatch/engines/code-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/code-engine.js +0 -14
- package/dist/dispatch/engines/code-engine.js.map +0 -1
- package/dist/dispatch/engines/codebase-map-engine.d.ts +0 -31
- package/dist/dispatch/engines/codebase-map-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/codebase-map-engine.js +0 -43
- package/dist/dispatch/engines/codebase-map-engine.js.map +0 -1
- package/dist/dispatch/engines/config-engine.d.ts +0 -14
- package/dist/dispatch/engines/config-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/config-engine.js +0 -14
- package/dist/dispatch/engines/config-engine.js.map +0 -1
- package/dist/dispatch/engines/diagnostics-engine.d.ts +0 -13
- package/dist/dispatch/engines/diagnostics-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/diagnostics-engine.js +0 -12
- package/dist/dispatch/engines/diagnostics-engine.js.map +0 -1
- package/dist/dispatch/engines/hooks-engine.d.ts +0 -13
- package/dist/dispatch/engines/hooks-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/hooks-engine.js +0 -12
- package/dist/dispatch/engines/hooks-engine.js.map +0 -1
- package/dist/dispatch/engines/init-engine.d.ts +0 -14
- package/dist/dispatch/engines/init-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/init-engine.js +0 -14
- package/dist/dispatch/engines/init-engine.js.map +0 -1
- package/dist/dispatch/engines/lifecycle-engine.d.ts +0 -13
- package/dist/dispatch/engines/lifecycle-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/lifecycle-engine.js +0 -12
- package/dist/dispatch/engines/lifecycle-engine.js.map +0 -1
- package/dist/dispatch/engines/memory-engine.d.ts +0 -10
- package/dist/dispatch/engines/memory-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/memory-engine.js +0 -10
- package/dist/dispatch/engines/memory-engine.js.map +0 -1
- package/dist/dispatch/engines/nexus-engine.d.ts +0 -603
- package/dist/dispatch/engines/nexus-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/nexus-engine.js +0 -1438
- package/dist/dispatch/engines/nexus-engine.js.map +0 -1
- package/dist/dispatch/engines/orchestrate-engine.d.ts +0 -252
- package/dist/dispatch/engines/orchestrate-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/orchestrate-engine.js +0 -1526
- package/dist/dispatch/engines/orchestrate-engine.js.map +0 -1
- package/dist/dispatch/engines/pipeline-engine.d.ts +0 -13
- package/dist/dispatch/engines/pipeline-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/pipeline-engine.js +0 -12
- package/dist/dispatch/engines/pipeline-engine.js.map +0 -1
- package/dist/dispatch/engines/release-engine.d.ts +0 -13
- package/dist/dispatch/engines/release-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/release-engine.js +0 -13
- package/dist/dispatch/engines/release-engine.js.map +0 -1
- package/dist/dispatch/engines/session-engine.d.ts +0 -15
- package/dist/dispatch/engines/session-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/session-engine.js +0 -12
- package/dist/dispatch/engines/session-engine.js.map +0 -1
- package/dist/dispatch/engines/sticky-engine.d.ts +0 -13
- package/dist/dispatch/engines/sticky-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/sticky-engine.js +0 -12
- package/dist/dispatch/engines/sticky-engine.js.map +0 -1
- package/dist/dispatch/engines/system-engine.d.ts +0 -543
- package/dist/dispatch/engines/system-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/system-engine.js +0 -1278
- package/dist/dispatch/engines/system-engine.js.map +0 -1
- package/dist/dispatch/engines/task-engine.d.ts +0 -1161
- package/dist/dispatch/engines/task-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/task-engine.js +0 -1599
- package/dist/dispatch/engines/task-engine.js.map +0 -1
- package/dist/dispatch/engines/template-parser.d.ts +0 -85
- package/dist/dispatch/engines/template-parser.d.ts.map +0 -1
- package/dist/dispatch/engines/template-parser.js +0 -114
- package/dist/dispatch/engines/template-parser.js.map +0 -1
- package/dist/dispatch/engines/tools-engine.d.ts +0 -13
- package/dist/dispatch/engines/tools-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/tools-engine.js +0 -12
- package/dist/dispatch/engines/tools-engine.js.map +0 -1
- package/dist/dispatch/engines/validate-engine.d.ts +0 -13
- package/dist/dispatch/engines/validate-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/validate-engine.js +0 -13
- package/dist/dispatch/engines/validate-engine.js.map +0 -1
- package/dist/dispatch/index.d.ts +0 -20
- package/dist/dispatch/index.d.ts.map +0 -1
- package/dist/dispatch/index.js +0 -19
- package/dist/dispatch/index.js.map +0 -1
- package/dist/dispatch/lib/background-jobs.d.ts +0 -162
- package/dist/dispatch/lib/background-jobs.d.ts.map +0 -1
- package/dist/dispatch/lib/background-jobs.js +0 -360
- package/dist/dispatch/lib/background-jobs.js.map +0 -1
- package/dist/dispatch/lib/budget.d.ts +0 -36
- package/dist/dispatch/lib/budget.d.ts.map +0 -1
- package/dist/dispatch/lib/budget.js +0 -109
- package/dist/dispatch/lib/budget.js.map +0 -1
- package/dist/dispatch/lib/capability-matrix.d.ts +0 -11
- package/dist/dispatch/lib/capability-matrix.d.ts.map +0 -1
- package/dist/dispatch/lib/capability-matrix.js +0 -10
- package/dist/dispatch/lib/capability-matrix.js.map +0 -1
- package/dist/dispatch/lib/config-loader.d.ts +0 -42
- package/dist/dispatch/lib/config-loader.d.ts.map +0 -1
- package/dist/dispatch/lib/config-loader.js +0 -218
- package/dist/dispatch/lib/config-loader.js.map +0 -1
- package/dist/dispatch/lib/config.d.ts +0 -11
- package/dist/dispatch/lib/config.d.ts.map +0 -1
- package/dist/dispatch/lib/config.js +0 -10
- package/dist/dispatch/lib/config.js.map +0 -1
- package/dist/dispatch/lib/defaults.d.ts +0 -115
- package/dist/dispatch/lib/defaults.d.ts.map +0 -1
- package/dist/dispatch/lib/defaults.js +0 -61
- package/dist/dispatch/lib/defaults.js.map +0 -1
- package/dist/dispatch/lib/engine.d.ts +0 -17
- package/dist/dispatch/lib/engine.d.ts.map +0 -1
- package/dist/dispatch/lib/engine.js +0 -36
- package/dist/dispatch/lib/engine.js.map +0 -1
- package/dist/dispatch/lib/exit-codes.d.ts +0 -35
- package/dist/dispatch/lib/exit-codes.d.ts.map +0 -1
- package/dist/dispatch/lib/exit-codes.js +0 -60
- package/dist/dispatch/lib/exit-codes.js.map +0 -1
- package/dist/dispatch/lib/gateway-meta.d.ts +0 -37
- package/dist/dispatch/lib/gateway-meta.d.ts.map +0 -1
- package/dist/dispatch/lib/gateway-meta.js +0 -50
- package/dist/dispatch/lib/gateway-meta.js.map +0 -1
- package/dist/dispatch/lib/job-manager-accessor.d.ts +0 -9
- package/dist/dispatch/lib/job-manager-accessor.d.ts.map +0 -1
- package/dist/dispatch/lib/job-manager-accessor.js +0 -13
- package/dist/dispatch/lib/job-manager-accessor.js.map +0 -1
- package/dist/dispatch/lib/meta.d.ts +0 -26
- package/dist/dispatch/lib/meta.d.ts.map +0 -1
- package/dist/dispatch/lib/meta.js +0 -37
- package/dist/dispatch/lib/meta.js.map +0 -1
- package/dist/dispatch/lib/param-utils.d.ts +0 -11
- package/dist/dispatch/lib/param-utils.d.ts.map +0 -1
- package/dist/dispatch/lib/param-utils.js +0 -10
- package/dist/dispatch/lib/param-utils.js.map +0 -1
- package/dist/dispatch/lib/projections.d.ts +0 -56
- package/dist/dispatch/lib/projections.d.ts.map +0 -1
- package/dist/dispatch/lib/projections.js +0 -65
- package/dist/dispatch/lib/projections.js.map +0 -1
- package/dist/dispatch/lib/proto-envelope.d.ts +0 -56
- package/dist/dispatch/lib/proto-envelope.d.ts.map +0 -1
- package/dist/dispatch/lib/proto-envelope.js +0 -17
- package/dist/dispatch/lib/proto-envelope.js.map +0 -1
- package/dist/dispatch/lib/schema-utils.d.ts +0 -39
- package/dist/dispatch/lib/schema-utils.d.ts.map +0 -1
- package/dist/dispatch/lib/schema-utils.js +0 -88
- package/dist/dispatch/lib/schema-utils.js.map +0 -1
- package/dist/dispatch/lib/security.d.ts +0 -11
- package/dist/dispatch/lib/security.d.ts.map +0 -1
- package/dist/dispatch/lib/security.js +0 -10
- package/dist/dispatch/lib/security.js.map +0 -1
- package/dist/dispatch/middleware/audit.d.ts +0 -23
- package/dist/dispatch/middleware/audit.d.ts.map +0 -1
- package/dist/dispatch/middleware/audit.js +0 -169
- package/dist/dispatch/middleware/audit.js.map +0 -1
- package/dist/dispatch/middleware/field-filter.d.ts +0 -25
- package/dist/dispatch/middleware/field-filter.d.ts.map +0 -1
- package/dist/dispatch/middleware/field-filter.js +0 -70
- package/dist/dispatch/middleware/field-filter.js.map +0 -1
- package/dist/dispatch/middleware/pipeline.d.ts +0 -33
- package/dist/dispatch/middleware/pipeline.d.ts.map +0 -1
- package/dist/dispatch/middleware/pipeline.js +0 -60
- package/dist/dispatch/middleware/pipeline.js.map +0 -1
- package/dist/dispatch/middleware/projection.d.ts +0 -35
- package/dist/dispatch/middleware/projection.d.ts.map +0 -1
- package/dist/dispatch/middleware/projection.js +0 -146
- package/dist/dispatch/middleware/projection.js.map +0 -1
- package/dist/dispatch/middleware/protocol-enforcement.d.ts +0 -30
- package/dist/dispatch/middleware/protocol-enforcement.d.ts.map +0 -1
- package/dist/dispatch/middleware/protocol-enforcement.js +0 -56
- package/dist/dispatch/middleware/protocol-enforcement.js.map +0 -1
- package/dist/dispatch/middleware/rate-limiter.d.ts +0 -72
- package/dist/dispatch/middleware/rate-limiter.d.ts.map +0 -1
- package/dist/dispatch/middleware/rate-limiter.js +0 -127
- package/dist/dispatch/middleware/rate-limiter.js.map +0 -1
- package/dist/dispatch/middleware/sanitizer.d.ts +0 -24
- package/dist/dispatch/middleware/sanitizer.d.ts.map +0 -1
- package/dist/dispatch/middleware/sanitizer.js +0 -56
- package/dist/dispatch/middleware/sanitizer.js.map +0 -1
- package/dist/dispatch/middleware/session-resolver.d.ts +0 -26
- package/dist/dispatch/middleware/session-resolver.d.ts.map +0 -1
- package/dist/dispatch/middleware/session-resolver.js +0 -65
- package/dist/dispatch/middleware/session-resolver.js.map +0 -1
- package/dist/dispatch/middleware/telemetry.d.ts +0 -21
- package/dist/dispatch/middleware/telemetry.d.ts.map +0 -1
- package/dist/dispatch/middleware/telemetry.js +0 -50
- package/dist/dispatch/middleware/telemetry.js.map +0 -1
- package/dist/dispatch/middleware/verification-gates.d.ts +0 -22
- package/dist/dispatch/middleware/verification-gates.d.ts.map +0 -1
- package/dist/dispatch/middleware/verification-gates.js +0 -59
- package/dist/dispatch/middleware/verification-gates.js.map +0 -1
- package/dist/dispatch/registry.d.ts +0 -91
- package/dist/dispatch/registry.d.ts.map +0 -1
- package/dist/dispatch/registry.js +0 -6430
- package/dist/dispatch/registry.js.map +0 -1
- package/dist/dispatch/types.d.ts +0 -150
- package/dist/dispatch/types.d.ts.map +0 -1
- package/dist/dispatch/types.js +0 -38
- package/dist/dispatch/types.js.map +0 -1
- package/dist/migrations/2026-04-25-t991-parent-link-repair.d.ts +0 -88
- package/dist/migrations/2026-04-25-t991-parent-link-repair.d.ts.map +0 -1
- package/dist/migrations/2026-04-25-t991-parent-link-repair.js +0 -76
- package/dist/migrations/2026-04-25-t991-parent-link-repair.js.map +0 -1
|
@@ -1,986 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Orchestrate Domain Handler (Dispatch Layer)
|
|
3
|
-
*
|
|
4
|
-
* Handles multi-agent orchestration: dependency analysis, wave computation,
|
|
5
|
-
* spawn readiness, parallel coordination, and orchestration context.
|
|
6
|
-
* All operations delegate to native engine functions.
|
|
7
|
-
*
|
|
8
|
-
* Wave 7a additions (T379):
|
|
9
|
-
* - orchestrate.classify (T408) — prompt-based team routing stub
|
|
10
|
-
* - orchestrate.fanout (T409) — Promise.allSettled spawn wrapper
|
|
11
|
-
* - orchestrate.fanout.status (T415) — fanout status stub
|
|
12
|
-
* - orchestrate.analyze mode="parallel-safety" (T410) — dep-graph grouping
|
|
13
|
-
*
|
|
14
|
-
* Type-safe dispatch via OpsFromCore<typeof coreOps> per ADR-058.
|
|
15
|
-
* Param extraction inferred by coreOps — zero `params?.x as Type` casts.
|
|
16
|
-
*
|
|
17
|
-
* @epic T4820
|
|
18
|
-
* @epic T377
|
|
19
|
-
* @task T1538 — OpsFromCore migration per ADR-058
|
|
20
|
-
*/
|
|
21
|
-
import { getLogger, getProjectRoot, instantiateTessera, listTesseraTemplates, paginate, pivotTask, showTessera, } from '@cleocode/core/internal';
|
|
22
|
-
import { CLEO_DIR_NAME, WORKFLOWS_SUBDIR } from '../../cli/paths.js';
|
|
23
|
-
import { orchestrateAnalyze, orchestrateBootstrap, orchestrateContext, orchestrateHandoff, orchestrateNext, orchestrateParallelEnd, orchestrateParallelStart, orchestratePlan, orchestrateReady, orchestrateSpawn, orchestrateSpawnExecute, orchestrateStartup, orchestrateStatus, orchestrateUnblockOpportunities, orchestrateValidate, orchestrateWaves, sessionContextInject, sessionEnd, sessionStatus, } from '../lib/engine.js';
|
|
24
|
-
import { errorResult, getListParams, handleErrorResult, wrapResult } from './_base.js';
|
|
25
|
-
import { dispatchMeta } from './_meta.js';
|
|
26
|
-
import { routeByParam } from './_routing.js';
|
|
27
|
-
import { IvtrHandler } from './ivtr.js';
|
|
28
|
-
import { acquirePlaybookDb, listPendingApprovalsForDispatch, lookupApprovalByTokenForDispatch, } from './playbook.js';
|
|
29
|
-
/** Shared IvtrHandler instance for ivtr.* sub-operations (T811). */
|
|
30
|
-
const ivtrHandler = new IvtrHandler();
|
|
31
|
-
/** Maximum number of fanout manifest entries retained in memory. */
|
|
32
|
-
const FANOUT_MANIFEST_MAX_SIZE = 64;
|
|
33
|
-
const fanoutManifestStore = new Map();
|
|
34
|
-
/**
|
|
35
|
-
* Evict oldest entries when the manifest store exceeds the size cap.
|
|
36
|
-
*/
|
|
37
|
-
function evictFanoutManifest() {
|
|
38
|
-
while (fanoutManifestStore.size > FANOUT_MANIFEST_MAX_SIZE) {
|
|
39
|
-
const oldest = fanoutManifestStore.keys().next().value;
|
|
40
|
-
if (oldest !== undefined)
|
|
41
|
-
fanoutManifestStore.delete(oldest);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// ---------------------------------------------------------------------------
|
|
45
|
-
// Core op wrappers — single-param functions for OpsFromCore inference
|
|
46
|
-
// ---------------------------------------------------------------------------
|
|
47
|
-
async function orchestrateStatusOp(params) {
|
|
48
|
-
return orchestrateStatus(params.epicId, getProjectRoot());
|
|
49
|
-
}
|
|
50
|
-
async function orchestrateNextOp(params) {
|
|
51
|
-
return orchestrateNext(params.epicId, getProjectRoot());
|
|
52
|
-
}
|
|
53
|
-
async function orchestrateReadyOp(params) {
|
|
54
|
-
return orchestrateReady(params.epicId, getProjectRoot());
|
|
55
|
-
}
|
|
56
|
-
async function orchestrateAnalyzeOp(params) {
|
|
57
|
-
if (params.mode === 'parallel-safety') {
|
|
58
|
-
return orchestrateAnalyzeParallelSafety(params.taskIds ?? [], getProjectRoot());
|
|
59
|
-
}
|
|
60
|
-
return orchestrateAnalyze(params.epicId, getProjectRoot(), params.mode);
|
|
61
|
-
}
|
|
62
|
-
async function orchestrateClassifyOp(params) {
|
|
63
|
-
return orchestrateClassify(params.request, params.context, getProjectRoot());
|
|
64
|
-
}
|
|
65
|
-
function orchestrateFanoutStatusOp(params) {
|
|
66
|
-
const entry = fanoutManifestStore.get(params.manifestEntryId);
|
|
67
|
-
if (!entry) {
|
|
68
|
-
return Promise.resolve({
|
|
69
|
-
success: true,
|
|
70
|
-
data: {
|
|
71
|
-
manifestEntryId: params.manifestEntryId,
|
|
72
|
-
pending: [],
|
|
73
|
-
running: [],
|
|
74
|
-
complete: [],
|
|
75
|
-
failed: [],
|
|
76
|
-
found: false,
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
const spawned = entry.results.filter((r) => r.status === 'spawned').map((r) => r.taskId);
|
|
81
|
-
const failed = entry.results.filter((r) => r.status === 'failed').map((r) => r.taskId);
|
|
82
|
-
return Promise.resolve({
|
|
83
|
-
success: true,
|
|
84
|
-
data: {
|
|
85
|
-
manifestEntryId: params.manifestEntryId,
|
|
86
|
-
pending: [],
|
|
87
|
-
running: spawned,
|
|
88
|
-
complete: [],
|
|
89
|
-
failed,
|
|
90
|
-
found: true,
|
|
91
|
-
completedAt: entry.completedAt,
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
async function orchestrateContextOp(params) {
|
|
96
|
-
return orchestrateContext(params.epicId, getProjectRoot());
|
|
97
|
-
}
|
|
98
|
-
async function orchestrateWavesOp(params) {
|
|
99
|
-
return orchestrateWaves(params.epicId, getProjectRoot());
|
|
100
|
-
}
|
|
101
|
-
async function orchestratePlanOp(params) {
|
|
102
|
-
return orchestratePlan({
|
|
103
|
-
epicId: params.epicId,
|
|
104
|
-
projectRoot: getProjectRoot(),
|
|
105
|
-
preferTier: params.preferTier,
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
async function orchestrateBootstrapOp(params) {
|
|
109
|
-
return orchestrateBootstrap(getProjectRoot(), { speed: params.speed });
|
|
110
|
-
}
|
|
111
|
-
async function orchestrateUnblockOp(_params) {
|
|
112
|
-
return orchestrateUnblockOpportunities(getProjectRoot());
|
|
113
|
-
}
|
|
114
|
-
async function orchestrateTesseraListOp(params) {
|
|
115
|
-
return Promise.resolve({ success: true, data: params }); // sentinel — handled inline
|
|
116
|
-
}
|
|
117
|
-
async function orchestrateIvtrStatusOp(params) {
|
|
118
|
-
return ivtrHandler.query('status', params);
|
|
119
|
-
}
|
|
120
|
-
async function orchestratePendingOp(_params) {
|
|
121
|
-
return Promise.resolve({ success: true, data: {} }); // sentinel — handled inline
|
|
122
|
-
}
|
|
123
|
-
async function orchestrateStartOp(params) {
|
|
124
|
-
return orchestrateStartup(params.epicId, getProjectRoot());
|
|
125
|
-
}
|
|
126
|
-
async function orchestrateSpawnOp(params) {
|
|
127
|
-
return orchestrateSpawn(params.taskId, params.protocolType, getProjectRoot(), params.tier, params.noWorktree);
|
|
128
|
-
}
|
|
129
|
-
async function orchestrateHandoffOp(params) {
|
|
130
|
-
return orchestrateHandoff({
|
|
131
|
-
taskId: params.taskId,
|
|
132
|
-
protocolType: params.protocolType,
|
|
133
|
-
note: params.note,
|
|
134
|
-
nextAction: params.nextAction,
|
|
135
|
-
variant: params.variant,
|
|
136
|
-
tier: params.tier,
|
|
137
|
-
idempotencyKey: params.idempotencyKey,
|
|
138
|
-
},
|
|
139
|
-
// Inject cleo session ops to avoid core→cleo import cycle (T1570 ADR-057)
|
|
140
|
-
{ sessionStatus, sessionEnd, sessionContextInject }, getProjectRoot());
|
|
141
|
-
}
|
|
142
|
-
async function orchestrateSpawnExecuteOp(params) {
|
|
143
|
-
return orchestrateSpawnExecute(params.taskId, params.adapterId, params.protocolType, getProjectRoot(), params.tier);
|
|
144
|
-
}
|
|
145
|
-
async function orchestrateValidateOp(params) {
|
|
146
|
-
return orchestrateValidate(params.taskId, getProjectRoot());
|
|
147
|
-
}
|
|
148
|
-
async function orchestratePivotOp(params) {
|
|
149
|
-
try {
|
|
150
|
-
const result = await pivotTask(params.fromTaskId, params.toTaskId, {
|
|
151
|
-
reason: params.reason,
|
|
152
|
-
blocksFrom: params.blocksFrom,
|
|
153
|
-
projectRoot: getProjectRoot(),
|
|
154
|
-
});
|
|
155
|
-
return { success: true, data: result };
|
|
156
|
-
}
|
|
157
|
-
catch (err) {
|
|
158
|
-
const code = err?.code;
|
|
159
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
160
|
-
// Map ExitCode 38 (ACTIVE_TASK_REQUIRED) → spec-named E_NOT_ACTIVE
|
|
161
|
-
let errorCode = 'E_GENERAL';
|
|
162
|
-
if (code === 2)
|
|
163
|
-
errorCode = 'E_INVALID_INPUT';
|
|
164
|
-
else if (code === 4)
|
|
165
|
-
errorCode = 'E_NOT_FOUND';
|
|
166
|
-
else if (code === 6)
|
|
167
|
-
errorCode = 'E_VALIDATION';
|
|
168
|
-
else if (code === 38)
|
|
169
|
-
errorCode = 'E_NOT_ACTIVE';
|
|
170
|
-
return {
|
|
171
|
-
success: false,
|
|
172
|
-
error: { code: errorCode, message },
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
async function orchestrateWorktreeCompleteOp(params) {
|
|
177
|
-
return handleWorktreeComplete(params.taskId, getProjectRoot());
|
|
178
|
-
}
|
|
179
|
-
async function orchestrateWorktreeCleanupOp(params) {
|
|
180
|
-
return handleWorktreeCleanup(getProjectRoot(), params.taskIds);
|
|
181
|
-
}
|
|
182
|
-
async function orchestrateWorktreePruneOp(params) {
|
|
183
|
-
return handleWorktreePrune(getProjectRoot(), params.taskId);
|
|
184
|
-
}
|
|
185
|
-
async function orchestrateParallelOp(params) {
|
|
186
|
-
return Promise.resolve({ success: true, data: params }); // sentinel — handled inline via routeByParam
|
|
187
|
-
}
|
|
188
|
-
async function orchestrateFanoutOp(params) {
|
|
189
|
-
return orchestrateFanoutImpl(params.items, getProjectRoot());
|
|
190
|
-
}
|
|
191
|
-
async function orchestrateTesseraInstantiateOp(params) {
|
|
192
|
-
return Promise.resolve({ success: true, data: params }); // sentinel — handled inline
|
|
193
|
-
}
|
|
194
|
-
async function orchestrateApproveOp(params) {
|
|
195
|
-
return Promise.resolve({ success: true, data: params }); // sentinel — handled inline
|
|
196
|
-
}
|
|
197
|
-
async function orchestrateRejectOp(params) {
|
|
198
|
-
return Promise.resolve({ success: true, data: params }); // sentinel — handled inline
|
|
199
|
-
}
|
|
200
|
-
// ---------------------------------------------------------------------------
|
|
201
|
-
// Core op registry — OpsFromCore inference source
|
|
202
|
-
// ---------------------------------------------------------------------------
|
|
203
|
-
/**
|
|
204
|
-
* Orchestrate operation registry for `OpsFromCore<typeof coreOps>` inference.
|
|
205
|
-
*
|
|
206
|
-
* @task T1538 — orchestrate dispatch OpsFromCore migration
|
|
207
|
-
*/
|
|
208
|
-
const coreOps = {
|
|
209
|
-
status: orchestrateStatusOp,
|
|
210
|
-
next: orchestrateNextOp,
|
|
211
|
-
ready: orchestrateReadyOp,
|
|
212
|
-
analyze: orchestrateAnalyzeOp,
|
|
213
|
-
classify: orchestrateClassifyOp,
|
|
214
|
-
'fanout.status': orchestrateFanoutStatusOp,
|
|
215
|
-
context: orchestrateContextOp,
|
|
216
|
-
waves: orchestrateWavesOp,
|
|
217
|
-
plan: orchestratePlanOp,
|
|
218
|
-
bootstrap: orchestrateBootstrapOp,
|
|
219
|
-
'unblock.opportunities': orchestrateUnblockOp,
|
|
220
|
-
'tessera.list': orchestrateTesseraListOp,
|
|
221
|
-
'ivtr.status': orchestrateIvtrStatusOp,
|
|
222
|
-
pending: orchestratePendingOp,
|
|
223
|
-
start: orchestrateStartOp,
|
|
224
|
-
spawn: orchestrateSpawnOp,
|
|
225
|
-
handoff: orchestrateHandoffOp,
|
|
226
|
-
'spawn.execute': orchestrateSpawnExecuteOp,
|
|
227
|
-
validate: orchestrateValidateOp,
|
|
228
|
-
pivot: orchestratePivotOp,
|
|
229
|
-
'worktree.complete': orchestrateWorktreeCompleteOp,
|
|
230
|
-
'worktree.cleanup': orchestrateWorktreeCleanupOp,
|
|
231
|
-
'worktree.prune': orchestrateWorktreePruneOp,
|
|
232
|
-
parallel: orchestrateParallelOp,
|
|
233
|
-
fanout: orchestrateFanoutOp,
|
|
234
|
-
'tessera.instantiate': orchestrateTesseraInstantiateOp,
|
|
235
|
-
approve: orchestrateApproveOp,
|
|
236
|
-
reject: orchestrateRejectOp,
|
|
237
|
-
};
|
|
238
|
-
// ---------------------------------------------------------------------------
|
|
239
|
-
// OrchestrateHandler
|
|
240
|
-
// ---------------------------------------------------------------------------
|
|
241
|
-
export class OrchestrateHandler {
|
|
242
|
-
// -----------------------------------------------------------------------
|
|
243
|
-
// DomainHandler interface
|
|
244
|
-
// -----------------------------------------------------------------------
|
|
245
|
-
async query(operation, params) {
|
|
246
|
-
const startTime = Date.now();
|
|
247
|
-
try {
|
|
248
|
-
switch (operation) {
|
|
249
|
-
case 'status': {
|
|
250
|
-
const p = { epicId: params?.epicId };
|
|
251
|
-
return wrapResult(await coreOps.status(p), 'query', 'orchestrate', operation, startTime);
|
|
252
|
-
}
|
|
253
|
-
case 'next': {
|
|
254
|
-
if (!params?.epicId)
|
|
255
|
-
return errorResult('query', 'orchestrate', operation, 'E_INVALID_INPUT', 'epicId is required', startTime);
|
|
256
|
-
const p = { epicId: params.epicId };
|
|
257
|
-
return wrapResult(await coreOps.next(p), 'query', 'orchestrate', operation, startTime);
|
|
258
|
-
}
|
|
259
|
-
case 'ready': {
|
|
260
|
-
if (!params?.epicId)
|
|
261
|
-
return errorResult('query', 'orchestrate', operation, 'E_INVALID_INPUT', 'epicId is required', startTime);
|
|
262
|
-
const p = { epicId: params.epicId };
|
|
263
|
-
return wrapResult(await coreOps.ready(p), 'query', 'orchestrate', operation, startTime);
|
|
264
|
-
}
|
|
265
|
-
case 'analyze': {
|
|
266
|
-
const p = {
|
|
267
|
-
epicId: params?.epicId,
|
|
268
|
-
mode: params?.mode,
|
|
269
|
-
taskIds: params?.taskIds,
|
|
270
|
-
};
|
|
271
|
-
return wrapResult(await coreOps.analyze(p), 'query', 'orchestrate', 'analyze', startTime);
|
|
272
|
-
}
|
|
273
|
-
case 'classify': {
|
|
274
|
-
if (!params?.request)
|
|
275
|
-
return errorResult('query', 'orchestrate', operation, 'E_INVALID_INPUT', 'request is required', startTime);
|
|
276
|
-
const p = {
|
|
277
|
-
request: params.request,
|
|
278
|
-
context: params.context,
|
|
279
|
-
};
|
|
280
|
-
return wrapResult(await coreOps.classify(p), 'query', 'orchestrate', operation, startTime);
|
|
281
|
-
}
|
|
282
|
-
case 'fanout.status': {
|
|
283
|
-
if (!params?.manifestEntryId)
|
|
284
|
-
return errorResult('query', 'orchestrate', operation, 'E_INVALID_INPUT', 'manifestEntryId is required', startTime);
|
|
285
|
-
const p = {
|
|
286
|
-
manifestEntryId: params.manifestEntryId,
|
|
287
|
-
};
|
|
288
|
-
const result = await coreOps['fanout.status'](p);
|
|
289
|
-
return {
|
|
290
|
-
meta: dispatchMeta('query', 'orchestrate', operation, startTime),
|
|
291
|
-
success: true,
|
|
292
|
-
data: result.data,
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
case 'context': {
|
|
296
|
-
const p = { epicId: params?.epicId };
|
|
297
|
-
return wrapResult(await coreOps.context(p), 'query', 'orchestrate', operation, startTime);
|
|
298
|
-
}
|
|
299
|
-
case 'waves': {
|
|
300
|
-
if (!params?.epicId)
|
|
301
|
-
return errorResult('query', 'orchestrate', operation, 'E_INVALID_INPUT', 'epicId is required', startTime);
|
|
302
|
-
const p = { epicId: params.epicId };
|
|
303
|
-
return wrapResult(await coreOps.waves(p), 'query', 'orchestrate', operation, startTime);
|
|
304
|
-
}
|
|
305
|
-
case 'plan': {
|
|
306
|
-
if (!params?.epicId)
|
|
307
|
-
return errorResult('query', 'orchestrate', operation, 'E_INVALID_INPUT', 'epicId is required', startTime);
|
|
308
|
-
const preferTierRaw = params.preferTier;
|
|
309
|
-
let preferTier;
|
|
310
|
-
if (preferTierRaw === 0 || preferTierRaw === 1 || preferTierRaw === 2) {
|
|
311
|
-
preferTier = preferTierRaw;
|
|
312
|
-
}
|
|
313
|
-
const p = { epicId: params.epicId, preferTier };
|
|
314
|
-
return wrapResult(await coreOps.plan(p), 'query', 'orchestrate', operation, startTime);
|
|
315
|
-
}
|
|
316
|
-
case 'bootstrap': {
|
|
317
|
-
const p = {
|
|
318
|
-
speed: params?.speed,
|
|
319
|
-
};
|
|
320
|
-
return wrapResult(await coreOps.bootstrap(p), 'query', 'orchestrate', operation, startTime);
|
|
321
|
-
}
|
|
322
|
-
case 'unblock.opportunities':
|
|
323
|
-
return wrapResult(await coreOps['unblock.opportunities']({}), 'query', 'orchestrate', operation, startTime);
|
|
324
|
-
case 'tessera.list': {
|
|
325
|
-
const id = params?.id;
|
|
326
|
-
if (id) {
|
|
327
|
-
const template = showTessera(id);
|
|
328
|
-
if (!template)
|
|
329
|
-
return errorResult('query', 'orchestrate', 'tessera.list', 'E_NOT_FOUND', `Tessera template "${id}" not found`, startTime);
|
|
330
|
-
return {
|
|
331
|
-
meta: dispatchMeta('query', 'orchestrate', 'tessera.list', startTime),
|
|
332
|
-
success: true,
|
|
333
|
-
data: template,
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
const templates = listTesseraTemplates();
|
|
337
|
-
const { limit, offset } = getListParams(params);
|
|
338
|
-
const page = paginate(templates, limit, offset);
|
|
339
|
-
return {
|
|
340
|
-
meta: dispatchMeta('query', 'orchestrate', 'tessera.list', startTime),
|
|
341
|
-
success: true,
|
|
342
|
-
data: {
|
|
343
|
-
templates: page.items,
|
|
344
|
-
count: templates.length,
|
|
345
|
-
total: templates.length,
|
|
346
|
-
filtered: templates.length,
|
|
347
|
-
},
|
|
348
|
-
page: page.page,
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
case 'ivtr.status':
|
|
352
|
-
return ivtrHandler.query('status', params);
|
|
353
|
-
case 'pending':
|
|
354
|
-
return handlePendingApprovals(startTime);
|
|
355
|
-
default:
|
|
356
|
-
return errorResult('query', 'orchestrate', operation, 'E_INVALID_OPERATION', `Unknown orchestrate query: ${operation}`, startTime);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
catch (error) {
|
|
360
|
-
getLogger('domain:orchestrate').error({ gateway: 'query', domain: 'orchestrate', operation, err: error }, error instanceof Error ? error.message : String(error));
|
|
361
|
-
return handleErrorResult('query', 'orchestrate', operation, error, startTime);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
async mutate(operation, params) {
|
|
365
|
-
const startTime = Date.now();
|
|
366
|
-
try {
|
|
367
|
-
switch (operation) {
|
|
368
|
-
case 'start': {
|
|
369
|
-
if (!params?.epicId)
|
|
370
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'epicId is required', startTime);
|
|
371
|
-
const p = { epicId: params.epicId };
|
|
372
|
-
return wrapResult(await coreOps.start(p), 'mutate', 'orchestrate', operation, startTime);
|
|
373
|
-
}
|
|
374
|
-
case 'spawn': {
|
|
375
|
-
if (!params?.taskId)
|
|
376
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'taskId is required', startTime);
|
|
377
|
-
const tierRaw = params.tier;
|
|
378
|
-
const tier = tierRaw === 0 || tierRaw === 1 || tierRaw === 2 ? tierRaw : undefined;
|
|
379
|
-
const p = {
|
|
380
|
-
taskId: params.taskId,
|
|
381
|
-
protocolType: params.protocolType,
|
|
382
|
-
tier,
|
|
383
|
-
noWorktree: params.noWorktree,
|
|
384
|
-
};
|
|
385
|
-
return wrapResult(await coreOps.spawn(p), 'mutate', 'orchestrate', operation, startTime);
|
|
386
|
-
}
|
|
387
|
-
case 'handoff': {
|
|
388
|
-
if (!params?.taskId)
|
|
389
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'taskId is required', startTime);
|
|
390
|
-
if (!params?.protocolType)
|
|
391
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'protocolType is required', startTime);
|
|
392
|
-
const tierRaw = params.tier;
|
|
393
|
-
const tier = tierRaw === 0 || tierRaw === 1 || tierRaw === 2 ? tierRaw : undefined;
|
|
394
|
-
const p = {
|
|
395
|
-
taskId: params.taskId,
|
|
396
|
-
protocolType: params.protocolType,
|
|
397
|
-
note: params.note,
|
|
398
|
-
nextAction: params.nextAction,
|
|
399
|
-
variant: params.variant,
|
|
400
|
-
tier,
|
|
401
|
-
idempotencyKey: params.idempotencyKey,
|
|
402
|
-
};
|
|
403
|
-
return wrapResult(await coreOps.handoff(p), 'mutate', 'orchestrate', operation, startTime);
|
|
404
|
-
}
|
|
405
|
-
case 'spawn.execute': {
|
|
406
|
-
if (!params?.taskId)
|
|
407
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'taskId is required', startTime);
|
|
408
|
-
const tierRaw = params.tier;
|
|
409
|
-
const tier = tierRaw === 0 || tierRaw === 1 || tierRaw === 2 ? tierRaw : undefined;
|
|
410
|
-
const p = {
|
|
411
|
-
taskId: params.taskId,
|
|
412
|
-
adapterId: params.adapterId,
|
|
413
|
-
protocolType: params.protocolType,
|
|
414
|
-
tier,
|
|
415
|
-
};
|
|
416
|
-
return wrapResult(await coreOps['spawn.execute'](p), 'mutate', 'orchestrate', operation, startTime);
|
|
417
|
-
}
|
|
418
|
-
case 'validate': {
|
|
419
|
-
if (!params?.taskId)
|
|
420
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'taskId is required', startTime);
|
|
421
|
-
const p = { taskId: params.taskId };
|
|
422
|
-
return wrapResult(await coreOps.validate(p), 'mutate', 'orchestrate', operation, startTime);
|
|
423
|
-
}
|
|
424
|
-
case 'pivot': {
|
|
425
|
-
if (!params?.fromTaskId)
|
|
426
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'fromTaskId is required', startTime);
|
|
427
|
-
if (!params?.toTaskId)
|
|
428
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'toTaskId is required', startTime);
|
|
429
|
-
if (!params?.reason || typeof params.reason !== 'string' || !params.reason.trim())
|
|
430
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_VALIDATION', 'reason is required (no silent pivots)', startTime);
|
|
431
|
-
const p = {
|
|
432
|
-
fromTaskId: params.fromTaskId,
|
|
433
|
-
toTaskId: params.toTaskId,
|
|
434
|
-
reason: params.reason,
|
|
435
|
-
blocksFrom: params.blocksFrom,
|
|
436
|
-
};
|
|
437
|
-
return wrapResult(await coreOps.pivot(p), 'mutate', 'orchestrate', operation, startTime);
|
|
438
|
-
}
|
|
439
|
-
case 'worktree.complete': {
|
|
440
|
-
if (!params?.taskId)
|
|
441
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'taskId is required', startTime);
|
|
442
|
-
const p = { taskId: params.taskId };
|
|
443
|
-
return wrapResult(await coreOps['worktree.complete'](p), 'mutate', 'orchestrate', operation, startTime);
|
|
444
|
-
}
|
|
445
|
-
case 'worktree.cleanup': {
|
|
446
|
-
const p = {
|
|
447
|
-
taskIds: params?.taskIds,
|
|
448
|
-
};
|
|
449
|
-
return wrapResult(await coreOps['worktree.cleanup'](p), 'mutate', 'orchestrate', operation, startTime);
|
|
450
|
-
}
|
|
451
|
-
case 'worktree.prune': {
|
|
452
|
-
const p = {
|
|
453
|
-
taskId: params?.taskId,
|
|
454
|
-
};
|
|
455
|
-
return wrapResult(await coreOps['worktree.prune'](p), 'mutate', 'orchestrate', operation, startTime);
|
|
456
|
-
}
|
|
457
|
-
case 'parallel': {
|
|
458
|
-
return routeByParam(params, 'action', {
|
|
459
|
-
start: async () => {
|
|
460
|
-
const epicId = params?.epicId;
|
|
461
|
-
const wave = params?.wave;
|
|
462
|
-
if (!epicId)
|
|
463
|
-
return errorResult('mutate', 'orchestrate', 'parallel', 'E_INVALID_INPUT', 'epicId is required', startTime);
|
|
464
|
-
if (wave === undefined || wave === null)
|
|
465
|
-
return errorResult('mutate', 'orchestrate', 'parallel', 'E_INVALID_INPUT', 'wave number is required', startTime);
|
|
466
|
-
return wrapResult(await orchestrateParallelStart(epicId, wave, getProjectRoot()), 'mutate', 'orchestrate', 'parallel', startTime);
|
|
467
|
-
},
|
|
468
|
-
end: async () => {
|
|
469
|
-
const epicId = params?.epicId;
|
|
470
|
-
const wave = params?.wave;
|
|
471
|
-
if (!epicId)
|
|
472
|
-
return errorResult('mutate', 'orchestrate', 'parallel', 'E_INVALID_INPUT', 'epicId is required', startTime);
|
|
473
|
-
if (wave === undefined || wave === null)
|
|
474
|
-
return errorResult('mutate', 'orchestrate', 'parallel', 'E_INVALID_INPUT', 'wave number is required', startTime);
|
|
475
|
-
return wrapResult(await orchestrateParallelEnd(epicId, wave, getProjectRoot()), 'mutate', 'orchestrate', 'parallel', startTime);
|
|
476
|
-
},
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
case 'fanout': {
|
|
480
|
-
const items = params?.items;
|
|
481
|
-
if (!items || !Array.isArray(items) || items.length === 0)
|
|
482
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'items array is required and must be non-empty', startTime);
|
|
483
|
-
const p = { items };
|
|
484
|
-
return wrapResult(await coreOps.fanout(p), 'mutate', 'orchestrate', operation, startTime);
|
|
485
|
-
}
|
|
486
|
-
case 'tessera.instantiate': {
|
|
487
|
-
if (!params?.templateId)
|
|
488
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'templateId is required', startTime);
|
|
489
|
-
if (!params?.epicId)
|
|
490
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_INPUT', 'epicId is required', startTime);
|
|
491
|
-
const template = showTessera(params.templateId);
|
|
492
|
-
if (!template)
|
|
493
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_NOT_FOUND', `Tessera template "${params.templateId}" not found`, startTime);
|
|
494
|
-
const variables = params.variables ?? {};
|
|
495
|
-
const epicId = params.epicId;
|
|
496
|
-
const instance = await instantiateTessera(template, {
|
|
497
|
-
templateId: params.templateId,
|
|
498
|
-
epicId,
|
|
499
|
-
variables: { epicId, ...variables },
|
|
500
|
-
}, getProjectRoot());
|
|
501
|
-
return {
|
|
502
|
-
meta: dispatchMeta('mutate', 'orchestrate', operation, startTime),
|
|
503
|
-
success: true,
|
|
504
|
-
data: instance,
|
|
505
|
-
};
|
|
506
|
-
}
|
|
507
|
-
case 'ivtr.start':
|
|
508
|
-
return ivtrHandler.mutate('start', params);
|
|
509
|
-
case 'ivtr.next':
|
|
510
|
-
return ivtrHandler.mutate('next', params);
|
|
511
|
-
case 'ivtr.release':
|
|
512
|
-
return ivtrHandler.mutate('release', params);
|
|
513
|
-
case 'ivtr.loop-back':
|
|
514
|
-
return ivtrHandler.mutate('loop-back', params);
|
|
515
|
-
case 'approve':
|
|
516
|
-
return handleApproveGate(params, startTime);
|
|
517
|
-
case 'reject':
|
|
518
|
-
return handleRejectGate(params, startTime);
|
|
519
|
-
default:
|
|
520
|
-
return errorResult('mutate', 'orchestrate', operation, 'E_INVALID_OPERATION', `Unknown orchestrate mutation: ${operation}`, startTime);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
catch (error) {
|
|
524
|
-
getLogger('domain:orchestrate').error({ gateway: 'mutate', domain: 'orchestrate', operation, err: error }, error instanceof Error ? error.message : String(error));
|
|
525
|
-
return handleErrorResult('mutate', 'orchestrate', operation, error, startTime);
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
getSupportedOperations() {
|
|
529
|
-
return {
|
|
530
|
-
query: [
|
|
531
|
-
'status',
|
|
532
|
-
'next',
|
|
533
|
-
'ready',
|
|
534
|
-
'analyze',
|
|
535
|
-
'context',
|
|
536
|
-
'waves',
|
|
537
|
-
'plan',
|
|
538
|
-
'bootstrap',
|
|
539
|
-
'unblock.opportunities',
|
|
540
|
-
'tessera.list',
|
|
541
|
-
'classify',
|
|
542
|
-
'fanout.status',
|
|
543
|
-
'ivtr.status',
|
|
544
|
-
'pending',
|
|
545
|
-
],
|
|
546
|
-
mutate: [
|
|
547
|
-
'start',
|
|
548
|
-
'spawn',
|
|
549
|
-
'handoff',
|
|
550
|
-
'spawn.execute',
|
|
551
|
-
'validate',
|
|
552
|
-
'pivot',
|
|
553
|
-
'parallel',
|
|
554
|
-
'tessera.instantiate',
|
|
555
|
-
'fanout',
|
|
556
|
-
'ivtr.start',
|
|
557
|
-
'ivtr.next',
|
|
558
|
-
'ivtr.release',
|
|
559
|
-
'ivtr.loop-back',
|
|
560
|
-
'approve',
|
|
561
|
-
'reject',
|
|
562
|
-
'worktree.complete',
|
|
563
|
-
'worktree.cleanup',
|
|
564
|
-
'worktree.prune',
|
|
565
|
-
],
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
// ---------------------------------------------------------------------------
|
|
570
|
-
// Wave 7a handler functions (T408, T409, T410)
|
|
571
|
-
// ---------------------------------------------------------------------------
|
|
572
|
-
/**
|
|
573
|
-
* T408 — Classify a request against the CANT team registry.
|
|
574
|
-
*
|
|
575
|
-
* @param request - The request text to classify.
|
|
576
|
-
* @param context - Optional additional context.
|
|
577
|
-
* @param projectRoot - Project root directory.
|
|
578
|
-
*/
|
|
579
|
-
async function orchestrateClassify(request, context, projectRoot) {
|
|
580
|
-
try {
|
|
581
|
-
const { getCleoCantWorkflowsDir } = await import('@cleocode/core/internal');
|
|
582
|
-
const { readFileSync, readdirSync, existsSync } = await import('node:fs');
|
|
583
|
-
const { join } = await import('node:path');
|
|
584
|
-
const workflowsDir = getCleoCantWorkflowsDir();
|
|
585
|
-
const combined = `${request} ${context ?? ''}`.toLowerCase();
|
|
586
|
-
const matches = [];
|
|
587
|
-
if (existsSync(workflowsDir)) {
|
|
588
|
-
const files = readdirSync(workflowsDir).filter((f) => f.endsWith('.cant'));
|
|
589
|
-
for (const file of files) {
|
|
590
|
-
try {
|
|
591
|
-
const src = readFileSync(join(workflowsDir, file), 'utf-8');
|
|
592
|
-
const teamMatch = /^team\s+(\S+):/m.exec(src);
|
|
593
|
-
if (!teamMatch)
|
|
594
|
-
continue;
|
|
595
|
-
const teamName = teamMatch[1];
|
|
596
|
-
const cwMatch = /consult-when:\s*["']?(.+?)["']?\s*$/m.exec(src);
|
|
597
|
-
const consultWhen = cwMatch ? cwMatch[1].trim() : '';
|
|
598
|
-
const stagesMatch = /stages:\s*\[([^\]]+)\]/.exec(src);
|
|
599
|
-
const stages = stagesMatch ? stagesMatch[1].split(',').map((s) => s.trim()) : [];
|
|
600
|
-
const hintWords = consultWhen.toLowerCase().split(/\s+/);
|
|
601
|
-
const score = hintWords.filter((w) => combined.includes(w)).length;
|
|
602
|
-
matches.push({ team: teamName, score, consultWhen, stages });
|
|
603
|
-
}
|
|
604
|
-
catch {
|
|
605
|
-
// skip unreadable files
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
const localCantDir = join(projectRoot, CLEO_DIR_NAME, WORKFLOWS_SUBDIR);
|
|
610
|
-
if (existsSync(localCantDir)) {
|
|
611
|
-
const files = readdirSync(localCantDir).filter((f) => f.endsWith('.cant'));
|
|
612
|
-
for (const file of files) {
|
|
613
|
-
try {
|
|
614
|
-
const src = readFileSync(join(localCantDir, file), 'utf-8');
|
|
615
|
-
const teamMatch = /^team\s+(\S+):/m.exec(src);
|
|
616
|
-
if (!teamMatch)
|
|
617
|
-
continue;
|
|
618
|
-
const teamName = teamMatch[1];
|
|
619
|
-
const cwMatch = /consult-when:\s*["']?(.+?)["']?\s*$/m.exec(src);
|
|
620
|
-
const consultWhen = cwMatch ? cwMatch[1].trim() : '';
|
|
621
|
-
const stagesMatch = /stages:\s*\[([^\]]+)\]/.exec(src);
|
|
622
|
-
const stages = stagesMatch ? stagesMatch[1].split(',').map((s) => s.trim()) : [];
|
|
623
|
-
const hintWords = consultWhen.toLowerCase().split(/\s+/);
|
|
624
|
-
const score = hintWords.filter((w) => combined.includes(w)).length;
|
|
625
|
-
matches.push({ team: teamName, score, consultWhen, stages });
|
|
626
|
-
}
|
|
627
|
-
catch {
|
|
628
|
-
// skip
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
if (matches.length === 0) {
|
|
633
|
-
return {
|
|
634
|
-
success: true,
|
|
635
|
-
data: {
|
|
636
|
-
team: null,
|
|
637
|
-
lead: null,
|
|
638
|
-
protocol: null,
|
|
639
|
-
stage: null,
|
|
640
|
-
confidence: 0,
|
|
641
|
-
reasoning: 'No CANT team definitions found. Seed teams.cant in the global workflows dir (W7b runtime enforcement) to enable team routing.',
|
|
642
|
-
},
|
|
643
|
-
};
|
|
644
|
-
}
|
|
645
|
-
matches.sort((a, b) => b.score - a.score);
|
|
646
|
-
const best = matches[0];
|
|
647
|
-
return {
|
|
648
|
-
success: true,
|
|
649
|
-
data: {
|
|
650
|
-
team: best.team,
|
|
651
|
-
lead: null,
|
|
652
|
-
protocol: 'base-subagent',
|
|
653
|
-
stage: best.stages[0] ?? null,
|
|
654
|
-
confidence: best.score > 0 ? 0.5 : 0.1,
|
|
655
|
-
reasoning: best.score > 0
|
|
656
|
-
? `Matched team '${best.team}' via consult-when hint: "${best.consultWhen}"`
|
|
657
|
-
: `No strong match found; defaulting to first registered team '${best.team}'`,
|
|
658
|
-
},
|
|
659
|
-
};
|
|
660
|
-
}
|
|
661
|
-
catch (error) {
|
|
662
|
-
getLogger('domain:orchestrate').error({ operation: 'classify', err: error }, error instanceof Error ? error.message : String(error));
|
|
663
|
-
return {
|
|
664
|
-
success: false,
|
|
665
|
-
error: {
|
|
666
|
-
code: 'E_CLASSIFY_FAILED',
|
|
667
|
-
message: error instanceof Error ? error.message : String(error),
|
|
668
|
-
},
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
/**
|
|
673
|
-
* T409 / T433 — Fan out N spawn requests via Promise.allSettled.
|
|
674
|
-
*/
|
|
675
|
-
async function orchestrateFanoutImpl(items, projectRoot) {
|
|
676
|
-
const manifestEntryId = `fanout-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
677
|
-
try {
|
|
678
|
-
const settled = await Promise.allSettled(items.map(async (item) => {
|
|
679
|
-
const spawnResult = await orchestrateSpawnExecute(item.taskId, undefined, undefined, projectRoot, undefined);
|
|
680
|
-
if (!spawnResult.success) {
|
|
681
|
-
return {
|
|
682
|
-
taskId: item.taskId,
|
|
683
|
-
status: 'failed',
|
|
684
|
-
error: spawnResult.error?.message ?? `Spawn failed for task ${item.taskId}`,
|
|
685
|
-
};
|
|
686
|
-
}
|
|
687
|
-
const data = spawnResult.data;
|
|
688
|
-
return {
|
|
689
|
-
taskId: item.taskId,
|
|
690
|
-
status: 'spawned',
|
|
691
|
-
instanceId: typeof data?.instanceId === 'string' ? data.instanceId : undefined,
|
|
692
|
-
};
|
|
693
|
-
}));
|
|
694
|
-
const results = settled.map((outcome, i) => {
|
|
695
|
-
if (outcome.status === 'fulfilled')
|
|
696
|
-
return outcome.value;
|
|
697
|
-
return {
|
|
698
|
-
taskId: items[i].taskId,
|
|
699
|
-
status: 'failed',
|
|
700
|
-
error: outcome.reason instanceof Error ? outcome.reason.message : String(outcome.reason),
|
|
701
|
-
};
|
|
702
|
-
});
|
|
703
|
-
fanoutManifestStore.set(manifestEntryId, { results, completedAt: new Date().toISOString() });
|
|
704
|
-
evictFanoutManifest();
|
|
705
|
-
return {
|
|
706
|
-
success: true,
|
|
707
|
-
data: {
|
|
708
|
-
manifestEntryId,
|
|
709
|
-
results,
|
|
710
|
-
total: items.length,
|
|
711
|
-
spawned: results.filter((r) => r.status === 'spawned').length,
|
|
712
|
-
failed: results.filter((r) => r.status === 'failed').length,
|
|
713
|
-
},
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
catch (error) {
|
|
717
|
-
getLogger('domain:orchestrate').error({ operation: 'fanout', err: error }, error instanceof Error ? error.message : String(error));
|
|
718
|
-
return {
|
|
719
|
-
success: false,
|
|
720
|
-
error: {
|
|
721
|
-
code: 'E_FANOUT_FAILED',
|
|
722
|
-
message: error instanceof Error ? error.message : String(error),
|
|
723
|
-
},
|
|
724
|
-
};
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
/**
|
|
728
|
-
* T410 — Analyze a list of tasks for parallel safety.
|
|
729
|
-
*/
|
|
730
|
-
async function orchestrateAnalyzeParallelSafety(taskIds, projectRoot) {
|
|
731
|
-
if (taskIds.length === 0) {
|
|
732
|
-
return {
|
|
733
|
-
success: true,
|
|
734
|
-
data: {
|
|
735
|
-
parallelSafe: true,
|
|
736
|
-
groups: [],
|
|
737
|
-
note: 'No tasks provided — trivially parallel-safe',
|
|
738
|
-
},
|
|
739
|
-
};
|
|
740
|
-
}
|
|
741
|
-
try {
|
|
742
|
-
const { getAccessor } = await import('@cleocode/core/internal');
|
|
743
|
-
const accessor = await getAccessor(projectRoot);
|
|
744
|
-
const result = await accessor.queryTasks({});
|
|
745
|
-
const allTasks = result?.tasks ?? [];
|
|
746
|
-
const depMap = new Map();
|
|
747
|
-
for (const t of allTasks) {
|
|
748
|
-
const deps = t.blockers ?? [];
|
|
749
|
-
depMap.set(t.id, deps);
|
|
750
|
-
}
|
|
751
|
-
function transitiveClose(id, visited = new Set()) {
|
|
752
|
-
if (visited.has(id))
|
|
753
|
-
return visited;
|
|
754
|
-
visited.add(id);
|
|
755
|
-
const deps = depMap.get(id) ?? [];
|
|
756
|
-
for (const dep of deps) {
|
|
757
|
-
transitiveClose(dep, visited);
|
|
758
|
-
}
|
|
759
|
-
return visited;
|
|
760
|
-
}
|
|
761
|
-
const closures = new Map();
|
|
762
|
-
for (const id of taskIds) {
|
|
763
|
-
closures.set(id, transitiveClose(id));
|
|
764
|
-
}
|
|
765
|
-
function parallelSafe(a, b) {
|
|
766
|
-
const closureA = closures.get(a) ?? new Set();
|
|
767
|
-
const closureB = closures.get(b) ?? new Set();
|
|
768
|
-
return !closureA.has(b) && !closureB.has(a);
|
|
769
|
-
}
|
|
770
|
-
const groups = [];
|
|
771
|
-
for (const id of taskIds) {
|
|
772
|
-
let placed = false;
|
|
773
|
-
for (const group of groups) {
|
|
774
|
-
if (group.every((member) => parallelSafe(id, member))) {
|
|
775
|
-
group.push(id);
|
|
776
|
-
placed = true;
|
|
777
|
-
break;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
if (!placed) {
|
|
781
|
-
groups.push([id]);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
return {
|
|
785
|
-
success: true,
|
|
786
|
-
data: {
|
|
787
|
-
parallelSafe: groups.length <= 1,
|
|
788
|
-
groups,
|
|
789
|
-
taskCount: taskIds.length,
|
|
790
|
-
groupCount: groups.length,
|
|
791
|
-
},
|
|
792
|
-
};
|
|
793
|
-
}
|
|
794
|
-
catch (error) {
|
|
795
|
-
getLogger('domain:orchestrate').error({ operation: 'analyze/parallel-safety', err: error }, error instanceof Error ? error.message : String(error));
|
|
796
|
-
return {
|
|
797
|
-
success: false,
|
|
798
|
-
error: {
|
|
799
|
-
code: 'E_ANALYZE_FAILED',
|
|
800
|
-
message: error instanceof Error ? error.message : String(error),
|
|
801
|
-
},
|
|
802
|
-
};
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
// ---------------------------------------------------------------------------
|
|
806
|
-
// T1118 L1 — Worktree lifecycle handlers
|
|
807
|
-
// ---------------------------------------------------------------------------
|
|
808
|
-
/**
|
|
809
|
-
* Dispatch handler for `cleo orchestrate worktree.complete`.
|
|
810
|
-
*
|
|
811
|
-
* Per ADR-062 / T1587 / T1601 — uses `git merge --no-ff` rather than
|
|
812
|
-
* cherry-pick so the agent's commit SHAs are preserved in the integration
|
|
813
|
-
* branch's history. Project-agnostic: delegates target-branch resolution to
|
|
814
|
-
* {@link getDefaultBranch} (no hardcoded `main`).
|
|
815
|
-
*
|
|
816
|
-
* @task T1601
|
|
817
|
-
* @adr ADR-062
|
|
818
|
-
*/
|
|
819
|
-
async function handleWorktreeComplete(taskId, projectRoot) {
|
|
820
|
-
try {
|
|
821
|
-
const { completeAgentWorktreeViaMerge } = await import('@cleocode/core/internal');
|
|
822
|
-
const result = completeAgentWorktreeViaMerge(taskId, projectRoot);
|
|
823
|
-
// Surface a non-fatal merge error as a dispatch-level failure so callers
|
|
824
|
-
// can react (rebase conflicts, missing branch, etc.) rather than treating
|
|
825
|
-
// a partial result as success.
|
|
826
|
-
if (!result.merged && result.error) {
|
|
827
|
-
return {
|
|
828
|
-
success: false,
|
|
829
|
-
error: {
|
|
830
|
-
code: 'E_WORKTREE_COMPLETE_FAILED',
|
|
831
|
-
message: result.error,
|
|
832
|
-
},
|
|
833
|
-
};
|
|
834
|
-
}
|
|
835
|
-
return { success: true, data: result };
|
|
836
|
-
}
|
|
837
|
-
catch (error) {
|
|
838
|
-
getLogger('domain:orchestrate').error({ operation: 'worktree.complete', taskId, err: error }, error instanceof Error ? error.message : String(error));
|
|
839
|
-
return {
|
|
840
|
-
success: false,
|
|
841
|
-
error: {
|
|
842
|
-
code: 'E_WORKTREE_COMPLETE_FAILED',
|
|
843
|
-
message: error instanceof Error ? error.message : String(error),
|
|
844
|
-
},
|
|
845
|
-
};
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
async function handleWorktreeCleanup(projectRoot, taskIds) {
|
|
849
|
-
try {
|
|
850
|
-
const { pruneOrphanedWorktrees } = await import('@cleocode/core/internal');
|
|
851
|
-
const activeSet = taskIds ? new Set(taskIds) : undefined;
|
|
852
|
-
const result = pruneOrphanedWorktrees(projectRoot, activeSet);
|
|
853
|
-
return { success: true, data: result };
|
|
854
|
-
}
|
|
855
|
-
catch (error) {
|
|
856
|
-
getLogger('domain:orchestrate').error({ operation: 'worktree.cleanup', err: error }, error instanceof Error ? error.message : String(error));
|
|
857
|
-
return {
|
|
858
|
-
success: false,
|
|
859
|
-
error: {
|
|
860
|
-
code: 'E_WORKTREE_CLEANUP_FAILED',
|
|
861
|
-
message: error instanceof Error ? error.message : String(error),
|
|
862
|
-
},
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
async function handleWorktreePrune(projectRoot, taskId) {
|
|
867
|
-
try {
|
|
868
|
-
const { pruneWorktree, pruneOrphanedWorktrees } = await import('@cleocode/core/internal');
|
|
869
|
-
if (taskId) {
|
|
870
|
-
const result = pruneWorktree(taskId, projectRoot);
|
|
871
|
-
return { success: true, data: result };
|
|
872
|
-
}
|
|
873
|
-
const result = pruneOrphanedWorktrees(projectRoot, undefined);
|
|
874
|
-
return { success: true, data: { ...result, mode: 'bulk' } };
|
|
875
|
-
}
|
|
876
|
-
catch (error) {
|
|
877
|
-
getLogger('domain:orchestrate').error({ operation: 'worktree.prune', taskId, err: error }, error instanceof Error ? error.message : String(error));
|
|
878
|
-
return {
|
|
879
|
-
success: false,
|
|
880
|
-
error: {
|
|
881
|
-
code: 'E_WORKTREE_PRUNE_FAILED',
|
|
882
|
-
message: error instanceof Error ? error.message : String(error),
|
|
883
|
-
},
|
|
884
|
-
};
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
// ---------------------------------------------------------------------------
|
|
888
|
-
// T935 — HITL approval gate handlers
|
|
889
|
-
// ---------------------------------------------------------------------------
|
|
890
|
-
async function handlePendingApprovals(startTime) {
|
|
891
|
-
try {
|
|
892
|
-
const approvals = await listPendingApprovalsForDispatch();
|
|
893
|
-
return {
|
|
894
|
-
meta: dispatchMeta('query', 'orchestrate', 'pending', startTime),
|
|
895
|
-
success: true,
|
|
896
|
-
data: { approvals, count: approvals.length, total: approvals.length },
|
|
897
|
-
};
|
|
898
|
-
}
|
|
899
|
-
catch (error) {
|
|
900
|
-
getLogger('domain:orchestrate').error({ operation: 'pending', err: error }, error instanceof Error ? error.message : String(error));
|
|
901
|
-
return handleErrorResult('query', 'orchestrate', 'pending', error, startTime);
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
async function handleApproveGate(params, startTime) {
|
|
905
|
-
const resumeToken = params?.resumeToken;
|
|
906
|
-
if (!resumeToken)
|
|
907
|
-
return errorResult('mutate', 'orchestrate', 'approve', 'E_VALIDATION', 'resumeToken is required', startTime);
|
|
908
|
-
const approver = typeof params?.approver === 'string' && params.approver.length > 0
|
|
909
|
-
? params.approver
|
|
910
|
-
: 'cli-user';
|
|
911
|
-
const reason = typeof params?.reason === 'string' ? params.reason : undefined;
|
|
912
|
-
try {
|
|
913
|
-
const existing = await lookupApprovalByTokenForDispatch(resumeToken);
|
|
914
|
-
if (existing === null)
|
|
915
|
-
return errorResult('mutate', 'orchestrate', 'approve', 'E_APPROVAL_NOT_FOUND', `no approval gate for token ${resumeToken}`, startTime);
|
|
916
|
-
if (existing.status === 'approved') {
|
|
917
|
-
return {
|
|
918
|
-
meta: dispatchMeta('mutate', 'orchestrate', 'approve', startTime),
|
|
919
|
-
success: true,
|
|
920
|
-
data: { ...existing, idempotent: true },
|
|
921
|
-
};
|
|
922
|
-
}
|
|
923
|
-
if (existing.status === 'rejected')
|
|
924
|
-
return errorResult('mutate', 'orchestrate', 'approve', 'E_APPROVAL_ALREADY_DECIDED', `gate ${existing.approvalId} was rejected${existing.reason ? ` (${existing.reason})` : ''}`, startTime);
|
|
925
|
-
const db = await acquirePlaybookDb();
|
|
926
|
-
const { approveGate } = await import('@cleocode/playbooks');
|
|
927
|
-
const updated = approveGate(db, resumeToken, approver, reason);
|
|
928
|
-
return {
|
|
929
|
-
meta: dispatchMeta('mutate', 'orchestrate', 'approve', startTime),
|
|
930
|
-
success: true,
|
|
931
|
-
data: updated,
|
|
932
|
-
};
|
|
933
|
-
}
|
|
934
|
-
catch (error) {
|
|
935
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
936
|
-
if (message.includes('E_APPROVAL_ALREADY_DECIDED'))
|
|
937
|
-
return errorResult('mutate', 'orchestrate', 'approve', 'E_APPROVAL_ALREADY_DECIDED', message, startTime);
|
|
938
|
-
if (message.includes('E_APPROVAL_NOT_FOUND'))
|
|
939
|
-
return errorResult('mutate', 'orchestrate', 'approve', 'E_APPROVAL_NOT_FOUND', message, startTime);
|
|
940
|
-
getLogger('domain:orchestrate').error({ operation: 'approve', err: error }, message);
|
|
941
|
-
return handleErrorResult('mutate', 'orchestrate', 'approve', error, startTime);
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
async function handleRejectGate(params, startTime) {
|
|
945
|
-
const resumeToken = params?.resumeToken;
|
|
946
|
-
if (!resumeToken)
|
|
947
|
-
return errorResult('mutate', 'orchestrate', 'reject', 'E_VALIDATION', 'resumeToken is required', startTime);
|
|
948
|
-
const reason = typeof params?.reason === 'string' ? params.reason.trim() : '';
|
|
949
|
-
if (reason.length === 0)
|
|
950
|
-
return errorResult('mutate', 'orchestrate', 'reject', 'E_VALIDATION', 'reason is required for rejection', startTime);
|
|
951
|
-
const approver = typeof params?.approver === 'string' && params.approver.length > 0
|
|
952
|
-
? params.approver
|
|
953
|
-
: 'cli-user';
|
|
954
|
-
try {
|
|
955
|
-
const existing = await lookupApprovalByTokenForDispatch(resumeToken);
|
|
956
|
-
if (existing === null)
|
|
957
|
-
return errorResult('mutate', 'orchestrate', 'reject', 'E_APPROVAL_NOT_FOUND', `no approval gate for token ${resumeToken}`, startTime);
|
|
958
|
-
if (existing.status === 'rejected') {
|
|
959
|
-
return {
|
|
960
|
-
meta: dispatchMeta('mutate', 'orchestrate', 'reject', startTime),
|
|
961
|
-
success: true,
|
|
962
|
-
data: { ...existing, idempotent: true },
|
|
963
|
-
};
|
|
964
|
-
}
|
|
965
|
-
if (existing.status === 'approved')
|
|
966
|
-
return errorResult('mutate', 'orchestrate', 'reject', 'E_APPROVAL_ALREADY_DECIDED', `gate ${existing.approvalId} was already approved`, startTime);
|
|
967
|
-
const db = await acquirePlaybookDb();
|
|
968
|
-
const { rejectGate } = await import('@cleocode/playbooks');
|
|
969
|
-
const updated = rejectGate(db, resumeToken, approver, reason);
|
|
970
|
-
return {
|
|
971
|
-
meta: dispatchMeta('mutate', 'orchestrate', 'reject', startTime),
|
|
972
|
-
success: true,
|
|
973
|
-
data: updated,
|
|
974
|
-
};
|
|
975
|
-
}
|
|
976
|
-
catch (error) {
|
|
977
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
978
|
-
if (message.includes('E_APPROVAL_ALREADY_DECIDED'))
|
|
979
|
-
return errorResult('mutate', 'orchestrate', 'reject', 'E_APPROVAL_ALREADY_DECIDED', message, startTime);
|
|
980
|
-
if (message.includes('E_APPROVAL_NOT_FOUND'))
|
|
981
|
-
return errorResult('mutate', 'orchestrate', 'reject', 'E_APPROVAL_NOT_FOUND', message, startTime);
|
|
982
|
-
getLogger('domain:orchestrate').error({ operation: 'reject', err: error }, message);
|
|
983
|
-
return handleErrorResult('mutate', 'orchestrate', 'reject', error, startTime);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
//# sourceMappingURL=orchestrate.js.map
|