@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,450 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* classify.ts — cheap, synchronous heuristics for categorising Desktop items.
|
|
3
|
+
*
|
|
4
|
+
* Rules:
|
|
5
|
+
* - Never throw; return null / 'other' on any error.
|
|
6
|
+
* - Zero runtime deps (Node builtins only).
|
|
7
|
+
* - Synchronous everywhere — called in a tight scan loop.
|
|
8
|
+
*/
|
|
9
|
+
import fs from 'node:fs';
|
|
10
|
+
import path from 'node:path';
|
|
11
|
+
import os from 'node:os';
|
|
12
|
+
import { loadConfig } from './config.js';
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Internal helpers
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
/**
|
|
17
|
+
* Resolve the active config. We intentionally do NOT cache across calls:
|
|
18
|
+
* `loadConfig()` reads a tiny JSON file and a stale cache would yield wrong
|
|
19
|
+
* categories if the config changes between scans (or between tests). The cost
|
|
20
|
+
* is negligible relative to the filesystem work each classify call already does.
|
|
21
|
+
*/
|
|
22
|
+
function cfg() {
|
|
23
|
+
try {
|
|
24
|
+
return loadConfig();
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
// loadConfig unavailable / config missing — return a minimal default.
|
|
28
|
+
return {
|
|
29
|
+
version: 1,
|
|
30
|
+
roots: [path.join(process.env['HOME'] ?? os.homedir(), 'Desktop')],
|
|
31
|
+
editor: 'cursor',
|
|
32
|
+
staleDays: 30,
|
|
33
|
+
categories: {},
|
|
34
|
+
tidyRules: [],
|
|
35
|
+
keepers: [],
|
|
36
|
+
models: { lmstudio: '', ollama: '', providerChain: [] },
|
|
37
|
+
telemetry: {},
|
|
38
|
+
tools: {},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Inline `.git` detection — avoids a circular dep on git.ts (which may not
|
|
44
|
+
* exist when classify.ts is compiled in isolation).
|
|
45
|
+
*/
|
|
46
|
+
function hasGitDir(dir) {
|
|
47
|
+
try {
|
|
48
|
+
const gitPath = path.join(dir, '.git');
|
|
49
|
+
const st = fs.lstatSync(gitPath);
|
|
50
|
+
// .git is either a directory (normal clone) or a file (worktree/submodule)
|
|
51
|
+
return st.isDirectory() || st.isFile();
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** Read a file as UTF-8 text, return null on any error. */
|
|
58
|
+
function readText(filePath) {
|
|
59
|
+
try {
|
|
60
|
+
return fs.readFileSync(filePath, 'utf8');
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Truncate a string to at most `max` characters (full words not required). */
|
|
67
|
+
function cap(s, max = 160) {
|
|
68
|
+
return s.length <= max ? s : s.slice(0, max - 1) + '…';
|
|
69
|
+
}
|
|
70
|
+
// ---------------------------------------------------------------------------
|
|
71
|
+
// Known doc-category folder basenames (top-level Desktop directories that
|
|
72
|
+
// are NOT git repos and are NOT under github/).
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
const DOC_CATEGORY_FOLDERS = new Set([
|
|
75
|
+
'Business',
|
|
76
|
+
'Client-Work',
|
|
77
|
+
'Product-Docs',
|
|
78
|
+
'Knowledge',
|
|
79
|
+
'Assets',
|
|
80
|
+
'archive',
|
|
81
|
+
// sub-folders users commonly have
|
|
82
|
+
'CMP',
|
|
83
|
+
'RDE',
|
|
84
|
+
'Aether',
|
|
85
|
+
'Chaos-Engine',
|
|
86
|
+
]);
|
|
87
|
+
// File extensions considered "documents".
|
|
88
|
+
const DOC_EXTENSIONS = new Set([
|
|
89
|
+
'.md', '.markdown', '.txt', '.rst', '.pdf', '.docx', '.doc',
|
|
90
|
+
'.pages', '.rtf', '.tex', '.org', '.adoc', '.asciidoc',
|
|
91
|
+
'.html', '.htm', '.csv', '.xlsx', '.xls', '.json', '.yaml', '.yml',
|
|
92
|
+
'.toml', '.ini', '.conf', '.env',
|
|
93
|
+
]);
|
|
94
|
+
// File extensions considered "assets" (images, media, fonts, …).
|
|
95
|
+
const ASSET_EXTENSIONS = new Set([
|
|
96
|
+
'.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', '.bmp', '.tiff',
|
|
97
|
+
'.mp4', '.mov', '.avi', '.mkv', '.webm', '.mp3', '.wav', '.flac', '.aac',
|
|
98
|
+
'.m4a', '.ogg', '.otf', '.ttf', '.woff', '.woff2', '.eot',
|
|
99
|
+
'.zip', '.tar', '.gz', '.bz2', '.7z', '.rar',
|
|
100
|
+
'.sketch', '.fig', '.xd', '.psd', '.ai',
|
|
101
|
+
]);
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
// categoryOf
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
/**
|
|
106
|
+
* Return the category bucket for `itemPath`:
|
|
107
|
+
* - For a path under `github/<category>/<repo>` → the category name
|
|
108
|
+
* (e.g. "dev-tools", "side-projects").
|
|
109
|
+
* - For a path directly under the Desktop (or its known doc folders) →
|
|
110
|
+
* the top-level folder name (e.g. "Business", "Client-Work").
|
|
111
|
+
* - Otherwise → null.
|
|
112
|
+
*/
|
|
113
|
+
export function categoryOf(itemPath) {
|
|
114
|
+
try {
|
|
115
|
+
const config = cfg();
|
|
116
|
+
// 1. Check against configured categories map (category → absolute dir).
|
|
117
|
+
// A repo at /…/github/dev-tools/my-repo has itemPath that starts with
|
|
118
|
+
// the category dir.
|
|
119
|
+
for (const [name, catDir] of Object.entries(config.categories)) {
|
|
120
|
+
const normalCat = catDir.endsWith('/') ? catDir : catDir + '/';
|
|
121
|
+
if (itemPath.startsWith(normalCat) || itemPath === catDir) {
|
|
122
|
+
return name;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// 2. Heuristic: detect github/<category> in path segments.
|
|
126
|
+
// Works even when categories map is empty (e.g. during first run).
|
|
127
|
+
const parts = itemPath.split(path.sep);
|
|
128
|
+
const githubIdx = parts.lastIndexOf('github');
|
|
129
|
+
if (githubIdx !== -1 && githubIdx + 1 < parts.length) {
|
|
130
|
+
const category = parts[githubIdx + 1];
|
|
131
|
+
// Must be a known-style category (not a repo name) — the item itself
|
|
132
|
+
// is at githubIdx+2 or deeper.
|
|
133
|
+
if (category && githubIdx + 2 <= parts.length - 1) {
|
|
134
|
+
return category;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// 3. Top-level Desktop folder: if the item's parent matches a doc folder.
|
|
138
|
+
// Resolve the Desktop root explicitly rather than assuming roots[0] is
|
|
139
|
+
// the Desktop — roots[0] is typically '.../Desktop/github', which would
|
|
140
|
+
// make every relative path start with '..' and silently disable this
|
|
141
|
+
// heuristic. Prefer a root whose basename is 'Desktop', else strip a
|
|
142
|
+
// trailing '/github' from a github root, else fall back to HOME/Desktop.
|
|
143
|
+
const desktop = config.roots.find((r) => path.basename(r) === 'Desktop') ??
|
|
144
|
+
(() => {
|
|
145
|
+
const gh = config.roots.find((r) => path.basename(r) === 'github');
|
|
146
|
+
if (gh)
|
|
147
|
+
return path.dirname(gh);
|
|
148
|
+
return path.join(process.env['HOME'] ?? '', 'Desktop');
|
|
149
|
+
})();
|
|
150
|
+
const rel = path.relative(desktop, itemPath);
|
|
151
|
+
if (!rel.startsWith('..') && rel !== '') {
|
|
152
|
+
const topSegment = rel.split(path.sep)[0];
|
|
153
|
+
if (topSegment && DOC_CATEGORY_FOLDERS.has(topSegment)) {
|
|
154
|
+
return topSegment;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// ---------------------------------------------------------------------------
|
|
164
|
+
// describe
|
|
165
|
+
// ---------------------------------------------------------------------------
|
|
166
|
+
/**
|
|
167
|
+
* Return a one-line description for `itemPath` (a directory or file):
|
|
168
|
+
* 1. package.json "description" field (if present and non-empty).
|
|
169
|
+
* 2. First H1 (`# …`) in README.md / README.markdown / README (stripped of `#`).
|
|
170
|
+
* 3. First non-empty non-heading line in the README.
|
|
171
|
+
* 4. null if none found.
|
|
172
|
+
*
|
|
173
|
+
* Capped at 160 characters.
|
|
174
|
+
*/
|
|
175
|
+
export function describe(itemPath) {
|
|
176
|
+
try {
|
|
177
|
+
// Determine directory to search
|
|
178
|
+
let dir;
|
|
179
|
+
try {
|
|
180
|
+
const st = fs.lstatSync(itemPath);
|
|
181
|
+
dir = st.isDirectory() ? itemPath : path.dirname(itemPath);
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
// 1. README first H1 (highest priority per contract).
|
|
187
|
+
const readmeCandidates = [
|
|
188
|
+
'README.md', 'README.markdown', 'README.txt', 'README.rst', 'README',
|
|
189
|
+
'readme.md', 'Readme.md',
|
|
190
|
+
];
|
|
191
|
+
for (const fname of readmeCandidates) {
|
|
192
|
+
const text = readText(path.join(dir, fname));
|
|
193
|
+
if (!text)
|
|
194
|
+
continue;
|
|
195
|
+
const lines = text.split('\n');
|
|
196
|
+
for (const line of lines) {
|
|
197
|
+
// Markdown H1: # Title
|
|
198
|
+
const h1Match = line.match(/^#\s+(.+)/);
|
|
199
|
+
if (h1Match && h1Match[1]) {
|
|
200
|
+
const title = h1Match[1].trim();
|
|
201
|
+
if (title)
|
|
202
|
+
return cap(title);
|
|
203
|
+
}
|
|
204
|
+
// HTML H1: <h1>Title</h1> or <h1>Title (unclosed)
|
|
205
|
+
const htmlH1Match = line.match(/<h1[^>]*>(.*?)<\/h1>/i)
|
|
206
|
+
?? line.match(/<h1[^>]*>([^<]+)/i);
|
|
207
|
+
if (htmlH1Match && htmlH1Match[1]) {
|
|
208
|
+
const title = htmlH1Match[1].trim();
|
|
209
|
+
if (title)
|
|
210
|
+
return cap(title);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// README present but no H1 — stop scanning further README candidates;
|
|
214
|
+
// fall through to package.json. (No body-line fallback by design.)
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
// 2. package.json "description" fallback.
|
|
218
|
+
const pkgText = readText(path.join(dir, 'package.json'));
|
|
219
|
+
if (pkgText) {
|
|
220
|
+
try {
|
|
221
|
+
const pkg = JSON.parse(pkgText);
|
|
222
|
+
if (typeof pkg['description'] === 'string' && pkg['description'].trim()) {
|
|
223
|
+
return cap(pkg['description'].trim());
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
// malformed JSON — fall through
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// ---------------------------------------------------------------------------
|
|
237
|
+
// primaryLanguage
|
|
238
|
+
// ---------------------------------------------------------------------------
|
|
239
|
+
/** Extension → language name map for source-counting fallback. */
|
|
240
|
+
const EXT_LANGUAGE = {
|
|
241
|
+
'.ts': 'TypeScript',
|
|
242
|
+
'.tsx': 'TypeScript',
|
|
243
|
+
'.js': 'JavaScript',
|
|
244
|
+
'.jsx': 'JavaScript',
|
|
245
|
+
'.mjs': 'JavaScript',
|
|
246
|
+
'.cjs': 'JavaScript',
|
|
247
|
+
'.py': 'Python',
|
|
248
|
+
'.rs': 'Rust',
|
|
249
|
+
'.go': 'Go',
|
|
250
|
+
'.swift': 'Swift',
|
|
251
|
+
'.rb': 'Ruby',
|
|
252
|
+
'.java': 'Java',
|
|
253
|
+
'.kt': 'Kotlin',
|
|
254
|
+
'.cs': 'C#',
|
|
255
|
+
'.cpp': 'C++',
|
|
256
|
+
'.cc': 'C++',
|
|
257
|
+
'.cxx': 'C++',
|
|
258
|
+
'.c': 'C',
|
|
259
|
+
'.h': 'C',
|
|
260
|
+
'.hpp': 'C++',
|
|
261
|
+
'.php': 'PHP',
|
|
262
|
+
'.lua': 'Lua',
|
|
263
|
+
'.r': 'R',
|
|
264
|
+
'.R': 'R',
|
|
265
|
+
'.sh': 'Shell',
|
|
266
|
+
'.bash': 'Shell',
|
|
267
|
+
'.zsh': 'Shell',
|
|
268
|
+
'.fish': 'Shell',
|
|
269
|
+
'.dart': 'Dart',
|
|
270
|
+
'.ex': 'Elixir',
|
|
271
|
+
'.exs': 'Elixir',
|
|
272
|
+
'.elm': 'Elm',
|
|
273
|
+
'.hs': 'Haskell',
|
|
274
|
+
'.clj': 'Clojure',
|
|
275
|
+
'.scala': 'Scala',
|
|
276
|
+
'.vue': 'Vue',
|
|
277
|
+
'.svelte': 'Svelte',
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Cheap heuristic language detection (no AST, no external tools):
|
|
281
|
+
* 1. package.json present → JavaScript or TypeScript (check for .ts devDeps).
|
|
282
|
+
* 2. Cargo.toml → Rust.
|
|
283
|
+
* 3. pyproject.toml | requirements.txt | setup.py → Python.
|
|
284
|
+
* 4. Package.swift → Swift.
|
|
285
|
+
* 5. go.mod → Go.
|
|
286
|
+
* 6. Gemfile | *.gemspec → Ruby.
|
|
287
|
+
* 7. pom.xml | build.gradle → Java/Kotlin.
|
|
288
|
+
* 8. Shallow directory scan — most common source extension wins.
|
|
289
|
+
* 9. null if undetermined.
|
|
290
|
+
*/
|
|
291
|
+
export function primaryLanguage(itemPath) {
|
|
292
|
+
try {
|
|
293
|
+
let dir;
|
|
294
|
+
try {
|
|
295
|
+
const st = fs.lstatSync(itemPath);
|
|
296
|
+
if (st.isSymbolicLink())
|
|
297
|
+
return null;
|
|
298
|
+
dir = st.isDirectory() ? itemPath : path.dirname(itemPath);
|
|
299
|
+
}
|
|
300
|
+
catch {
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
// Helper: does a file exist in dir?
|
|
304
|
+
const has = (fname) => {
|
|
305
|
+
try {
|
|
306
|
+
fs.accessSync(path.join(dir, fname));
|
|
307
|
+
return true;
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
// 1. package.json → JS or TS
|
|
314
|
+
if (has('package.json')) {
|
|
315
|
+
// If there are .ts files or typescript in devDeps → TypeScript
|
|
316
|
+
if (has('tsconfig.json') || has('tsconfig.base.json'))
|
|
317
|
+
return 'TypeScript';
|
|
318
|
+
const pkgText = readText(path.join(dir, 'package.json'));
|
|
319
|
+
if (pkgText) {
|
|
320
|
+
try {
|
|
321
|
+
const pkg = JSON.parse(pkgText);
|
|
322
|
+
const allDeps = {
|
|
323
|
+
...(pkg['dependencies'] ?? {}),
|
|
324
|
+
...(pkg['devDependencies'] ?? {}),
|
|
325
|
+
};
|
|
326
|
+
if ('typescript' in allDeps)
|
|
327
|
+
return 'TypeScript';
|
|
328
|
+
}
|
|
329
|
+
catch { /* fall through */ }
|
|
330
|
+
}
|
|
331
|
+
return 'JavaScript';
|
|
332
|
+
}
|
|
333
|
+
// 2. Rust
|
|
334
|
+
if (has('Cargo.toml'))
|
|
335
|
+
return 'Rust';
|
|
336
|
+
// 3. Python
|
|
337
|
+
if (has('pyproject.toml') || has('requirements.txt') || has('setup.py') || has('setup.cfg')) {
|
|
338
|
+
return 'Python';
|
|
339
|
+
}
|
|
340
|
+
// 4. Swift
|
|
341
|
+
if (has('Package.swift'))
|
|
342
|
+
return 'Swift';
|
|
343
|
+
// 5. Go
|
|
344
|
+
if (has('go.mod'))
|
|
345
|
+
return 'Go';
|
|
346
|
+
// 6. Ruby
|
|
347
|
+
if (has('Gemfile') || has('.gemspec'))
|
|
348
|
+
return 'Ruby';
|
|
349
|
+
// 7. Java / Kotlin
|
|
350
|
+
if (has('pom.xml'))
|
|
351
|
+
return 'Java';
|
|
352
|
+
if (has('build.gradle') || has('build.gradle.kts')) {
|
|
353
|
+
// build.gradle.kts → likely Kotlin
|
|
354
|
+
return has('build.gradle.kts') ? 'Kotlin' : 'Java';
|
|
355
|
+
}
|
|
356
|
+
// 8. Shallow extension-frequency scan
|
|
357
|
+
return dominantLanguageFromEntries(dir);
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
/** Count source extensions in a shallow directory listing and return the winner. */
|
|
364
|
+
function dominantLanguageFromEntries(dir) {
|
|
365
|
+
try {
|
|
366
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
367
|
+
const counts = {};
|
|
368
|
+
for (const entry of entries) {
|
|
369
|
+
if (!entry.isFile())
|
|
370
|
+
continue;
|
|
371
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
372
|
+
if (!ext || !(ext in EXT_LANGUAGE))
|
|
373
|
+
continue;
|
|
374
|
+
counts[ext] = (counts[ext] ?? 0) + 1;
|
|
375
|
+
}
|
|
376
|
+
// Also do one level deeper (src/)
|
|
377
|
+
const srcDir = path.join(dir, 'src');
|
|
378
|
+
try {
|
|
379
|
+
const srcEntries = fs.readdirSync(srcDir, { withFileTypes: true });
|
|
380
|
+
for (const entry of srcEntries) {
|
|
381
|
+
if (!entry.isFile())
|
|
382
|
+
continue;
|
|
383
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
384
|
+
if (!ext || !(ext in EXT_LANGUAGE))
|
|
385
|
+
continue;
|
|
386
|
+
// Weight src/ files slightly higher
|
|
387
|
+
counts[ext] = (counts[ext] ?? 0) + 2;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
catch { /* src/ may not exist */ }
|
|
391
|
+
let bestExt = null;
|
|
392
|
+
let bestCount = 0;
|
|
393
|
+
for (const [ext, count] of Object.entries(counts)) {
|
|
394
|
+
if (count > bestCount) {
|
|
395
|
+
bestCount = count;
|
|
396
|
+
bestExt = ext;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return bestExt ? (EXT_LANGUAGE[bestExt] ?? null) : null;
|
|
400
|
+
}
|
|
401
|
+
catch {
|
|
402
|
+
return null;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
// ---------------------------------------------------------------------------
|
|
406
|
+
// kindOf
|
|
407
|
+
// ---------------------------------------------------------------------------
|
|
408
|
+
/**
|
|
409
|
+
* Determine the fundamental kind of `itemPath`:
|
|
410
|
+
* - 'symlink' — lstat shows it's a symbolic link (checked first).
|
|
411
|
+
* - 'repo' — directory that contains a .git entry.
|
|
412
|
+
* - 'doc-folder' — directory whose basename is a known doc-category folder.
|
|
413
|
+
* - 'doc' — file with a document extension.
|
|
414
|
+
* - 'asset' — file with an image/media/archive extension.
|
|
415
|
+
* - 'other' — anything else.
|
|
416
|
+
*/
|
|
417
|
+
export function kindOf(itemPath) {
|
|
418
|
+
try {
|
|
419
|
+
// Use lstat so we inspect the link itself, not its target.
|
|
420
|
+
const st = fs.lstatSync(itemPath);
|
|
421
|
+
// 1. Symlink — highest priority
|
|
422
|
+
if (st.isSymbolicLink())
|
|
423
|
+
return 'symlink';
|
|
424
|
+
if (st.isDirectory()) {
|
|
425
|
+
// 2. Repo — has .git dir or file
|
|
426
|
+
if (hasGitDir(itemPath))
|
|
427
|
+
return 'repo';
|
|
428
|
+
// 3. Known doc-category folder
|
|
429
|
+
const base = path.basename(itemPath);
|
|
430
|
+
if (DOC_CATEGORY_FOLDERS.has(base))
|
|
431
|
+
return 'doc-folder';
|
|
432
|
+
return 'other';
|
|
433
|
+
}
|
|
434
|
+
if (st.isFile()) {
|
|
435
|
+
const ext = path.extname(itemPath).toLowerCase();
|
|
436
|
+
// 4. Document
|
|
437
|
+
if (DOC_EXTENSIONS.has(ext))
|
|
438
|
+
return 'doc';
|
|
439
|
+
// 5. Asset
|
|
440
|
+
if (ASSET_EXTENSIONS.has(ext))
|
|
441
|
+
return 'asset';
|
|
442
|
+
return 'other';
|
|
443
|
+
}
|
|
444
|
+
return 'other';
|
|
445
|
+
}
|
|
446
|
+
catch {
|
|
447
|
+
return 'other';
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
//# sourceMappingURL=classify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../../src/core/classify.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E;;;;;GAKG;AACH,SAAS,GAAG;IACV,IAAI,CAAC;QACH,OAAO,UAAU,EAAE,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,sEAAsE;QACtE,OAAO;YACL,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;YAClE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ACjB,CAAC;QAED,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;YAChB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;YAEjD,cAAc;YACd,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,KAAK,CAAC;YAE1C,WAAW;YACX,IAAI,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,OAAO,CAAC;YAE9C,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { AshlrConfig } from './types.js';
|
|
2
|
+
/** Absolute path to the hub's config/index home: ~/.ashlr */
|
|
3
|
+
export declare const CONFIG_DIR: string;
|
|
4
|
+
/** Absolute path to the config file: ~/.ashlr/config.json */
|
|
5
|
+
export declare const CONFIG_PATH: string;
|
|
6
|
+
/** Absolute path to the index file: ~/.ashlr/index.json */
|
|
7
|
+
export declare const INDEX_PATH: string;
|
|
8
|
+
/**
|
|
9
|
+
* Absolute path to the M26 self-improvement / meta-learning home:
|
|
10
|
+
* `~/.ashlr/learn`. Re-resolved from `homedir()` at call time so tests that
|
|
11
|
+
* relocate HOME work. This is the ONLY directory `ashlr reflect` writes to for
|
|
12
|
+
* its reports/snapshots — it NEVER writes CONFIG_PATH / router policy / prompts.
|
|
13
|
+
* This function does NOT create the directory; the learn store creates it lazily.
|
|
14
|
+
*/
|
|
15
|
+
export declare function learnDir(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Absolute path to the M27 quality / health-review home: `~/.ashlr/quality`.
|
|
18
|
+
* Re-resolved from `homedir()` at call time so tests that relocate HOME work.
|
|
19
|
+
* This is the ONLY directory `ashlr health` writes to for its HealthReport
|
|
20
|
+
* snapshots (trend tracking) — it NEVER writes CONFIG_PATH / router policy /
|
|
21
|
+
* prompts, and NEVER touches a user repo working tree. This function does NOT
|
|
22
|
+
* create the directory; the quality store creates it lazily.
|
|
23
|
+
*/
|
|
24
|
+
export declare function qualityDir(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Absolute path to the M28 goal planning/tracking home: `~/.ashlr/goals`.
|
|
27
|
+
* Re-resolved from `homedir()` at call time so tests that relocate HOME work.
|
|
28
|
+
* This is the ONLY directory `ashlr goals` writes its planning/tracking data
|
|
29
|
+
* to — it NEVER writes CONFIG_PATH / router policy / prompts, and NEVER touches
|
|
30
|
+
* a user repo working tree. This function does NOT create the directory; the
|
|
31
|
+
* goals store creates it lazily. Single source of truth for the ~/.ashlr root.
|
|
32
|
+
*/
|
|
33
|
+
export declare function goalsDir(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Absolute path to the M29 portfolio-digest home: `~/.ashlr/digests`.
|
|
36
|
+
* Re-resolved from `homedir()` at call time so tests that relocate HOME work.
|
|
37
|
+
* This is the ONLY directory `ashlr digest` writes to (JSON + markdown digest
|
|
38
|
+
* artifacts for day-over-day trend) — it NEVER writes CONFIG_PATH / router
|
|
39
|
+
* policy / prompts, and NEVER touches a user repo working tree. This function
|
|
40
|
+
* does NOT create the directory; the digest store creates it lazily. Single
|
|
41
|
+
* source of truth for the ~/.ashlr root.
|
|
42
|
+
*/
|
|
43
|
+
export declare function digestsDir(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Produce a sensible default AshlrConfig for a fresh install.
|
|
46
|
+
* All paths are resolved to absolute values (no ~ remaining).
|
|
47
|
+
*/
|
|
48
|
+
export declare function defaultConfig(): AshlrConfig;
|
|
49
|
+
/**
|
|
50
|
+
* Load config from CONFIG_PATH.
|
|
51
|
+
* - If CONFIG_DIR does not exist, creates it.
|
|
52
|
+
* - If CONFIG_PATH does not exist, writes the default config and returns it.
|
|
53
|
+
* - Otherwise, reads the file, JSON-parses it, deep-merges over defaultConfig()
|
|
54
|
+
* (so new keys added in future versions are always present), and returns.
|
|
55
|
+
* - On parse error, logs a warning and falls back to the default config
|
|
56
|
+
* (we intentionally do NOT overwrite the user's potentially-fixable file).
|
|
57
|
+
*/
|
|
58
|
+
export declare function loadConfig(): AshlrConfig;
|
|
59
|
+
/**
|
|
60
|
+
* Persist `c` to CONFIG_PATH as pretty-printed JSON.
|
|
61
|
+
* Creates CONFIG_DIR if it does not yet exist.
|
|
62
|
+
*/
|
|
63
|
+
export declare function saveConfig(c: AshlrConfig): void;
|