@xano/xanoscript-language-server 12.23.0 → 12.24.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/lexer/tokens.js +1 -1
- package/package.json +1 -1
- package/parser/branch_parser.js +1 -1
- package/parser/clauses/mesh0Clause.js +11 -23
package/lexer/tokens.js
CHANGED
|
@@ -295,7 +295,7 @@ export const HistoryToken = createTokenByName("history", {
|
|
|
295
295
|
categories: [Identifier], // could also be an identifier
|
|
296
296
|
});
|
|
297
297
|
|
|
298
|
-
// `mesh0 = {logging
|
|
298
|
+
// `mesh0 = {logging}` on objects and containers.
|
|
299
299
|
export const Mesh0Token = createTokenByName("mesh0", {
|
|
300
300
|
longer_alt: Identifier,
|
|
301
301
|
categories: [Identifier], // could also be an identifier
|
package/package.json
CHANGED
package/parser/branch_parser.js
CHANGED
|
@@ -57,7 +57,7 @@ export function branchDeclaration($) {
|
|
|
57
57
|
"prompt?": historyValues,
|
|
58
58
|
"resource?": historyValues,
|
|
59
59
|
},
|
|
60
|
-
// Strict whitelist of run types, each `{logging
|
|
60
|
+
// Strict whitelist of run types, each `{logging}`.
|
|
61
61
|
// The platform writes only the types that differ from the
|
|
62
62
|
// default, and no block at all when none do.
|
|
63
63
|
"mesh0?": {
|
|
@@ -2,26 +2,25 @@ import { EqualToken } from "../../lexer/control.js";
|
|
|
2
2
|
import { Mesh0Token } from "../../lexer/tokens.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The value set of one mesh0 setting, `{logging
|
|
5
|
+
* The value set of one mesh0 setting, `{logging}`, shared by the
|
|
6
6
|
* object/container `mesh0 = {...}` clause and each run type of a branch
|
|
7
7
|
* document's `mesh0` block (`branch_parser.js`).
|
|
8
8
|
*
|
|
9
9
|
* Mirrors the platform's mesh0 settings: `logging` is the trace detail
|
|
10
|
-
* (`"inherit"` defers to the next level)
|
|
11
|
-
* span cap
|
|
12
|
-
*
|
|
10
|
+
* (`"inherit"` defers to the next level) and is required. The per-run
|
|
11
|
+
* statement span cap is not a mesh0 key; the platform takes it from the
|
|
12
|
+
* request-history `history` setting, so a `statements` key is invalid.
|
|
13
13
|
*/
|
|
14
14
|
export const MESH0_SETTING_SCHEMA = {
|
|
15
|
-
|
|
16
|
-
"statements?": [100, 1000, 10000, "all"],
|
|
15
|
+
logging: ["inherit", "minimal", "light", "full"],
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
|
-
* Parses the `mesh0 = {logging: "light"
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
19
|
+
* Parses the `mesh0 = {logging: "light"}` setting of an object (query,
|
|
20
|
+
* function, task, tool, middleware, trigger, prompt, resource) or a container
|
|
21
|
+
* (api_group, mcp_server, channel, realtime_server). It sits beside
|
|
22
|
+
* `history`. A container presents the same key; the platform maps it to its
|
|
23
|
+
* type-prefixed field (`query_logging`, `tool_logging`, ...).
|
|
25
24
|
*
|
|
26
25
|
* @param {import('../base_parser.js').XanoBaseParser} $
|
|
27
26
|
*/
|
|
@@ -31,19 +30,8 @@ export function mesh0Clause($) {
|
|
|
31
30
|
const parent = $.CONSUME(Mesh0Token); // "mesh0"
|
|
32
31
|
$.CONSUME(EqualToken); // "="
|
|
33
32
|
|
|
34
|
-
const captured = {};
|
|
35
33
|
$.SUBRULE($.schemaParseObjectFn, {
|
|
36
|
-
ARGS: [parent, MESH0_SETTING_SCHEMA
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
// Both keys are optional, but an empty setting says nothing.
|
|
40
|
-
$.ACTION(() => {
|
|
41
|
-
if (Object.keys(captured).length === 0) {
|
|
42
|
-
$.addMissingError(
|
|
43
|
-
parent,
|
|
44
|
-
"{} requires at least one of: logging, statements",
|
|
45
|
-
);
|
|
46
|
-
}
|
|
34
|
+
ARGS: [parent, MESH0_SETTING_SCHEMA],
|
|
47
35
|
});
|
|
48
36
|
|
|
49
37
|
$.sectionStack.pop();
|