@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
package/dist/cli/open.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cli/open.ts — Launch items in editor, Finder, or Terminal.
|
|
3
|
+
*
|
|
4
|
+
* All launchers use spawn (detached, unref'd) so the CLI process exits
|
|
5
|
+
* immediately. Errors are swallowed — never throw; open operations are
|
|
6
|
+
* best-effort UI conveniences.
|
|
7
|
+
*/
|
|
8
|
+
import { spawn } from 'node:child_process';
|
|
9
|
+
import { resolve } from 'node:path';
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// Internal helper
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
/**
|
|
14
|
+
* Fire-and-forget spawn. Detaches the child process so the parent can exit
|
|
15
|
+
* without waiting. Errors are silently discarded.
|
|
16
|
+
*/
|
|
17
|
+
function fire(cmd, args) {
|
|
18
|
+
try {
|
|
19
|
+
const child = spawn(cmd, args, {
|
|
20
|
+
detached: true,
|
|
21
|
+
stdio: 'ignore',
|
|
22
|
+
});
|
|
23
|
+
child.unref();
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// best-effort — never propagate
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Public API
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
/**
|
|
33
|
+
* Open `path` in the configured editor using a deep link URL.
|
|
34
|
+
*
|
|
35
|
+
* Strategy:
|
|
36
|
+
* 1. Cursor → `open "cursor://file/<abs>"`
|
|
37
|
+
* Fallback: `open -a Cursor <path>`
|
|
38
|
+
* 2. VSCode → `open "vscode://file/<abs>"`
|
|
39
|
+
* Fallback: `open -a "Visual Studio Code" <path>`
|
|
40
|
+
*
|
|
41
|
+
* The deep link is tried first; if the URL scheme handler is not registered
|
|
42
|
+
* (e.g. app not installed) macOS silently does nothing, so we do not attempt
|
|
43
|
+
* explicit fallback detection — callers are welcome to retry via openInFinder.
|
|
44
|
+
*/
|
|
45
|
+
export function openInEditor(path, cfg) {
|
|
46
|
+
const abs = resolve(path);
|
|
47
|
+
// Percent-encode each path segment so paths containing spaces or reserved
|
|
48
|
+
// URI characters (e.g. "Keys & Recovery", "Rent Application.pdf", "tts
|
|
49
|
+
// agents") still yield a valid URL. `abs` always begins with '/', so the
|
|
50
|
+
// first split element is the empty string and the join restores the leading
|
|
51
|
+
// slash; encodeURIComponent never emits '/', so separators are preserved.
|
|
52
|
+
const enc = abs.split('/').map(encodeURIComponent).join('/');
|
|
53
|
+
if (cfg.editor === 'vscode') {
|
|
54
|
+
// Deep link: vscode://file<enc> (enc already starts with '/')
|
|
55
|
+
const url = `vscode://file${enc}`;
|
|
56
|
+
fire('open', [url]);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// Default: Cursor deep link: cursor://file<enc>
|
|
60
|
+
const url = `cursor://file${enc}`;
|
|
61
|
+
fire('open', [url]);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Reveal `path` in macOS Finder.
|
|
66
|
+
* Uses `open <path>` which opens directories in Finder and files with their
|
|
67
|
+
* default app. For "reveal in Finder" semantics on a file, callers can pass
|
|
68
|
+
* the parent directory instead.
|
|
69
|
+
*/
|
|
70
|
+
export function openInFinder(path) {
|
|
71
|
+
const abs = resolve(path);
|
|
72
|
+
fire('open', [abs]);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Open a new Terminal window cd'd to `path` (best-effort).
|
|
76
|
+
*
|
|
77
|
+
* Uses `open -a Terminal <path>`. On macOS this opens a new Terminal window
|
|
78
|
+
* at the given directory when path is a directory. For files, Terminal opens
|
|
79
|
+
* at the parent directory. No guarantee for iTerm2 or other terminals — this
|
|
80
|
+
* targets the system Terminal.app only.
|
|
81
|
+
*/
|
|
82
|
+
export function openInTerminal(path) {
|
|
83
|
+
const abs = resolve(path);
|
|
84
|
+
fire('open', ['-a', 'Terminal', abs]);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=open.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.js","sourceRoot":"","sources":["../../src/cli/open.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E;;;GAGG;AACH,SAAS,IAAI,CAAC,GAAW,EAAE,IAAc;IACvC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE;YAC7B,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;QACH,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,gCAAgC;IAClC,CAAC;AACH,CAAC;AAED,8EAA8E;AAC9E,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: one read-only call that
|
|
5
|
+
* answers "what should I know before I start working here" — genome memory,
|
|
6
|
+
* health, backlog, pending proposals, portfolio attention.
|
|
7
|
+
*
|
|
8
|
+
* CLI-FIRST AGENT CONTRACT:
|
|
9
|
+
* - `--json` emits a stable OrientResult (src/core/types.ts) on stdout,
|
|
10
|
+
* no ANSI, exit 0. This shape is part of the M31 contract.
|
|
11
|
+
* - Exit codes: 0 success, 2 bad usage. (Sections are best-effort; a
|
|
12
|
+
* missing store yields empty sections, never a non-zero exit.)
|
|
13
|
+
*/
|
|
14
|
+
export declare function cmdOrient(args: string[]): Promise<number>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cli/orient.ts — `ashlr orient [--repo <r>] [--json]` (M31).
|
|
3
|
+
*
|
|
4
|
+
* The session-start command for agents AND humans: one read-only call that
|
|
5
|
+
* answers "what should I know before I start working here" — genome memory,
|
|
6
|
+
* health, backlog, pending proposals, portfolio attention.
|
|
7
|
+
*
|
|
8
|
+
* CLI-FIRST AGENT CONTRACT:
|
|
9
|
+
* - `--json` emits a stable OrientResult (src/core/types.ts) on stdout,
|
|
10
|
+
* no ANSI, exit 0. This shape is part of the M31 contract.
|
|
11
|
+
* - Exit codes: 0 success, 2 bad usage. (Sections are best-effort; a
|
|
12
|
+
* missing store yields empty sections, never a non-zero exit.)
|
|
13
|
+
*/
|
|
14
|
+
import { loadConfig } from '../core/config.js';
|
|
15
|
+
import { buildOrientation } from '../core/orient.js';
|
|
16
|
+
import { makeColors, isTty, pad } from './ui.js';
|
|
17
|
+
function printOrientHelp() {
|
|
18
|
+
const c = makeColors(isTty());
|
|
19
|
+
console.log('');
|
|
20
|
+
console.log(c.bold(' ashlr orient') + c.dim(' — session-start context (read-only)'));
|
|
21
|
+
console.log('');
|
|
22
|
+
console.log(' Usage:');
|
|
23
|
+
console.log(` ${c.cyan('ashlr orient')} ${c.dim('portfolio-wide orientation')}`);
|
|
24
|
+
console.log(` ${c.cyan('ashlr orient --repo <path>')} ${c.dim('scope to one repo')}`);
|
|
25
|
+
console.log(` ${c.cyan('ashlr orient --json')} ${c.dim('stable OrientResult JSON (agent contract)')}`);
|
|
26
|
+
console.log('');
|
|
27
|
+
console.log(' ' + c.dim('Agents: run this once at session start; see `ashlr docs --agent`.'));
|
|
28
|
+
console.log('');
|
|
29
|
+
}
|
|
30
|
+
export async function cmdOrient(args) {
|
|
31
|
+
const json = args.includes('--json');
|
|
32
|
+
let repo;
|
|
33
|
+
for (let i = 0; i < args.length; i++) {
|
|
34
|
+
const a = args[i];
|
|
35
|
+
if (a === '--json')
|
|
36
|
+
continue;
|
|
37
|
+
if (a === '--help' || a === '-h' || a === 'help') {
|
|
38
|
+
printOrientHelp();
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
if (a === '--repo') {
|
|
42
|
+
const val = args[i + 1];
|
|
43
|
+
if (!val || val.startsWith('--')) {
|
|
44
|
+
process.stderr.write('error: --repo requires a path\n');
|
|
45
|
+
return 2;
|
|
46
|
+
}
|
|
47
|
+
repo = val;
|
|
48
|
+
i++;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
process.stderr.write(`error: unknown argument: ${a}\n`);
|
|
52
|
+
printOrientHelp();
|
|
53
|
+
return 2;
|
|
54
|
+
}
|
|
55
|
+
const cfg = loadConfig();
|
|
56
|
+
const result = await buildOrientation(cfg, repo);
|
|
57
|
+
if (json) {
|
|
58
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
const c = makeColors(isTty());
|
|
62
|
+
console.log('');
|
|
63
|
+
console.log(c.bold(' ashlr orient') +
|
|
64
|
+
c.dim(result.repo ? ` — ${result.repo}` : ' — portfolio-wide'));
|
|
65
|
+
console.log('');
|
|
66
|
+
// ── Memory ──────────────────────────────────────────────────────────────
|
|
67
|
+
console.log(' ' + c.bold('Memory') + c.dim(` (${result.genomeHits.length} hits)`));
|
|
68
|
+
if (result.genomeHits.length === 0) {
|
|
69
|
+
console.log(c.dim(' none — seed with `ashlr learn "<text>"`'));
|
|
70
|
+
}
|
|
71
|
+
for (const hit of result.genomeHits) {
|
|
72
|
+
const scope = hit.project ? c.dim(` [${hit.project}]`) : '';
|
|
73
|
+
console.log(` ${c.cyan('•')} ${hit.title}${scope}`);
|
|
74
|
+
}
|
|
75
|
+
console.log('');
|
|
76
|
+
// ── Health ──────────────────────────────────────────────────────────────
|
|
77
|
+
console.log(' ' + c.bold('Health'));
|
|
78
|
+
if (result.health) {
|
|
79
|
+
console.log(` ${c.cyan(String(result.health.score))} (${result.health.grade})` +
|
|
80
|
+
(result.health.worstDimensions.length
|
|
81
|
+
? c.dim(` worst: ${result.health.worstDimensions.join(', ')}`)
|
|
82
|
+
: ''));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
console.log(c.dim(' no health report — run `ashlr health`'));
|
|
86
|
+
}
|
|
87
|
+
console.log('');
|
|
88
|
+
// ── Backlog ─────────────────────────────────────────────────────────────
|
|
89
|
+
console.log(' ' + c.bold('Backlog') + c.dim(` (top ${result.backlogItems.length})`));
|
|
90
|
+
if (result.backlogItems.length === 0) {
|
|
91
|
+
console.log(c.dim(' none persisted — run `ashlr backlog refresh`'));
|
|
92
|
+
}
|
|
93
|
+
for (const item of result.backlogItems) {
|
|
94
|
+
console.log(` ${c.cyan(pad(String(item.score), 4, 'right'))} ${c.dim(`[${item.source}]`)} ${item.title}`);
|
|
95
|
+
}
|
|
96
|
+
console.log('');
|
|
97
|
+
// ── Attention + inbox ───────────────────────────────────────────────────
|
|
98
|
+
const att = result.attention;
|
|
99
|
+
const attText = att
|
|
100
|
+
? `${att.dirtyRepos} dirty, ${att.staleRepos} stale repos`
|
|
101
|
+
: 'no index — run `ashlr index`';
|
|
102
|
+
console.log(' ' + c.bold('Attention ') + attText);
|
|
103
|
+
console.log(' ' + c.bold('Inbox ') +
|
|
104
|
+
(result.pendingProposals > 0
|
|
105
|
+
? c.yellow(`${result.pendingProposals} pending proposal(s) — review with \`ashlr inbox\``)
|
|
106
|
+
: c.dim('no pending proposals')));
|
|
107
|
+
console.log('');
|
|
108
|
+
return 0;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=orient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orient.js","sourceRoot":"","sources":["../../src/cli/orient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAEjD,SAAS,eAAe;IACtB,MAAM,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;IAC9B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC,GAAG,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC;IACtG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;IAC7F,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,2CAA2C,CAAC,EAAE,CAAC,CAAC;IAC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C,OAAO,CAAC,GAAG,CACT,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,2EAA2E;IAC3E,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC;IAC7B,MAAM,OAAO,GAAG,GAAG;QACjB,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,WAAW,GAAG,CAAC,UAAU,cAAc;QAC1D,CAAC,CAAC,8BAA8B,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CACT,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC,MAAM,CAAC,gBAAgB,GAAG,CAAC;YAC1B,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,gBAAgB,oDAAoD,CAAC;YAC1F,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,CACnC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive item picker for the ashlr CLI.
|
|
3
|
+
*
|
|
4
|
+
* Strategy:
|
|
5
|
+
* 1. If stdout/stdin are not a TTY → return null (headless / piped).
|
|
6
|
+
* 2. If `fzf` is on PATH → pipe formatted lines into fzf and map the
|
|
7
|
+
* selection back to the originating IndexedItem.
|
|
8
|
+
* 3. Otherwise → built-in readline picker: numbered list with optional
|
|
9
|
+
* type-to-filter, arrow-free, works in every terminal.
|
|
10
|
+
*/
|
|
11
|
+
import type { IndexedItem } from '../core/types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Present an interactive picker over `items`.
|
|
14
|
+
*
|
|
15
|
+
* - Returns the chosen {@link IndexedItem}, or
|
|
16
|
+
* - `null` if the user cancelled, there are no items, or the process is
|
|
17
|
+
* not running in a TTY (headless / piped context).
|
|
18
|
+
*
|
|
19
|
+
* Prefers `fzf` when available; falls back to a built-in readline picker.
|
|
20
|
+
*/
|
|
21
|
+
export declare function pick(items: IndexedItem[]): Promise<IndexedItem | null>;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive item picker for the ashlr CLI.
|
|
3
|
+
*
|
|
4
|
+
* Strategy:
|
|
5
|
+
* 1. If stdout/stdin are not a TTY → return null (headless / piped).
|
|
6
|
+
* 2. If `fzf` is on PATH → pipe formatted lines into fzf and map the
|
|
7
|
+
* selection back to the originating IndexedItem.
|
|
8
|
+
* 3. Otherwise → built-in readline picker: numbered list with optional
|
|
9
|
+
* type-to-filter, arrow-free, works in every terminal.
|
|
10
|
+
*/
|
|
11
|
+
import { execFileSync, spawnSync } from 'node:child_process';
|
|
12
|
+
import * as readline from 'node:readline';
|
|
13
|
+
// ── Helpers ──────────────────────────────────────────────────────────────────
|
|
14
|
+
/** True when both stdin and stdout are connected to a real terminal. */
|
|
15
|
+
function isTTY() {
|
|
16
|
+
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
17
|
+
}
|
|
18
|
+
/** True when `fzf` can be found on PATH without throwing. */
|
|
19
|
+
function hasFzf() {
|
|
20
|
+
try {
|
|
21
|
+
execFileSync('which', ['fzf'], { stdio: 'pipe' });
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Format a single item into the line shown to the user.
|
|
30
|
+
* Format: "<name> [<category>] <description>"
|
|
31
|
+
* Each segment is tab-separated so fzf column alignment works.
|
|
32
|
+
*/
|
|
33
|
+
function formatLine(item) {
|
|
34
|
+
const cat = item.category ?? 'uncategorized';
|
|
35
|
+
const desc = item.description ?? item.kind;
|
|
36
|
+
return `${item.name}\t[${cat}]\t${desc}`;
|
|
37
|
+
}
|
|
38
|
+
// ── fzf picker ───────────────────────────────────────────────────────────────
|
|
39
|
+
/**
|
|
40
|
+
* Run the selection through fzf.
|
|
41
|
+
* Returns the chosen IndexedItem or null on cancel / error.
|
|
42
|
+
*/
|
|
43
|
+
function pickWithFzf(items) {
|
|
44
|
+
const lines = items.map(formatLine);
|
|
45
|
+
const input = lines.join('\n');
|
|
46
|
+
const result = spawnSync('fzf', ['--ansi', '--with-nth=1,2,3', '--delimiter=\t', '--height=40%', '--reverse', '--prompt=ashlr> '], {
|
|
47
|
+
input,
|
|
48
|
+
encoding: 'utf8',
|
|
49
|
+
stdio: ['pipe', 'pipe', 'inherit'],
|
|
50
|
+
});
|
|
51
|
+
// Exit code 130 = user cancelled (Ctrl-C / Esc); 1 = no match.
|
|
52
|
+
if (result.status !== 0 || !result.stdout) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const chosen = result.stdout.trim();
|
|
56
|
+
if (!chosen)
|
|
57
|
+
return null;
|
|
58
|
+
// Map the selected line back to the item by matching the formatted line.
|
|
59
|
+
const idx = lines.findIndex((l) => l === chosen);
|
|
60
|
+
return idx >= 0 ? items[idx] ?? null : null;
|
|
61
|
+
}
|
|
62
|
+
// ── Built-in readline picker ─────────────────────────────────────────────────
|
|
63
|
+
/**
|
|
64
|
+
* Simple numbered list picker with optional filter query.
|
|
65
|
+
* Renders up to `PAGE_SIZE` items at a time; user types a number or a
|
|
66
|
+
* filter string and presses Enter.
|
|
67
|
+
*/
|
|
68
|
+
const PAGE_SIZE = 20;
|
|
69
|
+
async function pickWithReadline(items) {
|
|
70
|
+
return new Promise((resolve) => {
|
|
71
|
+
// We open /dev/tty explicitly so the picker works even when stdin is
|
|
72
|
+
// redirected — though we already guard against non-TTY above.
|
|
73
|
+
// All picker UI is written to stderr so that stdout stays clean for
|
|
74
|
+
// capture (e.g. `cd $(ashlr go foo --cd)` must only ever see the chosen
|
|
75
|
+
// path on stdout, never the interactive prompt chrome).
|
|
76
|
+
const ttyIn = process.stdin;
|
|
77
|
+
const ttyOut = process.stderr;
|
|
78
|
+
/** Print a filtered, numbered list and the prompt. */
|
|
79
|
+
function renderList(filtered, filter) {
|
|
80
|
+
ttyOut.write('\x1B[2J\x1B[H'); // clear screen
|
|
81
|
+
ttyOut.write('\x1B[1mashlr picker\x1B[0m');
|
|
82
|
+
if (filter)
|
|
83
|
+
ttyOut.write(` filter: \x1B[33m${filter}\x1B[0m`);
|
|
84
|
+
ttyOut.write(` (${filtered.length} / ${items.length})\n\n`);
|
|
85
|
+
const page = filtered.slice(0, PAGE_SIZE);
|
|
86
|
+
for (let i = 0; i < page.length; i++) {
|
|
87
|
+
const item = page[i];
|
|
88
|
+
const num = String(i + 1).padStart(3, ' ');
|
|
89
|
+
const cat = item.category ? `\x1B[36m[${item.category}]\x1B[0m ` : '';
|
|
90
|
+
const desc = item.description ? `\x1B[2m— ${item.description}\x1B[0m` : '';
|
|
91
|
+
ttyOut.write(` ${num}. \x1B[1m${item.name}\x1B[0m ${cat}${desc}\n`);
|
|
92
|
+
}
|
|
93
|
+
if (filtered.length > PAGE_SIZE) {
|
|
94
|
+
ttyOut.write(`\n … and ${filtered.length - PAGE_SIZE} more. Narrow your filter.\n`);
|
|
95
|
+
}
|
|
96
|
+
ttyOut.write('\nType a number to select, text to filter, or Enter to cancel: ');
|
|
97
|
+
}
|
|
98
|
+
const rl = readline.createInterface({
|
|
99
|
+
input: ttyIn,
|
|
100
|
+
output: ttyOut,
|
|
101
|
+
terminal: true,
|
|
102
|
+
});
|
|
103
|
+
let currentFilter = '';
|
|
104
|
+
let filtered = [...items];
|
|
105
|
+
/** Re-render and ask for the next input. */
|
|
106
|
+
function prompt() {
|
|
107
|
+
renderList(filtered, currentFilter);
|
|
108
|
+
rl.question('', (answer) => {
|
|
109
|
+
const trimmed = answer.trim();
|
|
110
|
+
// Empty input → cancel
|
|
111
|
+
if (!trimmed) {
|
|
112
|
+
rl.close();
|
|
113
|
+
resolve(null);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
// Numeric input → pick by displayed index (1-based)
|
|
117
|
+
const num = parseInt(trimmed, 10);
|
|
118
|
+
const isAllDigits = /^\d+$/.test(trimmed);
|
|
119
|
+
if (!isNaN(num) && num >= 1 && num <= Math.min(filtered.length, PAGE_SIZE)) {
|
|
120
|
+
rl.close();
|
|
121
|
+
resolve(filtered[num - 1] ?? null);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
// All-digit input that is out of the visible selection range is clearly
|
|
125
|
+
// a (mis-typed) selection, not a filter. Tell the user and re-prompt
|
|
126
|
+
// WITHOUT clobbering their current filter.
|
|
127
|
+
if (isAllDigits) {
|
|
128
|
+
ttyOut.write(`\n \x1B[31mNo item #${trimmed} on this page.\x1B[0m Narrow your filter and pick again.\n`);
|
|
129
|
+
prompt();
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
// Text input → update filter and re-render
|
|
133
|
+
currentFilter = trimmed.toLowerCase();
|
|
134
|
+
filtered = items.filter((item) => {
|
|
135
|
+
const haystack = [item.name, item.category, item.description, item.kind]
|
|
136
|
+
.filter(Boolean)
|
|
137
|
+
.join(' ')
|
|
138
|
+
.toLowerCase();
|
|
139
|
+
return haystack.includes(currentFilter);
|
|
140
|
+
});
|
|
141
|
+
if (filtered.length === 0) {
|
|
142
|
+
// No matches — reset filter and let user try again
|
|
143
|
+
ttyOut.write('\n \x1B[31mNo matches for that filter.\x1B[0m Press Enter to cancel or type another query.\n');
|
|
144
|
+
currentFilter = '';
|
|
145
|
+
filtered = [...items];
|
|
146
|
+
}
|
|
147
|
+
prompt();
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
// Handle Ctrl-C gracefully
|
|
151
|
+
rl.on('close', () => {
|
|
152
|
+
resolve(null);
|
|
153
|
+
});
|
|
154
|
+
prompt();
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
// ── Public API ────────────────────────────────────────────────────────────────
|
|
158
|
+
/**
|
|
159
|
+
* Present an interactive picker over `items`.
|
|
160
|
+
*
|
|
161
|
+
* - Returns the chosen {@link IndexedItem}, or
|
|
162
|
+
* - `null` if the user cancelled, there are no items, or the process is
|
|
163
|
+
* not running in a TTY (headless / piped context).
|
|
164
|
+
*
|
|
165
|
+
* Prefers `fzf` when available; falls back to a built-in readline picker.
|
|
166
|
+
*/
|
|
167
|
+
export async function pick(items) {
|
|
168
|
+
if (items.length === 0)
|
|
169
|
+
return null;
|
|
170
|
+
if (!isTTY())
|
|
171
|
+
return null;
|
|
172
|
+
if (hasFzf()) {
|
|
173
|
+
return pickWithFzf(items);
|
|
174
|
+
}
|
|
175
|
+
return pickWithReadline(items);
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker.js","sourceRoot":"","sources":["../../src/cli/picker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAG1C,gFAAgF;AAEhF,wEAAwE;AACxE,SAAS,KAAK;IACZ,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAED,6DAA6D;AAC7D,SAAS,MAAM;IACb,IAAI,CAAC;QACH,YAAY,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE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AAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YAClB,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,MAAM,EAAE,CAAC;IACX,CAAC,CAAC,CAAC;AACL,CAAC;AAED,iFAAiF;AAEjF;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,KAAoB;IAC7C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,CAAC,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAE1B,IAAI,MAAM,EAAE,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cli/plugins.ts — `ashlr plugins list|info|enable|disable` + `ashlr x <name>` (M33).
|
|
3
|
+
*
|
|
4
|
+
* Trust posture (CONTRACT-M33 / docs/PLUGINS.md):
|
|
5
|
+
* - `list` / `info` are DISCOVERY ONLY — they read manifest.json files and
|
|
6
|
+
* NEVER import plugin code.
|
|
7
|
+
* - `enable` is the consent gate: shows declared capabilities + a trust
|
|
8
|
+
* warning, requires interactive confirmation (or --yes), and pins the
|
|
9
|
+
* entry file's sha256 into ~/.ashlr/config.json (tamper evidence).
|
|
10
|
+
* - `disable` removes the name from plugins.enabled (pin kept for re-enable).
|
|
11
|
+
* - `ashlr x <name> [...]` runs an enabled plugin's command through the
|
|
12
|
+
* wrapped (audited, exit-code-safe) runner.
|
|
13
|
+
*
|
|
14
|
+
* Exit codes: 0 success · 1 runtime error · 2 bad usage.
|
|
15
|
+
*/
|
|
16
|
+
export declare function cmdPlugins(args: string[]): Promise<number>;
|
|
17
|
+
/**
|
|
18
|
+
* `ashlr x <name> [args...]` — run an enabled plugin's command (wrapped:
|
|
19
|
+
* audited invocation + exit code; builtin shadowing rejected at load).
|
|
20
|
+
*/
|
|
21
|
+
export declare function cmdX(args: string[]): Promise<number>;
|