@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,362 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed dispatch adapter — single-point compile-time bridge.
|
|
3
|
+
*
|
|
4
|
+
* ## Purpose
|
|
5
|
+
*
|
|
6
|
+
* The canonical {@link DomainHandler} interface accepts `Record<string, unknown>` params
|
|
7
|
+
* on every operation. This forces every handler to hand-cast each field at the call
|
|
8
|
+
* site (`params?.foo as string`). The T910 audit enumerated **579** such casts
|
|
9
|
+
* across 14 domain handlers — latent schema drift with zero compile-time enforcement.
|
|
10
|
+
*
|
|
11
|
+
* This module provides the compile-time "adapter" (Option A in the T910 audit):
|
|
12
|
+
* handlers declare a typed operation record `O extends TypedOpRecord`, and the
|
|
13
|
+
* single `as O[K][0]` cast inside {@link typedDispatch} is the only boundary
|
|
14
|
+
* between the untyped registry and fully-typed per-op params.
|
|
15
|
+
*
|
|
16
|
+
* ## Scope — what this module does and does NOT do
|
|
17
|
+
*
|
|
18
|
+
* - **Does**: Provide a `TypedDomainHandler<O>` interface, a `typedDispatch` helper,
|
|
19
|
+
* a `defineTypedHandler` builder, and `lafsSuccess` / `lafsError` envelope helpers.
|
|
20
|
+
* - **Does NOT**: Perform runtime validation. A follow-up epic (Wave D Phase 2) will
|
|
21
|
+
* layer zod schemas on top of this module. Today the cast in `typedDispatch`
|
|
22
|
+
* trusts the caller — the registry upstream validates that `op` exists in the
|
|
23
|
+
* handler's operations map, and the contracts in `@cleocode/contracts/src/operations/`
|
|
24
|
+
* are the typed source of truth for what each op accepts.
|
|
25
|
+
* - **Does NOT**: Replace {@link DomainHandler}. Migrations (T975-T983) wire each
|
|
26
|
+
* existing handler through this typed layer one domain at a time; the legacy
|
|
27
|
+
* `DomainHandler` interface remains for back-compat.
|
|
28
|
+
*
|
|
29
|
+
* ## Rationale for the single cast
|
|
30
|
+
*
|
|
31
|
+
* The cast `rawParams as O[K][0]` inside {@link typedDispatch} is the documented
|
|
32
|
+
* "trust boundary". The registry upstream (`registry.ts`) validates the operation
|
|
33
|
+
* name against a known set; the contracts package defines the typed params shape.
|
|
34
|
+
* No other cast is needed because every downstream call site sees the narrowed
|
|
35
|
+
* `O[K][0]` type.
|
|
36
|
+
*
|
|
37
|
+
* @task T974 — Wave D foundation (clean-code SSoT reconciliation epic T962)
|
|
38
|
+
* @see packages/cleo/src/dispatch/domains/diagnostics.ts (gold-standard guard pattern)
|
|
39
|
+
* @see .cleo/agent-outputs/T910-reconciliation/dispatch-cast-audit.md (full audit)
|
|
40
|
+
*/
|
|
41
|
+
import type { LafsEnvelope, LafsSuccess } from '@cleocode/contracts';
|
|
42
|
+
/**
|
|
43
|
+
* Infer a `TypedOpRecord` from a Core function registry.
|
|
44
|
+
*
|
|
45
|
+
* Transforms a map of Core functions into a typed operation record by extracting
|
|
46
|
+
* parameter and return types. The inference rule:
|
|
47
|
+
*
|
|
48
|
+
* - **Params**: `Parameters<F>[0]` — the first argument type of the function.
|
|
49
|
+
* If the function takes no arguments, infers to `Record<string, never>`
|
|
50
|
+
* (representing a no-op/void-arg operation).
|
|
51
|
+
*
|
|
52
|
+
* - **Result**: `Awaited<ReturnType<F>>` — the resolved type of the function's
|
|
53
|
+
* return value. If the function returns a `Promise<T>`, unwraps to `T`.
|
|
54
|
+
* If synchronous, returns the value as-is. This ensures both async and
|
|
55
|
+
* sync Core functions produce a consistent result type.
|
|
56
|
+
*
|
|
57
|
+
* **Overload Resolution**: TypeScript's `Parameters<F>` and `ReturnType<F>`
|
|
58
|
+
* pick the LAST overload of an overloaded function signature. If a Core function
|
|
59
|
+
* defines multiple overloads, the inferred types correspond to the final overload.
|
|
60
|
+
* This is a known limitation; prefer single-signature Core functions when possible,
|
|
61
|
+
* or manually wire the operation record if overloads have materially different
|
|
62
|
+
* parameter/result shapes.
|
|
63
|
+
*
|
|
64
|
+
* **Escape Hatch**: If `OpsFromCore<C>` inference doesn't fit your needs,
|
|
65
|
+
* you may still hand-write a `TypedOpRecord` — this helper is opt-in and
|
|
66
|
+
* coexists with manual declaration. Both approaches satisfy the same
|
|
67
|
+
* `TypedOpRecord` contract.
|
|
68
|
+
*
|
|
69
|
+
* @typeParam C - A record (often `typeof someModule`) mapping operation names
|
|
70
|
+
* to Core functions. Each value must be a function matching
|
|
71
|
+
* `(...args: any[]) => any`.
|
|
72
|
+
*
|
|
73
|
+
* @returns A `TypedOpRecord` (map of operation names to `[Params, Result]`
|
|
74
|
+
* tuples) suitable for passing to {@link defineTypedHandler}.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* // Core module defines:
|
|
79
|
+
* export async function nexusList(params: NexusListParams): Promise<NexusListResult> { ... }
|
|
80
|
+
* export async function nexusRegister(params: NexusRegisterParams): Promise<NexusRegisterResult> { ... }
|
|
81
|
+
*
|
|
82
|
+
* // Dispatch adapter creates:
|
|
83
|
+
* import * as nexusCore from '@cleocode/core/nexus';
|
|
84
|
+
*
|
|
85
|
+
* const coreOps = {
|
|
86
|
+
* 'nexus.list': nexusCore.nexusList,
|
|
87
|
+
* 'nexus.register': nexusCore.nexusRegister,
|
|
88
|
+
* } as const;
|
|
89
|
+
*
|
|
90
|
+
* type NexusOps = OpsFromCore<typeof coreOps>;
|
|
91
|
+
* // Equivalent to:
|
|
92
|
+
* // type NexusOps = {
|
|
93
|
+
* // 'nexus.list': [NexusListParams, NexusListResult];
|
|
94
|
+
* // 'nexus.register': [NexusRegisterParams, NexusRegisterResult];
|
|
95
|
+
* // };
|
|
96
|
+
*
|
|
97
|
+
* const handler = defineTypedHandler<NexusOps>('nexus', {
|
|
98
|
+
* 'nexus.list': async (params) => { ... },
|
|
99
|
+
* 'nexus.register': async (params) => { ... },
|
|
100
|
+
* });
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* **Zero-Argument (Void-Arg) Functions**:
|
|
104
|
+
* ```ts
|
|
105
|
+
* // If Core defines:
|
|
106
|
+
* export async function sessionStatus(): Promise<SessionStatusResult> { ... }
|
|
107
|
+
*
|
|
108
|
+
* // Then:
|
|
109
|
+
* const coreOps = { 'session.status': sessionStatus } as const;
|
|
110
|
+
* type SessionOps = OpsFromCore<typeof coreOps>;
|
|
111
|
+
* // type SessionOps = {
|
|
112
|
+
* // 'session.status': [Record<string, never>, SessionStatusResult];
|
|
113
|
+
* // };
|
|
114
|
+
*
|
|
115
|
+
* // Inside the handler, the params arg is still typed:
|
|
116
|
+
* const handler = defineTypedHandler<SessionOps>('session', {
|
|
117
|
+
* 'session.status': async (_params: Record<string, never>) => {
|
|
118
|
+
* // _params is empty; safe to ignore.
|
|
119
|
+
* return lafsSuccess({ ... }, 'session.status');
|
|
120
|
+
* },
|
|
121
|
+
* });
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* @see {@link TypedOpRecord}
|
|
125
|
+
* @see {@link defineTypedHandler}
|
|
126
|
+
* @task T1436 — Wave 0 of T1435 dispatch refactor (eliminate dispatch-vs-contracts drift)
|
|
127
|
+
*
|
|
128
|
+
* **Note on the `any` constraint**: The `(...args: any[]) => any` constraint is REQUIRED
|
|
129
|
+
* for TypeScript to allow generic inference of `Parameters<C[K]>[0]` and `ReturnType<C[K]>`
|
|
130
|
+
* without widening to `unknown`. Tightening this constraint would break the inference.
|
|
131
|
+
* This is a mandatory boundary in the type-system design.
|
|
132
|
+
*/
|
|
133
|
+
export type OpsFromCore<C extends Record<string, (...args: any[]) => any>> = {
|
|
134
|
+
[K in keyof C]: [
|
|
135
|
+
Parameters<C[K]>[0] extends undefined ? Record<string, never> : Parameters<C[K]>[0],
|
|
136
|
+
Awaited<ReturnType<C[K]>>
|
|
137
|
+
];
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Shape of a typed-op record.
|
|
141
|
+
*
|
|
142
|
+
* Each key in the record is an operation name, and each value is a tuple of
|
|
143
|
+
* `[Params, Result]` types. The adapter uses declaration-merging to narrow
|
|
144
|
+
* the handler's operation functions without runtime indirection.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* import type { SessionStartParams, SessionStartResult } from '@cleocode/contracts';
|
|
149
|
+
*
|
|
150
|
+
* type SessionOps = {
|
|
151
|
+
* 'session.start': [SessionStartParams, SessionStartResult];
|
|
152
|
+
* 'session.status': [Record<string, never>, SessionStatusResult];
|
|
153
|
+
* };
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export type TypedOpRecord = Record<string, readonly [unknown, unknown]>;
|
|
157
|
+
/**
|
|
158
|
+
* A fully-typed domain handler.
|
|
159
|
+
*
|
|
160
|
+
* Callers supply an `OPS extends TypedOpRecord` mapping each op name to its
|
|
161
|
+
* typed `[Params, Result]` tuple. Every function in `operations` receives the
|
|
162
|
+
* narrowed `Params` type and returns a `LafsEnvelope<Result>`.
|
|
163
|
+
*
|
|
164
|
+
* @typeParam O - The typed operation record. Each entry is `[Params, Result]`.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```ts
|
|
168
|
+
* const handler: TypedDomainHandler<SessionOps> = {
|
|
169
|
+
* domain: 'session',
|
|
170
|
+
* operations: {
|
|
171
|
+
* 'session.start': async (params) => lafsSuccess({...}, 'session.start'),
|
|
172
|
+
* 'session.status': async (_params) => lafsSuccess({...}, 'session.status'),
|
|
173
|
+
* },
|
|
174
|
+
* };
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
export interface TypedDomainHandler<O extends TypedOpRecord> {
|
|
178
|
+
/** Canonical domain name (matches the registry key). */
|
|
179
|
+
readonly domain: string;
|
|
180
|
+
/**
|
|
181
|
+
* Per-operation function map. Each op receives its typed params and returns
|
|
182
|
+
* a `LafsEnvelope<Result>` built with {@link lafsSuccess} or {@link lafsError}.
|
|
183
|
+
*/
|
|
184
|
+
readonly operations: {
|
|
185
|
+
readonly [K in keyof O]: (params: O[K][0]) => Promise<LafsEnvelope<unknown>>;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Dispatch a typed op on a typed handler.
|
|
190
|
+
*
|
|
191
|
+
* Given a `TypedDomainHandler<O>`, dispatches `op` with `rawParams` and returns
|
|
192
|
+
* the handler's `LafsEnvelope<O[K][1]>`. The single `as O[K][0]` cast inside
|
|
193
|
+
* this function is the **documented trust boundary**: the registry upstream
|
|
194
|
+
* guarantees that `op` exists in the handler's operations map and that
|
|
195
|
+
* `rawParams` was constructed from the CLI adapter's validated input.
|
|
196
|
+
*
|
|
197
|
+
* No runtime validation is performed here. Runtime schema validation (zod) is
|
|
198
|
+
* the subject of a separate follow-up epic; inserting it into this function
|
|
199
|
+
* will be a localized change (see the `// Future` comment in the implementation).
|
|
200
|
+
*
|
|
201
|
+
* @typeParam O - The handler's typed operation record.
|
|
202
|
+
* @typeParam K - The specific op key being dispatched.
|
|
203
|
+
* @param handler - The typed handler produced by {@link defineTypedHandler}.
|
|
204
|
+
* @param op - The operation name (must exist in `handler.operations`).
|
|
205
|
+
* @param rawParams - Raw params from the dispatcher middleware. Type-narrowed
|
|
206
|
+
* to `O[K][0]` by the single boundary cast below.
|
|
207
|
+
* @returns A `LafsEnvelope<O[K][1]>` from the handler's per-op function.
|
|
208
|
+
*
|
|
209
|
+
* @throws Propagates any error thrown by the handler's op function. Callers
|
|
210
|
+
* that need LAFS-shaped errors should wrap with {@link lafsError} at the
|
|
211
|
+
* op-fn level; {@link typedDispatch} itself does not catch.
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```ts
|
|
215
|
+
* const envelope = await typedDispatch(sessionHandler, 'session.start', rawParams);
|
|
216
|
+
* if (envelope.success) console.log(envelope.data); // SessionStartResult
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
export declare function typedDispatch<O extends TypedOpRecord, K extends keyof O & string>(handler: TypedDomainHandler<O>, op: K, rawParams: unknown): Promise<LafsEnvelope<O[K][1]>>;
|
|
220
|
+
/**
|
|
221
|
+
* Build a {@link TypedDomainHandler} from a domain name and op map.
|
|
222
|
+
*
|
|
223
|
+
* Convenience factory that keeps the domain name and operations record visible
|
|
224
|
+
* at a single call site. Equivalent to writing out the object literal, but
|
|
225
|
+
* makes the generic parameter explicit at the point of construction.
|
|
226
|
+
*
|
|
227
|
+
* @typeParam O - The handler's typed operation record.
|
|
228
|
+
* @param domain - Canonical domain name (matches the registry key).
|
|
229
|
+
* @param operations - Per-op function map produced in user code.
|
|
230
|
+
* @returns A typed handler ready to pass to {@link typedDispatch}.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```ts
|
|
234
|
+
* const sessionHandler = defineTypedHandler<SessionOps>('session', {
|
|
235
|
+
* 'session.start': async (params) => lafsSuccess({...}, 'session.start'),
|
|
236
|
+
* 'session.status': async (_params) => lafsSuccess({...}, 'session.status'),
|
|
237
|
+
* });
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
export declare function defineTypedHandler<O extends TypedOpRecord>(domain: string, operations: TypedDomainHandler<O>['operations']): TypedDomainHandler<O>;
|
|
241
|
+
/**
|
|
242
|
+
* Generate a stable request id for envelope correlation.
|
|
243
|
+
*
|
|
244
|
+
* @internal
|
|
245
|
+
*/
|
|
246
|
+
declare function generateRequestId(): string;
|
|
247
|
+
/**
|
|
248
|
+
* Build a LAFS success envelope around `data`.
|
|
249
|
+
*
|
|
250
|
+
* Produces a `LafsSuccess<T>` (the CLI envelope variant from
|
|
251
|
+
* `@cleocode/contracts/src/lafs.ts`). The `operation` argument is accepted
|
|
252
|
+
* for parity with {@link lafsError} but is not persisted on the CLI variant
|
|
253
|
+
* — upstream middleware writes it onto the gateway-enriched envelope
|
|
254
|
+
* (`GatewaySuccess._meta.operation`) when the response crosses the dispatcher
|
|
255
|
+
* boundary.
|
|
256
|
+
*
|
|
257
|
+
* @typeParam T - The data payload type.
|
|
258
|
+
* @param data - The successful result payload.
|
|
259
|
+
* @param _operation - Operation name (accepted for parity; not persisted on
|
|
260
|
+
* the CLI envelope variant — it is written by the gateway middleware).
|
|
261
|
+
* @returns A `LafsSuccess<T>` envelope.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```ts
|
|
265
|
+
* return lafsSuccess({ sessionId: 'ses_…', scope: 'global' }, 'session.start');
|
|
266
|
+
* ```
|
|
267
|
+
*/
|
|
268
|
+
export declare function lafsSuccess<T>(data: T, _operation: string, extra?: {
|
|
269
|
+
page?: import('@cleocode/contracts').LAFSPage;
|
|
270
|
+
}): LafsSuccess<T> & {
|
|
271
|
+
page?: import('@cleocode/contracts').LAFSPage;
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Build a LAFS error envelope.
|
|
275
|
+
*
|
|
276
|
+
* Produces a `LafsError` (the CLI envelope variant from
|
|
277
|
+
* `@cleocode/contracts/src/lafs.ts`). The `operation` argument is accepted
|
|
278
|
+
* for parity with {@link lafsSuccess} but is not persisted on the CLI variant
|
|
279
|
+
* — upstream middleware writes it onto the gateway-enriched envelope
|
|
280
|
+
* (`GatewayError._meta.operation`).
|
|
281
|
+
*
|
|
282
|
+
* @param code - Stable machine-readable error code (e.g. `'E_NOT_FOUND'`).
|
|
283
|
+
* @param message - Human-readable error description.
|
|
284
|
+
* @param _operation - Operation name (accepted for parity; not persisted on
|
|
285
|
+
* the CLI envelope variant — it is written by the gateway middleware).
|
|
286
|
+
* @param fix - Optional copy-paste fix hint for the caller.
|
|
287
|
+
* @returns A `LafsError` envelope. Typed as `LafsEnvelope<never>` so it
|
|
288
|
+
* composes with any `LafsEnvelope<T>` return type.
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* ```ts
|
|
292
|
+
* return lafsError('E_NOT_FOUND', `task ${id} not found`, 'tasks.show', `cleo find ${id}`);
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
export declare function lafsError(code: string, message: string, _operation: string, fix?: string): LafsEnvelope<never>;
|
|
296
|
+
/**
|
|
297
|
+
* Wrap a Core engine result into a LAFS envelope.
|
|
298
|
+
*
|
|
299
|
+
* Eliminates the repetitive 8-12 line pattern:
|
|
300
|
+
* ```ts
|
|
301
|
+
* const result = await coreOps.foo(params);
|
|
302
|
+
* if (!result.success) return lafsError(String(result.error?.code ?? 'E_INTERNAL'), ...);
|
|
303
|
+
* return lafsSuccess(result.data ?? fallback, opName);
|
|
304
|
+
* ```
|
|
305
|
+
*
|
|
306
|
+
* Usage:
|
|
307
|
+
* ```ts
|
|
308
|
+
* return wrapCoreResult(await coreOps.foo(params), 'foo', fallback);
|
|
309
|
+
* ```
|
|
310
|
+
*
|
|
311
|
+
* @param result - Result returned by a Core op wrapper function.
|
|
312
|
+
* @param opName - Operation name forwarded to {@link lafsError} / {@link lafsSuccess}.
|
|
313
|
+
* @param fallback - Optional default when `result.data` is `null`/`undefined` on success.
|
|
314
|
+
* @returns A `LafsEnvelope` for the operation.
|
|
315
|
+
*
|
|
316
|
+
* @task T1484
|
|
317
|
+
*/
|
|
318
|
+
export declare function wrapCoreResult<T = any>(result: {
|
|
319
|
+
success: boolean;
|
|
320
|
+
data?: T;
|
|
321
|
+
error?: {
|
|
322
|
+
code?: string | number;
|
|
323
|
+
message?: string;
|
|
324
|
+
};
|
|
325
|
+
}, opName: string, fallback?: T): LafsEnvelope<T>;
|
|
326
|
+
/**
|
|
327
|
+
* Wrap a conduit `*Impl` call in a standardised try/catch returning a LAFS envelope.
|
|
328
|
+
*
|
|
329
|
+
* All conduit typed-handler ops follow an identical 15-25 line try/catch pattern:
|
|
330
|
+
* ```ts
|
|
331
|
+
* try {
|
|
332
|
+
* const result = await fooImpl(...params);
|
|
333
|
+
* if (!result.success) return lafsError(result.error?.code ?? 'E_CONDUIT', ...);
|
|
334
|
+
* return lafsSuccess(result.data ?? {}, opName);
|
|
335
|
+
* } catch (error) {
|
|
336
|
+
* return lafsError('E_CONDUIT', error instanceof Error ? error.message : String(error), opName);
|
|
337
|
+
* }
|
|
338
|
+
* ```
|
|
339
|
+
*
|
|
340
|
+
* Usage:
|
|
341
|
+
* ```ts
|
|
342
|
+
* return wrapConduitImpl(() => fooImpl(params.bar, params.baz), 'foo');
|
|
343
|
+
* ```
|
|
344
|
+
*
|
|
345
|
+
* @param fn - Zero-argument async factory that calls the impl function.
|
|
346
|
+
* @param opName - Operation name forwarded to {@link lafsError} / {@link lafsSuccess}.
|
|
347
|
+
* @returns A `Promise<LafsEnvelope<T>>` for the operation.
|
|
348
|
+
*
|
|
349
|
+
* @task T1484
|
|
350
|
+
*/
|
|
351
|
+
export declare function wrapConduitImpl(fn: () => Promise<unknown>, opName: string): Promise<LafsEnvelope<unknown>>;
|
|
352
|
+
/**
|
|
353
|
+
* Internal request-id generator, exposed for deterministic assertions in unit
|
|
354
|
+
* tests. Production callers should never import this directly.
|
|
355
|
+
*
|
|
356
|
+
* @internal
|
|
357
|
+
*/
|
|
358
|
+
export declare const __typedInternals: {
|
|
359
|
+
generateRequestId: typeof generateRequestId;
|
|
360
|
+
};
|
|
361
|
+
export {};
|
|
362
|
+
//# sourceMappingURL=typed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../../src/dispatch/adapters/typed.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed dispatch adapter — single-point compile-time bridge.
|
|
3
|
+
*
|
|
4
|
+
* ## Purpose
|
|
5
|
+
*
|
|
6
|
+
* The canonical {@link DomainHandler} interface accepts `Record<string, unknown>` params
|
|
7
|
+
* on every operation. This forces every handler to hand-cast each field at the call
|
|
8
|
+
* site (`params?.foo as string`). The T910 audit enumerated **579** such casts
|
|
9
|
+
* across 14 domain handlers — latent schema drift with zero compile-time enforcement.
|
|
10
|
+
*
|
|
11
|
+
* This module provides the compile-time "adapter" (Option A in the T910 audit):
|
|
12
|
+
* handlers declare a typed operation record `O extends TypedOpRecord`, and the
|
|
13
|
+
* single `as O[K][0]` cast inside {@link typedDispatch} is the only boundary
|
|
14
|
+
* between the untyped registry and fully-typed per-op params.
|
|
15
|
+
*
|
|
16
|
+
* ## Scope — what this module does and does NOT do
|
|
17
|
+
*
|
|
18
|
+
* - **Does**: Provide a `TypedDomainHandler<O>` interface, a `typedDispatch` helper,
|
|
19
|
+
* a `defineTypedHandler` builder, and `lafsSuccess` / `lafsError` envelope helpers.
|
|
20
|
+
* - **Does NOT**: Perform runtime validation. A follow-up epic (Wave D Phase 2) will
|
|
21
|
+
* layer zod schemas on top of this module. Today the cast in `typedDispatch`
|
|
22
|
+
* trusts the caller — the registry upstream validates that `op` exists in the
|
|
23
|
+
* handler's operations map, and the contracts in `@cleocode/contracts/src/operations/`
|
|
24
|
+
* are the typed source of truth for what each op accepts.
|
|
25
|
+
* - **Does NOT**: Replace {@link DomainHandler}. Migrations (T975-T983) wire each
|
|
26
|
+
* existing handler through this typed layer one domain at a time; the legacy
|
|
27
|
+
* `DomainHandler` interface remains for back-compat.
|
|
28
|
+
*
|
|
29
|
+
* ## Rationale for the single cast
|
|
30
|
+
*
|
|
31
|
+
* The cast `rawParams as O[K][0]` inside {@link typedDispatch} is the documented
|
|
32
|
+
* "trust boundary". The registry upstream (`registry.ts`) validates the operation
|
|
33
|
+
* name against a known set; the contracts package defines the typed params shape.
|
|
34
|
+
* No other cast is needed because every downstream call site sees the narrowed
|
|
35
|
+
* `O[K][0]` type.
|
|
36
|
+
*
|
|
37
|
+
* @task T974 — Wave D foundation (clean-code SSoT reconciliation epic T962)
|
|
38
|
+
* @see packages/cleo/src/dispatch/domains/diagnostics.ts (gold-standard guard pattern)
|
|
39
|
+
* @see .cleo/agent-outputs/T910-reconciliation/dispatch-cast-audit.md (full audit)
|
|
40
|
+
*/
|
|
41
|
+
import { randomUUID } from 'node:crypto';
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// Dispatch helper
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
/**
|
|
46
|
+
* Dispatch a typed op on a typed handler.
|
|
47
|
+
*
|
|
48
|
+
* Given a `TypedDomainHandler<O>`, dispatches `op` with `rawParams` and returns
|
|
49
|
+
* the handler's `LafsEnvelope<O[K][1]>`. The single `as O[K][0]` cast inside
|
|
50
|
+
* this function is the **documented trust boundary**: the registry upstream
|
|
51
|
+
* guarantees that `op` exists in the handler's operations map and that
|
|
52
|
+
* `rawParams` was constructed from the CLI adapter's validated input.
|
|
53
|
+
*
|
|
54
|
+
* No runtime validation is performed here. Runtime schema validation (zod) is
|
|
55
|
+
* the subject of a separate follow-up epic; inserting it into this function
|
|
56
|
+
* will be a localized change (see the `// Future` comment in the implementation).
|
|
57
|
+
*
|
|
58
|
+
* @typeParam O - The handler's typed operation record.
|
|
59
|
+
* @typeParam K - The specific op key being dispatched.
|
|
60
|
+
* @param handler - The typed handler produced by {@link defineTypedHandler}.
|
|
61
|
+
* @param op - The operation name (must exist in `handler.operations`).
|
|
62
|
+
* @param rawParams - Raw params from the dispatcher middleware. Type-narrowed
|
|
63
|
+
* to `O[K][0]` by the single boundary cast below.
|
|
64
|
+
* @returns A `LafsEnvelope<O[K][1]>` from the handler's per-op function.
|
|
65
|
+
*
|
|
66
|
+
* @throws Propagates any error thrown by the handler's op function. Callers
|
|
67
|
+
* that need LAFS-shaped errors should wrap with {@link lafsError} at the
|
|
68
|
+
* op-fn level; {@link typedDispatch} itself does not catch.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const envelope = await typedDispatch(sessionHandler, 'session.start', rawParams);
|
|
73
|
+
* if (envelope.success) console.log(envelope.data); // SessionStartResult
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export async function typedDispatch(handler, op, rawParams) {
|
|
77
|
+
// ------------------------------------------------------------------------
|
|
78
|
+
// Trust boundary (single-point cast).
|
|
79
|
+
//
|
|
80
|
+
// `rawParams` is `unknown` at the registry boundary. The CLI adapter
|
|
81
|
+
// (`packages/cleo/src/dispatch/adapters/cli.ts`) has already unpacked the
|
|
82
|
+
// wire format via `params-resolver`, and the registry's `resolveOperation`
|
|
83
|
+
// guarantees that `op` exists in `handler.operations`. This cast is the
|
|
84
|
+
// ONLY point in the typed adapter where `unknown` becomes a concrete params
|
|
85
|
+
// type; every downstream call site sees the narrowed `O[K][0]`.
|
|
86
|
+
//
|
|
87
|
+
// Future (Wave D Phase 2, separate epic): insert zod parsing here to gate
|
|
88
|
+
// drift at runtime as well as at compile time. The shape would be:
|
|
89
|
+
//
|
|
90
|
+
// const schema = OpSchemas[handler.domain][op];
|
|
91
|
+
// const parsed = schema.safeParse(rawParams);
|
|
92
|
+
// if (!parsed.success) {
|
|
93
|
+
// return lafsError('E_VALIDATION', parsed.error.message, `${handler.domain}.${op}`);
|
|
94
|
+
// }
|
|
95
|
+
// return handler.operations[op](parsed.data);
|
|
96
|
+
//
|
|
97
|
+
// See packages/contracts/src/operations/*.ts for the typed Params contracts
|
|
98
|
+
// that would back these schemas.
|
|
99
|
+
// ------------------------------------------------------------------------
|
|
100
|
+
return handler.operations[op](rawParams);
|
|
101
|
+
}
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
// Builder
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
/**
|
|
106
|
+
* Build a {@link TypedDomainHandler} from a domain name and op map.
|
|
107
|
+
*
|
|
108
|
+
* Convenience factory that keeps the domain name and operations record visible
|
|
109
|
+
* at a single call site. Equivalent to writing out the object literal, but
|
|
110
|
+
* makes the generic parameter explicit at the point of construction.
|
|
111
|
+
*
|
|
112
|
+
* @typeParam O - The handler's typed operation record.
|
|
113
|
+
* @param domain - Canonical domain name (matches the registry key).
|
|
114
|
+
* @param operations - Per-op function map produced in user code.
|
|
115
|
+
* @returns A typed handler ready to pass to {@link typedDispatch}.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* const sessionHandler = defineTypedHandler<SessionOps>('session', {
|
|
120
|
+
* 'session.start': async (params) => lafsSuccess({...}, 'session.start'),
|
|
121
|
+
* 'session.status': async (_params) => lafsSuccess({...}, 'session.status'),
|
|
122
|
+
* });
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export function defineTypedHandler(domain, operations) {
|
|
126
|
+
return { domain, operations };
|
|
127
|
+
}
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
// LAFS envelope helpers
|
|
130
|
+
// ---------------------------------------------------------------------------
|
|
131
|
+
/**
|
|
132
|
+
* Generate a stable request id for envelope correlation.
|
|
133
|
+
*
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
function generateRequestId() {
|
|
137
|
+
return randomUUID();
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Build a LAFS success envelope around `data`.
|
|
141
|
+
*
|
|
142
|
+
* Produces a `LafsSuccess<T>` (the CLI envelope variant from
|
|
143
|
+
* `@cleocode/contracts/src/lafs.ts`). The `operation` argument is accepted
|
|
144
|
+
* for parity with {@link lafsError} but is not persisted on the CLI variant
|
|
145
|
+
* — upstream middleware writes it onto the gateway-enriched envelope
|
|
146
|
+
* (`GatewaySuccess._meta.operation`) when the response crosses the dispatcher
|
|
147
|
+
* boundary.
|
|
148
|
+
*
|
|
149
|
+
* @typeParam T - The data payload type.
|
|
150
|
+
* @param data - The successful result payload.
|
|
151
|
+
* @param _operation - Operation name (accepted for parity; not persisted on
|
|
152
|
+
* the CLI envelope variant — it is written by the gateway middleware).
|
|
153
|
+
* @returns A `LafsSuccess<T>` envelope.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```ts
|
|
157
|
+
* return lafsSuccess({ sessionId: 'ses_…', scope: 'global' }, 'session.start');
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
export function lafsSuccess(data, _operation, extra) {
|
|
161
|
+
return {
|
|
162
|
+
success: true,
|
|
163
|
+
data,
|
|
164
|
+
...(extra?.page ? { page: extra.page } : {}),
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Build a LAFS error envelope.
|
|
169
|
+
*
|
|
170
|
+
* Produces a `LafsError` (the CLI envelope variant from
|
|
171
|
+
* `@cleocode/contracts/src/lafs.ts`). The `operation` argument is accepted
|
|
172
|
+
* for parity with {@link lafsSuccess} but is not persisted on the CLI variant
|
|
173
|
+
* — upstream middleware writes it onto the gateway-enriched envelope
|
|
174
|
+
* (`GatewayError._meta.operation`).
|
|
175
|
+
*
|
|
176
|
+
* @param code - Stable machine-readable error code (e.g. `'E_NOT_FOUND'`).
|
|
177
|
+
* @param message - Human-readable error description.
|
|
178
|
+
* @param _operation - Operation name (accepted for parity; not persisted on
|
|
179
|
+
* the CLI envelope variant — it is written by the gateway middleware).
|
|
180
|
+
* @param fix - Optional copy-paste fix hint for the caller.
|
|
181
|
+
* @returns A `LafsError` envelope. Typed as `LafsEnvelope<never>` so it
|
|
182
|
+
* composes with any `LafsEnvelope<T>` return type.
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```ts
|
|
186
|
+
* return lafsError('E_NOT_FOUND', `task ${id} not found`, 'tasks.show', `cleo find ${id}`);
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
export function lafsError(code, message, _operation, fix) {
|
|
190
|
+
const error = { code, message };
|
|
191
|
+
if (fix !== undefined)
|
|
192
|
+
error.fix = fix;
|
|
193
|
+
return {
|
|
194
|
+
success: false,
|
|
195
|
+
error,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
// Thin-dispatch helpers (T1484 · ADR-057 D3)
|
|
200
|
+
// ---------------------------------------------------------------------------
|
|
201
|
+
/**
|
|
202
|
+
* Wrap a Core engine result into a LAFS envelope.
|
|
203
|
+
*
|
|
204
|
+
* Eliminates the repetitive 8-12 line pattern:
|
|
205
|
+
* ```ts
|
|
206
|
+
* const result = await coreOps.foo(params);
|
|
207
|
+
* if (!result.success) return lafsError(String(result.error?.code ?? 'E_INTERNAL'), ...);
|
|
208
|
+
* return lafsSuccess(result.data ?? fallback, opName);
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* Usage:
|
|
212
|
+
* ```ts
|
|
213
|
+
* return wrapCoreResult(await coreOps.foo(params), 'foo', fallback);
|
|
214
|
+
* ```
|
|
215
|
+
*
|
|
216
|
+
* @param result - Result returned by a Core op wrapper function.
|
|
217
|
+
* @param opName - Operation name forwarded to {@link lafsError} / {@link lafsSuccess}.
|
|
218
|
+
* @param fallback - Optional default when `result.data` is `null`/`undefined` on success.
|
|
219
|
+
* @returns A `LafsEnvelope` for the operation.
|
|
220
|
+
*
|
|
221
|
+
* @task T1484
|
|
222
|
+
*/
|
|
223
|
+
// biome-ignore lint/suspicious/noExplicitAny: fallback must accept any data shape
|
|
224
|
+
export function wrapCoreResult(result, opName, fallback) {
|
|
225
|
+
if (!result.success) {
|
|
226
|
+
return lafsError(String(result.error?.code ?? 'E_INTERNAL'), result.error?.message ?? 'Unknown error', opName);
|
|
227
|
+
}
|
|
228
|
+
return lafsSuccess((result.data ?? fallback), opName);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Wrap a conduit `*Impl` call in a standardised try/catch returning a LAFS envelope.
|
|
232
|
+
*
|
|
233
|
+
* All conduit typed-handler ops follow an identical 15-25 line try/catch pattern:
|
|
234
|
+
* ```ts
|
|
235
|
+
* try {
|
|
236
|
+
* const result = await fooImpl(...params);
|
|
237
|
+
* if (!result.success) return lafsError(result.error?.code ?? 'E_CONDUIT', ...);
|
|
238
|
+
* return lafsSuccess(result.data ?? {}, opName);
|
|
239
|
+
* } catch (error) {
|
|
240
|
+
* return lafsError('E_CONDUIT', error instanceof Error ? error.message : String(error), opName);
|
|
241
|
+
* }
|
|
242
|
+
* ```
|
|
243
|
+
*
|
|
244
|
+
* Usage:
|
|
245
|
+
* ```ts
|
|
246
|
+
* return wrapConduitImpl(() => fooImpl(params.bar, params.baz), 'foo');
|
|
247
|
+
* ```
|
|
248
|
+
*
|
|
249
|
+
* @param fn - Zero-argument async factory that calls the impl function.
|
|
250
|
+
* @param opName - Operation name forwarded to {@link lafsError} / {@link lafsSuccess}.
|
|
251
|
+
* @returns A `Promise<LafsEnvelope<T>>` for the operation.
|
|
252
|
+
*
|
|
253
|
+
* @task T1484
|
|
254
|
+
*/
|
|
255
|
+
export async function wrapConduitImpl(fn, opName) {
|
|
256
|
+
try {
|
|
257
|
+
// biome-ignore lint/suspicious/noExplicitAny: conduit impl types are heterogeneous
|
|
258
|
+
const result = (await fn());
|
|
259
|
+
if (!result.success) {
|
|
260
|
+
return lafsError(String(result.error?.code ?? 'E_CONDUIT'), result.error?.message ?? 'Unknown error', opName);
|
|
261
|
+
}
|
|
262
|
+
return lafsSuccess(result.data ?? {}, opName);
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
return lafsError('E_CONDUIT', error instanceof Error ? error.message : String(error), opName);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// ---------------------------------------------------------------------------
|
|
269
|
+
// Internal exports for testing
|
|
270
|
+
// ---------------------------------------------------------------------------
|
|
271
|
+
/**
|
|
272
|
+
* Internal request-id generator, exposed for deterministic assertions in unit
|
|
273
|
+
* tests. Production callers should never import this directly.
|
|
274
|
+
*
|
|
275
|
+
* @internal
|
|
276
|
+
*/
|
|
277
|
+
export const __typedInternals = { generateRequestId };
|
|
278
|
+
//# sourceMappingURL=typed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed.js","sourceRoot":"","sources":["../../../src/dispatch/adapters/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAiKzC,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAA8B,EAC9B,EAAK,EACL,SAAkB;IAElB,2EAA2E;IAC3E,sCAAsC;IACtC,EAAE;IACF,qEAAqE;IACrE,0EAA0E;IAC1E,2EAA2E;IAC3E,wEAAwE;IACxE,4EAA4E;IAC5E,gEAAgE;IAChE,EAAE;IACF,0EAA0E;IAC1E,mEAAmE;IACnE,EAAE;IACF,kDAAkD;IAClD,gDAAgD;IAChD,2BAA2B;IAC3B,yFAAyF;IACzF,MAAM;IACN,gDAAgD;IAChD,EAAE;IACF,4EAA4E;IAC5E,iCAAiC;IACjC,2EAA2E;IAC3E,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,SAAoB,CAAC,CAAC;AACtD,CAAC;AAED,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAc,EACd,UAA+C;IAE/C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAChC,CAAC;AAED,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E;AAE9E;;;;GAIG;AACH,SAAS,iBAAiB;IACxB,OAAO,UAAU,EAAE,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,WAAW,CACzB,IAAO,EACP,UAAkB,EAClB,KAAyD;IAEzD,OAAO;QACL,OAAO,EAAE,IAAI;QACb,IAAI;QACJ,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC7C,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,SAAS,CACvB,IAAY,EACZ,OAAe,EACf,UAAkB,EAClB,GAAY;IAEZ,MAAM,KAAK,GAAuB,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACpD,IAAI,GAAG,KAAK,SAAS;QAAE,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;IACvC,OAAO;QACL,OAAO,EAAE,KAAK;QACd,KAAK;KACN,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,6CAA6C;AAC7C,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,kFAAkF;AAClF,MAAM,UAAU,cAAc,CAC5B,MAIC,EACD,MAAc,EACd,QAAY;IAEZ,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,SAAS,CACd,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,IAAI,YAAY,CAAC,EAC1C,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,eAAe,EACxC,MAAM,CACY,CAAC;IACvB,CAAC;IACD,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAM,EAAE,MAAM,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,EAA0B,EAC1B,MAAc;IAEd,IAAI,CAAC;QACH,mFAAmF;QACnF,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,EAAE,CAAQ,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,SAAS,CACd,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,IAAI,WAAW,CAAC,EACzC,MAAM,CAAC,KAAK,EAAE,OAAO,IAAI,eAAe,EACxC,MAAM,CACP,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,SAAS,CAAC,WAAW,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;IAChG,CAAC;AACH,CAAC;AAED,8EAA8E;AAC9E,+BAA+B;AAC/B,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,iBAAiB,EAAE,CAAC"}
|