@nudojs/lsp 0.8.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/index.d.ts +101 -0
- package/dist/index.js +250754 -0
- package/dist/public-api.d.ts +8 -7
- package/dist/public-api.js +12 -19
- package/dist/server.d.ts +14 -6
- package/dist/server.js +76377 -90466
- package/package.json +19 -9
package/dist/public-api.d.ts
CHANGED
|
@@ -9,22 +9,23 @@
|
|
|
9
9
|
* - executeCommand uses **dot** form: `nudo.check`
|
|
10
10
|
* - custom requests use **slash** form: `nudo/check` (canonical protocol)
|
|
11
11
|
* - every slash-form agent request has a matching executeCommand name
|
|
12
|
+
*
|
|
13
|
+
* Product names match CLI verbs (design-cli-semantics): check / test /
|
|
14
|
+
* contract / export / health. There are no protocol aliases.
|
|
12
15
|
*/
|
|
13
16
|
/** 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.
|
|
17
|
+
declare const NUDO_EXECUTE_COMMANDS: readonly ["nudo.whatIf", "nudo.suggestCase", "nudo.trace", "nudo.check", "nudo.hover", "nudo.test", "nudo.contract", "nudo.contract.draft", "nudo.contract.emit", "nudo.selectCase", "nudo.getActiveCases"];
|
|
15
18
|
/**
|
|
16
19
|
* Custom LSP request method names (slash form) — the protocol contract.
|
|
17
|
-
* Agent tools also register the dot-form method
|
|
20
|
+
* Agent tools also register the dot-form method for MCP bridges.
|
|
18
21
|
*/
|
|
19
|
-
declare const NUDO_SLASH_REQUESTS: readonly ["nudo/selectCase", "nudo/getActiveCases", "nudo/whatIf", "nudo/suggestCase", "nudo/trace", "nudo/check", "nudo/hover", "nudo/
|
|
22
|
+
declare const NUDO_SLASH_REQUESTS: readonly ["nudo/selectCase", "nudo/getActiveCases", "nudo/whatIf", "nudo/suggestCase", "nudo/trace", "nudo/check", "nudo/hover", "nudo/test", "nudo/contract", "nudo/contract.draft", "nudo/contract.emit"];
|
|
20
23
|
/**
|
|
21
24
|
* Agent-tool names shared by executeCommand / slash requests / AGENT_TOOL_SOURCES.
|
|
22
25
|
* `codeLens` is server-computed only (no command/request); `selectCase` /
|
|
23
26
|
* `getActiveCases` are editor commands, not agent tools.
|
|
24
27
|
*/
|
|
25
|
-
declare const NUDO_AGENT_TOOL_NAMES: readonly ["whatIf", "suggestCase", "trace", "check", "hover", "
|
|
26
|
-
/** executeCommand aliases kept for CodeLens / Marketplace command palette */
|
|
27
|
-
declare const NUDO_COMMAND_ALIASES: Readonly<Record<string, string>>;
|
|
28
|
+
declare const NUDO_AGENT_TOOL_NAMES: readonly ["whatIf", "suggestCase", "trace", "check", "hover", "test", "contract", "contract.draft", "contract.emit"];
|
|
28
29
|
/** Capability keys declared in connection.onInitialize */
|
|
29
30
|
declare const NUDO_INITIALIZE_CAPABILITIES: readonly ["textDocumentSync", "hoverProvider", "completionProvider", "codeLensProvider", "inlayHintProvider", "definitionProvider", "referencesProvider", "renameProvider", "documentSymbolProvider", "workspaceSymbolProvider", "codeActionProvider", "signatureHelpProvider", "semanticTokensProvider", "executeCommandProvider", "diagnosticProvider"];
|
|
30
31
|
/** Slash-form → matching executeCommand (dot form) */
|
|
@@ -41,4 +42,4 @@ declare const NUDO_LSP_PACKAGE_SURFACE: {
|
|
|
41
42
|
readonly publicApiPath: "./dist/public-api.js";
|
|
42
43
|
};
|
|
43
44
|
|
|
44
|
-
export { NUDO_AGENT_TOOL_NAMES,
|
|
45
|
+
export { NUDO_AGENT_TOOL_NAMES, NUDO_EXECUTE_COMMANDS, NUDO_INITIALIZE_CAPABILITIES, NUDO_LSP_PACKAGE_SURFACE, NUDO_SLASH_REQUESTS, slashToExecuteCommand };
|
package/dist/public-api.js
CHANGED
|
@@ -11,12 +11,10 @@ var NUDO_EXECUTE_COMMANDS = [
|
|
|
11
11
|
"nudo.trace",
|
|
12
12
|
"nudo.check",
|
|
13
13
|
"nudo.hover",
|
|
14
|
-
"nudo.
|
|
15
|
-
"nudo.
|
|
16
|
-
"nudo.
|
|
17
|
-
"nudo.
|
|
18
|
-
"nudo.interfaceEmit",
|
|
19
|
-
"nudo.interface.emit",
|
|
14
|
+
"nudo.test",
|
|
15
|
+
"nudo.contract",
|
|
16
|
+
"nudo.contract.draft",
|
|
17
|
+
"nudo.contract.emit",
|
|
20
18
|
"nudo.selectCase",
|
|
21
19
|
"nudo.getActiveCases"
|
|
22
20
|
];
|
|
@@ -28,10 +26,10 @@ var NUDO_SLASH_REQUESTS = [
|
|
|
28
26
|
"nudo/trace",
|
|
29
27
|
"nudo/check",
|
|
30
28
|
"nudo/hover",
|
|
31
|
-
"nudo/
|
|
32
|
-
"nudo/
|
|
33
|
-
"nudo/
|
|
34
|
-
"nudo/
|
|
29
|
+
"nudo/test",
|
|
30
|
+
"nudo/contract",
|
|
31
|
+
"nudo/contract.draft",
|
|
32
|
+
"nudo/contract.emit"
|
|
35
33
|
];
|
|
36
34
|
var NUDO_AGENT_TOOL_NAMES = [
|
|
37
35
|
"whatIf",
|
|
@@ -39,15 +37,11 @@ var NUDO_AGENT_TOOL_NAMES = [
|
|
|
39
37
|
"trace",
|
|
40
38
|
"check",
|
|
41
39
|
"hover",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
40
|
+
"test",
|
|
41
|
+
"contract",
|
|
42
|
+
"contract.draft",
|
|
43
|
+
"contract.emit"
|
|
46
44
|
];
|
|
47
|
-
var NUDO_COMMAND_ALIASES = {
|
|
48
|
-
"nudo.interfaceDraft": "nudo.interface.draft",
|
|
49
|
-
"nudo.interfaceEmit": "nudo.interface.emit"
|
|
50
|
-
};
|
|
51
45
|
var NUDO_INITIALIZE_CAPABILITIES = [
|
|
52
46
|
"textDocumentSync",
|
|
53
47
|
"hoverProvider",
|
|
@@ -80,7 +74,6 @@ var NUDO_LSP_PACKAGE_SURFACE = {
|
|
|
80
74
|
};
|
|
81
75
|
export {
|
|
82
76
|
NUDO_AGENT_TOOL_NAMES,
|
|
83
|
-
NUDO_COMMAND_ALIASES,
|
|
84
77
|
NUDO_EXECUTE_COMMANDS,
|
|
85
78
|
NUDO_INITIALIZE_CAPABILITIES,
|
|
86
79
|
NUDO_LSP_PACKAGE_SURFACE,
|
package/dist/server.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { TextDocuments, Connection } from 'vscode-languageserver/node';
|
|
3
|
+
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
4
|
+
|
|
5
|
+
/** Wiring result: documents store + transport start (bin entry calls listen). */
|
|
6
|
+
type NudoServerHandle = {
|
|
7
|
+
documents: TextDocuments<TextDocument>;
|
|
8
|
+
/** Start the JSON-RPC transport. Not called in tests. */
|
|
9
|
+
listen: () => void;
|
|
10
|
+
};
|
|
2
11
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
12
|
+
* Register the full Nudo LSP surface on `connection`.
|
|
13
|
+
* Importable without side effects — the real transport (`createConnection`)
|
|
14
|
+
* is created only by the bin entry below.
|
|
5
15
|
*/
|
|
6
|
-
declare
|
|
7
|
-
/** 注册 watched-files 监听器,返回注销函数。 */
|
|
8
|
-
declare function registerWatchedFilesListener(listener: (uris: string[]) => void): () => void;
|
|
16
|
+
declare function createNudoServer(connection: Connection): NudoServerHandle;
|
|
9
17
|
|
|
10
|
-
export {
|
|
18
|
+
export { type NudoServerHandle, createNudoServer };
|