@n-dx/core 0.1.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/LICENSE +96 -0
- package/README.md +214 -0
- package/ci.js +1243 -0
- package/claude-integration.js +331 -0
- package/cli.js +975 -0
- package/config.js +1054 -0
- package/export.js +509 -0
- package/help.js +1051 -0
- package/package.json +93 -0
- package/packages/hench/dist/agent/analysis/adaptive.d.ts +101 -0
- package/packages/hench/dist/agent/analysis/adaptive.js +353 -0
- package/packages/hench/dist/agent/analysis/adaptive.js.map +1 -0
- package/packages/hench/dist/agent/analysis/index.d.ts +26 -0
- package/packages/hench/dist/agent/analysis/index.js +30 -0
- package/packages/hench/dist/agent/analysis/index.js.map +1 -0
- package/packages/hench/dist/agent/analysis/review.d.ts +40 -0
- package/packages/hench/dist/agent/analysis/review.js +66 -0
- package/packages/hench/dist/agent/analysis/review.js.map +1 -0
- package/packages/hench/dist/agent/analysis/spin.d.ts +27 -0
- package/packages/hench/dist/agent/analysis/spin.js +32 -0
- package/packages/hench/dist/agent/analysis/spin.js.map +1 -0
- package/packages/hench/dist/agent/analysis/stuck.d.ts +22 -0
- package/packages/hench/dist/agent/analysis/stuck.js +56 -0
- package/packages/hench/dist/agent/analysis/stuck.js.map +1 -0
- package/packages/hench/dist/agent/analysis/summary.d.ts +9 -0
- package/packages/hench/dist/agent/analysis/summary.js +106 -0
- package/packages/hench/dist/agent/analysis/summary.js.map +1 -0
- package/packages/hench/dist/agent/analysis/workflow.d.ts +60 -0
- package/packages/hench/dist/agent/analysis/workflow.js +359 -0
- package/packages/hench/dist/agent/analysis/workflow.js.map +1 -0
- package/packages/hench/dist/agent/brief.d.ts +33 -0
- package/packages/hench/dist/agent/brief.js +235 -0
- package/packages/hench/dist/agent/brief.js.map +1 -0
- package/packages/hench/dist/agent/cli-loop.d.ts +43 -0
- package/packages/hench/dist/agent/cli-loop.js +469 -0
- package/packages/hench/dist/agent/cli-loop.js.map +1 -0
- package/packages/hench/dist/agent/completion.d.ts +8 -0
- package/packages/hench/dist/agent/completion.js +8 -0
- package/packages/hench/dist/agent/completion.js.map +1 -0
- package/packages/hench/dist/agent/index.d.ts +35 -0
- package/packages/hench/dist/agent/index.js +40 -0
- package/packages/hench/dist/agent/index.js.map +1 -0
- package/packages/hench/dist/agent/lifecycle/cli-loop.d.ts +65 -0
- package/packages/hench/dist/agent/lifecycle/cli-loop.js +882 -0
- package/packages/hench/dist/agent/lifecycle/cli-loop.js.map +1 -0
- package/packages/hench/dist/agent/lifecycle/heartbeat.d.ts +38 -0
- package/packages/hench/dist/agent/lifecycle/heartbeat.js +72 -0
- package/packages/hench/dist/agent/lifecycle/heartbeat.js.map +1 -0
- package/packages/hench/dist/agent/lifecycle/loop.d.ts +11 -0
- package/packages/hench/dist/agent/lifecycle/loop.js +300 -0
- package/packages/hench/dist/agent/lifecycle/loop.js.map +1 -0
- package/packages/hench/dist/agent/lifecycle/shared.d.ts +138 -0
- package/packages/hench/dist/agent/lifecycle/shared.js +241 -0
- package/packages/hench/dist/agent/lifecycle/shared.js.map +1 -0
- package/packages/hench/dist/agent/lifecycle/task-display.d.ts +7 -0
- package/packages/hench/dist/agent/lifecycle/task-display.js +22 -0
- package/packages/hench/dist/agent/lifecycle/task-display.js.map +1 -0
- package/packages/hench/dist/agent/lifecycle/token-budget.d.ts +18 -0
- package/packages/hench/dist/agent/lifecycle/token-budget.js +16 -0
- package/packages/hench/dist/agent/lifecycle/token-budget.js.map +1 -0
- package/packages/hench/dist/agent/lifecycle/token-usage.d.ts +44 -0
- package/packages/hench/dist/agent/lifecycle/token-usage.js +102 -0
- package/packages/hench/dist/agent/lifecycle/token-usage.js.map +1 -0
- package/packages/hench/dist/agent/loop.d.ts +24 -0
- package/packages/hench/dist/agent/loop.js +312 -0
- package/packages/hench/dist/agent/loop.js.map +1 -0
- package/packages/hench/dist/agent/planning/brief.d.ts +40 -0
- package/packages/hench/dist/agent/planning/brief.js +267 -0
- package/packages/hench/dist/agent/planning/brief.js.map +1 -0
- package/packages/hench/dist/agent/planning/prompt.d.ts +2 -0
- package/packages/hench/dist/agent/planning/prompt.js +73 -0
- package/packages/hench/dist/agent/planning/prompt.js.map +1 -0
- package/packages/hench/dist/agent/prompt.d.ts +2 -0
- package/packages/hench/dist/agent/prompt.js +65 -0
- package/packages/hench/dist/agent/prompt.js.map +1 -0
- package/packages/hench/dist/agent/review.d.ts +40 -0
- package/packages/hench/dist/agent/review.js +76 -0
- package/packages/hench/dist/agent/review.js.map +1 -0
- package/packages/hench/dist/agent/stuck.d.ts +22 -0
- package/packages/hench/dist/agent/stuck.js +56 -0
- package/packages/hench/dist/agent/stuck.js.map +1 -0
- package/packages/hench/dist/agent/summary.d.ts +9 -0
- package/packages/hench/dist/agent/summary.js +106 -0
- package/packages/hench/dist/agent/summary.js.map +1 -0
- package/packages/hench/dist/agent/test-runner.d.ts +81 -0
- package/packages/hench/dist/agent/test-runner.js +245 -0
- package/packages/hench/dist/agent/test-runner.js.map +1 -0
- package/packages/hench/dist/agent/token-budget.d.ts +18 -0
- package/packages/hench/dist/agent/token-budget.js +16 -0
- package/packages/hench/dist/agent/token-budget.js.map +1 -0
- package/packages/hench/dist/agent/token-usage.d.ts +27 -0
- package/packages/hench/dist/agent/token-usage.js +52 -0
- package/packages/hench/dist/agent/token-usage.js.map +1 -0
- package/packages/hench/dist/agent/tools.d.ts +8 -0
- package/packages/hench/dist/agent/tools.js +8 -0
- package/packages/hench/dist/agent/tools.js.map +1 -0
- package/packages/hench/dist/cli/commands/config.d.ts +40 -0
- package/packages/hench/dist/cli/commands/config.js +463 -0
- package/packages/hench/dist/cli/commands/config.js.map +1 -0
- package/packages/hench/dist/cli/commands/constants.d.ts +5 -0
- package/packages/hench/dist/cli/commands/constants.js +46 -0
- package/packages/hench/dist/cli/commands/constants.js.map +1 -0
- package/packages/hench/dist/cli/commands/init.d.ts +1 -0
- package/packages/hench/dist/cli/commands/init.js +22 -0
- package/packages/hench/dist/cli/commands/init.js.map +1 -0
- package/packages/hench/dist/cli/commands/run.d.ts +108 -0
- package/packages/hench/dist/cli/commands/run.js +847 -0
- package/packages/hench/dist/cli/commands/run.js.map +1 -0
- package/packages/hench/dist/cli/commands/show.d.ts +1 -0
- package/packages/hench/dist/cli/commands/show.js +101 -0
- package/packages/hench/dist/cli/commands/show.js.map +1 -0
- package/packages/hench/dist/cli/commands/status.d.ts +1 -0
- package/packages/hench/dist/cli/commands/status.js +63 -0
- package/packages/hench/dist/cli/commands/status.js.map +1 -0
- package/packages/hench/dist/cli/commands/task-lookup.d.ts +24 -0
- package/packages/hench/dist/cli/commands/task-lookup.js +69 -0
- package/packages/hench/dist/cli/commands/task-lookup.js.map +1 -0
- package/packages/hench/dist/cli/commands/template.d.ts +12 -0
- package/packages/hench/dist/cli/commands/template.js +217 -0
- package/packages/hench/dist/cli/commands/template.js.map +1 -0
- package/packages/hench/dist/cli/errors.d.ts +55 -0
- package/packages/hench/dist/cli/errors.js +185 -0
- package/packages/hench/dist/cli/errors.js.map +1 -0
- package/packages/hench/dist/cli/help.d.ts +23 -0
- package/packages/hench/dist/cli/help.js +186 -0
- package/packages/hench/dist/cli/help.js.map +1 -0
- package/packages/hench/dist/cli/index.d.ts +21 -0
- package/packages/hench/dist/cli/index.js +131 -0
- package/packages/hench/dist/cli/index.js.map +1 -0
- package/packages/hench/dist/cli/output.d.ts +9 -0
- package/packages/hench/dist/cli/output.js +10 -0
- package/packages/hench/dist/cli/output.js.map +1 -0
- package/packages/hench/dist/guard/commands.d.ts +27 -0
- package/packages/hench/dist/guard/commands.js +69 -0
- package/packages/hench/dist/guard/commands.js.map +1 -0
- package/packages/hench/dist/guard/contracts.d.ts +31 -0
- package/packages/hench/dist/guard/contracts.js +8 -0
- package/packages/hench/dist/guard/contracts.js.map +1 -0
- package/packages/hench/dist/guard/index.d.ts +107 -0
- package/packages/hench/dist/guard/index.js +139 -0
- package/packages/hench/dist/guard/index.js.map +1 -0
- package/packages/hench/dist/guard/paths.d.ts +43 -0
- package/packages/hench/dist/guard/paths.js +112 -0
- package/packages/hench/dist/guard/paths.js.map +1 -0
- package/packages/hench/dist/guard/policy.d.ts +108 -0
- package/packages/hench/dist/guard/policy.js +156 -0
- package/packages/hench/dist/guard/policy.js.map +1 -0
- package/packages/hench/dist/prd/llm-gateway.d.ts +47 -0
- package/packages/hench/dist/prd/llm-gateway.js +57 -0
- package/packages/hench/dist/prd/llm-gateway.js.map +1 -0
- package/packages/hench/dist/prd/ops.d.ts +5 -0
- package/packages/hench/dist/prd/ops.js +6 -0
- package/packages/hench/dist/prd/ops.js.map +1 -0
- package/packages/hench/dist/prd/rex-gateway.d.ts +95 -0
- package/packages/hench/dist/prd/rex-gateway.js +104 -0
- package/packages/hench/dist/prd/rex-gateway.js.map +1 -0
- package/packages/hench/dist/process/concurrent-execution-metrics.d.ts +243 -0
- package/packages/hench/dist/process/concurrent-execution-metrics.js +352 -0
- package/packages/hench/dist/process/concurrent-execution-metrics.js.map +1 -0
- package/packages/hench/dist/process/exec-shell.d.ts +8 -0
- package/packages/hench/dist/process/exec-shell.js +8 -0
- package/packages/hench/dist/process/exec-shell.js.map +1 -0
- package/packages/hench/dist/process/exec.d.ts +12 -0
- package/packages/hench/dist/process/exec.js +12 -0
- package/packages/hench/dist/process/exec.js.map +1 -0
- package/packages/hench/dist/process/index.d.ts +22 -0
- package/packages/hench/dist/process/index.js +15 -0
- package/packages/hench/dist/process/index.js.map +1 -0
- package/packages/hench/dist/process/lifecycle.d.ts +208 -0
- package/packages/hench/dist/process/lifecycle.js +387 -0
- package/packages/hench/dist/process/lifecycle.js.map +1 -0
- package/packages/hench/dist/process/limiter.d.ts +85 -0
- package/packages/hench/dist/process/limiter.js +215 -0
- package/packages/hench/dist/process/limiter.js.map +1 -0
- package/packages/hench/dist/process/memory-monitor.d.ts +162 -0
- package/packages/hench/dist/process/memory-monitor.js +268 -0
- package/packages/hench/dist/process/memory-monitor.js.map +1 -0
- package/packages/hench/dist/process/memory-throttle.d.ts +140 -0
- package/packages/hench/dist/process/memory-throttle.js +238 -0
- package/packages/hench/dist/process/memory-throttle.js.map +1 -0
- package/packages/hench/dist/process/pool.d.ts +231 -0
- package/packages/hench/dist/process/pool.js +344 -0
- package/packages/hench/dist/process/pool.js.map +1 -0
- package/packages/hench/dist/process/process-memory-tracker.d.ts +164 -0
- package/packages/hench/dist/process/process-memory-tracker.js +249 -0
- package/packages/hench/dist/process/process-memory-tracker.js.map +1 -0
- package/packages/hench/dist/public.d.ts +62 -0
- package/packages/hench/dist/public.js +58 -0
- package/packages/hench/dist/public.js.map +1 -0
- package/packages/hench/dist/queue/execution-queue.d.ts +128 -0
- package/packages/hench/dist/queue/execution-queue.js +206 -0
- package/packages/hench/dist/queue/execution-queue.js.map +1 -0
- package/packages/hench/dist/queue/format.d.ts +19 -0
- package/packages/hench/dist/queue/format.js +52 -0
- package/packages/hench/dist/queue/format.js.map +1 -0
- package/packages/hench/dist/queue/index.d.ts +5 -0
- package/packages/hench/dist/queue/index.js +4 -0
- package/packages/hench/dist/queue/index.js.map +1 -0
- package/packages/hench/dist/queue/priority-scheduler.d.ts +73 -0
- package/packages/hench/dist/queue/priority-scheduler.js +119 -0
- package/packages/hench/dist/queue/priority-scheduler.js.map +1 -0
- package/packages/hench/dist/schema/index.d.ts +6 -0
- package/packages/hench/dist/schema/index.js +4 -0
- package/packages/hench/dist/schema/index.js.map +1 -0
- package/packages/hench/dist/schema/templates.d.ts +34 -0
- package/packages/hench/dist/schema/templates.js +147 -0
- package/packages/hench/dist/schema/templates.js.map +1 -0
- package/packages/hench/dist/schema/v1.d.ts +235 -0
- package/packages/hench/dist/schema/v1.js +34 -0
- package/packages/hench/dist/schema/v1.js.map +1 -0
- package/packages/hench/dist/schema/validate.d.ts +601 -0
- package/packages/hench/dist/schema/validate.js +166 -0
- package/packages/hench/dist/schema/validate.js.map +1 -0
- package/packages/hench/dist/shared/glob.d.ts +11 -0
- package/packages/hench/dist/shared/glob.js +57 -0
- package/packages/hench/dist/shared/glob.js.map +1 -0
- package/packages/hench/dist/store/adjustments.d.ts +75 -0
- package/packages/hench/dist/store/adjustments.js +139 -0
- package/packages/hench/dist/store/adjustments.js.map +1 -0
- package/packages/hench/dist/store/config.d.ts +6 -0
- package/packages/hench/dist/store/config.js +41 -0
- package/packages/hench/dist/store/config.js.map +1 -0
- package/packages/hench/dist/store/index.d.ts +7 -0
- package/packages/hench/dist/store/index.js +6 -0
- package/packages/hench/dist/store/index.js.map +1 -0
- package/packages/hench/dist/store/json.d.ts +1 -0
- package/packages/hench/dist/store/json.js +3 -0
- package/packages/hench/dist/store/json.js.map +1 -0
- package/packages/hench/dist/store/project-config.d.ts +62 -0
- package/packages/hench/dist/store/project-config.js +100 -0
- package/packages/hench/dist/store/project-config.js.map +1 -0
- package/packages/hench/dist/store/run-archiver.d.ts +107 -0
- package/packages/hench/dist/store/run-archiver.js +204 -0
- package/packages/hench/dist/store/run-archiver.js.map +1 -0
- package/packages/hench/dist/store/run-change-detector.d.ts +99 -0
- package/packages/hench/dist/store/run-change-detector.js +170 -0
- package/packages/hench/dist/store/run-change-detector.js.map +1 -0
- package/packages/hench/dist/store/run-retention-scheduler.d.ts +80 -0
- package/packages/hench/dist/store/run-retention-scheduler.js +143 -0
- package/packages/hench/dist/store/run-retention-scheduler.js.map +1 -0
- package/packages/hench/dist/store/run-retention.d.ts +150 -0
- package/packages/hench/dist/store/run-retention.js +327 -0
- package/packages/hench/dist/store/run-retention.js.map +1 -0
- package/packages/hench/dist/store/runs.d.ts +4 -0
- package/packages/hench/dist/store/runs.js +80 -0
- package/packages/hench/dist/store/runs.js.map +1 -0
- package/packages/hench/dist/store/suggestions.d.ts +43 -0
- package/packages/hench/dist/store/suggestions.js +61 -0
- package/packages/hench/dist/store/suggestions.js.map +1 -0
- package/packages/hench/dist/store/templates.d.ts +34 -0
- package/packages/hench/dist/store/templates.js +119 -0
- package/packages/hench/dist/store/templates.js.map +1 -0
- package/packages/hench/dist/tools/contracts.d.ts +60 -0
- package/packages/hench/dist/tools/contracts.js +2 -0
- package/packages/hench/dist/tools/contracts.js.map +1 -0
- package/packages/hench/dist/tools/dispatch.d.ts +29 -0
- package/packages/hench/dist/tools/dispatch.js +213 -0
- package/packages/hench/dist/tools/dispatch.js.map +1 -0
- package/packages/hench/dist/tools/exec-shell.d.ts +23 -0
- package/packages/hench/dist/tools/exec-shell.js +29 -0
- package/packages/hench/dist/tools/exec-shell.js.map +1 -0
- package/packages/hench/dist/tools/files.d.ts +17 -0
- package/packages/hench/dist/tools/files.js +111 -0
- package/packages/hench/dist/tools/files.js.map +1 -0
- package/packages/hench/dist/tools/git.d.ts +5 -0
- package/packages/hench/dist/tools/git.js +48 -0
- package/packages/hench/dist/tools/git.js.map +1 -0
- package/packages/hench/dist/tools/index.d.ts +17 -0
- package/packages/hench/dist/tools/index.js +19 -0
- package/packages/hench/dist/tools/index.js.map +1 -0
- package/packages/hench/dist/tools/rex.d.ts +32 -0
- package/packages/hench/dist/tools/rex.js +185 -0
- package/packages/hench/dist/tools/rex.js.map +1 -0
- package/packages/hench/dist/tools/shell.d.ts +6 -0
- package/packages/hench/dist/tools/shell.js +10 -0
- package/packages/hench/dist/tools/shell.js.map +1 -0
- package/packages/hench/dist/tools/test-runner.d.ts +81 -0
- package/packages/hench/dist/tools/test-runner.js +229 -0
- package/packages/hench/dist/tools/test-runner.js.map +1 -0
- package/packages/hench/dist/types/index.d.ts +4 -0
- package/packages/hench/dist/types/index.js +6 -0
- package/packages/hench/dist/types/index.js.map +1 -0
- package/packages/hench/dist/types/output.d.ts +47 -0
- package/packages/hench/dist/types/output.js +74 -0
- package/packages/hench/dist/types/output.js.map +1 -0
- package/packages/hench/dist/validation/completion.d.ts +37 -0
- package/packages/hench/dist/validation/completion.js +83 -0
- package/packages/hench/dist/validation/completion.js.map +1 -0
- package/packages/hench/dist/validation/index.d.ts +9 -0
- package/packages/hench/dist/validation/index.js +9 -0
- package/packages/hench/dist/validation/index.js.map +1 -0
- package/packages/hench/package.json +40 -0
- package/packages/llm-client/dist/api-provider.d.ts +47 -0
- package/packages/llm-client/dist/api-provider.js +126 -0
- package/packages/llm-client/dist/api-provider.js.map +1 -0
- package/packages/llm-client/dist/auth.d.ts +85 -0
- package/packages/llm-client/dist/auth.js +165 -0
- package/packages/llm-client/dist/auth.js.map +1 -0
- package/packages/llm-client/dist/cli-provider.d.ts +49 -0
- package/packages/llm-client/dist/cli-provider.js +226 -0
- package/packages/llm-client/dist/cli-provider.js.map +1 -0
- package/packages/llm-client/dist/codex-cli-provider.d.ts +15 -0
- package/packages/llm-client/dist/codex-cli-provider.js +206 -0
- package/packages/llm-client/dist/codex-cli-provider.js.map +1 -0
- package/packages/llm-client/dist/config.d.ts +39 -0
- package/packages/llm-client/dist/config.js +85 -0
- package/packages/llm-client/dist/config.js.map +1 -0
- package/packages/llm-client/dist/create-client.d.ts +66 -0
- package/packages/llm-client/dist/create-client.js +73 -0
- package/packages/llm-client/dist/create-client.js.map +1 -0
- package/packages/llm-client/dist/exec.d.ts +231 -0
- package/packages/llm-client/dist/exec.js +440 -0
- package/packages/llm-client/dist/exec.js.map +1 -0
- package/packages/llm-client/dist/help-format.d.ts +143 -0
- package/packages/llm-client/dist/help-format.js +280 -0
- package/packages/llm-client/dist/help-format.js.map +1 -0
- package/packages/llm-client/dist/json.d.ts +15 -0
- package/packages/llm-client/dist/json.js +18 -0
- package/packages/llm-client/dist/json.js.map +1 -0
- package/packages/llm-client/dist/llm-client.d.ts +43 -0
- package/packages/llm-client/dist/llm-client.js +48 -0
- package/packages/llm-client/dist/llm-client.js.map +1 -0
- package/packages/llm-client/dist/llm-config.d.ts +16 -0
- package/packages/llm-client/dist/llm-config.js +81 -0
- package/packages/llm-client/dist/llm-config.js.map +1 -0
- package/packages/llm-client/dist/llm-types.d.ts +40 -0
- package/packages/llm-client/dist/llm-types.js +17 -0
- package/packages/llm-client/dist/llm-types.js.map +1 -0
- package/packages/llm-client/dist/output.d.ts +27 -0
- package/packages/llm-client/dist/output.js +38 -0
- package/packages/llm-client/dist/output.js.map +1 -0
- package/packages/llm-client/dist/project-config.d.ts +25 -0
- package/packages/llm-client/dist/project-config.js +66 -0
- package/packages/llm-client/dist/project-config.js.map +1 -0
- package/packages/llm-client/dist/project-dirs.d.ts +32 -0
- package/packages/llm-client/dist/project-dirs.js +31 -0
- package/packages/llm-client/dist/project-dirs.js.map +1 -0
- package/packages/llm-client/dist/provider-interface.d.ts +194 -0
- package/packages/llm-client/dist/provider-interface.js +50 -0
- package/packages/llm-client/dist/provider-interface.js.map +1 -0
- package/packages/llm-client/dist/provider-registry.d.ts +147 -0
- package/packages/llm-client/dist/provider-registry.js +175 -0
- package/packages/llm-client/dist/provider-registry.js.map +1 -0
- package/packages/llm-client/dist/provider-session.d.ts +141 -0
- package/packages/llm-client/dist/provider-session.js +174 -0
- package/packages/llm-client/dist/provider-session.js.map +1 -0
- package/packages/llm-client/dist/public.d.ts +120 -0
- package/packages/llm-client/dist/public.js +122 -0
- package/packages/llm-client/dist/public.js.map +1 -0
- package/packages/llm-client/dist/suggest.d.ts +27 -0
- package/packages/llm-client/dist/suggest.js +63 -0
- package/packages/llm-client/dist/suggest.js.map +1 -0
- package/packages/llm-client/dist/token-usage.d.ts +43 -0
- package/packages/llm-client/dist/token-usage.js +106 -0
- package/packages/llm-client/dist/token-usage.js.map +1 -0
- package/packages/llm-client/dist/types.d.ts +108 -0
- package/packages/llm-client/dist/types.js +49 -0
- package/packages/llm-client/dist/types.js.map +1 -0
- package/packages/llm-client/package.json +34 -0
- package/packages/rex/dist/analyze/acknowledge.d.ts +44 -0
- package/packages/rex/dist/analyze/acknowledge.js +100 -0
- package/packages/rex/dist/analyze/acknowledge.js.map +1 -0
- package/packages/rex/dist/analyze/analyze-shared.d.ts +51 -0
- package/packages/rex/dist/analyze/analyze-shared.js +356 -0
- package/packages/rex/dist/analyze/analyze-shared.js.map +1 -0
- package/packages/rex/dist/analyze/batch-types.d.ts +48 -0
- package/packages/rex/dist/analyze/batch-types.js +9 -0
- package/packages/rex/dist/analyze/batch-types.js.map +1 -0
- package/packages/rex/dist/analyze/consolidation-guard.d.ts +45 -0
- package/packages/rex/dist/analyze/consolidation-guard.js +125 -0
- package/packages/rex/dist/analyze/consolidation-guard.js.map +1 -0
- package/packages/rex/dist/analyze/decompose.d.ts +62 -0
- package/packages/rex/dist/analyze/decompose.js +212 -0
- package/packages/rex/dist/analyze/decompose.js.map +1 -0
- package/packages/rex/dist/analyze/dedupe.d.ts +30 -0
- package/packages/rex/dist/analyze/dedupe.js +339 -0
- package/packages/rex/dist/analyze/dedupe.js.map +1 -0
- package/packages/rex/dist/analyze/diff.d.ts +13 -0
- package/packages/rex/dist/analyze/diff.js +146 -0
- package/packages/rex/dist/analyze/diff.js.map +1 -0
- package/packages/rex/dist/analyze/extract.d.ts +152 -0
- package/packages/rex/dist/analyze/extract.js +1338 -0
- package/packages/rex/dist/analyze/extract.js.map +1 -0
- package/packages/rex/dist/analyze/file-validation.d.ts +122 -0
- package/packages/rex/dist/analyze/file-validation.js +427 -0
- package/packages/rex/dist/analyze/file-validation.js.map +1 -0
- package/packages/rex/dist/analyze/guided.d.ts +17 -0
- package/packages/rex/dist/analyze/guided.js +162 -0
- package/packages/rex/dist/analyze/guided.js.map +1 -0
- package/packages/rex/dist/analyze/index.d.ts +27 -0
- package/packages/rex/dist/analyze/index.js +15 -0
- package/packages/rex/dist/analyze/index.js.map +1 -0
- package/packages/rex/dist/analyze/llm-bridge.d.ts +49 -0
- package/packages/rex/dist/analyze/llm-bridge.js +133 -0
- package/packages/rex/dist/analyze/llm-bridge.js.map +1 -0
- package/packages/rex/dist/analyze/modify-reason.d.ts +68 -0
- package/packages/rex/dist/analyze/modify-reason.js +182 -0
- package/packages/rex/dist/analyze/modify-reason.js.map +1 -0
- package/packages/rex/dist/analyze/propose.d.ts +72 -0
- package/packages/rex/dist/analyze/propose.js +246 -0
- package/packages/rex/dist/analyze/propose.js.map +1 -0
- package/packages/rex/dist/analyze/reason.d.ts +277 -0
- package/packages/rex/dist/analyze/reason.js +1446 -0
- package/packages/rex/dist/analyze/reason.js.map +1 -0
- package/packages/rex/dist/analyze/reconcile.d.ts +25 -0
- package/packages/rex/dist/analyze/reconcile.js +82 -0
- package/packages/rex/dist/analyze/reconcile.js.map +1 -0
- package/packages/rex/dist/analyze/reshape-reason.d.ts +38 -0
- package/packages/rex/dist/analyze/reshape-reason.js +302 -0
- package/packages/rex/dist/analyze/reshape-reason.js.map +1 -0
- package/packages/rex/dist/analyze/scanners.d.ts +36 -0
- package/packages/rex/dist/analyze/scanners.js +805 -0
- package/packages/rex/dist/analyze/scanners.js.map +1 -0
- package/packages/rex/dist/analyze/validate-modification.d.ts +54 -0
- package/packages/rex/dist/analyze/validate-modification.js +166 -0
- package/packages/rex/dist/analyze/validate-modification.js.map +1 -0
- package/packages/rex/dist/cli/commands/adapter.d.ts +11 -0
- package/packages/rex/dist/cli/commands/adapter.js +211 -0
- package/packages/rex/dist/cli/commands/adapter.js.map +1 -0
- package/packages/rex/dist/cli/commands/add.d.ts +1 -0
- package/packages/rex/dist/cli/commands/add.js +111 -0
- package/packages/rex/dist/cli/commands/add.js.map +1 -0
- package/packages/rex/dist/cli/commands/analyze.d.ts +4 -0
- package/packages/rex/dist/cli/commands/analyze.js +672 -0
- package/packages/rex/dist/cli/commands/analyze.js.map +1 -0
- package/packages/rex/dist/cli/commands/chunked-review-state.d.ts +183 -0
- package/packages/rex/dist/cli/commands/chunked-review-state.js +637 -0
- package/packages/rex/dist/cli/commands/chunked-review-state.js.map +1 -0
- package/packages/rex/dist/cli/commands/chunked-review.d.ts +21 -0
- package/packages/rex/dist/cli/commands/chunked-review.js +147 -0
- package/packages/rex/dist/cli/commands/chunked-review.js.map +1 -0
- package/packages/rex/dist/cli/commands/constants.d.ts +3 -0
- package/packages/rex/dist/cli/commands/constants.js +50 -0
- package/packages/rex/dist/cli/commands/constants.js.map +1 -0
- package/packages/rex/dist/cli/commands/decomposition-review.d.ts +92 -0
- package/packages/rex/dist/cli/commands/decomposition-review.js +258 -0
- package/packages/rex/dist/cli/commands/decomposition-review.js.map +1 -0
- package/packages/rex/dist/cli/commands/fix.d.ts +8 -0
- package/packages/rex/dist/cli/commands/fix.js +101 -0
- package/packages/rex/dist/cli/commands/fix.js.map +1 -0
- package/packages/rex/dist/cli/commands/format-loe.d.ts +22 -0
- package/packages/rex/dist/cli/commands/format-loe.js +35 -0
- package/packages/rex/dist/cli/commands/format-loe.js.map +1 -0
- package/packages/rex/dist/cli/commands/health.d.ts +7 -0
- package/packages/rex/dist/cli/commands/health.js +24 -0
- package/packages/rex/dist/cli/commands/health.js.map +1 -0
- package/packages/rex/dist/cli/commands/init.d.ts +1 -0
- package/packages/rex/dist/cli/commands/init.js +64 -0
- package/packages/rex/dist/cli/commands/init.js.map +1 -0
- package/packages/rex/dist/cli/commands/move.d.ts +1 -0
- package/packages/rex/dist/cli/commands/move.js +45 -0
- package/packages/rex/dist/cli/commands/move.js.map +1 -0
- package/packages/rex/dist/cli/commands/next.d.ts +1 -0
- package/packages/rex/dist/cli/commands/next.js +64 -0
- package/packages/rex/dist/cli/commands/next.js.map +1 -0
- package/packages/rex/dist/cli/commands/prune.d.ts +1 -0
- package/packages/rex/dist/cli/commands/prune.js +561 -0
- package/packages/rex/dist/cli/commands/prune.js.map +1 -0
- package/packages/rex/dist/cli/commands/recommend.d.ts +2 -0
- package/packages/rex/dist/cli/commands/recommend.js +517 -0
- package/packages/rex/dist/cli/commands/recommend.js.map +1 -0
- package/packages/rex/dist/cli/commands/remove.d.ts +12 -0
- package/packages/rex/dist/cli/commands/remove.js +206 -0
- package/packages/rex/dist/cli/commands/remove.js.map +1 -0
- package/packages/rex/dist/cli/commands/reorganize.d.ts +16 -0
- package/packages/rex/dist/cli/commands/reorganize.js +288 -0
- package/packages/rex/dist/cli/commands/reorganize.js.map +1 -0
- package/packages/rex/dist/cli/commands/report.d.ts +49 -0
- package/packages/rex/dist/cli/commands/report.js +218 -0
- package/packages/rex/dist/cli/commands/report.js.map +1 -0
- package/packages/rex/dist/cli/commands/reshape.d.ts +1 -0
- package/packages/rex/dist/cli/commands/reshape.js +182 -0
- package/packages/rex/dist/cli/commands/reshape.js.map +1 -0
- package/packages/rex/dist/cli/commands/smart-add-duplicates.d.ts +45 -0
- package/packages/rex/dist/cli/commands/smart-add-duplicates.js +252 -0
- package/packages/rex/dist/cli/commands/smart-add-duplicates.js.map +1 -0
- package/packages/rex/dist/cli/commands/smart-add.d.ts +80 -0
- package/packages/rex/dist/cli/commands/smart-add.js +1343 -0
- package/packages/rex/dist/cli/commands/smart-add.js.map +1 -0
- package/packages/rex/dist/cli/commands/status-sections.d.ts +70 -0
- package/packages/rex/dist/cli/commands/status-sections.js +201 -0
- package/packages/rex/dist/cli/commands/status-sections.js.map +1 -0
- package/packages/rex/dist/cli/commands/status-shared.d.ts +44 -0
- package/packages/rex/dist/cli/commands/status-shared.js +191 -0
- package/packages/rex/dist/cli/commands/status-shared.js.map +1 -0
- package/packages/rex/dist/cli/commands/status.d.ts +3 -0
- package/packages/rex/dist/cli/commands/status.js +118 -0
- package/packages/rex/dist/cli/commands/status.js.map +1 -0
- package/packages/rex/dist/cli/commands/sync.d.ts +11 -0
- package/packages/rex/dist/cli/commands/sync.js +131 -0
- package/packages/rex/dist/cli/commands/sync.js.map +1 -0
- package/packages/rex/dist/cli/commands/token-format.d.ts +31 -0
- package/packages/rex/dist/cli/commands/token-format.js +86 -0
- package/packages/rex/dist/cli/commands/token-format.js.map +1 -0
- package/packages/rex/dist/cli/commands/update.d.ts +1 -0
- package/packages/rex/dist/cli/commands/update.js +146 -0
- package/packages/rex/dist/cli/commands/update.js.map +1 -0
- package/packages/rex/dist/cli/commands/usage.d.ts +1 -0
- package/packages/rex/dist/cli/commands/usage.js +192 -0
- package/packages/rex/dist/cli/commands/usage.js.map +1 -0
- package/packages/rex/dist/cli/commands/validate-interactive.d.ts +46 -0
- package/packages/rex/dist/cli/commands/validate-interactive.js +236 -0
- package/packages/rex/dist/cli/commands/validate-interactive.js.map +1 -0
- package/packages/rex/dist/cli/commands/validate.d.ts +10 -0
- package/packages/rex/dist/cli/commands/validate.js +212 -0
- package/packages/rex/dist/cli/commands/validate.js.map +1 -0
- package/packages/rex/dist/cli/commands/verify.d.ts +1 -0
- package/packages/rex/dist/cli/commands/verify.js +90 -0
- package/packages/rex/dist/cli/commands/verify.js.map +1 -0
- package/packages/rex/dist/cli/errors.d.ts +40 -0
- package/packages/rex/dist/cli/errors.js +125 -0
- package/packages/rex/dist/cli/errors.js.map +1 -0
- package/packages/rex/dist/cli/help.d.ts +23 -0
- package/packages/rex/dist/cli/help.js +584 -0
- package/packages/rex/dist/cli/help.js.map +1 -0
- package/packages/rex/dist/cli/index.d.ts +2 -0
- package/packages/rex/dist/cli/index.js +405 -0
- package/packages/rex/dist/cli/index.js.map +1 -0
- package/packages/rex/dist/cli/mcp-tools.d.ts +86 -0
- package/packages/rex/dist/cli/mcp-tools.js +555 -0
- package/packages/rex/dist/cli/mcp-tools.js.map +1 -0
- package/packages/rex/dist/cli/mcp.d.ts +26 -0
- package/packages/rex/dist/cli/mcp.js +144 -0
- package/packages/rex/dist/cli/mcp.js.map +1 -0
- package/packages/rex/dist/cli/output.d.ts +36 -0
- package/packages/rex/dist/cli/output.js +70 -0
- package/packages/rex/dist/cli/output.js.map +1 -0
- package/packages/rex/dist/cli/validate-input.d.ts +45 -0
- package/packages/rex/dist/cli/validate-input.js +87 -0
- package/packages/rex/dist/cli/validate-input.js.map +1 -0
- package/packages/rex/dist/core/analytics.d.ts +38 -0
- package/packages/rex/dist/core/analytics.js +87 -0
- package/packages/rex/dist/core/analytics.js.map +1 -0
- package/packages/rex/dist/core/canonical.d.ts +3 -0
- package/packages/rex/dist/core/canonical.js +21 -0
- package/packages/rex/dist/core/canonical.js.map +1 -0
- package/packages/rex/dist/core/cascade-reset.d.ts +31 -0
- package/packages/rex/dist/core/cascade-reset.js +47 -0
- package/packages/rex/dist/core/cascade-reset.js.map +1 -0
- package/packages/rex/dist/core/code-coverage.d.ts +38 -0
- package/packages/rex/dist/core/code-coverage.js +85 -0
- package/packages/rex/dist/core/code-coverage.js.map +1 -0
- package/packages/rex/dist/core/dag.d.ts +6 -0
- package/packages/rex/dist/core/dag.js +67 -0
- package/packages/rex/dist/core/dag.js.map +1 -0
- package/packages/rex/dist/core/delete.d.ts +10 -0
- package/packages/rex/dist/core/delete.js +38 -0
- package/packages/rex/dist/core/delete.js.map +1 -0
- package/packages/rex/dist/core/epic-correlation.d.ts +94 -0
- package/packages/rex/dist/core/epic-correlation.js +179 -0
- package/packages/rex/dist/core/epic-correlation.js.map +1 -0
- package/packages/rex/dist/core/facets.d.ts +54 -0
- package/packages/rex/dist/core/facets.js +176 -0
- package/packages/rex/dist/core/facets.js.map +1 -0
- package/packages/rex/dist/core/fix.d.ts +59 -0
- package/packages/rex/dist/core/fix.js +190 -0
- package/packages/rex/dist/core/fix.js.map +1 -0
- package/packages/rex/dist/core/health.d.ts +43 -0
- package/packages/rex/dist/core/health.js +331 -0
- package/packages/rex/dist/core/health.js.map +1 -0
- package/packages/rex/dist/core/keywords.d.ts +20 -0
- package/packages/rex/dist/core/keywords.js +47 -0
- package/packages/rex/dist/core/keywords.js.map +1 -0
- package/packages/rex/dist/core/merge.d.ts +87 -0
- package/packages/rex/dist/core/merge.js +289 -0
- package/packages/rex/dist/core/merge.js.map +1 -0
- package/packages/rex/dist/core/move.d.ts +48 -0
- package/packages/rex/dist/core/move.js +163 -0
- package/packages/rex/dist/core/move.js.map +1 -0
- package/packages/rex/dist/core/next-task.d.ts +121 -0
- package/packages/rex/dist/core/next-task.js +443 -0
- package/packages/rex/dist/core/next-task.js.map +1 -0
- package/packages/rex/dist/core/notion-map.d.ts +207 -0
- package/packages/rex/dist/core/notion-map.js +535 -0
- package/packages/rex/dist/core/notion-map.js.map +1 -0
- package/packages/rex/dist/core/override-escalation.d.ts +28 -0
- package/packages/rex/dist/core/override-escalation.js +69 -0
- package/packages/rex/dist/core/override-escalation.js.map +1 -0
- package/packages/rex/dist/core/parent-completion.d.ts +41 -0
- package/packages/rex/dist/core/parent-completion.js +75 -0
- package/packages/rex/dist/core/parent-completion.js.map +1 -0
- package/packages/rex/dist/core/parent-reset.d.ts +45 -0
- package/packages/rex/dist/core/parent-reset.js +59 -0
- package/packages/rex/dist/core/parent-reset.js.map +1 -0
- package/packages/rex/dist/core/pending-cache.d.ts +27 -0
- package/packages/rex/dist/core/pending-cache.js +55 -0
- package/packages/rex/dist/core/pending-cache.js.map +1 -0
- package/packages/rex/dist/core/prune.d.ts +50 -0
- package/packages/rex/dist/core/prune.js +89 -0
- package/packages/rex/dist/core/prune.js.map +1 -0
- package/packages/rex/dist/core/remove-epic.d.ts +35 -0
- package/packages/rex/dist/core/remove-epic.js +51 -0
- package/packages/rex/dist/core/remove-epic.js.map +1 -0
- package/packages/rex/dist/core/remove-feature.d.ts +100 -0
- package/packages/rex/dist/core/remove-feature.js +189 -0
- package/packages/rex/dist/core/remove-feature.js.map +1 -0
- package/packages/rex/dist/core/remove-task.d.ts +66 -0
- package/packages/rex/dist/core/remove-task.js +93 -0
- package/packages/rex/dist/core/remove-task.js.map +1 -0
- package/packages/rex/dist/core/reorganize-executor.d.ts +43 -0
- package/packages/rex/dist/core/reorganize-executor.js +153 -0
- package/packages/rex/dist/core/reorganize-executor.js.map +1 -0
- package/packages/rex/dist/core/reorganize.d.ts +109 -0
- package/packages/rex/dist/core/reorganize.js +453 -0
- package/packages/rex/dist/core/reorganize.js.map +1 -0
- package/packages/rex/dist/core/requirements.d.ts +131 -0
- package/packages/rex/dist/core/requirements.js +263 -0
- package/packages/rex/dist/core/requirements.js.map +1 -0
- package/packages/rex/dist/core/reshape.d.ts +88 -0
- package/packages/rex/dist/core/reshape.js +168 -0
- package/packages/rex/dist/core/reshape.js.map +1 -0
- package/packages/rex/dist/core/scope-creep.d.ts +31 -0
- package/packages/rex/dist/core/scope-creep.js +53 -0
- package/packages/rex/dist/core/scope-creep.js.map +1 -0
- package/packages/rex/dist/core/stats.d.ts +12 -0
- package/packages/rex/dist/core/stats.js +47 -0
- package/packages/rex/dist/core/stats.js.map +1 -0
- package/packages/rex/dist/core/structural.d.ts +63 -0
- package/packages/rex/dist/core/structural.js +267 -0
- package/packages/rex/dist/core/structural.js.map +1 -0
- package/packages/rex/dist/core/sync-engine.d.ts +63 -0
- package/packages/rex/dist/core/sync-engine.js +429 -0
- package/packages/rex/dist/core/sync-engine.js.map +1 -0
- package/packages/rex/dist/core/sync.d.ts +82 -0
- package/packages/rex/dist/core/sync.js +204 -0
- package/packages/rex/dist/core/sync.js.map +1 -0
- package/packages/rex/dist/core/timestamps.d.ts +34 -0
- package/packages/rex/dist/core/timestamps.js +50 -0
- package/packages/rex/dist/core/timestamps.js.map +1 -0
- package/packages/rex/dist/core/token-usage.d.ts +196 -0
- package/packages/rex/dist/core/token-usage.js +468 -0
- package/packages/rex/dist/core/token-usage.js.map +1 -0
- package/packages/rex/dist/core/transitions.d.ts +28 -0
- package/packages/rex/dist/core/transitions.js +74 -0
- package/packages/rex/dist/core/transitions.js.map +1 -0
- package/packages/rex/dist/core/tree.d.ts +12 -0
- package/packages/rex/dist/core/tree.js +76 -0
- package/packages/rex/dist/core/tree.js.map +1 -0
- package/packages/rex/dist/core/verify.d.ts +92 -0
- package/packages/rex/dist/core/verify.js +201 -0
- package/packages/rex/dist/core/verify.js.map +1 -0
- package/packages/rex/dist/public.d.ts +115 -0
- package/packages/rex/dist/public.js +114 -0
- package/packages/rex/dist/public.js.map +1 -0
- package/packages/rex/dist/recommend/conflict-detection.d.ts +102 -0
- package/packages/rex/dist/recommend/conflict-detection.js +238 -0
- package/packages/rex/dist/recommend/conflict-detection.js.map +1 -0
- package/packages/rex/dist/recommend/create-from-recommendations.d.ts +109 -0
- package/packages/rex/dist/recommend/create-from-recommendations.js +287 -0
- package/packages/rex/dist/recommend/create-from-recommendations.js.map +1 -0
- package/packages/rex/dist/recommend/types.d.ts +59 -0
- package/packages/rex/dist/recommend/types.js +11 -0
- package/packages/rex/dist/recommend/types.js.map +1 -0
- package/packages/rex/dist/schema/index.d.ts +23 -0
- package/packages/rex/dist/schema/index.js +22 -0
- package/packages/rex/dist/schema/index.js.map +1 -0
- package/packages/rex/dist/schema/levels.d.ts +82 -0
- package/packages/rex/dist/schema/levels.js +152 -0
- package/packages/rex/dist/schema/levels.js.map +1 -0
- package/packages/rex/dist/schema/v1.d.ts +341 -0
- package/packages/rex/dist/schema/v1.js +179 -0
- package/packages/rex/dist/schema/v1.js.map +1 -0
- package/packages/rex/dist/schema/validate.d.ts +194 -0
- package/packages/rex/dist/schema/validate.js +136 -0
- package/packages/rex/dist/schema/validate.js.map +1 -0
- package/packages/rex/dist/store/adapter-registry.d.ts +143 -0
- package/packages/rex/dist/store/adapter-registry.js +304 -0
- package/packages/rex/dist/store/adapter-registry.js.map +1 -0
- package/packages/rex/dist/store/atomic-write.d.ts +22 -0
- package/packages/rex/dist/store/atomic-write.js +30 -0
- package/packages/rex/dist/store/atomic-write.js.map +1 -0
- package/packages/rex/dist/store/contracts.d.ts +142 -0
- package/packages/rex/dist/store/contracts.js +19 -0
- package/packages/rex/dist/store/contracts.js.map +1 -0
- package/packages/rex/dist/store/file-adapter.d.ts +23 -0
- package/packages/rex/dist/store/file-adapter.js +150 -0
- package/packages/rex/dist/store/file-adapter.js.map +1 -0
- package/packages/rex/dist/store/index.d.ts +67 -0
- package/packages/rex/dist/store/index.js +78 -0
- package/packages/rex/dist/store/index.js.map +1 -0
- package/packages/rex/dist/store/integration-schema.d.ts +205 -0
- package/packages/rex/dist/store/integration-schema.js +136 -0
- package/packages/rex/dist/store/integration-schema.js.map +1 -0
- package/packages/rex/dist/store/integration-schemas/index.d.ts +28 -0
- package/packages/rex/dist/store/integration-schemas/index.js +45 -0
- package/packages/rex/dist/store/integration-schemas/index.js.map +1 -0
- package/packages/rex/dist/store/integration-schemas/jira.d.ts +11 -0
- package/packages/rex/dist/store/integration-schemas/jira.js +147 -0
- package/packages/rex/dist/store/integration-schemas/jira.js.map +1 -0
- package/packages/rex/dist/store/integration-schemas/notion.d.ts +11 -0
- package/packages/rex/dist/store/integration-schemas/notion.js +80 -0
- package/packages/rex/dist/store/integration-schemas/notion.js.map +1 -0
- package/packages/rex/dist/store/notion-adapter.d.ts +42 -0
- package/packages/rex/dist/store/notion-adapter.js +247 -0
- package/packages/rex/dist/store/notion-adapter.js.map +1 -0
- package/packages/rex/dist/store/notion-client.d.ts +56 -0
- package/packages/rex/dist/store/notion-client.js +82 -0
- package/packages/rex/dist/store/notion-client.js.map +1 -0
- package/packages/rex/dist/store/notion-map.d.ts +207 -0
- package/packages/rex/dist/store/notion-map.js +535 -0
- package/packages/rex/dist/store/notion-map.js.map +1 -0
- package/packages/rex/dist/store/project-config.d.ts +44 -0
- package/packages/rex/dist/store/project-config.js +56 -0
- package/packages/rex/dist/store/project-config.js.map +1 -0
- package/packages/rex/dist/store/types.d.ts +142 -0
- package/packages/rex/dist/store/types.js +19 -0
- package/packages/rex/dist/store/types.js.map +1 -0
- package/packages/rex/dist/workflow/default.d.ts +1 -0
- package/packages/rex/dist/workflow/default.js +21 -0
- package/packages/rex/dist/workflow/default.js.map +1 -0
- package/packages/rex/package.json +40 -0
- package/packages/sourcevision/dist/analyzers/__tests__/components.test.d.ts +1 -0
- package/packages/sourcevision/dist/analyzers/__tests__/components.test.js +370 -0
- package/packages/sourcevision/dist/analyzers/__tests__/components.test.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/__tests__/imports.test.d.ts +1 -0
- package/packages/sourcevision/dist/analyzers/__tests__/imports.test.js +101 -0
- package/packages/sourcevision/dist/analyzers/__tests__/imports.test.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/__tests__/inventory.test.d.ts +1 -0
- package/packages/sourcevision/dist/analyzers/__tests__/inventory.test.js +118 -0
- package/packages/sourcevision/dist/analyzers/__tests__/inventory.test.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/__tests__/manifest.test.d.ts +1 -0
- package/packages/sourcevision/dist/analyzers/__tests__/manifest.test.js +61 -0
- package/packages/sourcevision/dist/analyzers/__tests__/manifest.test.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/__tests__/zones.test.d.ts +1 -0
- package/packages/sourcevision/dist/analyzers/__tests__/zones.test.js +836 -0
- package/packages/sourcevision/dist/analyzers/__tests__/zones.test.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/archetypes.d.ts +18 -0
- package/packages/sourcevision/dist/analyzers/archetypes.js +272 -0
- package/packages/sourcevision/dist/analyzers/archetypes.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/branch-work-classifier.d.ts +67 -0
- package/packages/sourcevision/dist/analyzers/branch-work-classifier.js +202 -0
- package/packages/sourcevision/dist/analyzers/branch-work-classifier.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/branch-work-collector.d.ts +121 -0
- package/packages/sourcevision/dist/analyzers/branch-work-collector.js +301 -0
- package/packages/sourcevision/dist/analyzers/branch-work-collector.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/branch-work-filter.d.ts +112 -0
- package/packages/sourcevision/dist/analyzers/branch-work-filter.js +285 -0
- package/packages/sourcevision/dist/analyzers/branch-work-filter.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/branch-work-store.d.ts +65 -0
- package/packages/sourcevision/dist/analyzers/branch-work-store.js +127 -0
- package/packages/sourcevision/dist/analyzers/branch-work-store.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/callgraph-findings.d.ts +26 -0
- package/packages/sourcevision/dist/analyzers/callgraph-findings.js +581 -0
- package/packages/sourcevision/dist/analyzers/callgraph-findings.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/callgraph.d.ts +64 -0
- package/packages/sourcevision/dist/analyzers/callgraph.js +659 -0
- package/packages/sourcevision/dist/analyzers/callgraph.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/classify.d.ts +45 -0
- package/packages/sourcevision/dist/analyzers/classify.js +431 -0
- package/packages/sourcevision/dist/analyzers/classify.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/claude-cli.d.ts +29 -0
- package/packages/sourcevision/dist/analyzers/claude-cli.js +137 -0
- package/packages/sourcevision/dist/analyzers/claude-cli.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/claude-client.d.ts +47 -0
- package/packages/sourcevision/dist/analyzers/claude-client.js +112 -0
- package/packages/sourcevision/dist/analyzers/claude-client.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/completion-reader.d.ts +218 -0
- package/packages/sourcevision/dist/analyzers/completion-reader.js +355 -0
- package/packages/sourcevision/dist/analyzers/completion-reader.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/components.d.ts +18 -0
- package/packages/sourcevision/dist/analyzers/components.js +598 -0
- package/packages/sourcevision/dist/analyzers/components.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/context.d.ts +6 -0
- package/packages/sourcevision/dist/analyzers/context.js +175 -0
- package/packages/sourcevision/dist/analyzers/context.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/convergence.d.ts +74 -0
- package/packages/sourcevision/dist/analyzers/convergence.js +144 -0
- package/packages/sourcevision/dist/analyzers/convergence.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/enrich-batch.d.ts +47 -0
- package/packages/sourcevision/dist/analyzers/enrich-batch.js +340 -0
- package/packages/sourcevision/dist/analyzers/enrich-batch.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/enrich-config.d.ts +41 -0
- package/packages/sourcevision/dist/analyzers/enrich-config.js +215 -0
- package/packages/sourcevision/dist/analyzers/enrich-config.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/enrich-parsing.d.ts +58 -0
- package/packages/sourcevision/dist/analyzers/enrich-parsing.js +401 -0
- package/packages/sourcevision/dist/analyzers/enrich-parsing.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/enrich-per-zone.d.ts +27 -0
- package/packages/sourcevision/dist/analyzers/enrich-per-zone.js +287 -0
- package/packages/sourcevision/dist/analyzers/enrich-per-zone.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/enrich.d.ts +25 -0
- package/packages/sourcevision/dist/analyzers/enrich.js +255 -0
- package/packages/sourcevision/dist/analyzers/enrich.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/imports.d.ts +18 -0
- package/packages/sourcevision/dist/analyzers/imports.js +448 -0
- package/packages/sourcevision/dist/analyzers/imports.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/index.d.ts +12 -0
- package/packages/sourcevision/dist/analyzers/index.js +10 -0
- package/packages/sourcevision/dist/analyzers/index.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/inventory.d.ts +33 -0
- package/packages/sourcevision/dist/analyzers/inventory.js +594 -0
- package/packages/sourcevision/dist/analyzers/inventory.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/llms-txt.d.ts +6 -0
- package/packages/sourcevision/dist/analyzers/llms-txt.js +268 -0
- package/packages/sourcevision/dist/analyzers/llms-txt.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/louvain.d.ts +123 -0
- package/packages/sourcevision/dist/analyzers/louvain.js +669 -0
- package/packages/sourcevision/dist/analyzers/louvain.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/manifest.d.ts +8 -0
- package/packages/sourcevision/dist/analyzers/manifest.js +72 -0
- package/packages/sourcevision/dist/analyzers/manifest.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/move-recommendations.d.ts +41 -0
- package/packages/sourcevision/dist/analyzers/move-recommendations.js +193 -0
- package/packages/sourcevision/dist/analyzers/move-recommendations.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/next-steps.d.ts +10 -0
- package/packages/sourcevision/dist/analyzers/next-steps.js +228 -0
- package/packages/sourcevision/dist/analyzers/next-steps.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/risk-scoring.d.ts +120 -0
- package/packages/sourcevision/dist/analyzers/risk-scoring.js +266 -0
- package/packages/sourcevision/dist/analyzers/risk-scoring.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/route-detection.d.ts +29 -0
- package/packages/sourcevision/dist/analyzers/route-detection.js +316 -0
- package/packages/sourcevision/dist/analyzers/route-detection.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/server-route-detection.d.ts +35 -0
- package/packages/sourcevision/dist/analyzers/server-route-detection.js +210 -0
- package/packages/sourcevision/dist/analyzers/server-route-detection.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/token-usage.d.ts +11 -0
- package/packages/sourcevision/dist/analyzers/token-usage.js +41 -0
- package/packages/sourcevision/dist/analyzers/token-usage.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/workspace-aggregate.d.ts +80 -0
- package/packages/sourcevision/dist/analyzers/workspace-aggregate.js +386 -0
- package/packages/sourcevision/dist/analyzers/workspace-aggregate.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/workspace-crossings.d.ts +63 -0
- package/packages/sourcevision/dist/analyzers/workspace-crossings.js +239 -0
- package/packages/sourcevision/dist/analyzers/workspace-crossings.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/workspace.d.ts +65 -0
- package/packages/sourcevision/dist/analyzers/workspace.js +243 -0
- package/packages/sourcevision/dist/analyzers/workspace.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/zone-hash.d.ts +15 -0
- package/packages/sourcevision/dist/analyzers/zone-hash.js +23 -0
- package/packages/sourcevision/dist/analyzers/zone-hash.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/zone-output.d.ts +20 -0
- package/packages/sourcevision/dist/analyzers/zone-output.js +252 -0
- package/packages/sourcevision/dist/analyzers/zone-output.js.map +1 -0
- package/packages/sourcevision/dist/analyzers/zones.d.ts +224 -0
- package/packages/sourcevision/dist/analyzers/zones.js +1538 -0
- package/packages/sourcevision/dist/analyzers/zones.js.map +1 -0
- package/packages/sourcevision/dist/cli/commands/analyze-phases.d.ts +48 -0
- package/packages/sourcevision/dist/cli/commands/analyze-phases.js +496 -0
- package/packages/sourcevision/dist/cli/commands/analyze-phases.js.map +1 -0
- package/packages/sourcevision/dist/cli/commands/analyze.d.ts +13 -0
- package/packages/sourcevision/dist/cli/commands/analyze.js +332 -0
- package/packages/sourcevision/dist/cli/commands/analyze.js.map +1 -0
- package/packages/sourcevision/dist/cli/commands/constants.d.ts +2 -0
- package/packages/sourcevision/dist/cli/commands/constants.js +34 -0
- package/packages/sourcevision/dist/cli/commands/constants.js.map +1 -0
- package/packages/sourcevision/dist/cli/commands/export-pdf.d.ts +19 -0
- package/packages/sourcevision/dist/cli/commands/export-pdf.js +73 -0
- package/packages/sourcevision/dist/cli/commands/export-pdf.js.map +1 -0
- package/packages/sourcevision/dist/cli/commands/git-credential-helper.d.ts +2 -0
- package/packages/sourcevision/dist/cli/commands/git-credential-helper.js +59 -0
- package/packages/sourcevision/dist/cli/commands/git-credential-helper.js.map +1 -0
- package/packages/sourcevision/dist/cli/commands/init.d.ts +2 -0
- package/packages/sourcevision/dist/cli/commands/init.js +55 -0
- package/packages/sourcevision/dist/cli/commands/init.js.map +1 -0
- package/packages/sourcevision/dist/cli/commands/pr-markdown.d.ts +72 -0
- package/packages/sourcevision/dist/cli/commands/pr-markdown.js +121 -0
- package/packages/sourcevision/dist/cli/commands/pr-markdown.js.map +1 -0
- package/packages/sourcevision/dist/cli/commands/prd-epic-resolver.d.ts +45 -0
- package/packages/sourcevision/dist/cli/commands/prd-epic-resolver.js +220 -0
- package/packages/sourcevision/dist/cli/commands/prd-epic-resolver.js.map +1 -0
- package/packages/sourcevision/dist/cli/commands/reset.d.ts +1 -0
- package/packages/sourcevision/dist/cli/commands/reset.js +54 -0
- package/packages/sourcevision/dist/cli/commands/reset.js.map +1 -0
- package/packages/sourcevision/dist/cli/commands/validate.d.ts +1 -0
- package/packages/sourcevision/dist/cli/commands/validate.js +53 -0
- package/packages/sourcevision/dist/cli/commands/validate.js.map +1 -0
- package/packages/sourcevision/dist/cli/commands/workspace.d.ts +19 -0
- package/packages/sourcevision/dist/cli/commands/workspace.js +139 -0
- package/packages/sourcevision/dist/cli/commands/workspace.js.map +1 -0
- package/packages/sourcevision/dist/cli/errors.d.ts +31 -0
- package/packages/sourcevision/dist/cli/errors.js +100 -0
- package/packages/sourcevision/dist/cli/errors.js.map +1 -0
- package/packages/sourcevision/dist/cli/help.d.ts +23 -0
- package/packages/sourcevision/dist/cli/help.js +241 -0
- package/packages/sourcevision/dist/cli/help.js.map +1 -0
- package/packages/sourcevision/dist/cli/index.d.ts +15 -0
- package/packages/sourcevision/dist/cli/index.js +127 -0
- package/packages/sourcevision/dist/cli/index.js.map +1 -0
- package/packages/sourcevision/dist/cli/mcp.d.ts +13 -0
- package/packages/sourcevision/dist/cli/mcp.js +433 -0
- package/packages/sourcevision/dist/cli/mcp.js.map +1 -0
- package/packages/sourcevision/dist/cli/output.d.ts +19 -0
- package/packages/sourcevision/dist/cli/output.js +48 -0
- package/packages/sourcevision/dist/cli/output.js.map +1 -0
- package/packages/sourcevision/dist/cli/serve.d.ts +11 -0
- package/packages/sourcevision/dist/cli/serve.js +41 -0
- package/packages/sourcevision/dist/cli/serve.js.map +1 -0
- package/packages/sourcevision/dist/cli/server/index.d.ts +19 -0
- package/packages/sourcevision/dist/cli/server/index.js +17 -0
- package/packages/sourcevision/dist/cli/server/index.js.map +1 -0
- package/packages/sourcevision/dist/cli/server/routes-data.d.ts +14 -0
- package/packages/sourcevision/dist/cli/server/routes-data.js +122 -0
- package/packages/sourcevision/dist/cli/server/routes-data.js.map +1 -0
- package/packages/sourcevision/dist/cli/server/routes-hench.d.ts +12 -0
- package/packages/sourcevision/dist/cli/server/routes-hench.js +100 -0
- package/packages/sourcevision/dist/cli/server/routes-hench.js.map +1 -0
- package/packages/sourcevision/dist/cli/server/routes-rex.d.ts +23 -0
- package/packages/sourcevision/dist/cli/server/routes-rex.js +817 -0
- package/packages/sourcevision/dist/cli/server/routes-rex.js.map +1 -0
- package/packages/sourcevision/dist/cli/server/routes-sourcevision.d.ts +17 -0
- package/packages/sourcevision/dist/cli/server/routes-sourcevision.js +145 -0
- package/packages/sourcevision/dist/cli/server/routes-sourcevision.js.map +1 -0
- package/packages/sourcevision/dist/cli/server/routes-static.d.ts +17 -0
- package/packages/sourcevision/dist/cli/server/routes-static.js +88 -0
- package/packages/sourcevision/dist/cli/server/routes-static.js.map +1 -0
- package/packages/sourcevision/dist/cli/server/routes-token-usage.d.ts +18 -0
- package/packages/sourcevision/dist/cli/server/routes-token-usage.js +349 -0
- package/packages/sourcevision/dist/cli/server/routes-token-usage.js.map +1 -0
- package/packages/sourcevision/dist/cli/server/routes-validation.d.ts +10 -0
- package/packages/sourcevision/dist/cli/server/routes-validation.js +395 -0
- package/packages/sourcevision/dist/cli/server/routes-validation.js.map +1 -0
- package/packages/sourcevision/dist/cli/server/start.d.ts +7 -0
- package/packages/sourcevision/dist/cli/server/start.js +166 -0
- package/packages/sourcevision/dist/cli/server/start.js.map +1 -0
- package/packages/sourcevision/dist/cli/server/types.d.ts +23 -0
- package/packages/sourcevision/dist/cli/server/types.js +26 -0
- package/packages/sourcevision/dist/cli/server/types.js.map +1 -0
- package/packages/sourcevision/dist/cli/server/websocket.d.ts +31 -0
- package/packages/sourcevision/dist/cli/server/websocket.js +247 -0
- package/packages/sourcevision/dist/cli/server/websocket.js.map +1 -0
- package/packages/sourcevision/dist/constants.d.ts +4 -0
- package/packages/sourcevision/dist/constants.js +6 -0
- package/packages/sourcevision/dist/constants.js.map +1 -0
- package/packages/sourcevision/dist/export/pdf-report.d.ts +27 -0
- package/packages/sourcevision/dist/export/pdf-report.js +447 -0
- package/packages/sourcevision/dist/export/pdf-report.js.map +1 -0
- package/packages/sourcevision/dist/generators/pr-markdown-template.d.ts +56 -0
- package/packages/sourcevision/dist/generators/pr-markdown-template.js +264 -0
- package/packages/sourcevision/dist/generators/pr-markdown-template.js.map +1 -0
- package/packages/sourcevision/dist/public.d.ts +41 -0
- package/packages/sourcevision/dist/public.js +43 -0
- package/packages/sourcevision/dist/public.js.map +1 -0
- package/packages/sourcevision/dist/schema/data-files.d.ts +11 -0
- package/packages/sourcevision/dist/schema/data-files.js +12 -0
- package/packages/sourcevision/dist/schema/data-files.js.map +1 -0
- package/packages/sourcevision/dist/schema/index.d.ts +3 -0
- package/packages/sourcevision/dist/schema/index.js +3 -0
- package/packages/sourcevision/dist/schema/index.js.map +1 -0
- package/packages/sourcevision/dist/schema/v1.d.ts +550 -0
- package/packages/sourcevision/dist/schema/v1.js +3 -0
- package/packages/sourcevision/dist/schema/v1.js.map +1 -0
- package/packages/sourcevision/dist/schema/validate.d.ts +1243 -0
- package/packages/sourcevision/dist/schema/validate.js +411 -0
- package/packages/sourcevision/dist/schema/validate.js.map +1 -0
- package/packages/sourcevision/dist/util/__tests__/merge.test.d.ts +1 -0
- package/packages/sourcevision/dist/util/__tests__/merge.test.js +122 -0
- package/packages/sourcevision/dist/util/__tests__/merge.test.js.map +1 -0
- package/packages/sourcevision/dist/util/__tests__/sort.test.d.ts +1 -0
- package/packages/sourcevision/dist/util/__tests__/sort.test.js +151 -0
- package/packages/sourcevision/dist/util/__tests__/sort.test.js.map +1 -0
- package/packages/sourcevision/dist/util/merge.d.ts +18 -0
- package/packages/sourcevision/dist/util/merge.js +152 -0
- package/packages/sourcevision/dist/util/merge.js.map +1 -0
- package/packages/sourcevision/dist/util/paths.d.ts +2 -0
- package/packages/sourcevision/dist/util/paths.js +5 -0
- package/packages/sourcevision/dist/util/paths.js.map +1 -0
- package/packages/sourcevision/dist/util/project-config.d.ts +29 -0
- package/packages/sourcevision/dist/util/project-config.js +49 -0
- package/packages/sourcevision/dist/util/project-config.js.map +1 -0
- package/packages/sourcevision/dist/util/sort.d.ts +31 -0
- package/packages/sourcevision/dist/util/sort.js +149 -0
- package/packages/sourcevision/dist/util/sort.js.map +1 -0
- package/packages/sourcevision/dist/viewer/Hench-F.png +0 -0
- package/packages/sourcevision/dist/viewer/Rex-F.png +0 -0
- package/packages/sourcevision/dist/viewer/SourceVision-F.png +0 -0
- package/packages/sourcevision/dist/viewer/SourceVision.png +0 -0
- package/packages/sourcevision/dist/viewer/components/collapsible-section.d.ts +12 -0
- package/packages/sourcevision/dist/viewer/components/collapsible-section.js +40 -0
- package/packages/sourcevision/dist/viewer/components/collapsible-section.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/constants.d.ts +6 -0
- package/packages/sourcevision/dist/viewer/components/constants.js +16 -0
- package/packages/sourcevision/dist/viewer/components/constants.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/data-display/collapsible-section.d.ts +12 -0
- package/packages/sourcevision/dist/viewer/components/data-display/collapsible-section.js +40 -0
- package/packages/sourcevision/dist/viewer/components/data-display/collapsible-section.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/data-display/findings-list.d.ts +13 -0
- package/packages/sourcevision/dist/viewer/components/data-display/findings-list.js +136 -0
- package/packages/sourcevision/dist/viewer/components/data-display/findings-list.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/data-display/health-gauge.d.ts +47 -0
- package/packages/sourcevision/dist/viewer/components/data-display/health-gauge.js +70 -0
- package/packages/sourcevision/dist/viewer/components/data-display/health-gauge.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/data-display/mini-charts.d.ts +36 -0
- package/packages/sourcevision/dist/viewer/components/data-display/mini-charts.js +124 -0
- package/packages/sourcevision/dist/viewer/components/data-display/mini-charts.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/data-display/tree-view.d.ts +18 -0
- package/packages/sourcevision/dist/viewer/components/data-display/tree-view.js +107 -0
- package/packages/sourcevision/dist/viewer/components/data-display/tree-view.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/data-display/zone-map.d.ts +28 -0
- package/packages/sourcevision/dist/viewer/components/data-display/zone-map.js +195 -0
- package/packages/sourcevision/dist/viewer/components/data-display/zone-map.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/detail-panel.d.ts +12 -0
- package/packages/sourcevision/dist/viewer/components/detail-panel.js +166 -0
- package/packages/sourcevision/dist/viewer/components/detail-panel.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/faq.d.ts +1 -0
- package/packages/sourcevision/dist/viewer/components/faq.js +162 -0
- package/packages/sourcevision/dist/viewer/components/faq.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/findings-list.d.ts +13 -0
- package/packages/sourcevision/dist/viewer/components/findings-list.js +136 -0
- package/packages/sourcevision/dist/viewer/components/findings-list.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/guide.d.ts +5 -0
- package/packages/sourcevision/dist/viewer/components/guide.js +77 -0
- package/packages/sourcevision/dist/viewer/components/guide.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/health-gauge.d.ts +47 -0
- package/packages/sourcevision/dist/viewer/components/health-gauge.js +70 -0
- package/packages/sourcevision/dist/viewer/components/health-gauge.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/logos.d.ts +103 -0
- package/packages/sourcevision/dist/viewer/components/logos.js +148 -0
- package/packages/sourcevision/dist/viewer/components/logos.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/mini-charts.d.ts +36 -0
- package/packages/sourcevision/dist/viewer/components/mini-charts.js +124 -0
- package/packages/sourcevision/dist/viewer/components/mini-charts.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/add-item-form.d.ts +31 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/add-item-form.js +209 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/add-item-form.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/analyze-panel.d.ts +13 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/analyze-panel.js +225 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/analyze-panel.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/bulk-actions.d.ts +17 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/bulk-actions.js +80 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/bulk-actions.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/compute.d.ts +28 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/compute.js +116 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/compute.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/index.d.ts +14 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/index.js +8 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/index.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/prd-tree.d.ts +21 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/prd-tree.js +293 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/prd-tree.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/status-filter.d.ts +40 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/status-filter.js +129 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/status-filter.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/task-detail.d.ts +18 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/task-detail.js +221 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/task-detail.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/types.d.ts +45 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/types.js +15 -0
- package/packages/sourcevision/dist/viewer/components/prd-tree/types.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/rex-task-link.d.ts +48 -0
- package/packages/sourcevision/dist/viewer/components/rex-task-link.js +191 -0
- package/packages/sourcevision/dist/viewer/components/rex-task-link.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/search-filter.d.ts +20 -0
- package/packages/sourcevision/dist/viewer/components/search-filter.js +28 -0
- package/packages/sourcevision/dist/viewer/components/search-filter.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/sidebar.d.ts +16 -0
- package/packages/sourcevision/dist/viewer/components/sidebar.js +296 -0
- package/packages/sourcevision/dist/viewer/components/sidebar.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/theme-toggle.d.ts +14 -0
- package/packages/sourcevision/dist/viewer/components/theme-toggle.js +37 -0
- package/packages/sourcevision/dist/viewer/components/theme-toggle.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/tree-view.d.ts +18 -0
- package/packages/sourcevision/dist/viewer/components/tree-view.js +107 -0
- package/packages/sourcevision/dist/viewer/components/tree-view.js.map +1 -0
- package/packages/sourcevision/dist/viewer/components/zone-map.d.ts +28 -0
- package/packages/sourcevision/dist/viewer/components/zone-map.js +195 -0
- package/packages/sourcevision/dist/viewer/components/zone-map.js.map +1 -0
- package/packages/sourcevision/dist/viewer/graph/physics.d.ts +70 -0
- package/packages/sourcevision/dist/viewer/graph/physics.js +260 -0
- package/packages/sourcevision/dist/viewer/graph/physics.js.map +1 -0
- package/packages/sourcevision/dist/viewer/graph/renderer.d.ts +69 -0
- package/packages/sourcevision/dist/viewer/graph/renderer.js +423 -0
- package/packages/sourcevision/dist/viewer/graph/renderer.js.map +1 -0
- package/packages/sourcevision/dist/viewer/index.html +27 -0
- package/packages/sourcevision/dist/viewer/loader.d.ts +20 -0
- package/packages/sourcevision/dist/viewer/loader.js +142 -0
- package/packages/sourcevision/dist/viewer/loader.js.map +1 -0
- package/packages/sourcevision/dist/viewer/main.d.ts +1 -0
- package/packages/sourcevision/dist/viewer/main.js +234 -0
- package/packages/sourcevision/dist/viewer/main.js.map +1 -0
- package/packages/sourcevision/dist/viewer/n-dx.png +0 -0
- package/packages/sourcevision/dist/viewer/schema-compat.d.ts +17 -0
- package/packages/sourcevision/dist/viewer/schema-compat.js +47 -0
- package/packages/sourcevision/dist/viewer/schema-compat.js.map +1 -0
- package/packages/sourcevision/dist/viewer/styles.css +2052 -0
- package/packages/sourcevision/dist/viewer/types.d.ts +63 -0
- package/packages/sourcevision/dist/viewer/types.js +2 -0
- package/packages/sourcevision/dist/viewer/types.js.map +1 -0
- package/packages/sourcevision/dist/viewer/utils.d.ts +23 -0
- package/packages/sourcevision/dist/viewer/utils.js +49 -0
- package/packages/sourcevision/dist/viewer/utils.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/analysis.d.ts +10 -0
- package/packages/sourcevision/dist/viewer/views/analysis.js +87 -0
- package/packages/sourcevision/dist/viewer/views/analysis.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/architecture.d.ts +10 -0
- package/packages/sourcevision/dist/viewer/views/architecture.js +75 -0
- package/packages/sourcevision/dist/viewer/views/architecture.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/files.d.ts +13 -0
- package/packages/sourcevision/dist/viewer/views/files.js +162 -0
- package/packages/sourcevision/dist/viewer/views/files.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/graph.d.ts +11 -0
- package/packages/sourcevision/dist/viewer/views/graph.js +130 -0
- package/packages/sourcevision/dist/viewer/views/graph.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/hench-runs.d.ts +17 -0
- package/packages/sourcevision/dist/viewer/views/hench-runs.js +336 -0
- package/packages/sourcevision/dist/viewer/views/hench-runs.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/overview.d.ts +10 -0
- package/packages/sourcevision/dist/viewer/views/overview.js +230 -0
- package/packages/sourcevision/dist/viewer/views/overview.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/prd.d.ts +21 -0
- package/packages/sourcevision/dist/viewer/views/prd.js +201 -0
- package/packages/sourcevision/dist/viewer/views/prd.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/problems.d.ts +8 -0
- package/packages/sourcevision/dist/viewer/views/problems.js +51 -0
- package/packages/sourcevision/dist/viewer/views/problems.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/rex-dashboard.d.ts +14 -0
- package/packages/sourcevision/dist/viewer/views/rex-dashboard.js +229 -0
- package/packages/sourcevision/dist/viewer/views/rex-dashboard.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/routes.d.ts +8 -0
- package/packages/sourcevision/dist/viewer/views/routes.js +218 -0
- package/packages/sourcevision/dist/viewer/views/routes.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/suggestions.d.ts +8 -0
- package/packages/sourcevision/dist/viewer/views/suggestions.js +36 -0
- package/packages/sourcevision/dist/viewer/views/suggestions.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/token-usage.d.ts +10 -0
- package/packages/sourcevision/dist/viewer/views/token-usage.js +384 -0
- package/packages/sourcevision/dist/viewer/views/token-usage.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/validation.d.ts +8 -0
- package/packages/sourcevision/dist/viewer/views/validation.js +470 -0
- package/packages/sourcevision/dist/viewer/views/validation.js.map +1 -0
- package/packages/sourcevision/dist/viewer/views/zones.d.ts +11 -0
- package/packages/sourcevision/dist/viewer/views/zones.js +146 -0
- package/packages/sourcevision/dist/viewer/views/zones.js.map +1 -0
- package/packages/sourcevision/package.json +43 -0
- package/packages/web/build.js +243 -0
- package/packages/web/dist/cli/index.d.ts +8 -0
- package/packages/web/dist/cli/index.js +50 -0
- package/packages/web/dist/cli/index.js.map +1 -0
- package/packages/web/dist/landing/color-inversion.d.ts +7 -0
- package/packages/web/dist/landing/color-inversion.js +24 -0
- package/packages/web/dist/landing/color-inversion.js.map +1 -0
- package/packages/web/dist/landing/index.html +325 -0
- package/packages/web/dist/landing/landing.d.ts +38 -0
- package/packages/web/dist/landing/landing.js +299 -0
- package/packages/web/dist/landing/landing.js.map +1 -0
- package/packages/web/dist/public.d.ts +55 -0
- package/packages/web/dist/public.js +51 -0
- package/packages/web/dist/public.js.map +1 -0
- package/packages/web/dist/schema/data-files.d.ts +10 -0
- package/packages/web/dist/schema/data-files.js +11 -0
- package/packages/web/dist/schema/data-files.js.map +1 -0
- package/packages/web/dist/schema/features.d.ts +28 -0
- package/packages/web/dist/schema/features.js +9 -0
- package/packages/web/dist/schema/features.js.map +1 -0
- package/packages/web/dist/schema/v1.d.ts +317 -0
- package/packages/web/dist/schema/v1.js +3 -0
- package/packages/web/dist/schema/v1.js.map +1 -0
- package/packages/web/dist/schema/validate.d.ts +15 -0
- package/packages/web/dist/schema/validate.js +260 -0
- package/packages/web/dist/schema/validate.js.map +1 -0
- package/packages/web/dist/server/aggregation-cache.d.ts +105 -0
- package/packages/web/dist/server/aggregation-cache.js +163 -0
- package/packages/web/dist/server/aggregation-cache.js.map +1 -0
- package/packages/web/dist/server/concurrent-execution-metrics.d.ts +103 -0
- package/packages/web/dist/server/concurrent-execution-metrics.js +253 -0
- package/packages/web/dist/server/concurrent-execution-metrics.js.map +1 -0
- package/packages/web/dist/server/domain-gateway.d.ts +18 -0
- package/packages/web/dist/server/domain-gateway.js +19 -0
- package/packages/web/dist/server/domain-gateway.js.map +1 -0
- package/packages/web/dist/server/incremental-task-usage.d.ts +92 -0
- package/packages/web/dist/server/incremental-task-usage.js +251 -0
- package/packages/web/dist/server/incremental-task-usage.js.map +1 -0
- package/packages/web/dist/server/index.d.ts +39 -0
- package/packages/web/dist/server/index.js +36 -0
- package/packages/web/dist/server/index.js.map +1 -0
- package/packages/web/dist/server/mcp-deps.d.ts +6 -0
- package/packages/web/dist/server/mcp-deps.js +7 -0
- package/packages/web/dist/server/mcp-deps.js.map +1 -0
- package/packages/web/dist/server/port.d.ts +96 -0
- package/packages/web/dist/server/port.js +134 -0
- package/packages/web/dist/server/port.js.map +1 -0
- package/packages/web/dist/server/pr-markdown-refresh-diagnostics.d.ts +59 -0
- package/packages/web/dist/server/pr-markdown-refresh-diagnostics.js +429 -0
- package/packages/web/dist/server/pr-markdown-refresh-diagnostics.js.map +1 -0
- package/packages/web/dist/server/prd-io.d.ts +40 -0
- package/packages/web/dist/server/prd-io.js +66 -0
- package/packages/web/dist/server/prd-io.js.map +1 -0
- package/packages/web/dist/server/process-memory-tracker.d.ts +79 -0
- package/packages/web/dist/server/process-memory-tracker.js +194 -0
- package/packages/web/dist/server/process-memory-tracker.js.map +1 -0
- package/packages/web/dist/server/register-scheduler.d.ts +53 -0
- package/packages/web/dist/server/register-scheduler.js +36 -0
- package/packages/web/dist/server/register-scheduler.js.map +1 -0
- package/packages/web/dist/server/rex-domain.d.ts +55 -0
- package/packages/web/dist/server/rex-domain.js +84 -0
- package/packages/web/dist/server/rex-domain.js.map +1 -0
- package/packages/web/dist/server/rex-gateway.d.ts +39 -0
- package/packages/web/dist/server/rex-gateway.js +47 -0
- package/packages/web/dist/server/rex-gateway.js.map +1 -0
- package/packages/web/dist/server/routes-adaptive.d.ts +21 -0
- package/packages/web/dist/server/routes-adaptive.js +659 -0
- package/packages/web/dist/server/routes-adaptive.js.map +1 -0
- package/packages/web/dist/server/routes-config.d.ts +47 -0
- package/packages/web/dist/server/routes-config.js +222 -0
- package/packages/web/dist/server/routes-config.js.map +1 -0
- package/packages/web/dist/server/routes-data.d.ts +14 -0
- package/packages/web/dist/server/routes-data.js +129 -0
- package/packages/web/dist/server/routes-data.js.map +1 -0
- package/packages/web/dist/server/routes-features.d.ts +14 -0
- package/packages/web/dist/server/routes-features.js +245 -0
- package/packages/web/dist/server/routes-features.js.map +1 -0
- package/packages/web/dist/server/routes-hench.d.ts +116 -0
- package/packages/web/dist/server/routes-hench.js +2016 -0
- package/packages/web/dist/server/routes-hench.js.map +1 -0
- package/packages/web/dist/server/routes-integrations.d.ts +23 -0
- package/packages/web/dist/server/routes-integrations.js +277 -0
- package/packages/web/dist/server/routes-integrations.js.map +1 -0
- package/packages/web/dist/server/routes-mcp.d.ts +31 -0
- package/packages/web/dist/server/routes-mcp.js +175 -0
- package/packages/web/dist/server/routes-mcp.js.map +1 -0
- package/packages/web/dist/server/routes-notion.d.ts +23 -0
- package/packages/web/dist/server/routes-notion.js +723 -0
- package/packages/web/dist/server/routes-notion.js.map +1 -0
- package/packages/web/dist/server/routes-project.d.ts +47 -0
- package/packages/web/dist/server/routes-project.js +128 -0
- package/packages/web/dist/server/routes-project.js.map +1 -0
- package/packages/web/dist/server/routes-rex/analysis.d.ts +11 -0
- package/packages/web/dist/server/routes-rex/analysis.js +583 -0
- package/packages/web/dist/server/routes-rex/analysis.js.map +1 -0
- package/packages/web/dist/server/routes-rex/execution.d.ts +37 -0
- package/packages/web/dist/server/routes-rex/execution.js +355 -0
- package/packages/web/dist/server/routes-rex/execution.js.map +1 -0
- package/packages/web/dist/server/routes-rex/health.d.ts +8 -0
- package/packages/web/dist/server/routes-rex/health.js +136 -0
- package/packages/web/dist/server/routes-rex/health.js.map +1 -0
- package/packages/web/dist/server/routes-rex/index.d.ts +35 -0
- package/packages/web/dist/server/routes-rex/index.js +72 -0
- package/packages/web/dist/server/routes-rex/index.js.map +1 -0
- package/packages/web/dist/server/routes-rex/items.d.ts +8 -0
- package/packages/web/dist/server/routes-rex/items.js +359 -0
- package/packages/web/dist/server/routes-rex/items.js.map +1 -0
- package/packages/web/dist/server/routes-rex/prune.d.ts +11 -0
- package/packages/web/dist/server/routes-rex/prune.js +379 -0
- package/packages/web/dist/server/routes-rex/prune.js.map +1 -0
- package/packages/web/dist/server/routes-rex/reads.d.ts +9 -0
- package/packages/web/dist/server/routes-rex/reads.js +119 -0
- package/packages/web/dist/server/routes-rex/reads.js.map +1 -0
- package/packages/web/dist/server/routes-rex/requirements.d.ts +10 -0
- package/packages/web/dist/server/routes-rex/requirements.js +408 -0
- package/packages/web/dist/server/routes-rex/requirements.js.map +1 -0
- package/packages/web/dist/server/routes-rex/shared.d.ts +37 -0
- package/packages/web/dist/server/routes-rex/shared.js +73 -0
- package/packages/web/dist/server/routes-rex/shared.js.map +1 -0
- package/packages/web/dist/server/routes-rex.d.ts +77 -0
- package/packages/web/dist/server/routes-rex.js +2403 -0
- package/packages/web/dist/server/routes-rex.js.map +1 -0
- package/packages/web/dist/server/routes-search.d.ts +26 -0
- package/packages/web/dist/server/routes-search.js +82 -0
- package/packages/web/dist/server/routes-search.js.map +1 -0
- package/packages/web/dist/server/routes-sourcevision.d.ts +18 -0
- package/packages/web/dist/server/routes-sourcevision.js +444 -0
- package/packages/web/dist/server/routes-sourcevision.js.map +1 -0
- package/packages/web/dist/server/routes-static.d.ts +20 -0
- package/packages/web/dist/server/routes-static.js +168 -0
- package/packages/web/dist/server/routes-static.js.map +1 -0
- package/packages/web/dist/server/routes-status.d.ts +58 -0
- package/packages/web/dist/server/routes-status.js +191 -0
- package/packages/web/dist/server/routes-status.js.map +1 -0
- package/packages/web/dist/server/routes-token-usage.d.ts +63 -0
- package/packages/web/dist/server/routes-token-usage.js +720 -0
- package/packages/web/dist/server/routes-token-usage.js.map +1 -0
- package/packages/web/dist/server/routes-validation.d.ts +10 -0
- package/packages/web/dist/server/routes-validation.js +365 -0
- package/packages/web/dist/server/routes-validation.js.map +1 -0
- package/packages/web/dist/server/routes-workflow.d.ts +15 -0
- package/packages/web/dist/server/routes-workflow.js +498 -0
- package/packages/web/dist/server/routes-workflow.js.map +1 -0
- package/packages/web/dist/server/search-index.d.ts +111 -0
- package/packages/web/dist/server/search-index.js +348 -0
- package/packages/web/dist/server/search-index.js.map +1 -0
- package/packages/web/dist/server/shared-types.d.ts +65 -0
- package/packages/web/dist/server/shared-types.js +31 -0
- package/packages/web/dist/server/shared-types.js.map +1 -0
- package/packages/web/dist/server/start.d.ts +68 -0
- package/packages/web/dist/server/start.js +568 -0
- package/packages/web/dist/server/start.js.map +1 -0
- package/packages/web/dist/server/task-usage.d.ts +17 -0
- package/packages/web/dist/server/task-usage.js +20 -0
- package/packages/web/dist/server/task-usage.js.map +1 -0
- package/packages/web/dist/server/types.d.ts +27 -0
- package/packages/web/dist/server/types.js +26 -0
- package/packages/web/dist/server/types.js.map +1 -0
- package/packages/web/dist/server/usage-cleanup-scheduler.d.ts +107 -0
- package/packages/web/dist/server/usage-cleanup-scheduler.js +232 -0
- package/packages/web/dist/server/usage-cleanup-scheduler.js.map +1 -0
- package/packages/web/dist/server/websocket.d.ts +131 -0
- package/packages/web/dist/server/websocket.js +512 -0
- package/packages/web/dist/server/websocket.js.map +1 -0
- package/packages/web/dist/server/ws-health-tracker.d.ts +86 -0
- package/packages/web/dist/server/ws-health-tracker.js +186 -0
- package/packages/web/dist/server/ws-health-tracker.js.map +1 -0
- package/packages/web/dist/shared/data-files.d.ts +17 -0
- package/packages/web/dist/shared/data-files.js +18 -0
- package/packages/web/dist/shared/data-files.js.map +1 -0
- package/packages/web/dist/shared/index.d.ts +9 -0
- package/packages/web/dist/shared/index.js +9 -0
- package/packages/web/dist/shared/index.js.map +1 -0
- package/packages/web/dist/shared/node-culler.d.ts +94 -0
- package/packages/web/dist/shared/node-culler.js +133 -0
- package/packages/web/dist/shared/node-culler.js.map +1 -0
- package/packages/web/dist/shared/request-dedup.d.ts +43 -0
- package/packages/web/dist/shared/request-dedup.js +55 -0
- package/packages/web/dist/shared/request-dedup.js.map +1 -0
- package/packages/web/dist/shared/view-id.d.ts +8 -0
- package/packages/web/dist/shared/view-id.js +9 -0
- package/packages/web/dist/shared/view-id.js.map +1 -0
- package/packages/web/dist/viewer/Hench-F.png +0 -0
- package/packages/web/dist/viewer/Rex-F.png +0 -0
- package/packages/web/dist/viewer/SourceVision-F.png +0 -0
- package/packages/web/dist/viewer/SourceVision.png +0 -0
- package/packages/web/dist/viewer/api.d.ts +19 -0
- package/packages/web/dist/viewer/api.js +17 -0
- package/packages/web/dist/viewer/api.js.map +1 -0
- package/packages/web/dist/viewer/batched-tick-dispatcher.d.ts +83 -0
- package/packages/web/dist/viewer/batched-tick-dispatcher.js +183 -0
- package/packages/web/dist/viewer/batched-tick-dispatcher.js.map +1 -0
- package/packages/web/dist/viewer/bootstrap.d.ts +13 -0
- package/packages/web/dist/viewer/bootstrap.js +40 -0
- package/packages/web/dist/viewer/bootstrap.js.map +1 -0
- package/packages/web/dist/viewer/call-rate-limiter.d.ts +50 -0
- package/packages/web/dist/viewer/call-rate-limiter.js +103 -0
- package/packages/web/dist/viewer/call-rate-limiter.js.map +1 -0
- package/packages/web/dist/viewer/components/active-tasks-panel.d.ts +36 -0
- package/packages/web/dist/viewer/components/active-tasks-panel.js +183 -0
- package/packages/web/dist/viewer/components/active-tasks-panel.js.map +1 -0
- package/packages/web/dist/viewer/components/breadcrumb.d.ts +21 -0
- package/packages/web/dist/viewer/components/breadcrumb.js +117 -0
- package/packages/web/dist/viewer/components/breadcrumb.js.map +1 -0
- package/packages/web/dist/viewer/components/concurrency-panel.d.ts +18 -0
- package/packages/web/dist/viewer/components/concurrency-panel.js +175 -0
- package/packages/web/dist/viewer/components/concurrency-panel.js.map +1 -0
- package/packages/web/dist/viewer/components/config-footer.d.ts +11 -0
- package/packages/web/dist/viewer/components/config-footer.js +132 -0
- package/packages/web/dist/viewer/components/config-footer.js.map +1 -0
- package/packages/web/dist/viewer/components/constants.d.ts +10 -0
- package/packages/web/dist/viewer/components/constants.js +11 -0
- package/packages/web/dist/viewer/components/constants.js.map +1 -0
- package/packages/web/dist/viewer/components/copy-link-button.d.ts +30 -0
- package/packages/web/dist/viewer/components/copy-link-button.js +74 -0
- package/packages/web/dist/viewer/components/copy-link-button.js.map +1 -0
- package/packages/web/dist/viewer/components/crash-recovery-banner.d.ts +28 -0
- package/packages/web/dist/viewer/components/crash-recovery-banner.js +47 -0
- package/packages/web/dist/viewer/components/crash-recovery-banner.js.map +1 -0
- package/packages/web/dist/viewer/components/data-display/collapsible-section.d.ts +14 -0
- package/packages/web/dist/viewer/components/data-display/collapsible-section.js +66 -0
- package/packages/web/dist/viewer/components/data-display/collapsible-section.js.map +1 -0
- package/packages/web/dist/viewer/components/data-display/findings-list.d.ts +13 -0
- package/packages/web/dist/viewer/components/data-display/findings-list.js +136 -0
- package/packages/web/dist/viewer/components/data-display/findings-list.js.map +1 -0
- package/packages/web/dist/viewer/components/data-display/health-gauge.d.ts +37 -0
- package/packages/web/dist/viewer/components/data-display/health-gauge.js +62 -0
- package/packages/web/dist/viewer/components/data-display/health-gauge.js.map +1 -0
- package/packages/web/dist/viewer/components/data-display/mini-charts.d.ts +36 -0
- package/packages/web/dist/viewer/components/data-display/mini-charts.js +124 -0
- package/packages/web/dist/viewer/components/data-display/mini-charts.js.map +1 -0
- package/packages/web/dist/viewer/components/data-display/tree-view.d.ts +18 -0
- package/packages/web/dist/viewer/components/data-display/tree-view.js +107 -0
- package/packages/web/dist/viewer/components/data-display/tree-view.js.map +1 -0
- package/packages/web/dist/viewer/components/data-display/zone-map.d.ts +28 -0
- package/packages/web/dist/viewer/components/data-display/zone-map.js +197 -0
- package/packages/web/dist/viewer/components/data-display/zone-map.js.map +1 -0
- package/packages/web/dist/viewer/components/degradation-banner.d.ts +28 -0
- package/packages/web/dist/viewer/components/degradation-banner.js +47 -0
- package/packages/web/dist/viewer/components/degradation-banner.js.map +1 -0
- package/packages/web/dist/viewer/components/detail-panel.d.ts +12 -0
- package/packages/web/dist/viewer/components/detail-panel.js +166 -0
- package/packages/web/dist/viewer/components/detail-panel.js.map +1 -0
- package/packages/web/dist/viewer/components/elapsed-time.d.ts +38 -0
- package/packages/web/dist/viewer/components/elapsed-time.js +35 -0
- package/packages/web/dist/viewer/components/elapsed-time.js.map +1 -0
- package/packages/web/dist/viewer/components/faq.d.ts +12 -0
- package/packages/web/dist/viewer/components/faq.js +237 -0
- package/packages/web/dist/viewer/components/faq.js.map +1 -0
- package/packages/web/dist/viewer/components/favicon.d.ts +30 -0
- package/packages/web/dist/viewer/components/favicon.js +90 -0
- package/packages/web/dist/viewer/components/favicon.js.map +1 -0
- package/packages/web/dist/viewer/components/guide.d.ts +5 -0
- package/packages/web/dist/viewer/components/guide.js +116 -0
- package/packages/web/dist/viewer/components/guide.js.map +1 -0
- package/packages/web/dist/viewer/components/index.d.ts +37 -0
- package/packages/web/dist/viewer/components/index.js +46 -0
- package/packages/web/dist/viewer/components/index.js.map +1 -0
- package/packages/web/dist/viewer/components/logos.d.ts +42 -0
- package/packages/web/dist/viewer/components/logos.js +46 -0
- package/packages/web/dist/viewer/components/logos.js.map +1 -0
- package/packages/web/dist/viewer/components/memory-panel.d.ts +19 -0
- package/packages/web/dist/viewer/components/memory-panel.js +181 -0
- package/packages/web/dist/viewer/components/memory-panel.js.map +1 -0
- package/packages/web/dist/viewer/components/memory-warning.d.ts +23 -0
- package/packages/web/dist/viewer/components/memory-warning.js +42 -0
- package/packages/web/dist/viewer/components/memory-warning.js.map +1 -0
- package/packages/web/dist/viewer/components/notion-schema-wizard.d.ts +16 -0
- package/packages/web/dist/viewer/components/notion-schema-wizard.js +263 -0
- package/packages/web/dist/viewer/components/notion-schema-wizard.js.map +1 -0
- package/packages/web/dist/viewer/components/polling-suspension-indicator.d.ts +24 -0
- package/packages/web/dist/viewer/components/polling-suspension-indicator.js +31 -0
- package/packages/web/dist/viewer/components/polling-suspension-indicator.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/add-item-form.d.ts +31 -0
- package/packages/web/dist/viewer/components/prd-tree/add-item-form.js +231 -0
- package/packages/web/dist/viewer/components/prd-tree/add-item-form.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/analyze-panel.d.ts +13 -0
- package/packages/web/dist/viewer/components/prd-tree/analyze-panel.js +245 -0
- package/packages/web/dist/viewer/components/prd-tree/analyze-panel.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/batch-import-panel.d.ts +34 -0
- package/packages/web/dist/viewer/components/prd-tree/batch-import-panel.js +415 -0
- package/packages/web/dist/viewer/components/prd-tree/batch-import-panel.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/bulk-actions.d.ts +19 -0
- package/packages/web/dist/viewer/components/prd-tree/bulk-actions.js +90 -0
- package/packages/web/dist/viewer/components/prd-tree/bulk-actions.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/compute.d.ts +32 -0
- package/packages/web/dist/viewer/components/prd-tree/compute.js +129 -0
- package/packages/web/dist/viewer/components/prd-tree/compute.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/delete-confirmation.d.ts +23 -0
- package/packages/web/dist/viewer/components/prd-tree/delete-confirmation.js +83 -0
- package/packages/web/dist/viewer/components/prd-tree/delete-confirmation.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/execution-panel.d.ts +14 -0
- package/packages/web/dist/viewer/components/prd-tree/execution-panel.js +291 -0
- package/packages/web/dist/viewer/components/prd-tree/execution-panel.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/facet-filter.d.ts +40 -0
- package/packages/web/dist/viewer/components/prd-tree/facet-filter.js +188 -0
- package/packages/web/dist/viewer/components/prd-tree/facet-filter.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/index.d.ts +24 -0
- package/packages/web/dist/viewer/components/prd-tree/index.js +16 -0
- package/packages/web/dist/viewer/components/prd-tree/index.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/inline-add-form.d.ts +32 -0
- package/packages/web/dist/viewer/components/prd-tree/inline-add-form.js +175 -0
- package/packages/web/dist/viewer/components/prd-tree/inline-add-form.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/inline-status-picker.d.ts +31 -0
- package/packages/web/dist/viewer/components/prd-tree/inline-status-picker.js +110 -0
- package/packages/web/dist/viewer/components/prd-tree/inline-status-picker.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/lazy-children.d.ts +40 -0
- package/packages/web/dist/viewer/components/prd-tree/lazy-children.js +73 -0
- package/packages/web/dist/viewer/components/prd-tree/lazy-children.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/levels.d.ts +31 -0
- package/packages/web/dist/viewer/components/prd-tree/levels.js +72 -0
- package/packages/web/dist/viewer/components/prd-tree/levels.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/listener-lifecycle.d.ts +105 -0
- package/packages/web/dist/viewer/components/prd-tree/listener-lifecycle.js +173 -0
- package/packages/web/dist/viewer/components/prd-tree/listener-lifecycle.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/merge-preview.d.ts +25 -0
- package/packages/web/dist/viewer/components/prd-tree/merge-preview.js +181 -0
- package/packages/web/dist/viewer/components/prd-tree/merge-preview.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/node-culler.d.ts +96 -0
- package/packages/web/dist/viewer/components/prd-tree/node-culler.js +135 -0
- package/packages/web/dist/viewer/components/prd-tree/node-culler.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/prd-tree.d.ts +91 -0
- package/packages/web/dist/viewer/components/prd-tree/prd-tree.js +565 -0
- package/packages/web/dist/viewer/components/prd-tree/prd-tree.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/progressive-loader.d.ts +114 -0
- package/packages/web/dist/viewer/components/prd-tree/progressive-loader.js +225 -0
- package/packages/web/dist/viewer/components/prd-tree/progressive-loader.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/proposal-editor.d.ts +44 -0
- package/packages/web/dist/viewer/components/prd-tree/proposal-editor.js +438 -0
- package/packages/web/dist/viewer/components/prd-tree/proposal-editor.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/prune-confirmation.d.ts +25 -0
- package/packages/web/dist/viewer/components/prd-tree/prune-confirmation.js +336 -0
- package/packages/web/dist/viewer/components/prd-tree/prune-confirmation.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/prune-diff-tree.d.ts +39 -0
- package/packages/web/dist/viewer/components/prd-tree/prune-diff-tree.js +319 -0
- package/packages/web/dist/viewer/components/prd-tree/prune-diff-tree.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/reorganize-panel.d.ts +16 -0
- package/packages/web/dist/viewer/components/prd-tree/reorganize-panel.js +213 -0
- package/packages/web/dist/viewer/components/prd-tree/reorganize-panel.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/shared-imports.d.ts +18 -0
- package/packages/web/dist/viewer/components/prd-tree/shared-imports.js +18 -0
- package/packages/web/dist/viewer/components/prd-tree/shared-imports.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/smart-add-input.d.ts +19 -0
- package/packages/web/dist/viewer/components/prd-tree/smart-add-input.js +383 -0
- package/packages/web/dist/viewer/components/prd-tree/smart-add-input.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/status-filter.d.ts +40 -0
- package/packages/web/dist/viewer/components/prd-tree/status-filter.js +131 -0
- package/packages/web/dist/viewer/components/prd-tree/status-filter.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/task-detail.d.ts +41 -0
- package/packages/web/dist/viewer/components/prd-tree/task-detail.js +1205 -0
- package/packages/web/dist/viewer/components/prd-tree/task-detail.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/task-utilization.d.ts +7 -0
- package/packages/web/dist/viewer/components/prd-tree/task-utilization.js +25 -0
- package/packages/web/dist/viewer/components/prd-tree/task-utilization.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-differ.d.ts +59 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-differ.js +200 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-differ.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-event-delegate.d.ts +70 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-event-delegate.js +176 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-event-delegate.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-search.d.ts +65 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-search.js +178 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-search.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-utils.d.ts +38 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-utils.js +107 -0
- package/packages/web/dist/viewer/components/prd-tree/tree-utils.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/types.d.ts +93 -0
- package/packages/web/dist/viewer/components/prd-tree/types.js +16 -0
- package/packages/web/dist/viewer/components/prd-tree/types.js.map +1 -0
- package/packages/web/dist/viewer/components/prd-tree/virtual-scroll.d.ts +119 -0
- package/packages/web/dist/viewer/components/prd-tree/virtual-scroll.js +169 -0
- package/packages/web/dist/viewer/components/prd-tree/virtual-scroll.js.map +1 -0
- package/packages/web/dist/viewer/components/progressive-loader.d.ts +114 -0
- package/packages/web/dist/viewer/components/progressive-loader.js +225 -0
- package/packages/web/dist/viewer/components/progressive-loader.js.map +1 -0
- package/packages/web/dist/viewer/components/refresh-queue-status.d.ts +20 -0
- package/packages/web/dist/viewer/components/refresh-queue-status.js +65 -0
- package/packages/web/dist/viewer/components/refresh-queue-status.js.map +1 -0
- package/packages/web/dist/viewer/components/rex-task-link.d.ts +50 -0
- package/packages/web/dist/viewer/components/rex-task-link.js +218 -0
- package/packages/web/dist/viewer/components/rex-task-link.js.map +1 -0
- package/packages/web/dist/viewer/components/search-filter.d.ts +20 -0
- package/packages/web/dist/viewer/components/search-filter.js +28 -0
- package/packages/web/dist/viewer/components/search-filter.js.map +1 -0
- package/packages/web/dist/viewer/components/search-overlay.d.ts +31 -0
- package/packages/web/dist/viewer/components/search-overlay.js +472 -0
- package/packages/web/dist/viewer/components/search-overlay.js.map +1 -0
- package/packages/web/dist/viewer/components/sidebar.d.ts +18 -0
- package/packages/web/dist/viewer/components/sidebar.js +357 -0
- package/packages/web/dist/viewer/components/sidebar.js.map +1 -0
- package/packages/web/dist/viewer/components/status-indicators.d.ts +63 -0
- package/packages/web/dist/viewer/components/status-indicators.js +136 -0
- package/packages/web/dist/viewer/components/status-indicators.js.map +1 -0
- package/packages/web/dist/viewer/components/theme-toggle.d.ts +8 -0
- package/packages/web/dist/viewer/components/theme-toggle.js +28 -0
- package/packages/web/dist/viewer/components/theme-toggle.js.map +1 -0
- package/packages/web/dist/viewer/components/throttle-controls.d.ts +18 -0
- package/packages/web/dist/viewer/components/throttle-controls.js +304 -0
- package/packages/web/dist/viewer/components/throttle-controls.js.map +1 -0
- package/packages/web/dist/viewer/components/ws-health-panel.d.ts +18 -0
- package/packages/web/dist/viewer/components/ws-health-panel.js +250 -0
- package/packages/web/dist/viewer/components/ws-health-panel.js.map +1 -0
- package/packages/web/dist/viewer/components/zone-slideout.d.ts +17 -0
- package/packages/web/dist/viewer/components/zone-slideout.js +162 -0
- package/packages/web/dist/viewer/components/zone-slideout.js.map +1 -0
- package/packages/web/dist/viewer/crash/crash-detector.d.ts +69 -0
- package/packages/web/dist/viewer/crash/crash-detector.js +239 -0
- package/packages/web/dist/viewer/crash/crash-detector.js.map +1 -0
- package/packages/web/dist/viewer/crash/index.d.ts +7 -0
- package/packages/web/dist/viewer/crash/index.js +8 -0
- package/packages/web/dist/viewer/crash/index.js.map +1 -0
- package/packages/web/dist/viewer/crash-detector.d.ts +105 -0
- package/packages/web/dist/viewer/crash-detector.js +257 -0
- package/packages/web/dist/viewer/crash-detector.js.map +1 -0
- package/packages/web/dist/viewer/deployed-mode.d.ts +37 -0
- package/packages/web/dist/viewer/deployed-mode.js +94 -0
- package/packages/web/dist/viewer/deployed-mode.js.map +1 -0
- package/packages/web/dist/viewer/dom-performance-monitor.d.ts +158 -0
- package/packages/web/dist/viewer/dom-performance-monitor.js +342 -0
- package/packages/web/dist/viewer/dom-performance-monitor.js.map +1 -0
- package/packages/web/dist/viewer/dom-update-gate.d.ts +122 -0
- package/packages/web/dist/viewer/dom-update-gate.js +229 -0
- package/packages/web/dist/viewer/dom-update-gate.js.map +1 -0
- package/packages/web/dist/viewer/external.d.ts +17 -0
- package/packages/web/dist/viewer/external.js +17 -0
- package/packages/web/dist/viewer/external.js.map +1 -0
- package/packages/web/dist/viewer/graceful-degradation.d.ts +73 -0
- package/packages/web/dist/viewer/graceful-degradation.js +152 -0
- package/packages/web/dist/viewer/graceful-degradation.js.map +1 -0
- package/packages/web/dist/viewer/graph/index.d.ts +9 -0
- package/packages/web/dist/viewer/graph/index.js +12 -0
- package/packages/web/dist/viewer/graph/index.js.map +1 -0
- package/packages/web/dist/viewer/graph/physics.d.ts +96 -0
- package/packages/web/dist/viewer/graph/physics.js +366 -0
- package/packages/web/dist/viewer/graph/physics.js.map +1 -0
- package/packages/web/dist/viewer/graph/renderer.d.ts +184 -0
- package/packages/web/dist/viewer/graph/renderer.js +1438 -0
- package/packages/web/dist/viewer/graph/renderer.js.map +1 -0
- package/packages/web/dist/viewer/hooks/index.d.ts +27 -0
- package/packages/web/dist/viewer/hooks/index.js +28 -0
- package/packages/web/dist/viewer/hooks/index.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-app-data.d.ts +31 -0
- package/packages/web/dist/viewer/hooks/use-app-data.js +152 -0
- package/packages/web/dist/viewer/hooks/use-app-data.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-crash-recovery.d.ts +50 -0
- package/packages/web/dist/viewer/hooks/use-crash-recovery.js +76 -0
- package/packages/web/dist/viewer/hooks/use-crash-recovery.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-delete-actions.d.ts +48 -0
- package/packages/web/dist/viewer/hooks/use-delete-actions.js +103 -0
- package/packages/web/dist/viewer/hooks/use-delete-actions.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-dom-performance-monitor.d.ts +68 -0
- package/packages/web/dist/viewer/hooks/use-dom-performance-monitor.js +71 -0
- package/packages/web/dist/viewer/hooks/use-dom-performance-monitor.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-facet-state.d.ts +32 -0
- package/packages/web/dist/viewer/hooks/use-facet-state.js +119 -0
- package/packages/web/dist/viewer/hooks/use-facet-state.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-feature-toggle.d.ts +18 -0
- package/packages/web/dist/viewer/hooks/use-feature-toggle.js +57 -0
- package/packages/web/dist/viewer/hooks/use-feature-toggle.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-file-edges.d.ts +23 -0
- package/packages/web/dist/viewer/hooks/use-file-edges.js +221 -0
- package/packages/web/dist/viewer/hooks/use-file-edges.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-graceful-degradation.d.ts +30 -0
- package/packages/web/dist/viewer/hooks/use-graceful-degradation.js +45 -0
- package/packages/web/dist/viewer/hooks/use-graceful-degradation.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-item-selection.d.ts +49 -0
- package/packages/web/dist/viewer/hooks/use-item-selection.js +117 -0
- package/packages/web/dist/viewer/hooks/use-item-selection.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-memory-monitor.d.ts +39 -0
- package/packages/web/dist/viewer/hooks/use-memory-monitor.js +73 -0
- package/packages/web/dist/viewer/hooks/use-memory-monitor.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-pan-zoom.d.ts +33 -0
- package/packages/web/dist/viewer/hooks/use-pan-zoom.js +110 -0
- package/packages/web/dist/viewer/hooks/use-pan-zoom.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-persistent-filter.d.ts +24 -0
- package/packages/web/dist/viewer/hooks/use-persistent-filter.js +37 -0
- package/packages/web/dist/viewer/hooks/use-persistent-filter.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-polling-suspension.d.ts +32 -0
- package/packages/web/dist/viewer/hooks/use-polling-suspension.js +41 -0
- package/packages/web/dist/viewer/hooks/use-polling-suspension.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-polling.d.ts +39 -0
- package/packages/web/dist/viewer/hooks/use-polling.js +55 -0
- package/packages/web/dist/viewer/hooks/use-polling.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-prd-actions.d.ts +126 -0
- package/packages/web/dist/viewer/hooks/use-prd-actions.js +250 -0
- package/packages/web/dist/viewer/hooks/use-prd-actions.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-prd-data.d.ts +45 -0
- package/packages/web/dist/viewer/hooks/use-prd-data.js +159 -0
- package/packages/web/dist/viewer/hooks/use-prd-data.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-prd-deep-link.d.ts +45 -0
- package/packages/web/dist/viewer/hooks/use-prd-deep-link.js +60 -0
- package/packages/web/dist/viewer/hooks/use-prd-deep-link.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-prd-websocket.d.ts +47 -0
- package/packages/web/dist/viewer/hooks/use-prd-websocket.js +139 -0
- package/packages/web/dist/viewer/hooks/use-prd-websocket.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-project-metadata.d.ts +25 -0
- package/packages/web/dist/viewer/hooks/use-project-metadata.js +55 -0
- package/packages/web/dist/viewer/hooks/use-project-metadata.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-project-status.d.ts +60 -0
- package/packages/web/dist/viewer/hooks/use-project-status.js +133 -0
- package/packages/web/dist/viewer/hooks/use-project-status.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-refresh-throttle.d.ts +45 -0
- package/packages/web/dist/viewer/hooks/use-refresh-throttle.js +52 -0
- package/packages/web/dist/viewer/hooks/use-refresh-throttle.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-route-state.d.ts +18 -0
- package/packages/web/dist/viewer/hooks/use-route-state.js +115 -0
- package/packages/web/dist/viewer/hooks/use-route-state.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-subzone-edges.d.ts +21 -0
- package/packages/web/dist/viewer/hooks/use-subzone-edges.js +147 -0
- package/packages/web/dist/viewer/hooks/use-subzone-edges.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-tab-visibility.d.ts +31 -0
- package/packages/web/dist/viewer/hooks/use-tab-visibility.js +43 -0
- package/packages/web/dist/viewer/hooks/use-tab-visibility.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-tick.d.ts +43 -0
- package/packages/web/dist/viewer/hooks/use-tick.js +76 -0
- package/packages/web/dist/viewer/hooks/use-tick.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-toast.d.ts +24 -0
- package/packages/web/dist/viewer/hooks/use-toast.js +26 -0
- package/packages/web/dist/viewer/hooks/use-toast.js.map +1 -0
- package/packages/web/dist/viewer/hooks/use-zone-drag.d.ts +30 -0
- package/packages/web/dist/viewer/hooks/use-zone-drag.js +60 -0
- package/packages/web/dist/viewer/hooks/use-zone-drag.js.map +1 -0
- package/packages/web/dist/viewer/index.html +36 -0
- package/packages/web/dist/viewer/loader.d.ts +33 -0
- package/packages/web/dist/viewer/loader.js +195 -0
- package/packages/web/dist/viewer/loader.js.map +1 -0
- package/packages/web/dist/viewer/main.d.ts +1 -0
- package/packages/web/dist/viewer/main.js +121 -0
- package/packages/web/dist/viewer/main.js.map +1 -0
- package/packages/web/dist/viewer/memory-monitor.d.ts +78 -0
- package/packages/web/dist/viewer/memory-monitor.js +218 -0
- package/packages/web/dist/viewer/memory-monitor.js.map +1 -0
- package/packages/web/dist/viewer/message-coalescer.d.ts +96 -0
- package/packages/web/dist/viewer/message-coalescer.js +121 -0
- package/packages/web/dist/viewer/message-coalescer.js.map +1 -0
- package/packages/web/dist/viewer/message-throttle.d.ts +95 -0
- package/packages/web/dist/viewer/message-throttle.js +147 -0
- package/packages/web/dist/viewer/message-throttle.js.map +1 -0
- package/packages/web/dist/viewer/messaging/call-rate-limiter.d.ts +50 -0
- package/packages/web/dist/viewer/messaging/call-rate-limiter.js +103 -0
- package/packages/web/dist/viewer/messaging/call-rate-limiter.js.map +1 -0
- package/packages/web/dist/viewer/messaging/fetch-pipeline.d.ts +58 -0
- package/packages/web/dist/viewer/messaging/fetch-pipeline.js +58 -0
- package/packages/web/dist/viewer/messaging/fetch-pipeline.js.map +1 -0
- package/packages/web/dist/viewer/messaging/index.d.ts +43 -0
- package/packages/web/dist/viewer/messaging/index.js +46 -0
- package/packages/web/dist/viewer/messaging/index.js.map +1 -0
- package/packages/web/dist/viewer/messaging/message-coalescer.d.ts +96 -0
- package/packages/web/dist/viewer/messaging/message-coalescer.js +121 -0
- package/packages/web/dist/viewer/messaging/message-coalescer.js.map +1 -0
- package/packages/web/dist/viewer/messaging/message-throttle.d.ts +95 -0
- package/packages/web/dist/viewer/messaging/message-throttle.js +147 -0
- package/packages/web/dist/viewer/messaging/message-throttle.js.map +1 -0
- package/packages/web/dist/viewer/messaging/request-dedup.d.ts +43 -0
- package/packages/web/dist/viewer/messaging/request-dedup.js +55 -0
- package/packages/web/dist/viewer/messaging/request-dedup.js.map +1 -0
- package/packages/web/dist/viewer/messaging/ws-pipeline.d.ts +85 -0
- package/packages/web/dist/viewer/messaging/ws-pipeline.js +68 -0
- package/packages/web/dist/viewer/messaging/ws-pipeline.js.map +1 -0
- package/packages/web/dist/viewer/n-dx.png +0 -0
- package/packages/web/dist/viewer/performance/crash-detector-test-support.d.ts +15 -0
- package/packages/web/dist/viewer/performance/crash-detector-test-support.js +19 -0
- package/packages/web/dist/viewer/performance/crash-detector-test-support.js.map +1 -0
- package/packages/web/dist/viewer/performance/crash-detector.d.ts +105 -0
- package/packages/web/dist/viewer/performance/crash-detector.js +257 -0
- package/packages/web/dist/viewer/performance/crash-detector.js.map +1 -0
- package/packages/web/dist/viewer/performance/dom-performance-monitor.d.ts +157 -0
- package/packages/web/dist/viewer/performance/dom-performance-monitor.js +341 -0
- package/packages/web/dist/viewer/performance/dom-performance-monitor.js.map +1 -0
- package/packages/web/dist/viewer/performance/dom-update-gate.d.ts +122 -0
- package/packages/web/dist/viewer/performance/dom-update-gate.js +229 -0
- package/packages/web/dist/viewer/performance/dom-update-gate.js.map +1 -0
- package/packages/web/dist/viewer/performance/graceful-degradation.d.ts +73 -0
- package/packages/web/dist/viewer/performance/graceful-degradation.js +152 -0
- package/packages/web/dist/viewer/performance/graceful-degradation.js.map +1 -0
- package/packages/web/dist/viewer/performance/index.d.ts +14 -0
- package/packages/web/dist/viewer/performance/index.js +20 -0
- package/packages/web/dist/viewer/performance/index.js.map +1 -0
- package/packages/web/dist/viewer/performance/memory-monitor.d.ts +78 -0
- package/packages/web/dist/viewer/performance/memory-monitor.js +218 -0
- package/packages/web/dist/viewer/performance/memory-monitor.js.map +1 -0
- package/packages/web/dist/viewer/performance/refresh-throttle.d.ts +90 -0
- package/packages/web/dist/viewer/performance/refresh-throttle.js +266 -0
- package/packages/web/dist/viewer/performance/refresh-throttle.js.map +1 -0
- package/packages/web/dist/viewer/performance/response-buffer-gate.d.ts +108 -0
- package/packages/web/dist/viewer/performance/response-buffer-gate.js +170 -0
- package/packages/web/dist/viewer/performance/response-buffer-gate.js.map +1 -0
- package/packages/web/dist/viewer/performance/update-batcher.d.ts +79 -0
- package/packages/web/dist/viewer/performance/update-batcher.js +119 -0
- package/packages/web/dist/viewer/performance/update-batcher.js.map +1 -0
- package/packages/web/dist/viewer/polling/batched-tick-dispatcher.d.ts +83 -0
- package/packages/web/dist/viewer/polling/batched-tick-dispatcher.js +183 -0
- package/packages/web/dist/viewer/polling/batched-tick-dispatcher.js.map +1 -0
- package/packages/web/dist/viewer/polling/index.d.ts +13 -0
- package/packages/web/dist/viewer/polling/index.js +16 -0
- package/packages/web/dist/viewer/polling/index.js.map +1 -0
- package/packages/web/dist/viewer/polling/polling-manager.d.ts +82 -0
- package/packages/web/dist/viewer/polling/polling-manager.js +254 -0
- package/packages/web/dist/viewer/polling/polling-manager.js.map +1 -0
- package/packages/web/dist/viewer/polling/polling-restart.d.ts +45 -0
- package/packages/web/dist/viewer/polling/polling-restart.js +98 -0
- package/packages/web/dist/viewer/polling/polling-restart.js.map +1 -0
- package/packages/web/dist/viewer/polling/polling-state.d.ts +182 -0
- package/packages/web/dist/viewer/polling/polling-state.js +306 -0
- package/packages/web/dist/viewer/polling/polling-state.js.map +1 -0
- package/packages/web/dist/viewer/polling/tab-visibility.d.ts +112 -0
- package/packages/web/dist/viewer/polling/tab-visibility.js +276 -0
- package/packages/web/dist/viewer/polling/tab-visibility.js.map +1 -0
- package/packages/web/dist/viewer/polling/tick-timer.d.ts +70 -0
- package/packages/web/dist/viewer/polling/tick-timer.js +168 -0
- package/packages/web/dist/viewer/polling/tick-timer.js.map +1 -0
- package/packages/web/dist/viewer/polling/tick-visibility-gate.d.ts +92 -0
- package/packages/web/dist/viewer/polling/tick-visibility-gate.js +146 -0
- package/packages/web/dist/viewer/polling/tick-visibility-gate.js.map +1 -0
- package/packages/web/dist/viewer/polling-manager.d.ts +82 -0
- package/packages/web/dist/viewer/polling-manager.js +254 -0
- package/packages/web/dist/viewer/polling-manager.js.map +1 -0
- package/packages/web/dist/viewer/polling-restart.d.ts +57 -0
- package/packages/web/dist/viewer/polling-restart.js +118 -0
- package/packages/web/dist/viewer/polling-restart.js.map +1 -0
- package/packages/web/dist/viewer/polling-state.d.ts +182 -0
- package/packages/web/dist/viewer/polling-state.js +306 -0
- package/packages/web/dist/viewer/polling-state.js.map +1 -0
- package/packages/web/dist/viewer/refresh-throttle.d.ts +90 -0
- package/packages/web/dist/viewer/refresh-throttle.js +266 -0
- package/packages/web/dist/viewer/refresh-throttle.js.map +1 -0
- package/packages/web/dist/viewer/request-dedup.d.ts +43 -0
- package/packages/web/dist/viewer/request-dedup.js +55 -0
- package/packages/web/dist/viewer/request-dedup.js.map +1 -0
- package/packages/web/dist/viewer/response-buffer-gate.d.ts +108 -0
- package/packages/web/dist/viewer/response-buffer-gate.js +170 -0
- package/packages/web/dist/viewer/response-buffer-gate.js.map +1 -0
- package/packages/web/dist/viewer/route-state.d.ts +8 -0
- package/packages/web/dist/viewer/route-state.js +77 -0
- package/packages/web/dist/viewer/route-state.js.map +1 -0
- package/packages/web/dist/viewer/schema-compat.d.ts +17 -0
- package/packages/web/dist/viewer/schema-compat.js +49 -0
- package/packages/web/dist/viewer/schema-compat.js.map +1 -0
- package/packages/web/dist/viewer/sourcevision-tabs.d.ts +10 -0
- package/packages/web/dist/viewer/sourcevision-tabs.js +14 -0
- package/packages/web/dist/viewer/sourcevision-tabs.js.map +1 -0
- package/packages/web/dist/viewer/tab-visibility.d.ts +112 -0
- package/packages/web/dist/viewer/tab-visibility.js +276 -0
- package/packages/web/dist/viewer/tab-visibility.js.map +1 -0
- package/packages/web/dist/viewer/tick-timer.d.ts +70 -0
- package/packages/web/dist/viewer/tick-timer.js +168 -0
- package/packages/web/dist/viewer/tick-timer.js.map +1 -0
- package/packages/web/dist/viewer/tick-visibility-gate.d.ts +92 -0
- package/packages/web/dist/viewer/tick-visibility-gate.js +146 -0
- package/packages/web/dist/viewer/tick-visibility-gate.js.map +1 -0
- package/packages/web/dist/viewer/types.d.ts +66 -0
- package/packages/web/dist/viewer/types.js +2 -0
- package/packages/web/dist/viewer/types.js.map +1 -0
- package/packages/web/dist/viewer/update-batcher.d.ts +79 -0
- package/packages/web/dist/viewer/update-batcher.js +119 -0
- package/packages/web/dist/viewer/update-batcher.js.map +1 -0
- package/packages/web/dist/viewer/usage/constants.d.ts +14 -0
- package/packages/web/dist/viewer/usage/constants.js +14 -0
- package/packages/web/dist/viewer/usage/constants.js.map +1 -0
- package/packages/web/dist/viewer/usage/index.d.ts +7 -0
- package/packages/web/dist/viewer/usage/index.js +8 -0
- package/packages/web/dist/viewer/usage/index.js.map +1 -0
- package/packages/web/dist/viewer/utils.d.ts +25 -0
- package/packages/web/dist/viewer/utils.js +48 -0
- package/packages/web/dist/viewer/utils.js.map +1 -0
- package/packages/web/dist/viewer/validate.d.ts +23 -0
- package/packages/web/dist/viewer/validate.js +275 -0
- package/packages/web/dist/viewer/validate.js.map +1 -0
- package/packages/web/dist/viewer/views/analysis.d.ts +10 -0
- package/packages/web/dist/viewer/views/analysis.js +109 -0
- package/packages/web/dist/viewer/views/analysis.js.map +1 -0
- package/packages/web/dist/viewer/views/architecture.d.ts +10 -0
- package/packages/web/dist/viewer/views/architecture.js +44 -0
- package/packages/web/dist/viewer/views/architecture.js.map +1 -0
- package/packages/web/dist/viewer/views/call-graph.d.ts +20 -0
- package/packages/web/dist/viewer/views/call-graph.js +1266 -0
- package/packages/web/dist/viewer/views/call-graph.js.map +1 -0
- package/packages/web/dist/viewer/views/domain-hench.d.ts +13 -0
- package/packages/web/dist/viewer/views/domain-hench.js +14 -0
- package/packages/web/dist/viewer/views/domain-hench.js.map +1 -0
- package/packages/web/dist/viewer/views/domain-rex.d.ts +17 -0
- package/packages/web/dist/viewer/views/domain-rex.js +18 -0
- package/packages/web/dist/viewer/views/domain-rex.js.map +1 -0
- package/packages/web/dist/viewer/views/domain-settings.d.ts +12 -0
- package/packages/web/dist/viewer/views/domain-settings.js +13 -0
- package/packages/web/dist/viewer/views/domain-settings.js.map +1 -0
- package/packages/web/dist/viewer/views/domain-sourcevision.d.ts +20 -0
- package/packages/web/dist/viewer/views/domain-sourcevision.js +21 -0
- package/packages/web/dist/viewer/views/domain-sourcevision.js.map +1 -0
- package/packages/web/dist/viewer/views/enrichment-thresholds.d.ts +11 -0
- package/packages/web/dist/viewer/views/enrichment-thresholds.js +12 -0
- package/packages/web/dist/viewer/views/enrichment-thresholds.js.map +1 -0
- package/packages/web/dist/viewer/views/feature-toggles.d.ts +13 -0
- package/packages/web/dist/viewer/views/feature-toggles.js +185 -0
- package/packages/web/dist/viewer/views/feature-toggles.js.map +1 -0
- package/packages/web/dist/viewer/views/files.d.ts +13 -0
- package/packages/web/dist/viewer/views/files.js +174 -0
- package/packages/web/dist/viewer/views/files.js.map +1 -0
- package/packages/web/dist/viewer/views/graph.d.ts +12 -0
- package/packages/web/dist/viewer/views/graph.js +316 -0
- package/packages/web/dist/viewer/views/graph.js.map +1 -0
- package/packages/web/dist/viewer/views/hench-config.d.ts +39 -0
- package/packages/web/dist/viewer/views/hench-config.js +473 -0
- package/packages/web/dist/viewer/views/hench-config.js.map +1 -0
- package/packages/web/dist/viewer/views/hench-runs.d.ts +19 -0
- package/packages/web/dist/viewer/views/hench-runs.js +460 -0
- package/packages/web/dist/viewer/views/hench-runs.js.map +1 -0
- package/packages/web/dist/viewer/views/hench-templates.d.ts +17 -0
- package/packages/web/dist/viewer/views/hench-templates.js +262 -0
- package/packages/web/dist/viewer/views/hench-templates.js.map +1 -0
- package/packages/web/dist/viewer/views/integration-config.d.ts +73 -0
- package/packages/web/dist/viewer/views/integration-config.js +524 -0
- package/packages/web/dist/viewer/views/integration-config.js.map +1 -0
- package/packages/web/dist/viewer/views/notion-config.d.ts +16 -0
- package/packages/web/dist/viewer/views/notion-config.js +357 -0
- package/packages/web/dist/viewer/views/notion-config.js.map +1 -0
- package/packages/web/dist/viewer/views/overview.d.ts +10 -0
- package/packages/web/dist/viewer/views/overview.js +187 -0
- package/packages/web/dist/viewer/views/overview.js.map +1 -0
- package/packages/web/dist/viewer/views/pr-markdown.d.ts +3 -0
- package/packages/web/dist/viewer/views/pr-markdown.js +350 -0
- package/packages/web/dist/viewer/views/pr-markdown.js.map +1 -0
- package/packages/web/dist/viewer/views/prd.d.ts +34 -0
- package/packages/web/dist/viewer/views/prd.js +257 -0
- package/packages/web/dist/viewer/views/prd.js.map +1 -0
- package/packages/web/dist/viewer/views/problems.d.ts +8 -0
- package/packages/web/dist/viewer/views/problems.js +50 -0
- package/packages/web/dist/viewer/views/problems.js.map +1 -0
- package/packages/web/dist/viewer/views/rex-dashboard.d.ts +14 -0
- package/packages/web/dist/viewer/views/rex-dashboard.js +334 -0
- package/packages/web/dist/viewer/views/rex-dashboard.js.map +1 -0
- package/packages/web/dist/viewer/views/routes.d.ts +8 -0
- package/packages/web/dist/viewer/views/routes.js +216 -0
- package/packages/web/dist/viewer/views/routes.js.map +1 -0
- package/packages/web/dist/viewer/views/sourcevision-tabs.d.ts +18 -0
- package/packages/web/dist/viewer/views/sourcevision-tabs.js +14 -0
- package/packages/web/dist/viewer/views/sourcevision-tabs.js.map +1 -0
- package/packages/web/dist/viewer/views/suggestions.d.ts +8 -0
- package/packages/web/dist/viewer/views/suggestions.js +36 -0
- package/packages/web/dist/viewer/views/suggestions.js.map +1 -0
- package/packages/web/dist/viewer/views/task-audit.d.ts +18 -0
- package/packages/web/dist/viewer/views/task-audit.js +413 -0
- package/packages/web/dist/viewer/views/task-audit.js.map +1 -0
- package/packages/web/dist/viewer/views/token-usage.d.ts +10 -0
- package/packages/web/dist/viewer/views/token-usage.js +410 -0
- package/packages/web/dist/viewer/views/token-usage.js.map +1 -0
- package/packages/web/dist/viewer/views/validation.d.ts +11 -0
- package/packages/web/dist/viewer/views/validation.js +475 -0
- package/packages/web/dist/viewer/views/validation.js.map +1 -0
- package/packages/web/dist/viewer/views/view-registry.d.ts +27 -0
- package/packages/web/dist/viewer/views/view-registry.js +70 -0
- package/packages/web/dist/viewer/views/view-registry.js.map +1 -0
- package/packages/web/dist/viewer/views/workflow-optimization.d.ts +12 -0
- package/packages/web/dist/viewer/views/workflow-optimization.js +311 -0
- package/packages/web/dist/viewer/views/workflow-optimization.js.map +1 -0
- package/packages/web/dist/viewer/views/zone-types.d.ts +69 -0
- package/packages/web/dist/viewer/views/zone-types.js +5 -0
- package/packages/web/dist/viewer/views/zone-types.js.map +1 -0
- package/packages/web/dist/viewer/views/zones.d.ts +50 -0
- package/packages/web/dist/viewer/views/zones.js +1438 -0
- package/packages/web/dist/viewer/views/zones.js.map +1 -0
- package/packages/web/dist/viewer/visualization/colors.d.ts +16 -0
- package/packages/web/dist/viewer/visualization/colors.js +31 -0
- package/packages/web/dist/viewer/visualization/colors.js.map +1 -0
- package/packages/web/dist/viewer/visualization/flow.d.ts +54 -0
- package/packages/web/dist/viewer/visualization/flow.js +123 -0
- package/packages/web/dist/viewer/visualization/flow.js.map +1 -0
- package/packages/web/dist/viewer/visualization/index.d.ts +34 -0
- package/packages/web/dist/viewer/visualization/index.js +40 -0
- package/packages/web/dist/viewer/visualization/index.js.map +1 -0
- package/packages/web/dist/viewer/visualization/metrics.d.ts +8 -0
- package/packages/web/dist/viewer/visualization/metrics.js +16 -0
- package/packages/web/dist/viewer/visualization/metrics.js.map +1 -0
- package/packages/web/package.json +53 -0
- package/refresh-artifacts.js +54 -0
- package/refresh-plan.js +79 -0
- package/refresh-validate.js +175 -0
- package/web.js +458 -0
|
@@ -0,0 +1,1446 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { isContainerLevel } from "../schema/index.js";
|
|
5
|
+
import { walkTree } from "../core/tree.js";
|
|
6
|
+
// Re-export shared utilities for backward compatibility — existing consumers
|
|
7
|
+
// that import from "./reason.js" continue to work without changes.
|
|
8
|
+
export { DEFAULT_MODEL, DEFAULT_CODEX_MODEL, MAX_RETRIES, parseTokenUsage, emptyAnalyzeTokenUsage, accumulateTokenUsage, detectFileFormat, extractJson, repairTruncatedJson, PRD_SCHEMA, TASK_QUALITY_RULES, OUTPUT_INSTRUCTION, } from "./analyze-shared.js";
|
|
9
|
+
// Re-export LLM bridge functions for backward compatibility — consumers
|
|
10
|
+
// that import config/client management from "./reason.js" continue to work.
|
|
11
|
+
export { setLLMConfig, setClaudeConfig, setClaudeClient, getAuthMode, getLLMVendor, spawnClaude, } from "./llm-bridge.js";
|
|
12
|
+
import { DEFAULT_MODEL, emptyAnalyzeTokenUsage, accumulateTokenUsage, extractJson, repairTruncatedJson, detectFileFormat, PRD_SCHEMA, TASK_QUALITY_RULES, OUTPUT_INSTRUCTION, } from "./analyze-shared.js";
|
|
13
|
+
import { spawnClaude } from "./llm-bridge.js";
|
|
14
|
+
// ── Zod schemas for LLM response validation ──
|
|
15
|
+
const STATUS_ENUM = z.enum(["pending", "completed"]).optional();
|
|
16
|
+
const ProposalTaskSchema = z.object({
|
|
17
|
+
title: z.string(),
|
|
18
|
+
description: z.string().optional(),
|
|
19
|
+
acceptanceCriteria: z.array(z.string()).optional(),
|
|
20
|
+
priority: z.enum(["critical", "high", "medium", "low"]).optional(),
|
|
21
|
+
tags: z.array(z.string()).optional(),
|
|
22
|
+
status: STATUS_ENUM,
|
|
23
|
+
loe: z.number().positive().optional(),
|
|
24
|
+
loeRationale: z.string().optional(),
|
|
25
|
+
loeConfidence: z.enum(["low", "medium", "high"]).optional(),
|
|
26
|
+
});
|
|
27
|
+
const ProposalFeatureSchema = z.object({
|
|
28
|
+
title: z.string(),
|
|
29
|
+
description: z.string().optional(),
|
|
30
|
+
existingId: z.string().optional(),
|
|
31
|
+
status: STATUS_ENUM,
|
|
32
|
+
tasks: z.array(ProposalTaskSchema),
|
|
33
|
+
});
|
|
34
|
+
const ProposalSchema = z.object({
|
|
35
|
+
epic: z.object({
|
|
36
|
+
title: z.string(),
|
|
37
|
+
existingId: z.string().optional(),
|
|
38
|
+
status: STATUS_ENUM,
|
|
39
|
+
}),
|
|
40
|
+
features: z.array(ProposalFeatureSchema),
|
|
41
|
+
});
|
|
42
|
+
const ProposalArraySchema = z.array(ProposalSchema);
|
|
43
|
+
// ── Helpers ──
|
|
44
|
+
function summarizeExisting(items, options) {
|
|
45
|
+
const lines = [];
|
|
46
|
+
for (const { item, parents } of walkTree(items)) {
|
|
47
|
+
const indent = " ".repeat(parents.length);
|
|
48
|
+
const showId = options?.withIds && isContainerLevel(item.level);
|
|
49
|
+
const idPart = showId ? ` (id: ${item.id})` : "";
|
|
50
|
+
lines.push(`${indent}- [${item.level}] ${item.title} (${item.status})${idPart}`);
|
|
51
|
+
}
|
|
52
|
+
return lines.length > 0 ? lines.join("\n") : "(empty PRD)";
|
|
53
|
+
}
|
|
54
|
+
// ── Project context loading ──
|
|
55
|
+
/** Doc files to search for, in priority order. First found wins per slot. */
|
|
56
|
+
const PROJECT_DOC_FILES = [
|
|
57
|
+
"CLAUDE.md",
|
|
58
|
+
"README.md",
|
|
59
|
+
"README",
|
|
60
|
+
"README.txt",
|
|
61
|
+
];
|
|
62
|
+
/** Max characters of project context to include in the LLM prompt. */
|
|
63
|
+
const MAX_CONTEXT_LENGTH = 4000;
|
|
64
|
+
/**
|
|
65
|
+
* Read project documentation files from `dir`. Returns a trimmed string
|
|
66
|
+
* suitable for inclusion in an LLM prompt, or an empty string if nothing
|
|
67
|
+
* useful is found.
|
|
68
|
+
*/
|
|
69
|
+
export async function readProjectContext(dir) {
|
|
70
|
+
const sections = [];
|
|
71
|
+
let totalLength = 0;
|
|
72
|
+
for (const name of PROJECT_DOC_FILES) {
|
|
73
|
+
if (totalLength >= MAX_CONTEXT_LENGTH)
|
|
74
|
+
break;
|
|
75
|
+
try {
|
|
76
|
+
const content = await readFile(join(dir, name), "utf-8");
|
|
77
|
+
const trimmed = content.trim();
|
|
78
|
+
if (trimmed.length === 0)
|
|
79
|
+
continue;
|
|
80
|
+
const remaining = MAX_CONTEXT_LENGTH - totalLength;
|
|
81
|
+
const snippet = trimmed.length > remaining
|
|
82
|
+
? trimmed.slice(0, remaining) + "\n...(truncated)"
|
|
83
|
+
: trimmed;
|
|
84
|
+
sections.push(`--- ${name} ---\n${snippet}`);
|
|
85
|
+
totalLength += snippet.length;
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
// File not found — skip
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return sections.join("\n\n");
|
|
92
|
+
}
|
|
93
|
+
export function parseProposalResponse(raw) {
|
|
94
|
+
const text = extractJson(raw);
|
|
95
|
+
let parsed;
|
|
96
|
+
try {
|
|
97
|
+
parsed = JSON.parse(text);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// Attempt to repair truncated JSON from cut-off responses
|
|
101
|
+
const repaired = repairTruncatedJson(text);
|
|
102
|
+
if (repaired) {
|
|
103
|
+
parsed = JSON.parse(repaired);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
throw new Error(`Invalid JSON in LLM response: ${text.slice(0, 200)}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// If the LLM returned a single object instead of an array, wrap it
|
|
110
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
111
|
+
const single = ProposalSchema.safeParse(parsed);
|
|
112
|
+
if (single.success) {
|
|
113
|
+
return normalizeProposals([single.data]);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Try strict validation first
|
|
117
|
+
const strict = ProposalArraySchema.safeParse(parsed);
|
|
118
|
+
if (strict.success) {
|
|
119
|
+
return normalizeProposals(strict.data);
|
|
120
|
+
}
|
|
121
|
+
// Lenient fallback: parse valid items individually, skip broken ones
|
|
122
|
+
if (Array.isArray(parsed) && parsed.length > 0) {
|
|
123
|
+
const valid = [];
|
|
124
|
+
for (const item of parsed) {
|
|
125
|
+
const result = ProposalSchema.safeParse(item);
|
|
126
|
+
if (result.success) {
|
|
127
|
+
valid.push(result.data);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (valid.length > 0) {
|
|
131
|
+
return normalizeProposals(valid);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// Nothing salvageable — throw with original error detail
|
|
135
|
+
throw new Error(`LLM response failed schema validation: ${strict.error.issues.map((i) => i.message).join("; ")}`);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Convert Zod-validated proposals into the full Proposal shape with source fields.
|
|
139
|
+
*/
|
|
140
|
+
function normalizeProposals(validated) {
|
|
141
|
+
return validated.map((p) => ({
|
|
142
|
+
epic: { title: p.epic.title, source: "llm", existingId: p.epic.existingId, status: p.epic.status },
|
|
143
|
+
features: p.features.map((f) => ({
|
|
144
|
+
title: f.title,
|
|
145
|
+
source: "llm",
|
|
146
|
+
description: f.description,
|
|
147
|
+
existingId: f.existingId,
|
|
148
|
+
status: f.status,
|
|
149
|
+
tasks: f.tasks.map((t) => ({
|
|
150
|
+
title: t.title,
|
|
151
|
+
source: "llm",
|
|
152
|
+
sourceFile: "",
|
|
153
|
+
description: t.description,
|
|
154
|
+
acceptanceCriteria: t.acceptanceCriteria,
|
|
155
|
+
priority: t.priority,
|
|
156
|
+
tags: t.tags,
|
|
157
|
+
status: t.status,
|
|
158
|
+
loe: t.loe,
|
|
159
|
+
loeRationale: t.loeRationale,
|
|
160
|
+
loeConfidence: t.loeConfidence,
|
|
161
|
+
})),
|
|
162
|
+
})),
|
|
163
|
+
}));
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Validate semantic quality of LLM-generated proposals.
|
|
167
|
+
* Returns issues found. Empty array means all quality checks passed.
|
|
168
|
+
*/
|
|
169
|
+
export function validateProposalQuality(proposals) {
|
|
170
|
+
const issues = [];
|
|
171
|
+
for (const p of proposals) {
|
|
172
|
+
const epicPath = `epic:"${p.epic.title}"`;
|
|
173
|
+
// Epic title quality
|
|
174
|
+
if (p.epic.title.length < 3) {
|
|
175
|
+
issues.push({
|
|
176
|
+
level: "warning",
|
|
177
|
+
path: epicPath,
|
|
178
|
+
message: "Epic title is too short to be descriptive",
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
if (p.features.length === 0) {
|
|
182
|
+
issues.push({
|
|
183
|
+
level: "warning",
|
|
184
|
+
path: epicPath,
|
|
185
|
+
message: "Epic has no features",
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
for (const f of p.features) {
|
|
189
|
+
const featurePath = `${epicPath} > feature:"${f.title}"`;
|
|
190
|
+
if (f.tasks.length === 0) {
|
|
191
|
+
issues.push({
|
|
192
|
+
level: "warning",
|
|
193
|
+
path: featurePath,
|
|
194
|
+
message: "Feature has no tasks",
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
for (const t of f.tasks) {
|
|
198
|
+
const taskPath = `${featurePath} > task:"${t.title}"`;
|
|
199
|
+
// Tasks should have descriptions or acceptance criteria
|
|
200
|
+
if (!t.description && (!t.acceptanceCriteria || t.acceptanceCriteria.length === 0)) {
|
|
201
|
+
issues.push({
|
|
202
|
+
level: "warning",
|
|
203
|
+
path: taskPath,
|
|
204
|
+
message: "Task lacks both description and acceptance criteria",
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
// Very short task titles suggest vague output
|
|
208
|
+
if (t.title.length < 5) {
|
|
209
|
+
issues.push({
|
|
210
|
+
level: "warning",
|
|
211
|
+
path: taskPath,
|
|
212
|
+
message: "Task title is too short to be actionable",
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return issues;
|
|
219
|
+
}
|
|
220
|
+
// ── Structured file parsing (JSON/YAML without LLM) ──
|
|
221
|
+
function extractJsonItems(content) {
|
|
222
|
+
try {
|
|
223
|
+
const data = JSON.parse(content);
|
|
224
|
+
const items = [];
|
|
225
|
+
function scan(obj) {
|
|
226
|
+
if (Array.isArray(obj)) {
|
|
227
|
+
for (const el of obj)
|
|
228
|
+
scan(el);
|
|
229
|
+
}
|
|
230
|
+
else if (obj && typeof obj === "object") {
|
|
231
|
+
const o = obj;
|
|
232
|
+
const name = (o.title ?? o.name);
|
|
233
|
+
if (typeof name === "string") {
|
|
234
|
+
items.push({
|
|
235
|
+
name,
|
|
236
|
+
description: typeof o.description === "string" ? o.description : undefined,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
for (const val of Object.values(o)) {
|
|
240
|
+
if (typeof val === "object" && val !== null)
|
|
241
|
+
scan(val);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
scan(data);
|
|
246
|
+
return items;
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
return [];
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function extractYamlItems(content) {
|
|
253
|
+
const items = [];
|
|
254
|
+
const lines = content.split("\n");
|
|
255
|
+
let currentName = null;
|
|
256
|
+
let currentDesc = null;
|
|
257
|
+
for (const line of lines) {
|
|
258
|
+
const nameMatch = line.match(/^\s*(?:title|name)\s*:\s*["']?(.+?)["']?\s*$/);
|
|
259
|
+
if (nameMatch) {
|
|
260
|
+
if (currentName) {
|
|
261
|
+
items.push({
|
|
262
|
+
name: currentName,
|
|
263
|
+
description: currentDesc ?? undefined,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
currentName = nameMatch[1];
|
|
267
|
+
currentDesc = null;
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
const descMatch = line.match(/^\s*description\s*:\s*["']?(.+?)["']?\s*$/);
|
|
271
|
+
if (descMatch && currentName) {
|
|
272
|
+
currentDesc = descMatch[1];
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
if (currentName) {
|
|
276
|
+
items.push({
|
|
277
|
+
name: currentName,
|
|
278
|
+
description: currentDesc ?? undefined,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
return items;
|
|
282
|
+
}
|
|
283
|
+
function normalize(s) {
|
|
284
|
+
return s.toLowerCase().trim();
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Attempt to parse structured file content (JSON/YAML) directly into proposals
|
|
288
|
+
* without an LLM call. Returns null if the format is markdown or if the content
|
|
289
|
+
* cannot be meaningfully extracted.
|
|
290
|
+
*/
|
|
291
|
+
export function parseStructuredFile(content, format, existingItems) {
|
|
292
|
+
if (format === "markdown" || format === "text")
|
|
293
|
+
return null;
|
|
294
|
+
// For JSON, first try to parse as the full Proposal schema
|
|
295
|
+
if (format === "json") {
|
|
296
|
+
try {
|
|
297
|
+
let text = content.trim();
|
|
298
|
+
const fenceMatch = text.match(/```(?:json)?\s*\n?([\s\S]*?)\n?\s*```/);
|
|
299
|
+
if (fenceMatch)
|
|
300
|
+
text = fenceMatch[1].trim();
|
|
301
|
+
const parsed = JSON.parse(text);
|
|
302
|
+
// Try as array first, then as single object
|
|
303
|
+
let validated = null;
|
|
304
|
+
const arrayResult = ProposalArraySchema.safeParse(parsed);
|
|
305
|
+
if (arrayResult.success) {
|
|
306
|
+
validated = arrayResult.data;
|
|
307
|
+
}
|
|
308
|
+
else if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
309
|
+
const singleResult = ProposalSchema.safeParse(parsed);
|
|
310
|
+
if (singleResult.success) {
|
|
311
|
+
validated = [singleResult.data];
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (validated && validated.length > 0) {
|
|
315
|
+
// Existing title set for dedup
|
|
316
|
+
const existingTitles = new Set(existingItems.map((item) => normalize(item.title)));
|
|
317
|
+
const result = validated
|
|
318
|
+
.map((p) => ({
|
|
319
|
+
epic: { title: p.epic.title, source: "file-import" },
|
|
320
|
+
features: p.features
|
|
321
|
+
.filter((f) => !existingTitles.has(normalize(f.title)))
|
|
322
|
+
.map((f) => ({
|
|
323
|
+
title: f.title,
|
|
324
|
+
source: "file-import",
|
|
325
|
+
description: f.description,
|
|
326
|
+
tasks: f.tasks
|
|
327
|
+
.filter((t) => !existingTitles.has(normalize(t.title)))
|
|
328
|
+
.map((t) => ({
|
|
329
|
+
title: t.title,
|
|
330
|
+
source: "file-import",
|
|
331
|
+
sourceFile: "",
|
|
332
|
+
description: t.description,
|
|
333
|
+
acceptanceCriteria: t.acceptanceCriteria,
|
|
334
|
+
priority: t.priority,
|
|
335
|
+
tags: t.tags,
|
|
336
|
+
})),
|
|
337
|
+
})),
|
|
338
|
+
}))
|
|
339
|
+
.filter((p) => p.features.length > 0 || !existingTitles.has(normalize(p.epic.title)));
|
|
340
|
+
if (result.length > 0)
|
|
341
|
+
return result;
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
catch {
|
|
346
|
+
// Not valid JSON or not in Proposal schema — fall through to generic extraction
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
// Generic extraction: pull title/name items from JSON or YAML
|
|
350
|
+
const items = format === "json" ? extractJsonItems(content) : extractYamlItems(content);
|
|
351
|
+
if (items.length === 0)
|
|
352
|
+
return null;
|
|
353
|
+
// Dedup against existing PRD
|
|
354
|
+
const existingTitles = new Set(existingItems.map((item) => normalize(item.title)));
|
|
355
|
+
const newItems = items.filter((i) => !existingTitles.has(normalize(i.name)));
|
|
356
|
+
if (newItems.length === 0)
|
|
357
|
+
return null;
|
|
358
|
+
// Group into a single "Imported Items" epic with each item as a feature
|
|
359
|
+
return [
|
|
360
|
+
{
|
|
361
|
+
epic: { title: "Imported Items", source: "file-import" },
|
|
362
|
+
features: newItems.map((item) => ({
|
|
363
|
+
title: item.name,
|
|
364
|
+
source: "file-import",
|
|
365
|
+
description: item.description,
|
|
366
|
+
tasks: [],
|
|
367
|
+
})),
|
|
368
|
+
},
|
|
369
|
+
];
|
|
370
|
+
}
|
|
371
|
+
// ── Format-specific LLM prompt hints ──
|
|
372
|
+
const FORMAT_HINTS = {
|
|
373
|
+
markdown: "The document is in Markdown format. Pay attention to headings, bullet points, and structured sections.",
|
|
374
|
+
text: "The document is in plain text format. Look for section headers (ALL CAPS, underlined, numbered), bullet points, and requirement keywords (must, should, shall).",
|
|
375
|
+
json: "The document is in JSON format. Extract meaningful requirements from the structured data, including nested objects and arrays.",
|
|
376
|
+
yaml: "The document is in YAML format. Extract meaningful requirements from the structured data fields.",
|
|
377
|
+
};
|
|
378
|
+
// ── Shared prompt fragments ──
|
|
379
|
+
// ANTI_PATTERNS is defined here (not in analyze-shared) because it is only
|
|
380
|
+
// used by reason.ts prompts, not by extract.ts or file-validation.ts.
|
|
381
|
+
export const ANTI_PATTERNS = `Avoid these common mistakes:
|
|
382
|
+
- Do NOT produce tasks with only a title and no description or criteria — every task needs substance.
|
|
383
|
+
- Do NOT use vague titles like "Implement the feature", "Fix the bug", "Update code" — be specific about WHAT is being implemented/fixed/updated.
|
|
384
|
+
- Do NOT create single-task features — if a feature has only one task, either break the task down or merge it into a related feature.
|
|
385
|
+
- Do NOT duplicate tasks already in the existing PRD (check the summary below).
|
|
386
|
+
- Do NOT wrap your response in markdown fences — return raw JSON only.`;
|
|
387
|
+
/**
|
|
388
|
+
* Auto-placement instruction block. Included in prompts when no explicit
|
|
389
|
+
* parentId is specified, telling the LLM it can reference existing PRD
|
|
390
|
+
* items by ID to place new items under them.
|
|
391
|
+
*/
|
|
392
|
+
export const AUTO_PLACEMENT_INSTRUCTION = `
|
|
393
|
+
## Placement
|
|
394
|
+
The existing PRD includes item IDs for epics and features. When new items
|
|
395
|
+
naturally belong under an existing epic or feature, set "existingId" on the
|
|
396
|
+
epic/feature object to reference it by ID. Only create new epics/features
|
|
397
|
+
when the items genuinely represent new work areas not covered by the existing tree.
|
|
398
|
+
|
|
399
|
+
If an existing parent's title needs to expand to accommodate the new scope,
|
|
400
|
+
use "existingId" to reference it AND set the title to the updated version.`;
|
|
401
|
+
/**
|
|
402
|
+
* Consolidation instruction block. Guides the LLM toward producing fewer,
|
|
403
|
+
* larger work packages rather than many micro-tasks. Included in prompts
|
|
404
|
+
* that process broad input (scan results, natural-language descriptions)
|
|
405
|
+
* to produce sprint-sized proposals.
|
|
406
|
+
*/
|
|
407
|
+
export const CONSOLIDATION_INSTRUCTION = `
|
|
408
|
+
## Consolidation
|
|
409
|
+
Prefer consolidated, sprint-sized work packages over many small tasks.
|
|
410
|
+
For broad input covering multiple areas, aim for 3–7 top-level proposals
|
|
411
|
+
(epics) rather than 10+ micro-items. Each task should represent a
|
|
412
|
+
meaningful deliverable — not a single function or file change.
|
|
413
|
+
|
|
414
|
+
Guidelines:
|
|
415
|
+
- Merge related scan findings into a single task when they address the
|
|
416
|
+
same concern (e.g. "add input validation" across multiple routes →
|
|
417
|
+
one task covering the validation pattern).
|
|
418
|
+
- Prefer one well-scoped task with clear acceptance criteria over three
|
|
419
|
+
trivially small tasks that would be completed together anyway.
|
|
420
|
+
- If a broad description covers an entire feature area, create 1–2
|
|
421
|
+
features with 2–5 tasks each, not a flat list of 15 micro-tasks.
|
|
422
|
+
- Each task should still be completable in a single focused sprint
|
|
423
|
+
(roughly 0.5–4 engineer-weeks), not so large it becomes vague.`;
|
|
424
|
+
// ── Few-shot example for LLM prompts ──
|
|
425
|
+
/**
|
|
426
|
+
* A compact example included in prompts to show the LLM the expected output
|
|
427
|
+
* shape, quality of titles, and level of detail for tasks.
|
|
428
|
+
*/
|
|
429
|
+
export const FEW_SHOT_EXAMPLE = `Example output (for reference — do NOT include this example in your response):
|
|
430
|
+
[
|
|
431
|
+
{
|
|
432
|
+
"epic": { "title": "User Authentication" },
|
|
433
|
+
"features": [
|
|
434
|
+
{
|
|
435
|
+
"title": "OAuth2 Integration",
|
|
436
|
+
"description": "Support third-party OAuth2 providers for user login",
|
|
437
|
+
"tasks": [
|
|
438
|
+
{
|
|
439
|
+
"title": "Implement OAuth2 callback handler",
|
|
440
|
+
"description": "Handle the authorization code exchange and token storage after provider redirects back to our app. Covers Google and GitHub providers with a pluggable adapter pattern for future providers.",
|
|
441
|
+
"acceptanceCriteria": [
|
|
442
|
+
"Handles Google and GitHub OAuth2 flows end-to-end",
|
|
443
|
+
"Stores refresh token securely in encrypted session storage",
|
|
444
|
+
"Returns meaningful error on provider rejection",
|
|
445
|
+
"Provider adapter interface documented with at least one example"
|
|
446
|
+
],
|
|
447
|
+
"priority": "high",
|
|
448
|
+
"tags": ["auth", "backend"],
|
|
449
|
+
"loe": 2,
|
|
450
|
+
"loeRationale": "Two providers with shared adapter pattern, plus token storage and error handling — bounded by well-documented OAuth2 spec.",
|
|
451
|
+
"loeConfidence": "high"
|
|
452
|
+
}
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
]
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"epic": { "title": "API Infrastructure", "existingId": "abc-123" },
|
|
459
|
+
"features": [
|
|
460
|
+
{
|
|
461
|
+
"title": "Rate Limiting",
|
|
462
|
+
"description": "Protect API endpoints from abuse with configurable rate limits",
|
|
463
|
+
"tasks": [
|
|
464
|
+
{
|
|
465
|
+
"title": "Implement token bucket rate limiter middleware",
|
|
466
|
+
"description": "Add per-endpoint rate limiting using a token bucket algorithm with configurable burst and sustained rates",
|
|
467
|
+
"acceptanceCriteria": [
|
|
468
|
+
"Returns 429 with Retry-After header when limit exceeded",
|
|
469
|
+
"Configurable per-route limits via middleware options",
|
|
470
|
+
"Supports both IP-based and API-key-based limiting"
|
|
471
|
+
],
|
|
472
|
+
"priority": "high",
|
|
473
|
+
"tags": ["api", "security"],
|
|
474
|
+
"loe": 1.5,
|
|
475
|
+
"loeRationale": "Standard middleware pattern with token bucket algorithm; main effort is the configuration surface and tests.",
|
|
476
|
+
"loeConfidence": "medium"
|
|
477
|
+
}
|
|
478
|
+
]
|
|
479
|
+
}
|
|
480
|
+
]
|
|
481
|
+
}
|
|
482
|
+
]`;
|
|
483
|
+
// ── Scan result summarization + chunking ──
|
|
484
|
+
/**
|
|
485
|
+
* Character budget per LLM chunk. Keeps each prompt well within token limits
|
|
486
|
+
* while leaving room for the system instructions, existing PRD summary, and
|
|
487
|
+
* project context that surround the scan data.
|
|
488
|
+
*/
|
|
489
|
+
export const CHUNK_CHAR_LIMIT = 40_000;
|
|
490
|
+
/**
|
|
491
|
+
* Maximum number of scan results per LLM chunk. Even if results fit within
|
|
492
|
+
* the character budget, limiting item count improves LLM reasoning quality
|
|
493
|
+
* by keeping context manageable. Set to 100 as a sensible default.
|
|
494
|
+
*/
|
|
495
|
+
export const CHUNK_ITEM_LIMIT = 100;
|
|
496
|
+
/**
|
|
497
|
+
* Render an array of ScanResults into the text block used inside LLM prompts.
|
|
498
|
+
*/
|
|
499
|
+
export function summarizeScanResults(results) {
|
|
500
|
+
return results
|
|
501
|
+
.map((r) => {
|
|
502
|
+
const parts = [
|
|
503
|
+
`[${r.kind}] ${r.name} (source: ${r.source}, file: ${r.sourceFile})`,
|
|
504
|
+
];
|
|
505
|
+
if (r.description)
|
|
506
|
+
parts.push(` description: ${r.description}`);
|
|
507
|
+
if (r.acceptanceCriteria?.length)
|
|
508
|
+
parts.push(` criteria: ${r.acceptanceCriteria.join("; ")}`);
|
|
509
|
+
if (r.priority)
|
|
510
|
+
parts.push(` priority: ${r.priority}`);
|
|
511
|
+
if (r.tags?.length)
|
|
512
|
+
parts.push(` tags: ${r.tags.join(", ")}`);
|
|
513
|
+
return parts.join("\n");
|
|
514
|
+
})
|
|
515
|
+
.join("\n\n");
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Estimate the serialized character length of a single ScanResult without
|
|
519
|
+
* allocating intermediate strings or arrays. Uses arithmetic on the existing
|
|
520
|
+
* field lengths to match what `summarizeScanResults([r])` would produce.
|
|
521
|
+
*
|
|
522
|
+
* This avoids O(N) full serializations during chunking — a significant
|
|
523
|
+
* saving for large codebases with thousands of scan results.
|
|
524
|
+
*/
|
|
525
|
+
export function estimateItemSize(r) {
|
|
526
|
+
// Header: `[${r.kind}] ${r.name} (source: ${r.source}, file: ${r.sourceFile})`
|
|
527
|
+
// [ kind ]_ name _(source:_ source ,_file:_ sourceFile )
|
|
528
|
+
let size = 1 + r.kind.length + 2 + r.name.length + 10 + r.source.length + 8 + r.sourceFile.length + 1;
|
|
529
|
+
if (r.description) {
|
|
530
|
+
// `\n description: ${r.description}` — prefix is 16 chars
|
|
531
|
+
size += 16 + r.description.length;
|
|
532
|
+
}
|
|
533
|
+
if (r.acceptanceCriteria && r.acceptanceCriteria.length > 0) {
|
|
534
|
+
// `\n criteria: ` + items joined by "; "
|
|
535
|
+
size += 13;
|
|
536
|
+
for (let i = 0; i < r.acceptanceCriteria.length; i++) {
|
|
537
|
+
if (i > 0)
|
|
538
|
+
size += 2; // "; "
|
|
539
|
+
size += r.acceptanceCriteria[i].length;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
if (r.priority) {
|
|
543
|
+
// `\n priority: ${r.priority}`
|
|
544
|
+
size += 13 + r.priority.length;
|
|
545
|
+
}
|
|
546
|
+
if (r.tags && r.tags.length > 0) {
|
|
547
|
+
// `\n tags: ` + items joined by ", "
|
|
548
|
+
size += 9;
|
|
549
|
+
for (let i = 0; i < r.tags.length; i++) {
|
|
550
|
+
if (i > 0)
|
|
551
|
+
size += 2; // ", "
|
|
552
|
+
size += r.tags[i].length;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return size;
|
|
556
|
+
}
|
|
557
|
+
/** Kind ordering for grouping: epics first, then features, then tasks. */
|
|
558
|
+
const KIND_ORDER = { epic: 0, feature: 1, task: 2 };
|
|
559
|
+
/**
|
|
560
|
+
* Sort scan results so related items are adjacent: first by source file,
|
|
561
|
+
* then by kind (epic → feature → task). This keeps context together within
|
|
562
|
+
* chunks so the LLM sees complete feature areas rather than interleaved
|
|
563
|
+
* fragments from different parts of the codebase.
|
|
564
|
+
*
|
|
565
|
+
* Returns a new array — does not mutate the input.
|
|
566
|
+
*/
|
|
567
|
+
export function groupScanResults(results) {
|
|
568
|
+
return [...results].sort((a, b) => {
|
|
569
|
+
if (a.sourceFile !== b.sourceFile) {
|
|
570
|
+
return a.sourceFile < b.sourceFile ? -1 : 1;
|
|
571
|
+
}
|
|
572
|
+
return (KIND_ORDER[a.kind] ?? 2) - (KIND_ORDER[b.kind] ?? 2);
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Split scan results into chunks that respect both `CHUNK_CHAR_LIMIT` and
|
|
577
|
+
* `CHUNK_ITEM_LIMIT`. When all results fit in a single chunk, this returns
|
|
578
|
+
* a one-element array — no overhead.
|
|
579
|
+
*
|
|
580
|
+
* Chunking triggers when either:
|
|
581
|
+
* - The serialized summary would exceed the character limit, OR
|
|
582
|
+
* - The item count would exceed 100 items per chunk
|
|
583
|
+
*
|
|
584
|
+
* This dual constraint ensures both:
|
|
585
|
+
* - Token budget stays within LLM limits (character-based)
|
|
586
|
+
* - LLM reasoning quality stays high (item-count-based)
|
|
587
|
+
*
|
|
588
|
+
* Optimizations over naive chunking:
|
|
589
|
+
* - Uses `estimateItemSize()` for O(1) size calculation per item instead
|
|
590
|
+
* of full serialization, reducing allocations for large result sets.
|
|
591
|
+
* - Groups related items by source file and kind so the LLM sees coherent
|
|
592
|
+
* context per chunk rather than interleaved fragments.
|
|
593
|
+
*/
|
|
594
|
+
export function chunkScanResults(results) {
|
|
595
|
+
if (results.length === 0)
|
|
596
|
+
return [];
|
|
597
|
+
// Group related items together before chunking
|
|
598
|
+
const sorted = groupScanResults(results);
|
|
599
|
+
const chunks = [];
|
|
600
|
+
let current = [];
|
|
601
|
+
let currentLen = 0;
|
|
602
|
+
for (const r of sorted) {
|
|
603
|
+
const itemLen = estimateItemSize(r);
|
|
604
|
+
// Flush the current chunk if adding this item would exceed either limit
|
|
605
|
+
// (unless it's empty — an oversized single item gets its own chunk).
|
|
606
|
+
const wouldExceedCharLimit = currentLen + itemLen + 2 > CHUNK_CHAR_LIMIT;
|
|
607
|
+
const wouldExceedItemLimit = current.length >= CHUNK_ITEM_LIMIT;
|
|
608
|
+
if (current.length > 0 && (wouldExceedCharLimit || wouldExceedItemLimit)) {
|
|
609
|
+
chunks.push(current);
|
|
610
|
+
current = [];
|
|
611
|
+
currentLen = 0;
|
|
612
|
+
}
|
|
613
|
+
current.push(r);
|
|
614
|
+
currentLen += itemLen + 2; // account for the "\n\n" separator
|
|
615
|
+
}
|
|
616
|
+
if (current.length > 0) {
|
|
617
|
+
chunks.push(current);
|
|
618
|
+
}
|
|
619
|
+
return chunks;
|
|
620
|
+
}
|
|
621
|
+
export async function reasonFromFile(filePath, existingItems, model) {
|
|
622
|
+
const content = await readFile(filePath, "utf-8");
|
|
623
|
+
const format = detectFileFormat(filePath);
|
|
624
|
+
const tokenUsage = emptyAnalyzeTokenUsage();
|
|
625
|
+
// For JSON/YAML, try direct structured parsing first
|
|
626
|
+
if (format !== "markdown" && format !== "text") {
|
|
627
|
+
const structured = parseStructuredFile(content, format, existingItems);
|
|
628
|
+
if (structured !== null) {
|
|
629
|
+
return { proposals: structured, tokenUsage };
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
// For text files, try local extraction before LLM
|
|
633
|
+
if (format === "text") {
|
|
634
|
+
const { extractFromText } = await import("./extract.js");
|
|
635
|
+
const extraction = extractFromText(content, { existingItems });
|
|
636
|
+
if (extraction.proposals.length > 0) {
|
|
637
|
+
return { proposals: extraction.proposals, tokenUsage };
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
// Fall back to LLM-based extraction
|
|
641
|
+
const existingSummary = summarizeExisting(existingItems);
|
|
642
|
+
const prompt = `You are a product requirements analyst. Read the following document and extract a structured PRD (Product Requirements Document) as a JSON array.
|
|
643
|
+
|
|
644
|
+
${PRD_SCHEMA}
|
|
645
|
+
|
|
646
|
+
${FEW_SHOT_EXAMPLE}
|
|
647
|
+
|
|
648
|
+
Structuring guidelines:
|
|
649
|
+
- Group related items into epics and features logically.
|
|
650
|
+
- Derive tasks from actionable items in the document.
|
|
651
|
+
- If the document covers multiple distinct areas, create separate epics for each.
|
|
652
|
+
|
|
653
|
+
${TASK_QUALITY_RULES}
|
|
654
|
+
|
|
655
|
+
${ANTI_PATTERNS}
|
|
656
|
+
|
|
657
|
+
${FORMAT_HINTS[format]}
|
|
658
|
+
|
|
659
|
+
Existing PRD:
|
|
660
|
+
${existingSummary}
|
|
661
|
+
|
|
662
|
+
Document to analyze:
|
|
663
|
+
${content}
|
|
664
|
+
|
|
665
|
+
${OUTPUT_INSTRUCTION}`;
|
|
666
|
+
const result = await spawnClaude(prompt, model ?? DEFAULT_MODEL);
|
|
667
|
+
accumulateTokenUsage(tokenUsage, result.tokenUsage);
|
|
668
|
+
return { proposals: parseProposalResponse(result.text), tokenUsage };
|
|
669
|
+
}
|
|
670
|
+
// ── Multi-file support ──
|
|
671
|
+
/**
|
|
672
|
+
* Merge proposals that share the same epic title (case-insensitive).
|
|
673
|
+
* Features and tasks are concatenated; duplicates within features are
|
|
674
|
+
* removed by normalized title.
|
|
675
|
+
*/
|
|
676
|
+
export function mergeProposals(all) {
|
|
677
|
+
const epicMap = new Map();
|
|
678
|
+
for (const p of all) {
|
|
679
|
+
const key = normalize(p.epic.title);
|
|
680
|
+
const existing = epicMap.get(key);
|
|
681
|
+
if (!existing) {
|
|
682
|
+
// Clone to avoid mutating inputs
|
|
683
|
+
epicMap.set(key, {
|
|
684
|
+
epic: { ...p.epic },
|
|
685
|
+
features: p.features.map((f) => ({
|
|
686
|
+
...f,
|
|
687
|
+
tasks: [...f.tasks],
|
|
688
|
+
})),
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
else {
|
|
692
|
+
// Merge features into existing epic
|
|
693
|
+
const seenFeatures = new Set(existing.features.map((f) => normalize(f.title)));
|
|
694
|
+
for (const f of p.features) {
|
|
695
|
+
const fKey = normalize(f.title);
|
|
696
|
+
if (seenFeatures.has(fKey)) {
|
|
697
|
+
// Merge tasks into existing feature
|
|
698
|
+
const target = existing.features.find((ef) => normalize(ef.title) === fKey);
|
|
699
|
+
const seenTasks = new Set(target.tasks.map((t) => normalize(t.title)));
|
|
700
|
+
for (const t of f.tasks) {
|
|
701
|
+
if (!seenTasks.has(normalize(t.title))) {
|
|
702
|
+
target.tasks.push(t);
|
|
703
|
+
seenTasks.add(normalize(t.title));
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
else {
|
|
708
|
+
existing.features.push({ ...f, tasks: [...f.tasks] });
|
|
709
|
+
seenFeatures.add(fKey);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
return [...epicMap.values()];
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* Process multiple input files and combine results into a single proposal list.
|
|
718
|
+
* Each file is read and parsed independently, then proposals are merged by epic.
|
|
719
|
+
*/
|
|
720
|
+
export async function reasonFromFiles(filePaths, existingItems, model) {
|
|
721
|
+
const tokenUsage = emptyAnalyzeTokenUsage();
|
|
722
|
+
if (filePaths.length === 0) {
|
|
723
|
+
return { proposals: [], tokenUsage };
|
|
724
|
+
}
|
|
725
|
+
if (filePaths.length === 1) {
|
|
726
|
+
return reasonFromFile(filePaths[0], existingItems, model);
|
|
727
|
+
}
|
|
728
|
+
const allProposals = [];
|
|
729
|
+
for (const fp of filePaths) {
|
|
730
|
+
const result = await reasonFromFile(fp, existingItems, model);
|
|
731
|
+
allProposals.push(...result.proposals);
|
|
732
|
+
// Accumulate per-file token usage (calls already counted in reasonFromFile)
|
|
733
|
+
tokenUsage.calls += result.tokenUsage.calls;
|
|
734
|
+
tokenUsage.inputTokens += result.tokenUsage.inputTokens;
|
|
735
|
+
tokenUsage.outputTokens += result.tokenUsage.outputTokens;
|
|
736
|
+
if (result.tokenUsage.cacheCreationInputTokens) {
|
|
737
|
+
tokenUsage.cacheCreationInputTokens =
|
|
738
|
+
(tokenUsage.cacheCreationInputTokens ?? 0) + result.tokenUsage.cacheCreationInputTokens;
|
|
739
|
+
}
|
|
740
|
+
if (result.tokenUsage.cacheReadInputTokens) {
|
|
741
|
+
tokenUsage.cacheReadInputTokens =
|
|
742
|
+
(tokenUsage.cacheReadInputTokens ?? 0) + result.tokenUsage.cacheReadInputTokens;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
return { proposals: mergeProposals(allProposals), tokenUsage };
|
|
746
|
+
}
|
|
747
|
+
export async function reasonFromScanResults(results, existingItems, options) {
|
|
748
|
+
const existingSummary = summarizeExisting(existingItems);
|
|
749
|
+
const tokenUsage = emptyAnalyzeTokenUsage();
|
|
750
|
+
// Baseline detection: empty PRD + existing code = first scan of an existing project.
|
|
751
|
+
// In baseline mode, the LLM should mark already-built functionality as "completed"
|
|
752
|
+
// and only mark gaps/improvements as "pending".
|
|
753
|
+
const isBaseline = existingItems.length === 0 && results.length > 0;
|
|
754
|
+
// Read project documentation for additional context
|
|
755
|
+
const projectContext = options?.dir
|
|
756
|
+
? await readProjectContext(options.dir)
|
|
757
|
+
: "";
|
|
758
|
+
const contextBlock = projectContext
|
|
759
|
+
? `\nProject context (from documentation):\n${projectContext}\n`
|
|
760
|
+
: "";
|
|
761
|
+
// Split large result sets into chunks to stay within token limits
|
|
762
|
+
const chunks = chunkScanResults(results);
|
|
763
|
+
if (chunks.length === 0) {
|
|
764
|
+
return { proposals: [], tokenUsage };
|
|
765
|
+
}
|
|
766
|
+
const model = options?.model ?? DEFAULT_MODEL;
|
|
767
|
+
const allProposals = [];
|
|
768
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
769
|
+
const scanSummary = summarizeScanResults(chunks[i]);
|
|
770
|
+
// Multi-chunk context: include epic titles from previous chunks so the
|
|
771
|
+
// LLM can reuse existing groupings instead of creating duplicates
|
|
772
|
+
let chunkNote = "";
|
|
773
|
+
if (chunks.length > 1) {
|
|
774
|
+
chunkNote = `\nNote: This is chunk ${i + 1} of ${chunks.length}. Focus only on the scan results shown here.`;
|
|
775
|
+
if (i > 0 && allProposals.length > 0) {
|
|
776
|
+
const priorEpics = [...new Set(allProposals.map((p) => p.epic.title))];
|
|
777
|
+
chunkNote += `\nEpics created from previous chunks (reuse these names where items belong to the same area):\n${priorEpics.map((e) => ` - ${e}`).join("\n")}`;
|
|
778
|
+
}
|
|
779
|
+
chunkNote += "\n";
|
|
780
|
+
}
|
|
781
|
+
const baselineInstruction = isBaseline ? `
|
|
782
|
+
IMPORTANT — Baseline mode:
|
|
783
|
+
This is the first scan of an existing codebase. The PRD is empty, but the code already exists.
|
|
784
|
+
You MUST include a "status" field on every epic, feature, and task:
|
|
785
|
+
- "completed" — the code already implements this functionality (the scan found evidence it exists)
|
|
786
|
+
- "pending" — this is a gap, improvement, or missing feature that should be built
|
|
787
|
+
|
|
788
|
+
Most items from an existing codebase scan should be "completed". Only mark items as "pending" if
|
|
789
|
+
they represent genuinely missing functionality, TODOs, or improvements identified in the scan results.
|
|
790
|
+
` : "";
|
|
791
|
+
const prompt = `You are a product requirements analyst. Given the following raw scan results from automated code analysis, organize them into a clean, well-structured PRD as a JSON array.
|
|
792
|
+
|
|
793
|
+
${PRD_SCHEMA}
|
|
794
|
+
|
|
795
|
+
${FEW_SHOT_EXAMPLE}
|
|
796
|
+
${CONSOLIDATION_INSTRUCTION}
|
|
797
|
+
${baselineInstruction}
|
|
798
|
+
Structuring guidelines:
|
|
799
|
+
- Near-duplicate items have already been merged. Focus on semantic grouping and structure.
|
|
800
|
+
- If any remaining items are clearly about the same thing, merge them into a single item.
|
|
801
|
+
- Create meaningful epic groupings that reflect the project's domain (not generic names like "Tests" or "Documentation").
|
|
802
|
+
- Group related work into features under appropriate epics.
|
|
803
|
+
|
|
804
|
+
${TASK_QUALITY_RULES}
|
|
805
|
+
|
|
806
|
+
Scan-specific rules:
|
|
807
|
+
- Preserve priority levels from the scan results where they exist.
|
|
808
|
+
- Rewrite vague scan-generated titles to be clear and actionable.
|
|
809
|
+
- Use the project context below to align epic/feature names with the project's domain terminology.
|
|
810
|
+
|
|
811
|
+
${ANTI_PATTERNS}
|
|
812
|
+
${chunkNote}${contextBlock}
|
|
813
|
+
Existing PRD:
|
|
814
|
+
${existingSummary}
|
|
815
|
+
|
|
816
|
+
Scan results:
|
|
817
|
+
${scanSummary}
|
|
818
|
+
|
|
819
|
+
${OUTPUT_INSTRUCTION}`;
|
|
820
|
+
const claudeResult = await spawnClaude(prompt, model);
|
|
821
|
+
accumulateTokenUsage(tokenUsage, claudeResult.tokenUsage);
|
|
822
|
+
allProposals.push(...parseProposalResponse(claudeResult.text));
|
|
823
|
+
}
|
|
824
|
+
// When we made multiple LLM calls, merge overlapping epics/features
|
|
825
|
+
const proposals = chunks.length > 1 ? mergeProposals(allProposals) : allProposals;
|
|
826
|
+
return { proposals, tokenUsage };
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Build the LLM prompt for a natural-language add command.
|
|
830
|
+
* Exported separately so it can be tested without spawning claude.
|
|
831
|
+
*/
|
|
832
|
+
export async function buildAddPrompt(description, existingItems, dir, options) {
|
|
833
|
+
const hasParent = !!options?.parentId;
|
|
834
|
+
const existingSummary = summarizeExisting(existingItems, { withIds: !hasParent });
|
|
835
|
+
const projectContext = await readProjectContext(dir);
|
|
836
|
+
const contextBlock = projectContext
|
|
837
|
+
? `\nProject context (from documentation):\n${projectContext}\n`
|
|
838
|
+
: "";
|
|
839
|
+
let parentConstraint = "";
|
|
840
|
+
let placementBlock = "";
|
|
841
|
+
if (hasParent) {
|
|
842
|
+
// Find the parent in the tree and describe it
|
|
843
|
+
const parentEntry = findItemInTree(existingItems, options.parentId);
|
|
844
|
+
if (parentEntry) {
|
|
845
|
+
parentConstraint = `
|
|
846
|
+
IMPORTANT: Scope your response to fit under this existing parent item:
|
|
847
|
+
ID: ${options.parentId}
|
|
848
|
+
Level: ${parentEntry.level}
|
|
849
|
+
Title: ${parentEntry.title}
|
|
850
|
+
|
|
851
|
+
Only create children appropriate for a ${parentEntry.level}. For example, if the parent is an epic, create features and tasks. If the parent is a feature, create only tasks.
|
|
852
|
+
Do NOT create a new epic — instead use the parent's title as the epic title in your response.`;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
else if (existingItems.length > 0) {
|
|
856
|
+
placementBlock = AUTO_PLACEMENT_INSTRUCTION;
|
|
857
|
+
}
|
|
858
|
+
return `You are a product requirements analyst. Given the following natural-language description, create a structured PRD breakdown as a JSON array.
|
|
859
|
+
|
|
860
|
+
${PRD_SCHEMA}
|
|
861
|
+
|
|
862
|
+
${FEW_SHOT_EXAMPLE}
|
|
863
|
+
${CONSOLIDATION_INSTRUCTION}
|
|
864
|
+
|
|
865
|
+
Structuring guidelines:
|
|
866
|
+
- Break the description into a logical hierarchy of epics, features, and tasks.
|
|
867
|
+
- If the description is broad or covers multiple distinct areas, create multiple epics rather than forcing everything under one.
|
|
868
|
+
- Group related work into features under appropriate epics.
|
|
869
|
+
|
|
870
|
+
${TASK_QUALITY_RULES}
|
|
871
|
+
|
|
872
|
+
Deduplication:
|
|
873
|
+
- Do NOT include items that duplicate anything already in the existing PRD below.
|
|
874
|
+
- Do NOT create duplicate tasks within your own response — if two aspects of the description overlap, merge them into a single task with combined criteria.
|
|
875
|
+
- Use the project context to understand terminology and architecture.
|
|
876
|
+
|
|
877
|
+
${ANTI_PATTERNS}
|
|
878
|
+
${parentConstraint}${placementBlock}
|
|
879
|
+
${contextBlock}
|
|
880
|
+
Existing PRD:
|
|
881
|
+
${existingSummary}
|
|
882
|
+
|
|
883
|
+
Description to add:
|
|
884
|
+
${description}
|
|
885
|
+
|
|
886
|
+
${OUTPUT_INSTRUCTION}`;
|
|
887
|
+
}
|
|
888
|
+
function findItemInTree(items, id) {
|
|
889
|
+
for (const item of items) {
|
|
890
|
+
if (item.id === id)
|
|
891
|
+
return item;
|
|
892
|
+
if (item.children) {
|
|
893
|
+
const found = findItemInTree(item.children, id);
|
|
894
|
+
if (found)
|
|
895
|
+
return found;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
return null;
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* Send a natural-language description to the LLM and get back structured proposals.
|
|
902
|
+
*/
|
|
903
|
+
export async function reasonFromDescription(description, existingItems, options) {
|
|
904
|
+
const dir = options?.dir ?? process.cwd();
|
|
905
|
+
const prompt = await buildAddPrompt(description, existingItems, dir, {
|
|
906
|
+
parentId: options?.parentId,
|
|
907
|
+
});
|
|
908
|
+
const tokenUsage = emptyAnalyzeTokenUsage();
|
|
909
|
+
const result = await spawnClaude(prompt, options?.model ?? DEFAULT_MODEL);
|
|
910
|
+
accumulateTokenUsage(tokenUsage, result.tokenUsage);
|
|
911
|
+
return { proposals: parseProposalResponse(result.text), tokenUsage };
|
|
912
|
+
}
|
|
913
|
+
// ── Multiple descriptions ──
|
|
914
|
+
/**
|
|
915
|
+
* Build the LLM prompt for multiple natural-language descriptions in a single
|
|
916
|
+
* add call. Each description is treated as a distinct idea; the LLM is
|
|
917
|
+
* instructed to produce a coherent, de-duplicated structure that covers them
|
|
918
|
+
* all.
|
|
919
|
+
*/
|
|
920
|
+
export async function buildMultiAddPrompt(descriptions, existingItems, dir, options) {
|
|
921
|
+
const hasParent = !!options?.parentId;
|
|
922
|
+
const existingSummary = summarizeExisting(existingItems, { withIds: !hasParent });
|
|
923
|
+
const projectContext = await readProjectContext(dir);
|
|
924
|
+
const contextBlock = projectContext
|
|
925
|
+
? `\nProject context (from documentation):\n${projectContext}\n`
|
|
926
|
+
: "";
|
|
927
|
+
let parentConstraint = "";
|
|
928
|
+
let placementBlock = "";
|
|
929
|
+
if (hasParent) {
|
|
930
|
+
const parentEntry = findItemInTree(existingItems, options.parentId);
|
|
931
|
+
if (parentEntry) {
|
|
932
|
+
parentConstraint = `
|
|
933
|
+
IMPORTANT: Scope your response to fit under this existing parent item:
|
|
934
|
+
ID: ${options.parentId}
|
|
935
|
+
Level: ${parentEntry.level}
|
|
936
|
+
Title: ${parentEntry.title}
|
|
937
|
+
|
|
938
|
+
Only create children appropriate for a ${parentEntry.level}. For example, if the parent is an epic, create features and tasks. If the parent is a feature, create only tasks.
|
|
939
|
+
Do NOT create a new epic — instead use the parent's title as the epic title in your response.`;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
else if (existingItems.length > 0) {
|
|
943
|
+
placementBlock = AUTO_PLACEMENT_INSTRUCTION;
|
|
944
|
+
}
|
|
945
|
+
const numbered = descriptions
|
|
946
|
+
.map((d, i) => `${i + 1}. ${d}`)
|
|
947
|
+
.join("\n");
|
|
948
|
+
return `You are a product requirements analyst. You have been given ${descriptions.length} feature descriptions at once. Analyze ALL of them and create a unified, coherent PRD breakdown as a JSON array.
|
|
949
|
+
|
|
950
|
+
${PRD_SCHEMA}
|
|
951
|
+
|
|
952
|
+
${FEW_SHOT_EXAMPLE}
|
|
953
|
+
${CONSOLIDATION_INSTRUCTION}
|
|
954
|
+
|
|
955
|
+
Structuring guidelines:
|
|
956
|
+
- Treat each description as a distinct piece of work.
|
|
957
|
+
- Group related descriptions under the same epic when they naturally belong together.
|
|
958
|
+
- Keep unrelated descriptions in separate epics.
|
|
959
|
+
|
|
960
|
+
${TASK_QUALITY_RULES}
|
|
961
|
+
|
|
962
|
+
Deduplication:
|
|
963
|
+
- Do NOT include items that duplicate anything already in the existing PRD below.
|
|
964
|
+
- Do NOT create duplicate items across descriptions — if two descriptions overlap, merge them into a single task with combined criteria.
|
|
965
|
+
- Use the project context to understand terminology and architecture.
|
|
966
|
+
|
|
967
|
+
${ANTI_PATTERNS}
|
|
968
|
+
${parentConstraint}${placementBlock}
|
|
969
|
+
${contextBlock}
|
|
970
|
+
Existing PRD:
|
|
971
|
+
${existingSummary}
|
|
972
|
+
|
|
973
|
+
Descriptions to add:
|
|
974
|
+
${numbered}
|
|
975
|
+
|
|
976
|
+
${OUTPUT_INSTRUCTION}`;
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Send multiple natural-language descriptions to the LLM in a single call and
|
|
980
|
+
* get back a unified set of proposals.
|
|
981
|
+
*/
|
|
982
|
+
export async function reasonFromDescriptions(descriptions, existingItems, options) {
|
|
983
|
+
const tokenUsage = emptyAnalyzeTokenUsage();
|
|
984
|
+
if (descriptions.length === 0)
|
|
985
|
+
return { proposals: [], tokenUsage };
|
|
986
|
+
// Single description — delegate to the original function
|
|
987
|
+
if (descriptions.length === 1) {
|
|
988
|
+
return reasonFromDescription(descriptions[0], existingItems, options);
|
|
989
|
+
}
|
|
990
|
+
const dir = options?.dir ?? process.cwd();
|
|
991
|
+
const prompt = await buildMultiAddPrompt(descriptions, existingItems, dir, {
|
|
992
|
+
parentId: options?.parentId,
|
|
993
|
+
});
|
|
994
|
+
const result = await spawnClaude(prompt, options?.model ?? DEFAULT_MODEL);
|
|
995
|
+
accumulateTokenUsage(tokenUsage, result.tokenUsage);
|
|
996
|
+
return { proposals: parseProposalResponse(result.text), tokenUsage };
|
|
997
|
+
}
|
|
998
|
+
// ── Granularity adjustment ──
|
|
999
|
+
/**
|
|
1000
|
+
* Build an LLM prompt to break down proposals into finer-grained tasks.
|
|
1001
|
+
* Each task is split into smaller subtasks; features may be expanded.
|
|
1002
|
+
* Pure function — no I/O.
|
|
1003
|
+
*/
|
|
1004
|
+
export function buildBreakdownPrompt(proposals) {
|
|
1005
|
+
const proposalJson = JSON.stringify(proposals, null, 2);
|
|
1006
|
+
return `You are a product requirements analyst. Break down the following PRD proposals into finer-grained, more detailed tasks.
|
|
1007
|
+
|
|
1008
|
+
Current proposals:
|
|
1009
|
+
${proposalJson}
|
|
1010
|
+
|
|
1011
|
+
Rules:
|
|
1012
|
+
- Split each task into 2-4 smaller, more specific subtasks.
|
|
1013
|
+
- If a feature has only 1 task, expand it into 2-3 tasks covering distinct aspects.
|
|
1014
|
+
- Preserve the epic and feature structure — do NOT change epic or feature titles.
|
|
1015
|
+
- Each new task MUST have a verb-first title AND both a description and acceptanceCriteria.
|
|
1016
|
+
- Distribute the original acceptance criteria among the subtasks — do not lose any.
|
|
1017
|
+
- Keep priorities consistent with the originals.
|
|
1018
|
+
- Do NOT add entirely new functionality — only decompose what exists.
|
|
1019
|
+
- Do NOT produce tasks with only a title — every task needs both description and criteria.
|
|
1020
|
+
|
|
1021
|
+
${FEW_SHOT_EXAMPLE}
|
|
1022
|
+
|
|
1023
|
+
${OUTPUT_INSTRUCTION}`;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Build an LLM prompt to consolidate proposals into coarser-grained tasks.
|
|
1027
|
+
* Multiple fine-grained tasks are merged into broader ones.
|
|
1028
|
+
* Pure function — no I/O.
|
|
1029
|
+
*/
|
|
1030
|
+
export function buildConsolidatePrompt(proposals) {
|
|
1031
|
+
const proposalJson = JSON.stringify(proposals, null, 2);
|
|
1032
|
+
return `You are a product requirements analyst. Consolidate the following PRD proposals into coarser-grained, higher-level tasks.
|
|
1033
|
+
|
|
1034
|
+
Current proposals:
|
|
1035
|
+
${proposalJson}
|
|
1036
|
+
|
|
1037
|
+
Rules:
|
|
1038
|
+
- Merge related tasks within each feature into broader, higher-level tasks.
|
|
1039
|
+
- Aim to reduce the total task count by roughly half.
|
|
1040
|
+
- If a feature has many tasks, combine related ones with merged acceptance criteria.
|
|
1041
|
+
- If multiple features are closely related, merge them into one feature.
|
|
1042
|
+
- Preserve the epic structure — do NOT change epic titles.
|
|
1043
|
+
- Each resulting task MUST have a verb-first title AND both a description and acceptanceCriteria.
|
|
1044
|
+
- Preserve the original intent — the consolidated tasks should cover the same scope as the originals.
|
|
1045
|
+
- Keep the highest priority among merged tasks.
|
|
1046
|
+
- Do NOT remove functionality — only consolidate what exists.
|
|
1047
|
+
- Do NOT produce tasks with only a title — every task needs both description and criteria.
|
|
1048
|
+
|
|
1049
|
+
${FEW_SHOT_EXAMPLE}
|
|
1050
|
+
|
|
1051
|
+
${OUTPUT_INSTRUCTION}`;
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Adjust the granularity of proposals by calling the LLM.
|
|
1055
|
+
* - "break_down": splits tasks into finer-grained subtasks
|
|
1056
|
+
* - "consolidate": merges tasks into coarser-grained units
|
|
1057
|
+
*/
|
|
1058
|
+
export async function adjustGranularity(proposals, direction, model) {
|
|
1059
|
+
const prompt = direction === "break_down"
|
|
1060
|
+
? buildBreakdownPrompt(proposals)
|
|
1061
|
+
: buildConsolidatePrompt(proposals);
|
|
1062
|
+
const tokenUsage = emptyAnalyzeTokenUsage();
|
|
1063
|
+
const result = await spawnClaude(prompt, model ?? DEFAULT_MODEL);
|
|
1064
|
+
accumulateTokenUsage(tokenUsage, result.tokenUsage);
|
|
1065
|
+
return { proposals: parseProposalResponse(result.text), tokenUsage };
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Zod schema for validating the LLM's assessment response.
|
|
1069
|
+
*/
|
|
1070
|
+
const GranularityAssessmentSchema = z.object({
|
|
1071
|
+
proposalIndex: z.number(),
|
|
1072
|
+
recommendation: z.enum(["break_down", "consolidate", "keep"]),
|
|
1073
|
+
reasoning: z.string(),
|
|
1074
|
+
issues: z.array(z.string()),
|
|
1075
|
+
});
|
|
1076
|
+
const GranularityAssessmentArraySchema = z.array(GranularityAssessmentSchema);
|
|
1077
|
+
/**
|
|
1078
|
+
* Build an LLM prompt to assess the granularity of proposals.
|
|
1079
|
+
* The LLM evaluates whether tasks are appropriately sized and suggests
|
|
1080
|
+
* when they should be broken down or consolidated.
|
|
1081
|
+
* Pure function — no I/O.
|
|
1082
|
+
*/
|
|
1083
|
+
export function buildAssessmentPrompt(proposals) {
|
|
1084
|
+
const proposalJson = JSON.stringify(proposals.map((p, i) => ({ proposalIndex: i, ...p })), null, 2);
|
|
1085
|
+
return `You are a product requirements analyst specializing in task sizing. Assess whether each proposal's tasks are at the right granularity.
|
|
1086
|
+
|
|
1087
|
+
Proposals to assess:
|
|
1088
|
+
${proposalJson}
|
|
1089
|
+
|
|
1090
|
+
For EACH proposal (by proposalIndex), provide:
|
|
1091
|
+
1. "recommendation": "break_down" | "consolidate" | "keep"
|
|
1092
|
+
- "break_down": tasks are too large/broad — split into smaller units
|
|
1093
|
+
- "consolidate": tasks are too fine-grained — merge into larger units
|
|
1094
|
+
- "keep": tasks are appropriately sized
|
|
1095
|
+
2. "reasoning": concise explanation (1-2 sentences)
|
|
1096
|
+
3. "issues": specific problems found (empty array if "keep")
|
|
1097
|
+
|
|
1098
|
+
Assessment criteria — a well-sized task is:
|
|
1099
|
+
- Completable in one focused session (1-4 hours)
|
|
1100
|
+
- Independently testable and deployable where possible
|
|
1101
|
+
- Specific enough that the implementer knows exactly what to do
|
|
1102
|
+
|
|
1103
|
+
Red flags for TOO BROAD:
|
|
1104
|
+
- More than 3 acceptance criteria
|
|
1105
|
+
- Vague titles like "implement the feature" or "add API endpoints"
|
|
1106
|
+
- Covers multiple distinct components or concerns
|
|
1107
|
+
|
|
1108
|
+
Red flags for TOO FINE-GRAINED:
|
|
1109
|
+
- Single line change or trivial config tweak
|
|
1110
|
+
- Feature has more than 6 tasks
|
|
1111
|
+
- Multiple tasks that would naturally be done in the same edit session
|
|
1112
|
+
|
|
1113
|
+
Red flags for MISSING SUBSTANCE:
|
|
1114
|
+
- Feature has only 1 task (should be broken down or merged)
|
|
1115
|
+
- Tasks lack description or acceptance criteria
|
|
1116
|
+
|
|
1117
|
+
Respond with ONLY a valid JSON array of assessment objects, one per proposal:
|
|
1118
|
+
[
|
|
1119
|
+
{
|
|
1120
|
+
"proposalIndex": 0,
|
|
1121
|
+
"recommendation": "break_down",
|
|
1122
|
+
"reasoning": "Several tasks cover broad functionality that spans multiple components.",
|
|
1123
|
+
"issues": [
|
|
1124
|
+
"Task 'Implement authentication system' covers login, signup, password reset, and session management — should be separate tasks",
|
|
1125
|
+
"Task 'Add API endpoints' is vague and likely involves multiple distinct endpoints"
|
|
1126
|
+
]
|
|
1127
|
+
}
|
|
1128
|
+
]
|
|
1129
|
+
|
|
1130
|
+
No explanation or markdown fences — ONLY the JSON array.`;
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* Parse the LLM's granularity assessment response.
|
|
1134
|
+
* Validates against schema and enriches with epic titles from proposals.
|
|
1135
|
+
*/
|
|
1136
|
+
export function parseAssessmentResponse(raw, proposals) {
|
|
1137
|
+
const text = extractJson(raw);
|
|
1138
|
+
let parsed;
|
|
1139
|
+
try {
|
|
1140
|
+
parsed = JSON.parse(text);
|
|
1141
|
+
}
|
|
1142
|
+
catch {
|
|
1143
|
+
const repaired = repairTruncatedJson(text);
|
|
1144
|
+
if (repaired) {
|
|
1145
|
+
parsed = JSON.parse(repaired);
|
|
1146
|
+
}
|
|
1147
|
+
else {
|
|
1148
|
+
throw new Error(`Invalid JSON in assessment response: ${text.slice(0, 200)}`);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
// Validate
|
|
1152
|
+
const result = GranularityAssessmentArraySchema.safeParse(parsed);
|
|
1153
|
+
if (!result.success) {
|
|
1154
|
+
// Lenient fallback: parse valid items individually
|
|
1155
|
+
if (Array.isArray(parsed) && parsed.length > 0) {
|
|
1156
|
+
const valid = [];
|
|
1157
|
+
for (const item of parsed) {
|
|
1158
|
+
const single = GranularityAssessmentSchema.safeParse(item);
|
|
1159
|
+
if (single.success)
|
|
1160
|
+
valid.push(single.data);
|
|
1161
|
+
}
|
|
1162
|
+
if (valid.length > 0) {
|
|
1163
|
+
return valid.map((a) => ({
|
|
1164
|
+
...a,
|
|
1165
|
+
epicTitle: proposals[a.proposalIndex]?.epic.title ?? `Proposal ${a.proposalIndex + 1}`,
|
|
1166
|
+
}));
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
throw new Error(`Assessment response failed schema validation: ${result.error.issues.map((i) => i.message).join("; ")}`);
|
|
1170
|
+
}
|
|
1171
|
+
return result.data.map((a) => ({
|
|
1172
|
+
...a,
|
|
1173
|
+
epicTitle: proposals[a.proposalIndex]?.epic.title ?? `Proposal ${a.proposalIndex + 1}`,
|
|
1174
|
+
}));
|
|
1175
|
+
}
|
|
1176
|
+
/**
|
|
1177
|
+
* Format a granularity assessment for human-readable display.
|
|
1178
|
+
* Pure function — returns a multi-line string.
|
|
1179
|
+
*/
|
|
1180
|
+
export function formatAssessment(assessments) {
|
|
1181
|
+
if (assessments.length === 0)
|
|
1182
|
+
return "No proposals to assess.";
|
|
1183
|
+
const lines = [];
|
|
1184
|
+
lines.push("Granularity Assessment");
|
|
1185
|
+
lines.push("─".repeat(40));
|
|
1186
|
+
const actionable = assessments.filter((a) => a.recommendation !== "keep");
|
|
1187
|
+
const good = assessments.filter((a) => a.recommendation === "keep");
|
|
1188
|
+
for (const a of actionable) {
|
|
1189
|
+
const icon = a.recommendation === "break_down" ? "⬇" : "⬆";
|
|
1190
|
+
const label = a.recommendation === "break_down" ? "Break down" : "Consolidate";
|
|
1191
|
+
lines.push(`${icon} ${a.epicTitle} → ${label}`);
|
|
1192
|
+
lines.push(` ${a.reasoning}`);
|
|
1193
|
+
for (const issue of a.issues) {
|
|
1194
|
+
lines.push(` • ${issue}`);
|
|
1195
|
+
}
|
|
1196
|
+
lines.push("");
|
|
1197
|
+
}
|
|
1198
|
+
if (good.length > 0) {
|
|
1199
|
+
const titles = good.map((a) => a.epicTitle).join(", ");
|
|
1200
|
+
lines.push(`✓ Appropriately sized: ${titles}`);
|
|
1201
|
+
}
|
|
1202
|
+
return lines.join("\n");
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* Assess the granularity of proposals by calling the LLM.
|
|
1206
|
+
* Returns assessments with recommendations and reasoning for each proposal.
|
|
1207
|
+
*/
|
|
1208
|
+
export async function assessGranularity(proposals, model) {
|
|
1209
|
+
const tokenUsage = emptyAnalyzeTokenUsage();
|
|
1210
|
+
if (proposals.length === 0) {
|
|
1211
|
+
return { assessments: [], tokenUsage };
|
|
1212
|
+
}
|
|
1213
|
+
const prompt = buildAssessmentPrompt(proposals);
|
|
1214
|
+
const result = await spawnClaude(prompt, model ?? DEFAULT_MODEL);
|
|
1215
|
+
accumulateTokenUsage(tokenUsage, result.tokenUsage);
|
|
1216
|
+
const assessments = parseAssessmentResponse(result.text, proposals);
|
|
1217
|
+
return { assessments, tokenUsage };
|
|
1218
|
+
}
|
|
1219
|
+
// ── Ideas file import ──
|
|
1220
|
+
/**
|
|
1221
|
+
* Build an LLM prompt for structuring freeform brainstorming notes into PRD
|
|
1222
|
+
* proposals. Distinct from `buildAddPrompt` (single description) and
|
|
1223
|
+
* `reasonFromFile` (formal spec import via analyze): this prompt is tuned for
|
|
1224
|
+
* rough, unstructured idea dumps.
|
|
1225
|
+
*/
|
|
1226
|
+
export async function buildIdeasPrompt(content, existingItems, dir, options) {
|
|
1227
|
+
const hasParent = !!options?.parentId;
|
|
1228
|
+
const existingSummary = summarizeExisting(existingItems, { withIds: !hasParent });
|
|
1229
|
+
const projectContext = await readProjectContext(dir);
|
|
1230
|
+
const contextBlock = projectContext
|
|
1231
|
+
? `\nProject context (from documentation):\n${projectContext}\n`
|
|
1232
|
+
: "";
|
|
1233
|
+
let parentConstraint = "";
|
|
1234
|
+
let placementBlock = "";
|
|
1235
|
+
if (hasParent) {
|
|
1236
|
+
const parentEntry = findItemInTree(existingItems, options.parentId);
|
|
1237
|
+
if (parentEntry) {
|
|
1238
|
+
parentConstraint = `
|
|
1239
|
+
IMPORTANT: Scope your response to fit under this existing parent item:
|
|
1240
|
+
ID: ${options.parentId}
|
|
1241
|
+
Level: ${parentEntry.level}
|
|
1242
|
+
Title: ${parentEntry.title}
|
|
1243
|
+
|
|
1244
|
+
Only create children appropriate for a ${parentEntry.level}. For example, if the parent is an epic, create features and tasks. If the parent is a feature, create only tasks.
|
|
1245
|
+
Do NOT create a new epic — instead use the parent's title as the epic title in your response.`;
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
else if (existingItems.length > 0) {
|
|
1249
|
+
placementBlock = AUTO_PLACEMENT_INSTRUCTION;
|
|
1250
|
+
}
|
|
1251
|
+
return `You are a product requirements analyst reading raw brainstorming notes. These are NOT formal specs — they are rough ideas, bullet points, half-formed thoughts, and informal shorthand. Distill every idea into a well-structured PRD as a JSON array.
|
|
1252
|
+
|
|
1253
|
+
${PRD_SCHEMA}
|
|
1254
|
+
|
|
1255
|
+
${FEW_SHOT_EXAMPLE}
|
|
1256
|
+
${CONSOLIDATION_INSTRUCTION}
|
|
1257
|
+
|
|
1258
|
+
Interpreting rough notes:
|
|
1259
|
+
- Capture EVERY idea, no matter how brief or fragmentary. A single word like "caching" is still an idea worth structuring.
|
|
1260
|
+
- Questions ("what about dark mode?") are feature requests in disguise — treat them as such.
|
|
1261
|
+
- Expand shorthand and abbreviations ("auth" → "authentication", "perf" → "performance") using the project context to infer meaning.
|
|
1262
|
+
- When an idea is ambiguous, pick the most likely interpretation given the project context and note your assumption in the task description.
|
|
1263
|
+
- Contradictory notes (e.g. "use Redis" and "keep it simple, no external deps") should both be captured as separate options with a note about the trade-off.
|
|
1264
|
+
- Problems without solutions ("login is slow") become investigative tasks (e.g. "Profile and optimize login flow").
|
|
1265
|
+
- Vague ideas ("make it better") should be fleshed out into concrete tasks based on the project context.
|
|
1266
|
+
|
|
1267
|
+
${TASK_QUALITY_RULES}
|
|
1268
|
+
|
|
1269
|
+
Deduplication:
|
|
1270
|
+
- Do NOT include items that duplicate anything already in the existing PRD below.
|
|
1271
|
+
- Use the project context to understand terminology, architecture, and domain-specific jargon in the notes.
|
|
1272
|
+
|
|
1273
|
+
${ANTI_PATTERNS}
|
|
1274
|
+
${parentConstraint}${placementBlock}
|
|
1275
|
+
${contextBlock}
|
|
1276
|
+
Existing PRD:
|
|
1277
|
+
${existingSummary}
|
|
1278
|
+
|
|
1279
|
+
Brainstorming notes:
|
|
1280
|
+
${content}
|
|
1281
|
+
|
|
1282
|
+
${OUTPUT_INSTRUCTION}`;
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* Read one or more freeform idea files and structure them into proposals.
|
|
1286
|
+
*
|
|
1287
|
+
* For well-structured files (markdown with headings, JSON matching the Proposal
|
|
1288
|
+
* schema, YAML with title/name fields), extraction is performed locally without
|
|
1289
|
+
* an LLM call. Files that cannot be meaningfully extracted fall back to the LLM
|
|
1290
|
+
* ideas pipeline.
|
|
1291
|
+
*
|
|
1292
|
+
* Unlike `reasonFromFile` / `reasonFromFiles` (used by `analyze --file` for
|
|
1293
|
+
* formal spec import), the LLM fallback uses a prompt specifically tuned for
|
|
1294
|
+
* rough brainstorming notes.
|
|
1295
|
+
*/
|
|
1296
|
+
export async function reasonFromIdeasFile(filePaths, existingItems, options) {
|
|
1297
|
+
const tokenUsage = emptyAnalyzeTokenUsage();
|
|
1298
|
+
if (filePaths.length === 0)
|
|
1299
|
+
return { proposals: [], tokenUsage };
|
|
1300
|
+
const dir = options?.dir ?? process.cwd();
|
|
1301
|
+
// Phase 1: Try local extraction for each file.
|
|
1302
|
+
// Collect proposals from files that can be parsed without LLM, and
|
|
1303
|
+
// accumulate content from files that need LLM fallback.
|
|
1304
|
+
const localProposals = [];
|
|
1305
|
+
const llmSections = [];
|
|
1306
|
+
for (const fp of filePaths) {
|
|
1307
|
+
const content = await readFile(fp, "utf-8");
|
|
1308
|
+
if (content.trim().length === 0)
|
|
1309
|
+
continue;
|
|
1310
|
+
const format = detectFileFormat(fp);
|
|
1311
|
+
// Try structured parsing for JSON/YAML files (no LLM needed)
|
|
1312
|
+
if (format === "json" || format === "yaml") {
|
|
1313
|
+
const structured = parseStructuredFile(content, format, existingItems);
|
|
1314
|
+
if (structured !== null && structured.length > 0) {
|
|
1315
|
+
localProposals.push(...structured);
|
|
1316
|
+
continue;
|
|
1317
|
+
}
|
|
1318
|
+
// Fall through to LLM processing
|
|
1319
|
+
}
|
|
1320
|
+
// Try local markdown extraction (no LLM needed)
|
|
1321
|
+
if (format === "markdown") {
|
|
1322
|
+
const { extractFromMarkdown } = await import("./extract.js");
|
|
1323
|
+
const extraction = extractFromMarkdown(content, { existingItems, sourceFile: fp });
|
|
1324
|
+
if (extraction.proposals.length > 0) {
|
|
1325
|
+
localProposals.push(...extraction.proposals);
|
|
1326
|
+
continue;
|
|
1327
|
+
}
|
|
1328
|
+
// Fall through to LLM processing
|
|
1329
|
+
}
|
|
1330
|
+
// Try local plain text extraction (no LLM needed)
|
|
1331
|
+
if (format === "text") {
|
|
1332
|
+
const { extractFromText } = await import("./extract.js");
|
|
1333
|
+
const extraction = extractFromText(content, { existingItems, sourceFile: fp });
|
|
1334
|
+
if (extraction.proposals.length > 0) {
|
|
1335
|
+
localProposals.push(...extraction.proposals);
|
|
1336
|
+
continue;
|
|
1337
|
+
}
|
|
1338
|
+
// Fall through to LLM processing
|
|
1339
|
+
}
|
|
1340
|
+
// File could not be locally extracted — queue for LLM
|
|
1341
|
+
if (filePaths.length > 1) {
|
|
1342
|
+
llmSections.push(`--- ${fp} ---\n${content.trim()}`);
|
|
1343
|
+
}
|
|
1344
|
+
else {
|
|
1345
|
+
llmSections.push(content.trim());
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
// Phase 2: Fall back to LLM for files that couldn't be locally parsed.
|
|
1349
|
+
if (llmSections.length > 0) {
|
|
1350
|
+
const combined = llmSections.join("\n\n");
|
|
1351
|
+
const prompt = await buildIdeasPrompt(combined, existingItems, dir, {
|
|
1352
|
+
parentId: options?.parentId,
|
|
1353
|
+
});
|
|
1354
|
+
const result = await spawnClaude(prompt, options?.model ?? DEFAULT_MODEL);
|
|
1355
|
+
accumulateTokenUsage(tokenUsage, result.tokenUsage);
|
|
1356
|
+
localProposals.push(...parseProposalResponse(result.text));
|
|
1357
|
+
}
|
|
1358
|
+
return { proposals: localProposals, tokenUsage };
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* Process multiple import items through the smart-add pipeline and return
|
|
1362
|
+
* consolidated, deduplicated proposals.
|
|
1363
|
+
*
|
|
1364
|
+
* JSON items are attempted via direct schema parsing first (no LLM). Text
|
|
1365
|
+
* and markdown items are batched into a single LLM call using the ideas
|
|
1366
|
+
* prompt for efficiency.
|
|
1367
|
+
*/
|
|
1368
|
+
export async function reasonFromBatch(items, existingItems, options) {
|
|
1369
|
+
const tokenUsage = emptyAnalyzeTokenUsage();
|
|
1370
|
+
const itemResults = new Array(items.length);
|
|
1371
|
+
if (items.length === 0) {
|
|
1372
|
+
return { proposals: [], itemResults: [], tokenUsage };
|
|
1373
|
+
}
|
|
1374
|
+
const dir = options?.dir ?? process.cwd();
|
|
1375
|
+
const allProposals = [];
|
|
1376
|
+
// Separate items into structured (JSON that can be parsed without LLM)
|
|
1377
|
+
// and unstructured (text/markdown/fallback JSON that need LLM processing)
|
|
1378
|
+
const unstructuredSections = [];
|
|
1379
|
+
const unstructuredIndices = [];
|
|
1380
|
+
for (let i = 0; i < items.length; i++) {
|
|
1381
|
+
const item = items[i];
|
|
1382
|
+
const trimmed = item.content.trim();
|
|
1383
|
+
if (trimmed.length === 0) {
|
|
1384
|
+
itemResults[i] = { source: item.source, proposalCount: 0 };
|
|
1385
|
+
continue;
|
|
1386
|
+
}
|
|
1387
|
+
// Try structured parsing for JSON items
|
|
1388
|
+
if (item.format === "json") {
|
|
1389
|
+
const structured = parseStructuredFile(trimmed, "json", existingItems);
|
|
1390
|
+
if (structured !== null && structured.length > 0) {
|
|
1391
|
+
allProposals.push(...structured);
|
|
1392
|
+
itemResults[i] = { source: item.source, proposalCount: structured.length };
|
|
1393
|
+
continue;
|
|
1394
|
+
}
|
|
1395
|
+
// Fall through to LLM processing
|
|
1396
|
+
}
|
|
1397
|
+
// Collect for batched LLM processing
|
|
1398
|
+
const label = item.source ?? `Item ${i + 1}`;
|
|
1399
|
+
unstructuredSections.push(`--- ${label} ---\n${trimmed}`);
|
|
1400
|
+
unstructuredIndices.push(i);
|
|
1401
|
+
}
|
|
1402
|
+
// Process all unstructured items in a single LLM call
|
|
1403
|
+
if (unstructuredSections.length > 0) {
|
|
1404
|
+
const combined = unstructuredSections.join("\n\n");
|
|
1405
|
+
try {
|
|
1406
|
+
const prompt = await buildIdeasPrompt(combined, existingItems, dir, {
|
|
1407
|
+
parentId: options?.parentId,
|
|
1408
|
+
});
|
|
1409
|
+
const llmResult = await spawnClaude(prompt, options?.model ?? DEFAULT_MODEL);
|
|
1410
|
+
accumulateTokenUsage(tokenUsage, llmResult.tokenUsage);
|
|
1411
|
+
const proposals = parseProposalResponse(llmResult.text);
|
|
1412
|
+
allProposals.push(...proposals);
|
|
1413
|
+
// Distribute proposal count: first item gets the total (LLM processes
|
|
1414
|
+
// all unstructured items as a single batch), rest get 0.
|
|
1415
|
+
for (let j = 0; j < unstructuredIndices.length; j++) {
|
|
1416
|
+
const idx = unstructuredIndices[j];
|
|
1417
|
+
itemResults[idx] = {
|
|
1418
|
+
source: items[idx].source,
|
|
1419
|
+
proposalCount: j === 0 ? proposals.length : 0,
|
|
1420
|
+
};
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
catch (err) {
|
|
1424
|
+
// Mark all unstructured items as failed
|
|
1425
|
+
for (const idx of unstructuredIndices) {
|
|
1426
|
+
itemResults[idx] = {
|
|
1427
|
+
source: items[idx].source,
|
|
1428
|
+
proposalCount: 0,
|
|
1429
|
+
error: err.message,
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
// Fill any gaps (shouldn't happen, but defensive)
|
|
1435
|
+
for (let i = 0; i < items.length; i++) {
|
|
1436
|
+
if (!itemResults[i]) {
|
|
1437
|
+
itemResults[i] = { source: items[i].source, proposalCount: 0 };
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
return {
|
|
1441
|
+
proposals: mergeProposals(allProposals),
|
|
1442
|
+
itemResults,
|
|
1443
|
+
tokenUsage,
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1446
|
+
//# sourceMappingURL=reason.js.map
|