@abco20/btxml-checker 0.1.1 → 0.1.2
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/cli.js +27 -26
- package/dist/config.js +1 -1
- package/dist/editor-node.d.ts +6 -6
- package/dist/editor-node.js +23 -21
- package/dist/editor.d.ts +6 -6
- package/dist/editor.js +22 -20
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -10
- package/dist/model.d.ts +2 -2
- package/dist/model.js +3 -2
- package/dist/{public-types-DaawwXHQ.d.ts → public-types-Cp3bKKQ3.d.ts} +4 -4
- package/dist/{public-types-B2noBQY9.d.ts → public-types-DCvVgnqw.d.ts} +17 -4
- package/dist/rules.d.ts +7 -6
- package/dist/rules.js +2 -2
- package/dist/semantic.d.ts +5 -5
- package/dist/semantic.js +3 -2
- package/dist/server.cjs +1261 -460
- package/dist/server.cjs.map +1 -1
- package/dist/syntax.js +6 -6
- package/dist/{types-CkOvIGPf.d.ts → types-B2hnkNNL.d.ts} +5 -3
- package/dist/{types-SY4-jKCn.d.ts → types-BRzExVMv.d.ts} +2 -2
- package/dist/{types-BaOc_AYN.d.ts → types-f9KgrQFd.d.ts} +1 -1
- package/package.json +1 -1
package/dist/server.cjs
CHANGED
|
@@ -927,9 +927,9 @@ var require_codegen = __commonJS({
|
|
|
927
927
|
}
|
|
928
928
|
};
|
|
929
929
|
var Throw = class extends Node {
|
|
930
|
-
constructor(
|
|
930
|
+
constructor(error52) {
|
|
931
931
|
super();
|
|
932
|
-
this.error =
|
|
932
|
+
this.error = error52;
|
|
933
933
|
}
|
|
934
934
|
render({ _n }) {
|
|
935
935
|
return `throw ${this.error};` + _n;
|
|
@@ -1166,9 +1166,9 @@ var require_codegen = __commonJS({
|
|
|
1166
1166
|
}
|
|
1167
1167
|
};
|
|
1168
1168
|
var Catch = class extends BlockNode {
|
|
1169
|
-
constructor(
|
|
1169
|
+
constructor(error52) {
|
|
1170
1170
|
super();
|
|
1171
|
-
this.error =
|
|
1171
|
+
this.error = error52;
|
|
1172
1172
|
}
|
|
1173
1173
|
render(opts) {
|
|
1174
1174
|
return `catch(${this.error})` + super.render(opts);
|
|
@@ -1359,9 +1359,9 @@ var require_codegen = __commonJS({
|
|
|
1359
1359
|
this._blockNode(node);
|
|
1360
1360
|
this.code(tryBody);
|
|
1361
1361
|
if (catchCode) {
|
|
1362
|
-
const
|
|
1363
|
-
this._currNode = node.catch = new Catch(
|
|
1364
|
-
catchCode(
|
|
1362
|
+
const error52 = this.name("e");
|
|
1363
|
+
this._currNode = node.catch = new Catch(error52);
|
|
1364
|
+
catchCode(error52);
|
|
1365
1365
|
}
|
|
1366
1366
|
if (finallyCode) {
|
|
1367
1367
|
this._currNode = node.finally = new Finally();
|
|
@@ -1370,8 +1370,8 @@ var require_codegen = __commonJS({
|
|
|
1370
1370
|
return this._endBlockNode(Catch, Finally);
|
|
1371
1371
|
}
|
|
1372
1372
|
// `throw` statement
|
|
1373
|
-
throw(
|
|
1374
|
-
return this._leafNode(new Throw(
|
|
1373
|
+
throw(error52) {
|
|
1374
|
+
return this._leafNode(new Throw(error52));
|
|
1375
1375
|
}
|
|
1376
1376
|
// start self-balancing block
|
|
1377
1377
|
block(body, nodeCount) {
|
|
@@ -1727,10 +1727,10 @@ var require_errors = __commonJS({
|
|
|
1727
1727
|
exports2.keyword$DataError = {
|
|
1728
1728
|
message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)`
|
|
1729
1729
|
};
|
|
1730
|
-
function reportError(cxt,
|
|
1730
|
+
function reportError(cxt, error52 = exports2.keywordError, errorPaths, overrideAllErrors) {
|
|
1731
1731
|
const { it } = cxt;
|
|
1732
1732
|
const { gen, compositeRule, allErrors } = it;
|
|
1733
|
-
const errObj = errorObjectCode(cxt,
|
|
1733
|
+
const errObj = errorObjectCode(cxt, error52, errorPaths);
|
|
1734
1734
|
if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) {
|
|
1735
1735
|
addError(gen, errObj);
|
|
1736
1736
|
} else {
|
|
@@ -1738,10 +1738,10 @@ var require_errors = __commonJS({
|
|
|
1738
1738
|
}
|
|
1739
1739
|
}
|
|
1740
1740
|
exports2.reportError = reportError;
|
|
1741
|
-
function reportExtraError(cxt,
|
|
1741
|
+
function reportExtraError(cxt, error52 = exports2.keywordError, errorPaths) {
|
|
1742
1742
|
const { it } = cxt;
|
|
1743
1743
|
const { gen, compositeRule, allErrors } = it;
|
|
1744
|
-
const errObj = errorObjectCode(cxt,
|
|
1744
|
+
const errObj = errorObjectCode(cxt, error52, errorPaths);
|
|
1745
1745
|
addError(gen, errObj);
|
|
1746
1746
|
if (!(compositeRule || allErrors)) {
|
|
1747
1747
|
returnErrors(it, names_1.default.vErrors);
|
|
@@ -1792,19 +1792,19 @@ var require_errors = __commonJS({
|
|
|
1792
1792
|
schema: new codegen_1.Name("schema"),
|
|
1793
1793
|
parentSchema: new codegen_1.Name("parentSchema")
|
|
1794
1794
|
};
|
|
1795
|
-
function errorObjectCode(cxt,
|
|
1795
|
+
function errorObjectCode(cxt, error52, errorPaths) {
|
|
1796
1796
|
const { createErrors } = cxt.it;
|
|
1797
1797
|
if (createErrors === false)
|
|
1798
1798
|
return (0, codegen_1._)`{}`;
|
|
1799
|
-
return errorObject(cxt,
|
|
1799
|
+
return errorObject(cxt, error52, errorPaths);
|
|
1800
1800
|
}
|
|
1801
|
-
function errorObject(cxt,
|
|
1801
|
+
function errorObject(cxt, error52, errorPaths = {}) {
|
|
1802
1802
|
const { gen, it } = cxt;
|
|
1803
1803
|
const keyValues = [
|
|
1804
1804
|
errorInstancePath(it, errorPaths),
|
|
1805
1805
|
errorSchemaPath(cxt, errorPaths)
|
|
1806
1806
|
];
|
|
1807
|
-
extraErrorProps(cxt,
|
|
1807
|
+
extraErrorProps(cxt, error52, keyValues);
|
|
1808
1808
|
return gen.object(...keyValues);
|
|
1809
1809
|
}
|
|
1810
1810
|
function errorInstancePath({ errorPath }, { instancePath }) {
|
|
@@ -5159,7 +5159,7 @@ var require_limitNumber = __commonJS({
|
|
|
5159
5159
|
exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
|
|
5160
5160
|
exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
|
|
5161
5161
|
};
|
|
5162
|
-
var
|
|
5162
|
+
var error52 = {
|
|
5163
5163
|
message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,
|
|
5164
5164
|
params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
|
|
5165
5165
|
};
|
|
@@ -5168,7 +5168,7 @@ var require_limitNumber = __commonJS({
|
|
|
5168
5168
|
type: "number",
|
|
5169
5169
|
schemaType: "number",
|
|
5170
5170
|
$data: true,
|
|
5171
|
-
error:
|
|
5171
|
+
error: error52,
|
|
5172
5172
|
code(cxt) {
|
|
5173
5173
|
const { keyword, data, schemaCode } = cxt;
|
|
5174
5174
|
cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
|
|
@@ -5184,7 +5184,7 @@ var require_multipleOf = __commonJS({
|
|
|
5184
5184
|
"use strict";
|
|
5185
5185
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5186
5186
|
var codegen_1 = require_codegen();
|
|
5187
|
-
var
|
|
5187
|
+
var error52 = {
|
|
5188
5188
|
message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,
|
|
5189
5189
|
params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`
|
|
5190
5190
|
};
|
|
@@ -5193,7 +5193,7 @@ var require_multipleOf = __commonJS({
|
|
|
5193
5193
|
type: "number",
|
|
5194
5194
|
schemaType: "number",
|
|
5195
5195
|
$data: true,
|
|
5196
|
-
error:
|
|
5196
|
+
error: error52,
|
|
5197
5197
|
code(cxt) {
|
|
5198
5198
|
const { gen, data, schemaCode, it } = cxt;
|
|
5199
5199
|
const prec = it.opts.multipleOfPrecision;
|
|
@@ -5240,7 +5240,7 @@ var require_limitLength = __commonJS({
|
|
|
5240
5240
|
var codegen_1 = require_codegen();
|
|
5241
5241
|
var util_1 = require_util();
|
|
5242
5242
|
var ucs2length_1 = require_ucs2length();
|
|
5243
|
-
var
|
|
5243
|
+
var error52 = {
|
|
5244
5244
|
message({ keyword, schemaCode }) {
|
|
5245
5245
|
const comp = keyword === "maxLength" ? "more" : "fewer";
|
|
5246
5246
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`;
|
|
@@ -5252,7 +5252,7 @@ var require_limitLength = __commonJS({
|
|
|
5252
5252
|
type: "string",
|
|
5253
5253
|
schemaType: "number",
|
|
5254
5254
|
$data: true,
|
|
5255
|
-
error:
|
|
5255
|
+
error: error52,
|
|
5256
5256
|
code(cxt) {
|
|
5257
5257
|
const { keyword, data, schemaCode, it } = cxt;
|
|
5258
5258
|
const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
@@ -5272,7 +5272,7 @@ var require_pattern = __commonJS({
|
|
|
5272
5272
|
var code_1 = require_code2();
|
|
5273
5273
|
var util_1 = require_util();
|
|
5274
5274
|
var codegen_1 = require_codegen();
|
|
5275
|
-
var
|
|
5275
|
+
var error52 = {
|
|
5276
5276
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
5277
5277
|
params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`
|
|
5278
5278
|
};
|
|
@@ -5281,7 +5281,7 @@ var require_pattern = __commonJS({
|
|
|
5281
5281
|
type: "string",
|
|
5282
5282
|
schemaType: "string",
|
|
5283
5283
|
$data: true,
|
|
5284
|
-
error:
|
|
5284
|
+
error: error52,
|
|
5285
5285
|
code(cxt) {
|
|
5286
5286
|
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
5287
5287
|
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
@@ -5307,7 +5307,7 @@ var require_limitProperties = __commonJS({
|
|
|
5307
5307
|
"use strict";
|
|
5308
5308
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5309
5309
|
var codegen_1 = require_codegen();
|
|
5310
|
-
var
|
|
5310
|
+
var error52 = {
|
|
5311
5311
|
message({ keyword, schemaCode }) {
|
|
5312
5312
|
const comp = keyword === "maxProperties" ? "more" : "fewer";
|
|
5313
5313
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`;
|
|
@@ -5319,7 +5319,7 @@ var require_limitProperties = __commonJS({
|
|
|
5319
5319
|
type: "object",
|
|
5320
5320
|
schemaType: "number",
|
|
5321
5321
|
$data: true,
|
|
5322
|
-
error:
|
|
5322
|
+
error: error52,
|
|
5323
5323
|
code(cxt) {
|
|
5324
5324
|
const { keyword, data, schemaCode } = cxt;
|
|
5325
5325
|
const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
@@ -5338,7 +5338,7 @@ var require_required = __commonJS({
|
|
|
5338
5338
|
var code_1 = require_code2();
|
|
5339
5339
|
var codegen_1 = require_codegen();
|
|
5340
5340
|
var util_1 = require_util();
|
|
5341
|
-
var
|
|
5341
|
+
var error52 = {
|
|
5342
5342
|
message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,
|
|
5343
5343
|
params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`
|
|
5344
5344
|
};
|
|
@@ -5347,7 +5347,7 @@ var require_required = __commonJS({
|
|
|
5347
5347
|
type: "object",
|
|
5348
5348
|
schemaType: "array",
|
|
5349
5349
|
$data: true,
|
|
5350
|
-
error:
|
|
5350
|
+
error: error52,
|
|
5351
5351
|
code(cxt) {
|
|
5352
5352
|
const { gen, schema, schemaCode, data, $data, it } = cxt;
|
|
5353
5353
|
const { opts } = it;
|
|
@@ -5418,7 +5418,7 @@ var require_limitItems = __commonJS({
|
|
|
5418
5418
|
"use strict";
|
|
5419
5419
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5420
5420
|
var codegen_1 = require_codegen();
|
|
5421
|
-
var
|
|
5421
|
+
var error52 = {
|
|
5422
5422
|
message({ keyword, schemaCode }) {
|
|
5423
5423
|
const comp = keyword === "maxItems" ? "more" : "fewer";
|
|
5424
5424
|
return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`;
|
|
@@ -5430,7 +5430,7 @@ var require_limitItems = __commonJS({
|
|
|
5430
5430
|
type: "array",
|
|
5431
5431
|
schemaType: "number",
|
|
5432
5432
|
$data: true,
|
|
5433
|
-
error:
|
|
5433
|
+
error: error52,
|
|
5434
5434
|
code(cxt) {
|
|
5435
5435
|
const { keyword, data, schemaCode } = cxt;
|
|
5436
5436
|
const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
|
|
@@ -5461,7 +5461,7 @@ var require_uniqueItems = __commonJS({
|
|
|
5461
5461
|
var codegen_1 = require_codegen();
|
|
5462
5462
|
var util_1 = require_util();
|
|
5463
5463
|
var equal_1 = require_equal();
|
|
5464
|
-
var
|
|
5464
|
+
var error52 = {
|
|
5465
5465
|
message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
|
|
5466
5466
|
params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`
|
|
5467
5467
|
};
|
|
@@ -5470,7 +5470,7 @@ var require_uniqueItems = __commonJS({
|
|
|
5470
5470
|
type: "array",
|
|
5471
5471
|
schemaType: "boolean",
|
|
5472
5472
|
$data: true,
|
|
5473
|
-
error:
|
|
5473
|
+
error: error52,
|
|
5474
5474
|
code(cxt) {
|
|
5475
5475
|
const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;
|
|
5476
5476
|
if (!$data && !schema)
|
|
@@ -5527,14 +5527,14 @@ var require_const = __commonJS({
|
|
|
5527
5527
|
var codegen_1 = require_codegen();
|
|
5528
5528
|
var util_1 = require_util();
|
|
5529
5529
|
var equal_1 = require_equal();
|
|
5530
|
-
var
|
|
5530
|
+
var error52 = {
|
|
5531
5531
|
message: "must be equal to constant",
|
|
5532
5532
|
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`
|
|
5533
5533
|
};
|
|
5534
5534
|
var def = {
|
|
5535
5535
|
keyword: "const",
|
|
5536
5536
|
$data: true,
|
|
5537
|
-
error:
|
|
5537
|
+
error: error52,
|
|
5538
5538
|
code(cxt) {
|
|
5539
5539
|
const { gen, data, $data, schemaCode, schema } = cxt;
|
|
5540
5540
|
if ($data || schema && typeof schema == "object") {
|
|
@@ -5556,7 +5556,7 @@ var require_enum = __commonJS({
|
|
|
5556
5556
|
var codegen_1 = require_codegen();
|
|
5557
5557
|
var util_1 = require_util();
|
|
5558
5558
|
var equal_1 = require_equal();
|
|
5559
|
-
var
|
|
5559
|
+
var error52 = {
|
|
5560
5560
|
message: "must be equal to one of the allowed values",
|
|
5561
5561
|
params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`
|
|
5562
5562
|
};
|
|
@@ -5564,7 +5564,7 @@ var require_enum = __commonJS({
|
|
|
5564
5564
|
keyword: "enum",
|
|
5565
5565
|
schemaType: "array",
|
|
5566
5566
|
$data: true,
|
|
5567
|
-
error:
|
|
5567
|
+
error: error52,
|
|
5568
5568
|
code(cxt) {
|
|
5569
5569
|
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
5570
5570
|
if (!$data && schema.length === 0)
|
|
@@ -5643,7 +5643,7 @@ var require_additionalItems = __commonJS({
|
|
|
5643
5643
|
exports2.validateAdditionalItems = void 0;
|
|
5644
5644
|
var codegen_1 = require_codegen();
|
|
5645
5645
|
var util_1 = require_util();
|
|
5646
|
-
var
|
|
5646
|
+
var error52 = {
|
|
5647
5647
|
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
5648
5648
|
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
5649
5649
|
};
|
|
@@ -5652,7 +5652,7 @@ var require_additionalItems = __commonJS({
|
|
|
5652
5652
|
type: "array",
|
|
5653
5653
|
schemaType: ["boolean", "object"],
|
|
5654
5654
|
before: "uniqueItems",
|
|
5655
|
-
error:
|
|
5655
|
+
error: error52,
|
|
5656
5656
|
code(cxt) {
|
|
5657
5657
|
const { parentSchema, it } = cxt;
|
|
5658
5658
|
const { items } = parentSchema;
|
|
@@ -5771,7 +5771,7 @@ var require_items2020 = __commonJS({
|
|
|
5771
5771
|
var util_1 = require_util();
|
|
5772
5772
|
var code_1 = require_code2();
|
|
5773
5773
|
var additionalItems_1 = require_additionalItems();
|
|
5774
|
-
var
|
|
5774
|
+
var error52 = {
|
|
5775
5775
|
message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
|
|
5776
5776
|
params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
|
|
5777
5777
|
};
|
|
@@ -5780,7 +5780,7 @@ var require_items2020 = __commonJS({
|
|
|
5780
5780
|
type: "array",
|
|
5781
5781
|
schemaType: ["object", "boolean"],
|
|
5782
5782
|
before: "uniqueItems",
|
|
5783
|
-
error:
|
|
5783
|
+
error: error52,
|
|
5784
5784
|
code(cxt) {
|
|
5785
5785
|
const { schema, parentSchema, it } = cxt;
|
|
5786
5786
|
const { prefixItems } = parentSchema;
|
|
@@ -5804,7 +5804,7 @@ var require_contains = __commonJS({
|
|
|
5804
5804
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5805
5805
|
var codegen_1 = require_codegen();
|
|
5806
5806
|
var util_1 = require_util();
|
|
5807
|
-
var
|
|
5807
|
+
var error52 = {
|
|
5808
5808
|
message: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`,
|
|
5809
5809
|
params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`
|
|
5810
5810
|
};
|
|
@@ -5814,7 +5814,7 @@ var require_contains = __commonJS({
|
|
|
5814
5814
|
schemaType: ["object", "boolean"],
|
|
5815
5815
|
before: "uniqueItems",
|
|
5816
5816
|
trackErrors: true,
|
|
5817
|
-
error:
|
|
5817
|
+
error: error52,
|
|
5818
5818
|
code(cxt) {
|
|
5819
5819
|
const { gen, schema, parentSchema, data, it } = cxt;
|
|
5820
5820
|
let min;
|
|
@@ -5992,7 +5992,7 @@ var require_propertyNames = __commonJS({
|
|
|
5992
5992
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5993
5993
|
var codegen_1 = require_codegen();
|
|
5994
5994
|
var util_1 = require_util();
|
|
5995
|
-
var
|
|
5995
|
+
var error52 = {
|
|
5996
5996
|
message: "property name must be valid",
|
|
5997
5997
|
params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`
|
|
5998
5998
|
};
|
|
@@ -6000,7 +6000,7 @@ var require_propertyNames = __commonJS({
|
|
|
6000
6000
|
keyword: "propertyNames",
|
|
6001
6001
|
type: "object",
|
|
6002
6002
|
schemaType: ["object", "boolean"],
|
|
6003
|
-
error:
|
|
6003
|
+
error: error52,
|
|
6004
6004
|
code(cxt) {
|
|
6005
6005
|
const { gen, schema, data, it } = cxt;
|
|
6006
6006
|
if ((0, util_1.alwaysValidSchema)(it, schema))
|
|
@@ -6037,7 +6037,7 @@ var require_additionalProperties = __commonJS({
|
|
|
6037
6037
|
var codegen_1 = require_codegen();
|
|
6038
6038
|
var names_1 = require_names();
|
|
6039
6039
|
var util_1 = require_util();
|
|
6040
|
-
var
|
|
6040
|
+
var error52 = {
|
|
6041
6041
|
message: "must NOT have additional properties",
|
|
6042
6042
|
params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`
|
|
6043
6043
|
};
|
|
@@ -6047,7 +6047,7 @@ var require_additionalProperties = __commonJS({
|
|
|
6047
6047
|
schemaType: ["boolean", "object"],
|
|
6048
6048
|
allowUndefined: true,
|
|
6049
6049
|
trackErrors: true,
|
|
6050
|
-
error:
|
|
6050
|
+
error: error52,
|
|
6051
6051
|
code(cxt) {
|
|
6052
6052
|
const { gen, schema, parentSchema, data, errsCount, it } = cxt;
|
|
6053
6053
|
if (!errsCount)
|
|
@@ -6321,7 +6321,7 @@ var require_oneOf = __commonJS({
|
|
|
6321
6321
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
6322
6322
|
var codegen_1 = require_codegen();
|
|
6323
6323
|
var util_1 = require_util();
|
|
6324
|
-
var
|
|
6324
|
+
var error52 = {
|
|
6325
6325
|
message: "must match exactly one schema in oneOf",
|
|
6326
6326
|
params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`
|
|
6327
6327
|
};
|
|
@@ -6329,7 +6329,7 @@ var require_oneOf = __commonJS({
|
|
|
6329
6329
|
keyword: "oneOf",
|
|
6330
6330
|
schemaType: "array",
|
|
6331
6331
|
trackErrors: true,
|
|
6332
|
-
error:
|
|
6332
|
+
error: error52,
|
|
6333
6333
|
code(cxt) {
|
|
6334
6334
|
const { gen, schema, parentSchema, it } = cxt;
|
|
6335
6335
|
if (!Array.isArray(schema))
|
|
@@ -6406,7 +6406,7 @@ var require_if = __commonJS({
|
|
|
6406
6406
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
6407
6407
|
var codegen_1 = require_codegen();
|
|
6408
6408
|
var util_1 = require_util();
|
|
6409
|
-
var
|
|
6409
|
+
var error52 = {
|
|
6410
6410
|
message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`,
|
|
6411
6411
|
params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`
|
|
6412
6412
|
};
|
|
@@ -6414,7 +6414,7 @@ var require_if = __commonJS({
|
|
|
6414
6414
|
keyword: "if",
|
|
6415
6415
|
schemaType: ["object", "boolean"],
|
|
6416
6416
|
trackErrors: true,
|
|
6417
|
-
error:
|
|
6417
|
+
error: error52,
|
|
6418
6418
|
code(cxt) {
|
|
6419
6419
|
const { gen, parentSchema, it } = cxt;
|
|
6420
6420
|
if (parentSchema.then === void 0 && parentSchema.else === void 0) {
|
|
@@ -6540,7 +6540,7 @@ var require_format = __commonJS({
|
|
|
6540
6540
|
"use strict";
|
|
6541
6541
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
6542
6542
|
var codegen_1 = require_codegen();
|
|
6543
|
-
var
|
|
6543
|
+
var error52 = {
|
|
6544
6544
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
|
|
6545
6545
|
params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
|
|
6546
6546
|
};
|
|
@@ -6549,7 +6549,7 @@ var require_format = __commonJS({
|
|
|
6549
6549
|
type: ["number", "string"],
|
|
6550
6550
|
schemaType: "string",
|
|
6551
6551
|
$data: true,
|
|
6552
|
-
error:
|
|
6552
|
+
error: error52,
|
|
6553
6553
|
code(cxt, ruleType) {
|
|
6554
6554
|
const { gen, data, $data, schema, schemaCode, it } = cxt;
|
|
6555
6555
|
const { opts, errSchemaPath, schemaEnv, self } = it;
|
|
@@ -6704,7 +6704,7 @@ var require_discriminator = __commonJS({
|
|
|
6704
6704
|
var compile_1 = require_compile();
|
|
6705
6705
|
var ref_error_1 = require_ref_error();
|
|
6706
6706
|
var util_1 = require_util();
|
|
6707
|
-
var
|
|
6707
|
+
var error52 = {
|
|
6708
6708
|
message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
|
|
6709
6709
|
params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
|
|
6710
6710
|
};
|
|
@@ -6712,7 +6712,7 @@ var require_discriminator = __commonJS({
|
|
|
6712
6712
|
keyword: "discriminator",
|
|
6713
6713
|
type: "object",
|
|
6714
6714
|
schemaType: "object",
|
|
6715
|
-
error:
|
|
6715
|
+
error: error52,
|
|
6716
6716
|
code(cxt) {
|
|
6717
6717
|
const { gen, data, schema, parentSchema, it } = cxt;
|
|
6718
6718
|
const { oneOf } = parentSchema;
|
|
@@ -7044,10 +7044,10 @@ var require_is = __commonJS({
|
|
|
7044
7044
|
return typeof value === "number" || value instanceof Number;
|
|
7045
7045
|
}
|
|
7046
7046
|
exports2.number = number4;
|
|
7047
|
-
function
|
|
7047
|
+
function error52(value) {
|
|
7048
7048
|
return value instanceof Error;
|
|
7049
7049
|
}
|
|
7050
|
-
exports2.error =
|
|
7050
|
+
exports2.error = error52;
|
|
7051
7051
|
function func(value) {
|
|
7052
7052
|
return typeof value === "function";
|
|
7053
7053
|
}
|
|
@@ -7089,10 +7089,10 @@ var require_is2 = __commonJS({
|
|
|
7089
7089
|
return typeof value === "number" || value instanceof Number;
|
|
7090
7090
|
}
|
|
7091
7091
|
exports2.number = number4;
|
|
7092
|
-
function
|
|
7092
|
+
function error52(value) {
|
|
7093
7093
|
return value instanceof Error;
|
|
7094
7094
|
}
|
|
7095
|
-
exports2.error =
|
|
7095
|
+
exports2.error = error52;
|
|
7096
7096
|
function func(value) {
|
|
7097
7097
|
return typeof value === "function";
|
|
7098
7098
|
}
|
|
@@ -8154,8 +8154,8 @@ var require_messageReader = __commonJS({
|
|
|
8154
8154
|
get onError() {
|
|
8155
8155
|
return this.errorEmitter.event;
|
|
8156
8156
|
}
|
|
8157
|
-
fireError(
|
|
8158
|
-
this.errorEmitter.fire(this.asError(
|
|
8157
|
+
fireError(error52) {
|
|
8158
|
+
this.errorEmitter.fire(this.asError(error52));
|
|
8159
8159
|
}
|
|
8160
8160
|
get onClose() {
|
|
8161
8161
|
return this.closeEmitter.event;
|
|
@@ -8169,11 +8169,11 @@ var require_messageReader = __commonJS({
|
|
|
8169
8169
|
firePartialMessage(info) {
|
|
8170
8170
|
this.partialMessageEmitter.fire(info);
|
|
8171
8171
|
}
|
|
8172
|
-
asError(
|
|
8173
|
-
if (
|
|
8174
|
-
return
|
|
8172
|
+
asError(error52) {
|
|
8173
|
+
if (error52 instanceof Error) {
|
|
8174
|
+
return error52;
|
|
8175
8175
|
} else {
|
|
8176
|
-
return new Error(`Reader received error. Reason: ${Is.string(
|
|
8176
|
+
return new Error(`Reader received error. Reason: ${Is.string(error52.message) ? error52.message : "unknown"}`);
|
|
8177
8177
|
}
|
|
8178
8178
|
}
|
|
8179
8179
|
};
|
|
@@ -8243,7 +8243,7 @@ var require_messageReader = __commonJS({
|
|
|
8243
8243
|
const result = this.readable.onData((data) => {
|
|
8244
8244
|
this.onData(data);
|
|
8245
8245
|
});
|
|
8246
|
-
this.readable.onError((
|
|
8246
|
+
this.readable.onError((error52) => this.fireError(error52));
|
|
8247
8247
|
this.readable.onClose(() => this.fireClose());
|
|
8248
8248
|
return result;
|
|
8249
8249
|
}
|
|
@@ -8280,12 +8280,12 @@ ${JSON.stringify(Object.fromEntries(headers))}`));
|
|
|
8280
8280
|
const bytes = this.options.contentDecoder !== void 0 ? await this.options.contentDecoder.decode(body) : body;
|
|
8281
8281
|
const message = await this.options.contentTypeDecoder.decode(bytes, this.options);
|
|
8282
8282
|
this.callback(message);
|
|
8283
|
-
}).catch((
|
|
8284
|
-
this.fireError(
|
|
8283
|
+
}).catch((error52) => {
|
|
8284
|
+
this.fireError(error52);
|
|
8285
8285
|
});
|
|
8286
8286
|
}
|
|
8287
|
-
} catch (
|
|
8288
|
-
this.fireError(
|
|
8287
|
+
} catch (error52) {
|
|
8288
|
+
this.fireError(error52);
|
|
8289
8289
|
}
|
|
8290
8290
|
}
|
|
8291
8291
|
clearPartialMessageTimer() {
|
|
@@ -8344,8 +8344,8 @@ var require_messageWriter = __commonJS({
|
|
|
8344
8344
|
get onError() {
|
|
8345
8345
|
return this.errorEmitter.event;
|
|
8346
8346
|
}
|
|
8347
|
-
fireError(
|
|
8348
|
-
this.errorEmitter.fire([this.asError(
|
|
8347
|
+
fireError(error52, message, count) {
|
|
8348
|
+
this.errorEmitter.fire([this.asError(error52), message, count]);
|
|
8349
8349
|
}
|
|
8350
8350
|
get onClose() {
|
|
8351
8351
|
return this.closeEmitter.event;
|
|
@@ -8353,11 +8353,11 @@ var require_messageWriter = __commonJS({
|
|
|
8353
8353
|
fireClose() {
|
|
8354
8354
|
this.closeEmitter.fire(void 0);
|
|
8355
8355
|
}
|
|
8356
|
-
asError(
|
|
8357
|
-
if (
|
|
8358
|
-
return
|
|
8356
|
+
asError(error52) {
|
|
8357
|
+
if (error52 instanceof Error) {
|
|
8358
|
+
return error52;
|
|
8359
8359
|
} else {
|
|
8360
|
-
return new Error(`Writer received error. Reason: ${Is.string(
|
|
8360
|
+
return new Error(`Writer received error. Reason: ${Is.string(error52.message) ? error52.message : "unknown"}`);
|
|
8361
8361
|
}
|
|
8362
8362
|
}
|
|
8363
8363
|
};
|
|
@@ -8380,7 +8380,7 @@ var require_messageWriter = __commonJS({
|
|
|
8380
8380
|
this.options = ResolvedMessageWriterOptions.fromOptions(options);
|
|
8381
8381
|
this.errorCount = 0;
|
|
8382
8382
|
this.writeSemaphore = new semaphore_1.Semaphore(1);
|
|
8383
|
-
this.writable.onError((
|
|
8383
|
+
this.writable.onError((error52) => this.fireError(error52));
|
|
8384
8384
|
this.writable.onClose(() => this.fireClose());
|
|
8385
8385
|
}
|
|
8386
8386
|
async write(msg) {
|
|
@@ -8397,9 +8397,9 @@ var require_messageWriter = __commonJS({
|
|
|
8397
8397
|
headers.push(ContentLength, buffer.byteLength.toString(), CRLF);
|
|
8398
8398
|
headers.push(CRLF);
|
|
8399
8399
|
return this.doWrite(msg, headers, buffer);
|
|
8400
|
-
}, (
|
|
8401
|
-
this.fireError(
|
|
8402
|
-
throw
|
|
8400
|
+
}, (error52) => {
|
|
8401
|
+
this.fireError(error52);
|
|
8402
|
+
throw error52;
|
|
8403
8403
|
});
|
|
8404
8404
|
});
|
|
8405
8405
|
}
|
|
@@ -8407,14 +8407,14 @@ var require_messageWriter = __commonJS({
|
|
|
8407
8407
|
try {
|
|
8408
8408
|
await this.writable.write(headers.join(""), "ascii");
|
|
8409
8409
|
return this.writable.write(data);
|
|
8410
|
-
} catch (
|
|
8411
|
-
this.handleError(
|
|
8412
|
-
return Promise.reject(
|
|
8410
|
+
} catch (error52) {
|
|
8411
|
+
this.handleError(error52, msg);
|
|
8412
|
+
return Promise.reject(error52);
|
|
8413
8413
|
}
|
|
8414
8414
|
}
|
|
8415
|
-
handleError(
|
|
8415
|
+
handleError(error52, msg) {
|
|
8416
8416
|
this.errorCount++;
|
|
8417
|
-
this.fireError(
|
|
8417
|
+
this.fireError(error52, msg, this.errorCount);
|
|
8418
8418
|
}
|
|
8419
8419
|
end() {
|
|
8420
8420
|
this.writable.end();
|
|
@@ -8867,8 +8867,8 @@ var require_connection = __commonJS({
|
|
|
8867
8867
|
closeEmitter.fire(void 0);
|
|
8868
8868
|
}
|
|
8869
8869
|
}
|
|
8870
|
-
function readErrorHandler(
|
|
8871
|
-
errorEmitter.fire([
|
|
8870
|
+
function readErrorHandler(error52) {
|
|
8871
|
+
errorEmitter.fire([error52, void 0, void 0]);
|
|
8872
8872
|
}
|
|
8873
8873
|
function writeErrorHandler(data) {
|
|
8874
8874
|
errorEmitter.fire(data);
|
|
@@ -8962,11 +8962,11 @@ var require_connection = __commonJS({
|
|
|
8962
8962
|
traceSendingResponse(message, method, startTime2);
|
|
8963
8963
|
messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));
|
|
8964
8964
|
}
|
|
8965
|
-
function replyError(
|
|
8965
|
+
function replyError(error52, method, startTime2) {
|
|
8966
8966
|
const message = {
|
|
8967
8967
|
jsonrpc: version2,
|
|
8968
8968
|
id: requestMessage.id,
|
|
8969
|
-
error:
|
|
8969
|
+
error: error52.toJson()
|
|
8970
8970
|
};
|
|
8971
8971
|
traceSendingResponse(message, method, startTime2);
|
|
8972
8972
|
messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));
|
|
@@ -9034,12 +9034,12 @@ var require_connection = __commonJS({
|
|
|
9034
9034
|
promise2.then((resultOrError) => {
|
|
9035
9035
|
requestTokens.delete(tokenKey);
|
|
9036
9036
|
reply(resultOrError, requestMessage.method, startTime);
|
|
9037
|
-
}, (
|
|
9037
|
+
}, (error52) => {
|
|
9038
9038
|
requestTokens.delete(tokenKey);
|
|
9039
|
-
if (
|
|
9040
|
-
replyError(
|
|
9041
|
-
} else if (
|
|
9042
|
-
replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${
|
|
9039
|
+
if (error52 instanceof messages_1.ResponseError) {
|
|
9040
|
+
replyError(error52, requestMessage.method, startTime);
|
|
9041
|
+
} else if (error52 && Is.string(error52.message)) {
|
|
9042
|
+
replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error52.message}`), requestMessage.method, startTime);
|
|
9043
9043
|
} else {
|
|
9044
9044
|
replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
|
|
9045
9045
|
}
|
|
@@ -9048,12 +9048,12 @@ var require_connection = __commonJS({
|
|
|
9048
9048
|
requestTokens.delete(tokenKey);
|
|
9049
9049
|
reply(handlerResult, requestMessage.method, startTime);
|
|
9050
9050
|
}
|
|
9051
|
-
} catch (
|
|
9051
|
+
} catch (error52) {
|
|
9052
9052
|
requestTokens.delete(tokenKey);
|
|
9053
|
-
if (
|
|
9054
|
-
reply(
|
|
9055
|
-
} else if (
|
|
9056
|
-
replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${
|
|
9053
|
+
if (error52 instanceof messages_1.ResponseError) {
|
|
9054
|
+
reply(error52, requestMessage.method, startTime);
|
|
9055
|
+
} else if (error52 && Is.string(error52.message)) {
|
|
9056
|
+
replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error52.message}`), requestMessage.method, startTime);
|
|
9057
9057
|
} else {
|
|
9058
9058
|
replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
|
|
9059
9059
|
}
|
|
@@ -9081,16 +9081,16 @@ ${JSON.stringify(responseMessage.error, void 0, 4)}`);
|
|
|
9081
9081
|
responsePromises.delete(key);
|
|
9082
9082
|
try {
|
|
9083
9083
|
if (responseMessage.error) {
|
|
9084
|
-
const
|
|
9085
|
-
responsePromise.reject(new messages_1.ResponseError(
|
|
9084
|
+
const error52 = responseMessage.error;
|
|
9085
|
+
responsePromise.reject(new messages_1.ResponseError(error52.code, error52.message, error52.data));
|
|
9086
9086
|
} else if (responseMessage.result !== void 0) {
|
|
9087
9087
|
responsePromise.resolve(responseMessage.result);
|
|
9088
9088
|
} else {
|
|
9089
9089
|
throw new Error("Should never happen.");
|
|
9090
9090
|
}
|
|
9091
|
-
} catch (
|
|
9092
|
-
if (
|
|
9093
|
-
logger.error(`Response handler '${responsePromise.method}' failed with message: ${
|
|
9091
|
+
} catch (error52) {
|
|
9092
|
+
if (error52.message) {
|
|
9093
|
+
logger.error(`Response handler '${responsePromise.method}' failed with message: ${error52.message}`);
|
|
9094
9094
|
} else {
|
|
9095
9095
|
logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);
|
|
9096
9096
|
}
|
|
@@ -9151,9 +9151,9 @@ ${JSON.stringify(responseMessage.error, void 0, 4)}`);
|
|
|
9151
9151
|
} else if (starNotificationHandler) {
|
|
9152
9152
|
starNotificationHandler(message.method, message.params);
|
|
9153
9153
|
}
|
|
9154
|
-
} catch (
|
|
9155
|
-
if (
|
|
9156
|
-
logger.error(`Notification handler '${message.method}' failed with message: ${
|
|
9154
|
+
} catch (error52) {
|
|
9155
|
+
if (error52.message) {
|
|
9156
|
+
logger.error(`Notification handler '${message.method}' failed with message: ${error52.message}`);
|
|
9157
9157
|
} else {
|
|
9158
9158
|
logger.error(`Notification handler '${message.method}' failed unexpectedly.`);
|
|
9159
9159
|
}
|
|
@@ -9311,8 +9311,8 @@ ${JSON.stringify(message, null, 4)}`);
|
|
|
9311
9311
|
}
|
|
9312
9312
|
}
|
|
9313
9313
|
if (responsePromise) {
|
|
9314
|
-
const
|
|
9315
|
-
tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${
|
|
9314
|
+
const error52 = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : "";
|
|
9315
|
+
tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error52}`, data);
|
|
9316
9316
|
} else {
|
|
9317
9317
|
tracer.log(`Received response ${message.id} without active response promise.`, data);
|
|
9318
9318
|
}
|
|
@@ -9451,9 +9451,9 @@ ${JSON.stringify(message, null, 4)}`);
|
|
|
9451
9451
|
params: messageParams
|
|
9452
9452
|
};
|
|
9453
9453
|
traceSendingNotification(notificationMessage);
|
|
9454
|
-
return messageWriter.write(notificationMessage).catch((
|
|
9454
|
+
return messageWriter.write(notificationMessage).catch((error52) => {
|
|
9455
9455
|
logger.error(`Sending notification failed.`);
|
|
9456
|
-
throw
|
|
9456
|
+
throw error52;
|
|
9457
9457
|
});
|
|
9458
9458
|
},
|
|
9459
9459
|
onNotification: (type, handler) => {
|
|
@@ -9578,10 +9578,10 @@ ${JSON.stringify(message, null, 4)}`);
|
|
|
9578
9578
|
try {
|
|
9579
9579
|
await messageWriter.write(requestMessage);
|
|
9580
9580
|
responsePromises.set(id, responsePromise);
|
|
9581
|
-
} catch (
|
|
9581
|
+
} catch (error52) {
|
|
9582
9582
|
logger.error(`Sending request failed.`);
|
|
9583
|
-
responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError,
|
|
9584
|
-
throw
|
|
9583
|
+
responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, error52.message ? error52.message : "Unknown reason"));
|
|
9584
|
+
throw error52;
|
|
9585
9585
|
}
|
|
9586
9586
|
});
|
|
9587
9587
|
},
|
|
@@ -9654,9 +9654,9 @@ ${JSON.stringify(message, null, 4)}`);
|
|
|
9654
9654
|
}
|
|
9655
9655
|
state = ConnectionState.Disposed;
|
|
9656
9656
|
disposeEmitter.fire(void 0);
|
|
9657
|
-
const
|
|
9657
|
+
const error52 = new messages_1.ResponseError(messages_1.ErrorCodes.PendingResponseRejected, "Pending response rejected since connection got disposed");
|
|
9658
9658
|
for (const promise2 of responsePromises.values()) {
|
|
9659
|
-
promise2.reject(
|
|
9659
|
+
promise2.reject(error52);
|
|
9660
9660
|
}
|
|
9661
9661
|
responsePromises = /* @__PURE__ */ new Map();
|
|
9662
9662
|
requestTokens = /* @__PURE__ */ new Map();
|
|
@@ -9977,11 +9977,11 @@ var require_ril = __commonJS({
|
|
|
9977
9977
|
}
|
|
9978
9978
|
write(data, encoding) {
|
|
9979
9979
|
return new Promise((resolve, reject) => {
|
|
9980
|
-
const callback = (
|
|
9981
|
-
if (
|
|
9980
|
+
const callback = (error52) => {
|
|
9981
|
+
if (error52 === void 0 || error52 === null) {
|
|
9982
9982
|
resolve();
|
|
9983
9983
|
} else {
|
|
9984
|
-
reject(
|
|
9984
|
+
reject(error52);
|
|
9985
9985
|
}
|
|
9986
9986
|
};
|
|
9987
9987
|
if (typeof data === "string") {
|
|
@@ -10093,7 +10093,7 @@ var require_main = __commonJS({
|
|
|
10093
10093
|
super();
|
|
10094
10094
|
this.process = process3;
|
|
10095
10095
|
let eventEmitter = this.process;
|
|
10096
|
-
eventEmitter.on("error", (
|
|
10096
|
+
eventEmitter.on("error", (error52) => this.fireError(error52));
|
|
10097
10097
|
eventEmitter.on("close", () => this.fireClose());
|
|
10098
10098
|
}
|
|
10099
10099
|
listen(callback) {
|
|
@@ -10108,30 +10108,30 @@ var require_main = __commonJS({
|
|
|
10108
10108
|
this.process = process3;
|
|
10109
10109
|
this.errorCount = 0;
|
|
10110
10110
|
const eventEmitter = this.process;
|
|
10111
|
-
eventEmitter.on("error", (
|
|
10111
|
+
eventEmitter.on("error", (error52) => this.fireError(error52));
|
|
10112
10112
|
eventEmitter.on("close", () => this.fireClose);
|
|
10113
10113
|
}
|
|
10114
10114
|
write(msg) {
|
|
10115
10115
|
try {
|
|
10116
10116
|
if (typeof this.process.send === "function") {
|
|
10117
|
-
this.process.send(msg, void 0, void 0, (
|
|
10118
|
-
if (
|
|
10117
|
+
this.process.send(msg, void 0, void 0, (error52) => {
|
|
10118
|
+
if (error52) {
|
|
10119
10119
|
this.errorCount++;
|
|
10120
|
-
this.handleError(
|
|
10120
|
+
this.handleError(error52, msg);
|
|
10121
10121
|
} else {
|
|
10122
10122
|
this.errorCount = 0;
|
|
10123
10123
|
}
|
|
10124
10124
|
});
|
|
10125
10125
|
}
|
|
10126
10126
|
return Promise.resolve();
|
|
10127
|
-
} catch (
|
|
10128
|
-
this.handleError(
|
|
10129
|
-
return Promise.reject(
|
|
10127
|
+
} catch (error52) {
|
|
10128
|
+
this.handleError(error52, msg);
|
|
10129
|
+
return Promise.reject(error52);
|
|
10130
10130
|
}
|
|
10131
10131
|
}
|
|
10132
|
-
handleError(
|
|
10132
|
+
handleError(error52, msg) {
|
|
10133
10133
|
this.errorCount++;
|
|
10134
|
-
this.fireError(
|
|
10134
|
+
this.fireError(error52, msg, this.errorCount);
|
|
10135
10135
|
}
|
|
10136
10136
|
end() {
|
|
10137
10137
|
}
|
|
@@ -10142,7 +10142,7 @@ var require_main = __commonJS({
|
|
|
10142
10142
|
super();
|
|
10143
10143
|
this.onData = new api_1.Emitter();
|
|
10144
10144
|
port.on("close", () => this.fireClose);
|
|
10145
|
-
port.on("error", (
|
|
10145
|
+
port.on("error", (error52) => this.fireError(error52));
|
|
10146
10146
|
port.on("message", (message) => {
|
|
10147
10147
|
this.onData.fire(message);
|
|
10148
10148
|
});
|
|
@@ -10158,20 +10158,20 @@ var require_main = __commonJS({
|
|
|
10158
10158
|
this.port = port;
|
|
10159
10159
|
this.errorCount = 0;
|
|
10160
10160
|
port.on("close", () => this.fireClose());
|
|
10161
|
-
port.on("error", (
|
|
10161
|
+
port.on("error", (error52) => this.fireError(error52));
|
|
10162
10162
|
}
|
|
10163
10163
|
write(msg) {
|
|
10164
10164
|
try {
|
|
10165
10165
|
this.port.postMessage(msg);
|
|
10166
10166
|
return Promise.resolve();
|
|
10167
|
-
} catch (
|
|
10168
|
-
this.handleError(
|
|
10169
|
-
return Promise.reject(
|
|
10167
|
+
} catch (error52) {
|
|
10168
|
+
this.handleError(error52, msg);
|
|
10169
|
+
return Promise.reject(error52);
|
|
10170
10170
|
}
|
|
10171
10171
|
}
|
|
10172
|
-
handleError(
|
|
10172
|
+
handleError(error52, msg) {
|
|
10173
10173
|
this.errorCount++;
|
|
10174
|
-
this.fireError(
|
|
10174
|
+
this.fireError(error52, msg, this.errorCount);
|
|
10175
10175
|
}
|
|
10176
10176
|
end() {
|
|
10177
10177
|
}
|
|
@@ -11908,10 +11908,10 @@ var require_is3 = __commonJS({
|
|
|
11908
11908
|
return typeof value === "number" || value instanceof Number;
|
|
11909
11909
|
}
|
|
11910
11910
|
exports2.number = number4;
|
|
11911
|
-
function
|
|
11911
|
+
function error52(value) {
|
|
11912
11912
|
return value instanceof Error;
|
|
11913
11913
|
}
|
|
11914
|
-
exports2.error =
|
|
11914
|
+
exports2.error = error52;
|
|
11915
11915
|
function func(value) {
|
|
11916
11916
|
return typeof value === "function";
|
|
11917
11917
|
}
|
|
@@ -15066,7 +15066,7 @@ var require_server = __commonJS({
|
|
|
15066
15066
|
return value;
|
|
15067
15067
|
} else if (Is.thenable(value)) {
|
|
15068
15068
|
return new Promise((resolve, reject) => {
|
|
15069
|
-
value.then((resolved) => resolve(resolved), (
|
|
15069
|
+
value.then((resolved) => resolve(resolved), (error52) => reject(error52));
|
|
15070
15070
|
});
|
|
15071
15071
|
} else {
|
|
15072
15072
|
return Promise.resolve(value);
|
|
@@ -15380,8 +15380,8 @@ var require_files = __commonJS({
|
|
|
15380
15380
|
reject(new Error(`Starting process to resolve node module ${moduleName} failed`));
|
|
15381
15381
|
return;
|
|
15382
15382
|
}
|
|
15383
|
-
cp.on("error", (
|
|
15384
|
-
reject(
|
|
15383
|
+
cp.on("error", (error52) => {
|
|
15384
|
+
reject(error52);
|
|
15385
15385
|
});
|
|
15386
15386
|
cp.on("message", (message2) => {
|
|
15387
15387
|
if (message2.c === "r") {
|
|
@@ -15398,8 +15398,8 @@ var require_files = __commonJS({
|
|
|
15398
15398
|
a: moduleName
|
|
15399
15399
|
};
|
|
15400
15400
|
cp.send(message);
|
|
15401
|
-
} catch (
|
|
15402
|
-
reject(
|
|
15401
|
+
} catch (error52) {
|
|
15402
|
+
reject(error52);
|
|
15403
15403
|
}
|
|
15404
15404
|
});
|
|
15405
15405
|
}
|
|
@@ -15850,7 +15850,7 @@ var require_main4 = __commonJS({
|
|
|
15850
15850
|
console.log = function log(...args) {
|
|
15851
15851
|
logger.log(serialize(args));
|
|
15852
15852
|
};
|
|
15853
|
-
console.error = function
|
|
15853
|
+
console.error = function error52(...args) {
|
|
15854
15854
|
logger.error(serialize(args));
|
|
15855
15855
|
};
|
|
15856
15856
|
console.trace = function trace(...args) {
|
|
@@ -16069,6 +16069,106 @@ function createTextDocument(uri, text, version2 = 0, languageId = "xml") {
|
|
|
16069
16069
|
return document;
|
|
16070
16070
|
}
|
|
16071
16071
|
|
|
16072
|
+
// ../model/src/blackboard-reference.ts
|
|
16073
|
+
var BLACKBOARD_KEY_RE = /^[A-Za-z_][A-Za-z0-9_./:-]*$/;
|
|
16074
|
+
function ok(reference) {
|
|
16075
|
+
return { ok: true, reference };
|
|
16076
|
+
}
|
|
16077
|
+
function error(kind, raw, message) {
|
|
16078
|
+
return {
|
|
16079
|
+
ok: false,
|
|
16080
|
+
error: {
|
|
16081
|
+
kind,
|
|
16082
|
+
raw,
|
|
16083
|
+
message
|
|
16084
|
+
}
|
|
16085
|
+
};
|
|
16086
|
+
}
|
|
16087
|
+
function isValidKey(key) {
|
|
16088
|
+
return BLACKBOARD_KEY_RE.test(key);
|
|
16089
|
+
}
|
|
16090
|
+
function parseScopedKey(raw) {
|
|
16091
|
+
if (!raw) {
|
|
16092
|
+
return error("empty-key", raw, "Blackboard reference key must not be empty");
|
|
16093
|
+
}
|
|
16094
|
+
if (raw[0] === "@") {
|
|
16095
|
+
const key = raw.slice(1);
|
|
16096
|
+
if (!key) {
|
|
16097
|
+
return error("empty-key", raw, "Global blackboard reference key must not be empty");
|
|
16098
|
+
}
|
|
16099
|
+
if (!isValidKey(key)) {
|
|
16100
|
+
return error("invalid-global-key", raw, `Invalid global blackboard reference key: ${raw}`);
|
|
16101
|
+
}
|
|
16102
|
+
return { ok: true, scope: "global", key };
|
|
16103
|
+
}
|
|
16104
|
+
if (!isValidKey(raw)) {
|
|
16105
|
+
return error("invalid-key", raw, `Invalid blackboard reference key: ${raw}`);
|
|
16106
|
+
}
|
|
16107
|
+
return { ok: true, scope: "local", key: raw };
|
|
16108
|
+
}
|
|
16109
|
+
function parsePortBlackboardReference(input) {
|
|
16110
|
+
const { portName } = input;
|
|
16111
|
+
const rawValue = input.rawValue.trim();
|
|
16112
|
+
if (rawValue === "=" || rawValue === "{=}") {
|
|
16113
|
+
return ok({
|
|
16114
|
+
scope: "local",
|
|
16115
|
+
key: portName,
|
|
16116
|
+
raw: rawValue,
|
|
16117
|
+
syntax: "shorthand"
|
|
16118
|
+
});
|
|
16119
|
+
}
|
|
16120
|
+
if (!rawValue.startsWith("{") && !rawValue.endsWith("}")) {
|
|
16121
|
+
return error("not-a-reference", rawValue, `Not a blackboard reference: ${rawValue}`);
|
|
16122
|
+
}
|
|
16123
|
+
if (!(rawValue.startsWith("{") && rawValue.endsWith("}"))) {
|
|
16124
|
+
return error(
|
|
16125
|
+
"unbalanced-braces",
|
|
16126
|
+
rawValue,
|
|
16127
|
+
`Unbalanced blackboard reference braces: ${rawValue}`
|
|
16128
|
+
);
|
|
16129
|
+
}
|
|
16130
|
+
const body = rawValue.slice(1, -1).trim();
|
|
16131
|
+
const parsed = parseScopedKey(body);
|
|
16132
|
+
if (!parsed.ok) {
|
|
16133
|
+
return parsed;
|
|
16134
|
+
}
|
|
16135
|
+
return ok({
|
|
16136
|
+
scope: parsed.scope,
|
|
16137
|
+
key: parsed.key,
|
|
16138
|
+
raw: rawValue,
|
|
16139
|
+
syntax: "braced"
|
|
16140
|
+
});
|
|
16141
|
+
}
|
|
16142
|
+
function parseScriptBlackboardIdentifier(input) {
|
|
16143
|
+
const { rawName } = input;
|
|
16144
|
+
if (!rawName.startsWith("@")) {
|
|
16145
|
+
return error("not-a-reference", rawName, `Not a script blackboard identifier: ${rawName}`);
|
|
16146
|
+
}
|
|
16147
|
+
const parsed = parseScopedKey(rawName);
|
|
16148
|
+
if (!parsed.ok) {
|
|
16149
|
+
return parsed;
|
|
16150
|
+
}
|
|
16151
|
+
if (parsed.scope !== "global") {
|
|
16152
|
+
return error(
|
|
16153
|
+
"not-a-reference",
|
|
16154
|
+
rawName,
|
|
16155
|
+
`Script blackboard identifiers must use the global scope marker: ${rawName}`
|
|
16156
|
+
);
|
|
16157
|
+
}
|
|
16158
|
+
return ok({
|
|
16159
|
+
scope: parsed.scope,
|
|
16160
|
+
key: parsed.key,
|
|
16161
|
+
raw: rawName,
|
|
16162
|
+
syntax: "script"
|
|
16163
|
+
});
|
|
16164
|
+
}
|
|
16165
|
+
function formatBlackboardReference(reference) {
|
|
16166
|
+
return reference.scope === "global" ? `{@${reference.key}}` : `{${reference.key}}`;
|
|
16167
|
+
}
|
|
16168
|
+
function makeBlackboardIdentity(reference) {
|
|
16169
|
+
return `${reference.scope}:${reference.key}`;
|
|
16170
|
+
}
|
|
16171
|
+
|
|
16072
16172
|
// ../model/src/model.ts
|
|
16073
16173
|
var BTCPP_DIAGNOSTIC_CODES = {
|
|
16074
16174
|
DuplicateNodeModelId: "BT006_DUPLICATE_NODE_MODEL_ID"
|
|
@@ -16096,31 +16196,76 @@ function toPortSource(document, fallback = "inline-tree-nodes-model") {
|
|
|
16096
16196
|
if (document.kind === "model-document") return "external-tree-nodes-model";
|
|
16097
16197
|
return fallback;
|
|
16098
16198
|
}
|
|
16099
|
-
function
|
|
16199
|
+
function advancePosition(start, text) {
|
|
16200
|
+
let line = start.line;
|
|
16201
|
+
let character = start.character;
|
|
16202
|
+
let offset = start.offset;
|
|
16203
|
+
for (const char of text) {
|
|
16204
|
+
offset += char.length;
|
|
16205
|
+
if (char === "\n") {
|
|
16206
|
+
line += 1;
|
|
16207
|
+
character = 0;
|
|
16208
|
+
continue;
|
|
16209
|
+
}
|
|
16210
|
+
character += char.length;
|
|
16211
|
+
}
|
|
16212
|
+
return { line, character, offset };
|
|
16213
|
+
}
|
|
16214
|
+
function rangeFromRawText(start, prefix, text) {
|
|
16215
|
+
const rangeStart = advancePosition(start, prefix);
|
|
16216
|
+
const rangeEnd = advancePosition(rangeStart, text);
|
|
16217
|
+
return {
|
|
16218
|
+
start: rangeStart,
|
|
16219
|
+
end: rangeEnd
|
|
16220
|
+
};
|
|
16221
|
+
}
|
|
16222
|
+
function collectBlackboardReferences(element, refs, uri, documentText) {
|
|
16100
16223
|
for (const attr of element.attributes || []) {
|
|
16101
|
-
const
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
const
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
|
|
16108
|
-
|
|
16109
|
-
|
|
16224
|
+
const baseRange = attr.valueContentRange ?? attr.valueRange;
|
|
16225
|
+
const rawValue = documentText.slice(baseRange.start.offset, baseRange.end.offset);
|
|
16226
|
+
const collectParsedReference = (input) => {
|
|
16227
|
+
const parsed = parsePortBlackboardReference({
|
|
16228
|
+
portName: attr.name,
|
|
16229
|
+
rawValue: input.parsedRaw
|
|
16230
|
+
});
|
|
16231
|
+
if (!parsed.ok) return;
|
|
16232
|
+
const referenceLength = parsed.reference.raw.length;
|
|
16110
16233
|
refs.push({
|
|
16111
|
-
|
|
16234
|
+
raw: parsed.reference.raw,
|
|
16235
|
+
key: parsed.reference.key,
|
|
16236
|
+
scope: parsed.reference.scope,
|
|
16237
|
+
identity: makeBlackboardIdentity(parsed.reference),
|
|
16238
|
+
syntax: parsed.reference.syntax,
|
|
16112
16239
|
attributeName: attr.name,
|
|
16113
16240
|
element,
|
|
16114
16241
|
uri,
|
|
16115
|
-
range:
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16242
|
+
range: rangeFromRawText(
|
|
16243
|
+
baseRange.start,
|
|
16244
|
+
rawValue.slice(0, input.parsedOffset),
|
|
16245
|
+
parsed.reference.raw.slice(0, referenceLength)
|
|
16246
|
+
)
|
|
16119
16247
|
});
|
|
16248
|
+
};
|
|
16249
|
+
const parsedWhole = parsePortBlackboardReference({
|
|
16250
|
+
portName: attr.name,
|
|
16251
|
+
rawValue
|
|
16252
|
+
});
|
|
16253
|
+
if (parsedWhole.ok) {
|
|
16254
|
+
const parsedOffset = Math.max(0, rawValue.indexOf(parsedWhole.reference.raw));
|
|
16255
|
+
collectParsedReference({
|
|
16256
|
+
parsedRaw: parsedWhole.reference.raw,
|
|
16257
|
+
parsedOffset
|
|
16258
|
+
});
|
|
16259
|
+
continue;
|
|
16260
|
+
}
|
|
16261
|
+
for (const match of rawValue.matchAll(/\{[^}]*\}/g)) {
|
|
16262
|
+
const parsedRaw = match[0];
|
|
16263
|
+
const parsedOffset = match.index ?? 0;
|
|
16264
|
+
collectParsedReference({ parsedRaw, parsedOffset });
|
|
16120
16265
|
}
|
|
16121
16266
|
}
|
|
16122
16267
|
for (const child of element.children || []) {
|
|
16123
|
-
if (child.kind === "element") collectBlackboardReferences(child, refs, uri);
|
|
16268
|
+
if (child.kind === "element") collectBlackboardReferences(child, refs, uri, documentText);
|
|
16124
16269
|
}
|
|
16125
16270
|
}
|
|
16126
16271
|
function extractTreeNodesModel(element, uri, source, editable) {
|
|
@@ -16198,8 +16343,10 @@ function extractBehaviorTrees(root, uri) {
|
|
|
16198
16343
|
}
|
|
16199
16344
|
function extractSubTreeReferences(root, uri) {
|
|
16200
16345
|
const refs = [];
|
|
16201
|
-
const walk2 = (node, parentBehaviorTreeId) => {
|
|
16346
|
+
const walk2 = (node, parentBehaviorTreeId, inTreeNodesModel = false) => {
|
|
16347
|
+
if (inTreeNodesModel) return;
|
|
16202
16348
|
const currentBehaviorTreeId = node.name === "BehaviorTree" ? getAttr(node, "ID")?.value ?? parentBehaviorTreeId : parentBehaviorTreeId;
|
|
16349
|
+
const nextInTreeNodesModel = node.name === "TreeNodesModel";
|
|
16203
16350
|
if (node.name === "SubTree") {
|
|
16204
16351
|
const idAttr = getAttr(node, "ID");
|
|
16205
16352
|
if (idAttr) {
|
|
@@ -16216,9 +16363,10 @@ function extractSubTreeReferences(root, uri) {
|
|
|
16216
16363
|
}
|
|
16217
16364
|
}
|
|
16218
16365
|
for (const child of node.children || []) {
|
|
16219
|
-
if (child.kind === "element") walk2(child, currentBehaviorTreeId);
|
|
16366
|
+
if (child.kind === "element") walk2(child, currentBehaviorTreeId, nextInTreeNodesModel);
|
|
16220
16367
|
}
|
|
16221
16368
|
};
|
|
16369
|
+
if (root.name === "TreeNodesModel") return refs;
|
|
16222
16370
|
for (const child of root.children || []) {
|
|
16223
16371
|
if (child.kind === "element") walk2(child);
|
|
16224
16372
|
}
|
|
@@ -16279,7 +16427,11 @@ function stripSubTreeReferenceAst(def) {
|
|
|
16279
16427
|
}
|
|
16280
16428
|
function stripBlackboardReferenceAst(def) {
|
|
16281
16429
|
return {
|
|
16282
|
-
|
|
16430
|
+
raw: def.raw,
|
|
16431
|
+
key: def.key,
|
|
16432
|
+
scope: def.scope,
|
|
16433
|
+
identity: def.identity,
|
|
16434
|
+
syntax: def.syntax,
|
|
16283
16435
|
attributeName: def.attributeName,
|
|
16284
16436
|
uri: def.uri,
|
|
16285
16437
|
range: def.range
|
|
@@ -16338,7 +16490,11 @@ function extractDocumentModel(document, options) {
|
|
|
16338
16490
|
const blockModels = extractTreeNodesModel(block, uri, source, editable);
|
|
16339
16491
|
const seenInBlock = /* @__PURE__ */ new Map();
|
|
16340
16492
|
for (const model of blockModels) {
|
|
16341
|
-
if (addTreeNodeModelToCollections({
|
|
16493
|
+
if (addTreeNodeModelToCollections({
|
|
16494
|
+
node: model,
|
|
16495
|
+
treeNodesModel,
|
|
16496
|
+
genericSubTreePorts
|
|
16497
|
+
})) {
|
|
16342
16498
|
continue;
|
|
16343
16499
|
}
|
|
16344
16500
|
if (seenInBlock.has(model.id)) diagnostics.push(createDuplicateNodeModelDiagnostic(model));
|
|
@@ -16348,7 +16504,7 @@ function extractDocumentModel(document, options) {
|
|
|
16348
16504
|
const subtreeReferences = root ? extractSubTreeReferences(root, uri) : [];
|
|
16349
16505
|
const blackboardReferences = root ? (() => {
|
|
16350
16506
|
const refs = [];
|
|
16351
|
-
collectBlackboardReferences(root, refs, uri);
|
|
16507
|
+
collectBlackboardReferences(root, refs, uri, document.originalText);
|
|
16352
16508
|
return refs;
|
|
16353
16509
|
})() : [];
|
|
16354
16510
|
const rootMainTreeToExecute = root ? getAttr(root, "main_tree_to_execute") : void 0;
|
|
@@ -16362,7 +16518,11 @@ function extractDocumentModel(document, options) {
|
|
|
16362
16518
|
blackboardReferences,
|
|
16363
16519
|
treeNodesModel,
|
|
16364
16520
|
genericSubTreePorts,
|
|
16365
|
-
rootMainTreeToExecute: rootMainTreeToExecute ? {
|
|
16521
|
+
rootMainTreeToExecute: rootMainTreeToExecute ? {
|
|
16522
|
+
uri,
|
|
16523
|
+
range: rootMainTreeToExecute.range,
|
|
16524
|
+
value: rootMainTreeToExecute.value
|
|
16525
|
+
} : void 0
|
|
16366
16526
|
});
|
|
16367
16527
|
return {
|
|
16368
16528
|
extracted: {
|
|
@@ -16694,35 +16854,6 @@ function areTypesCompatible(registry2, left, right) {
|
|
|
16694
16854
|
}
|
|
16695
16855
|
return leftType.compatibleWith.includes(rightType.canonical) || rightType.compatibleWith.includes(leftType.canonical);
|
|
16696
16856
|
}
|
|
16697
|
-
function isBlackboardPointer(value, strippedPointer) {
|
|
16698
|
-
if (value.length < 3) {
|
|
16699
|
-
return false;
|
|
16700
|
-
}
|
|
16701
|
-
let frontIndex = 0;
|
|
16702
|
-
let lastIndex = value.length - 1;
|
|
16703
|
-
while (frontIndex <= lastIndex && value[frontIndex] === " ") {
|
|
16704
|
-
frontIndex += 1;
|
|
16705
|
-
}
|
|
16706
|
-
while (frontIndex <= lastIndex && value[lastIndex] === " ") {
|
|
16707
|
-
lastIndex -= 1;
|
|
16708
|
-
}
|
|
16709
|
-
const size = lastIndex - frontIndex + 1;
|
|
16710
|
-
const valid = size >= 3 && value[frontIndex] === "{" && value[lastIndex] === "}";
|
|
16711
|
-
if (valid && strippedPointer) {
|
|
16712
|
-
strippedPointer.current = value.slice(frontIndex + 1, lastIndex);
|
|
16713
|
-
}
|
|
16714
|
-
return valid;
|
|
16715
|
-
}
|
|
16716
|
-
function stripBlackboardPointer(value) {
|
|
16717
|
-
const strippedPointer = {};
|
|
16718
|
-
return isBlackboardPointer(value, strippedPointer) ? strippedPointer.current : void 0;
|
|
16719
|
-
}
|
|
16720
|
-
function getRemappedKey(portName, rawValue) {
|
|
16721
|
-
if (rawValue === "{=}" || rawValue === "=") {
|
|
16722
|
-
return portName;
|
|
16723
|
-
}
|
|
16724
|
-
return stripBlackboardPointer(rawValue);
|
|
16725
|
-
}
|
|
16726
16857
|
|
|
16727
16858
|
// ../model/src/generated/btcpp-v4.6.2-builtins.ts
|
|
16728
16859
|
var btcppV4_6_2BuiltinModels = [
|
|
@@ -19254,8 +19385,8 @@ function parse(text, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
19254
19385
|
currentParent = previousParents.pop();
|
|
19255
19386
|
},
|
|
19256
19387
|
onLiteralValue: onValue,
|
|
19257
|
-
onError: (
|
|
19258
|
-
errors.push({ error:
|
|
19388
|
+
onError: (error52, offset, length) => {
|
|
19389
|
+
errors.push({ error: error52, offset, length });
|
|
19259
19390
|
}
|
|
19260
19391
|
};
|
|
19261
19392
|
visit(text, visitor, options);
|
|
@@ -19308,8 +19439,8 @@ function parseTree(text, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
19308
19439
|
}
|
|
19309
19440
|
}
|
|
19310
19441
|
},
|
|
19311
|
-
onError: (
|
|
19312
|
-
errors.push({ error:
|
|
19442
|
+
onError: (error52, offset, length) => {
|
|
19443
|
+
errors.push({ error: error52, offset, length });
|
|
19313
19444
|
}
|
|
19314
19445
|
};
|
|
19315
19446
|
visit(text, visitor, options);
|
|
@@ -19457,8 +19588,8 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
19457
19588
|
}
|
|
19458
19589
|
}
|
|
19459
19590
|
}
|
|
19460
|
-
function handleError(
|
|
19461
|
-
onError(
|
|
19591
|
+
function handleError(error52, skipUntilAfter = [], skipUntil = []) {
|
|
19592
|
+
onError(error52);
|
|
19462
19593
|
if (skipUntilAfter.length + skipUntil.length > 0) {
|
|
19463
19594
|
let token = _scanner.getToken();
|
|
19464
19595
|
while (token !== 17) {
|
|
@@ -21044,10 +21175,10 @@ var initializer = (inst, def) => {
|
|
|
21044
21175
|
};
|
|
21045
21176
|
var $ZodError = $constructor("$ZodError", initializer);
|
|
21046
21177
|
var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
|
|
21047
|
-
function flattenError(
|
|
21178
|
+
function flattenError(error52, mapper = (issue2) => issue2.message) {
|
|
21048
21179
|
const fieldErrors = {};
|
|
21049
21180
|
const formErrors = [];
|
|
21050
|
-
for (const sub of
|
|
21181
|
+
for (const sub of error52.issues) {
|
|
21051
21182
|
if (sub.path.length > 0) {
|
|
21052
21183
|
fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
|
|
21053
21184
|
fieldErrors[sub.path[0]].push(mapper(sub));
|
|
@@ -21057,10 +21188,10 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
21057
21188
|
}
|
|
21058
21189
|
return { formErrors, fieldErrors };
|
|
21059
21190
|
}
|
|
21060
|
-
function formatError(
|
|
21191
|
+
function formatError(error52, mapper = (issue2) => issue2.message) {
|
|
21061
21192
|
const fieldErrors = { _errors: [] };
|
|
21062
|
-
const processError = (
|
|
21063
|
-
for (const issue2 of
|
|
21193
|
+
const processError = (error53, path4 = []) => {
|
|
21194
|
+
for (const issue2 of error53.issues) {
|
|
21064
21195
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
21065
21196
|
issue2.errors.map((issues) => processError({ issues }, [...path4, ...issue2.path]));
|
|
21066
21197
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -21090,14 +21221,14 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
21090
21221
|
}
|
|
21091
21222
|
}
|
|
21092
21223
|
};
|
|
21093
|
-
processError(
|
|
21224
|
+
processError(error52);
|
|
21094
21225
|
return fieldErrors;
|
|
21095
21226
|
}
|
|
21096
|
-
function treeifyError(
|
|
21227
|
+
function treeifyError(error52, mapper = (issue2) => issue2.message) {
|
|
21097
21228
|
const result = { errors: [] };
|
|
21098
|
-
const processError = (
|
|
21229
|
+
const processError = (error53, path4 = []) => {
|
|
21099
21230
|
var _a3, _b;
|
|
21100
|
-
for (const issue2 of
|
|
21231
|
+
for (const issue2 of error53.issues) {
|
|
21101
21232
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
21102
21233
|
issue2.errors.map((issues) => processError({ issues }, [...path4, ...issue2.path]));
|
|
21103
21234
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -21132,7 +21263,7 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
21132
21263
|
}
|
|
21133
21264
|
}
|
|
21134
21265
|
};
|
|
21135
|
-
processError(
|
|
21266
|
+
processError(error52);
|
|
21136
21267
|
return result;
|
|
21137
21268
|
}
|
|
21138
21269
|
function toDotPath(_path) {
|
|
@@ -21153,9 +21284,9 @@ function toDotPath(_path) {
|
|
|
21153
21284
|
}
|
|
21154
21285
|
return segs.join("");
|
|
21155
21286
|
}
|
|
21156
|
-
function prettifyError(
|
|
21287
|
+
function prettifyError(error52) {
|
|
21157
21288
|
const lines = [];
|
|
21158
|
-
const issues = [...
|
|
21289
|
+
const issues = [...error52.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
|
|
21159
21290
|
for (const issue2 of issues) {
|
|
21160
21291
|
lines.push(`\u2716 ${issue2.message}`);
|
|
21161
21292
|
if (issue2.path?.length)
|
|
@@ -24153,7 +24284,7 @@ __export(locales_exports, {
|
|
|
24153
24284
|
});
|
|
24154
24285
|
|
|
24155
24286
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ar.js
|
|
24156
|
-
var
|
|
24287
|
+
var error2 = () => {
|
|
24157
24288
|
const Sizable = {
|
|
24158
24289
|
string: { unit: "\u062D\u0631\u0641", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
|
|
24159
24290
|
file: { unit: "\u0628\u0627\u064A\u062A", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
|
|
@@ -24255,12 +24386,12 @@ var error = () => {
|
|
|
24255
24386
|
};
|
|
24256
24387
|
function ar_default() {
|
|
24257
24388
|
return {
|
|
24258
|
-
localeError:
|
|
24389
|
+
localeError: error2()
|
|
24259
24390
|
};
|
|
24260
24391
|
}
|
|
24261
24392
|
|
|
24262
24393
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/az.js
|
|
24263
|
-
var
|
|
24394
|
+
var error3 = () => {
|
|
24264
24395
|
const Sizable = {
|
|
24265
24396
|
string: { unit: "simvol", verb: "olmal\u0131d\u0131r" },
|
|
24266
24397
|
file: { unit: "bayt", verb: "olmal\u0131d\u0131r" },
|
|
@@ -24361,7 +24492,7 @@ var error2 = () => {
|
|
|
24361
24492
|
};
|
|
24362
24493
|
function az_default() {
|
|
24363
24494
|
return {
|
|
24364
|
-
localeError:
|
|
24495
|
+
localeError: error3()
|
|
24365
24496
|
};
|
|
24366
24497
|
}
|
|
24367
24498
|
|
|
@@ -24381,7 +24512,7 @@ function getBelarusianPlural(count, one, few, many) {
|
|
|
24381
24512
|
}
|
|
24382
24513
|
return many;
|
|
24383
24514
|
}
|
|
24384
|
-
var
|
|
24515
|
+
var error4 = () => {
|
|
24385
24516
|
const Sizable = {
|
|
24386
24517
|
string: {
|
|
24387
24518
|
unit: {
|
|
@@ -24518,12 +24649,12 @@ var error3 = () => {
|
|
|
24518
24649
|
};
|
|
24519
24650
|
function be_default() {
|
|
24520
24651
|
return {
|
|
24521
|
-
localeError:
|
|
24652
|
+
localeError: error4()
|
|
24522
24653
|
};
|
|
24523
24654
|
}
|
|
24524
24655
|
|
|
24525
24656
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/bg.js
|
|
24526
|
-
var
|
|
24657
|
+
var error5 = () => {
|
|
24527
24658
|
const Sizable = {
|
|
24528
24659
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
|
|
24529
24660
|
file: { unit: "\u0431\u0430\u0439\u0442\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
|
|
@@ -24639,12 +24770,12 @@ var error4 = () => {
|
|
|
24639
24770
|
};
|
|
24640
24771
|
function bg_default() {
|
|
24641
24772
|
return {
|
|
24642
|
-
localeError:
|
|
24773
|
+
localeError: error5()
|
|
24643
24774
|
};
|
|
24644
24775
|
}
|
|
24645
24776
|
|
|
24646
24777
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ca.js
|
|
24647
|
-
var
|
|
24778
|
+
var error6 = () => {
|
|
24648
24779
|
const Sizable = {
|
|
24649
24780
|
string: { unit: "car\xE0cters", verb: "contenir" },
|
|
24650
24781
|
file: { unit: "bytes", verb: "contenir" },
|
|
@@ -24748,12 +24879,12 @@ var error5 = () => {
|
|
|
24748
24879
|
};
|
|
24749
24880
|
function ca_default() {
|
|
24750
24881
|
return {
|
|
24751
|
-
localeError:
|
|
24882
|
+
localeError: error6()
|
|
24752
24883
|
};
|
|
24753
24884
|
}
|
|
24754
24885
|
|
|
24755
24886
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/cs.js
|
|
24756
|
-
var
|
|
24887
|
+
var error7 = () => {
|
|
24757
24888
|
const Sizable = {
|
|
24758
24889
|
string: { unit: "znak\u016F", verb: "m\xEDt" },
|
|
24759
24890
|
file: { unit: "bajt\u016F", verb: "m\xEDt" },
|
|
@@ -24860,12 +24991,12 @@ var error6 = () => {
|
|
|
24860
24991
|
};
|
|
24861
24992
|
function cs_default() {
|
|
24862
24993
|
return {
|
|
24863
|
-
localeError:
|
|
24994
|
+
localeError: error7()
|
|
24864
24995
|
};
|
|
24865
24996
|
}
|
|
24866
24997
|
|
|
24867
24998
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/da.js
|
|
24868
|
-
var
|
|
24999
|
+
var error8 = () => {
|
|
24869
25000
|
const Sizable = {
|
|
24870
25001
|
string: { unit: "tegn", verb: "havde" },
|
|
24871
25002
|
file: { unit: "bytes", verb: "havde" },
|
|
@@ -24976,12 +25107,12 @@ var error7 = () => {
|
|
|
24976
25107
|
};
|
|
24977
25108
|
function da_default() {
|
|
24978
25109
|
return {
|
|
24979
|
-
localeError:
|
|
25110
|
+
localeError: error8()
|
|
24980
25111
|
};
|
|
24981
25112
|
}
|
|
24982
25113
|
|
|
24983
25114
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/de.js
|
|
24984
|
-
var
|
|
25115
|
+
var error9 = () => {
|
|
24985
25116
|
const Sizable = {
|
|
24986
25117
|
string: { unit: "Zeichen", verb: "zu haben" },
|
|
24987
25118
|
file: { unit: "Bytes", verb: "zu haben" },
|
|
@@ -25085,12 +25216,12 @@ var error8 = () => {
|
|
|
25085
25216
|
};
|
|
25086
25217
|
function de_default() {
|
|
25087
25218
|
return {
|
|
25088
|
-
localeError:
|
|
25219
|
+
localeError: error9()
|
|
25089
25220
|
};
|
|
25090
25221
|
}
|
|
25091
25222
|
|
|
25092
25223
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/el.js
|
|
25093
|
-
var
|
|
25224
|
+
var error10 = () => {
|
|
25094
25225
|
const Sizable = {
|
|
25095
25226
|
string: { unit: "\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
|
|
25096
25227
|
file: { unit: "bytes", verb: "\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9" },
|
|
@@ -25195,12 +25326,12 @@ var error9 = () => {
|
|
|
25195
25326
|
};
|
|
25196
25327
|
function el_default() {
|
|
25197
25328
|
return {
|
|
25198
|
-
localeError:
|
|
25329
|
+
localeError: error10()
|
|
25199
25330
|
};
|
|
25200
25331
|
}
|
|
25201
25332
|
|
|
25202
25333
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/en.js
|
|
25203
|
-
var
|
|
25334
|
+
var error11 = () => {
|
|
25204
25335
|
const Sizable = {
|
|
25205
25336
|
string: { unit: "characters", verb: "to have" },
|
|
25206
25337
|
file: { unit: "bytes", verb: "to have" },
|
|
@@ -25308,12 +25439,12 @@ var error10 = () => {
|
|
|
25308
25439
|
};
|
|
25309
25440
|
function en_default() {
|
|
25310
25441
|
return {
|
|
25311
|
-
localeError:
|
|
25442
|
+
localeError: error11()
|
|
25312
25443
|
};
|
|
25313
25444
|
}
|
|
25314
25445
|
|
|
25315
25446
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/eo.js
|
|
25316
|
-
var
|
|
25447
|
+
var error12 = () => {
|
|
25317
25448
|
const Sizable = {
|
|
25318
25449
|
string: { unit: "karaktrojn", verb: "havi" },
|
|
25319
25450
|
file: { unit: "bajtojn", verb: "havi" },
|
|
@@ -25418,12 +25549,12 @@ var error11 = () => {
|
|
|
25418
25549
|
};
|
|
25419
25550
|
function eo_default() {
|
|
25420
25551
|
return {
|
|
25421
|
-
localeError:
|
|
25552
|
+
localeError: error12()
|
|
25422
25553
|
};
|
|
25423
25554
|
}
|
|
25424
25555
|
|
|
25425
25556
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/es.js
|
|
25426
|
-
var
|
|
25557
|
+
var error13 = () => {
|
|
25427
25558
|
const Sizable = {
|
|
25428
25559
|
string: { unit: "caracteres", verb: "tener" },
|
|
25429
25560
|
file: { unit: "bytes", verb: "tener" },
|
|
@@ -25551,12 +25682,12 @@ var error12 = () => {
|
|
|
25551
25682
|
};
|
|
25552
25683
|
function es_default() {
|
|
25553
25684
|
return {
|
|
25554
|
-
localeError:
|
|
25685
|
+
localeError: error13()
|
|
25555
25686
|
};
|
|
25556
25687
|
}
|
|
25557
25688
|
|
|
25558
25689
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/fa.js
|
|
25559
|
-
var
|
|
25690
|
+
var error14 = () => {
|
|
25560
25691
|
const Sizable = {
|
|
25561
25692
|
string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
|
|
25562
25693
|
file: { unit: "\u0628\u0627\u06CC\u062A", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
|
|
@@ -25666,12 +25797,12 @@ var error13 = () => {
|
|
|
25666
25797
|
};
|
|
25667
25798
|
function fa_default() {
|
|
25668
25799
|
return {
|
|
25669
|
-
localeError:
|
|
25800
|
+
localeError: error14()
|
|
25670
25801
|
};
|
|
25671
25802
|
}
|
|
25672
25803
|
|
|
25673
25804
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/fi.js
|
|
25674
|
-
var
|
|
25805
|
+
var error15 = () => {
|
|
25675
25806
|
const Sizable = {
|
|
25676
25807
|
string: { unit: "merkki\xE4", subject: "merkkijonon" },
|
|
25677
25808
|
file: { unit: "tavua", subject: "tiedoston" },
|
|
@@ -25779,12 +25910,12 @@ var error14 = () => {
|
|
|
25779
25910
|
};
|
|
25780
25911
|
function fi_default() {
|
|
25781
25912
|
return {
|
|
25782
|
-
localeError:
|
|
25913
|
+
localeError: error15()
|
|
25783
25914
|
};
|
|
25784
25915
|
}
|
|
25785
25916
|
|
|
25786
25917
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/fr.js
|
|
25787
|
-
var
|
|
25918
|
+
var error16 = () => {
|
|
25788
25919
|
const Sizable = {
|
|
25789
25920
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
25790
25921
|
file: { unit: "octets", verb: "avoir" },
|
|
@@ -25905,12 +26036,12 @@ var error15 = () => {
|
|
|
25905
26036
|
};
|
|
25906
26037
|
function fr_default() {
|
|
25907
26038
|
return {
|
|
25908
|
-
localeError:
|
|
26039
|
+
localeError: error16()
|
|
25909
26040
|
};
|
|
25910
26041
|
}
|
|
25911
26042
|
|
|
25912
26043
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/fr-CA.js
|
|
25913
|
-
var
|
|
26044
|
+
var error17 = () => {
|
|
25914
26045
|
const Sizable = {
|
|
25915
26046
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
25916
26047
|
file: { unit: "octets", verb: "avoir" },
|
|
@@ -26013,12 +26144,12 @@ var error16 = () => {
|
|
|
26013
26144
|
};
|
|
26014
26145
|
function fr_CA_default() {
|
|
26015
26146
|
return {
|
|
26016
|
-
localeError:
|
|
26147
|
+
localeError: error17()
|
|
26017
26148
|
};
|
|
26018
26149
|
}
|
|
26019
26150
|
|
|
26020
26151
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/he.js
|
|
26021
|
-
var
|
|
26152
|
+
var error18 = () => {
|
|
26022
26153
|
const TypeNames = {
|
|
26023
26154
|
string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" },
|
|
26024
26155
|
number: { label: "\u05DE\u05E1\u05E4\u05E8", gender: "m" },
|
|
@@ -26208,12 +26339,12 @@ var error17 = () => {
|
|
|
26208
26339
|
};
|
|
26209
26340
|
function he_default() {
|
|
26210
26341
|
return {
|
|
26211
|
-
localeError:
|
|
26342
|
+
localeError: error18()
|
|
26212
26343
|
};
|
|
26213
26344
|
}
|
|
26214
26345
|
|
|
26215
26346
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/hr.js
|
|
26216
|
-
var
|
|
26347
|
+
var error19 = () => {
|
|
26217
26348
|
const Sizable = {
|
|
26218
26349
|
string: { unit: "znakova", verb: "imati" },
|
|
26219
26350
|
file: { unit: "bajtova", verb: "imati" },
|
|
@@ -26331,12 +26462,12 @@ var error18 = () => {
|
|
|
26331
26462
|
};
|
|
26332
26463
|
function hr_default() {
|
|
26333
26464
|
return {
|
|
26334
|
-
localeError:
|
|
26465
|
+
localeError: error19()
|
|
26335
26466
|
};
|
|
26336
26467
|
}
|
|
26337
26468
|
|
|
26338
26469
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/hu.js
|
|
26339
|
-
var
|
|
26470
|
+
var error20 = () => {
|
|
26340
26471
|
const Sizable = {
|
|
26341
26472
|
string: { unit: "karakter", verb: "legyen" },
|
|
26342
26473
|
file: { unit: "byte", verb: "legyen" },
|
|
@@ -26440,7 +26571,7 @@ var error19 = () => {
|
|
|
26440
26571
|
};
|
|
26441
26572
|
function hu_default() {
|
|
26442
26573
|
return {
|
|
26443
|
-
localeError:
|
|
26574
|
+
localeError: error20()
|
|
26444
26575
|
};
|
|
26445
26576
|
}
|
|
26446
26577
|
|
|
@@ -26455,7 +26586,7 @@ function withDefiniteArticle(word) {
|
|
|
26455
26586
|
const lastChar = word[word.length - 1];
|
|
26456
26587
|
return word + (vowels.includes(lastChar) ? "\u0576" : "\u0568");
|
|
26457
26588
|
}
|
|
26458
|
-
var
|
|
26589
|
+
var error21 = () => {
|
|
26459
26590
|
const Sizable = {
|
|
26460
26591
|
string: {
|
|
26461
26592
|
unit: {
|
|
@@ -26588,12 +26719,12 @@ var error20 = () => {
|
|
|
26588
26719
|
};
|
|
26589
26720
|
function hy_default() {
|
|
26590
26721
|
return {
|
|
26591
|
-
localeError:
|
|
26722
|
+
localeError: error21()
|
|
26592
26723
|
};
|
|
26593
26724
|
}
|
|
26594
26725
|
|
|
26595
26726
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/id.js
|
|
26596
|
-
var
|
|
26727
|
+
var error22 = () => {
|
|
26597
26728
|
const Sizable = {
|
|
26598
26729
|
string: { unit: "karakter", verb: "memiliki" },
|
|
26599
26730
|
file: { unit: "byte", verb: "memiliki" },
|
|
@@ -26695,12 +26826,12 @@ var error21 = () => {
|
|
|
26695
26826
|
};
|
|
26696
26827
|
function id_default() {
|
|
26697
26828
|
return {
|
|
26698
|
-
localeError:
|
|
26829
|
+
localeError: error22()
|
|
26699
26830
|
};
|
|
26700
26831
|
}
|
|
26701
26832
|
|
|
26702
26833
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/is.js
|
|
26703
|
-
var
|
|
26834
|
+
var error23 = () => {
|
|
26704
26835
|
const Sizable = {
|
|
26705
26836
|
string: { unit: "stafi", verb: "a\xF0 hafa" },
|
|
26706
26837
|
file: { unit: "b\xE6ti", verb: "a\xF0 hafa" },
|
|
@@ -26805,12 +26936,12 @@ var error22 = () => {
|
|
|
26805
26936
|
};
|
|
26806
26937
|
function is_default() {
|
|
26807
26938
|
return {
|
|
26808
|
-
localeError:
|
|
26939
|
+
localeError: error23()
|
|
26809
26940
|
};
|
|
26810
26941
|
}
|
|
26811
26942
|
|
|
26812
26943
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/it.js
|
|
26813
|
-
var
|
|
26944
|
+
var error24 = () => {
|
|
26814
26945
|
const Sizable = {
|
|
26815
26946
|
string: { unit: "caratteri", verb: "avere" },
|
|
26816
26947
|
file: { unit: "byte", verb: "avere" },
|
|
@@ -26914,12 +27045,12 @@ var error23 = () => {
|
|
|
26914
27045
|
};
|
|
26915
27046
|
function it_default() {
|
|
26916
27047
|
return {
|
|
26917
|
-
localeError:
|
|
27048
|
+
localeError: error24()
|
|
26918
27049
|
};
|
|
26919
27050
|
}
|
|
26920
27051
|
|
|
26921
27052
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ja.js
|
|
26922
|
-
var
|
|
27053
|
+
var error25 = () => {
|
|
26923
27054
|
const Sizable = {
|
|
26924
27055
|
string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
|
|
26925
27056
|
file: { unit: "\u30D0\u30A4\u30C8", verb: "\u3067\u3042\u308B" },
|
|
@@ -27022,12 +27153,12 @@ var error24 = () => {
|
|
|
27022
27153
|
};
|
|
27023
27154
|
function ja_default() {
|
|
27024
27155
|
return {
|
|
27025
|
-
localeError:
|
|
27156
|
+
localeError: error25()
|
|
27026
27157
|
};
|
|
27027
27158
|
}
|
|
27028
27159
|
|
|
27029
27160
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ka.js
|
|
27030
|
-
var
|
|
27161
|
+
var error26 = () => {
|
|
27031
27162
|
const Sizable = {
|
|
27032
27163
|
string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
|
|
27033
27164
|
file: { unit: "\u10D1\u10D0\u10D8\u10E2\u10D8", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
|
|
@@ -27135,12 +27266,12 @@ var error25 = () => {
|
|
|
27135
27266
|
};
|
|
27136
27267
|
function ka_default() {
|
|
27137
27268
|
return {
|
|
27138
|
-
localeError:
|
|
27269
|
+
localeError: error26()
|
|
27139
27270
|
};
|
|
27140
27271
|
}
|
|
27141
27272
|
|
|
27142
27273
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/km.js
|
|
27143
|
-
var
|
|
27274
|
+
var error27 = () => {
|
|
27144
27275
|
const Sizable = {
|
|
27145
27276
|
string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
|
|
27146
27277
|
file: { unit: "\u1794\u17C3", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
|
|
@@ -27246,7 +27377,7 @@ var error26 = () => {
|
|
|
27246
27377
|
};
|
|
27247
27378
|
function km_default() {
|
|
27248
27379
|
return {
|
|
27249
|
-
localeError:
|
|
27380
|
+
localeError: error27()
|
|
27250
27381
|
};
|
|
27251
27382
|
}
|
|
27252
27383
|
|
|
@@ -27256,7 +27387,7 @@ function kh_default() {
|
|
|
27256
27387
|
}
|
|
27257
27388
|
|
|
27258
27389
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ko.js
|
|
27259
|
-
var
|
|
27390
|
+
var error28 = () => {
|
|
27260
27391
|
const Sizable = {
|
|
27261
27392
|
string: { unit: "\uBB38\uC790", verb: "to have" },
|
|
27262
27393
|
file: { unit: "\uBC14\uC774\uD2B8", verb: "to have" },
|
|
@@ -27363,7 +27494,7 @@ var error27 = () => {
|
|
|
27363
27494
|
};
|
|
27364
27495
|
function ko_default() {
|
|
27365
27496
|
return {
|
|
27366
|
-
localeError:
|
|
27497
|
+
localeError: error28()
|
|
27367
27498
|
};
|
|
27368
27499
|
}
|
|
27369
27500
|
|
|
@@ -27381,7 +27512,7 @@ function getUnitTypeFromNumber(number4) {
|
|
|
27381
27512
|
return "one";
|
|
27382
27513
|
return "few";
|
|
27383
27514
|
}
|
|
27384
|
-
var
|
|
27515
|
+
var error29 = () => {
|
|
27385
27516
|
const Sizable = {
|
|
27386
27517
|
string: {
|
|
27387
27518
|
unit: {
|
|
@@ -27567,12 +27698,12 @@ var error28 = () => {
|
|
|
27567
27698
|
};
|
|
27568
27699
|
function lt_default() {
|
|
27569
27700
|
return {
|
|
27570
|
-
localeError:
|
|
27701
|
+
localeError: error29()
|
|
27571
27702
|
};
|
|
27572
27703
|
}
|
|
27573
27704
|
|
|
27574
27705
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/mk.js
|
|
27575
|
-
var
|
|
27706
|
+
var error30 = () => {
|
|
27576
27707
|
const Sizable = {
|
|
27577
27708
|
string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
|
|
27578
27709
|
file: { unit: "\u0431\u0430\u0458\u0442\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
|
|
@@ -27677,12 +27808,12 @@ var error29 = () => {
|
|
|
27677
27808
|
};
|
|
27678
27809
|
function mk_default() {
|
|
27679
27810
|
return {
|
|
27680
|
-
localeError:
|
|
27811
|
+
localeError: error30()
|
|
27681
27812
|
};
|
|
27682
27813
|
}
|
|
27683
27814
|
|
|
27684
27815
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ms.js
|
|
27685
|
-
var
|
|
27816
|
+
var error31 = () => {
|
|
27686
27817
|
const Sizable = {
|
|
27687
27818
|
string: { unit: "aksara", verb: "mempunyai" },
|
|
27688
27819
|
file: { unit: "bait", verb: "mempunyai" },
|
|
@@ -27785,12 +27916,12 @@ var error30 = () => {
|
|
|
27785
27916
|
};
|
|
27786
27917
|
function ms_default() {
|
|
27787
27918
|
return {
|
|
27788
|
-
localeError:
|
|
27919
|
+
localeError: error31()
|
|
27789
27920
|
};
|
|
27790
27921
|
}
|
|
27791
27922
|
|
|
27792
27923
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/nl.js
|
|
27793
|
-
var
|
|
27924
|
+
var error32 = () => {
|
|
27794
27925
|
const Sizable = {
|
|
27795
27926
|
string: { unit: "tekens", verb: "heeft" },
|
|
27796
27927
|
file: { unit: "bytes", verb: "heeft" },
|
|
@@ -27896,12 +28027,12 @@ var error31 = () => {
|
|
|
27896
28027
|
};
|
|
27897
28028
|
function nl_default() {
|
|
27898
28029
|
return {
|
|
27899
|
-
localeError:
|
|
28030
|
+
localeError: error32()
|
|
27900
28031
|
};
|
|
27901
28032
|
}
|
|
27902
28033
|
|
|
27903
28034
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/no.js
|
|
27904
|
-
var
|
|
28035
|
+
var error33 = () => {
|
|
27905
28036
|
const Sizable = {
|
|
27906
28037
|
string: { unit: "tegn", verb: "\xE5 ha" },
|
|
27907
28038
|
file: { unit: "bytes", verb: "\xE5 ha" },
|
|
@@ -28005,12 +28136,12 @@ var error32 = () => {
|
|
|
28005
28136
|
};
|
|
28006
28137
|
function no_default() {
|
|
28007
28138
|
return {
|
|
28008
|
-
localeError:
|
|
28139
|
+
localeError: error33()
|
|
28009
28140
|
};
|
|
28010
28141
|
}
|
|
28011
28142
|
|
|
28012
28143
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ota.js
|
|
28013
|
-
var
|
|
28144
|
+
var error34 = () => {
|
|
28014
28145
|
const Sizable = {
|
|
28015
28146
|
string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
|
|
28016
28147
|
file: { unit: "bayt", verb: "olmal\u0131d\u0131r" },
|
|
@@ -28115,12 +28246,12 @@ var error33 = () => {
|
|
|
28115
28246
|
};
|
|
28116
28247
|
function ota_default() {
|
|
28117
28248
|
return {
|
|
28118
|
-
localeError:
|
|
28249
|
+
localeError: error34()
|
|
28119
28250
|
};
|
|
28120
28251
|
}
|
|
28121
28252
|
|
|
28122
28253
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ps.js
|
|
28123
|
-
var
|
|
28254
|
+
var error35 = () => {
|
|
28124
28255
|
const Sizable = {
|
|
28125
28256
|
string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
|
|
28126
28257
|
file: { unit: "\u0628\u0627\u06CC\u067C\u0633", verb: "\u0648\u0644\u0631\u064A" },
|
|
@@ -28230,12 +28361,12 @@ var error34 = () => {
|
|
|
28230
28361
|
};
|
|
28231
28362
|
function ps_default() {
|
|
28232
28363
|
return {
|
|
28233
|
-
localeError:
|
|
28364
|
+
localeError: error35()
|
|
28234
28365
|
};
|
|
28235
28366
|
}
|
|
28236
28367
|
|
|
28237
28368
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/pl.js
|
|
28238
|
-
var
|
|
28369
|
+
var error36 = () => {
|
|
28239
28370
|
const Sizable = {
|
|
28240
28371
|
string: { unit: "znak\xF3w", verb: "mie\u0107" },
|
|
28241
28372
|
file: { unit: "bajt\xF3w", verb: "mie\u0107" },
|
|
@@ -28340,12 +28471,12 @@ var error35 = () => {
|
|
|
28340
28471
|
};
|
|
28341
28472
|
function pl_default() {
|
|
28342
28473
|
return {
|
|
28343
|
-
localeError:
|
|
28474
|
+
localeError: error36()
|
|
28344
28475
|
};
|
|
28345
28476
|
}
|
|
28346
28477
|
|
|
28347
28478
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/pt.js
|
|
28348
|
-
var
|
|
28479
|
+
var error37 = () => {
|
|
28349
28480
|
const Sizable = {
|
|
28350
28481
|
string: { unit: "caracteres", verb: "ter" },
|
|
28351
28482
|
file: { unit: "bytes", verb: "ter" },
|
|
@@ -28449,12 +28580,12 @@ var error36 = () => {
|
|
|
28449
28580
|
};
|
|
28450
28581
|
function pt_default() {
|
|
28451
28582
|
return {
|
|
28452
|
-
localeError:
|
|
28583
|
+
localeError: error37()
|
|
28453
28584
|
};
|
|
28454
28585
|
}
|
|
28455
28586
|
|
|
28456
28587
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ro.js
|
|
28457
|
-
var
|
|
28588
|
+
var error38 = () => {
|
|
28458
28589
|
const Sizable = {
|
|
28459
28590
|
string: { unit: "caractere", verb: "s\u0103 aib\u0103" },
|
|
28460
28591
|
file: { unit: "octe\u021Bi", verb: "s\u0103 aib\u0103" },
|
|
@@ -28569,7 +28700,7 @@ var error37 = () => {
|
|
|
28569
28700
|
};
|
|
28570
28701
|
function ro_default() {
|
|
28571
28702
|
return {
|
|
28572
|
-
localeError:
|
|
28703
|
+
localeError: error38()
|
|
28573
28704
|
};
|
|
28574
28705
|
}
|
|
28575
28706
|
|
|
@@ -28589,7 +28720,7 @@ function getRussianPlural(count, one, few, many) {
|
|
|
28589
28720
|
}
|
|
28590
28721
|
return many;
|
|
28591
28722
|
}
|
|
28592
|
-
var
|
|
28723
|
+
var error39 = () => {
|
|
28593
28724
|
const Sizable = {
|
|
28594
28725
|
string: {
|
|
28595
28726
|
unit: {
|
|
@@ -28726,12 +28857,12 @@ var error38 = () => {
|
|
|
28726
28857
|
};
|
|
28727
28858
|
function ru_default() {
|
|
28728
28859
|
return {
|
|
28729
|
-
localeError:
|
|
28860
|
+
localeError: error39()
|
|
28730
28861
|
};
|
|
28731
28862
|
}
|
|
28732
28863
|
|
|
28733
28864
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/sl.js
|
|
28734
|
-
var
|
|
28865
|
+
var error40 = () => {
|
|
28735
28866
|
const Sizable = {
|
|
28736
28867
|
string: { unit: "znakov", verb: "imeti" },
|
|
28737
28868
|
file: { unit: "bajtov", verb: "imeti" },
|
|
@@ -28836,12 +28967,12 @@ var error39 = () => {
|
|
|
28836
28967
|
};
|
|
28837
28968
|
function sl_default() {
|
|
28838
28969
|
return {
|
|
28839
|
-
localeError:
|
|
28970
|
+
localeError: error40()
|
|
28840
28971
|
};
|
|
28841
28972
|
}
|
|
28842
28973
|
|
|
28843
28974
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/sv.js
|
|
28844
|
-
var
|
|
28975
|
+
var error41 = () => {
|
|
28845
28976
|
const Sizable = {
|
|
28846
28977
|
string: { unit: "tecken", verb: "att ha" },
|
|
28847
28978
|
file: { unit: "bytes", verb: "att ha" },
|
|
@@ -28947,12 +29078,12 @@ var error40 = () => {
|
|
|
28947
29078
|
};
|
|
28948
29079
|
function sv_default() {
|
|
28949
29080
|
return {
|
|
28950
|
-
localeError:
|
|
29081
|
+
localeError: error41()
|
|
28951
29082
|
};
|
|
28952
29083
|
}
|
|
28953
29084
|
|
|
28954
29085
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ta.js
|
|
28955
|
-
var
|
|
29086
|
+
var error42 = () => {
|
|
28956
29087
|
const Sizable = {
|
|
28957
29088
|
string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
|
|
28958
29089
|
file: { unit: "\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
|
|
@@ -29058,12 +29189,12 @@ var error41 = () => {
|
|
|
29058
29189
|
};
|
|
29059
29190
|
function ta_default() {
|
|
29060
29191
|
return {
|
|
29061
|
-
localeError:
|
|
29192
|
+
localeError: error42()
|
|
29062
29193
|
};
|
|
29063
29194
|
}
|
|
29064
29195
|
|
|
29065
29196
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/th.js
|
|
29066
|
-
var
|
|
29197
|
+
var error43 = () => {
|
|
29067
29198
|
const Sizable = {
|
|
29068
29199
|
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
29069
29200
|
file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
@@ -29169,12 +29300,12 @@ var error42 = () => {
|
|
|
29169
29300
|
};
|
|
29170
29301
|
function th_default() {
|
|
29171
29302
|
return {
|
|
29172
|
-
localeError:
|
|
29303
|
+
localeError: error43()
|
|
29173
29304
|
};
|
|
29174
29305
|
}
|
|
29175
29306
|
|
|
29176
29307
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/tr.js
|
|
29177
|
-
var
|
|
29308
|
+
var error44 = () => {
|
|
29178
29309
|
const Sizable = {
|
|
29179
29310
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
29180
29311
|
file: { unit: "bayt", verb: "olmal\u0131" },
|
|
@@ -29275,12 +29406,12 @@ var error43 = () => {
|
|
|
29275
29406
|
};
|
|
29276
29407
|
function tr_default() {
|
|
29277
29408
|
return {
|
|
29278
|
-
localeError:
|
|
29409
|
+
localeError: error44()
|
|
29279
29410
|
};
|
|
29280
29411
|
}
|
|
29281
29412
|
|
|
29282
29413
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/uk.js
|
|
29283
|
-
var
|
|
29414
|
+
var error45 = () => {
|
|
29284
29415
|
const Sizable = {
|
|
29285
29416
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
29286
29417
|
file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -29384,7 +29515,7 @@ var error44 = () => {
|
|
|
29384
29515
|
};
|
|
29385
29516
|
function uk_default() {
|
|
29386
29517
|
return {
|
|
29387
|
-
localeError:
|
|
29518
|
+
localeError: error45()
|
|
29388
29519
|
};
|
|
29389
29520
|
}
|
|
29390
29521
|
|
|
@@ -29394,7 +29525,7 @@ function ua_default() {
|
|
|
29394
29525
|
}
|
|
29395
29526
|
|
|
29396
29527
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ur.js
|
|
29397
|
-
var
|
|
29528
|
+
var error46 = () => {
|
|
29398
29529
|
const Sizable = {
|
|
29399
29530
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
29400
29531
|
file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -29500,12 +29631,12 @@ var error45 = () => {
|
|
|
29500
29631
|
};
|
|
29501
29632
|
function ur_default() {
|
|
29502
29633
|
return {
|
|
29503
|
-
localeError:
|
|
29634
|
+
localeError: error46()
|
|
29504
29635
|
};
|
|
29505
29636
|
}
|
|
29506
29637
|
|
|
29507
29638
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/uz.js
|
|
29508
|
-
var
|
|
29639
|
+
var error47 = () => {
|
|
29509
29640
|
const Sizable = {
|
|
29510
29641
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
29511
29642
|
file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
|
|
@@ -29611,12 +29742,12 @@ var error46 = () => {
|
|
|
29611
29742
|
};
|
|
29612
29743
|
function uz_default() {
|
|
29613
29744
|
return {
|
|
29614
|
-
localeError:
|
|
29745
|
+
localeError: error47()
|
|
29615
29746
|
};
|
|
29616
29747
|
}
|
|
29617
29748
|
|
|
29618
29749
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/vi.js
|
|
29619
|
-
var
|
|
29750
|
+
var error48 = () => {
|
|
29620
29751
|
const Sizable = {
|
|
29621
29752
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
29622
29753
|
file: { unit: "byte", verb: "c\xF3" },
|
|
@@ -29720,12 +29851,12 @@ var error47 = () => {
|
|
|
29720
29851
|
};
|
|
29721
29852
|
function vi_default() {
|
|
29722
29853
|
return {
|
|
29723
|
-
localeError:
|
|
29854
|
+
localeError: error48()
|
|
29724
29855
|
};
|
|
29725
29856
|
}
|
|
29726
29857
|
|
|
29727
29858
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/zh-CN.js
|
|
29728
|
-
var
|
|
29859
|
+
var error49 = () => {
|
|
29729
29860
|
const Sizable = {
|
|
29730
29861
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
29731
29862
|
file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
|
|
@@ -29830,12 +29961,12 @@ var error48 = () => {
|
|
|
29830
29961
|
};
|
|
29831
29962
|
function zh_CN_default() {
|
|
29832
29963
|
return {
|
|
29833
|
-
localeError:
|
|
29964
|
+
localeError: error49()
|
|
29834
29965
|
};
|
|
29835
29966
|
}
|
|
29836
29967
|
|
|
29837
29968
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/zh-TW.js
|
|
29838
|
-
var
|
|
29969
|
+
var error50 = () => {
|
|
29839
29970
|
const Sizable = {
|
|
29840
29971
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
29841
29972
|
file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
|
|
@@ -29938,12 +30069,12 @@ var error49 = () => {
|
|
|
29938
30069
|
};
|
|
29939
30070
|
function zh_TW_default() {
|
|
29940
30071
|
return {
|
|
29941
|
-
localeError:
|
|
30072
|
+
localeError: error50()
|
|
29942
30073
|
};
|
|
29943
30074
|
}
|
|
29944
30075
|
|
|
29945
30076
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/yo.js
|
|
29946
|
-
var
|
|
30077
|
+
var error51 = () => {
|
|
29947
30078
|
const Sizable = {
|
|
29948
30079
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
29949
30080
|
file: { unit: "bytes", verb: "n\xED" },
|
|
@@ -30046,7 +30177,7 @@ var error50 = () => {
|
|
|
30046
30177
|
};
|
|
30047
30178
|
function yo_default() {
|
|
30048
30179
|
return {
|
|
30049
|
-
localeError:
|
|
30180
|
+
localeError: error51()
|
|
30050
30181
|
};
|
|
30051
30182
|
}
|
|
30052
30183
|
|
|
@@ -34393,7 +34524,7 @@ function parseModelAugmentationFile(text, options) {
|
|
|
34393
34524
|
uri,
|
|
34394
34525
|
path: options?.path
|
|
34395
34526
|
};
|
|
34396
|
-
} catch (
|
|
34527
|
+
} catch (error52) {
|
|
34397
34528
|
return {
|
|
34398
34529
|
ok: false,
|
|
34399
34530
|
uri,
|
|
@@ -34402,7 +34533,7 @@ function parseModelAugmentationFile(text, options) {
|
|
|
34402
34533
|
{
|
|
34403
34534
|
kind: "json",
|
|
34404
34535
|
message: "the file could not be parsed as JSON",
|
|
34405
|
-
notes: [String(
|
|
34536
|
+
notes: [String(error52.message || error52)]
|
|
34406
34537
|
}
|
|
34407
34538
|
]
|
|
34408
34539
|
};
|
|
@@ -34552,7 +34683,7 @@ function isInvalidValueIssue(issue2) {
|
|
|
34552
34683
|
return unionErrors.flat().some(isZodIssueLikeInvalidValue);
|
|
34553
34684
|
}
|
|
34554
34685
|
const zodUnionErrors = issue2.unionErrors;
|
|
34555
|
-
return Array.isArray(zodUnionErrors) ? zodUnionErrors.flatMap((
|
|
34686
|
+
return Array.isArray(zodUnionErrors) ? zodUnionErrors.flatMap((error52) => error52.issues ?? []).some(isZodIssueLikeInvalidValue) : false;
|
|
34556
34687
|
}
|
|
34557
34688
|
function isZodIssueLikeInvalidValue(issue2) {
|
|
34558
34689
|
return typeof issue2 === "object" && issue2 !== null && isInvalidValueIssue(issue2);
|
|
@@ -34628,8 +34759,8 @@ function normalizeParsedBtxmlConfig(raw) {
|
|
|
34628
34759
|
formatter: normalizeRawFormatterOverrideConfig(override.formatter)
|
|
34629
34760
|
})
|
|
34630
34761
|
);
|
|
34631
|
-
const
|
|
34632
|
-
return { config: config2, diagnostics, ok };
|
|
34762
|
+
const ok2 = !diagnostics.some((d) => d.severity === DiagnosticSeverity.Error);
|
|
34763
|
+
return { config: config2, diagnostics, ok: ok2 };
|
|
34633
34764
|
}
|
|
34634
34765
|
function normalizeBtxmlConfig(raw) {
|
|
34635
34766
|
const parsed = parseBtxmlConfig(raw);
|
|
@@ -34760,6 +34891,7 @@ var RuleCodes = {
|
|
|
34760
34891
|
InvalidScriptOperandType: "BT407_INVALID_SCRIPT_OPERAND_TYPE",
|
|
34761
34892
|
ScriptResultNotBoolCompatible: "BT408_SCRIPT_RESULT_NOT_BOOL_COMPATIBLE",
|
|
34762
34893
|
ScriptVariableTypeMismatch: "BT410_SCRIPT_VARIABLE_TYPE_MISMATCH",
|
|
34894
|
+
InvalidGlobalBlackboardIdentifier: "BT411_INVALID_GLOBAL_BLACKBOARD_IDENTIFIER",
|
|
34763
34895
|
InvalidRootElement: "BT001_INVALID_ROOT_ELEMENT",
|
|
34764
34896
|
MissingBTCPPFormat: "BT002_MISSING_BTCPP_FORMAT",
|
|
34765
34897
|
MissingBehaviorTreeID: "BT003_MISSING_BEHAVIOR_TREE_ID",
|
|
@@ -34838,7 +34970,8 @@ var RULES = {
|
|
|
34838
34970
|
codes: [
|
|
34839
34971
|
RuleCodes.AssignmentToUnknownVariable,
|
|
34840
34972
|
RuleCodes.InvalidCompoundAssignment,
|
|
34841
|
-
RuleCodes.ScriptVariableTypeMismatch
|
|
34973
|
+
RuleCodes.ScriptVariableTypeMismatch,
|
|
34974
|
+
RuleCodes.InvalidGlobalBlackboardIdentifier
|
|
34842
34975
|
],
|
|
34843
34976
|
defaultSeverity: "error",
|
|
34844
34977
|
description: "Script assignments must target known variables and use compatible types."
|
|
@@ -36201,7 +36334,7 @@ function getBehaviorTreeElements(document) {
|
|
|
36201
36334
|
(child) => child.kind === "element" && child.name === "BehaviorTree"
|
|
36202
36335
|
);
|
|
36203
36336
|
}
|
|
36204
|
-
function
|
|
36337
|
+
function advancePosition2(start, text) {
|
|
36205
36338
|
let line = start.line;
|
|
36206
36339
|
let character = start.character;
|
|
36207
36340
|
let offset = start.offset;
|
|
@@ -36217,32 +36350,66 @@ function advancePosition(start, text) {
|
|
|
36217
36350
|
return { line, character, offset };
|
|
36218
36351
|
}
|
|
36219
36352
|
function rangeFromText(start, prefix, text) {
|
|
36220
|
-
const rangeStart =
|
|
36221
|
-
const rangeEnd =
|
|
36353
|
+
const rangeStart = advancePosition2(start, prefix);
|
|
36354
|
+
const rangeEnd = advancePosition2(rangeStart, text);
|
|
36222
36355
|
return {
|
|
36223
36356
|
start: rangeStart,
|
|
36224
36357
|
end: rangeEnd
|
|
36225
36358
|
};
|
|
36226
36359
|
}
|
|
36227
|
-
function extractBlackboardReferences(document, attribute) {
|
|
36360
|
+
function extractBlackboardReferences(document, portName, attribute) {
|
|
36228
36361
|
const baseRange = attribute.valueContentRange || attribute.valueRange;
|
|
36229
36362
|
const rawValue = document.originalText.slice(baseRange.start.offset, baseRange.end.offset);
|
|
36230
36363
|
const references = [];
|
|
36231
|
-
for (const match of rawValue.matchAll(/\{
|
|
36364
|
+
for (const match of rawValue.matchAll(/\{[^}]*\}/g)) {
|
|
36232
36365
|
const raw = match[0];
|
|
36233
|
-
const key = match[1];
|
|
36234
36366
|
const index = match.index ?? 0;
|
|
36367
|
+
const parsed = parsePortBlackboardReference({ portName, rawValue: raw });
|
|
36368
|
+
if (parsed.ok) {
|
|
36369
|
+
references.push({
|
|
36370
|
+
raw,
|
|
36371
|
+
key: parsed.reference.key,
|
|
36372
|
+
scope: parsed.reference.scope,
|
|
36373
|
+
identity: makeBlackboardIdentity(parsed.reference),
|
|
36374
|
+
range: rangeFromText(baseRange.start, rawValue.slice(0, index), raw),
|
|
36375
|
+
syntax: parsed.reference.syntax === "shorthand" ? "shorthand" : "braced"
|
|
36376
|
+
});
|
|
36377
|
+
continue;
|
|
36378
|
+
}
|
|
36235
36379
|
references.push({
|
|
36236
36380
|
raw,
|
|
36237
|
-
key,
|
|
36381
|
+
key: raw,
|
|
36382
|
+
scope: "local",
|
|
36383
|
+
identity: `invalid:${raw}`,
|
|
36238
36384
|
range: rangeFromText(baseRange.start, rawValue.slice(0, index), raw),
|
|
36239
|
-
syntax: "
|
|
36385
|
+
syntax: "invalid"
|
|
36240
36386
|
});
|
|
36241
36387
|
}
|
|
36388
|
+
if (references.length === 0) {
|
|
36389
|
+
const parsed = parsePortBlackboardReference({ portName, rawValue });
|
|
36390
|
+
if (parsed.ok) {
|
|
36391
|
+
const parsedOffset = Math.max(0, rawValue.indexOf(parsed.reference.raw));
|
|
36392
|
+
references.push({
|
|
36393
|
+
raw: parsed.reference.raw,
|
|
36394
|
+
key: parsed.reference.key,
|
|
36395
|
+
scope: parsed.reference.scope,
|
|
36396
|
+
identity: makeBlackboardIdentity(parsed.reference),
|
|
36397
|
+
range: rangeFromText(
|
|
36398
|
+
baseRange.start,
|
|
36399
|
+
rawValue.slice(0, parsedOffset),
|
|
36400
|
+
parsed.reference.raw
|
|
36401
|
+
),
|
|
36402
|
+
syntax: parsed.reference.syntax === "shorthand" ? "shorthand" : "braced"
|
|
36403
|
+
});
|
|
36404
|
+
return references;
|
|
36405
|
+
}
|
|
36406
|
+
}
|
|
36242
36407
|
if (references.length === 0 && (rawValue.includes("{") || rawValue.includes("}"))) {
|
|
36243
36408
|
references.push({
|
|
36244
36409
|
raw: rawValue,
|
|
36245
36410
|
key: rawValue,
|
|
36411
|
+
scope: "local",
|
|
36412
|
+
identity: `invalid:${rawValue}`,
|
|
36246
36413
|
range: baseRange,
|
|
36247
36414
|
syntax: "invalid"
|
|
36248
36415
|
});
|
|
@@ -36349,10 +36516,13 @@ function getSemanticPortDirection(usage) {
|
|
|
36349
36516
|
}
|
|
36350
36517
|
function getSemanticPortValueKind(value, blackboardReferences) {
|
|
36351
36518
|
if (value === "") return "empty";
|
|
36352
|
-
if (value === "{=}") return "substitution";
|
|
36519
|
+
if (value === "{=}" || value === "=") return "substitution";
|
|
36353
36520
|
if (blackboardReferences.some((reference) => reference.syntax === "braced")) {
|
|
36354
36521
|
return "blackboard-reference";
|
|
36355
36522
|
}
|
|
36523
|
+
if (blackboardReferences.some((reference) => reference.syntax === "shorthand")) {
|
|
36524
|
+
return "substitution";
|
|
36525
|
+
}
|
|
36356
36526
|
if (blackboardReferences.some((reference) => reference.syntax === "invalid")) {
|
|
36357
36527
|
return "unknown";
|
|
36358
36528
|
}
|
|
@@ -36454,7 +36624,11 @@ function buildBtDocumentView(document, options) {
|
|
|
36454
36624
|
attribute: portUsage.attribute,
|
|
36455
36625
|
declaredPort: toPortResolution(portUsage),
|
|
36456
36626
|
usage: portUsage,
|
|
36457
|
-
blackboardReferences: extractBlackboardReferences(
|
|
36627
|
+
blackboardReferences: extractBlackboardReferences(
|
|
36628
|
+
document,
|
|
36629
|
+
portUsage.name,
|
|
36630
|
+
portUsage.attribute
|
|
36631
|
+
)
|
|
36458
36632
|
}));
|
|
36459
36633
|
node.children = element.children.filter((child) => child.kind === "element").map(
|
|
36460
36634
|
(child, childIndex) => buildTreeNode(child, behaviorTree, node, [...path4, childIndex])
|
|
@@ -36531,7 +36705,11 @@ function buildSemanticDocumentView(document, index, options) {
|
|
|
36531
36705
|
attribute: portUsage.attribute,
|
|
36532
36706
|
declaredPort: toPortResolution(portUsage),
|
|
36533
36707
|
usage: portUsage,
|
|
36534
|
-
blackboardReferences: extractBlackboardReferences(
|
|
36708
|
+
blackboardReferences: extractBlackboardReferences(
|
|
36709
|
+
document,
|
|
36710
|
+
portUsage.name,
|
|
36711
|
+
portUsage.attribute
|
|
36712
|
+
)
|
|
36535
36713
|
})
|
|
36536
36714
|
)
|
|
36537
36715
|
};
|
|
@@ -37503,6 +37681,9 @@ function parseBtXml(text, options = {}) {
|
|
|
37503
37681
|
);
|
|
37504
37682
|
}
|
|
37505
37683
|
const root = document.root;
|
|
37684
|
+
const looksLikeBtXml = root?.name === "BehaviorTree" || root?.name === "TreeNodesModel" || root?.name === "root" && (root.attributes.some((a) => a.name === "BTCPP_format" && a.value === "4") || root.children.some(
|
|
37685
|
+
(child) => child.kind === "element" && (child.name === "BehaviorTree" || child.name === "TreeNodesModel")
|
|
37686
|
+
));
|
|
37506
37687
|
if (root) {
|
|
37507
37688
|
for (const node of document.nodes) {
|
|
37508
37689
|
if (node === root) continue;
|
|
@@ -37521,7 +37702,7 @@ function parseBtXml(text, options = {}) {
|
|
|
37521
37702
|
}
|
|
37522
37703
|
}
|
|
37523
37704
|
}
|
|
37524
|
-
if (!document.xmlDeclaration) {
|
|
37705
|
+
if (!document.xmlDeclaration && !looksLikeBtXml) {
|
|
37525
37706
|
addOptionalDiagnostic(
|
|
37526
37707
|
"XML008_MISSING_DECLARATION",
|
|
37527
37708
|
DiagnosticSeverity.Warning,
|
|
@@ -37535,7 +37716,7 @@ function parseBtXml(text, options = {}) {
|
|
|
37535
37716
|
]
|
|
37536
37717
|
}
|
|
37537
37718
|
);
|
|
37538
|
-
} else if (document.xmlDeclaration
|
|
37719
|
+
} else if (document.xmlDeclaration?.encoding && document.xmlDeclaration.encoding.toUpperCase() !== "UTF-8") {
|
|
37539
37720
|
const encoding = document.xmlDeclaration.encoding;
|
|
37540
37721
|
addDiagnostic(
|
|
37541
37722
|
"XML009_INVALID_ENCODING",
|
|
@@ -38941,8 +39122,8 @@ async function loadProjectNodeModels(input) {
|
|
|
38941
39122
|
if (parseErrors.length > 0 || !jsonTree) {
|
|
38942
39123
|
throw new Error(`JSON parse error at offset ${parseErrors[0]?.offset ?? 0}`);
|
|
38943
39124
|
}
|
|
38944
|
-
} catch (
|
|
38945
|
-
const errorMessage = String(
|
|
39125
|
+
} catch (error52) {
|
|
39126
|
+
const errorMessage = String(error52.message || error52);
|
|
38946
39127
|
diagnostics.push(
|
|
38947
39128
|
createDiagnostic(
|
|
38948
39129
|
RuleCodes.InvalidNodeDefinitionJson,
|
|
@@ -39487,11 +39668,11 @@ function reportLiteralValidation(context, input) {
|
|
|
39487
39668
|
});
|
|
39488
39669
|
}
|
|
39489
39670
|
function validateLiteralValue(input) {
|
|
39490
|
-
const
|
|
39491
|
-
if (input.allowRemap &&
|
|
39671
|
+
const remappedReference = getExactBlackboardReference(input.port.name, input.value);
|
|
39672
|
+
if (input.allowRemap && remappedReference !== void 0) {
|
|
39492
39673
|
return void 0;
|
|
39493
39674
|
}
|
|
39494
|
-
if (!input.allowRemap &&
|
|
39675
|
+
if (!input.allowRemap && remappedReference !== void 0) {
|
|
39495
39676
|
return invalidLiteral(input.diagnosticCode, input.value, input.portLabel);
|
|
39496
39677
|
}
|
|
39497
39678
|
if (input.port.enum && !input.port.enum.includes(input.value)) {
|
|
@@ -39524,8 +39705,12 @@ function getResolvedPortType(port) {
|
|
|
39524
39705
|
function getResolvedPortTypeDefinition(registry2, port) {
|
|
39525
39706
|
return resolveTypeDefinition(registry2, getResolvedPortType(port));
|
|
39526
39707
|
}
|
|
39527
|
-
function
|
|
39528
|
-
|
|
39708
|
+
function getExactBlackboardReference(portName, rawValue) {
|
|
39709
|
+
const parsed = parsePortBlackboardReference({
|
|
39710
|
+
portName,
|
|
39711
|
+
rawValue: rawValue.trim()
|
|
39712
|
+
});
|
|
39713
|
+
return parsed.ok ? parsed.reference : void 0;
|
|
39529
39714
|
}
|
|
39530
39715
|
function invalidLiteral(code, literal2, portLabel) {
|
|
39531
39716
|
return {
|
|
@@ -39804,7 +39989,7 @@ var modelRules = [
|
|
|
39804
39989
|
const port = model?.ports.find((candidate) => candidate.name === portName);
|
|
39805
39990
|
if (!port) return;
|
|
39806
39991
|
if (port.direction === "output") {
|
|
39807
|
-
if (
|
|
39992
|
+
if (getExactBlackboardReference(port.name, defaultAttr.value) === void 0) {
|
|
39808
39993
|
context.report({
|
|
39809
39994
|
code: RuleCodes.InvalidPortDefaultValue,
|
|
39810
39995
|
message: `output port default for \`${port.name}\` must be a blackboard remap`,
|
|
@@ -39841,30 +40026,34 @@ var modelRules = [
|
|
|
39841
40026
|
return {
|
|
39842
40027
|
ProgramExit() {
|
|
39843
40028
|
const typeRegistry = getTypeRegistry(context.semantic);
|
|
39844
|
-
const
|
|
40029
|
+
const bindingsByIdentity = /* @__PURE__ */ new Map();
|
|
39845
40030
|
const allowStringEntryCompatibility = context.options.allowStringEntryCompatibility ?? true;
|
|
39846
40031
|
for (const node of context.view.nodes) {
|
|
39847
40032
|
for (const binding of node.portBindings) {
|
|
39848
40033
|
if (binding.declaredPort.status !== "resolved") continue;
|
|
39849
|
-
const
|
|
39850
|
-
if (!
|
|
40034
|
+
const reference = getExactBlackboardReference(binding.name, binding.value);
|
|
40035
|
+
if (!reference) continue;
|
|
39851
40036
|
const typeDefinition = getResolvedPortTypeDefinition(
|
|
39852
40037
|
typeRegistry,
|
|
39853
40038
|
binding.declaredPort.port
|
|
39854
40039
|
);
|
|
39855
40040
|
if (!typeDefinition || typeDefinition.kind === "any") continue;
|
|
39856
|
-
const
|
|
40041
|
+
const identity = makeBlackboardIdentity(reference);
|
|
40042
|
+
const records = bindingsByIdentity.get(identity) ?? [];
|
|
39857
40043
|
records.push({
|
|
39858
|
-
key,
|
|
40044
|
+
key: reference.key,
|
|
40045
|
+
scope: reference.scope,
|
|
40046
|
+
displayName: formatBlackboardReference(reference),
|
|
40047
|
+
identity,
|
|
39859
40048
|
nodeId: describeBindingNode(node.element),
|
|
39860
40049
|
port: binding.declaredPort.port,
|
|
39861
40050
|
typeDefinition,
|
|
39862
40051
|
range: binding.attribute.range
|
|
39863
40052
|
});
|
|
39864
|
-
|
|
40053
|
+
bindingsByIdentity.set(identity, records);
|
|
39865
40054
|
}
|
|
39866
40055
|
}
|
|
39867
|
-
for (const
|
|
40056
|
+
for (const bindings of bindingsByIdentity.values()) {
|
|
39868
40057
|
const incompatibleTypes = collectIncompatibleTypes(
|
|
39869
40058
|
context.semantic,
|
|
39870
40059
|
bindings,
|
|
@@ -39876,10 +40065,10 @@ var modelRules = [
|
|
|
39876
40065
|
);
|
|
39877
40066
|
context.report({
|
|
39878
40067
|
code: RuleCodes.BlackboardTypeMismatch,
|
|
39879
|
-
message: `blackboard entry \`${key}\` is used with incompatible port types: ${incompatibleTypes.map((type) => `\`${type}\``).join(", ")}`,
|
|
40068
|
+
message: `blackboard entry \`${primary?.displayName ?? bindings[0]?.displayName ?? bindings[0]?.key ?? ""}\` is used with incompatible port types: ${incompatibleTypes.map((type) => `\`${type}\``).join(", ")}`,
|
|
39880
40069
|
range: primary?.range,
|
|
39881
40070
|
details: {
|
|
39882
|
-
primaryLabel: `blackboard entry \`${key}\` mixes incompatible port types`,
|
|
40071
|
+
primaryLabel: `blackboard entry \`${primary?.displayName ?? bindings[0]?.displayName ?? bindings[0]?.key ?? ""}\` mixes incompatible port types`,
|
|
39883
40072
|
notes: bindings.filter((binding) => incompatibleTypes.includes(binding.typeDefinition.canonical)).map(
|
|
39884
40073
|
(binding) => `${binding.nodeId}.${binding.port.name} declares ${formatPortType(binding.port, binding.typeDefinition)}`
|
|
39885
40074
|
),
|
|
@@ -39906,7 +40095,8 @@ var modelRules = [
|
|
|
39906
40095
|
const portUsage = context.getPortUsage(element, attr.name);
|
|
39907
40096
|
if (portUsage?.status !== "resolved") continue;
|
|
39908
40097
|
if (portUsage.port.direction !== "output") continue;
|
|
39909
|
-
if (
|
|
40098
|
+
if (getExactBlackboardReference(portUsage.port.name, attr.value) !== void 0)
|
|
40099
|
+
continue;
|
|
39910
40100
|
context.report({
|
|
39911
40101
|
code: RuleCodes.OutputPortRequiresRemap,
|
|
39912
40102
|
message: `output port \`${portUsage.port.name}\` must be remapped to a blackboard entry`,
|
|
@@ -39998,6 +40188,22 @@ function classifyScriptAttribute(input) {
|
|
|
39998
40188
|
return void 0;
|
|
39999
40189
|
}
|
|
40000
40190
|
|
|
40191
|
+
// ../script/src/analysis/blackboard.ts
|
|
40192
|
+
function classifyScriptIdentifier(name) {
|
|
40193
|
+
if (!name.startsWith("@")) {
|
|
40194
|
+
return { kind: "local", name };
|
|
40195
|
+
}
|
|
40196
|
+
const parsed = parseScriptBlackboardIdentifier({ rawName: name });
|
|
40197
|
+
if (!parsed.ok) {
|
|
40198
|
+
return {
|
|
40199
|
+
kind: "invalid-global-blackboard",
|
|
40200
|
+
raw: name,
|
|
40201
|
+
message: `invalid global blackboard identifier \`${name}\``
|
|
40202
|
+
};
|
|
40203
|
+
}
|
|
40204
|
+
return { kind: "global-blackboard", key: parsed.reference.key };
|
|
40205
|
+
}
|
|
40206
|
+
|
|
40001
40207
|
// ../script/src/tokenizer.ts
|
|
40002
40208
|
var TWO_CHAR_TOKENS = /* @__PURE__ */ new Map([
|
|
40003
40209
|
["..", "DotDot"],
|
|
@@ -40571,12 +40777,22 @@ function createScriptEnvironment(input = {}) {
|
|
|
40571
40777
|
const registry2 = createTypeRegistry(input.augmentations ?? []);
|
|
40572
40778
|
const areTypesCompatible3 = input.areTypesCompatible ?? ((left, right) => areTypesCompatible(registry2, left, right));
|
|
40573
40779
|
const compatibilityKeys = /* @__PURE__ */ new Map();
|
|
40780
|
+
const globalCompatibilityKeys = /* @__PURE__ */ new Map();
|
|
40574
40781
|
const environment = {
|
|
40575
40782
|
symbols: /* @__PURE__ */ new Map(),
|
|
40783
|
+
globalBlackboard: /* @__PURE__ */ new Map(),
|
|
40576
40784
|
enums: normalizeEnums(input.enums, input.augmentations ?? [])
|
|
40577
40785
|
};
|
|
40578
40786
|
for (const symbol2 of input.symbols ?? []) {
|
|
40579
|
-
mergeScriptSymbol(environment, compatibilityKeys, symbol2, areTypesCompatible3);
|
|
40787
|
+
mergeScriptSymbol(environment.symbols, compatibilityKeys, symbol2, areTypesCompatible3);
|
|
40788
|
+
}
|
|
40789
|
+
for (const symbol2 of input.globalBlackboardSymbols ?? []) {
|
|
40790
|
+
mergeScriptSymbol(
|
|
40791
|
+
environment.globalBlackboard,
|
|
40792
|
+
globalCompatibilityKeys,
|
|
40793
|
+
symbol2,
|
|
40794
|
+
areTypesCompatible3
|
|
40795
|
+
);
|
|
40580
40796
|
}
|
|
40581
40797
|
return environment;
|
|
40582
40798
|
}
|
|
@@ -40585,6 +40801,12 @@ function cloneScriptEnvironment(environment) {
|
|
|
40585
40801
|
symbols: new Map(
|
|
40586
40802
|
[...environment?.symbols.entries() ?? []].map(([name, symbol2]) => [name, { ...symbol2 }])
|
|
40587
40803
|
),
|
|
40804
|
+
globalBlackboard: new Map(
|
|
40805
|
+
[...environment?.globalBlackboard.entries() ?? []].map(([name, symbol2]) => [
|
|
40806
|
+
name,
|
|
40807
|
+
{ ...symbol2 }
|
|
40808
|
+
])
|
|
40809
|
+
),
|
|
40588
40810
|
enums: new Map(environment?.enums ?? [])
|
|
40589
40811
|
};
|
|
40590
40812
|
}
|
|
@@ -40613,10 +40835,14 @@ function analyzeScriptFlow(input) {
|
|
|
40613
40835
|
...analysis ? { analysis } : {}
|
|
40614
40836
|
});
|
|
40615
40837
|
environment.symbols.clear();
|
|
40838
|
+
environment.globalBlackboard.clear();
|
|
40616
40839
|
environment.enums.clear();
|
|
40617
40840
|
for (const [name, symbol2] of environmentAfter.symbols) {
|
|
40618
40841
|
environment.symbols.set(name, { ...symbol2 });
|
|
40619
40842
|
}
|
|
40843
|
+
for (const [name, symbol2] of environmentAfter.globalBlackboard) {
|
|
40844
|
+
environment.globalBlackboard.set(name, { ...symbol2 });
|
|
40845
|
+
}
|
|
40620
40846
|
for (const [name, value] of environmentAfter.enums) {
|
|
40621
40847
|
environment.enums.set(name, value);
|
|
40622
40848
|
}
|
|
@@ -40692,10 +40918,10 @@ function normalizeEnums(enums, augmentations) {
|
|
|
40692
40918
|
}
|
|
40693
40919
|
return collected;
|
|
40694
40920
|
}
|
|
40695
|
-
function mergeScriptSymbol(
|
|
40696
|
-
const existing =
|
|
40921
|
+
function mergeScriptSymbol(target, compatibilityKeys, next, areTypesCompatible3) {
|
|
40922
|
+
const existing = target.get(next.name);
|
|
40697
40923
|
if (!existing) {
|
|
40698
|
-
|
|
40924
|
+
target.set(next.name, {
|
|
40699
40925
|
name: next.name,
|
|
40700
40926
|
type: next.type,
|
|
40701
40927
|
source: next.source,
|
|
@@ -40707,7 +40933,7 @@ function mergeScriptSymbol(environment, compatibilityKeys, next, areTypesCompati
|
|
|
40707
40933
|
}
|
|
40708
40934
|
const existingCompatibilityKey = compatibilityKeys.get(next.name);
|
|
40709
40935
|
const conflict = existing.conflict === true || existingCompatibilityKey !== void 0 && next.compatibilityKey !== void 0 && !areTypesCompatible3(existingCompatibilityKey, next.compatibilityKey) || !areScriptTypesCompatible(existing.type, next.type);
|
|
40710
|
-
|
|
40936
|
+
target.set(next.name, {
|
|
40711
40937
|
...existing,
|
|
40712
40938
|
readable: existing.readable || next.readable,
|
|
40713
40939
|
writable: existing.writable || next.writable,
|
|
@@ -40729,6 +40955,8 @@ function analyzeScript(input) {
|
|
|
40729
40955
|
const identifiers = [];
|
|
40730
40956
|
const resolvedIdentifiers = [];
|
|
40731
40957
|
const unknownIdentifiers = [];
|
|
40958
|
+
const globalBlackboardAccesses = [];
|
|
40959
|
+
const invalidGlobalBlackboardIdentifiers = [];
|
|
40732
40960
|
const introducedSymbols = [];
|
|
40733
40961
|
const diagnostics = [];
|
|
40734
40962
|
const statementTypes = [];
|
|
@@ -40741,6 +40969,8 @@ function analyzeScript(input) {
|
|
|
40741
40969
|
identifiers,
|
|
40742
40970
|
resolvedIdentifiers,
|
|
40743
40971
|
unknownIdentifiers,
|
|
40972
|
+
globalBlackboardAccesses,
|
|
40973
|
+
invalidGlobalBlackboardIdentifiers,
|
|
40744
40974
|
introducedSymbols,
|
|
40745
40975
|
diagnostics,
|
|
40746
40976
|
attributeName: input.attributeName ?? "code",
|
|
@@ -40753,6 +40983,8 @@ function analyzeScript(input) {
|
|
|
40753
40983
|
identifiers,
|
|
40754
40984
|
resolvedIdentifiers,
|
|
40755
40985
|
unknownIdentifiers,
|
|
40986
|
+
globalBlackboardAccesses,
|
|
40987
|
+
invalidGlobalBlackboardIdentifiers,
|
|
40756
40988
|
introducedSymbols,
|
|
40757
40989
|
diagnostics,
|
|
40758
40990
|
statementTypes,
|
|
@@ -40924,6 +41156,66 @@ function analyzeAssignment(context) {
|
|
|
40924
41156
|
statementIndex: context.statementIndex
|
|
40925
41157
|
};
|
|
40926
41158
|
identifiers.push(access2);
|
|
41159
|
+
const classified = classifyScriptIdentifier(left.name);
|
|
41160
|
+
if (classified.kind === "invalid-global-blackboard") {
|
|
41161
|
+
context.invalidGlobalBlackboardIdentifiers.push(access2);
|
|
41162
|
+
reportInvalidGlobalBlackboardIdentifier(
|
|
41163
|
+
context,
|
|
41164
|
+
left.range,
|
|
41165
|
+
classified.raw,
|
|
41166
|
+
classified.message
|
|
41167
|
+
);
|
|
41168
|
+
return ERROR_TYPE;
|
|
41169
|
+
}
|
|
41170
|
+
if (classified.kind === "global-blackboard") {
|
|
41171
|
+
const existingSymbol2 = environment.globalBlackboard.get(classified.key);
|
|
41172
|
+
const accessType = expression.operator === ":=" ? rightType : expression.operator === "=" ? existingSymbol2 && isScriptTypeAssignable(existingSymbol2.type, rightType) ? rightType : !existingSymbol2 ? rightType : void 0 : compoundAssignmentResult(
|
|
41173
|
+
existingSymbol2?.type ?? UNKNOWN_TYPE,
|
|
41174
|
+
rightType,
|
|
41175
|
+
expression.operator
|
|
41176
|
+
);
|
|
41177
|
+
if (expression.operator !== ":=" && expression.operator !== "=" && !accessType) {
|
|
41178
|
+
reportDiagnostic(
|
|
41179
|
+
context,
|
|
41180
|
+
"invalid-compound-assignment",
|
|
41181
|
+
expression.range,
|
|
41182
|
+
`operator \`${expression.operator}\` is not valid for these operand types`,
|
|
41183
|
+
`compound assignment \`${expression.operator}\` is not allowed here`,
|
|
41184
|
+
expression.operator === "+=" ? "use number += number or string += string" : "use numeric operands for this compound assignment"
|
|
41185
|
+
);
|
|
41186
|
+
return ERROR_TYPE;
|
|
41187
|
+
}
|
|
41188
|
+
if ((expression.operator === ":=" || expression.operator === "=") && existingSymbol2 && !isScriptTypeAssignable(existingSymbol2.type, rightType)) {
|
|
41189
|
+
reportTypeMismatch(context, left, existingSymbol2.type, rightType);
|
|
41190
|
+
return ERROR_TYPE;
|
|
41191
|
+
}
|
|
41192
|
+
const symbol2 = existingSymbol2 ? { ...existingSymbol2 } : {
|
|
41193
|
+
name: classified.key,
|
|
41194
|
+
type: rightType,
|
|
41195
|
+
source: {
|
|
41196
|
+
kind: "global-blackboard",
|
|
41197
|
+
key: classified.key,
|
|
41198
|
+
range: left.range,
|
|
41199
|
+
originId: context.originId
|
|
41200
|
+
},
|
|
41201
|
+
readable: true,
|
|
41202
|
+
writable: true
|
|
41203
|
+
};
|
|
41204
|
+
symbol2.type = accessType ?? rightType;
|
|
41205
|
+
environment.globalBlackboard.set(classified.key, symbol2);
|
|
41206
|
+
context.resolvedIdentifiers.push({
|
|
41207
|
+
access: access2,
|
|
41208
|
+
resolution: { kind: "global-blackboard", key: classified.key, symbol: symbol2 }
|
|
41209
|
+
});
|
|
41210
|
+
context.globalBlackboardAccesses.push({
|
|
41211
|
+
key: classified.key,
|
|
41212
|
+
rawName: left.name,
|
|
41213
|
+
kind: accessKind,
|
|
41214
|
+
range: left.range,
|
|
41215
|
+
inferredType: symbol2.type
|
|
41216
|
+
});
|
|
41217
|
+
return symbol2.type;
|
|
41218
|
+
}
|
|
40927
41219
|
const existingSymbol = environment.symbols.get(left.name);
|
|
40928
41220
|
if (expression.operator === ":=" && !existingSymbol) {
|
|
40929
41221
|
const symbol2 = {
|
|
@@ -41002,6 +41294,27 @@ function analyzeReadIdentifier(context, name, range) {
|
|
|
41002
41294
|
statementIndex: context.statementIndex
|
|
41003
41295
|
};
|
|
41004
41296
|
context.identifiers.push(access2);
|
|
41297
|
+
const classified = classifyScriptIdentifier(name);
|
|
41298
|
+
if (classified.kind === "invalid-global-blackboard") {
|
|
41299
|
+
context.invalidGlobalBlackboardIdentifiers.push(access2);
|
|
41300
|
+
reportInvalidGlobalBlackboardIdentifier(context, range, classified.raw, classified.message);
|
|
41301
|
+
return ERROR_TYPE;
|
|
41302
|
+
}
|
|
41303
|
+
if (classified.kind === "global-blackboard") {
|
|
41304
|
+
const symbol3 = context.environment.globalBlackboard.get(classified.key);
|
|
41305
|
+
context.globalBlackboardAccesses.push({
|
|
41306
|
+
key: classified.key,
|
|
41307
|
+
rawName: name,
|
|
41308
|
+
kind: "read",
|
|
41309
|
+
range,
|
|
41310
|
+
inferredType: symbol3?.type ?? UNKNOWN_TYPE
|
|
41311
|
+
});
|
|
41312
|
+
context.resolvedIdentifiers.push({
|
|
41313
|
+
access: access2,
|
|
41314
|
+
resolution: { kind: "global-blackboard", key: classified.key, ...symbol3 ? { symbol: symbol3 } : {} }
|
|
41315
|
+
});
|
|
41316
|
+
return symbol3?.type ?? UNKNOWN_TYPE;
|
|
41317
|
+
}
|
|
41005
41318
|
const enumValue = context.environment.enums.get(name);
|
|
41006
41319
|
if (enumValue !== void 0) {
|
|
41007
41320
|
context.resolvedIdentifiers.push({
|
|
@@ -41073,6 +41386,16 @@ function reportTypeMismatch(context, identifier, targetType, sourceType) {
|
|
|
41073
41386
|
"assign a compatible value or change the variable's source type"
|
|
41074
41387
|
);
|
|
41075
41388
|
}
|
|
41389
|
+
function reportInvalidGlobalBlackboardIdentifier(context, range, rawName, message) {
|
|
41390
|
+
reportDiagnostic(
|
|
41391
|
+
context,
|
|
41392
|
+
"invalid-global-blackboard-identifier",
|
|
41393
|
+
range,
|
|
41394
|
+
message,
|
|
41395
|
+
`\`${rawName}\` is not a valid global blackboard identifier`,
|
|
41396
|
+
"use `@name` with a valid blackboard key that starts with a letter or underscore"
|
|
41397
|
+
);
|
|
41398
|
+
}
|
|
41076
41399
|
function refineLocalSymbol(symbol2, nextType) {
|
|
41077
41400
|
if (symbol2.source.kind !== "script-assignment") return;
|
|
41078
41401
|
if (symbol2.type.kind !== "unknown" && symbol2.type.kind !== "error") return;
|
|
@@ -41206,7 +41529,10 @@ function getScriptCursorContext(input) {
|
|
|
41206
41529
|
};
|
|
41207
41530
|
}
|
|
41208
41531
|
if (containing && (containing.type === "Integer" || containing.type === "Real" || containing.type === "String" || containing.type === "Boolean")) {
|
|
41209
|
-
return {
|
|
41532
|
+
return {
|
|
41533
|
+
kind: "literal",
|
|
41534
|
+
range: { start: containing.start, end: containing.end }
|
|
41535
|
+
};
|
|
41210
41536
|
}
|
|
41211
41537
|
const operatorRange = scanOperatorRange(source, cursorOffset);
|
|
41212
41538
|
const previousBeforeOperator = previousToken(tokens, operatorRange.start);
|
|
@@ -41260,6 +41586,19 @@ function identifierCompletionItems(input, cursor) {
|
|
|
41260
41586
|
sortText: symbol2.source.kind === "script-assignment" ? `1-${symbol2.name}` : `2-${symbol2.name}`
|
|
41261
41587
|
});
|
|
41262
41588
|
}
|
|
41589
|
+
for (const symbol2 of environment.globalBlackboard.values()) {
|
|
41590
|
+
if (symbol2.conflict) continue;
|
|
41591
|
+
if (!symbol2.readable) continue;
|
|
41592
|
+
const label = `@${symbol2.name}`;
|
|
41593
|
+
if (!matchesPrefix(label, prefix)) continue;
|
|
41594
|
+
items.push({
|
|
41595
|
+
label,
|
|
41596
|
+
kind: "identifier",
|
|
41597
|
+
detail: describeScriptSymbol(symbol2),
|
|
41598
|
+
replaceRange: cursor.range,
|
|
41599
|
+
sortText: `2-${label}`
|
|
41600
|
+
});
|
|
41601
|
+
}
|
|
41263
41602
|
for (const value of ["true", "false"]) {
|
|
41264
41603
|
if (!matchesPrefix(value, prefix)) continue;
|
|
41265
41604
|
items.push({
|
|
@@ -41332,6 +41671,31 @@ function environmentBeforeCursor(input) {
|
|
|
41332
41671
|
if (symbol2.source.range.end > input.cursorOffset) continue;
|
|
41333
41672
|
next.symbols.set(symbol2.name, symbol2);
|
|
41334
41673
|
}
|
|
41674
|
+
for (const access2 of analyzed.globalBlackboardAccesses) {
|
|
41675
|
+
if (access2.kind === "read") continue;
|
|
41676
|
+
if (access2.range.end > input.cursorOffset) continue;
|
|
41677
|
+
const analyzedSymbol = analyzed.environment.globalBlackboard.get(access2.key);
|
|
41678
|
+
const existing = next.globalBlackboard.get(access2.key);
|
|
41679
|
+
let symbol2;
|
|
41680
|
+
if (analyzedSymbol) {
|
|
41681
|
+
symbol2 = { ...analyzedSymbol };
|
|
41682
|
+
} else if (existing) {
|
|
41683
|
+
symbol2 = { ...existing, type: access2.inferredType };
|
|
41684
|
+
} else {
|
|
41685
|
+
symbol2 = {
|
|
41686
|
+
name: access2.key,
|
|
41687
|
+
type: access2.inferredType,
|
|
41688
|
+
source: {
|
|
41689
|
+
kind: "global-blackboard",
|
|
41690
|
+
key: access2.key,
|
|
41691
|
+
range: access2.range
|
|
41692
|
+
},
|
|
41693
|
+
readable: true,
|
|
41694
|
+
writable: true
|
|
41695
|
+
};
|
|
41696
|
+
}
|
|
41697
|
+
next.globalBlackboard.set(access2.key, symbol2);
|
|
41698
|
+
}
|
|
41335
41699
|
return next;
|
|
41336
41700
|
}
|
|
41337
41701
|
for (const token of tokens) {
|
|
@@ -41340,9 +41704,26 @@ function environmentBeforeCursor(input) {
|
|
|
41340
41704
|
const next = nextToken(tokens, token.end);
|
|
41341
41705
|
if (next?.type !== "ColonEqual") continue;
|
|
41342
41706
|
if (next.end > input.cursorOffset) continue;
|
|
41343
|
-
|
|
41344
|
-
|
|
41345
|
-
|
|
41707
|
+
const classified = classifyScriptIdentifier(token.text);
|
|
41708
|
+
if (classified.kind === "invalid-global-blackboard") continue;
|
|
41709
|
+
if (classified.kind === "global-blackboard") {
|
|
41710
|
+
if (environment.globalBlackboard.has(classified.key)) continue;
|
|
41711
|
+
environment.globalBlackboard.set(classified.key, {
|
|
41712
|
+
name: classified.key,
|
|
41713
|
+
type: { kind: "unknown" },
|
|
41714
|
+
source: {
|
|
41715
|
+
kind: "global-blackboard",
|
|
41716
|
+
key: classified.key,
|
|
41717
|
+
range: { start: token.start, end: token.end }
|
|
41718
|
+
},
|
|
41719
|
+
readable: true,
|
|
41720
|
+
writable: true
|
|
41721
|
+
});
|
|
41722
|
+
continue;
|
|
41723
|
+
}
|
|
41724
|
+
if (environment.symbols.has(classified.name)) continue;
|
|
41725
|
+
environment.symbols.set(classified.name, {
|
|
41726
|
+
name: classified.name,
|
|
41346
41727
|
type: { kind: "unknown" },
|
|
41347
41728
|
source: {
|
|
41348
41729
|
kind: "script-assignment",
|
|
@@ -41360,10 +41741,14 @@ function describeScriptSymbol(symbol2) {
|
|
|
41360
41741
|
switch (symbol2.source.kind) {
|
|
41361
41742
|
case "port-remap":
|
|
41362
41743
|
return `${typeLabel} from ${symbol2.source.nodeType ?? "node"}.${symbol2.source.portName}`;
|
|
41744
|
+
case "global-blackboard-remap":
|
|
41745
|
+
return `${typeLabel} from global blackboard ${symbol2.source.nodeType ?? "node"}.${symbol2.source.portName}`;
|
|
41363
41746
|
case "subtree-port":
|
|
41364
41747
|
return `${typeLabel} from ${symbol2.source.nodeType ?? "SubTree"}.${symbol2.source.portName}`;
|
|
41365
41748
|
case "script-assignment":
|
|
41366
41749
|
return `${typeLabel} from earlier ${symbol2.source.attributeName} declaration`;
|
|
41750
|
+
case "global-blackboard":
|
|
41751
|
+
return `${typeLabel} from global blackboard @${symbol2.source.key}`;
|
|
41367
41752
|
case "augmentation":
|
|
41368
41753
|
return `${typeLabel} from augmentation`;
|
|
41369
41754
|
case "enum":
|
|
@@ -41505,6 +41890,7 @@ function getBehaviorTreeScriptFlow(context, behaviorTree) {
|
|
|
41505
41890
|
function buildBaseScriptEnvironment(context, nodes) {
|
|
41506
41891
|
const registry2 = getTypeRegistry(context.semantic);
|
|
41507
41892
|
const portSymbols = [];
|
|
41893
|
+
const globalBlackboardSymbols = [];
|
|
41508
41894
|
const behaviorTreeId = nodes[0]?.behaviorTree.id;
|
|
41509
41895
|
if (behaviorTreeId) {
|
|
41510
41896
|
const subtreeModel = context.getNodeModel(behaviorTreeId);
|
|
@@ -41530,17 +41916,21 @@ function buildBaseScriptEnvironment(context, nodes) {
|
|
|
41530
41916
|
}
|
|
41531
41917
|
}
|
|
41532
41918
|
for (const node of nodes) {
|
|
41533
|
-
const nodeType = node.usage.model.status === "resolved" ? node.usage.model.model.id : node.usage.nodeType;
|
|
41534
41919
|
for (const binding of node.portBindings) {
|
|
41535
41920
|
if (binding.usage.status !== "resolved") continue;
|
|
41536
|
-
const
|
|
41537
|
-
|
|
41921
|
+
const parsed = parsePortBlackboardReference({
|
|
41922
|
+
portName: binding.usage.port.name,
|
|
41923
|
+
rawValue: binding.usage.value
|
|
41924
|
+
});
|
|
41925
|
+
if (!parsed.ok) continue;
|
|
41926
|
+
if (parsed.reference.scope === "global") continue;
|
|
41538
41927
|
const resolvedTypeName = getResolvedPortType(binding.usage.port);
|
|
41539
41928
|
const resolvedDefinition = getTypeDefinition(context.semantic, resolvedTypeName);
|
|
41540
41929
|
const compatibilityKey = resolvedDefinition?.canonical ?? resolvedTypeName;
|
|
41541
41930
|
const direction = binding.usage.port.direction;
|
|
41931
|
+
const nodeType = node.usage.model.status === "resolved" ? node.usage.model.model.id : node.usage.nodeType;
|
|
41542
41932
|
portSymbols.push({
|
|
41543
|
-
name:
|
|
41933
|
+
name: parsed.reference.key,
|
|
41544
41934
|
type: scriptTypeFromTypeName(registry2, resolvedTypeName),
|
|
41545
41935
|
source: {
|
|
41546
41936
|
kind: "port-remap",
|
|
@@ -41554,12 +41944,47 @@ function buildBaseScriptEnvironment(context, nodes) {
|
|
|
41554
41944
|
});
|
|
41555
41945
|
}
|
|
41556
41946
|
}
|
|
41947
|
+
globalBlackboardSymbols.push(...collectGlobalBlackboardSeedSymbols(context, registry2));
|
|
41557
41948
|
return createScriptEnvironment({
|
|
41558
41949
|
symbols: portSymbols,
|
|
41950
|
+
globalBlackboardSymbols,
|
|
41559
41951
|
augmentations: getModelAugmentations(context.semantic),
|
|
41560
41952
|
areTypesCompatible: (left, right) => left && right ? areTypesCompatible2(context.semantic, left, right) : true
|
|
41561
41953
|
});
|
|
41562
41954
|
}
|
|
41955
|
+
function collectGlobalBlackboardSeedSymbols(context, registry2) {
|
|
41956
|
+
const symbols = [];
|
|
41957
|
+
for (const node of context.view.nodes) {
|
|
41958
|
+
const nodeType = node.usage.model.status === "resolved" ? node.usage.model.model.id : node.usage.nodeType;
|
|
41959
|
+
for (const binding of node.portBindings) {
|
|
41960
|
+
if (binding.usage.status !== "resolved") continue;
|
|
41961
|
+
const parsed = parsePortBlackboardReference({
|
|
41962
|
+
portName: binding.usage.port.name,
|
|
41963
|
+
rawValue: binding.usage.value
|
|
41964
|
+
});
|
|
41965
|
+
if (!parsed.ok || parsed.reference.scope !== "global") continue;
|
|
41966
|
+
const resolvedTypeName = getResolvedPortType(binding.usage.port);
|
|
41967
|
+
const resolvedDefinition = getTypeDefinition(context.semantic, resolvedTypeName);
|
|
41968
|
+
const compatibilityKey = resolvedDefinition?.canonical ?? resolvedTypeName;
|
|
41969
|
+
const direction = binding.usage.port.direction;
|
|
41970
|
+
symbols.push({
|
|
41971
|
+
name: parsed.reference.key,
|
|
41972
|
+
type: scriptTypeFromTypeName(registry2, resolvedTypeName),
|
|
41973
|
+
source: {
|
|
41974
|
+
kind: "global-blackboard-remap",
|
|
41975
|
+
nodeType,
|
|
41976
|
+
portName: binding.usage.port.name,
|
|
41977
|
+
direction,
|
|
41978
|
+
key: parsed.reference.key
|
|
41979
|
+
},
|
|
41980
|
+
readable: direction === "input" || direction === "output" || direction === "inout",
|
|
41981
|
+
writable: direction === "output" || direction === "inout",
|
|
41982
|
+
compatibilityKey
|
|
41983
|
+
});
|
|
41984
|
+
}
|
|
41985
|
+
}
|
|
41986
|
+
return symbols;
|
|
41987
|
+
}
|
|
41563
41988
|
|
|
41564
41989
|
// ../analyzer/src/analysis/rules/script/no-unknown-variable.ts
|
|
41565
41990
|
var scriptNoUnknownVariableRule = makeRuleModule({
|
|
@@ -41595,7 +42020,7 @@ var scriptValidAssignmentRule = makeRuleModule({
|
|
|
41595
42020
|
for (const candidate of getAnalyzedScriptAttributeCandidates(context, element)) {
|
|
41596
42021
|
if (!candidate.analysis) continue;
|
|
41597
42022
|
for (const diagnostic of candidate.analysis.diagnostics) {
|
|
41598
|
-
const code = diagnostic.code === "assignment-to-unknown-variable" ? RuleCodes.AssignmentToUnknownVariable : diagnostic.code === "invalid-compound-assignment" ? RuleCodes.InvalidCompoundAssignment : diagnostic.code === "variable-type-mismatch" ? RuleCodes.ScriptVariableTypeMismatch : void 0;
|
|
42023
|
+
const code = diagnostic.code === "assignment-to-unknown-variable" ? RuleCodes.AssignmentToUnknownVariable : diagnostic.code === "invalid-compound-assignment" ? RuleCodes.InvalidCompoundAssignment : diagnostic.code === "variable-type-mismatch" ? RuleCodes.ScriptVariableTypeMismatch : diagnostic.code === "invalid-global-blackboard-identifier" ? RuleCodes.InvalidGlobalBlackboardIdentifier : void 0;
|
|
41599
42024
|
if (!code) continue;
|
|
41600
42025
|
context.report({
|
|
41601
42026
|
code,
|
|
@@ -41668,16 +42093,16 @@ var scriptValidSyntaxRule = makeRuleModule({
|
|
|
41668
42093
|
Element(element) {
|
|
41669
42094
|
for (const candidate of getScriptAttributeCandidates(context, element)) {
|
|
41670
42095
|
if (candidate.parseResult.ok) continue;
|
|
41671
|
-
for (const
|
|
41672
|
-
const code =
|
|
42096
|
+
for (const error52 of candidate.parseResult.errors) {
|
|
42097
|
+
const code = error52.kind === "empty-script" ? RuleCodes.EmptyScript : error52.kind === "invalid-token" ? RuleCodes.InvalidScriptToken : RuleCodes.InvalidScriptSyntax;
|
|
41673
42098
|
context.report({
|
|
41674
42099
|
code,
|
|
41675
|
-
message:
|
|
41676
|
-
range:
|
|
42100
|
+
message: error52.message,
|
|
42101
|
+
range: error52.kind === "empty-script" ? candidate.attribute.valueContentRange ?? candidate.attribute.valueRange ?? mapScriptRangeToDocument(
|
|
41677
42102
|
context,
|
|
41678
42103
|
candidate.attribute,
|
|
41679
42104
|
attributeScriptRange(candidate.attribute)
|
|
41680
|
-
) : mapScriptRangeToDocument(context, candidate.attribute,
|
|
42105
|
+
) : mapScriptRangeToDocument(context, candidate.attribute, error52.range),
|
|
41681
42106
|
details: {
|
|
41682
42107
|
primaryLabel: `invalid script in \`${candidate.attribute.name}\``
|
|
41683
42108
|
}
|
|
@@ -41733,6 +42158,18 @@ var suppressionRules = [
|
|
|
41733
42158
|
function getAttr3(element, name) {
|
|
41734
42159
|
return element.attributes.find((attr) => attr.name === name);
|
|
41735
42160
|
}
|
|
42161
|
+
function isInsideTreeNodesModel(root, target) {
|
|
42162
|
+
if (!root) return false;
|
|
42163
|
+
const walk2 = (element, inTreeNodesModel) => {
|
|
42164
|
+
const nextInTreeNodesModel = inTreeNodesModel || element.name === "TreeNodesModel";
|
|
42165
|
+
if (element === target) return nextInTreeNodesModel;
|
|
42166
|
+
for (const child of element.children) {
|
|
42167
|
+
if (child.kind === "element" && walk2(child, nextInTreeNodesModel)) return true;
|
|
42168
|
+
}
|
|
42169
|
+
return false;
|
|
42170
|
+
};
|
|
42171
|
+
return walk2(root, false);
|
|
42172
|
+
}
|
|
41736
42173
|
var treeRules = [
|
|
41737
42174
|
makeRuleModule({
|
|
41738
42175
|
name: "tree/require-id",
|
|
@@ -41809,6 +42246,7 @@ var treeRules = [
|
|
|
41809
42246
|
return {
|
|
41810
42247
|
Element(element) {
|
|
41811
42248
|
if (element.name !== "SubTree") return;
|
|
42249
|
+
if (isInsideTreeNodesModel(context.document.root, element)) return;
|
|
41812
42250
|
const call = context.getSubTreeCallView(element);
|
|
41813
42251
|
const idAttr = call?.node.element.attributes.find((attr) => attr.name === "ID") ?? getAttr3(element, "ID");
|
|
41814
42252
|
if (!idAttr) return;
|
|
@@ -41829,6 +42267,7 @@ var treeRules = [
|
|
|
41829
42267
|
return {
|
|
41830
42268
|
Element(element) {
|
|
41831
42269
|
if (element.name !== "SubTree") return;
|
|
42270
|
+
if (isInsideTreeNodesModel(context.document.root, element)) return;
|
|
41832
42271
|
const idAttr = getAttr3(element, "ID");
|
|
41833
42272
|
if (!idAttr) return;
|
|
41834
42273
|
const call = context.getSubTreeCallView(element);
|
|
@@ -42795,8 +43234,8 @@ async function discoverBtxmlConfig(input) {
|
|
|
42795
43234
|
}
|
|
42796
43235
|
try {
|
|
42797
43236
|
raw = await readJson(configUri, input.host);
|
|
42798
|
-
} catch (
|
|
42799
|
-
const errorMessage = String(
|
|
43237
|
+
} catch (error52) {
|
|
43238
|
+
const errorMessage = String(error52.message || error52);
|
|
42800
43239
|
return {
|
|
42801
43240
|
ok: false,
|
|
42802
43241
|
configUri,
|
|
@@ -42856,34 +43295,31 @@ async function discoverBtxmlConfig(input) {
|
|
|
42856
43295
|
|
|
42857
43296
|
// ../project/src/models.ts
|
|
42858
43297
|
async function discoverModelFiles(rootUri, modelsConfig, filesConfig, host) {
|
|
42859
|
-
const ignore2 = [...filesConfig.ignore];
|
|
42860
|
-
const gitignoreLines = filesConfig.useGitignore ? await loadGitignore(rootUri, host) : [];
|
|
42861
|
-
const ig = createIgnoreInstance(gitignoreLines);
|
|
42862
43298
|
const modelFilesPatternResult = await expandPatterns(
|
|
42863
43299
|
modelsConfig.files,
|
|
42864
43300
|
rootUri,
|
|
42865
|
-
|
|
43301
|
+
[],
|
|
42866
43302
|
filesConfig.followSymlinks,
|
|
42867
43303
|
void 0,
|
|
42868
|
-
|
|
43304
|
+
void 0,
|
|
42869
43305
|
host
|
|
42870
43306
|
);
|
|
42871
43307
|
const definitionFilesPatternResult = await expandPatterns(
|
|
42872
43308
|
modelsConfig.definitions,
|
|
42873
43309
|
rootUri,
|
|
42874
|
-
|
|
43310
|
+
[],
|
|
42875
43311
|
filesConfig.followSymlinks,
|
|
42876
43312
|
void 0,
|
|
42877
|
-
|
|
43313
|
+
void 0,
|
|
42878
43314
|
host
|
|
42879
43315
|
);
|
|
42880
43316
|
const augmentationFilesPatternResult = await expandPatterns(
|
|
42881
43317
|
modelsConfig.augmentations,
|
|
42882
43318
|
rootUri,
|
|
42883
|
-
|
|
43319
|
+
[],
|
|
42884
43320
|
filesConfig.followSymlinks,
|
|
42885
43321
|
void 0,
|
|
42886
|
-
|
|
43322
|
+
void 0,
|
|
42887
43323
|
host
|
|
42888
43324
|
);
|
|
42889
43325
|
const modelFiles = modelFilesPatternResult.files.map((uri) => ({
|
|
@@ -43362,21 +43798,8 @@ function uniqueItems(items) {
|
|
|
43362
43798
|
}
|
|
43363
43799
|
|
|
43364
43800
|
// ../language-service/src/providers/blackboard-symbols.ts
|
|
43365
|
-
|
|
43366
|
-
|
|
43367
|
-
const key = raw?.trim();
|
|
43368
|
-
if (!key) return void 0;
|
|
43369
|
-
if (key.includes("{") || key.includes("}")) return void 0;
|
|
43370
|
-
return BLACKBOARD_KEY_RE.test(key) ? key : void 0;
|
|
43371
|
-
}
|
|
43372
|
-
function normalizeBlackboardKey(raw) {
|
|
43373
|
-
const value = raw?.trim();
|
|
43374
|
-
if (!value) return void 0;
|
|
43375
|
-
const extracted = value.startsWith("{") && value.endsWith("}") ? value.slice(1, -1).trim() : value;
|
|
43376
|
-
return validateExtractedBlackboardKey(extracted);
|
|
43377
|
-
}
|
|
43378
|
-
function formatBlackboardReference(key) {
|
|
43379
|
-
return `{${key}}`;
|
|
43801
|
+
function formatBlackboardReference2(symbol2) {
|
|
43802
|
+
return formatBlackboardReference(symbol2);
|
|
43380
43803
|
}
|
|
43381
43804
|
function normalizeType(type) {
|
|
43382
43805
|
return type?.trim().replace(/^const\s+/, "").replace(/[&*]\s*$/, "").replace(/\s+/g, " ").toLowerCase();
|
|
@@ -43392,31 +43815,32 @@ function collectBlackboardSymbols(context) {
|
|
|
43392
43815
|
if (binding.declaredPort.status !== "resolved") continue;
|
|
43393
43816
|
const port = binding.declaredPort.port;
|
|
43394
43817
|
for (const ref of binding.blackboardReferences) {
|
|
43395
|
-
|
|
43396
|
-
if (!key) continue;
|
|
43818
|
+
if (ref.syntax === "invalid") continue;
|
|
43397
43819
|
const next = {
|
|
43398
|
-
|
|
43820
|
+
identity: ref.identity,
|
|
43821
|
+
key: ref.key,
|
|
43822
|
+
scope: ref.scope,
|
|
43399
43823
|
type: port.type,
|
|
43400
43824
|
direction: port.direction,
|
|
43401
43825
|
nodeType: node.usage.nodeType || node.tagName,
|
|
43402
43826
|
portName: port.name
|
|
43403
43827
|
};
|
|
43404
|
-
const current = grouped.get(
|
|
43828
|
+
const current = grouped.get(ref.identity);
|
|
43405
43829
|
if (!current) {
|
|
43406
|
-
grouped.set(
|
|
43830
|
+
grouped.set(ref.identity, next);
|
|
43407
43831
|
continue;
|
|
43408
43832
|
}
|
|
43409
43833
|
const currentType = normalizeType(current.type);
|
|
43410
43834
|
const nextType = normalizeType(next.type);
|
|
43411
43835
|
if (currentType && nextType && currentType !== nextType) {
|
|
43412
|
-
grouped.set(
|
|
43836
|
+
grouped.set(ref.identity, {
|
|
43413
43837
|
...current,
|
|
43414
43838
|
conflict: true
|
|
43415
43839
|
});
|
|
43416
43840
|
continue;
|
|
43417
43841
|
}
|
|
43418
43842
|
if (!currentType && nextType) {
|
|
43419
|
-
grouped.set(
|
|
43843
|
+
grouped.set(ref.identity, {
|
|
43420
43844
|
...current,
|
|
43421
43845
|
type: next.type
|
|
43422
43846
|
});
|
|
@@ -43441,23 +43865,45 @@ function getBlackboardReplacementRange(document, attribute, cursorOffset) {
|
|
|
43441
43865
|
const endsInBraces = value.endsWith("}");
|
|
43442
43866
|
if (startsInBraces && cursorOffset > valueStart) {
|
|
43443
43867
|
const innerStart = valueStart + 1;
|
|
43868
|
+
const innerValueStart = value[1] === "@" ? innerStart + 1 : innerStart;
|
|
43444
43869
|
const innerEnd = endsInBraces ? valueEnd - 1 : valueEnd;
|
|
43445
43870
|
return {
|
|
43446
|
-
replacementRange: rangeFromOffsets2(
|
|
43447
|
-
|
|
43871
|
+
replacementRange: rangeFromOffsets2(
|
|
43872
|
+
document,
|
|
43873
|
+
innerValueStart,
|
|
43874
|
+
Math.max(innerValueStart, innerEnd)
|
|
43875
|
+
),
|
|
43876
|
+
wrapsReference: false,
|
|
43877
|
+
hasScopeMarker: value[1] === "@"
|
|
43448
43878
|
};
|
|
43449
43879
|
}
|
|
43450
43880
|
return {
|
|
43451
43881
|
insertText: attribute.value,
|
|
43452
43882
|
replacementRange: valueContentRange,
|
|
43453
|
-
wrapsReference: true
|
|
43883
|
+
wrapsReference: true,
|
|
43884
|
+
hasScopeMarker: false
|
|
43454
43885
|
};
|
|
43455
43886
|
}
|
|
43456
43887
|
function createBlackboardCompletionItem(args) {
|
|
43457
43888
|
const { document, attribute, cursorOffset, symbol: symbol2, detail } = args;
|
|
43458
43889
|
const replacement = getBlackboardReplacementRange(document, attribute, cursorOffset);
|
|
43459
|
-
const
|
|
43460
|
-
const
|
|
43890
|
+
const wrapsReference = replacement?.wrapsReference ?? false;
|
|
43891
|
+
const hasScopeMarker = replacement?.hasScopeMarker ?? false;
|
|
43892
|
+
if (hasScopeMarker && symbol2.scope !== "global") return void 0;
|
|
43893
|
+
let label = symbol2.key;
|
|
43894
|
+
if (wrapsReference) {
|
|
43895
|
+
label = formatBlackboardReference2(symbol2);
|
|
43896
|
+
} else if (symbol2.scope === "global") {
|
|
43897
|
+
label = `@${symbol2.key}`;
|
|
43898
|
+
}
|
|
43899
|
+
let newText = symbol2.key;
|
|
43900
|
+
if (wrapsReference) {
|
|
43901
|
+
newText = formatBlackboardReference2(symbol2);
|
|
43902
|
+
} else if (symbol2.scope === "global") {
|
|
43903
|
+
newText = hasScopeMarker ? symbol2.key : `@${symbol2.key}`;
|
|
43904
|
+
}
|
|
43905
|
+
const scopeFilterText = symbol2.scope === "global" ? ` @${symbol2.key}` : "";
|
|
43906
|
+
const filterText = `${symbol2.key} ${label}${scopeFilterText}`.trim();
|
|
43461
43907
|
return completion(
|
|
43462
43908
|
label,
|
|
43463
43909
|
"Reference",
|
|
@@ -43467,7 +43913,7 @@ function createBlackboardCompletionItem(args) {
|
|
|
43467
43913
|
newText
|
|
43468
43914
|
} : void 0,
|
|
43469
43915
|
{
|
|
43470
|
-
filterText
|
|
43916
|
+
filterText,
|
|
43471
43917
|
insertText: newText
|
|
43472
43918
|
}
|
|
43473
43919
|
);
|
|
@@ -43501,13 +43947,14 @@ function getScriptIdentifierTarget(context, position) {
|
|
|
43501
43947
|
(entry) => entry.access.range.start === cursor.range.start && entry.access.range.end === cursor.range.end && entry.resolution.kind !== "unknown"
|
|
43502
43948
|
);
|
|
43503
43949
|
if (!resolved || resolved.resolution.kind === "unknown") return void 0;
|
|
43504
|
-
const reference = resolved.resolution.kind === "symbol" ? { kind: "symbol", symbol: resolved.resolution.symbol } : resolved.resolution;
|
|
43950
|
+
const reference = resolved.resolution.kind === "symbol" ? { kind: "symbol", symbol: resolved.resolution.symbol } : resolved.resolution.kind === "global-blackboard" ? { ...resolved.resolution, origin: "script" } : resolved.resolution;
|
|
43505
43951
|
return {
|
|
43506
43952
|
attributeContext: scriptContext,
|
|
43507
43953
|
range: toDocumentRange(context, scriptContext, cursor.range),
|
|
43508
43954
|
reference,
|
|
43509
43955
|
flowState,
|
|
43510
43956
|
occurrence: {
|
|
43957
|
+
uri: context.document.uri,
|
|
43511
43958
|
attributeContext: scriptContext,
|
|
43512
43959
|
identifier: resolved.access,
|
|
43513
43960
|
reference,
|
|
@@ -43516,11 +43963,35 @@ function getScriptIdentifierTarget(context, position) {
|
|
|
43516
43963
|
};
|
|
43517
43964
|
}
|
|
43518
43965
|
function getScriptReferencesForSymbol(context, target) {
|
|
43519
|
-
const
|
|
43520
|
-
|
|
43521
|
-
|
|
43522
|
-
|
|
43523
|
-
|
|
43966
|
+
const occurrences = (target.reference.kind === "global-blackboard" ? collectAllScriptOccurrences(context) : getBehaviorTreeScriptFlow2(context, target.attributeContext.behaviorTree).flatMap(
|
|
43967
|
+
(state) => collectResolvedOccurrences(context, state)
|
|
43968
|
+
)).filter(
|
|
43969
|
+
(occurrence) => target.reference.kind === "enum" ? occurrence.reference.kind === "enum" && occurrence.reference.name === target.reference.name : target.reference.kind === "global-blackboard" ? occurrence.reference.kind === "global-blackboard" && occurrence.reference.key === target.reference.key : sameResolvedSymbol(target.reference.symbol, occurrence.reference)
|
|
43970
|
+
);
|
|
43971
|
+
if (target.reference.kind === "global-blackboard") {
|
|
43972
|
+
return uniqueScriptOccurrences([
|
|
43973
|
+
...occurrences,
|
|
43974
|
+
...collectGlobalBlackboardRemapOccurrences(context, target.reference.key)
|
|
43975
|
+
]);
|
|
43976
|
+
}
|
|
43977
|
+
return occurrences;
|
|
43978
|
+
}
|
|
43979
|
+
function getGlobalBlackboardReferenceLocations(context, key) {
|
|
43980
|
+
return uniqueBlackboardLocations(
|
|
43981
|
+
collectGlobalBlackboardRemapOccurrences(context, key).map((occurrence) => ({
|
|
43982
|
+
uri: occurrence.uri,
|
|
43983
|
+
range: occurrence.documentRange
|
|
43984
|
+
}))
|
|
43985
|
+
);
|
|
43986
|
+
}
|
|
43987
|
+
function getGlobalBlackboardScriptLocations(context, key) {
|
|
43988
|
+
return uniqueBlackboardLocations(
|
|
43989
|
+
collectAllScriptOccurrences(context).filter(
|
|
43990
|
+
(occurrence) => occurrence.reference.kind === "global-blackboard" && occurrence.reference.key === key
|
|
43991
|
+
).map((occurrence) => ({
|
|
43992
|
+
uri: occurrence.uri,
|
|
43993
|
+
range: occurrence.documentRange
|
|
43994
|
+
}))
|
|
43524
43995
|
);
|
|
43525
43996
|
}
|
|
43526
43997
|
function getBehaviorTreeScriptFlowStates(context, behaviorTree) {
|
|
@@ -43536,10 +44007,14 @@ function describeScriptSymbol2(symbol2) {
|
|
|
43536
44007
|
switch (symbol2.source.kind) {
|
|
43537
44008
|
case "port-remap":
|
|
43538
44009
|
return `${typeLabel} from ${symbol2.source.nodeType ?? "node"}.${symbol2.source.portName}`;
|
|
44010
|
+
case "global-blackboard-remap":
|
|
44011
|
+
return `${typeLabel} from global blackboard ${symbol2.source.nodeType ?? "node"}.${symbol2.source.portName}`;
|
|
43539
44012
|
case "subtree-port":
|
|
43540
44013
|
return `${typeLabel} from ${symbol2.source.nodeType ?? "SubTree"}.${symbol2.source.portName}`;
|
|
43541
44014
|
case "script-assignment":
|
|
43542
44015
|
return `${typeLabel} from earlier ${symbol2.source.attributeName} declaration`;
|
|
44016
|
+
case "global-blackboard":
|
|
44017
|
+
return `${typeLabel} from global blackboard @${symbol2.source.key}`;
|
|
43543
44018
|
case "augmentation":
|
|
43544
44019
|
return `${typeLabel} from augmentation`;
|
|
43545
44020
|
case "enum":
|
|
@@ -43615,6 +44090,7 @@ function getScriptAttributeContext(context, element, attribute) {
|
|
|
43615
44090
|
function buildBaseScriptEnvironment2(context, nodes) {
|
|
43616
44091
|
const registry2 = getTypeRegistry(context.semantic);
|
|
43617
44092
|
const portSymbols = [];
|
|
44093
|
+
const globalBlackboardSymbols = [];
|
|
43618
44094
|
const behaviorTreeId = nodes[0]?.behaviorTree.id;
|
|
43619
44095
|
if (behaviorTreeId) {
|
|
43620
44096
|
const subtreeModel = getNodeModel(context.semantic, behaviorTreeId);
|
|
@@ -43640,17 +44116,18 @@ function buildBaseScriptEnvironment2(context, nodes) {
|
|
|
43640
44116
|
}
|
|
43641
44117
|
}
|
|
43642
44118
|
for (const node of nodes) {
|
|
43643
|
-
const nodeType = node.usage.model.status === "resolved" ? node.usage.model.model.id : node.usage.nodeType;
|
|
43644
44119
|
for (const binding of node.portBindings) {
|
|
43645
44120
|
if (binding.declaredPort.status !== "resolved") continue;
|
|
43646
|
-
const
|
|
43647
|
-
if (!
|
|
44121
|
+
const reference = getBlackboardReferenceFromBinding(binding);
|
|
44122
|
+
if (!reference) continue;
|
|
44123
|
+
if (reference.scope === "global") continue;
|
|
43648
44124
|
const resolvedTypeName = binding.declaredPort.port.type;
|
|
43649
44125
|
const resolvedDefinition = getTypeDefinition(context.semantic, resolvedTypeName);
|
|
43650
44126
|
const compatibilityKey = resolvedDefinition?.canonical ?? resolvedTypeName;
|
|
43651
44127
|
const direction = binding.declaredPort.port.direction;
|
|
44128
|
+
const nodeType = node.usage.model.status === "resolved" ? node.usage.model.model.id : node.usage.nodeType;
|
|
43652
44129
|
portSymbols.push({
|
|
43653
|
-
name:
|
|
44130
|
+
name: reference.key,
|
|
43654
44131
|
type: scriptTypeFromTypeName(registry2, resolvedTypeName),
|
|
43655
44132
|
source: {
|
|
43656
44133
|
kind: "port-remap",
|
|
@@ -43664,19 +44141,57 @@ function buildBaseScriptEnvironment2(context, nodes) {
|
|
|
43664
44141
|
});
|
|
43665
44142
|
}
|
|
43666
44143
|
}
|
|
44144
|
+
const workspaceNodes = getDocumentTrees(context).flatMap(
|
|
44145
|
+
({ trees }) => trees.flatMap((tree) => tree.nodes)
|
|
44146
|
+
);
|
|
44147
|
+
globalBlackboardSymbols.push(
|
|
44148
|
+
...collectGlobalBlackboardSeedSymbols2(context, registry2, workspaceNodes)
|
|
44149
|
+
);
|
|
43667
44150
|
return createScriptEnvironment({
|
|
43668
44151
|
symbols: portSymbols,
|
|
44152
|
+
globalBlackboardSymbols,
|
|
43669
44153
|
augmentations: getModelAugmentations(context.semantic),
|
|
43670
44154
|
areTypesCompatible: (left, right) => left && right ? areTypesCompatible2(context.semantic, left, right) : true
|
|
43671
44155
|
});
|
|
43672
44156
|
}
|
|
44157
|
+
function collectGlobalBlackboardSeedSymbols2(context, registry2, nodes) {
|
|
44158
|
+
const symbols = [];
|
|
44159
|
+
for (const node of nodes) {
|
|
44160
|
+
const nodeType = node.usage.model.status === "resolved" ? node.usage.model.model.id : node.usage.nodeType;
|
|
44161
|
+
for (const binding of node.portBindings) {
|
|
44162
|
+
if (binding.declaredPort.status !== "resolved") continue;
|
|
44163
|
+
const reference = getBlackboardReferenceFromBinding(binding);
|
|
44164
|
+
if (!reference || reference.scope !== "global") continue;
|
|
44165
|
+
const resolvedTypeName = binding.declaredPort.port.type;
|
|
44166
|
+
const resolvedDefinition = getTypeDefinition(context.semantic, resolvedTypeName);
|
|
44167
|
+
const compatibilityKey = resolvedDefinition?.canonical ?? resolvedTypeName;
|
|
44168
|
+
const direction = binding.declaredPort.port.direction;
|
|
44169
|
+
symbols.push({
|
|
44170
|
+
name: reference.key,
|
|
44171
|
+
type: scriptTypeFromTypeName(registry2, resolvedTypeName),
|
|
44172
|
+
source: {
|
|
44173
|
+
kind: "global-blackboard-remap",
|
|
44174
|
+
nodeType,
|
|
44175
|
+
portName: binding.declaredPort.port.name,
|
|
44176
|
+
direction,
|
|
44177
|
+
key: reference.key
|
|
44178
|
+
},
|
|
44179
|
+
readable: direction === "input" || direction === "output" || direction === "inout",
|
|
44180
|
+
writable: direction === "output" || direction === "inout",
|
|
44181
|
+
compatibilityKey
|
|
44182
|
+
});
|
|
44183
|
+
}
|
|
44184
|
+
}
|
|
44185
|
+
return symbols;
|
|
44186
|
+
}
|
|
43673
44187
|
function collectResolvedOccurrences(context, state) {
|
|
43674
44188
|
if (!state.analysis) return [];
|
|
43675
44189
|
return state.analysis.resolvedIdentifiers.flatMap((entry) => {
|
|
43676
44190
|
if (entry.resolution.kind === "unknown") return [];
|
|
43677
|
-
const reference = entry.resolution.kind === "symbol" ? { kind: "symbol", symbol: entry.resolution.symbol } : entry.resolution;
|
|
44191
|
+
const reference = entry.resolution.kind === "symbol" ? { kind: "symbol", symbol: entry.resolution.symbol } : entry.resolution.kind === "global-blackboard" ? { ...entry.resolution, origin: "script" } : entry.resolution;
|
|
43678
44192
|
return [
|
|
43679
44193
|
{
|
|
44194
|
+
uri: context.document.uri,
|
|
43680
44195
|
attributeContext: state.context,
|
|
43681
44196
|
identifier: entry.access,
|
|
43682
44197
|
reference,
|
|
@@ -43696,6 +44211,112 @@ function sameResolvedSymbol(symbol2, reference) {
|
|
|
43696
44211
|
}
|
|
43697
44212
|
return symbol2.name === candidate.name && symbol2.source.kind === candidate.source.kind;
|
|
43698
44213
|
}
|
|
44214
|
+
function uniqueScriptOccurrences(occurrences) {
|
|
44215
|
+
const seen = /* @__PURE__ */ new Set();
|
|
44216
|
+
const result = [];
|
|
44217
|
+
for (const occurrence of occurrences) {
|
|
44218
|
+
const key = `${occurrence.uri}:${occurrence.documentRange.start.offset}:${occurrence.documentRange.end.offset}:${occurrence.reference.kind}`;
|
|
44219
|
+
if (seen.has(key)) continue;
|
|
44220
|
+
seen.add(key);
|
|
44221
|
+
result.push(occurrence);
|
|
44222
|
+
}
|
|
44223
|
+
return result;
|
|
44224
|
+
}
|
|
44225
|
+
function collectGlobalBlackboardRemapOccurrences(context, key) {
|
|
44226
|
+
return getDocumentTrees(context).flatMap(
|
|
44227
|
+
({ uri, trees }) => trees.flatMap(
|
|
44228
|
+
(behaviorTree) => behaviorTree.nodes.flatMap(
|
|
44229
|
+
(node) => node.portBindings.flatMap(
|
|
44230
|
+
(binding) => binding.blackboardReferences.filter((reference) => reference.scope === "global" && reference.key === key).map((reference) => ({
|
|
44231
|
+
uri,
|
|
44232
|
+
attributeContext: {
|
|
44233
|
+
id: `${node.path.join(".")}:${binding.attribute.name}:${node.element.attributes.indexOf(binding.attribute)}`,
|
|
44234
|
+
node,
|
|
44235
|
+
element: node.element,
|
|
44236
|
+
attribute: binding.attribute,
|
|
44237
|
+
source: binding.attribute.value,
|
|
44238
|
+
behaviorTree: node.behaviorTree
|
|
44239
|
+
},
|
|
44240
|
+
identifier: {
|
|
44241
|
+
name: `@${reference.key}`,
|
|
44242
|
+
kind: "read",
|
|
44243
|
+
range: { start: 0, end: 0 },
|
|
44244
|
+
identifier: {
|
|
44245
|
+
kind: "Identifier",
|
|
44246
|
+
name: `@${reference.key}`,
|
|
44247
|
+
range: { start: 0, end: 0 }
|
|
44248
|
+
},
|
|
44249
|
+
statementIndex: -1
|
|
44250
|
+
},
|
|
44251
|
+
reference: {
|
|
44252
|
+
kind: "global-blackboard",
|
|
44253
|
+
key: reference.key,
|
|
44254
|
+
origin: "port-remap"
|
|
44255
|
+
},
|
|
44256
|
+
documentRange: reference.range
|
|
44257
|
+
}))
|
|
44258
|
+
)
|
|
44259
|
+
)
|
|
44260
|
+
)
|
|
44261
|
+
);
|
|
44262
|
+
}
|
|
44263
|
+
function collectAllScriptOccurrences(context) {
|
|
44264
|
+
return getDocumentTrees(context).flatMap(
|
|
44265
|
+
({ uri, trees }) => trees.flatMap((behaviorTree) => {
|
|
44266
|
+
const nextContext = getContextForUri(context, uri);
|
|
44267
|
+
return getBehaviorTreeScriptFlow2(nextContext, behaviorTree).flatMap(
|
|
44268
|
+
(state) => collectResolvedOccurrencesByUri(nextContext, uri, state)
|
|
44269
|
+
);
|
|
44270
|
+
})
|
|
44271
|
+
);
|
|
44272
|
+
}
|
|
44273
|
+
function collectResolvedOccurrencesByUri(context, uri, state) {
|
|
44274
|
+
return collectResolvedOccurrences(context, state).map((occurrence) => ({
|
|
44275
|
+
...occurrence,
|
|
44276
|
+
uri
|
|
44277
|
+
}));
|
|
44278
|
+
}
|
|
44279
|
+
function getDocumentTrees(context) {
|
|
44280
|
+
const current = context.documentView ? [{ uri: context.document.uri, trees: context.documentView.behaviorTrees }] : [];
|
|
44281
|
+
const workspace = context.workspace?.documents ?? [];
|
|
44282
|
+
const others = workspace.filter((document) => document.uri !== context.document.uri).map((document) => {
|
|
44283
|
+
const view = buildBtDocumentView(document, {
|
|
44284
|
+
semantic: context.semantic,
|
|
44285
|
+
config: context.config,
|
|
44286
|
+
policy: context.nodeUsagePolicy
|
|
44287
|
+
});
|
|
44288
|
+
return { uri: document.uri, trees: view.behaviorTrees };
|
|
44289
|
+
}).filter((entry) => entry.trees.length > 0);
|
|
44290
|
+
return [...current, ...others];
|
|
44291
|
+
}
|
|
44292
|
+
function getContextForUri(context, uri) {
|
|
44293
|
+
if (uri === context.document.uri) return context;
|
|
44294
|
+
const parsed = context.workspace?.documents.find((document2) => document2.uri === uri);
|
|
44295
|
+
if (!parsed) return context;
|
|
44296
|
+
const document = createTextDocument(uri, parsed.originalText, 0, "btcpp-xml");
|
|
44297
|
+
const documentView = buildBtDocumentView(parsed, {
|
|
44298
|
+
semantic: context.semantic,
|
|
44299
|
+
config: context.config,
|
|
44300
|
+
policy: context.nodeUsagePolicy
|
|
44301
|
+
});
|
|
44302
|
+
return {
|
|
44303
|
+
...context,
|
|
44304
|
+
document,
|
|
44305
|
+
parsed,
|
|
44306
|
+
documentView
|
|
44307
|
+
};
|
|
44308
|
+
}
|
|
44309
|
+
function uniqueBlackboardLocations(locations) {
|
|
44310
|
+
const seen = /* @__PURE__ */ new Set();
|
|
44311
|
+
const result = [];
|
|
44312
|
+
for (const location of locations) {
|
|
44313
|
+
const key = `${location.uri}:${location.range.start.offset}:${location.range.end.offset}`;
|
|
44314
|
+
if (seen.has(key)) continue;
|
|
44315
|
+
seen.add(key);
|
|
44316
|
+
result.push(location);
|
|
44317
|
+
}
|
|
44318
|
+
return result;
|
|
44319
|
+
}
|
|
43699
44320
|
function toDocumentRange(context, scriptContext, range) {
|
|
43700
44321
|
return mapDecodedAttributeRangeToDocumentRange(
|
|
43701
44322
|
context.parsed ?? { originalText: context.document.text },
|
|
@@ -43721,9 +44342,13 @@ function mapDecodedRangeToReplacementRange(context, attribute, range) {
|
|
|
43721
44342
|
const document = context.parsed ?? { originalText: context.document.text };
|
|
43722
44343
|
return mapDecodedAttributeRangeToDocumentRange(document, attribute, range);
|
|
43723
44344
|
}
|
|
43724
|
-
function
|
|
44345
|
+
function getBlackboardReferenceFromBinding(binding) {
|
|
43725
44346
|
if (binding.declaredPort.status !== "resolved") return void 0;
|
|
43726
|
-
|
|
44347
|
+
const parsed = parsePortBlackboardReference({
|
|
44348
|
+
portName: binding.declaredPort.port.name,
|
|
44349
|
+
rawValue: binding.value
|
|
44350
|
+
});
|
|
44351
|
+
return parsed.ok ? parsed.reference : void 0;
|
|
43727
44352
|
}
|
|
43728
44353
|
|
|
43729
44354
|
// ../language-service/src/providers/script-completions.ts
|
|
@@ -44006,28 +44631,37 @@ function attributeValueItems(input, inspect, context) {
|
|
|
44006
44631
|
const unknownTypeSymbols = symbols.filter(
|
|
44007
44632
|
(symbol2) => !symbol2.conflict && !normalizeType(symbol2.type) && normalizedCurrentType
|
|
44008
44633
|
);
|
|
44009
|
-
const matchingKeyItems = matchingSymbols.
|
|
44010
|
-
|
|
44634
|
+
const matchingKeyItems = matchingSymbols.flatMap((symbol2) => {
|
|
44635
|
+
const item = createBlackboardCompletionItem({
|
|
44011
44636
|
document: input.document,
|
|
44012
44637
|
attribute,
|
|
44013
44638
|
cursorOffset: input.position.offset,
|
|
44014
44639
|
symbol: symbol2,
|
|
44015
|
-
detail: `${symbol2.type || "unknown"} blackboard key from ${symbol2.nodeType}.${symbol2.portName}`
|
|
44016
|
-
})
|
|
44017
|
-
|
|
44018
|
-
|
|
44019
|
-
|
|
44020
|
-
|
|
44640
|
+
detail: symbol2.scope === "global" ? `${symbol2.type || "unknown"} global blackboard key from ${symbol2.nodeType}.${symbol2.portName}` : `${symbol2.type || "unknown"} blackboard key from ${symbol2.nodeType}.${symbol2.portName}`
|
|
44641
|
+
});
|
|
44642
|
+
return item ? [
|
|
44643
|
+
{
|
|
44644
|
+
...item,
|
|
44645
|
+
sortText: `${BLACKBOARD_SORT_TEXT.matchingKey}-${symbol2.scope === "global" ? symbol2.identity : symbol2.key}`
|
|
44646
|
+
}
|
|
44647
|
+
] : [];
|
|
44648
|
+
});
|
|
44649
|
+
const unknownKeyItems = unknownTypeSymbols.flatMap((symbol2) => {
|
|
44650
|
+
const item = createBlackboardCompletionItem({
|
|
44021
44651
|
document: input.document,
|
|
44022
44652
|
attribute,
|
|
44023
44653
|
cursorOffset: input.position.offset,
|
|
44024
44654
|
symbol: symbol2,
|
|
44025
|
-
detail: `unknown-type blackboard key from ${symbol2.nodeType}.${symbol2.portName}`
|
|
44026
|
-
})
|
|
44027
|
-
|
|
44028
|
-
|
|
44029
|
-
|
|
44030
|
-
|
|
44655
|
+
detail: symbol2.scope === "global" ? `unknown-type global blackboard key from ${symbol2.nodeType}.${symbol2.portName}` : `unknown-type blackboard key from ${symbol2.nodeType}.${symbol2.portName}`
|
|
44656
|
+
});
|
|
44657
|
+
return item ? [
|
|
44658
|
+
{
|
|
44659
|
+
...item,
|
|
44660
|
+
sortText: `${BLACKBOARD_SORT_TEXT.unknownKey}-${symbol2.scope === "global" ? symbol2.identity : symbol2.key}`
|
|
44661
|
+
}
|
|
44662
|
+
] : [];
|
|
44663
|
+
});
|
|
44664
|
+
items.push(...matchingKeyItems, ...unknownKeyItems);
|
|
44031
44665
|
if (items.length > 0) {
|
|
44032
44666
|
return uniqueItems(items);
|
|
44033
44667
|
}
|
|
@@ -44060,7 +44694,9 @@ function getCompletions(context, input) {
|
|
|
44060
44694
|
};
|
|
44061
44695
|
}
|
|
44062
44696
|
if (inspect.kind === "tag-name") {
|
|
44063
|
-
return {
|
|
44697
|
+
return {
|
|
44698
|
+
items: uniqueItems(elementNameItems(context.semantic, inspect.element?.nameRange))
|
|
44699
|
+
};
|
|
44064
44700
|
}
|
|
44065
44701
|
if (inspect.kind === "closing-tag-name") {
|
|
44066
44702
|
return { items: uniqueItems(closingTagItems(inspect)) };
|
|
@@ -44069,6 +44705,63 @@ function getCompletions(context, input) {
|
|
|
44069
44705
|
}
|
|
44070
44706
|
|
|
44071
44707
|
// ../language-service/src/providers/definition.ts
|
|
44708
|
+
function uniqueLocations(locations) {
|
|
44709
|
+
const seen = /* @__PURE__ */ new Set();
|
|
44710
|
+
const result = [];
|
|
44711
|
+
for (const location of locations) {
|
|
44712
|
+
const key = `${location.uri}:${location.range.start.offset}:${location.range.end.offset}`;
|
|
44713
|
+
if (seen.has(key)) continue;
|
|
44714
|
+
seen.add(key);
|
|
44715
|
+
result.push(location);
|
|
44716
|
+
}
|
|
44717
|
+
return result;
|
|
44718
|
+
}
|
|
44719
|
+
function getSubTreeModelDefinitionLocations(semantic, id, fallbackUri) {
|
|
44720
|
+
return getNodeModelDefinitions(semantic, id).filter((definition) => definition.kind === "SubTree").map((definition) => {
|
|
44721
|
+
if (definition.idRange) {
|
|
44722
|
+
return {
|
|
44723
|
+
uri: definition.uri || fallbackUri,
|
|
44724
|
+
range: definition.idRange
|
|
44725
|
+
};
|
|
44726
|
+
}
|
|
44727
|
+
if (definition.range) {
|
|
44728
|
+
return {
|
|
44729
|
+
uri: definition.uri || fallbackUri,
|
|
44730
|
+
range: definition.range
|
|
44731
|
+
};
|
|
44732
|
+
}
|
|
44733
|
+
return void 0;
|
|
44734
|
+
}).filter((location) => Boolean(location));
|
|
44735
|
+
}
|
|
44736
|
+
function getBlackboardDefinitionLocations(documentView, identity, fallbackUri) {
|
|
44737
|
+
if (!documentView) return [];
|
|
44738
|
+
return uniqueLocations(
|
|
44739
|
+
documentView.nodes.flatMap(
|
|
44740
|
+
(node) => node.portBindings.flatMap(
|
|
44741
|
+
(binding) => binding.blackboardReferences.filter((reference) => reference.identity === identity).map((reference) => ({
|
|
44742
|
+
uri: fallbackUri,
|
|
44743
|
+
range: reference.range
|
|
44744
|
+
}))
|
|
44745
|
+
)
|
|
44746
|
+
)
|
|
44747
|
+
);
|
|
44748
|
+
}
|
|
44749
|
+
function getWorkspaceBlackboardLocations(documentView, workspaceDocuments, semantic, config2, policy, identity, fallbackUri) {
|
|
44750
|
+
const current = getBlackboardDefinitionLocations(documentView, identity, fallbackUri);
|
|
44751
|
+
const workspace = (workspaceDocuments ?? []).flatMap((document) => {
|
|
44752
|
+
if (document.uri === fallbackUri) return [];
|
|
44753
|
+
const view = buildBtDocumentView(document, {
|
|
44754
|
+
semantic,
|
|
44755
|
+
config: config2,
|
|
44756
|
+
policy
|
|
44757
|
+
});
|
|
44758
|
+
return getBlackboardDefinitionLocations(view, identity, document.uri);
|
|
44759
|
+
});
|
|
44760
|
+
return uniqueLocations([...current, ...workspace]);
|
|
44761
|
+
}
|
|
44762
|
+
function getDocumentBlackboardLocations(documentView, identity, fallbackUri) {
|
|
44763
|
+
return getBlackboardDefinitionLocations(documentView, identity, fallbackUri);
|
|
44764
|
+
}
|
|
44072
44765
|
function getDefinitionLocations(parsed, documentView, position, semantic, config2, policy, workspaceDocuments) {
|
|
44073
44766
|
if (!parsed) return [];
|
|
44074
44767
|
const inspect = inspectXmlCursor({
|
|
@@ -44094,27 +44787,45 @@ function getDefinitionLocations(parsed, documentView, position, semantic, config
|
|
|
44094
44787
|
policy
|
|
44095
44788
|
}) : void 0;
|
|
44096
44789
|
if (element?.name === "SubTree" && attribute?.name === "ID") {
|
|
44790
|
+
if (usage?.tagForm === "model-definition") {
|
|
44791
|
+
return getBehaviorTrees(semantic, attribute.value).map((def) => def.idRange ? { uri: def.uri, range: def.idRange } : void 0).filter((location) => Boolean(location));
|
|
44792
|
+
}
|
|
44793
|
+
const subtreeModelDefinitions = getSubTreeModelDefinitionLocations(
|
|
44794
|
+
semantic,
|
|
44795
|
+
attribute.value,
|
|
44796
|
+
parsed.uri
|
|
44797
|
+
);
|
|
44097
44798
|
const target = usage?.subtree?.target;
|
|
44098
44799
|
if (target?.status === "resolved" && target.kind === "behavior-tree") {
|
|
44099
44800
|
const behaviorTree = target.behaviorTree;
|
|
44100
44801
|
if (behaviorTree.idRange) {
|
|
44101
|
-
return [
|
|
44802
|
+
return uniqueLocations([
|
|
44102
44803
|
{
|
|
44103
44804
|
uri: behaviorTree.uri,
|
|
44104
44805
|
range: behaviorTree.idRange
|
|
44105
|
-
}
|
|
44106
|
-
|
|
44806
|
+
},
|
|
44807
|
+
...subtreeModelDefinitions
|
|
44808
|
+
]);
|
|
44107
44809
|
}
|
|
44810
|
+
return subtreeModelDefinitions;
|
|
44108
44811
|
}
|
|
44109
44812
|
if (target?.status === "ambiguous") {
|
|
44110
|
-
return
|
|
44111
|
-
|
|
44112
|
-
|
|
44813
|
+
return uniqueLocations(
|
|
44814
|
+
[
|
|
44815
|
+
...target.behaviorTrees.map(
|
|
44816
|
+
(def) => def.idRange ? { uri: def.uri || parsed.uri, range: def.idRange } : void 0
|
|
44817
|
+
),
|
|
44818
|
+
...subtreeModelDefinitions
|
|
44819
|
+
].filter((location) => Boolean(location))
|
|
44820
|
+
);
|
|
44113
44821
|
}
|
|
44114
|
-
if (target?.status === "resolved" && target.kind === "node-model"
|
|
44115
|
-
|
|
44822
|
+
if (target?.status === "resolved" && target.kind === "node-model") {
|
|
44823
|
+
if (subtreeModelDefinitions.length > 0) return subtreeModelDefinitions;
|
|
44824
|
+
if (target.model.idRange) {
|
|
44825
|
+
return [{ uri: target.model.uri || parsed.uri, range: target.model.idRange }];
|
|
44826
|
+
}
|
|
44116
44827
|
}
|
|
44117
|
-
return
|
|
44828
|
+
return subtreeModelDefinitions;
|
|
44118
44829
|
}
|
|
44119
44830
|
if (element?.name === "root" && attribute?.name === "main_tree_to_execute") {
|
|
44120
44831
|
return getBehaviorTrees(semantic, attribute.value).map((def) => def.idRange ? { uri: def.uri, range: def.idRange } : void 0).filter((location) => Boolean(location));
|
|
@@ -44127,6 +44838,20 @@ function getDefinitionLocations(parsed, documentView, position, semantic, config
|
|
|
44127
44838
|
}
|
|
44128
44839
|
if (attribute && element) {
|
|
44129
44840
|
const binding = documentView ? findPortBindingAtPosition(documentView, position) : void 0;
|
|
44841
|
+
const blackboardReference = binding?.blackboardReferences.find(
|
|
44842
|
+
(reference) => position.offset >= reference.range.start.offset && position.offset <= reference.range.end.offset
|
|
44843
|
+
);
|
|
44844
|
+
if (blackboardReference) {
|
|
44845
|
+
return blackboardReference.scope === "global" ? getWorkspaceBlackboardLocations(
|
|
44846
|
+
documentView,
|
|
44847
|
+
workspaceDocuments,
|
|
44848
|
+
semantic,
|
|
44849
|
+
config2,
|
|
44850
|
+
policy,
|
|
44851
|
+
blackboardReference.identity,
|
|
44852
|
+
parsed.uri
|
|
44853
|
+
) : getDocumentBlackboardLocations(documentView, blackboardReference.identity, parsed.uri);
|
|
44854
|
+
}
|
|
44130
44855
|
if (binding?.declaredPort.status === "resolved") {
|
|
44131
44856
|
const port = binding.declaredPort.port;
|
|
44132
44857
|
if (port.nameRange) return [{ uri: port.uri || parsed.uri, range: port.nameRange }];
|
|
@@ -44170,12 +44895,16 @@ function getDefinition(context, input) {
|
|
|
44170
44895
|
]
|
|
44171
44896
|
};
|
|
44172
44897
|
}
|
|
44173
|
-
if (symbol2.source.kind === "port-remap") {
|
|
44898
|
+
if (symbol2.source.kind === "port-remap" || symbol2.source.kind === "global-blackboard-remap") {
|
|
44174
44899
|
const source = symbol2.source;
|
|
44900
|
+
const targetIdentity = makeBlackboardIdentity({
|
|
44901
|
+
scope: source.kind === "global-blackboard-remap" ? "global" : "local",
|
|
44902
|
+
key: symbol2.name
|
|
44903
|
+
});
|
|
44175
44904
|
const binding = context.documentView?.nodes.filter((node) => node.behaviorTree === scriptTarget.attributeContext.behaviorTree).flatMap((node) => node.portBindings).filter(
|
|
44176
44905
|
(binding2) => binding2.declaredPort.status === "resolved"
|
|
44177
44906
|
).find(
|
|
44178
|
-
(binding2) => binding2.declaredPort.port.name === source.portName && binding2.declaredPort.port.direction === source.direction &&
|
|
44907
|
+
(binding2) => binding2.declaredPort.port.name === source.portName && binding2.declaredPort.port.direction === source.direction && binding2.blackboardReferences.some((reference) => reference.identity === targetIdentity)
|
|
44179
44908
|
);
|
|
44180
44909
|
const location = binding?.declaredPort.port.nameRange;
|
|
44181
44910
|
if (location) {
|
|
@@ -44207,6 +44936,39 @@ function getDefinition(context, input) {
|
|
|
44207
44936
|
}
|
|
44208
44937
|
}
|
|
44209
44938
|
}
|
|
44939
|
+
if (scriptTarget?.reference.kind === "global-blackboard") {
|
|
44940
|
+
const targetIdentity = makeBlackboardIdentity({
|
|
44941
|
+
scope: "global",
|
|
44942
|
+
key: scriptTarget.reference.key
|
|
44943
|
+
});
|
|
44944
|
+
const locations = getGlobalBlackboardReferenceLocations(context, scriptTarget.reference.key);
|
|
44945
|
+
if (locations.length > 0) {
|
|
44946
|
+
return {
|
|
44947
|
+
locations
|
|
44948
|
+
};
|
|
44949
|
+
}
|
|
44950
|
+
const symbol2 = scriptTarget.reference.symbol;
|
|
44951
|
+
if (symbol2?.source.kind === "global-blackboard") {
|
|
44952
|
+
const source = symbol2.source;
|
|
44953
|
+
const declarationState = getBehaviorTreeScriptFlowStates(
|
|
44954
|
+
context,
|
|
44955
|
+
scriptTarget.attributeContext.behaviorTree
|
|
44956
|
+
).find((state) => state.id === source.originId);
|
|
44957
|
+
const declarationContext = declarationState?.context ?? scriptTarget.attributeContext;
|
|
44958
|
+
return {
|
|
44959
|
+
locations: [
|
|
44960
|
+
{
|
|
44961
|
+
uri: context.document.uri,
|
|
44962
|
+
range: mapDecodedAttributeRangeToDocumentRange(
|
|
44963
|
+
context.parsed ?? { originalText: context.document.text },
|
|
44964
|
+
declarationContext.attribute,
|
|
44965
|
+
source.range
|
|
44966
|
+
)
|
|
44967
|
+
}
|
|
44968
|
+
]
|
|
44969
|
+
};
|
|
44970
|
+
}
|
|
44971
|
+
}
|
|
44210
44972
|
return {
|
|
44211
44973
|
locations: getDefinitionLocations(
|
|
44212
44974
|
context.parsed,
|
|
@@ -44293,6 +45055,18 @@ function getHover(context, input) {
|
|
|
44293
45055
|
Value: \`${scriptTarget.reference.value}\``
|
|
44294
45056
|
};
|
|
44295
45057
|
}
|
|
45058
|
+
if (scriptTarget.reference.kind === "global-blackboard") {
|
|
45059
|
+
const symbol3 = scriptTarget.reference.symbol;
|
|
45060
|
+
return {
|
|
45061
|
+
range: scriptTarget.range,
|
|
45062
|
+
contents: symbol3 ? [
|
|
45063
|
+
`**Global Blackboard** \`@${scriptTarget.reference.key}\``,
|
|
45064
|
+
"",
|
|
45065
|
+
`Type: \`${formatScriptType3(symbol3.type)}\``,
|
|
45066
|
+
`Source: ${describeScriptSymbol2(symbol3)}`
|
|
45067
|
+
].join("\n") : `**Global Blackboard** \`@${scriptTarget.reference.key}\``
|
|
45068
|
+
};
|
|
45069
|
+
}
|
|
44296
45070
|
const symbol2 = scriptTarget.reference.symbol;
|
|
44297
45071
|
return {
|
|
44298
45072
|
range: scriptTarget.range,
|
|
@@ -44389,7 +45163,7 @@ Resolves to SubTree model in \`${target.model.uri || context.parsed?.uri || "wor
|
|
|
44389
45163
|
function toReferenceLocations(context, id) {
|
|
44390
45164
|
return getSubTreeReferences(context.semantic, id).filter((ref) => ref.parentBehaviorTreeId && ref.idRange).map((ref) => ({ uri: ref.uri, range: ref.idRange })).filter((location) => Boolean(location.range));
|
|
44391
45165
|
}
|
|
44392
|
-
function
|
|
45166
|
+
function uniqueLocations2(locations) {
|
|
44393
45167
|
const seen = /* @__PURE__ */ new Set();
|
|
44394
45168
|
const result = [];
|
|
44395
45169
|
for (const location of locations) {
|
|
@@ -44425,9 +45199,9 @@ function getReferences(context, input) {
|
|
|
44425
45199
|
const scriptTarget = getScriptIdentifierTarget(context, input.position);
|
|
44426
45200
|
if (scriptTarget) {
|
|
44427
45201
|
return {
|
|
44428
|
-
locations:
|
|
45202
|
+
locations: uniqueLocations2(
|
|
44429
45203
|
getScriptReferencesForSymbol(context, scriptTarget).map((occurrence) => ({
|
|
44430
|
-
uri:
|
|
45204
|
+
uri: occurrence.uri,
|
|
44431
45205
|
range: occurrence.documentRange
|
|
44432
45206
|
}))
|
|
44433
45207
|
)
|
|
@@ -44440,6 +45214,32 @@ function getReferences(context, input) {
|
|
|
44440
45214
|
}) : void 0;
|
|
44441
45215
|
const element = inspect && "element" in inspect ? inspect.element : void 0;
|
|
44442
45216
|
const attribute = inspect && "attribute" in inspect ? inspect.attribute : void 0;
|
|
45217
|
+
const binding = context.documentView && context.parsed ? context.documentView.nodes.flatMap((node) => node.portBindings).find(
|
|
45218
|
+
(candidate) => candidate.attribute === attribute && input.position.offset >= (candidate.attribute.valueContentRange ?? candidate.attribute.valueRange).start.offset && input.position.offset <= (candidate.attribute.valueContentRange ?? candidate.attribute.valueRange).end.offset
|
|
45219
|
+
) : void 0;
|
|
45220
|
+
const blackboardReference = binding?.blackboardReferences.find(
|
|
45221
|
+
(reference) => input.position.offset >= reference.range.start.offset && input.position.offset <= reference.range.end.offset
|
|
45222
|
+
);
|
|
45223
|
+
if (blackboardReference) {
|
|
45224
|
+
const identity = makeBlackboardIdentity({
|
|
45225
|
+
scope: blackboardReference.scope,
|
|
45226
|
+
key: blackboardReference.key
|
|
45227
|
+
});
|
|
45228
|
+
return {
|
|
45229
|
+
locations: uniqueLocations2([
|
|
45230
|
+
...blackboardReference.scope === "global" ? getWorkspaceBlackboardLocations(
|
|
45231
|
+
context.documentView,
|
|
45232
|
+
context.workspace?.documents,
|
|
45233
|
+
context.semantic,
|
|
45234
|
+
context.config,
|
|
45235
|
+
context.nodeUsagePolicy,
|
|
45236
|
+
identity,
|
|
45237
|
+
context.document.uri
|
|
45238
|
+
) : getDocumentBlackboardLocations(context.documentView, identity, context.document.uri),
|
|
45239
|
+
...blackboardReference.scope === "global" ? getGlobalBlackboardScriptLocations(context, blackboardReference.key) : []
|
|
45240
|
+
])
|
|
45241
|
+
};
|
|
45242
|
+
}
|
|
44443
45243
|
if (element?.name === "BehaviorTree" && attribute?.name === "ID") {
|
|
44444
45244
|
return {
|
|
44445
45245
|
locations: toReferenceLocations(context, attribute.value)
|
|
@@ -44472,7 +45272,7 @@ function getReferences(context, input) {
|
|
|
44472
45272
|
const ids = getReferencedSubTreeIds(context, defs);
|
|
44473
45273
|
if (ids.length > 0) {
|
|
44474
45274
|
return {
|
|
44475
|
-
locations:
|
|
45275
|
+
locations: uniqueLocations2(ids.flatMap((id) => toReferenceLocations(context, id)))
|
|
44476
45276
|
};
|
|
44477
45277
|
}
|
|
44478
45278
|
return { locations: [] };
|
|
@@ -45081,8 +45881,8 @@ function createNodeWorkspaceHost(cwd = process.cwd()) {
|
|
|
45081
45881
|
try {
|
|
45082
45882
|
await import_promises.default.access(fileUriToPath3(uri), import_node_fs.constants.F_OK);
|
|
45083
45883
|
return true;
|
|
45084
|
-
} catch (
|
|
45085
|
-
if (
|
|
45884
|
+
} catch (error52) {
|
|
45885
|
+
if (error52.code !== "ENOENT") throw error52;
|
|
45086
45886
|
return false;
|
|
45087
45887
|
}
|
|
45088
45888
|
},
|
|
@@ -45213,8 +46013,8 @@ function createNodeWorkspaceService(options = {}) {
|
|
|
45213
46013
|
resolve(result) {
|
|
45214
46014
|
resolveReload?.(result);
|
|
45215
46015
|
},
|
|
45216
|
-
reject(
|
|
45217
|
-
rejectReload?.(
|
|
46016
|
+
reject(error52) {
|
|
46017
|
+
rejectReload?.(error52);
|
|
45218
46018
|
}
|
|
45219
46019
|
};
|
|
45220
46020
|
}
|
|
@@ -45223,8 +46023,8 @@ function createNodeWorkspaceService(options = {}) {
|
|
|
45223
46023
|
const scheduled = pendingReload;
|
|
45224
46024
|
void load(lastLoadOptions).then((result) => {
|
|
45225
46025
|
scheduled?.resolve(result);
|
|
45226
|
-
}).catch((
|
|
45227
|
-
scheduled?.reject(
|
|
46026
|
+
}).catch((error52) => {
|
|
46027
|
+
scheduled?.reject(error52);
|
|
45228
46028
|
}).finally(() => {
|
|
45229
46029
|
if (pendingReload === scheduled) pendingReload = void 0;
|
|
45230
46030
|
});
|
|
@@ -45724,6 +46524,7 @@ function handleGetChildCapability(workspace, params) {
|
|
|
45724
46524
|
}
|
|
45725
46525
|
|
|
45726
46526
|
// src/server.ts
|
|
46527
|
+
var SERVER_VERSION = true ? "0.1.2" : "unknown";
|
|
45727
46528
|
var connection = (0, import_node4.createConnection)(import_node4.ProposedFeatures.all);
|
|
45728
46529
|
var documents = new import_node4.TextDocuments(TextDocument);
|
|
45729
46530
|
var openUris = /* @__PURE__ */ new Set();
|
|
@@ -46091,7 +46892,7 @@ connection.onInitialize((params) => {
|
|
|
46091
46892
|
return {
|
|
46092
46893
|
serverInfo: {
|
|
46093
46894
|
name: "btxml",
|
|
46094
|
-
version:
|
|
46895
|
+
version: SERVER_VERSION
|
|
46095
46896
|
},
|
|
46096
46897
|
capabilities: {
|
|
46097
46898
|
textDocumentSync: import_node4.TextDocumentSyncKind.Incremental,
|
|
@@ -46250,8 +47051,8 @@ async function startLanguageServer() {
|
|
|
46250
47051
|
}
|
|
46251
47052
|
|
|
46252
47053
|
// src/main.ts
|
|
46253
|
-
startLanguageServer().catch((
|
|
46254
|
-
process.stderr.write(`${String(
|
|
47054
|
+
startLanguageServer().catch((error52) => {
|
|
47055
|
+
process.stderr.write(`${String(error52)}
|
|
46255
47056
|
`);
|
|
46256
47057
|
process.exitCode = 1;
|
|
46257
47058
|
});
|