@mrclrchtr/supi-code-intelligence 1.8.0 → 1.9.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/README.md +17 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/README.md +13 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +97 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +53 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +30 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +76 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +186 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +119 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +36 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +31 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +30 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +40 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +86 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +15 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +41 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +226 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +116 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +40 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +35 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +68 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +31 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +110 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +41 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +170 -0
- package/node_modules/@mrclrchtr/supi-core/README.md +3 -13
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -7
- package/node_modules/@mrclrchtr/supi-lsp/README.md +20 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/README.md +13 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +97 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +57 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +30 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +76 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +186 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +119 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +36 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +31 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +30 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +40 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +86 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +15 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +41 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +226 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +116 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +40 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +35 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +68 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +31 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +110 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +41 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +170 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/README.md +3 -13
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -7
- package/node_modules/@mrclrchtr/supi-lsp/package.json +9 -6
- package/node_modules/@mrclrchtr/supi-lsp/src/handlers/session-lifecycle.ts +17 -7
- package/node_modules/@mrclrchtr/supi-lsp/src/lsp.ts +3 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/capability-index.ts +24 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/client-pool.ts +33 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/diagnostic-store.ts +51 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/recovery-coordinator.ts +37 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-router.ts +44 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +156 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registration.ts +39 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/tool/register-tools.ts +0 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +18 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/README.md +13 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +97 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +57 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +30 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +76 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +186 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +119 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +36 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +31 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +30 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +40 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +86 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +15 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +41 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +226 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +116 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +40 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +35 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +68 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +31 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +110 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +41 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +170 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/README.md +3 -13
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +9 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/provider/tree-sitter-provider.ts +144 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/runtime-registration.ts +37 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tree-sitter.ts +18 -8
- package/package.json +8 -6
- package/src/api.ts +31 -16
- package/src/brief-focused.ts +2 -2
- package/src/brief.ts +2 -2
- package/src/code-intelligence.ts +13 -1
- package/src/index.ts +29 -16
- package/src/{architecture.ts → model.ts} +20 -61
- package/src/presentation/markdown/brief.ts +2 -2
- package/src/substrates/types.ts +22 -105
- package/src/targeting/resolve-file.ts +4 -7
- package/src/tool/execute-affected.ts +25 -1
- package/src/tool/execute-brief.ts +5 -4
- package/src/tool/execute-pattern.ts +4 -3
- package/src/tool/execute-relations.ts +22 -1
- package/src/types.ts +101 -3
- package/src/use-case/build-overview.ts +1 -1
- package/src/use-case/generate-affected.ts +25 -7
- package/src/use-case/generate-brief.ts +31 -14
- package/src/use-case/generate-pattern.ts +9 -9
- package/src/use-case/generate-relations.ts +66 -20
- package/src/use-case/types.ts +3 -3
- package/src/workspace/request-context.ts +139 -0
- package/node_modules/@mrclrchtr/supi-core/src/extension.ts +0 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/extension.ts +0 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/extension.ts +0 -1
- package/src/substrates/lsp-adapter.ts +0 -197
- package/src/substrates/tree-sitter-adapter.ts +0 -173
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// /supi-settings command registration.
|
|
2
|
+
//
|
|
3
|
+
// Thin wrapper that registers the command and delegates to openSettingsOverlay.
|
|
4
|
+
|
|
5
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
import { openSettingsOverlay } from "./settings-ui.ts";
|
|
7
|
+
|
|
8
|
+
export function registerSettingsCommand(pi: ExtensionAPI): void {
|
|
9
|
+
pi.registerCommand("supi-settings", {
|
|
10
|
+
description: "Manage SuPi extension settings",
|
|
11
|
+
handler: async (_args, ctx) => {
|
|
12
|
+
openSettingsOverlay(ctx);
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Settings registry for SuPi extensions.
|
|
2
|
+
//
|
|
3
|
+
// Extensions declare their settings via `registerSettings()` during their
|
|
4
|
+
// factory function. The generic settings UI reads them via `getRegisteredSettings()`.
|
|
5
|
+
|
|
6
|
+
import type { SettingItem } from "@earendil-works/pi-tui";
|
|
7
|
+
import { createRegistry } from "../registry-utils.ts";
|
|
8
|
+
|
|
9
|
+
export type SettingsScope = "project" | "global";
|
|
10
|
+
|
|
11
|
+
export interface SettingsSection {
|
|
12
|
+
/** Extension identifier — e.g. "lsp", "claude-md" */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Human-readable label shown in the UI */
|
|
15
|
+
label: string;
|
|
16
|
+
/** Load current SettingItem[] for the given scope */
|
|
17
|
+
loadValues: (scope: SettingsScope, cwd: string) => SettingItem[];
|
|
18
|
+
/** Persist a change back to config */
|
|
19
|
+
persistChange: (scope: SettingsScope, cwd: string, settingId: string, value: string) => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const registry = createRegistry<SettingsSection>("settings-registry");
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Register a settings section for an extension.
|
|
26
|
+
* Call during the extension factory function (not async handlers).
|
|
27
|
+
* Duplicate ids replace the previous registration.
|
|
28
|
+
*/
|
|
29
|
+
export function registerSettings(section: SettingsSection): void {
|
|
30
|
+
registry.register(section.id, section);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Get all registered settings sections in registration order. */
|
|
34
|
+
export function getRegisteredSettings(): SettingsSection[] {
|
|
35
|
+
return registry.getAll();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Clear the registry — used by tests. */
|
|
39
|
+
export function clearRegisteredSettings(): void {
|
|
40
|
+
registry.clear();
|
|
41
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
// Generic settings overlay for SuPi extensions.
|
|
2
|
+
//
|
|
3
|
+
// Uses pi-tui's SettingsList with scope toggle (Tab), extension grouping,
|
|
4
|
+
// and search. Each extension declares its settings via registerSettings().
|
|
5
|
+
|
|
6
|
+
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
7
|
+
import { getSettingsListTheme } from "@earendil-works/pi-coding-agent";
|
|
8
|
+
import {
|
|
9
|
+
Container,
|
|
10
|
+
Input,
|
|
11
|
+
Key,
|
|
12
|
+
matchesKey,
|
|
13
|
+
type SettingItem,
|
|
14
|
+
SettingsList,
|
|
15
|
+
Text,
|
|
16
|
+
} from "@earendil-works/pi-tui";
|
|
17
|
+
import {
|
|
18
|
+
getRegisteredSettings,
|
|
19
|
+
type SettingsScope,
|
|
20
|
+
type SettingsSection,
|
|
21
|
+
} from "./settings-registry.ts";
|
|
22
|
+
|
|
23
|
+
// ── Input submenu component ──────────────────────────────────
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Creates a pi-tui Input-backed submenu component with enter-to-confirm
|
|
27
|
+
* and escape-to-cancel handling.
|
|
28
|
+
*
|
|
29
|
+
* @param currentValue - Initial value for the text input.
|
|
30
|
+
* @param label - Label text displayed above the input.
|
|
31
|
+
* @param done - Callback invoked with the confirmed value, or undefined on cancel.
|
|
32
|
+
*/
|
|
33
|
+
export function createInputSubmenu(
|
|
34
|
+
currentValue: string,
|
|
35
|
+
label: string,
|
|
36
|
+
done: (selectedValue?: string) => void,
|
|
37
|
+
): {
|
|
38
|
+
render: (width: number) => string[];
|
|
39
|
+
invalidate: () => void;
|
|
40
|
+
handleInput: (data: string) => boolean;
|
|
41
|
+
} {
|
|
42
|
+
const input = new Input();
|
|
43
|
+
input.setValue(currentValue);
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
render: (_width: number) => {
|
|
47
|
+
const lines = [` ${label}`];
|
|
48
|
+
lines.push(...input.render(_width));
|
|
49
|
+
lines.push(" enter confirm • esc cancel");
|
|
50
|
+
return lines;
|
|
51
|
+
},
|
|
52
|
+
invalidate: () => {
|
|
53
|
+
input.invalidate();
|
|
54
|
+
},
|
|
55
|
+
handleInput: (data: string) => {
|
|
56
|
+
if (matchesKey(data, Key.escape)) {
|
|
57
|
+
done();
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
if (matchesKey(data, Key.enter)) {
|
|
61
|
+
done(input.getValue());
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
input.handleInput(data);
|
|
65
|
+
return true;
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ── Types ────────────────────────────────────────────────────
|
|
71
|
+
|
|
72
|
+
interface OverlayState {
|
|
73
|
+
scope: SettingsScope;
|
|
74
|
+
cwd: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// ── Pure helpers ─────────────────────────────────────────────
|
|
78
|
+
|
|
79
|
+
function getScopeLabel(scope: SettingsScope): string {
|
|
80
|
+
return scope === "project" ? "Project" : "Global";
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function buildFlatItems(
|
|
84
|
+
sections: SettingsSection[],
|
|
85
|
+
scope: SettingsScope,
|
|
86
|
+
cwd: string,
|
|
87
|
+
): SettingItem[] {
|
|
88
|
+
const items: SettingItem[] = [];
|
|
89
|
+
for (const section of sections) {
|
|
90
|
+
const sectionItems = section.loadValues(scope, cwd);
|
|
91
|
+
for (const item of sectionItems) {
|
|
92
|
+
items.push({
|
|
93
|
+
...item,
|
|
94
|
+
id: `${section.id}.${item.id}`,
|
|
95
|
+
label: `${section.label}: ${item.label}`,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return items;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function findSectionAndId(
|
|
103
|
+
sections: SettingsSection[],
|
|
104
|
+
flatId: string,
|
|
105
|
+
): { section: SettingsSection; itemId: string } | null {
|
|
106
|
+
const dotIndex = flatId.indexOf(".");
|
|
107
|
+
if (dotIndex === -1) return null;
|
|
108
|
+
const sectionId = flatId.slice(0, dotIndex);
|
|
109
|
+
const itemId = flatId.slice(dotIndex + 1);
|
|
110
|
+
const section = sections.find((s) => s.id === sectionId);
|
|
111
|
+
if (!section) return null;
|
|
112
|
+
return { section, itemId };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// ── Component ────────────────────────────────────────────────
|
|
116
|
+
|
|
117
|
+
interface SettingsOverlayDeps {
|
|
118
|
+
state: OverlayState;
|
|
119
|
+
container: Container;
|
|
120
|
+
settingsList: SettingsList | null;
|
|
121
|
+
tui: Parameters<Parameters<ExtensionContext["ui"]["custom"]>[0]>[0];
|
|
122
|
+
theme: Parameters<Parameters<ExtensionContext["ui"]["custom"]>[0]>[1];
|
|
123
|
+
done: () => void;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function createSettingsList(deps: SettingsOverlayDeps): SettingsList {
|
|
127
|
+
const sections = getRegisteredSettings();
|
|
128
|
+
const items = buildFlatItems(sections, deps.state.scope, deps.state.cwd);
|
|
129
|
+
const onChange = (flatId: string, newValue: string) => {
|
|
130
|
+
const found = findSectionAndId(sections, flatId);
|
|
131
|
+
if (found) {
|
|
132
|
+
found.section.persistChange(deps.state.scope, deps.state.cwd, found.itemId, newValue);
|
|
133
|
+
}
|
|
134
|
+
// Re-read all values to reflect persisted changes, but keep the list
|
|
135
|
+
// instance (and its selectedIndex) intact.
|
|
136
|
+
const updatedItems = buildFlatItems(sections, deps.state.scope, deps.state.cwd);
|
|
137
|
+
for (const updated of updatedItems) {
|
|
138
|
+
const existing = items.find((i) => i.id === updated.id);
|
|
139
|
+
if (existing && existing.currentValue !== updated.currentValue) {
|
|
140
|
+
settingsList.updateValue(updated.id, updated.currentValue);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
deps.tui.requestRender();
|
|
144
|
+
};
|
|
145
|
+
const settingsList = new SettingsList(
|
|
146
|
+
items,
|
|
147
|
+
Math.min(items.length + 4, 20),
|
|
148
|
+
getSettingsListTheme(),
|
|
149
|
+
onChange,
|
|
150
|
+
() => deps.done(),
|
|
151
|
+
{ enableSearch: true },
|
|
152
|
+
);
|
|
153
|
+
return settingsList;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function rebuildSettingsList(deps: SettingsOverlayDeps): SettingsList {
|
|
157
|
+
const settingsList = createSettingsList(deps);
|
|
158
|
+
deps.settingsList = settingsList;
|
|
159
|
+
|
|
160
|
+
deps.container.clear();
|
|
161
|
+
deps.container.addChild(createHeaderComponent(deps));
|
|
162
|
+
deps.container.addChild(settingsList);
|
|
163
|
+
|
|
164
|
+
return settingsList;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function createHeaderComponent(deps: SettingsOverlayDeps): Text {
|
|
168
|
+
const { theme, state } = deps;
|
|
169
|
+
const scopeLabel = getScopeLabel(state.scope);
|
|
170
|
+
const otherScope = state.scope === "project" ? "Global" : "Project";
|
|
171
|
+
const headerText = new Text(
|
|
172
|
+
`${theme.fg("accent", theme.bold("SuPi Settings"))} ${theme.fg("text", `Scope: ${scopeLabel}`)} ${theme.fg("dim", `(tab → ${otherScope})`)}`,
|
|
173
|
+
0,
|
|
174
|
+
0,
|
|
175
|
+
);
|
|
176
|
+
return headerText;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function handleScopeToggle(deps: SettingsOverlayDeps): void {
|
|
180
|
+
deps.state.scope = deps.state.scope === "project" ? "global" : "project";
|
|
181
|
+
rebuildSettingsList(deps);
|
|
182
|
+
deps.tui.requestRender();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// ── Entry point ──────────────────────────────────────────────
|
|
186
|
+
|
|
187
|
+
export function openSettingsOverlay(ctx: ExtensionContext): void {
|
|
188
|
+
const sections = getRegisteredSettings();
|
|
189
|
+
if (sections.length === 0) {
|
|
190
|
+
ctx.ui.notify("No settings registered by SuPi extensions", "info");
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
void ctx.ui.custom<void>((tui, theme, _kb, done) => {
|
|
195
|
+
const state: OverlayState = { scope: "project", cwd: ctx.cwd };
|
|
196
|
+
const container = new Container();
|
|
197
|
+
|
|
198
|
+
const deps: SettingsOverlayDeps = {
|
|
199
|
+
state,
|
|
200
|
+
container,
|
|
201
|
+
settingsList: null,
|
|
202
|
+
tui,
|
|
203
|
+
theme,
|
|
204
|
+
done,
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
rebuildSettingsList(deps);
|
|
208
|
+
|
|
209
|
+
const component = {
|
|
210
|
+
render: (width: number) => container.render(width),
|
|
211
|
+
invalidate: () => container.invalidate(),
|
|
212
|
+
handleInput: (data: string) => {
|
|
213
|
+
if (matchesKey(data, Key.tab)) {
|
|
214
|
+
handleScopeToggle(deps);
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
// Delegate input to the settings list (always set after rebuildSettingsList)
|
|
218
|
+
deps.settingsList?.handleInput?.(data);
|
|
219
|
+
deps.tui.requestRender();
|
|
220
|
+
return true;
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
return component;
|
|
225
|
+
});
|
|
226
|
+
}
|
package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// supi-core settings domain — settings registry (lightweight, type-only pi-tui import).
|
|
2
|
+
|
|
3
|
+
export { registerSettingsCommand } from "./settings/settings-command.ts";
|
|
4
|
+
export type { SettingsScope, SettingsSection } from "./settings/settings-registry.ts";
|
|
5
|
+
export {
|
|
6
|
+
clearRegisteredSettings,
|
|
7
|
+
getRegisteredSettings,
|
|
8
|
+
registerSettings,
|
|
9
|
+
} from "./settings/settings-registry.ts";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** 0-based position used by LSP and code-intelligence internally. */
|
|
2
|
+
export interface CodePosition {
|
|
3
|
+
line: number;
|
|
4
|
+
character: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** Normalized location — flat replacement for LSP's nested Location/range shape. */
|
|
8
|
+
export interface CodeLocation {
|
|
9
|
+
uri: string;
|
|
10
|
+
range: { start: CodePosition; end: CodePosition };
|
|
11
|
+
}
|
package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared terminal title formatting and signaling utilities.
|
|
3
|
+
*
|
|
4
|
+
* Centralized place for pi title convention (π prefix), completion (✓)
|
|
5
|
+
* and waiting (●) indicators, and the audible terminal bell.
|
|
6
|
+
*/
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
|
|
9
|
+
/** Unicode checkmark shown when the agent finishes a turn. */
|
|
10
|
+
export const DONE_SYMBOL = "\u2713";
|
|
11
|
+
/** Unicode dot shown when waiting for user input. */
|
|
12
|
+
export const WAITING_SYMBOL = "\u25CF";
|
|
13
|
+
|
|
14
|
+
/** Minimal UI surface needed for title operations. */
|
|
15
|
+
export interface TitleTarget {
|
|
16
|
+
ui: {
|
|
17
|
+
setTitle?(title: string): void;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Format pi's canonical terminal title from session name and cwd.
|
|
23
|
+
* Falls back gracefully when either is missing.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* formatTitle("my-session", "/home/projects/foo") // "π - my-session - foo"
|
|
27
|
+
* formatTitle(undefined, "/home/projects/foo") // "π - foo"
|
|
28
|
+
* formatTitle("my-session") // "π - my-session"
|
|
29
|
+
* formatTitle() // "π"
|
|
30
|
+
*/
|
|
31
|
+
export function formatTitle(sessionName?: string, cwd?: string): string {
|
|
32
|
+
const base = cwd ? path.basename(cwd) : undefined;
|
|
33
|
+
if (sessionName && base) return `π - ${sessionName} - ${base}`;
|
|
34
|
+
if (sessionName) return `π - ${sessionName}`;
|
|
35
|
+
if (base) return `π - ${base}`;
|
|
36
|
+
return "π";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Sound the audible terminal bell (ASCII BEL). */
|
|
40
|
+
export function signalBell(): void {
|
|
41
|
+
process.stdout.write("\x07");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Set the terminal title to indicate the agent is waiting for user input.
|
|
46
|
+
* Prefixes with ● and sounds the terminal bell.
|
|
47
|
+
*/
|
|
48
|
+
export function signalWaiting(ctx: TitleTarget, title: string): void {
|
|
49
|
+
ctx.ui.setTitle?.(`${WAITING_SYMBOL} ${title}`);
|
|
50
|
+
signalBell();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Set the terminal title to indicate the agent turn has completed.
|
|
55
|
+
* Prefixes with ✓ and sounds the terminal bell.
|
|
56
|
+
*/
|
|
57
|
+
export function signalDone(ctx: TitleTarget, title: string): void {
|
|
58
|
+
ctx.ui.setTitle?.(`${DONE_SYMBOL} ${title}`);
|
|
59
|
+
signalBell();
|
|
60
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Shared tool framework for SuPi extensions.
|
|
2
|
+
//
|
|
3
|
+
// Provides a standard ToolSpec→PromptSurface→registerTool pipeline so
|
|
4
|
+
// individual packages do not duplicate spec interfaces, guidance derivation,
|
|
5
|
+
// registration loops, or common TypeBox parameter schemas.
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
AgentToolResult,
|
|
9
|
+
AgentToolUpdateCallback,
|
|
10
|
+
ExtensionAPI,
|
|
11
|
+
ExtensionContext,
|
|
12
|
+
} from "@earendil-works/pi-coding-agent";
|
|
13
|
+
import { type TSchema, Type } from "typebox";
|
|
14
|
+
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Types
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
|
|
19
|
+
/** Minimum contract for a SuPi tool definition. */
|
|
20
|
+
export interface SuiPiToolSpec {
|
|
21
|
+
name: string;
|
|
22
|
+
label: string;
|
|
23
|
+
description: string;
|
|
24
|
+
promptSnippet: string;
|
|
25
|
+
promptGuidelines: string[];
|
|
26
|
+
parameters: TSchema;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Derived prompt surface — what pi flattens into the system prompt. */
|
|
30
|
+
export interface SuiPiToolPromptSurface {
|
|
31
|
+
description: string;
|
|
32
|
+
promptSnippet: string;
|
|
33
|
+
promptGuidelines: string[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
// Guidance derivation
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Static derivation: copies spec fields into a prompt surface.
|
|
42
|
+
*
|
|
43
|
+
* Packages that need dynamic guidance (e.g. server-coverage injection) should
|
|
44
|
+
* build their own surfaces, optionally starting from the output of this helper.
|
|
45
|
+
*/
|
|
46
|
+
export function derivePromptSurface(spec: SuiPiToolSpec): SuiPiToolPromptSurface {
|
|
47
|
+
return {
|
|
48
|
+
description: spec.description,
|
|
49
|
+
promptSnippet: spec.promptSnippet,
|
|
50
|
+
promptGuidelines: [...spec.promptGuidelines],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
// Registration
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
|
|
58
|
+
// biome-ignore lint/complexity/useMaxParams: matches pi ToolDefinition.execute signature
|
|
59
|
+
export type ToolExecuteFn = (
|
|
60
|
+
toolCallId: string,
|
|
61
|
+
params: unknown,
|
|
62
|
+
signal: AbortSignal | undefined,
|
|
63
|
+
onUpdate: AgentToolUpdateCallback<Record<string, unknown>> | undefined,
|
|
64
|
+
ctx: ExtensionContext,
|
|
65
|
+
) => Promise<AgentToolResult<Record<string, unknown>>>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Register a set of tools from specs + pre-derived surfaces.
|
|
69
|
+
*
|
|
70
|
+
* `createExecute` receives the spec and returns a pi-compatible execute
|
|
71
|
+
* function. This keeps execute-logic package-local while the framework owns
|
|
72
|
+
* the declarative surface and registration boilerplate.
|
|
73
|
+
*/
|
|
74
|
+
export function registerSuiPiTools(
|
|
75
|
+
pi: ExtensionAPI,
|
|
76
|
+
specs: readonly SuiPiToolSpec[],
|
|
77
|
+
surfaces: Record<string, SuiPiToolPromptSurface>,
|
|
78
|
+
createExecute: (spec: SuiPiToolSpec) => ToolExecuteFn,
|
|
79
|
+
): void {
|
|
80
|
+
for (const spec of specs) {
|
|
81
|
+
const surface = surfaces[spec.name];
|
|
82
|
+
pi.registerTool({
|
|
83
|
+
name: spec.name,
|
|
84
|
+
label: spec.label,
|
|
85
|
+
description: surface?.description ?? spec.description,
|
|
86
|
+
promptSnippet: surface?.promptSnippet ?? spec.promptSnippet,
|
|
87
|
+
promptGuidelines: surface?.promptGuidelines ?? [...spec.promptGuidelines],
|
|
88
|
+
parameters: spec.parameters,
|
|
89
|
+
execute: createExecute(spec),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
// Shared parameter builders
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
|
|
98
|
+
/** File path (relative or absolute). */
|
|
99
|
+
export const FileParam = Type.String({ description: "File path (relative or absolute)" });
|
|
100
|
+
|
|
101
|
+
/** 1-based line number. */
|
|
102
|
+
export const LineParam = Type.Number({ description: "1-based line number", minimum: 1 });
|
|
103
|
+
|
|
104
|
+
/** 1-based character column (UTF-16). */
|
|
105
|
+
export const CharacterParam = Type.Number({
|
|
106
|
+
description: "1-based column number (UTF-16)",
|
|
107
|
+
minimum: 1,
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
/** Symbol name for discovery-based resolution. */
|
|
111
|
+
export const SymbolParam = Type.String({
|
|
112
|
+
description: "Symbol name for discovery-based resolution",
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
/** Maximum results to return. */
|
|
116
|
+
export const MaxResultsParam = Type.Number({ description: "Maximum results to return" });
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mrclrchtr/supi-code-runtime",
|
|
3
|
+
"version": "1.9.0",
|
|
4
|
+
"description": "SuPi code-runtime — shared workspace context, capability contracts, and canonical types for the code-understanding stack",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/mrclrchtr/supi.git"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"pi",
|
|
15
|
+
"pi-coding-agent"
|
|
16
|
+
],
|
|
17
|
+
"files": [
|
|
18
|
+
"src/**/*.ts",
|
|
19
|
+
"!__tests__"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@mrclrchtr/supi-core": "1.9.0"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
26
|
+
},
|
|
27
|
+
"peerDependenciesMeta": {
|
|
28
|
+
"@earendil-works/pi-coding-agent": {
|
|
29
|
+
"optional": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"bundledDependencies": [
|
|
33
|
+
"@mrclrchtr/supi-core"
|
|
34
|
+
],
|
|
35
|
+
"main": "src/api.ts",
|
|
36
|
+
"exports": {
|
|
37
|
+
"./api": "./src/api.ts",
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API surface for @mrclrchtr/supi-code-runtime.
|
|
3
|
+
*
|
|
4
|
+
* This package exports shared canonical types, capability interfaces,
|
|
5
|
+
* workspace runtime primitives, and typed request context helpers.
|
|
6
|
+
* It is a library-only package with no pi extension entrypoint.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Capability interfaces and availability states
|
|
10
|
+
export type {
|
|
11
|
+
CapabilityState,
|
|
12
|
+
SemanticProvider,
|
|
13
|
+
StructuralProvider,
|
|
14
|
+
StructuralResult,
|
|
15
|
+
} from "./capability/types.ts";
|
|
16
|
+
// Shared canonical types
|
|
17
|
+
export type {
|
|
18
|
+
CalleesData,
|
|
19
|
+
CodeLocation,
|
|
20
|
+
CodePosition,
|
|
21
|
+
CodeResult,
|
|
22
|
+
CodeSymbol,
|
|
23
|
+
ConfidenceMode,
|
|
24
|
+
ExportData,
|
|
25
|
+
ImportData,
|
|
26
|
+
NodeAtData,
|
|
27
|
+
OutlineData,
|
|
28
|
+
SourceRange,
|
|
29
|
+
} from "./types.ts";
|
|
30
|
+
export type { WorkspaceContext } from "./workspace/context.ts";
|
|
31
|
+
// Workspace context
|
|
32
|
+
export { createWorkspaceContext } from "./workspace/context.ts";
|
|
33
|
+
export type { WorkspaceCapabilities } from "./workspace/runtime.ts";
|
|
34
|
+
// Workspace runtime
|
|
35
|
+
export { getDefaultWorkspaceRuntime, WorkspaceRuntime } from "./workspace/runtime.ts";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability interfaces and availability states for the code-understanding
|
|
3
|
+
* stack. These define the contracts through which substrates (LSP,
|
|
4
|
+
* tree-sitter) advertise what they can do.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
CalleesData,
|
|
9
|
+
CodeLocation,
|
|
10
|
+
CodePosition,
|
|
11
|
+
CodeResult,
|
|
12
|
+
CodeSymbol,
|
|
13
|
+
ExportData,
|
|
14
|
+
ImportData,
|
|
15
|
+
NodeAtData,
|
|
16
|
+
OutlineData,
|
|
17
|
+
} from "../types.ts";
|
|
18
|
+
|
|
19
|
+
// ── Availability state ─────────────────────────────────────────────────
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Availability state for a capability within a workspace.
|
|
23
|
+
*
|
|
24
|
+
* - `pending`: the capability may become ready soon (e.g., server starting)
|
|
25
|
+
* - `ready`: the capability is active and can be used
|
|
26
|
+
* - `inactive`: the capability exists but is intentionally turned off
|
|
27
|
+
* - `disabled`: the capability is unavailable for workspace-specific reasons
|
|
28
|
+
* - `unavailable`: the capability cannot be provided at all
|
|
29
|
+
*/
|
|
30
|
+
export type CapabilityState =
|
|
31
|
+
| { kind: "pending" }
|
|
32
|
+
| { kind: "ready" }
|
|
33
|
+
| { kind: "inactive" }
|
|
34
|
+
| { kind: "disabled" }
|
|
35
|
+
| { kind: "unavailable"; reason: string };
|
|
36
|
+
|
|
37
|
+
// ── Provider interfaces ────────────────────────────────────────────────
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Semantic analysis capability backed by a language server (LSP).
|
|
41
|
+
*
|
|
42
|
+
* Methods return `null` to signal absence (unavailable / inactive) and
|
|
43
|
+
* an array to signal a successful query (possibly empty).
|
|
44
|
+
*/
|
|
45
|
+
export interface SemanticProvider {
|
|
46
|
+
references(filePath: string, position: CodePosition): Promise<CodeLocation[] | null>;
|
|
47
|
+
implementation(filePath: string, position: CodePosition): Promise<CodeLocation[] | null>;
|
|
48
|
+
documentSymbols(filePath: string): Promise<CodeSymbol[] | null>;
|
|
49
|
+
workspaceSymbols(query: string): Promise<CodeSymbol[] | null>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Structural analysis capability backed by a parser (tree-sitter).
|
|
54
|
+
*
|
|
55
|
+
* Methods return a discriminated `CodeResult` union that explicitly encodes
|
|
56
|
+
* success, unsupported-language, file-access error, validation error,
|
|
57
|
+
* and runtime error states.
|
|
58
|
+
*/
|
|
59
|
+
export interface StructuralProvider {
|
|
60
|
+
calleesAt(file: string, line: number, character: number): Promise<CodeResult<CalleesData>>;
|
|
61
|
+
exports(file: string): Promise<CodeResult<ExportData[]>>;
|
|
62
|
+
outline(file: string): Promise<CodeResult<OutlineData[]>>;
|
|
63
|
+
imports(file: string): Promise<CodeResult<ImportData[]>>;
|
|
64
|
+
nodeAt(file: string, line: number, character: number): Promise<CodeResult<NodeAtData>>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Convenience alias for `CodeResult` used in structural contexts. */
|
|
68
|
+
export type StructuralResult<T> = CodeResult<T>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package-root re-export surface for @mrclrchtr/supi-code-runtime.
|
|
3
|
+
*
|
|
4
|
+
* Prefer importing from `@mrclrchtr/supi-code-runtime/api` for explicit
|
|
5
|
+
* access to the shared contracts and workspace primitives.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type {
|
|
9
|
+
CalleesData,
|
|
10
|
+
CapabilityState,
|
|
11
|
+
CodeLocation,
|
|
12
|
+
CodePosition,
|
|
13
|
+
CodeResult,
|
|
14
|
+
CodeSymbol,
|
|
15
|
+
ConfidenceMode,
|
|
16
|
+
ExportData,
|
|
17
|
+
ImportData,
|
|
18
|
+
NodeAtData,
|
|
19
|
+
OutlineData,
|
|
20
|
+
SemanticProvider,
|
|
21
|
+
SourceRange,
|
|
22
|
+
StructuralProvider,
|
|
23
|
+
StructuralResult,
|
|
24
|
+
WorkspaceCapabilities,
|
|
25
|
+
WorkspaceContext,
|
|
26
|
+
} from "./api.ts";
|
|
27
|
+
export {
|
|
28
|
+
createWorkspaceContext,
|
|
29
|
+
getDefaultWorkspaceRuntime,
|
|
30
|
+
WorkspaceRuntime,
|
|
31
|
+
} from "./api.ts";
|