@nudojs/lsp 0.7.1 → 0.8.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/dist/public-api.d.ts +44 -0
- package/dist/public-api.js +89 -0
- package/dist/server.js +6516 -850
- package/package.json +8 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Freeze inventory for `@nudojs/lsp` public surface (A1/A7).
|
|
3
|
+
*
|
|
4
|
+
* Pure constants — importable without starting the language server
|
|
5
|
+
* (`server.ts` has side effects on import). Human-readable inventory:
|
|
6
|
+
* `packages/lsp/PUBLIC_API.md`.
|
|
7
|
+
*
|
|
8
|
+
* Protocol contract:
|
|
9
|
+
* - executeCommand uses **dot** form: `nudo.check`
|
|
10
|
+
* - custom requests use **slash** form: `nudo/check` (canonical protocol)
|
|
11
|
+
* - every slash-form agent request has a matching executeCommand name
|
|
12
|
+
*/
|
|
13
|
+
/** workspace/executeCommand names (dot form) — declared on initialize */
|
|
14
|
+
declare const NUDO_EXECUTE_COMMANDS: readonly ["nudo.whatIf", "nudo.suggestCase", "nudo.trace", "nudo.check", "nudo.hover", "nudo.infer", "nudo.interface", "nudo.interface.draft", "nudo.interfaceDraft", "nudo.interfaceEmit", "nudo.interface.emit", "nudo.selectCase", "nudo.getActiveCases"];
|
|
15
|
+
/**
|
|
16
|
+
* Custom LSP request method names (slash form) — the protocol contract.
|
|
17
|
+
* Agent tools also register the dot-form method as an alias for MCP bridges.
|
|
18
|
+
*/
|
|
19
|
+
declare const NUDO_SLASH_REQUESTS: readonly ["nudo/selectCase", "nudo/getActiveCases", "nudo/whatIf", "nudo/suggestCase", "nudo/trace", "nudo/check", "nudo/hover", "nudo/infer", "nudo/interface", "nudo/interface.draft", "nudo/interface.emit"];
|
|
20
|
+
/**
|
|
21
|
+
* Agent-tool names shared by executeCommand / slash requests / AGENT_TOOL_SOURCES.
|
|
22
|
+
* `codeLens` is server-computed only (no command/request); `selectCase` /
|
|
23
|
+
* `getActiveCases` are editor commands, not agent tools.
|
|
24
|
+
*/
|
|
25
|
+
declare const NUDO_AGENT_TOOL_NAMES: readonly ["whatIf", "suggestCase", "trace", "check", "hover", "infer", "interface", "interface.draft", "interface.emit"];
|
|
26
|
+
/** executeCommand aliases kept for CodeLens / Marketplace command palette */
|
|
27
|
+
declare const NUDO_COMMAND_ALIASES: Readonly<Record<string, string>>;
|
|
28
|
+
/** Capability keys declared in connection.onInitialize */
|
|
29
|
+
declare const NUDO_INITIALIZE_CAPABILITIES: readonly ["textDocumentSync", "hoverProvider", "completionProvider", "codeLensProvider", "inlayHintProvider", "definitionProvider", "referencesProvider", "renameProvider", "documentSymbolProvider", "workspaceSymbolProvider", "codeActionProvider", "signatureHelpProvider", "semanticTokensProvider", "executeCommandProvider", "diagnosticProvider"];
|
|
30
|
+
/** Slash-form → matching executeCommand (dot form) */
|
|
31
|
+
declare function slashToExecuteCommand(slash: string): string;
|
|
32
|
+
/** npm package public surface (mirrors packages/lsp/package.json) */
|
|
33
|
+
declare const NUDO_LSP_PACKAGE_SURFACE: {
|
|
34
|
+
readonly name: "@nudojs/lsp";
|
|
35
|
+
readonly bin: "nudo-lsp";
|
|
36
|
+
readonly entry: ".";
|
|
37
|
+
readonly entryPath: "./dist/server.js";
|
|
38
|
+
readonly files: readonly ["dist"];
|
|
39
|
+
/** Machine-readable freeze inventory (no server side effects). */
|
|
40
|
+
readonly publicApiExport: "./public-api";
|
|
41
|
+
readonly publicApiPath: "./dist/public-api.js";
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { NUDO_AGENT_TOOL_NAMES, NUDO_COMMAND_ALIASES, NUDO_EXECUTE_COMMANDS, NUDO_INITIALIZE_CAPABILITIES, NUDO_LSP_PACKAGE_SURFACE, NUDO_SLASH_REQUESTS, slashToExecuteCommand };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createRequire as __nudoCreateRequire } from "module";
|
|
2
|
+
import { fileURLToPath as __nudoFileURLToPath } from "url";
|
|
3
|
+
const require = __nudoCreateRequire(import.meta.url);
|
|
4
|
+
const __filename = __nudoFileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = __nudoFileURLToPath(new URL(".", import.meta.url));
|
|
6
|
+
|
|
7
|
+
// src/public-api.ts
|
|
8
|
+
var NUDO_EXECUTE_COMMANDS = [
|
|
9
|
+
"nudo.whatIf",
|
|
10
|
+
"nudo.suggestCase",
|
|
11
|
+
"nudo.trace",
|
|
12
|
+
"nudo.check",
|
|
13
|
+
"nudo.hover",
|
|
14
|
+
"nudo.infer",
|
|
15
|
+
"nudo.interface",
|
|
16
|
+
"nudo.interface.draft",
|
|
17
|
+
"nudo.interfaceDraft",
|
|
18
|
+
"nudo.interfaceEmit",
|
|
19
|
+
"nudo.interface.emit",
|
|
20
|
+
"nudo.selectCase",
|
|
21
|
+
"nudo.getActiveCases"
|
|
22
|
+
];
|
|
23
|
+
var NUDO_SLASH_REQUESTS = [
|
|
24
|
+
"nudo/selectCase",
|
|
25
|
+
"nudo/getActiveCases",
|
|
26
|
+
"nudo/whatIf",
|
|
27
|
+
"nudo/suggestCase",
|
|
28
|
+
"nudo/trace",
|
|
29
|
+
"nudo/check",
|
|
30
|
+
"nudo/hover",
|
|
31
|
+
"nudo/infer",
|
|
32
|
+
"nudo/interface",
|
|
33
|
+
"nudo/interface.draft",
|
|
34
|
+
"nudo/interface.emit"
|
|
35
|
+
];
|
|
36
|
+
var NUDO_AGENT_TOOL_NAMES = [
|
|
37
|
+
"whatIf",
|
|
38
|
+
"suggestCase",
|
|
39
|
+
"trace",
|
|
40
|
+
"check",
|
|
41
|
+
"hover",
|
|
42
|
+
"infer",
|
|
43
|
+
"interface",
|
|
44
|
+
"interface.draft",
|
|
45
|
+
"interface.emit"
|
|
46
|
+
];
|
|
47
|
+
var NUDO_COMMAND_ALIASES = {
|
|
48
|
+
"nudo.interfaceDraft": "nudo.interface.draft",
|
|
49
|
+
"nudo.interfaceEmit": "nudo.interface.emit"
|
|
50
|
+
};
|
|
51
|
+
var NUDO_INITIALIZE_CAPABILITIES = [
|
|
52
|
+
"textDocumentSync",
|
|
53
|
+
"hoverProvider",
|
|
54
|
+
"completionProvider",
|
|
55
|
+
"codeLensProvider",
|
|
56
|
+
"inlayHintProvider",
|
|
57
|
+
"definitionProvider",
|
|
58
|
+
"referencesProvider",
|
|
59
|
+
"renameProvider",
|
|
60
|
+
"documentSymbolProvider",
|
|
61
|
+
"workspaceSymbolProvider",
|
|
62
|
+
"codeActionProvider",
|
|
63
|
+
"signatureHelpProvider",
|
|
64
|
+
"semanticTokensProvider",
|
|
65
|
+
"executeCommandProvider",
|
|
66
|
+
"diagnosticProvider"
|
|
67
|
+
];
|
|
68
|
+
function slashToExecuteCommand(slash) {
|
|
69
|
+
return slash.replace(/^nudo\//, "nudo.");
|
|
70
|
+
}
|
|
71
|
+
var NUDO_LSP_PACKAGE_SURFACE = {
|
|
72
|
+
name: "@nudojs/lsp",
|
|
73
|
+
bin: "nudo-lsp",
|
|
74
|
+
entry: ".",
|
|
75
|
+
entryPath: "./dist/server.js",
|
|
76
|
+
files: ["dist"],
|
|
77
|
+
/** Machine-readable freeze inventory (no server side effects). */
|
|
78
|
+
publicApiExport: "./public-api",
|
|
79
|
+
publicApiPath: "./dist/public-api.js"
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
NUDO_AGENT_TOOL_NAMES,
|
|
83
|
+
NUDO_COMMAND_ALIASES,
|
|
84
|
+
NUDO_EXECUTE_COMMANDS,
|
|
85
|
+
NUDO_INITIALIZE_CAPABILITIES,
|
|
86
|
+
NUDO_LSP_PACKAGE_SURFACE,
|
|
87
|
+
NUDO_SLASH_REQUESTS,
|
|
88
|
+
slashToExecuteCommand
|
|
89
|
+
};
|