@mrclrchtr/supi-code-intelligence 4.6.0 → 4.8.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/node_modules/@mrclrchtr/supi-code-runtime/README.md +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -15
- package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -6
- package/node_modules/@mrclrchtr/supi-core/README.md +26 -34
- package/node_modules/@mrclrchtr/supi-core/package.json +4 -7
- package/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -6
- package/node_modules/@mrclrchtr/supi-core/src/config/config.ts +0 -20
- package/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +7 -1
- package/node_modules/@mrclrchtr/supi-core/src/config.ts +0 -1
- package/node_modules/@mrclrchtr/supi-core/src/context.ts +1 -9
- package/node_modules/@mrclrchtr/supi-core/src/index.ts +4 -6
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +54 -28
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +91 -125
- package/node_modules/@mrclrchtr/supi-core/src/settings.ts +10 -7
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/README.md +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -15
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -6
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/README.md +26 -34
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +4 -7
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -6
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config/config.ts +0 -20
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +7 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config.ts +0 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context.ts +1 -9
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/index.ts +4 -6
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +54 -28
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +91 -125
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings.ts +10 -7
- package/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +361 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +46 -238
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +25 -33
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/README.md +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -15
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/README.md +26 -34
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +4 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config/config.ts +0 -20
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +7 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config.ts +0 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context.ts +1 -9
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/index.ts +4 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +54 -28
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +91 -125
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings.ts +10 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-html-sql.ts +1 -1
- package/package.json +5 -5
- package/src/config.ts +19 -16
- package/src/substrate/lsp/settings.ts +90 -91
- package/src/tool/find/execute.ts +5 -8
- package/src/tool/graph/execute.ts +1 -1
- package/src/tool/health/execute.ts +2 -5
- package/src/tool/inspect/execute.ts +5 -7
- package/src/tool/orientation/execute.ts +4 -5
- package/src/tool/refactor-apply/execute.ts +4 -5
- package/src/tool/refactor-plan/execute.ts +7 -9
- package/src/tool/result/errors.ts +2 -82
- package/src/ui/tui/common.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +0 -120
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +0 -75
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +0 -42
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +0 -221
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +0 -357
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +0 -11
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +0 -119
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +0 -36
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +0 -31
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +0 -16
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -287
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/evidence-badge.ts +0 -41
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +0 -57
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +0 -36
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/llm.ts +0 -201
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +0 -134
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +0 -44
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +0 -2
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/progress-widget.ts +0 -189
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +0 -170
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +0 -15
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +0 -4
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +0 -93
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/report.ts +0 -121
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +0 -71
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +0 -8
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +0 -373
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +0 -102
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +0 -15
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +0 -76
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +0 -487
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +0 -141
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +0 -118
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +0 -3
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +0 -33
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +0 -11
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +0 -68
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +0 -60
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +0 -192
- package/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +0 -42
- package/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +0 -45
- package/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +0 -119
- package/node_modules/@mrclrchtr/supi-core/src/progress-widget.ts +0 -189
- package/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +0 -373
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +0 -102
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +0 -15
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +0 -141
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +0 -118
- package/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +0 -3
- package/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +0 -192
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +0 -120
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +0 -75
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +0 -42
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +0 -221
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +0 -357
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +0 -11
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +0 -119
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +0 -36
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +0 -31
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +0 -16
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -287
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/evidence-badge.ts +0 -41
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +0 -57
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +0 -36
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/llm.ts +0 -201
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +0 -134
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +0 -44
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +0 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/progress-widget.ts +0 -189
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +0 -170
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +0 -15
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +0 -4
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +0 -93
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/report.ts +0 -121
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +0 -71
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +0 -8
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +0 -373
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +0 -102
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +0 -15
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +0 -76
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +0 -487
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +0 -141
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +0 -118
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +0 -3
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +0 -33
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +0 -11
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +0 -68
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +0 -60
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +0 -192
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +0 -42
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +0 -45
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +0 -119
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/progress-widget.ts +0 -189
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +0 -373
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +0 -102
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +0 -15
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +0 -141
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +0 -118
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +0 -3
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +0 -192
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-refresh.ts +0 -234
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/diagnostics.ts +0 -99
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/suppression-diagnostics.ts +0 -60
- package/node_modules/@mrclrchtr/supi-lsp/src/index.ts +0 -41
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +0 -120
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +0 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +0 -42
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +0 -221
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +0 -357
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +0 -11
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +0 -119
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +0 -36
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +0 -31
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +0 -16
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -287
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/evidence-badge.ts +0 -41
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +0 -57
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +0 -36
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/llm.ts +0 -201
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +0 -134
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +0 -44
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +0 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/progress-widget.ts +0 -189
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +0 -170
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +0 -15
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +0 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +0 -93
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/report.ts +0 -121
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +0 -71
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +0 -8
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +0 -373
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +0 -102
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +0 -15
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +0 -76
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +0 -487
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +0 -141
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +0 -118
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +0 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +0 -33
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +0 -11
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +0 -68
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +0 -60
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +0 -192
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +0 -42
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +0 -45
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +0 -119
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/progress-widget.ts +0 -189
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +0 -373
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +0 -102
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +0 -15
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +0 -141
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +0 -118
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +0 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +0 -192
- package/src/tool/infra/error-results.ts +0 -19
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
|
|
4
|
-
const IGNORED_DIRECTORIES = new Set(["node_modules", ".git", ".pnpm"]);
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Walk a project directory tree, calling `onDirectory` for each directory.
|
|
8
|
-
* Skips `node_modules`, `.git`, and `.pnpm`.
|
|
9
|
-
* Stops at depth 0.
|
|
10
|
-
*/
|
|
11
|
-
export function walkProject(
|
|
12
|
-
directory: string,
|
|
13
|
-
depth: number,
|
|
14
|
-
onDirectory: (directory: string, entryNames: Set<string>) => void,
|
|
15
|
-
): void {
|
|
16
|
-
let entries: fs.Dirent[];
|
|
17
|
-
try {
|
|
18
|
-
entries = fs.readdirSync(directory, { withFileTypes: true });
|
|
19
|
-
} catch {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const entryNames = new Set(entries.map((entry) => entry.name));
|
|
24
|
-
onDirectory(directory, entryNames);
|
|
25
|
-
|
|
26
|
-
if (depth <= 0) return;
|
|
27
|
-
|
|
28
|
-
for (const entry of entries) {
|
|
29
|
-
if (!entry.isDirectory()) continue;
|
|
30
|
-
if (IGNORED_DIRECTORIES.has(entry.name)) continue;
|
|
31
|
-
walkProject(path.join(directory, entry.name), depth - 1, onDirectory);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Search upward from `startDir` for any of the `markers` files/dirs.
|
|
37
|
-
* Returns the directory containing the first found marker, or `fallback`.
|
|
38
|
-
*/
|
|
39
|
-
export function findProjectRoot(startDir: string, markers: string[], fallback: string): string {
|
|
40
|
-
let dir = path.resolve(startDir);
|
|
41
|
-
const root = path.parse(dir).root;
|
|
42
|
-
|
|
43
|
-
while (dir !== root) {
|
|
44
|
-
for (const marker of markers) {
|
|
45
|
-
if (fs.existsSync(path.join(dir, marker))) {
|
|
46
|
-
return dir;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
const parent = path.dirname(dir);
|
|
50
|
-
if (parent === dir) break;
|
|
51
|
-
dir = parent;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return fallback;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Deduplicate overlapping roots, keeping only the topmost (shortest path) roots.
|
|
59
|
-
*/
|
|
60
|
-
export function dedupeTopmostRoots(roots: string[]): string[] {
|
|
61
|
-
const accepted: string[] = [];
|
|
62
|
-
|
|
63
|
-
for (const root of [...new Set(roots.map((entry) => path.resolve(entry)))].sort(byPathDepth)) {
|
|
64
|
-
const isChild = accepted.some((parent) => root !== parent && isWithin(parent, root));
|
|
65
|
-
if (!isChild) {
|
|
66
|
-
accepted.push(root);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return accepted;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Minimal shape accepted by `buildKnownRootsMap`.
|
|
75
|
-
* Structurally compatible with `DetectedProjectServer` and similar
|
|
76
|
-
* `{ name, root }` records — callers may pass a wider type safely.
|
|
77
|
-
*/
|
|
78
|
-
export type KnownRootEntry = { name: string; root: string };
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Build a map of language/server name to sorted, deduplicated root paths.
|
|
82
|
-
*
|
|
83
|
-
* Accepts an array of detected project entries (e.g. from LSP project discovery)
|
|
84
|
-
* and groups them by name with roots sorted by specificity.
|
|
85
|
-
*/
|
|
86
|
-
export function buildKnownRootsMap(detected: KnownRootEntry[]): Map<string, string[]> {
|
|
87
|
-
const next = new Map<string, string[]>();
|
|
88
|
-
|
|
89
|
-
for (const entry of detected) {
|
|
90
|
-
const roots = next.get(entry.name) ?? [];
|
|
91
|
-
if (!roots.includes(entry.root)) roots.push(entry.root);
|
|
92
|
-
next.set(entry.name, sortRootsBySpecificity(roots));
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return next;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Merge a new root into an existing list, deduplicating and sorting.
|
|
100
|
-
*
|
|
101
|
-
* Returns the original reference when the root is already present.
|
|
102
|
-
*/
|
|
103
|
-
export function mergeKnownRoots(roots: string[], root: string): string[] {
|
|
104
|
-
if (roots.includes(root)) return roots;
|
|
105
|
-
return sortRootsBySpecificity([...roots, root]);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Resolve the most specific known root that contains `filePath`.
|
|
110
|
-
*
|
|
111
|
-
* Searches the given roots list (presumed sorted by specificity) and returns
|
|
112
|
-
* the first root that contains or equals `filePath`.
|
|
113
|
-
*
|
|
114
|
-
* @returns The matching root string, or `null` when none match.
|
|
115
|
-
*/
|
|
116
|
-
export function resolveKnownRoot(filePath: string, roots: string[]): string | null {
|
|
117
|
-
const resolvedPath = path.resolve(filePath);
|
|
118
|
-
return roots.find((root) => isWithinOrEqual(root, resolvedPath)) ?? null;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Sort roots by specificity (deepest/longest first), then alphabetically.
|
|
123
|
-
*
|
|
124
|
-
* Deduplicates by resolved path before sorting.
|
|
125
|
-
*/
|
|
126
|
-
export function sortRootsBySpecificity(roots: string[]): string[] {
|
|
127
|
-
return [...new Set(roots.map((root) => path.resolve(root)))].sort(
|
|
128
|
-
(a, b) => b.length - a.length || a.localeCompare(b),
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Check if `child` is strictly inside `parent`.
|
|
134
|
-
*
|
|
135
|
-
* Returns `true` when `child` is a subdirectory of `parent`.
|
|
136
|
-
* Returns `false` for the same path.
|
|
137
|
-
*/
|
|
138
|
-
export function isWithin(parent: string, child: string): boolean {
|
|
139
|
-
const relative = path.relative(parent, child);
|
|
140
|
-
return relative !== "" && !relative.startsWith(`..${path.sep}`) && relative !== "..";
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Check if `filePath` is inside `root` or is the same path.
|
|
145
|
-
*
|
|
146
|
-
* Combines exact-path equality with `isWithin` semantics.
|
|
147
|
-
*/
|
|
148
|
-
export function isWithinOrEqual(root: string, filePath: string): boolean {
|
|
149
|
-
const relative = path.relative(root, filePath);
|
|
150
|
-
return relative === "" || isWithin(root, filePath);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Comparator for sorting paths by depth (shallowest first), then alphabetically.
|
|
155
|
-
*
|
|
156
|
-
* Useful with `.sort()` on arrays of path strings.
|
|
157
|
-
*/
|
|
158
|
-
export function byPathDepth(a: string, b: string): number {
|
|
159
|
-
const depthDiff = segmentCount(a) - segmentCount(b);
|
|
160
|
-
return depthDiff !== 0 ? depthDiff : a.localeCompare(b);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Count path segments in a resolved absolute path.
|
|
165
|
-
*
|
|
166
|
-
* @example segmentCount("/a/b/c") // 3
|
|
167
|
-
*/
|
|
168
|
-
export function segmentCount(target: string): number {
|
|
169
|
-
return path.resolve(target).split(path.sep).filter(Boolean).length;
|
|
170
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// supi-core project domain — project root discovery and traversal.
|
|
2
|
-
export type { KnownRootEntry } from "./project-roots.ts";
|
|
3
|
-
export {
|
|
4
|
-
buildKnownRootsMap,
|
|
5
|
-
byPathDepth,
|
|
6
|
-
dedupeTopmostRoots,
|
|
7
|
-
findProjectRoot,
|
|
8
|
-
isWithin,
|
|
9
|
-
isWithinOrEqual,
|
|
10
|
-
mergeKnownRoots,
|
|
11
|
-
resolveKnownRoot,
|
|
12
|
-
segmentCount,
|
|
13
|
-
sortRootsBySpecificity,
|
|
14
|
-
walkProject,
|
|
15
|
-
} from "./project-roots.ts";
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// Shared registry utility for SuPi extensions.
|
|
2
|
-
//
|
|
3
|
-
// Provides a globalThis-backed registry pattern so that all jiti module instances
|
|
4
|
-
// (resolved through different node_modules symlinks) share the same Map.
|
|
5
|
-
// Without this, each symlink path gets its own module copy and its own Map,
|
|
6
|
-
// so registrations from one instance are invisible to consumers in another.
|
|
7
|
-
|
|
8
|
-
import * as path from "node:path";
|
|
9
|
-
|
|
10
|
-
const SYMBOL_PREFIX = "@mrclrchtr/supi-core/";
|
|
11
|
-
|
|
12
|
-
function getGlobalRegistryMap<T>(name: string): Map<string, T> {
|
|
13
|
-
const key = Symbol.for(SYMBOL_PREFIX + name);
|
|
14
|
-
let map = (globalThis as Record<symbol, unknown>)[key] as Map<string, T> | undefined;
|
|
15
|
-
if (!map) {
|
|
16
|
-
map = new Map<string, T>();
|
|
17
|
-
(globalThis as Record<symbol, unknown>)[key] = map;
|
|
18
|
-
}
|
|
19
|
-
return map;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Create a named registry backed by `globalThis` + `Symbol.for`.
|
|
24
|
-
*
|
|
25
|
-
* The registry is lazily initialized on first access and shared across all
|
|
26
|
-
* jiti module instances via the global symbol namespace.
|
|
27
|
-
*
|
|
28
|
-
* @typeParam T - The value type stored in the registry.
|
|
29
|
-
* @param name - Unique registry name (used to construct the `Symbol.for` key).
|
|
30
|
-
* @returns An object with `register`, `unregister`, `getAll`, and `clear` functions.
|
|
31
|
-
*/
|
|
32
|
-
export function createRegistry<T>(name: string) {
|
|
33
|
-
const getMap = (): Map<string, T> => getGlobalRegistryMap<T>(name);
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
/**
|
|
37
|
-
* Register a value by id. Duplicate ids silently replace the previous registration.
|
|
38
|
-
*/
|
|
39
|
-
register: (id: string, value: T): void => {
|
|
40
|
-
getMap().set(id, value);
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Remove a registration by id. No-op if not registered.
|
|
45
|
-
*/
|
|
46
|
-
unregister: (id: string): void => {
|
|
47
|
-
getMap().delete(id);
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Get all registered values in registration order.
|
|
52
|
-
*/
|
|
53
|
-
getAll: (): T[] => {
|
|
54
|
-
return Array.from(getMap().values());
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Clear all entries from the registry (primarily for tests).
|
|
59
|
-
*/
|
|
60
|
-
clear: (): void => {
|
|
61
|
-
getMap().clear();
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Create a named session-state registry keyed by normalized cwd.
|
|
68
|
-
*
|
|
69
|
-
* This helper is intended for session-scoped runtime services that should be
|
|
70
|
-
* shared across duplicate jiti module instances while keeping package-specific
|
|
71
|
-
* state unions and convenience wrappers local to the calling package.
|
|
72
|
-
*/
|
|
73
|
-
export function createSessionStateRegistry<TState>(name: string) {
|
|
74
|
-
const getMap = (): Map<string, TState> => getGlobalRegistryMap<TState>(name);
|
|
75
|
-
const normalizeCwd = (cwd: string): string => path.resolve(cwd);
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
/** Get the current state for one session cwd. */
|
|
79
|
-
get: (cwd: string): TState | undefined => {
|
|
80
|
-
return getMap().get(normalizeCwd(cwd));
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
/** Store the current state for one session cwd. */
|
|
84
|
-
set: (cwd: string, state: TState): void => {
|
|
85
|
-
getMap().set(normalizeCwd(cwd), state);
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
/** Clear the current state for one session cwd. */
|
|
89
|
-
clear: (cwd: string): void => {
|
|
90
|
-
getMap().delete(normalizeCwd(cwd));
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { truncateToWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
3
|
-
|
|
4
|
-
/** Minimal theme surface required by the shared report helpers. */
|
|
5
|
-
export type ReportTheme = Pick<Theme, "fg">;
|
|
6
|
-
|
|
7
|
-
/** Color keys accepted by the report helpers. */
|
|
8
|
-
export type ReportColor = Parameters<Theme["fg"]>[0];
|
|
9
|
-
|
|
10
|
-
/** Options for rendering a themed key/value report row. */
|
|
11
|
-
export interface KeyValueLineOptions {
|
|
12
|
-
/** The label shown on the left. */
|
|
13
|
-
label: string;
|
|
14
|
-
/** The value shown on the right. */
|
|
15
|
-
value: string;
|
|
16
|
-
/** Theme used for color formatting. */
|
|
17
|
-
theme: ReportTheme;
|
|
18
|
-
/** Maximum rendered width. */
|
|
19
|
-
width: number;
|
|
20
|
-
/** Left indentation in spaces. */
|
|
21
|
-
indent?: number;
|
|
22
|
-
/** Theme color applied to the label. Defaults to `"text"`. */
|
|
23
|
-
labelColor?: ReportColor;
|
|
24
|
-
/** Theme color applied to the value. Defaults to `"dim"`. */
|
|
25
|
-
valueColor?: ReportColor;
|
|
26
|
-
/** Separator placed between label and value. Defaults to `": "`. */
|
|
27
|
-
separator?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** Options for rendering a preview-overflow hint. */
|
|
31
|
-
export interface OverflowHintOptions {
|
|
32
|
-
/** Optional follow-up hint such as `run /supi-context full`. */
|
|
33
|
-
hint?: string | null;
|
|
34
|
-
/** Left indentation in spaces. Defaults to `2`. */
|
|
35
|
-
indent?: number;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** Ensure a report width never drops below the minimum readable width. */
|
|
39
|
-
export function clampReportWidth(width: number, minWidth = 24): number {
|
|
40
|
-
return Math.max(minWidth, width);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** Render a top-level report title line with theme color and truncation. */
|
|
44
|
-
export function formatReportTitle(
|
|
45
|
-
title: string,
|
|
46
|
-
theme: ReportTheme,
|
|
47
|
-
width: number,
|
|
48
|
-
color: ReportColor = "accent",
|
|
49
|
-
): string {
|
|
50
|
-
return truncateToWidth(theme.fg(color, title), width);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Render a section header with optional dimmed metadata.
|
|
55
|
-
*
|
|
56
|
-
* Example: `Usage by category 42.3k tokens`
|
|
57
|
-
*/
|
|
58
|
-
export function formatSectionHeader(
|
|
59
|
-
title: string,
|
|
60
|
-
meta: string | null,
|
|
61
|
-
theme: ReportTheme,
|
|
62
|
-
width: number,
|
|
63
|
-
): string {
|
|
64
|
-
const left = theme.fg("text", title);
|
|
65
|
-
const content = meta ? `${left}${theme.fg("dim", ` ${meta}`)}` : left;
|
|
66
|
-
return truncateToWidth(content, width);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** Render a single dimmed report line with optional left indentation. */
|
|
70
|
-
export function formatDimLine(text: string, theme: ReportTheme, width: number, indent = 0): string {
|
|
71
|
-
const safeIndent = Math.max(0, indent);
|
|
72
|
-
return truncateToWidth(`${" ".repeat(safeIndent)}${theme.fg("dim", text)}`, width);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** Render a dimmed preview-overflow hint such as `… and 3 more — run /foo full`. */
|
|
76
|
-
export function formatOverflowHint(
|
|
77
|
-
hiddenCount: number,
|
|
78
|
-
theme: ReportTheme,
|
|
79
|
-
width: number,
|
|
80
|
-
options: OverflowHintOptions = {},
|
|
81
|
-
): string {
|
|
82
|
-
const { hint = null, indent = 2 } = options;
|
|
83
|
-
const suffix = hint ? ` — ${hint}` : "";
|
|
84
|
-
return formatDimLine(`… and ${hiddenCount} more${suffix}`, theme, width, indent);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/** Render a single themed `label: value` row with truncation. */
|
|
88
|
-
export function formatKeyValueLine(options: KeyValueLineOptions): string {
|
|
89
|
-
const {
|
|
90
|
-
label,
|
|
91
|
-
value,
|
|
92
|
-
theme,
|
|
93
|
-
width,
|
|
94
|
-
indent = 2,
|
|
95
|
-
labelColor = "text",
|
|
96
|
-
valueColor = "dim",
|
|
97
|
-
separator = ": ",
|
|
98
|
-
} = options;
|
|
99
|
-
const safeIndent = Math.max(0, indent);
|
|
100
|
-
|
|
101
|
-
return truncateToWidth(
|
|
102
|
-
`${" ".repeat(safeIndent)}${theme.fg(labelColor, label)}${separator}${theme.fg(valueColor, value)}`,
|
|
103
|
-
width,
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Wrap a report text block to the available width and optionally prefix each line.
|
|
109
|
-
*
|
|
110
|
-
* This is useful for wrapped bullets or explanatory notes that should align
|
|
111
|
-
* under an existing report indent.
|
|
112
|
-
*/
|
|
113
|
-
export function wrapReportText(
|
|
114
|
-
text: string,
|
|
115
|
-
width: number,
|
|
116
|
-
options: { indent?: string } = {},
|
|
117
|
-
): string[] {
|
|
118
|
-
const indent = options.indent ?? "";
|
|
119
|
-
const wrapped = wrapTextWithAnsi(text, Math.max(1, width - indent.length));
|
|
120
|
-
return indent ? wrapped.map((line) => `${indent}${line}`) : wrapped;
|
|
121
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// Generic session-file tree-walking utilities.
|
|
2
|
-
|
|
3
|
-
import type { FileEntry, SessionEntry } from "@earendil-works/pi-coding-agent";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Minimal pi API surface needed to track the current session display name reactively.
|
|
7
|
-
* Accept `ExtensionAPI` or any object satisfying this shape.
|
|
8
|
-
*/
|
|
9
|
-
export interface SessionNameTrackerHost {
|
|
10
|
-
on(event: string, handler: (...args: unknown[]) => unknown): void;
|
|
11
|
-
getSessionName(): string | undefined;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Create a reactive session-name tracker that stays consistent across
|
|
16
|
-
* session starts, renames, and shutdowns without polling.
|
|
17
|
-
*
|
|
18
|
-
* Subscribes to `session_start` (initial name), `session_info_changed`
|
|
19
|
-
* (renames via `/name`, `pi.setSessionName()`, or RPC), and
|
|
20
|
-
* `session_shutdown` (reset to `undefined`).
|
|
21
|
-
*
|
|
22
|
-
* @returns a zero-arg getter that always returns the current session name
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```ts
|
|
26
|
-
* const getSessionName = createSessionNameTracker(pi);
|
|
27
|
-
* // …later, during tool execute or spinner rendering:
|
|
28
|
-
* const name = getSessionName();
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export function createSessionNameTracker(pi: SessionNameTrackerHost): () => string | undefined {
|
|
32
|
-
let name: string | undefined;
|
|
33
|
-
|
|
34
|
-
pi.on("session_start", () => {
|
|
35
|
-
name = pi.getSessionName();
|
|
36
|
-
});
|
|
37
|
-
pi.on("session_info_changed", (event) => {
|
|
38
|
-
name = (event as { name?: string }).name;
|
|
39
|
-
});
|
|
40
|
-
pi.on("session_shutdown", () => {
|
|
41
|
-
name = undefined;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
return () => name;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Resolve the active branch path using PI's append-only tree semantics.
|
|
49
|
-
*
|
|
50
|
-
* The active branch is the path from the **last entry** (current leaf)
|
|
51
|
-
* back to the root via `parentId`. This follows PI's tree structure where
|
|
52
|
-
* entries are append-only and the last entry in the file is always the
|
|
53
|
-
* current leaf of the active branch.
|
|
54
|
-
*/
|
|
55
|
-
export function getActiveBranchEntries(entries: FileEntry[]): SessionEntry[] {
|
|
56
|
-
const sessionEntries = entries.filter((e): e is SessionEntry => e.type !== "session");
|
|
57
|
-
const byId = new Map(sessionEntries.map((entry) => [entry.id, entry]));
|
|
58
|
-
const leaf = sessionEntries.at(-1);
|
|
59
|
-
if (!leaf) return [];
|
|
60
|
-
|
|
61
|
-
const path: SessionEntry[] = [];
|
|
62
|
-
const visited = new Set<string>();
|
|
63
|
-
let current: SessionEntry | undefined = leaf;
|
|
64
|
-
while (current) {
|
|
65
|
-
if (visited.has(current.id)) break;
|
|
66
|
-
visited.add(current.id);
|
|
67
|
-
path.unshift(current);
|
|
68
|
-
current = current.parentId ? byId.get(current.parentId) : undefined;
|
|
69
|
-
}
|
|
70
|
-
return path;
|
|
71
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// supi-core session domain — session utilities and registries.
|
|
2
|
-
|
|
3
|
-
export { createRegistry, createSessionStateRegistry } from "./registry-utils.ts";
|
|
4
|
-
export type { SessionNameTrackerHost } from "./session-utils.ts";
|
|
5
|
-
export {
|
|
6
|
-
createSessionNameTracker,
|
|
7
|
-
getActiveBranchEntries,
|
|
8
|
-
} from "./session-utils.ts";
|