@ashlr/hub 2.2.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/CHANGELOG.md +1158 -0
- package/LICENSE +21 -0
- package/README.md +833 -0
- package/bin/ashlr +8 -0
- package/dist/api/core.d.ts +28 -0
- package/dist/api/core.js +42 -0
- package/dist/api/core.js.map +1 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/api/index.js +9 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/plugin.d.ts +12 -0
- package/dist/api/plugin.js +13 -0
- package/dist/api/plugin.js.map +1 -0
- package/dist/api/types.d.ts +9 -0
- package/dist/api/types.js +9 -0
- package/dist/api/types.js.map +1 -0
- package/dist/cli/args.d.ts +20 -0
- package/dist/cli/args.js +23 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/ask.d.ts +22 -0
- package/dist/cli/ask.js +240 -0
- package/dist/cli/ask.js.map +1 -0
- package/dist/cli/audit.d.ts +26 -0
- package/dist/cli/audit.js +199 -0
- package/dist/cli/audit.js.map +1 -0
- package/dist/cli/backlog.d.ts +26 -0
- package/dist/cli/backlog.js +322 -0
- package/dist/cli/backlog.js.map +1 -0
- package/dist/cli/completions.d.ts +18 -0
- package/dist/cli/completions.js +156 -0
- package/dist/cli/completions.js.map +1 -0
- package/dist/cli/daemon.d.ts +31 -0
- package/dist/cli/daemon.js +334 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/demo-sandbox.d.ts +78 -0
- package/dist/cli/demo-sandbox.js +227 -0
- package/dist/cli/demo-sandbox.js.map +1 -0
- package/dist/cli/demo.d.ts +76 -0
- package/dist/cli/demo.js +285 -0
- package/dist/cli/demo.js.map +1 -0
- package/dist/cli/digest.d.ts +46 -0
- package/dist/cli/digest.js +352 -0
- package/dist/cli/digest.js.map +1 -0
- package/dist/cli/doctor-init.d.ts +28 -0
- package/dist/cli/doctor-init.js +335 -0
- package/dist/cli/doctor-init.js.map +1 -0
- package/dist/cli/genome.d.ts +62 -0
- package/dist/cli/genome.js +1061 -0
- package/dist/cli/genome.js.map +1 -0
- package/dist/cli/gh.d.ts +27 -0
- package/dist/cli/gh.js +322 -0
- package/dist/cli/gh.js.map +1 -0
- package/dist/cli/goals.d.ts +55 -0
- package/dist/cli/goals.js +667 -0
- package/dist/cli/goals.js.map +1 -0
- package/dist/cli/health.d.ts +56 -0
- package/dist/cli/health.js +407 -0
- package/dist/cli/health.js.map +1 -0
- package/dist/cli/help.d.ts +51 -0
- package/dist/cli/help.js +436 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/inbox.d.ts +28 -0
- package/dist/cli/inbox.js +589 -0
- package/dist/cli/inbox.js.map +1 -0
- package/dist/cli/index.d.ts +41 -0
- package/dist/cli/index.js +1208 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/knowledge.d.ts +33 -0
- package/dist/cli/knowledge.js +575 -0
- package/dist/cli/knowledge.js.map +1 -0
- package/dist/cli/mcp.d.ts +26 -0
- package/dist/cli/mcp.js +487 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/models.d.ts +26 -0
- package/dist/cli/models.js +435 -0
- package/dist/cli/models.js.map +1 -0
- package/dist/cli/new.d.ts +32 -0
- package/dist/cli/new.js +565 -0
- package/dist/cli/new.js.map +1 -0
- package/dist/cli/notify.d.ts +20 -0
- package/dist/cli/notify.js +188 -0
- package/dist/cli/notify.js.map +1 -0
- package/dist/cli/onboard.d.ts +85 -0
- package/dist/cli/onboard.js +305 -0
- package/dist/cli/onboard.js.map +1 -0
- package/dist/cli/open.d.ts +38 -0
- package/dist/cli/open.js +86 -0
- package/dist/cli/open.js.map +1 -0
- package/dist/cli/orient.d.ts +14 -0
- package/dist/cli/orient.js +110 -0
- package/dist/cli/orient.js.map +1 -0
- package/dist/cli/picker.d.ts +21 -0
- package/dist/cli/picker.js +177 -0
- package/dist/cli/picker.js.map +1 -0
- package/dist/cli/plugins.d.ts +21 -0
- package/dist/cli/plugins.js +394 -0
- package/dist/cli/plugins.js.map +1 -0
- package/dist/cli/preflight.d.ts +29 -0
- package/dist/cli/preflight.js +131 -0
- package/dist/cli/preflight.js.map +1 -0
- package/dist/cli/pulse.d.ts +26 -0
- package/dist/cli/pulse.js +482 -0
- package/dist/cli/pulse.js.map +1 -0
- package/dist/cli/reflect.d.ts +42 -0
- package/dist/cli/reflect.js +381 -0
- package/dist/cli/reflect.js.map +1 -0
- package/dist/cli/run.d.ts +29 -0
- package/dist/cli/run.js +687 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/sandbox.d.ts +20 -0
- package/dist/cli/sandbox.js +345 -0
- package/dist/cli/sandbox.js.map +1 -0
- package/dist/cli/seams.d.ts +41 -0
- package/dist/cli/seams.js +167 -0
- package/dist/cli/seams.js.map +1 -0
- package/dist/cli/serve.d.ts +25 -0
- package/dist/cli/serve.js +249 -0
- package/dist/cli/serve.js.map +1 -0
- package/dist/cli/ship.d.ts +33 -0
- package/dist/cli/ship.js +433 -0
- package/dist/cli/ship.js.map +1 -0
- package/dist/cli/spec.d.ts +19 -0
- package/dist/cli/spec.js +478 -0
- package/dist/cli/spec.js.map +1 -0
- package/dist/cli/swarm.d.ts +42 -0
- package/dist/cli/swarm.js +1365 -0
- package/dist/cli/swarm.js.map +1 -0
- package/dist/cli/telemetry.d.ts +26 -0
- package/dist/cli/telemetry.js +364 -0
- package/dist/cli/telemetry.js.map +1 -0
- package/dist/cli/tui.d.ts +17 -0
- package/dist/cli/tui.js +52 -0
- package/dist/cli/tui.js.map +1 -0
- package/dist/cli/ui.d.ts +53 -0
- package/dist/cli/ui.js +66 -0
- package/dist/cli/ui.js.map +1 -0
- package/dist/cli/update.d.ts +38 -0
- package/dist/cli/update.js +682 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/cli/vercel.d.ts +20 -0
- package/dist/cli/vercel.js +193 -0
- package/dist/cli/vercel.js.map +1 -0
- package/dist/cli/verify-safety.d.ts +96 -0
- package/dist/cli/verify-safety.js +509 -0
- package/dist/cli/verify-safety.js.map +1 -0
- package/dist/cli/wire.d.ts +22 -0
- package/dist/cli/wire.js +205 -0
- package/dist/cli/wire.js.map +1 -0
- package/dist/core/classify.d.ts +51 -0
- package/dist/core/classify.js +450 -0
- package/dist/core/classify.js.map +1 -0
- package/dist/core/config.d.ts +63 -0
- package/dist/core/config.js +474 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/daemon/loop.d.ts +74 -0
- package/dist/core/daemon/loop.js +618 -0
- package/dist/core/daemon/loop.js.map +1 -0
- package/dist/core/daemon/state.d.ts +66 -0
- package/dist/core/daemon/state.js +197 -0
- package/dist/core/daemon/state.js.map +1 -0
- package/dist/core/dashboard.d.ts +40 -0
- package/dist/core/dashboard.js +463 -0
- package/dist/core/dashboard.js.map +1 -0
- package/dist/core/digest/build.d.ts +51 -0
- package/dist/core/digest/build.js +230 -0
- package/dist/core/digest/build.js.map +1 -0
- package/dist/core/digest/deliver.d.ts +47 -0
- package/dist/core/digest/deliver.js +230 -0
- package/dist/core/digest/deliver.js.map +1 -0
- package/dist/core/digest/store.d.ts +57 -0
- package/dist/core/digest/store.js +223 -0
- package/dist/core/digest/store.js.map +1 -0
- package/dist/core/doctor-fix.d.ts +21 -0
- package/dist/core/doctor-fix.js +440 -0
- package/dist/core/doctor-fix.js.map +1 -0
- package/dist/core/doctor.d.ts +18 -0
- package/dist/core/doctor.js +806 -0
- package/dist/core/doctor.js.map +1 -0
- package/dist/core/env-bridge.d.ts +64 -0
- package/dist/core/env-bridge.js +103 -0
- package/dist/core/env-bridge.js.map +1 -0
- package/dist/core/genome/capture.d.ts +49 -0
- package/dist/core/genome/capture.js +352 -0
- package/dist/core/genome/capture.js.map +1 -0
- package/dist/core/genome/consolidate.d.ts +38 -0
- package/dist/core/genome/consolidate.js +426 -0
- package/dist/core/genome/consolidate.js.map +1 -0
- package/dist/core/genome/export.d.ts +29 -0
- package/dist/core/genome/export.js +102 -0
- package/dist/core/genome/export.js.map +1 -0
- package/dist/core/genome/playbook.d.ts +33 -0
- package/dist/core/genome/playbook.js +320 -0
- package/dist/core/genome/playbook.js.map +1 -0
- package/dist/core/genome/recall.d.ts +45 -0
- package/dist/core/genome/recall.js +293 -0
- package/dist/core/genome/recall.js.map +1 -0
- package/dist/core/genome/store.d.ts +62 -0
- package/dist/core/genome/store.js +711 -0
- package/dist/core/genome/store.js.map +1 -0
- package/dist/core/git.d.ts +34 -0
- package/dist/core/git.js +115 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/goals/advance.d.ts +82 -0
- package/dist/core/goals/advance.js +263 -0
- package/dist/core/goals/advance.js.map +1 -0
- package/dist/core/goals/planner.d.ts +58 -0
- package/dist/core/goals/planner.js +233 -0
- package/dist/core/goals/planner.js.map +1 -0
- package/dist/core/goals/store.d.ts +128 -0
- package/dist/core/goals/store.js +442 -0
- package/dist/core/goals/store.js.map +1 -0
- package/dist/core/inbox/apply.d.ts +36 -0
- package/dist/core/inbox/apply.js +407 -0
- package/dist/core/inbox/apply.js.map +1 -0
- package/dist/core/inbox/notify-proposal.d.ts +13 -0
- package/dist/core/inbox/notify-proposal.js +21 -0
- package/dist/core/inbox/notify-proposal.js.map +1 -0
- package/dist/core/inbox/store.d.ts +67 -0
- package/dist/core/inbox/store.js +258 -0
- package/dist/core/inbox/store.js.map +1 -0
- package/dist/core/index-engine.d.ts +62 -0
- package/dist/core/index-engine.js +486 -0
- package/dist/core/index-engine.js.map +1 -0
- package/dist/core/integrations/desktop-notify.d.ts +18 -0
- package/dist/core/integrations/desktop-notify.js +42 -0
- package/dist/core/integrations/desktop-notify.js.map +1 -0
- package/dist/core/integrations/editors.d.ts +50 -0
- package/dist/core/integrations/editors.js +216 -0
- package/dist/core/integrations/editors.js.map +1 -0
- package/dist/core/integrations/github.d.ts +66 -0
- package/dist/core/integrations/github.js +332 -0
- package/dist/core/integrations/github.js.map +1 -0
- package/dist/core/integrations/identity.d.ts +29 -0
- package/dist/core/integrations/identity.js +359 -0
- package/dist/core/integrations/identity.js.map +1 -0
- package/dist/core/integrations/notify.d.ts +23 -0
- package/dist/core/integrations/notify.js +96 -0
- package/dist/core/integrations/notify.js.map +1 -0
- package/dist/core/integrations/vercel.d.ts +37 -0
- package/dist/core/integrations/vercel.js +192 -0
- package/dist/core/integrations/vercel.js.map +1 -0
- package/dist/core/knowledge/ask.d.ts +34 -0
- package/dist/core/knowledge/ask.js +325 -0
- package/dist/core/knowledge/ask.js.map +1 -0
- package/dist/core/knowledge/graph.d.ts +51 -0
- package/dist/core/knowledge/graph.js +564 -0
- package/dist/core/knowledge/graph.js.map +1 -0
- package/dist/core/knowledge/index.d.ts +74 -0
- package/dist/core/knowledge/index.js +586 -0
- package/dist/core/knowledge/index.js.map +1 -0
- package/dist/core/learn/playbooks.d.ts +84 -0
- package/dist/core/learn/playbooks.js +241 -0
- package/dist/core/learn/playbooks.js.map +1 -0
- package/dist/core/learn/reflect.d.ts +87 -0
- package/dist/core/learn/reflect.js +435 -0
- package/dist/core/learn/reflect.js.map +1 -0
- package/dist/core/learn/store.d.ts +51 -0
- package/dist/core/learn/store.js +165 -0
- package/dist/core/learn/store.js.map +1 -0
- package/dist/core/learn/tuning.d.ts +48 -0
- package/dist/core/learn/tuning.js +201 -0
- package/dist/core/learn/tuning.js.map +1 -0
- package/dist/core/lifecycle/scaffold.d.ts +43 -0
- package/dist/core/lifecycle/scaffold.js +260 -0
- package/dist/core/lifecycle/scaffold.js.map +1 -0
- package/dist/core/lifecycle/ship.d.ts +48 -0
- package/dist/core/lifecycle/ship.js +513 -0
- package/dist/core/lifecycle/ship.js.map +1 -0
- package/dist/core/lifecycle/templates.d.ts +20 -0
- package/dist/core/lifecycle/templates.js +605 -0
- package/dist/core/lifecycle/templates.js.map +1 -0
- package/dist/core/mcp-gateway.d.ts +59 -0
- package/dist/core/mcp-gateway.js +385 -0
- package/dist/core/mcp-gateway.js.map +1 -0
- package/dist/core/mcp-native.d.ts +53 -0
- package/dist/core/mcp-native.js +507 -0
- package/dist/core/mcp-native.js.map +1 -0
- package/dist/core/mcp-registry.d.ts +36 -0
- package/dist/core/mcp-registry.js +180 -0
- package/dist/core/mcp-registry.js.map +1 -0
- package/dist/core/observability/budget-alert.d.ts +18 -0
- package/dist/core/observability/budget-alert.js +90 -0
- package/dist/core/observability/budget-alert.js.map +1 -0
- package/dist/core/observability/estimate.d.ts +27 -0
- package/dist/core/observability/estimate.js +188 -0
- package/dist/core/observability/estimate.js.map +1 -0
- package/dist/core/observability/forecast.d.ts +19 -0
- package/dist/core/observability/forecast.js +101 -0
- package/dist/core/observability/forecast.js.map +1 -0
- package/dist/core/observability/governance.d.ts +28 -0
- package/dist/core/observability/governance.js +101 -0
- package/dist/core/observability/governance.js.map +1 -0
- package/dist/core/observability/otlp.d.ts +88 -0
- package/dist/core/observability/otlp.js +217 -0
- package/dist/core/observability/otlp.js.map +1 -0
- package/dist/core/observability/rollup.d.ts +35 -0
- package/dist/core/observability/rollup.js +311 -0
- package/dist/core/observability/rollup.js.map +1 -0
- package/dist/core/observability/telemetry-sink.d.ts +63 -0
- package/dist/core/observability/telemetry-sink.js +350 -0
- package/dist/core/observability/telemetry-sink.js.map +1 -0
- package/dist/core/observability/usage-source.d.ts +60 -0
- package/dist/core/observability/usage-source.js +347 -0
- package/dist/core/observability/usage-source.js.map +1 -0
- package/dist/core/onboard.d.ts +27 -0
- package/dist/core/onboard.js +288 -0
- package/dist/core/onboard.js.map +1 -0
- package/dist/core/orient.d.ts +23 -0
- package/dist/core/orient.js +135 -0
- package/dist/core/orient.js.map +1 -0
- package/dist/core/phantom.d.ts +23 -0
- package/dist/core/phantom.js +279 -0
- package/dist/core/phantom.js.map +1 -0
- package/dist/core/plugins/host-api.d.ts +29 -0
- package/dist/core/plugins/host-api.js +113 -0
- package/dist/core/plugins/host-api.js.map +1 -0
- package/dist/core/plugins/integrity.d.ts +36 -0
- package/dist/core/plugins/integrity.js +73 -0
- package/dist/core/plugins/integrity.js.map +1 -0
- package/dist/core/plugins/manifest.d.ts +31 -0
- package/dist/core/plugins/manifest.js +316 -0
- package/dist/core/plugins/manifest.js.map +1 -0
- package/dist/core/plugins/registry.d.ts +87 -0
- package/dist/core/plugins/registry.js +415 -0
- package/dist/core/plugins/registry.js.map +1 -0
- package/dist/core/plugins/types.d.ts +182 -0
- package/dist/core/plugins/types.js +40 -0
- package/dist/core/plugins/types.js.map +1 -0
- package/dist/core/plugins/wrappers.d.ts +40 -0
- package/dist/core/plugins/wrappers.js +229 -0
- package/dist/core/plugins/wrappers.js.map +1 -0
- package/dist/core/portfolio/backlog.d.ts +40 -0
- package/dist/core/portfolio/backlog.js +177 -0
- package/dist/core/portfolio/backlog.js.map +1 -0
- package/dist/core/portfolio/scanners.d.ts +21 -0
- package/dist/core/portfolio/scanners.js +600 -0
- package/dist/core/portfolio/scanners.js.map +1 -0
- package/dist/core/providers.d.ts +34 -0
- package/dist/core/providers.js +250 -0
- package/dist/core/providers.js.map +1 -0
- package/dist/core/quality/conventions.d.ts +35 -0
- package/dist/core/quality/conventions.js +267 -0
- package/dist/core/quality/conventions.js.map +1 -0
- package/dist/core/quality/fixes.d.ts +56 -0
- package/dist/core/quality/fixes.js +209 -0
- package/dist/core/quality/fixes.js.map +1 -0
- package/dist/core/quality/health.d.ts +69 -0
- package/dist/core/quality/health.js +350 -0
- package/dist/core/quality/health.js.map +1 -0
- package/dist/core/quality/store.d.ts +56 -0
- package/dist/core/quality/store.js +195 -0
- package/dist/core/quality/store.js.map +1 -0
- package/dist/core/readiness.d.ts +112 -0
- package/dist/core/readiness.js +431 -0
- package/dist/core/readiness.js.map +1 -0
- package/dist/core/run/agent-loop.d.ts +40 -0
- package/dist/core/run/agent-loop.js +291 -0
- package/dist/core/run/agent-loop.js.map +1 -0
- package/dist/core/run/budget.d.ts +47 -0
- package/dist/core/run/budget.js +113 -0
- package/dist/core/run/budget.js.map +1 -0
- package/dist/core/run/engines.d.ts +75 -0
- package/dist/core/run/engines.js +199 -0
- package/dist/core/run/engines.js.map +1 -0
- package/dist/core/run/model-manager.d.ts +64 -0
- package/dist/core/run/model-manager.js +339 -0
- package/dist/core/run/model-manager.js.map +1 -0
- package/dist/core/run/orchestrator.d.ts +100 -0
- package/dist/core/run/orchestrator.js +1515 -0
- package/dist/core/run/orchestrator.js.map +1 -0
- package/dist/core/run/provider-client.d.ts +46 -0
- package/dist/core/run/provider-client.js +796 -0
- package/dist/core/run/provider-client.js.map +1 -0
- package/dist/core/run/retry.d.ts +19 -0
- package/dist/core/run/retry.js +68 -0
- package/dist/core/run/retry.js.map +1 -0
- package/dist/core/run/router.d.ts +50 -0
- package/dist/core/run/router.js +257 -0
- package/dist/core/run/router.js.map +1 -0
- package/dist/core/run/self-heal.d.ts +52 -0
- package/dist/core/run/self-heal.js +181 -0
- package/dist/core/run/self-heal.js.map +1 -0
- package/dist/core/run/streaming.d.ts +31 -0
- package/dist/core/run/streaming.js +122 -0
- package/dist/core/run/streaming.js.map +1 -0
- package/dist/core/run/verify.d.ts +30 -0
- package/dist/core/run/verify.js +204 -0
- package/dist/core/run/verify.js.map +1 -0
- package/dist/core/sandbox/audit.d.ts +31 -0
- package/dist/core/sandbox/audit.js +169 -0
- package/dist/core/sandbox/audit.js.map +1 -0
- package/dist/core/sandbox/policy.d.ts +61 -0
- package/dist/core/sandbox/policy.js +211 -0
- package/dist/core/sandbox/policy.js.map +1 -0
- package/dist/core/sandbox/worktree.d.ts +175 -0
- package/dist/core/sandbox/worktree.js +673 -0
- package/dist/core/sandbox/worktree.js.map +1 -0
- package/dist/core/seams/backlog.d.ts +47 -0
- package/dist/core/seams/backlog.js +47 -0
- package/dist/core/seams/backlog.js.map +1 -0
- package/dist/core/seams/daemon-coordinator.d.ts +72 -0
- package/dist/core/seams/daemon-coordinator.js +76 -0
- package/dist/core/seams/daemon-coordinator.js.map +1 -0
- package/dist/core/seams/genome.d.ts +45 -0
- package/dist/core/seams/genome.js +53 -0
- package/dist/core/seams/genome.js.map +1 -0
- package/dist/core/seams/identity.d.ts +40 -0
- package/dist/core/seams/identity.js +44 -0
- package/dist/core/seams/identity.js.map +1 -0
- package/dist/core/seams/inbox.d.ts +60 -0
- package/dist/core/seams/inbox.js +66 -0
- package/dist/core/seams/inbox.js.map +1 -0
- package/dist/core/seams/index.d.ts +20 -0
- package/dist/core/seams/index.js +21 -0
- package/dist/core/seams/index.js.map +1 -0
- package/dist/core/seams/portfolio.d.ts +50 -0
- package/dist/core/seams/portfolio.js +61 -0
- package/dist/core/seams/portfolio.js.map +1 -0
- package/dist/core/seams/registry.d.ts +42 -0
- package/dist/core/seams/registry.js +128 -0
- package/dist/core/seams/registry.js.map +1 -0
- package/dist/core/seams/run-swarm.d.ts +66 -0
- package/dist/core/seams/run-swarm.js +74 -0
- package/dist/core/seams/run-swarm.js.map +1 -0
- package/dist/core/seams/types.d.ts +123 -0
- package/dist/core/seams/types.js +35 -0
- package/dist/core/seams/types.js.map +1 -0
- package/dist/core/spec/spec-store.d.ts +62 -0
- package/dist/core/spec/spec-store.js +359 -0
- package/dist/core/spec/spec-store.js.map +1 -0
- package/dist/core/swarm/gate.d.ts +45 -0
- package/dist/core/swarm/gate.js +114 -0
- package/dist/core/swarm/gate.js.map +1 -0
- package/dist/core/swarm/planner.d.ts +32 -0
- package/dist/core/swarm/planner.js +293 -0
- package/dist/core/swarm/planner.js.map +1 -0
- package/dist/core/swarm/rollback.d.ts +56 -0
- package/dist/core/swarm/rollback.js +266 -0
- package/dist/core/swarm/rollback.js.map +1 -0
- package/dist/core/swarm/runner.d.ts +62 -0
- package/dist/core/swarm/runner.js +1263 -0
- package/dist/core/swarm/runner.js.map +1 -0
- package/dist/core/swarm/sign.d.ts +71 -0
- package/dist/core/swarm/sign.js +362 -0
- package/dist/core/swarm/sign.js.map +1 -0
- package/dist/core/swarm/store.d.ts +52 -0
- package/dist/core/swarm/store.js +195 -0
- package/dist/core/swarm/store.js.map +1 -0
- package/dist/core/tidy.d.ts +32 -0
- package/dist/core/tidy.js +354 -0
- package/dist/core/tidy.js.map +1 -0
- package/dist/core/tools-registry.d.ts +16 -0
- package/dist/core/tools-registry.js +308 -0
- package/dist/core/tools-registry.js.map +1 -0
- package/dist/core/types.d.ts +2545 -0
- package/dist/core/types.js +9 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/web/api.d.ts +53 -0
- package/dist/core/web/api.js +698 -0
- package/dist/core/web/api.js.map +1 -0
- package/dist/core/web/public/app.js +1906 -0
- package/dist/core/web/public/index.html +721 -0
- package/dist/core/web/public/styles.css +2007 -0
- package/dist/core/web/server.d.ts +18 -0
- package/dist/core/web/server.js +122 -0
- package/dist/core/web/server.js.map +1 -0
- package/dist/core/web/static.d.ts +18 -0
- package/dist/core/web/static.js +122 -0
- package/dist/core/web/static.js.map +1 -0
- package/dist/tui/app.d.ts +33 -0
- package/dist/tui/app.js +350 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/tui/render.d.ts +20 -0
- package/dist/tui/render.js +558 -0
- package/dist/tui/render.js.map +1 -0
- package/package.json +80 -0
- package/schema/config.schema.json +223 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* planner.ts — M28: deterministic-by-default decomposition of an OBJECTIVE
|
|
3
|
+
* into ordered MILESTONES, and per-milestone spec authoring.
|
|
4
|
+
*
|
|
5
|
+
* SAFETY / DESIGN (see docs/contracts/CONTRACT-M28.md):
|
|
6
|
+
* - LOCAL-FIRST: decomposeGoal is DETERMINISTIC by default (a heuristic split
|
|
7
|
+
* — NO LLM, ZERO network). Optional LLM-assisted refinement routes ONLY
|
|
8
|
+
* through getActiveClient(cfg, { allowCloud }) — local Ollama/LM Studio
|
|
9
|
+
* unless --allow-cloud + a configured key (mirrors M25/M26/M27). The default
|
|
10
|
+
* path makes ZERO non-localhost connections.
|
|
11
|
+
* - BOUNDED: the number of milestones is hard-capped by maxMilestones.
|
|
12
|
+
* - NO OUTWARD ACTION: planning NEVER runs a swarm, NEVER touches a user repo
|
|
13
|
+
* working tree, NEVER pushes/PRs/deploys. planMilestoneSpec authors a spec
|
|
14
|
+
* via spec-store (writes ONLY under the spec store, never a user tree).
|
|
15
|
+
* - No new runtime deps; node builtins + existing modules only.
|
|
16
|
+
*/
|
|
17
|
+
import { createHash } from 'node:crypto';
|
|
18
|
+
import { authorSpec } from '../spec/spec-store.js';
|
|
19
|
+
import { getActiveClient } from '../run/provider-client.js';
|
|
20
|
+
/**
|
|
21
|
+
* FIXED stable epoch for decomposed-but-not-yet-persisted milestones. Using a
|
|
22
|
+
* constant (NOT Date.now()) keeps decomposeGoal byte-identical across runs for
|
|
23
|
+
* a given input — the determinism the contract + tests require. The store
|
|
24
|
+
* stamps real timestamps when it materializes a milestone (addMilestone).
|
|
25
|
+
*/
|
|
26
|
+
const STABLE_EPOCH = '1970-01-01T00:00:00.000Z';
|
|
27
|
+
/** Lowercase, hyphenated, alnum-only slug (mirrors the store/spec-store slug). */
|
|
28
|
+
function slugify(text) {
|
|
29
|
+
return text
|
|
30
|
+
.toLowerCase()
|
|
31
|
+
.replace(/[^a-z0-9\s-]/g, '')
|
|
32
|
+
.trim()
|
|
33
|
+
.replace(/\s+/g, '-')
|
|
34
|
+
.replace(/-+/g, '-')
|
|
35
|
+
.slice(0, 32)
|
|
36
|
+
.replace(/-$/, '');
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Deterministic, unique-within-the-objective milestone id derived from the
|
|
40
|
+
* order + title (+ a short content hash). Stable across runs; no clock, no
|
|
41
|
+
* randomness. The store replaces this with its own `${goalId}-m<order>` id on
|
|
42
|
+
* persistence — this id only needs to be unique within a single decompose call.
|
|
43
|
+
*/
|
|
44
|
+
function stableMilestoneId(order, title) {
|
|
45
|
+
const hash = createHash('sha256').update(`${order}:${title}`).digest('hex').slice(0, 6);
|
|
46
|
+
const slug = slugify(title) || 'milestone';
|
|
47
|
+
return `m${order}-${slug}-${hash}`;
|
|
48
|
+
}
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
// Bounds
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
/** Hard default cap on milestones produced from one objective. */
|
|
53
|
+
const DEFAULT_MAX_MILESTONES = 8;
|
|
54
|
+
/** Absolute ceiling regardless of caller-supplied maxMilestones. */
|
|
55
|
+
const HARD_MAX_MILESTONES = 16;
|
|
56
|
+
/** Standard phase scaffold applied to a single-clause objective (no explicit steps). */
|
|
57
|
+
const STANDARD_PHASES = [
|
|
58
|
+
{ title: 'Design', detail: 'Clarify scope, constraints, and acceptance criteria.' },
|
|
59
|
+
{ title: 'Implement', detail: 'Build the core functionality to satisfy the objective.' },
|
|
60
|
+
{ title: 'Test', detail: 'Add focused tests and verify behavior end-to-end.' },
|
|
61
|
+
{ title: 'Document', detail: 'Document the change and update any relevant references.' },
|
|
62
|
+
];
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// decomposeGoal
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
/**
|
|
67
|
+
* Decompose a high-level `objective` into an ordered list of Milestones.
|
|
68
|
+
*
|
|
69
|
+
* DEFAULT (local, deterministic): split the objective into a bounded sequence
|
|
70
|
+
* of ordered milestones using a pure heuristic (numbered-list / "then" /
|
|
71
|
+
* sentence segmentation, plus a standard scaffold of phases when the objective
|
|
72
|
+
* is a single clause). NO model is called; ZERO network.
|
|
73
|
+
*
|
|
74
|
+
* OPTIONAL (opts.allowCloud): refine the deterministic split's titles/details
|
|
75
|
+
* via getActiveClient(cfg, { allowCloud }) — local-first; cloud only with a
|
|
76
|
+
* configured key. Refinement NEVER increases the count beyond the cap and
|
|
77
|
+
* falls back to the deterministic split on any model error.
|
|
78
|
+
*
|
|
79
|
+
* Returns plain Milestone[] (status 'pending', specId/swarmId/proposalId null,
|
|
80
|
+
* order assigned 0..n). Does NOT persist — the caller (store.addMilestone /
|
|
81
|
+
* the CLI `goals plan`) materializes them. Bounded by
|
|
82
|
+
* min(opts.maxMilestones ?? DEFAULT_MAX_MILESTONES, HARD_MAX_MILESTONES).
|
|
83
|
+
* Never throws.
|
|
84
|
+
*/
|
|
85
|
+
export async function decomposeGoal(objective, cfg, opts) {
|
|
86
|
+
const cap = Math.max(1, Math.min(opts?.maxMilestones ?? DEFAULT_MAX_MILESTONES, HARD_MAX_MILESTONES));
|
|
87
|
+
const deterministic = deterministicSplit(objective, cap);
|
|
88
|
+
let parts = deterministic;
|
|
89
|
+
// OPTIONAL local-first refinement. Default path NEVER reaches here.
|
|
90
|
+
if (opts?.allowCloud) {
|
|
91
|
+
try {
|
|
92
|
+
const refined = await refineWithModel(objective, deterministic, cfg, true);
|
|
93
|
+
// COUNT-PRESERVING: a refinement that changes the milestone count is
|
|
94
|
+
// discarded (we keep the deterministic split). This keeps the plan's
|
|
95
|
+
// shape under the human's control and guards against a hallucinated
|
|
96
|
+
// expansion/collapse.
|
|
97
|
+
parts = refined.length === deterministic.length ? refined : deterministic;
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// Any model error => keep the deterministic split (local-first fallback).
|
|
101
|
+
parts = deterministic;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return parts.slice(0, cap).map((p, i) => ({
|
|
105
|
+
id: stableMilestoneId(i, p.title),
|
|
106
|
+
title: p.title,
|
|
107
|
+
detail: p.detail,
|
|
108
|
+
order: i,
|
|
109
|
+
status: 'pending',
|
|
110
|
+
specId: null,
|
|
111
|
+
swarmId: null,
|
|
112
|
+
proposalId: null,
|
|
113
|
+
createdAt: STABLE_EPOCH,
|
|
114
|
+
updatedAt: STABLE_EPOCH,
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Pure, deterministic, local-only split of an objective into <= cap milestone
|
|
119
|
+
* titles. NO model, NO network. Stable across runs for a given input.
|
|
120
|
+
*
|
|
121
|
+
* Strategy (first that yields >1 segment wins):
|
|
122
|
+
* 1. Numbered / bulleted list items ("1.", "2)", "- ", "* ").
|
|
123
|
+
* 2. Explicit step separators ("then", ";", newline).
|
|
124
|
+
* 3. Sentence boundaries.
|
|
125
|
+
* 4. Single clause => the STANDARD_PHASES scaffold.
|
|
126
|
+
*/
|
|
127
|
+
function deterministicSplit(objective, cap) {
|
|
128
|
+
const text = objective.trim();
|
|
129
|
+
if (text.length === 0) {
|
|
130
|
+
return STANDARD_PHASES.slice(0, cap);
|
|
131
|
+
}
|
|
132
|
+
// 1. Numbered / bulleted list items.
|
|
133
|
+
const listItems = text
|
|
134
|
+
.split(/\r?\n/)
|
|
135
|
+
.map((l) => l.replace(/^\s*(?:\d+[.)]|[-*])\s+/, '').trim())
|
|
136
|
+
.filter((l) => l.length > 0);
|
|
137
|
+
const hadListMarkers = /(?:^|\n)\s*(?:\d+[.)]|[-*])\s+/.test(text);
|
|
138
|
+
if (hadListMarkers && listItems.length > 1) {
|
|
139
|
+
return toParts(listItems, cap);
|
|
140
|
+
}
|
|
141
|
+
// 2. Explicit step separators: " then ", " finally ", " next ", ";", newlines.
|
|
142
|
+
const stepParts = text
|
|
143
|
+
.split(/\s*;\s*|\s+then\s+|\s+finally\s+|\s+next\s+|\r?\n+/i)
|
|
144
|
+
.map((s) => s.trim())
|
|
145
|
+
.filter((s) => s.length > 0);
|
|
146
|
+
if (stepParts.length > 1) {
|
|
147
|
+
return toParts(stepParts, cap);
|
|
148
|
+
}
|
|
149
|
+
// 3. Sentence boundaries.
|
|
150
|
+
const sentences = text
|
|
151
|
+
.split(/(?<=[.!?])\s+/)
|
|
152
|
+
.map((s) => s.trim())
|
|
153
|
+
.filter((s) => s.length > 0);
|
|
154
|
+
if (sentences.length > 1) {
|
|
155
|
+
return toParts(sentences, cap);
|
|
156
|
+
}
|
|
157
|
+
// 4. Single clause => standard phase scaffold.
|
|
158
|
+
return STANDARD_PHASES.slice(0, cap);
|
|
159
|
+
}
|
|
160
|
+
/** Build {title, detail} parts from raw segments: title is the segment trimmed to a short line. */
|
|
161
|
+
function toParts(segments, cap) {
|
|
162
|
+
return segments.slice(0, cap).map((seg) => {
|
|
163
|
+
const clean = seg.replace(/^[.\s]+/, '').replace(/[.\s]+$/, '');
|
|
164
|
+
const title = clean.length > 72 ? `${clean.slice(0, 69)}...` : clean;
|
|
165
|
+
return { title: title || 'Milestone', detail: clean };
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* OPTIONAL refinement of the deterministic split via the active local-first
|
|
170
|
+
* provider. Returns refined parts on success, or throws (the caller falls back
|
|
171
|
+
* to the deterministic split). NEVER increases the count beyond `cap`. The
|
|
172
|
+
* provider chain is local unless allowCloud + a configured key (enforced by
|
|
173
|
+
* getActiveClient itself).
|
|
174
|
+
*/
|
|
175
|
+
async function refineWithModel(objective, parts, cfg, allowCloud) {
|
|
176
|
+
const client = await getActiveClient(cfg, { allowCloud });
|
|
177
|
+
const sys = 'You refine a software objective into a concise, ordered list of milestones. ' +
|
|
178
|
+
'Return STRICT JSON: an array of objects {"title": string, "detail": string}. ' +
|
|
179
|
+
`Return EXACTLY ${parts.length} items, in the same order. No prose, no code fences.`;
|
|
180
|
+
const usr = `Objective:\n${objective}\n\n` +
|
|
181
|
+
`Current draft milestones (refine titles/details, keep ordering, do not add count):\n` +
|
|
182
|
+
parts.map((p, i) => `${i + 1}. ${p.title} — ${p.detail}`).join('\n');
|
|
183
|
+
const res = await client.chat([
|
|
184
|
+
{ role: 'system', content: sys },
|
|
185
|
+
{ role: 'user', content: usr },
|
|
186
|
+
]);
|
|
187
|
+
const parsed = JSON.parse(stripFences(res.content));
|
|
188
|
+
if (!Array.isArray(parsed))
|
|
189
|
+
throw new Error('model did not return an array');
|
|
190
|
+
const refined = parsed
|
|
191
|
+
.filter((x) => typeof x === 'object' && x !== null && typeof x.title === 'string')
|
|
192
|
+
.map((x) => ({ title: String(x.title), detail: String(x.detail ?? '') }));
|
|
193
|
+
if (refined.length === 0)
|
|
194
|
+
throw new Error('model returned no usable milestones');
|
|
195
|
+
return refined;
|
|
196
|
+
}
|
|
197
|
+
/** Strip an accidental ```json fence the model might wrap JSON in. */
|
|
198
|
+
function stripFences(s) {
|
|
199
|
+
return s
|
|
200
|
+
.trim()
|
|
201
|
+
.replace(/^```(?:json)?\s*/i, '')
|
|
202
|
+
.replace(/\s*```$/i, '')
|
|
203
|
+
.trim();
|
|
204
|
+
}
|
|
205
|
+
// ---------------------------------------------------------------------------
|
|
206
|
+
// planMilestoneSpec
|
|
207
|
+
// ---------------------------------------------------------------------------
|
|
208
|
+
/**
|
|
209
|
+
* Author (or link) a versioned SpecArtifact for a single milestone of a goal.
|
|
210
|
+
*
|
|
211
|
+
* Delegates to spec-store.authorSpec(goal-derived-prompt, cfg, { project }),
|
|
212
|
+
* which is local-first and idempotent (v1 is reused if it already exists).
|
|
213
|
+
* The authored spec is scoped to the goal's `project` when set. Returns the
|
|
214
|
+
* SpecArtifact so the caller can persist milestone.specId = artifact.id via
|
|
215
|
+
* store.updateMilestoneStatus.
|
|
216
|
+
*
|
|
217
|
+
* NEVER runs a swarm and NEVER touches a user repo working tree — authorSpec
|
|
218
|
+
* only writes to the spec store (project/.ashlr/specs or ~/.ashlr/specs).
|
|
219
|
+
*
|
|
220
|
+
* LOCAL-FIRST: `opts.allowCloud` is threaded straight into authorSpec and
|
|
221
|
+
* defaults to FALSE, so the no-flag `goals plan` path can NEVER reach a cloud
|
|
222
|
+
* provider for spec authoring even when a cloud provider sits in the configured
|
|
223
|
+
* providerChain (closing the default-path cloud-egress gap). Cloud authoring
|
|
224
|
+
* happens ONLY when the user explicitly passed --allow-cloud.
|
|
225
|
+
*/
|
|
226
|
+
export async function planMilestoneSpec(goal, milestone, cfg, opts) {
|
|
227
|
+
const goalText = `${goal.objective} — milestone: ${milestone.title}\n${milestone.detail}`;
|
|
228
|
+
return authorSpec(goalText, cfg, {
|
|
229
|
+
...(goal.project ? { project: goal.project } : {}),
|
|
230
|
+
allowCloud: opts?.allowCloud ?? false,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=planner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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C,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACjF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,sEAAsE;AACtE,SAAS,WAAW,CAAC,CAAS;IAC5B,OAAO,CAAC;SACL,IAAI,EAAE;SACN,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;SAChC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,IAAI,EAAE,CAAC;AACZ,CAAC;AAED,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,IAAU,EACV,SAAoB,EACpB,GAAgB,EAChB,IAA+B;IAE/B,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,SAAS,iBAAiB,SAAS,CAAC,KAAK,KAAK,SAAS,CAAC,MAAM,EAAE,CAAC;IAC1F,OAAO,UAAU,CAAC,QAAQ,EAAE,GAAG,EAAE;QAC/B,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,UAAU,EAAE,IAAI,EAAE,UAAU,IAAI,KAAK;KACtC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* store.ts — M28: Goal record persistence for `ashlr goals`.
|
|
3
|
+
*
|
|
4
|
+
* Persists one Goal per file at ~/.ashlr/goals/<id>.json (atomic write-then-
|
|
5
|
+
* rename), mirroring the learn/quality/inbox store pattern.
|
|
6
|
+
*
|
|
7
|
+
* GUARDRAILS (paramount — see docs/contracts/CONTRACT-M28.md):
|
|
8
|
+
* - PURE PERSISTENCE / READ-MOSTLY: this module NEVER runs a swarm, NEVER
|
|
9
|
+
* authors a spec, NEVER touches a user repo working tree, NEVER emits an
|
|
10
|
+
* outward action (no applyProposal, no setStatus(approved), no git push, no
|
|
11
|
+
* createPr, no deploy). It only reads/writes JSON under ~/.ashlr/goals/.
|
|
12
|
+
* - LOCAL-FIRST: writes ONLY under ~/.ashlr/goals/. Zero network.
|
|
13
|
+
* - Atomic write: <id>.json.tmp then rename (POSIX-atomic).
|
|
14
|
+
* - Never throws on read paths: list/load swallow errors and return safe
|
|
15
|
+
* defaults ([] / null) so callers remain unblocked.
|
|
16
|
+
* - No secrets stored: Goal/Milestone carry metadata + ids only.
|
|
17
|
+
* - No new runtime deps; node builtins only.
|
|
18
|
+
*/
|
|
19
|
+
import type { Goal, GoalStatus, Milestone, MilestoneStatus } from '../types.js';
|
|
20
|
+
import { goalsDir } from '../config.js';
|
|
21
|
+
export { goalsDir };
|
|
22
|
+
/**
|
|
23
|
+
* Create a new Goal from an objective, persist it, and return it.
|
|
24
|
+
*
|
|
25
|
+
* Assigns a fresh id, status 'planning', empty milestones, and createdAt/
|
|
26
|
+
* updatedAt timestamps. `project` (when given) MUST already be a resolved,
|
|
27
|
+
* ENROLLED absolute repo path — enrollment is enforced by the CLI/advance
|
|
28
|
+
* path, NOT here; this is pure persistence.
|
|
29
|
+
*
|
|
30
|
+
* NEVER runs a swarm, authors a spec, or emits an outward action. Best-effort
|
|
31
|
+
* persistence (returns the in-memory Goal even if the write fails).
|
|
32
|
+
*/
|
|
33
|
+
export declare function createGoal(objective: string, opts?: {
|
|
34
|
+
project?: string | null;
|
|
35
|
+
now?: string;
|
|
36
|
+
}): Goal;
|
|
37
|
+
/**
|
|
38
|
+
* Load a single Goal by id. Returns null when absent, unreadable, or malformed.
|
|
39
|
+
* Read-only. Never throws.
|
|
40
|
+
*/
|
|
41
|
+
export declare function loadGoal(id: string): Goal | null;
|
|
42
|
+
/**
|
|
43
|
+
* List all persisted Goals, most-recent first by updatedAt (bounded MAX_LIST).
|
|
44
|
+
* Skips .tmp sidecars and unreadable/corrupt files. Read-only. Never throws.
|
|
45
|
+
*/
|
|
46
|
+
export declare function listGoals(filter?: {
|
|
47
|
+
status?: GoalStatus;
|
|
48
|
+
}): Goal[];
|
|
49
|
+
/**
|
|
50
|
+
* Persist a Goal record atomically (tmp-write + rename). Bumps updatedAt.
|
|
51
|
+
* Best-effort; never throws (mirrors the swarm/inbox stores).
|
|
52
|
+
*/
|
|
53
|
+
export declare function saveGoal(goal: Goal, opts?: {
|
|
54
|
+
now?: string;
|
|
55
|
+
}): void;
|
|
56
|
+
/**
|
|
57
|
+
* Delete a Goal record by id. Idempotent — deleting an absent goal is a no-op.
|
|
58
|
+
* Pure FS under ~/.ashlr/goals; never touches a user repo. Never throws.
|
|
59
|
+
*/
|
|
60
|
+
export declare function deleteGoal(id: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Append a new Milestone to a Goal (status 'pending', specId/swarmId/proposalId
|
|
63
|
+
* null) at the end of the current order. Returns the updated Goal, or null if
|
|
64
|
+
* the goal does not exist. Used by planner.decomposeGoal to materialize a plan.
|
|
65
|
+
*/
|
|
66
|
+
export declare function addMilestone(goalId: string, milestone: Pick<Milestone, 'title' | 'detail'>, opts?: {
|
|
67
|
+
now?: string;
|
|
68
|
+
}): Goal | null;
|
|
69
|
+
/**
|
|
70
|
+
* Set a milestone's status (and optionally link swarmId/proposalId/specId).
|
|
71
|
+
* This is the ONLY way the advance path records progress (pending ->
|
|
72
|
+
* in-progress -> proposed, or -> blocked). Returns the updated Goal, or null
|
|
73
|
+
* if not found.
|
|
74
|
+
*
|
|
75
|
+
* NOTE: this mutates the M28 Goal record ONLY — it NEVER calls inbox setStatus
|
|
76
|
+
* and NEVER approves/applies the linked proposal.
|
|
77
|
+
*/
|
|
78
|
+
export declare function updateMilestoneStatus(goalId: string, milestoneId: string, status: MilestoneStatus, link?: {
|
|
79
|
+
swarmId?: string | null;
|
|
80
|
+
proposalId?: string | null;
|
|
81
|
+
specId?: string | null;
|
|
82
|
+
now?: string;
|
|
83
|
+
}): Goal | null;
|
|
84
|
+
/**
|
|
85
|
+
* Clear ALL of a goal's milestones, returning it to a fresh, unplanned state
|
|
86
|
+
* (status re-rolled to 'planning'). Used by the CLI `goals plan --replace` to
|
|
87
|
+
* support an explicit, destructive re-plan WITHOUT duplicating the milestone
|
|
88
|
+
* set. Pure local edit under ~/.ashlr/goals — never runs a swarm, never touches
|
|
89
|
+
* a user repo, never approves/applies a proposal. Returns the updated Goal, or
|
|
90
|
+
* null if not found.
|
|
91
|
+
*/
|
|
92
|
+
export declare function clearMilestones(goalId: string, opts?: {
|
|
93
|
+
now?: string;
|
|
94
|
+
}): Goal | null;
|
|
95
|
+
/**
|
|
96
|
+
* Reorder a goal's milestones to match the given id sequence (any ids omitted
|
|
97
|
+
* keep their relative order after the listed ones). Rewrites `order` keys and
|
|
98
|
+
* re-sorts. Returns the updated Goal, or null if not found.
|
|
99
|
+
*/
|
|
100
|
+
export declare function reorderMilestones(goalId: string, orderedIds: string[], opts?: {
|
|
101
|
+
now?: string;
|
|
102
|
+
}): Goal | null;
|
|
103
|
+
/**
|
|
104
|
+
* Pause a single milestone (status 'paused') or, when milestoneId is omitted,
|
|
105
|
+
* pause the WHOLE goal (goal.status 'paused' — no milestone advances). A paused
|
|
106
|
+
* milestone is skipped by nextActionableMilestone(). Returns updated Goal/null.
|
|
107
|
+
*/
|
|
108
|
+
export declare function pauseMilestone(goalId: string, milestoneId?: string, opts?: {
|
|
109
|
+
now?: string;
|
|
110
|
+
}): Goal | null;
|
|
111
|
+
/**
|
|
112
|
+
* Resume a milestone back to 'pending' or, when milestoneId is omitted, resume
|
|
113
|
+
* the WHOLE goal (re-roll goal.status). A milestone is resumable when it is
|
|
114
|
+
* 'paused' (human steering) OR 'blocked' (a prior advance that threw / needs
|
|
115
|
+
* recovery) — both transition back to 'pending' so it can be re-advanced. This
|
|
116
|
+
* is the recovery path out of the 'blocked' state the advance error-handler
|
|
117
|
+
* sets. Returns updated Goal/null.
|
|
118
|
+
*/
|
|
119
|
+
export declare function resumeMilestone(goalId: string, milestoneId?: string, opts?: {
|
|
120
|
+
now?: string;
|
|
121
|
+
}): Goal | null;
|
|
122
|
+
/**
|
|
123
|
+
* Skip a milestone permanently (status 'skipped'); it is excluded from progress
|
|
124
|
+
* denominators and never advanced. Returns updated Goal, or null if not found.
|
|
125
|
+
*/
|
|
126
|
+
export declare function skipMilestone(goalId: string, milestoneId: string, opts?: {
|
|
127
|
+
now?: string;
|
|
128
|
+
}): Goal | null;
|