@mrclrchtr/supi-review 5.0.0 → 6.0.1
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/README.md +17 -15
- package/node_modules/@mrclrchtr/supi-agent-runtime/README.md +2 -0
- package/node_modules/@mrclrchtr/supi-agent-runtime/node_modules/@mrclrchtr/supi-core/README.md +2 -0
- package/node_modules/@mrclrchtr/supi-agent-runtime/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-agent-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +1 -1
- package/node_modules/@mrclrchtr/supi-agent-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -3
- package/node_modules/@mrclrchtr/supi-agent-runtime/node_modules/@mrclrchtr/supi-core/src/debug.ts +9 -0
- package/node_modules/@mrclrchtr/supi-agent-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +1 -1
- package/node_modules/@mrclrchtr/supi-agent-runtime/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/README.md +4 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-code-runtime/README.md +2 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-core/README.md +2 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-core/src/api.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-core/src/debug.ts +9 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-core/src/index.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/README.md +36 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/README.md +2 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/README.md +2 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug.ts +9 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/index.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/api.ts +12 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +67 -28
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-collection.ts +63 -6
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-evidence.ts +46 -5
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +1 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-publication.ts +214 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +278 -79
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-timing.ts +29 -8
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +101 -19
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +19 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +49 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +73 -15
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/client/transport.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/config/capabilities.ts +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/config/config.ts +5 -5
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +3 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +68 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +8 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +176 -24
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +4 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/workspace-sentinels.ts +46 -10
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-diagnostics.ts +4 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-recovery.ts +65 -17
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +143 -21
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +2 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +43 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +31 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/README.md +2 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/README.md +2 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/README.md +2 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug.ts +9 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/index.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +4 -4
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +4 -4
- package/node_modules/@mrclrchtr/supi-code-intelligence/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/package.json +5 -5
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/analysis/health/diagnostics.ts +58 -126
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/analysis/health/file-scope.ts +184 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/analysis/health/recovery.ts +8 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/analysis/readiness.ts +4 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/analysis/search/ast-scan.ts +4 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/analysis/search/pattern-analysis.ts +10 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/analysis/search/pattern.ts +6 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/config.ts +35 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/extension.ts +57 -14
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/overview/overview-data.ts +9 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/overview/overview.ts +49 -30
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/overview/types.ts +2 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/find-types.ts +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/find-workflow.ts +3 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/health-refresh.ts +76 -49
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/health-types.ts +7 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/health-workflow.ts +35 -18
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/input/workflows.ts +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/inspect-workflow.ts +2 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/orientation/collect.ts +2 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/orientation-types.ts +2 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/orientation-workflow.ts +8 -2
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/refactor-workflow.ts +2 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/session/session.ts +25 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/substrate/lsp/maintenance.ts +105 -23
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/substrate/lsp/recovery.ts +11 -5
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_find/execute.ts +23 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_find/guidance.ts +8 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{find → code_find}/render.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{result/find.ts → code_find/result.ts} +36 -11
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_find/spec.ts +37 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_graph/execute.ts +24 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_graph/guidance.ts +6 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{graph → code_graph}/markdown.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{result/graph.ts → code_graph/result.ts} +69 -4
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_graph/spec.ts +39 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{health → code_health}/execute.ts +2 -18
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_health/guidance.ts +8 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{health → code_health}/markdown.ts +68 -18
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{result/health.ts → code_health/result.ts} +29 -4
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_health/spec.ts +41 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_inspect/execute.ts +20 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_inspect/guidance.ts +6 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{inspect → code_inspect}/markdown.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{result/inspect.ts → code_inspect/result.ts} +32 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_inspect/spec.ts +25 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_orientation/execute.ts +25 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_orientation/guidance.ts +9 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{orientation → code_orientation}/markdown.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{result/orientation.ts → code_orientation/result.ts} +67 -3
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_orientation/spec.ts +25 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_refactor_apply/execute.ts +17 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_refactor_apply/guidance.ts +5 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{refactor-apply/execute.ts → code_refactor_apply/result.ts} +5 -11
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_refactor_apply/spec.ts +26 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_refactor_plan/execute.ts +27 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_refactor_plan/guidance.ts +8 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{refactor-plan/execute.ts → code_refactor_plan/result.ts} +9 -22
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_refactor_plan/spec.ts +25 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_resolve/execute.ts +19 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_resolve/guidance.ts +8 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{resolve → code_resolve}/markdown.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{result/resolve.ts → code_resolve/result.ts} +37 -24
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/code_resolve/spec.ts +25 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/guidance.ts +71 -52
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/infra/truncate.ts +40 -0
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{refactor-plan/markdown.ts → refactor-markdown.ts} +4 -7
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/register.ts +9 -97
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/result/refactor.ts +1 -4
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/schemas.ts +26 -157
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/specs.ts +40 -126
- package/node_modules/@mrclrchtr/supi-core/README.md +2 -0
- package/node_modules/@mrclrchtr/supi-core/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-core/src/api.ts +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -3
- package/node_modules/@mrclrchtr/supi-core/src/debug.ts +9 -0
- package/node_modules/@mrclrchtr/supi-core/src/index.ts +1 -1
- package/package.json +4 -4
- package/src/config.ts +2 -2
- package/src/review.ts +5 -5
- package/src/target/input.ts +90 -0
- package/src/target/resolve.ts +9 -39
- package/src/tool/output-page.ts +45 -8
- package/src/tool/page-render.ts +37 -0
- package/src/tool/page-schemas.ts +29 -0
- package/src/tool/review_audit/execute.ts +56 -0
- package/src/tool/review_audit/guidance.ts +10 -0
- package/src/tool/review_audit/register.ts +19 -0
- package/src/{tui/paged-output.ts → tool/review_audit/render.ts} +9 -72
- package/src/tool/review_audit/result.ts +144 -0
- package/src/tool/review_audit/spec.ts +44 -0
- package/src/tool/review_output/execute.ts +19 -0
- package/src/tool/review_output/guidance.ts +7 -0
- package/src/tool/review_output/register.ts +23 -0
- package/src/tool/review_output/render.ts +37 -0
- package/src/tool/review_output/result.ts +33 -0
- package/src/tool/review_output/spec.ts +29 -0
- package/src/tool/{child-failure-diagnostics.ts → review_run/child-failures.ts} +1 -1
- package/src/tool/{child-session-runner.ts → review_run/child-session.ts} +2 -2
- package/src/tool/{review-tools.ts → review_run/child-tools.ts} +43 -6
- package/src/tool/{review-debug-summary.ts → review_run/debug-summary.ts} +1 -1
- package/src/tool/{agent-review-tools.ts → review_run/execute.ts} +10 -59
- package/src/tool/{review-execution.ts → review_run/execution.ts} +6 -6
- package/src/tool/{review-format.ts → review_run/format.ts} +9 -11
- package/src/tool/review_run/guidance.ts +11 -0
- package/src/tool/{agent-review-schemas.ts → review_run/input-schema.ts} +61 -62
- package/src/tool/{planner-input.ts → review_run/planner-input.ts} +3 -3
- package/src/tool/{planner-runner.ts → review_run/planner.ts} +7 -7
- package/src/tool/{post-review-policy.ts → review_run/post-policy.ts} +4 -4
- package/src/tool/{review-recovery.ts → review_run/recovery.ts} +4 -4
- package/src/tool/review_run/register.ts +24 -0
- package/src/{tui/run.ts → tool/review_run/render.ts} +30 -23
- package/src/tool/review_run/result.ts +51 -0
- package/src/tool/{review-runner.ts → review_run/runner.ts} +7 -7
- package/src/tool/{schemas.ts → review_run/schemas.ts} +4 -4
- package/src/tool/review_run/spec.ts +11 -0
- package/src/{review-result.ts → tool/review_run/submission.ts} +7 -5
- package/src/tool/{review-system-prompt.ts → review_run/system-prompt.ts} +3 -3
- package/src/tool/{review-workflow.ts → review_run/workflow.ts} +19 -15
- package/src/tui/common.ts +2 -2
- package/src/tui/review-command.ts +4 -4
- package/src/tui/review-target-picker.ts +11 -11
- package/src/types.ts +15 -5
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/find/execute.ts +0 -43
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/graph/execute.ts +0 -82
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/inspect/execute.ts +0 -40
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/orientation/execute.ts +0 -80
- package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/resolve/execute.ts +0 -53
- package/src/tool/review-audit-tool.ts +0 -181
- package/src/tool/review-output-tool.ts +0 -74
- package/src/tool/tool-specs.ts +0 -137
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{find → code_find}/ast-kinds.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{find → code_find}/markdown.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{find → code_find}/modes.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{find → code_find}/tui.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{graph → code_graph}/tui.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{health → code_health}/refresh-status.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{health → code_health}/semantic-state.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{health → code_health}/tui.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{inspect → code_inspect}/tui.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{orientation → code_orientation}/tui.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{refactor-apply → code_refactor_apply}/tui.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{refactor-plan → code_refactor_plan}/tui.ts +0 -0
- /package/node_modules/@mrclrchtr/supi-code-intelligence/src/tool/{resolve → code_resolve}/tui.ts +0 -0
- /package/src/tool/{child-resource-loader.ts → review_run/child-resources.ts} +0 -0
package/src/tui/common.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Shared TUI rendering helpers for supi-review tool output.
|
|
3
3
|
*
|
|
4
4
|
* Dual-surface rendering: chrome built from details, markdown body excluded.
|
|
5
|
-
* Follows the tool-rendering convention in docs/tool-rendering.md.
|
|
5
|
+
* Follows the tool-rendering convention in docs/conventions/tool-rendering.md.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
9
9
|
import { type Container, Spacer, Text } from "@earendil-works/pi-tui";
|
|
10
10
|
import { formatEvidenceBadge } from "@mrclrchtr/supi-core/evidence-badge";
|
|
11
|
-
import { getChildDiagnosticErrorRows } from "../tool/child-
|
|
11
|
+
import { getChildDiagnosticErrorRows } from "../tool/review_run/child-failures.ts";
|
|
12
12
|
import { formatReviewUsage } from "../tool/usage-format.ts";
|
|
13
13
|
import type {
|
|
14
14
|
ChildFailureDiagnostics,
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
resolveRecoveryReviewModel,
|
|
16
16
|
} from "../model.ts";
|
|
17
17
|
import type { ReviewArtifactStore } from "../session/review-artifact-store.ts";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { captureReviewTarget, draftReviewTasks, runReview } from "../tool/
|
|
18
|
+
import { createReviewOutput } from "../tool/output-page.ts";
|
|
19
|
+
import { formatReviewBatch } from "../tool/review_run/format.ts";
|
|
20
|
+
import { queuePostReviewTurn } from "../tool/review_run/post-policy.ts";
|
|
21
|
+
import { captureReviewTarget, draftReviewTasks, runReview } from "../tool/review_run/workflow.ts";
|
|
22
22
|
import type {
|
|
23
23
|
PlanningRecord,
|
|
24
24
|
ReviewInput,
|
|
@@ -60,9 +60,9 @@ export async function selectInteractiveTarget(
|
|
|
60
60
|
const head = await selectedHead(ctx.cwd);
|
|
61
61
|
if (kind === "Current work") {
|
|
62
62
|
return {
|
|
63
|
-
selectedTarget: {
|
|
64
|
-
stateTarget: {
|
|
65
|
-
changeTarget: {
|
|
63
|
+
selectedTarget: { workingTree: { from: head } },
|
|
64
|
+
stateTarget: { workingTree: {} },
|
|
65
|
+
changeTarget: { workingTree: { from: head } },
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -77,12 +77,12 @@ export async function selectInteractiveTarget(
|
|
|
77
77
|
|
|
78
78
|
if (kind === "One commit") {
|
|
79
79
|
const parent = await firstAvailableParent(ctx.cwd, choice.commit);
|
|
80
|
-
const stateTarget = { to: choice.commit
|
|
80
|
+
const stateTarget = { committed: { to: choice.commit } };
|
|
81
81
|
return parent
|
|
82
82
|
? {
|
|
83
|
-
selectedTarget: { from: parent,
|
|
83
|
+
selectedTarget: { committed: { from: parent, to: choice.commit } },
|
|
84
84
|
stateTarget,
|
|
85
|
-
changeTarget: { from: parent,
|
|
85
|
+
changeTarget: { committed: { from: parent, to: choice.commit } },
|
|
86
86
|
}
|
|
87
87
|
: { selectedTarget: stateTarget, stateTarget };
|
|
88
88
|
}
|
|
@@ -91,16 +91,16 @@ export async function selectInteractiveTarget(
|
|
|
91
91
|
if (!from) throw new Error("The selected branch has no common ancestor with HEAD.");
|
|
92
92
|
if (kind === "Current work against a base branch") {
|
|
93
93
|
return {
|
|
94
|
-
selectedTarget: {
|
|
95
|
-
stateTarget: {
|
|
96
|
-
changeTarget: {
|
|
94
|
+
selectedTarget: { workingTree: { from } },
|
|
95
|
+
stateTarget: { workingTree: {} },
|
|
96
|
+
changeTarget: { workingTree: { from } },
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
const changeTarget = { from, to: head
|
|
100
|
+
const changeTarget = { committed: { from, to: head } };
|
|
101
101
|
return {
|
|
102
102
|
selectedTarget: changeTarget,
|
|
103
|
-
stateTarget: {
|
|
103
|
+
stateTarget: { committed: { to: head } },
|
|
104
104
|
changeTarget,
|
|
105
105
|
};
|
|
106
106
|
}
|
package/src/types.ts
CHANGED
|
@@ -9,14 +9,24 @@ import type { ReviewWorkspaceCleanupWarning } from "./workspace/review-workspace
|
|
|
9
9
|
/** A full Git commit id after target resolution. */
|
|
10
10
|
export type CommitId = string;
|
|
11
11
|
|
|
12
|
-
/** Public Review Target input.
|
|
13
|
-
export
|
|
12
|
+
/** Public Review Target input. Omit it, or use an empty object, for the current filesystem. */
|
|
13
|
+
export type ReviewTargetSpec =
|
|
14
|
+
| { workingTree?: never; committed?: never }
|
|
15
|
+
| { workingTree: WorkingTreeReviewTarget; committed?: never }
|
|
16
|
+
| { workingTree?: never; committed: CommittedReviewTarget };
|
|
17
|
+
|
|
18
|
+
/** Target source for the frozen current filesystem. */
|
|
19
|
+
export interface WorkingTreeReviewTarget {
|
|
14
20
|
/** Optional before commit syntax. The Review Engine resolves it once. */
|
|
15
21
|
from?: string;
|
|
16
|
-
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Target source for exact committed Git state. */
|
|
25
|
+
export interface CommittedReviewTarget {
|
|
26
|
+
/** Optional before commit syntax. The Review Engine resolves it once. */
|
|
27
|
+
from?: string;
|
|
28
|
+
/** Optional after commit syntax. It defaults to HEAD. */
|
|
17
29
|
to?: string;
|
|
18
|
-
/** Include the current filesystem and non-ignored untracked files. Defaults to true. */
|
|
19
|
-
includeUncommittedChanges?: boolean;
|
|
20
30
|
}
|
|
21
31
|
|
|
22
32
|
/** Exact target state used by the Review Engine after endpoint resolution. */
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/** Thin Pi adapter for the session-owned code_find workflow. */
|
|
2
|
-
|
|
3
|
-
import type { FindMode, FindWorkflowInput } from "../../session/find-types.ts";
|
|
4
|
-
import type { CodeIntelResult, CodeIntelToolExecCtx } from "../../types/index.ts";
|
|
5
|
-
import { toWorkflowControl } from "../infra/workflow-control.ts";
|
|
6
|
-
import { searchErrorResult } from "../result/errors.ts";
|
|
7
|
-
import { assembleFindWorkflowResult } from "../result/find.ts";
|
|
8
|
-
import type { CodeFindAstKind } from "./ast-kinds.ts";
|
|
9
|
-
import { renderFindResult } from "./render.ts";
|
|
10
|
-
|
|
11
|
-
export interface CodeFindToolParams {
|
|
12
|
-
query: string;
|
|
13
|
-
scope?: string[];
|
|
14
|
-
mode: FindMode;
|
|
15
|
-
kind?: CodeFindAstKind;
|
|
16
|
-
maxResults?: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export async function executeFindTool(
|
|
20
|
-
params: CodeFindToolParams,
|
|
21
|
-
ctx: CodeIntelToolExecCtx,
|
|
22
|
-
): Promise<CodeIntelResult> {
|
|
23
|
-
const outcome = await ctx.session.find(params as FindWorkflowInput, toWorkflowControl(ctx));
|
|
24
|
-
if (outcome.kind === "unavailable") throw new Error(outcome.reason);
|
|
25
|
-
if (outcome.kind === "invalid-input") {
|
|
26
|
-
return searchErrorResult(`**Error:** ${outcome.message}`, {
|
|
27
|
-
scope: Array.isArray(params?.scope) ? params.scope.join(", ") : null,
|
|
28
|
-
nextQueries: ["Fix the search input and retry"],
|
|
29
|
-
message: outcome.message,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const assembly = assembleFindWorkflowResult(outcome);
|
|
34
|
-
return {
|
|
35
|
-
content: renderFindResult(assembly),
|
|
36
|
-
details: {
|
|
37
|
-
type: "search",
|
|
38
|
-
data: assembly.details,
|
|
39
|
-
status: "completed",
|
|
40
|
-
displaySections: assembly.displaySections,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/** Thin Pi adapter for the session-owned code_graph workflow. */
|
|
2
|
-
|
|
3
|
-
import type { GraphWorkflowInput, RequestedGraphRelation } from "../../session/graph-types.ts";
|
|
4
|
-
import type { GraphTargetInput } from "../../session/target-input.ts";
|
|
5
|
-
import type { CodeIntelResult, CodeIntelToolExecCtx } from "../../types/index.ts";
|
|
6
|
-
import { toWorkflowControl } from "../infra/workflow-control.ts";
|
|
7
|
-
import { createToolDisplaySection } from "../result/display.ts";
|
|
8
|
-
import { searchErrorResult } from "../result/errors.ts";
|
|
9
|
-
import { assembleGraphResult } from "../result/graph.ts";
|
|
10
|
-
import { renderGraphResult } from "./markdown.ts";
|
|
11
|
-
|
|
12
|
-
export type GraphRelation = RequestedGraphRelation;
|
|
13
|
-
|
|
14
|
-
export interface CodeGraphToolParams {
|
|
15
|
-
target: GraphTargetInput;
|
|
16
|
-
relations?: GraphRelation[];
|
|
17
|
-
calleeDepth?: "direct" | "deep";
|
|
18
|
-
maxResults?: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function executeGraphTool(
|
|
22
|
-
params: CodeGraphToolParams,
|
|
23
|
-
ctx: CodeIntelToolExecCtx,
|
|
24
|
-
): Promise<CodeIntelResult> {
|
|
25
|
-
const outcome = await ctx.session.graph(params as GraphWorkflowInput, toWorkflowControl(ctx));
|
|
26
|
-
|
|
27
|
-
if (outcome.kind === "unavailable") throw new Error(outcome.reason);
|
|
28
|
-
if (outcome.kind === "invalid-input") {
|
|
29
|
-
return searchErrorResult(`**Error:** ${outcome.message}`, { message: outcome.message });
|
|
30
|
-
}
|
|
31
|
-
if (outcome.kind === "disambiguation" || outcome.kind === "kind-mismatch") {
|
|
32
|
-
const lines = [
|
|
33
|
-
outcome.kind === "kind-mismatch"
|
|
34
|
-
? `**No target matched provider kind \`${outcome.requestedKind}\`. Near matches:**`
|
|
35
|
-
: "**Target is ambiguous. Choose one candidate handle:**",
|
|
36
|
-
"",
|
|
37
|
-
];
|
|
38
|
-
for (const candidate of outcome.candidates) {
|
|
39
|
-
lines.push(
|
|
40
|
-
`- \`${candidate.targetId}\` — ${candidate.name} (\`${candidate.kind ?? "unknown"}\`) at ${candidate.file}:${candidate.line}:${candidate.character}`,
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
if (outcome.kind === "kind-mismatch") {
|
|
44
|
-
lines.push(
|
|
45
|
-
"",
|
|
46
|
-
"Retry without `symbolKind`, use an observed provider kind, or choose a handle.",
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
return searchErrorResult(lines.join("\n"), {
|
|
50
|
-
message:
|
|
51
|
-
outcome.kind === "kind-mismatch"
|
|
52
|
-
? `No target matched provider kind ${outcome.requestedKind}.`
|
|
53
|
-
: "The target is ambiguous.",
|
|
54
|
-
displaySections: [
|
|
55
|
-
createToolDisplaySection({
|
|
56
|
-
key: "graph.candidates",
|
|
57
|
-
title: "Candidates",
|
|
58
|
-
items: outcome.candidates,
|
|
59
|
-
format: (candidate) =>
|
|
60
|
-
`${candidate.targetId} — ${candidate.name} (${candidate.kind ?? "unknown"}) at ${candidate.file}:${candidate.line}:${candidate.character}`,
|
|
61
|
-
}),
|
|
62
|
-
],
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const assembly = assembleGraphResult({
|
|
67
|
-
displayName: outcome.displayName,
|
|
68
|
-
sections: outcome.sections,
|
|
69
|
-
resolvedDisplayFile: outcome.resolvedDisplayFile,
|
|
70
|
-
maxResults: outcome.maxResults,
|
|
71
|
-
cwd: ctx.cwd,
|
|
72
|
-
});
|
|
73
|
-
return {
|
|
74
|
-
content: renderGraphResult(assembly),
|
|
75
|
-
details: {
|
|
76
|
-
type: "search",
|
|
77
|
-
data: assembly.details,
|
|
78
|
-
status: "completed",
|
|
79
|
-
displaySections: assembly.displaySections,
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/** Thin Pi adapter for session-owned point inspection. */
|
|
2
|
-
|
|
3
|
-
import type { InspectWorkflowInput } from "../../session/inspect-types.ts";
|
|
4
|
-
import type { SourcePointInput } from "../../session/target-input.ts";
|
|
5
|
-
import type { CodeIntelResult, CodeIntelToolExecCtx } from "../../types/index.ts";
|
|
6
|
-
import { toWorkflowControl } from "../infra/workflow-control.ts";
|
|
7
|
-
import { inspectErrorResult } from "../result/errors.ts";
|
|
8
|
-
import { assembleInspectResult } from "../result/inspect.ts";
|
|
9
|
-
import { renderInspectResult } from "./markdown.ts";
|
|
10
|
-
|
|
11
|
-
export interface CodeInspectToolParams {
|
|
12
|
-
point: SourcePointInput;
|
|
13
|
-
maxResults?: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export async function executeInspectTool(
|
|
17
|
-
params: CodeInspectToolParams,
|
|
18
|
-
ctx: CodeIntelToolExecCtx,
|
|
19
|
-
): Promise<CodeIntelResult> {
|
|
20
|
-
const outcome = await ctx.session.inspect(params as InspectWorkflowInput, toWorkflowControl(ctx));
|
|
21
|
-
if (outcome.kind === "unavailable") throw new Error(outcome.reason);
|
|
22
|
-
if (outcome.kind === "invalid-input") {
|
|
23
|
-
return inspectErrorResult(`**Error:** ${outcome.message}`, {
|
|
24
|
-
focusTarget: "invalid input",
|
|
25
|
-
nextQueries: ["Provide an existing file and exact 1-based point"],
|
|
26
|
-
message: outcome.message,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const assembly = assembleInspectResult(outcome.data, outcome.nextQueries);
|
|
31
|
-
return {
|
|
32
|
-
content: renderInspectResult(assembly),
|
|
33
|
-
details: {
|
|
34
|
-
type: "inspect",
|
|
35
|
-
data: assembly.details,
|
|
36
|
-
status: "completed",
|
|
37
|
-
displaySections: assembly.displaySections,
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/** Thin Pi adapter for the session-owned Orientation workflow. */
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
OrientationFocusInput,
|
|
5
|
-
OrientationWorkflowInput,
|
|
6
|
-
} from "../../session/orientation-types.ts";
|
|
7
|
-
import type { CodeIntelResult, CodeIntelToolExecCtx } from "../../types/index.ts";
|
|
8
|
-
import { toWorkflowControl } from "../infra/workflow-control.ts";
|
|
9
|
-
import { contextErrorResult } from "../result/errors.ts";
|
|
10
|
-
import {
|
|
11
|
-
assembleOrientationDetails,
|
|
12
|
-
assembleOrientationResult,
|
|
13
|
-
orientationCandidateDisplaySections,
|
|
14
|
-
} from "../result/orientation.ts";
|
|
15
|
-
import { renderOrientationResult } from "./markdown.ts";
|
|
16
|
-
|
|
17
|
-
export interface CodeOrientationToolParams {
|
|
18
|
-
focus?: OrientationFocusInput;
|
|
19
|
-
maxResults?: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export async function executeOrientationTool(
|
|
23
|
-
params: CodeOrientationToolParams,
|
|
24
|
-
ctx: CodeIntelToolExecCtx,
|
|
25
|
-
): Promise<CodeIntelResult> {
|
|
26
|
-
const outcome = await ctx.session.orient(
|
|
27
|
-
params as OrientationWorkflowInput,
|
|
28
|
-
toWorkflowControl(ctx),
|
|
29
|
-
);
|
|
30
|
-
if (outcome.kind === "unavailable") throw new Error(outcome.reason);
|
|
31
|
-
if (outcome.kind === "invalid-input") {
|
|
32
|
-
return contextErrorResult(`**Error:** ${outcome.message}`, {
|
|
33
|
-
nextQueries: ["Choose an existing path, module, or precise target"],
|
|
34
|
-
message: outcome.message,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
if (outcome.kind === "disambiguation" || outcome.kind === "kind-mismatch") {
|
|
38
|
-
const candidates = outcome.candidates ?? [];
|
|
39
|
-
const lines = [
|
|
40
|
-
outcome.kind === "kind-mismatch"
|
|
41
|
-
? `# No Orientation target matched provider kind \`${outcome.requestedKind}\``
|
|
42
|
-
: "# Multiple Orientation targets",
|
|
43
|
-
"",
|
|
44
|
-
];
|
|
45
|
-
for (const candidate of candidates) {
|
|
46
|
-
lines.push(
|
|
47
|
-
`${candidate.rank}. **${candidate.name}** (\`${candidate.kind ?? "unknown"}\`) — \`${candidate.file}\`:${candidate.line}:${candidate.character} — \`${candidate.targetId}\``,
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
const nextQueries =
|
|
51
|
-
outcome.kind === "kind-mismatch"
|
|
52
|
-
? ["Retry without symbolKind, use an observed provider kind, or focus one handle"]
|
|
53
|
-
: ["Use one candidate handle as focus.target.handle"];
|
|
54
|
-
const details = assembleOrientationDetails({
|
|
55
|
-
confidence: "semantic",
|
|
56
|
-
omittedCount: outcome.omittedCount,
|
|
57
|
-
candidates,
|
|
58
|
-
nextQueries,
|
|
59
|
-
});
|
|
60
|
-
return {
|
|
61
|
-
content: lines.join("\n"),
|
|
62
|
-
details: {
|
|
63
|
-
type: "context",
|
|
64
|
-
data: details,
|
|
65
|
-
status: "completed",
|
|
66
|
-
displaySections: orientationCandidateDisplaySections(candidates, outcome.omittedCount),
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
const assembly = assembleOrientationResult(outcome.data);
|
|
71
|
-
return {
|
|
72
|
-
content: renderOrientationResult(assembly),
|
|
73
|
-
details: {
|
|
74
|
-
type: "context",
|
|
75
|
-
data: assembly.details,
|
|
76
|
-
status: "completed",
|
|
77
|
-
displaySections: assembly.displaySections,
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/** Thin Pi adapter for code_resolve. */
|
|
2
|
-
|
|
3
|
-
import type { ResolveTargetInput } from "../../session/target-input.ts";
|
|
4
|
-
import type { CodeIntelResult, CodeIntelToolExecCtx } from "../../types/index.ts";
|
|
5
|
-
import { toWorkflowControl } from "../infra/workflow-control.ts";
|
|
6
|
-
import { assembleResolveResult, suggestedResolveRelations } from "../result/resolve.ts";
|
|
7
|
-
import { renderResolveResult } from "./markdown.ts";
|
|
8
|
-
|
|
9
|
-
export interface CodeResolveToolParams {
|
|
10
|
-
target: ResolveTargetInput;
|
|
11
|
-
maxResults?: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export async function executeResolveTool(
|
|
15
|
-
params: CodeResolveToolParams,
|
|
16
|
-
ctx: CodeIntelToolExecCtx,
|
|
17
|
-
): Promise<CodeIntelResult> {
|
|
18
|
-
const outcome = await ctx.session.resolve(params, toWorkflowControl(ctx));
|
|
19
|
-
if (outcome.kind === "unavailable") {
|
|
20
|
-
throw new Error(outcome.reason);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const assembly = assembleResolveResult(outcome, ctx.cwd);
|
|
24
|
-
let content = renderResolveResult(assembly);
|
|
25
|
-
if (outcome.kind === "resolved") {
|
|
26
|
-
const relations = suggestedResolveRelations(outcome.entry.kind);
|
|
27
|
-
content +=
|
|
28
|
-
`\n\nChain next: \`code_graph({ target: { handle: "${outcome.entry.targetId}" }, ` +
|
|
29
|
-
`relations: ${JSON.stringify(relations)} })\``;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
content,
|
|
34
|
-
details: {
|
|
35
|
-
type: "resolve",
|
|
36
|
-
data: assembly.details,
|
|
37
|
-
status:
|
|
38
|
-
outcome.kind === "resolved" || outcome.kind === "target-group"
|
|
39
|
-
? "completed"
|
|
40
|
-
: outcome.kind === "disambiguation" || outcome.kind === "kind-mismatch"
|
|
41
|
-
? "disambiguation"
|
|
42
|
-
: "invalid-input",
|
|
43
|
-
...(outcome.kind === "invalid-input"
|
|
44
|
-
? { message: outcome.message }
|
|
45
|
-
: outcome.kind === "disambiguation"
|
|
46
|
-
? { message: "Multiple target matches require one candidate." }
|
|
47
|
-
: outcome.kind === "kind-mismatch"
|
|
48
|
-
? { message: `No target matched provider kind ${outcome.requestedKind}.` }
|
|
49
|
-
: {}),
|
|
50
|
-
displaySections: assembly.displaySections,
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { Value } from "typebox/value";
|
|
3
|
-
import type { LocalReviewAuditStore } from "../audit/local-review-audit-store.ts";
|
|
4
|
-
import { formatReplayOutline, projectReplayOutline } from "../audit/replay-outline.ts";
|
|
5
|
-
import { parseReviewAuditRecord, serializeReplayMessage } from "../audit/review-audit-record.ts";
|
|
6
|
-
import { renderAuditCall, renderAuditResult } from "../tui/paged-output.ts";
|
|
7
|
-
import { modelFacingPage, pageText, type TextPage } from "./output-page.ts";
|
|
8
|
-
import { REVIEW_TOOL_SPECS } from "./tool-specs.ts";
|
|
9
|
-
|
|
10
|
-
interface AuditParams {
|
|
11
|
-
artifactId?: string;
|
|
12
|
-
view?: "outline" | "message" | "raw";
|
|
13
|
-
messageIndex?: number;
|
|
14
|
-
offset?: number;
|
|
15
|
-
limit?: number;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function formatAuditList(audits: Awaited<ReturnType<LocalReviewAuditStore["list"]>>): string {
|
|
19
|
-
if (audits.length === 0) return "No non-expired local reviewer replays were found.";
|
|
20
|
-
return [
|
|
21
|
-
"# Local Reviewer Replays",
|
|
22
|
-
"",
|
|
23
|
-
...audits.map((audit) => `- ${audit.artifactId} (expires ${audit.expiresAt})`),
|
|
24
|
-
].join("\n");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function pageDetails(page: TextPage) {
|
|
28
|
-
return {
|
|
29
|
-
offset: page.offset,
|
|
30
|
-
...(page.nextOffset === undefined ? {} : { nextOffset: page.nextOffset }),
|
|
31
|
-
totalCharacters: page.totalCharacters,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function validateAuditCombination(params: AuditParams): void {
|
|
36
|
-
if (params.view && !params.artifactId) {
|
|
37
|
-
throw new Error("view requires artifactId. Omit view to list local replays.");
|
|
38
|
-
}
|
|
39
|
-
if (params.messageIndex !== undefined && params.view !== "message") {
|
|
40
|
-
throw new Error('messageIndex is valid only with view: "message".');
|
|
41
|
-
}
|
|
42
|
-
if (
|
|
43
|
-
params.view === "message" &&
|
|
44
|
-
(!Number.isSafeInteger(params.messageIndex) || (params.messageIndex ?? -1) < 0)
|
|
45
|
-
) {
|
|
46
|
-
throw new Error('view: "message" requires a non-negative integer messageIndex.');
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function completeOutlineRowIndexes(text: string, page: TextPage): number[] {
|
|
51
|
-
if (text === "[no messages]") return [];
|
|
52
|
-
const starts: Array<{ index: number; start: number; end: number }> = [];
|
|
53
|
-
let start = 0;
|
|
54
|
-
for (const line of text.split("\n")) {
|
|
55
|
-
const match = /^\[(\d+)\]/.exec(line);
|
|
56
|
-
const end = start + line.length;
|
|
57
|
-
if (match) starts.push({ index: Number(match[1]), start, end });
|
|
58
|
-
start = end + 1;
|
|
59
|
-
}
|
|
60
|
-
const pageEnd = page.nextOffset ?? page.totalCharacters;
|
|
61
|
-
return starts
|
|
62
|
-
.filter((row) => row.start >= page.offset && row.end <= pageEnd)
|
|
63
|
-
.map((row) => row.index);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async function listResult(
|
|
67
|
-
spec: typeof REVIEW_TOOL_SPECS.audit,
|
|
68
|
-
store: LocalReviewAuditStore,
|
|
69
|
-
params: AuditParams,
|
|
70
|
-
signal?: AbortSignal,
|
|
71
|
-
) {
|
|
72
|
-
const audits = await store.list(signal);
|
|
73
|
-
const page = pageText(formatAuditList(audits), params.offset, params.limit);
|
|
74
|
-
const visibleAudits = audits.filter((audit) => {
|
|
75
|
-
signal?.throwIfAborted();
|
|
76
|
-
return page.text.includes(audit.artifactId);
|
|
77
|
-
});
|
|
78
|
-
return {
|
|
79
|
-
content: [{ type: "text" as const, text: modelFacingPage(spec.name, {}, page) }],
|
|
80
|
-
details: {
|
|
81
|
-
kind: "review-audit" as const,
|
|
82
|
-
mode: "list" as const,
|
|
83
|
-
audits: visibleAudits,
|
|
84
|
-
totalAudits: audits.length,
|
|
85
|
-
...pageDetails(page),
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
async function artifactResult(
|
|
91
|
-
spec: typeof REVIEW_TOOL_SPECS.audit,
|
|
92
|
-
store: LocalReviewAuditStore,
|
|
93
|
-
params: AuditParams & { artifactId: string },
|
|
94
|
-
signal?: AbortSignal,
|
|
95
|
-
) {
|
|
96
|
-
const raw = await store.read(params.artifactId, signal);
|
|
97
|
-
if (raw === undefined) {
|
|
98
|
-
throw new Error(`Reviewer replay ${params.artifactId} was not found or has expired.`);
|
|
99
|
-
}
|
|
100
|
-
const view = params.view ?? "outline";
|
|
101
|
-
if (view === "raw") {
|
|
102
|
-
const page = pageText(raw, params.offset, params.limit);
|
|
103
|
-
return {
|
|
104
|
-
content: [
|
|
105
|
-
{
|
|
106
|
-
type: "text" as const,
|
|
107
|
-
text: modelFacingPage(spec.name, { artifactId: params.artifactId, view: "raw" }, page),
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
details: {
|
|
111
|
-
kind: "review-audit" as const,
|
|
112
|
-
mode: "raw" as const,
|
|
113
|
-
artifactId: params.artifactId,
|
|
114
|
-
...pageDetails(page),
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const record = parseReviewAuditRecord(raw);
|
|
120
|
-
if (view === "message") {
|
|
121
|
-
const messageIndex = params.messageIndex as number;
|
|
122
|
-
const text = serializeReplayMessage(record, messageIndex);
|
|
123
|
-
const page = pageText(text, params.offset, params.limit);
|
|
124
|
-
return {
|
|
125
|
-
content: [
|
|
126
|
-
{
|
|
127
|
-
type: "text" as const,
|
|
128
|
-
text: modelFacingPage(
|
|
129
|
-
spec.name,
|
|
130
|
-
{ artifactId: params.artifactId, view: "message", messageIndex },
|
|
131
|
-
page,
|
|
132
|
-
),
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
details: {
|
|
136
|
-
kind: "review-audit" as const,
|
|
137
|
-
mode: "message" as const,
|
|
138
|
-
artifactId: params.artifactId,
|
|
139
|
-
messageIndex,
|
|
140
|
-
...pageDetails(page),
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
const rows = projectReplayOutline(record.messages);
|
|
146
|
-
const text = formatReplayOutline(rows);
|
|
147
|
-
const page = pageText(text, params.offset, params.limit);
|
|
148
|
-
return {
|
|
149
|
-
content: [
|
|
150
|
-
{
|
|
151
|
-
type: "text" as const,
|
|
152
|
-
text: modelFacingPage(spec.name, { artifactId: params.artifactId, view: "outline" }, page),
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
details: {
|
|
156
|
-
kind: "review-audit" as const,
|
|
157
|
-
mode: "outline" as const,
|
|
158
|
-
artifactId: params.artifactId,
|
|
159
|
-
totalMessages: rows.length,
|
|
160
|
-
messageIndexes: completeOutlineRowIndexes(text, page),
|
|
161
|
-
...pageDetails(page),
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/** Register explicit retrieval for opt-in, local-only reviewer replay artifacts. */
|
|
167
|
-
export function registerReviewAuditTool(pi: ExtensionAPI, store: LocalReviewAuditStore): void {
|
|
168
|
-
const spec = REVIEW_TOOL_SPECS.audit;
|
|
169
|
-
pi.registerTool({
|
|
170
|
-
...spec,
|
|
171
|
-
promptGuidelines: [...spec.promptGuidelines],
|
|
172
|
-
renderCall: renderAuditCall,
|
|
173
|
-
renderResult: renderAuditResult,
|
|
174
|
-
async execute(_id, params, signal) {
|
|
175
|
-
if (!Value.Check(spec.parameters, params)) throw new Error("Invalid review audit input.");
|
|
176
|
-
validateAuditCombination(params);
|
|
177
|
-
if (!params.artifactId) return listResult(spec, store, params, signal);
|
|
178
|
-
return artifactResult(spec, store, { ...params, artifactId: params.artifactId }, signal);
|
|
179
|
-
},
|
|
180
|
-
});
|
|
181
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import type { ReviewArtifactStore } from "../session/review-artifact-store.ts";
|
|
3
|
-
import { renderOutputCall, renderOutputResult } from "../tui/paged-output.ts";
|
|
4
|
-
import type { ReviewOutputReference } from "../types.ts";
|
|
5
|
-
import { modelFacingPage } from "./output-page.ts";
|
|
6
|
-
import { REVIEW_TOOL_SPECS } from "./tool-specs.ts";
|
|
7
|
-
|
|
8
|
-
interface ReviewOutputOptions {
|
|
9
|
-
firstPageCharacters?: number;
|
|
10
|
-
firstPageLines?: number;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/** Store complete output and return its first bounded model-facing page. */
|
|
14
|
-
export function createReviewOutput(
|
|
15
|
-
store: ReviewArtifactStore,
|
|
16
|
-
text: string,
|
|
17
|
-
options: ReviewOutputOptions = {},
|
|
18
|
-
): { text: string; reference: ReviewOutputReference } {
|
|
19
|
-
const artifact = store.create(text);
|
|
20
|
-
const page = store.read(
|
|
21
|
-
artifact.id,
|
|
22
|
-
undefined,
|
|
23
|
-
options.firstPageCharacters,
|
|
24
|
-
options.firstPageLines,
|
|
25
|
-
);
|
|
26
|
-
if (!page) throw new Error("Review output expired before it could be returned.");
|
|
27
|
-
return {
|
|
28
|
-
text: modelFacingPage(REVIEW_TOOL_SPECS.output.name, { artifactId: artifact.id }, page),
|
|
29
|
-
reference: {
|
|
30
|
-
artifactId: artifact.id,
|
|
31
|
-
offset: page.offset,
|
|
32
|
-
...(page.nextOffset === undefined ? {} : { nextOffset: page.nextOffset }),
|
|
33
|
-
totalCharacters: page.totalCharacters,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** Register resumable retrieval for agent and interactive Review output artifacts. */
|
|
39
|
-
export function registerReviewOutputTool(pi: ExtensionAPI, store: ReviewArtifactStore): void {
|
|
40
|
-
const spec = REVIEW_TOOL_SPECS.output;
|
|
41
|
-
pi.registerTool({
|
|
42
|
-
...spec,
|
|
43
|
-
promptGuidelines: [...spec.promptGuidelines],
|
|
44
|
-
renderCall: renderOutputCall,
|
|
45
|
-
renderResult: renderOutputResult,
|
|
46
|
-
async execute(_id, params) {
|
|
47
|
-
const page = store.read(params.artifactId, params.offset, params.limit);
|
|
48
|
-
if (!page) {
|
|
49
|
-
throw new Error(
|
|
50
|
-
`Review output ${params.artifactId} was not found or has expired from this session.`,
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
content: [
|
|
55
|
-
{
|
|
56
|
-
type: "text" as const,
|
|
57
|
-
text: modelFacingPage(spec.name, { artifactId: params.artifactId }, page),
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
details: {
|
|
61
|
-
kind: "review-output-page" as const,
|
|
62
|
-
artifactId: params.artifactId,
|
|
63
|
-
offset: page.offset,
|
|
64
|
-
...(page.nextOffset === undefined ? {} : { nextOffset: page.nextOffset }),
|
|
65
|
-
totalCharacters: page.totalCharacters,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
pi.on("session_start", () => store.clear());
|
|
72
|
-
pi.on("session_tree", () => store.clear());
|
|
73
|
-
pi.on("session_shutdown", () => store.clear());
|
|
74
|
-
}
|