@xano/xanoscript-language-server 12.16.6 → 12.17.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.
@@ -5,16 +5,20 @@ import { InstructionsToken, ToolToken } from "../lexer/tool.js";
5
5
 
6
6
  export function toolDeclaration($) {
7
7
  return () => {
8
+ let hasAnnotations = false;
8
9
  let hasDescription = false;
9
10
  let hasGuid = false;
10
11
  let hasDocs = false;
11
12
  let hasHistory = false;
13
+ let hasIcons = false;
12
14
  let hasInput = false;
13
15
  let hasInstructions = false;
14
16
  let hasMiddleware = false;
17
+ let hasOutput = false;
15
18
  let hasResponse = false;
16
19
  let hasStack = false;
17
20
  let hasTags = false;
21
+ let hasTitle = false;
18
22
 
19
23
  $.sectionStack.push("toolDeclaration");
20
24
  // Allow leading comments and newlines before the tool declaration
@@ -31,6 +35,13 @@ export function toolDeclaration($) {
31
35
  $.AT_LEAST_ONE(() => $.CONSUME(NewlineToken)); // at least one new line
32
36
  $.OR2([
33
37
  { ALT: () => $.SUBRULE($.commentBlockFn) },
38
+ {
39
+ GATE: () => !hasAnnotations,
40
+ ALT: () => {
41
+ hasAnnotations = true;
42
+ $.SUBRULE($.mcpToolAnnotationsClause);
43
+ },
44
+ },
34
45
  {
35
46
  GATE: () => !hasDescription,
36
47
  ALT: () => {
@@ -59,6 +70,13 @@ export function toolDeclaration($) {
59
70
  $.SUBRULE($.historyClause);
60
71
  },
61
72
  },
73
+ {
74
+ GATE: () => !hasIcons,
75
+ ALT: () => {
76
+ hasIcons = true;
77
+ $.SUBRULE($.mcpIconsClause);
78
+ },
79
+ },
62
80
  {
63
81
  GATE: () => !hasInput,
64
82
  ALT: () => {
@@ -84,6 +102,13 @@ export function toolDeclaration($) {
84
102
  $.SUBRULE($.middlewareClause);
85
103
  },
86
104
  },
105
+ {
106
+ GATE: () => !hasOutput,
107
+ ALT: () => {
108
+ hasOutput = true;
109
+ $.SUBRULE($.outputClause);
110
+ },
111
+ },
87
112
  {
88
113
  GATE: () => !hasResponse,
89
114
  ALT: () => {
@@ -107,6 +132,13 @@ export function toolDeclaration($) {
107
132
  $.SUBRULE($.tagsAttribute);
108
133
  },
109
134
  },
135
+ {
136
+ GATE: () => !hasTitle,
137
+ ALT: () => {
138
+ hasTitle = true;
139
+ $.SUBRULE($.mcpTitleClause);
140
+ },
141
+ },
110
142
  ]);
111
143
  });
112
144
 
package/utils.js CHANGED
@@ -32,11 +32,13 @@ const schemeByFirstWord = {
32
32
  message: "message",
33
33
  microservice: "microservice",
34
34
  middleware: "middleware",
35
+ prompt: "prompt",
35
36
  query: "api",
36
37
  realtime_server: "realtime_server",
37
38
  realtime_server_trigger: "realtime_server_trigger",
38
39
  realtime_trigger: "realtime_trigger",
39
40
  realtime_channel: "realtime_channel",
41
+ resource: "resource",
40
42
  run: "run",
41
43
  table: "db",
42
44
  table_trigger: "table_trigger",