strikethroo 3.13.0 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-web/assets/{arc-BgbdqiWZ.js → arc-CPV8jHYe.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-C11ra1og.js → architectureDiagram-3BPJPVTR-BpIpszyN.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-sneTcKTc.js → blockDiagram-GPEHLZMM-BAgDI2Zm.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-rcZrBkXz.js → c4Diagram-AAUBKEIU-BET4EERh.js} +1 -1
- package/dist-web/assets/channel-DwRnCewT.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-BMATkNbT.js → chunk-2J33WTMH-D8jpG3a4.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-BSz2O6Ft.js → chunk-4BX2VUAB-yG4p6PAE.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-MumFzZkZ.js → chunk-55IACEB6-a851Jl__.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-4dQkVcIM.js → chunk-727SXJPM-B7wgoSFn.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-v5TVK_fa.js → chunk-AQP2D5EJ-CxqjOVSX.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-BArw-yD6.js → chunk-FMBD7UC4-B0h5Gdww.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-jmMu7-6G.js → chunk-ND2GUHAM-C3NAorDT.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-CoFZRE9S.js → chunk-QZHKN3VN-BLaRElsr.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-B5U8rxJL.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-B5U8rxJL.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-DfE6Yc6V.js → cose-bilkent-S5V4N54A-Clj5Olnn.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-GLQxrEea.js → dagre-BM42HDAG-BeaPLjrR.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-CPF-j3jI.js → diagram-2AECGRRQ-MkufFUw8.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-DX8N0bhf.js → diagram-5GNKFQAL-8uP5bqOE.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-D4wM_Xrg.js → diagram-KO2AKTUF-BrMJQxXr.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-uVt4DExc.js → diagram-LMA3HP47-D9uJotCC.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-DzfLImY-.js → diagram-OG6HWLK6-Dv1U4e1U.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-BDOB8bJk.js → erDiagram-TEJ5UH35-BmTkOMhL.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-DsofFC7H.js → flowDiagram-I6XJVG4X-CFZWfAEY.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-DYCTEBUe.js → ganttDiagram-6RSMTGT7-B1a5xyN2.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-B373xEyt.js → gitGraphDiagram-PVQCEYII-C9sfVrbr.js} +1 -1
- package/dist-web/assets/{index-BxjDhqax.js → index-BUHKa0dY.js} +1 -1
- package/dist-web/assets/{index-BrXKePvp.js → index-D5CSQXBf.js} +1 -1
- package/dist-web/assets/{index-CvZkEGgs.js → index-DG4Wpjjw.js} +7 -7
- package/dist-web/assets/{infoDiagram-5YYISTIA-BTdfbRG3.js → infoDiagram-5YYISTIA-Bv9vm2nI.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-By0jpBpG.js → ishikawaDiagram-YF4QCWOH-DAA36K2o.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-CN4ddpRF.js → journeyDiagram-JHISSGLW-Bu02Ja-A.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-CSzp97xY.js → kanban-definition-UN3LZRKU-CCcZ9N23.js} +1 -1
- package/dist-web/assets/{linear-Bo45a3LX.js → linear-BrNOlUnw.js} +1 -1
- package/dist-web/assets/{mermaid.core-fEMv_ThD.js → mermaid.core-nDPdnkcp.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-lcelYnaU.js → mindmap-definition-RKZ34NQL-BFnEp1hz.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-DqrHeOSK.js → pieDiagram-4H26LBE5-BWKjatdb.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-lKQsolLl.js → quadrantDiagram-W4KKPZXB-CfFnxMK9.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-D3GerVWN.js → requirementDiagram-4Y6WPE33-C5pi1ZTH.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-Dn0Rn4jy.js → sankeyDiagram-5OEKKPKP-C5I5UenM.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-BMZb9HkP.js → sequenceDiagram-3UESZ5HK-BuspSeLK.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-mHX_sHdp.js → stateDiagram-AJRCARHV-BTQ5I5FJ.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-DJKGQKe2.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-CrVF3pNw.js → timeline-definition-PNZ67QCA-Bhj5NY9p.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-Dfw6e8s7.js → vennDiagram-CIIHVFJN-BAejy7W2.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-HlLGXiR6.js → wardley-L42UT6IY-Cc1J-r4w.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-DPL-Ch-8.js → wardleyDiagram-YWT4CUSO-BkDwQFzz.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-Cd6IimVj.js → xychartDiagram-2RQKCTM6-CWVievgi.js} +1 -1
- package/dist-web/index.html +1 -1
- package/package.json +1 -1
- package/templates/harness/skills/st-create-plan/SKILL.md +1 -1
- package/templates/harness/skills/st-execute-blueprint/SKILL.md +7 -1
- package/templates/harness/skills/st-execute-blueprint/scripts/dispatch-task-execution.cjs +3017 -299
- package/templates/harness/skills/st-execute-task/SKILL.md +11 -2
- package/templates/harness/skills/st-execute-task/scripts/dispatch-task-execution.cjs +3017 -299
- package/templates/harness/skills/st-full-workflow/SKILL.md +50 -45
- package/templates/harness/skills/st-full-workflow/scripts/dispatch-task-execution.cjs +3017 -299
- package/templates/harness/skills/st-full-workflow/scripts/route-task-execution.cjs +87 -3895
- package/templates/harness/skills/st-generate-tasks/SKILL.md +13 -14
- package/templates/harness/skills/st-generate-tasks/scripts/route-task-execution.cjs +87 -3895
- package/templates/strikethroo/config/config.yaml +9 -7
- package/templates/strikethroo/config/hooks/TASK_EXECUTION_ROUTING.md +4 -3
- package/templates/strikethroo/config/templates/TASK_TEMPLATE.md +2 -6
- package/templates/strikethroo/runtime/.gitignore +2 -0
- package/dist-web/assets/channel-DhL4ovjN.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DNoS6CPC.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DNoS6CPC.js +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BwuUXdDR.js +0 -1
|
@@ -9,6 +9,10 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
9
9
|
var __commonJS = (cb, mod) => function __require() {
|
|
10
10
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
11
|
};
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
12
16
|
var __copyProps = (to, from, except, desc) => {
|
|
13
17
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
18
|
for (let key of __getOwnPropNames(from))
|
|
@@ -25,6 +29,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
29
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
30
|
mod
|
|
27
31
|
));
|
|
32
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
33
|
|
|
29
34
|
// node_modules/kind-of/index.js
|
|
30
35
|
var require_kind_of = __commonJS({
|
|
@@ -177,12 +182,12 @@ var require_extend_shallow = __commonJS({
|
|
|
177
182
|
};
|
|
178
183
|
function assign(a, b) {
|
|
179
184
|
for (var key in b) {
|
|
180
|
-
if (
|
|
185
|
+
if (hasOwn(b, key)) {
|
|
181
186
|
a[key] = b[key];
|
|
182
187
|
}
|
|
183
188
|
}
|
|
184
189
|
}
|
|
185
|
-
function
|
|
190
|
+
function hasOwn(obj, key) {
|
|
186
191
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
187
192
|
}
|
|
188
193
|
}
|
|
@@ -344,7 +349,7 @@ var require_common = __commonJS({
|
|
|
344
349
|
var require_exception = __commonJS({
|
|
345
350
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/exception.js"(exports2, module2) {
|
|
346
351
|
"use strict";
|
|
347
|
-
function
|
|
352
|
+
function YAMLException2(reason, mark) {
|
|
348
353
|
Error.call(this);
|
|
349
354
|
this.name = "YAMLException";
|
|
350
355
|
this.reason = reason;
|
|
@@ -356,9 +361,9 @@ var require_exception = __commonJS({
|
|
|
356
361
|
this.stack = new Error().stack || "";
|
|
357
362
|
}
|
|
358
363
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
364
|
+
YAMLException2.prototype = Object.create(Error.prototype);
|
|
365
|
+
YAMLException2.prototype.constructor = YAMLException2;
|
|
366
|
+
YAMLException2.prototype.toString = function toString(compact) {
|
|
362
367
|
var result = this.name + ": ";
|
|
363
368
|
result += this.reason || "(unknown reason)";
|
|
364
369
|
if (!compact && this.mark) {
|
|
@@ -366,7 +371,7 @@ var require_exception = __commonJS({
|
|
|
366
371
|
}
|
|
367
372
|
return result;
|
|
368
373
|
};
|
|
369
|
-
module2.exports =
|
|
374
|
+
module2.exports = YAMLException2;
|
|
370
375
|
}
|
|
371
376
|
});
|
|
372
377
|
|
|
@@ -432,7 +437,7 @@ var require_mark = __commonJS({
|
|
|
432
437
|
var require_type = __commonJS({
|
|
433
438
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type.js"(exports2, module2) {
|
|
434
439
|
"use strict";
|
|
435
|
-
var
|
|
440
|
+
var YAMLException2 = require_exception();
|
|
436
441
|
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
437
442
|
"kind",
|
|
438
443
|
"resolve",
|
|
@@ -463,7 +468,7 @@ var require_type = __commonJS({
|
|
|
463
468
|
options2 = options2 || {};
|
|
464
469
|
Object.keys(options2).forEach(function(name) {
|
|
465
470
|
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
|
466
|
-
throw new
|
|
471
|
+
throw new YAMLException2('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
467
472
|
}
|
|
468
473
|
});
|
|
469
474
|
this.tag = tag;
|
|
@@ -480,7 +485,7 @@ var require_type = __commonJS({
|
|
|
480
485
|
this.defaultStyle = options2["defaultStyle"] || null;
|
|
481
486
|
this.styleAliases = compileStyleAliases(options2["styleAliases"] || null);
|
|
482
487
|
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
|
483
|
-
throw new
|
|
488
|
+
throw new YAMLException2('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
484
489
|
}
|
|
485
490
|
}
|
|
486
491
|
module2.exports = Type;
|
|
@@ -492,7 +497,7 @@ var require_schema = __commonJS({
|
|
|
492
497
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema.js"(exports2, module2) {
|
|
493
498
|
"use strict";
|
|
494
499
|
var common = require_common();
|
|
495
|
-
var
|
|
500
|
+
var YAMLException2 = require_exception();
|
|
496
501
|
var Type = require_type();
|
|
497
502
|
function compileList(schema, name, result) {
|
|
498
503
|
var exclude = [];
|
|
@@ -526,25 +531,25 @@ var require_schema = __commonJS({
|
|
|
526
531
|
}
|
|
527
532
|
return result;
|
|
528
533
|
}
|
|
529
|
-
function
|
|
534
|
+
function Schema3(definition) {
|
|
530
535
|
this.include = definition.include || [];
|
|
531
536
|
this.implicit = definition.implicit || [];
|
|
532
537
|
this.explicit = definition.explicit || [];
|
|
533
538
|
this.implicit.forEach(function(type) {
|
|
534
539
|
if (type.loadKind && type.loadKind !== "scalar") {
|
|
535
|
-
throw new
|
|
540
|
+
throw new YAMLException2("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
536
541
|
}
|
|
537
542
|
});
|
|
538
543
|
this.compiledImplicit = compileList(this, "implicit", []);
|
|
539
544
|
this.compiledExplicit = compileList(this, "explicit", []);
|
|
540
545
|
this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
|
|
541
546
|
}
|
|
542
|
-
|
|
543
|
-
|
|
547
|
+
Schema3.DEFAULT = null;
|
|
548
|
+
Schema3.create = function createSchema() {
|
|
544
549
|
var schemas, types;
|
|
545
550
|
switch (arguments.length) {
|
|
546
551
|
case 1:
|
|
547
|
-
schemas =
|
|
552
|
+
schemas = Schema3.DEFAULT;
|
|
548
553
|
types = arguments[0];
|
|
549
554
|
break;
|
|
550
555
|
case 2:
|
|
@@ -552,26 +557,26 @@ var require_schema = __commonJS({
|
|
|
552
557
|
types = arguments[1];
|
|
553
558
|
break;
|
|
554
559
|
default:
|
|
555
|
-
throw new
|
|
560
|
+
throw new YAMLException2("Wrong number of arguments for Schema.create function");
|
|
556
561
|
}
|
|
557
562
|
schemas = common.toArray(schemas);
|
|
558
563
|
types = common.toArray(types);
|
|
559
564
|
if (!schemas.every(function(schema) {
|
|
560
|
-
return schema instanceof
|
|
565
|
+
return schema instanceof Schema3;
|
|
561
566
|
})) {
|
|
562
|
-
throw new
|
|
567
|
+
throw new YAMLException2("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
|
|
563
568
|
}
|
|
564
569
|
if (!types.every(function(type) {
|
|
565
570
|
return type instanceof Type;
|
|
566
571
|
})) {
|
|
567
|
-
throw new
|
|
572
|
+
throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
568
573
|
}
|
|
569
|
-
return new
|
|
574
|
+
return new Schema3({
|
|
570
575
|
include: schemas,
|
|
571
576
|
explicit: types
|
|
572
577
|
});
|
|
573
578
|
};
|
|
574
|
-
module2.exports =
|
|
579
|
+
module2.exports = Schema3;
|
|
575
580
|
}
|
|
576
581
|
});
|
|
577
582
|
|
|
@@ -621,8 +626,8 @@ var require_map = __commonJS({
|
|
|
621
626
|
var require_failsafe = __commonJS({
|
|
622
627
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js"(exports2, module2) {
|
|
623
628
|
"use strict";
|
|
624
|
-
var
|
|
625
|
-
module2.exports = new
|
|
629
|
+
var Schema3 = require_schema();
|
|
630
|
+
module2.exports = new Schema3({
|
|
626
631
|
explicit: [
|
|
627
632
|
require_str(),
|
|
628
633
|
require_seq(),
|
|
@@ -724,7 +729,7 @@ var require_int = __commonJS({
|
|
|
724
729
|
function isDecCode(c) {
|
|
725
730
|
return 48 <= c && c <= 57;
|
|
726
731
|
}
|
|
727
|
-
function
|
|
732
|
+
function resolveYamlInteger2(data) {
|
|
728
733
|
if (data === null) return false;
|
|
729
734
|
var max = data.length, index = 0, hasDigits = false, ch;
|
|
730
735
|
if (!max) return false;
|
|
@@ -813,7 +818,7 @@ var require_int = __commonJS({
|
|
|
813
818
|
}
|
|
814
819
|
module2.exports = new Type("tag:yaml.org,2002:int", {
|
|
815
820
|
kind: "scalar",
|
|
816
|
-
resolve:
|
|
821
|
+
resolve: resolveYamlInteger2,
|
|
817
822
|
construct: constructYamlInteger,
|
|
818
823
|
predicate: isInteger,
|
|
819
824
|
represent: {
|
|
@@ -848,13 +853,13 @@ var require_float = __commonJS({
|
|
|
848
853
|
"use strict";
|
|
849
854
|
var common = require_common();
|
|
850
855
|
var Type = require_type();
|
|
851
|
-
var
|
|
856
|
+
var YAML_FLOAT_PATTERN2 = new RegExp(
|
|
852
857
|
// 2.5e4, 2.5 and integers
|
|
853
858
|
"^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
|
854
859
|
);
|
|
855
|
-
function
|
|
860
|
+
function resolveYamlFloat2(data) {
|
|
856
861
|
if (data === null) return false;
|
|
857
|
-
if (!
|
|
862
|
+
if (!YAML_FLOAT_PATTERN2.test(data) || // Quick hack to not allow integers end with `_`
|
|
858
863
|
// Probably should update regexp & check speed
|
|
859
864
|
data[data.length - 1] === "_") {
|
|
860
865
|
return false;
|
|
@@ -888,7 +893,7 @@ var require_float = __commonJS({
|
|
|
888
893
|
return sign * parseFloat(value, 10);
|
|
889
894
|
}
|
|
890
895
|
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
891
|
-
function
|
|
896
|
+
function representYamlFloat2(object, style) {
|
|
892
897
|
var res;
|
|
893
898
|
if (isNaN(object)) {
|
|
894
899
|
switch (style) {
|
|
@@ -928,10 +933,10 @@ var require_float = __commonJS({
|
|
|
928
933
|
}
|
|
929
934
|
module2.exports = new Type("tag:yaml.org,2002:float", {
|
|
930
935
|
kind: "scalar",
|
|
931
|
-
resolve:
|
|
936
|
+
resolve: resolveYamlFloat2,
|
|
932
937
|
construct: constructYamlFloat,
|
|
933
938
|
predicate: isFloat,
|
|
934
|
-
represent:
|
|
939
|
+
represent: representYamlFloat2,
|
|
935
940
|
defaultStyle: "lowercase"
|
|
936
941
|
});
|
|
937
942
|
}
|
|
@@ -941,8 +946,8 @@ var require_float = __commonJS({
|
|
|
941
946
|
var require_json = __commonJS({
|
|
942
947
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/json.js"(exports2, module2) {
|
|
943
948
|
"use strict";
|
|
944
|
-
var
|
|
945
|
-
module2.exports = new
|
|
949
|
+
var Schema3 = require_schema();
|
|
950
|
+
module2.exports = new Schema3({
|
|
946
951
|
include: [
|
|
947
952
|
require_failsafe()
|
|
948
953
|
],
|
|
@@ -960,8 +965,8 @@ var require_json = __commonJS({
|
|
|
960
965
|
var require_core = __commonJS({
|
|
961
966
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/core.js"(exports2, module2) {
|
|
962
967
|
"use strict";
|
|
963
|
-
var
|
|
964
|
-
module2.exports = new
|
|
968
|
+
var Schema3 = require_schema();
|
|
969
|
+
module2.exports = new Schema3({
|
|
965
970
|
include: [
|
|
966
971
|
require_json()
|
|
967
972
|
]
|
|
@@ -974,22 +979,22 @@ var require_timestamp = __commonJS({
|
|
|
974
979
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/timestamp.js"(exports2, module2) {
|
|
975
980
|
"use strict";
|
|
976
981
|
var Type = require_type();
|
|
977
|
-
var
|
|
982
|
+
var YAML_DATE_REGEXP2 = new RegExp(
|
|
978
983
|
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
979
984
|
);
|
|
980
|
-
var
|
|
985
|
+
var YAML_TIMESTAMP_REGEXP2 = new RegExp(
|
|
981
986
|
"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
|
|
982
987
|
);
|
|
983
|
-
function
|
|
988
|
+
function resolveYamlTimestamp2(data) {
|
|
984
989
|
if (data === null) return false;
|
|
985
|
-
if (
|
|
986
|
-
if (
|
|
990
|
+
if (YAML_DATE_REGEXP2.exec(data) !== null) return true;
|
|
991
|
+
if (YAML_TIMESTAMP_REGEXP2.exec(data) !== null) return true;
|
|
987
992
|
return false;
|
|
988
993
|
}
|
|
989
994
|
function constructYamlTimestamp(data) {
|
|
990
995
|
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
991
|
-
match =
|
|
992
|
-
if (match === null) match =
|
|
996
|
+
match = YAML_DATE_REGEXP2.exec(data);
|
|
997
|
+
if (match === null) match = YAML_TIMESTAMP_REGEXP2.exec(data);
|
|
993
998
|
if (match === null) throw new Error("Date resolve error");
|
|
994
999
|
year = +match[1];
|
|
995
1000
|
month = +match[2] - 1;
|
|
@@ -1022,7 +1027,7 @@ var require_timestamp = __commonJS({
|
|
|
1022
1027
|
}
|
|
1023
1028
|
module2.exports = new Type("tag:yaml.org,2002:timestamp", {
|
|
1024
1029
|
kind: "scalar",
|
|
1025
|
-
resolve:
|
|
1030
|
+
resolve: resolveYamlTimestamp2,
|
|
1026
1031
|
construct: constructYamlTimestamp,
|
|
1027
1032
|
instanceOf: Date,
|
|
1028
1033
|
represent: representYamlTimestamp
|
|
@@ -1058,7 +1063,7 @@ var require_binary = __commonJS({
|
|
|
1058
1063
|
var _require;
|
|
1059
1064
|
var Type = require_type();
|
|
1060
1065
|
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
1061
|
-
function
|
|
1066
|
+
function resolveYamlBinary2(data) {
|
|
1062
1067
|
if (data === null) return false;
|
|
1063
1068
|
var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
|
|
1064
1069
|
for (idx = 0; idx < max; idx++) {
|
|
@@ -1095,7 +1100,7 @@ var require_binary = __commonJS({
|
|
|
1095
1100
|
}
|
|
1096
1101
|
return result;
|
|
1097
1102
|
}
|
|
1098
|
-
function
|
|
1103
|
+
function representYamlBinary2(object) {
|
|
1099
1104
|
var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
|
|
1100
1105
|
for (idx = 0; idx < max; idx++) {
|
|
1101
1106
|
if (idx % 3 === 0 && idx) {
|
|
@@ -1130,10 +1135,10 @@ var require_binary = __commonJS({
|
|
|
1130
1135
|
}
|
|
1131
1136
|
module2.exports = new Type("tag:yaml.org,2002:binary", {
|
|
1132
1137
|
kind: "scalar",
|
|
1133
|
-
resolve:
|
|
1138
|
+
resolve: resolveYamlBinary2,
|
|
1134
1139
|
construct: constructYamlBinary,
|
|
1135
1140
|
predicate: isBinary,
|
|
1136
|
-
represent:
|
|
1141
|
+
represent: representYamlBinary2
|
|
1137
1142
|
});
|
|
1138
1143
|
}
|
|
1139
1144
|
});
|
|
@@ -1244,8 +1249,8 @@ var require_set = __commonJS({
|
|
|
1244
1249
|
var require_default_safe = __commonJS({
|
|
1245
1250
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js"(exports2, module2) {
|
|
1246
1251
|
"use strict";
|
|
1247
|
-
var
|
|
1248
|
-
module2.exports = new
|
|
1252
|
+
var Schema3 = require_schema();
|
|
1253
|
+
module2.exports = new Schema3({
|
|
1249
1254
|
include: [
|
|
1250
1255
|
require_core()
|
|
1251
1256
|
],
|
|
@@ -1393,8 +1398,8 @@ var require_function = __commonJS({
|
|
|
1393
1398
|
var require_default_full = __commonJS({
|
|
1394
1399
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/default_full.js"(exports2, module2) {
|
|
1395
1400
|
"use strict";
|
|
1396
|
-
var
|
|
1397
|
-
module2.exports =
|
|
1401
|
+
var Schema3 = require_schema();
|
|
1402
|
+
module2.exports = Schema3.DEFAULT = new Schema3({
|
|
1398
1403
|
include: [
|
|
1399
1404
|
require_default_safe()
|
|
1400
1405
|
],
|
|
@@ -1412,23 +1417,23 @@ var require_loader = __commonJS({
|
|
|
1412
1417
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/loader.js"(exports2, module2) {
|
|
1413
1418
|
"use strict";
|
|
1414
1419
|
var common = require_common();
|
|
1415
|
-
var
|
|
1420
|
+
var YAMLException2 = require_exception();
|
|
1416
1421
|
var Mark = require_mark();
|
|
1417
1422
|
var DEFAULT_SAFE_SCHEMA = require_default_safe();
|
|
1418
1423
|
var DEFAULT_FULL_SCHEMA = require_default_full();
|
|
1419
1424
|
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1420
|
-
var
|
|
1421
|
-
var
|
|
1422
|
-
var
|
|
1423
|
-
var
|
|
1425
|
+
var CONTEXT_FLOW_IN2 = 1;
|
|
1426
|
+
var CONTEXT_FLOW_OUT2 = 2;
|
|
1427
|
+
var CONTEXT_BLOCK_IN2 = 3;
|
|
1428
|
+
var CONTEXT_BLOCK_OUT2 = 4;
|
|
1424
1429
|
var CHOMPING_CLIP = 1;
|
|
1425
1430
|
var CHOMPING_STRIP = 2;
|
|
1426
1431
|
var CHOMPING_KEEP = 3;
|
|
1427
|
-
var
|
|
1432
|
+
var PATTERN_NON_PRINTABLE2 = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
1428
1433
|
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
1429
|
-
var
|
|
1430
|
-
var
|
|
1431
|
-
var
|
|
1434
|
+
var PATTERN_FLOW_INDICATORS2 = /[,\[\]\{\}]/;
|
|
1435
|
+
var PATTERN_TAG_HANDLE2 = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
1436
|
+
var PATTERN_TAG_URI2 = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
1432
1437
|
function _class(obj) {
|
|
1433
1438
|
return Object.prototype.toString.call(obj);
|
|
1434
1439
|
}
|
|
@@ -1444,7 +1449,7 @@ var require_loader = __commonJS({
|
|
|
1444
1449
|
function is_FLOW_INDICATOR(c) {
|
|
1445
1450
|
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
1446
1451
|
}
|
|
1447
|
-
function
|
|
1452
|
+
function fromHexCode2(c) {
|
|
1448
1453
|
var lc;
|
|
1449
1454
|
if (48 <= c && c <= 57) {
|
|
1450
1455
|
return c - 48;
|
|
@@ -1455,7 +1460,7 @@ var require_loader = __commonJS({
|
|
|
1455
1460
|
}
|
|
1456
1461
|
return -1;
|
|
1457
1462
|
}
|
|
1458
|
-
function
|
|
1463
|
+
function escapedHexLen2(c) {
|
|
1459
1464
|
if (c === 120) {
|
|
1460
1465
|
return 2;
|
|
1461
1466
|
}
|
|
@@ -1467,16 +1472,16 @@ var require_loader = __commonJS({
|
|
|
1467
1472
|
}
|
|
1468
1473
|
return 0;
|
|
1469
1474
|
}
|
|
1470
|
-
function
|
|
1475
|
+
function fromDecimalCode2(c) {
|
|
1471
1476
|
if (48 <= c && c <= 57) {
|
|
1472
1477
|
return c - 48;
|
|
1473
1478
|
}
|
|
1474
1479
|
return -1;
|
|
1475
1480
|
}
|
|
1476
|
-
function
|
|
1481
|
+
function simpleEscapeSequence2(c) {
|
|
1477
1482
|
return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
|
|
1478
1483
|
}
|
|
1479
|
-
function
|
|
1484
|
+
function charFromCodepoint2(c) {
|
|
1480
1485
|
if (c <= 65535) {
|
|
1481
1486
|
return String.fromCharCode(c);
|
|
1482
1487
|
}
|
|
@@ -1497,11 +1502,11 @@ var require_loader = __commonJS({
|
|
|
1497
1502
|
object[key] = value;
|
|
1498
1503
|
}
|
|
1499
1504
|
}
|
|
1500
|
-
var
|
|
1501
|
-
var
|
|
1505
|
+
var simpleEscapeCheck2 = new Array(256);
|
|
1506
|
+
var simpleEscapeMap2 = new Array(256);
|
|
1502
1507
|
for (i = 0; i < 256; i++) {
|
|
1503
|
-
|
|
1504
|
-
|
|
1508
|
+
simpleEscapeCheck2[i] = simpleEscapeSequence2(i) ? 1 : 0;
|
|
1509
|
+
simpleEscapeMap2[i] = simpleEscapeSequence2(i);
|
|
1505
1510
|
}
|
|
1506
1511
|
var i;
|
|
1507
1512
|
function State(input, options2) {
|
|
@@ -1524,12 +1529,12 @@ var require_loader = __commonJS({
|
|
|
1524
1529
|
this.documents = [];
|
|
1525
1530
|
}
|
|
1526
1531
|
function generateError(state, message) {
|
|
1527
|
-
return new
|
|
1532
|
+
return new YAMLException2(
|
|
1528
1533
|
message,
|
|
1529
1534
|
new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart)
|
|
1530
1535
|
);
|
|
1531
1536
|
}
|
|
1532
|
-
function
|
|
1537
|
+
function throwError2(state, message) {
|
|
1533
1538
|
throw generateError(state, message);
|
|
1534
1539
|
}
|
|
1535
1540
|
function throwWarning(state, message) {
|
|
@@ -1541,19 +1546,19 @@ var require_loader = __commonJS({
|
|
|
1541
1546
|
YAML: function handleYamlDirective(state, name, args) {
|
|
1542
1547
|
var match, major, minor;
|
|
1543
1548
|
if (state.version !== null) {
|
|
1544
|
-
|
|
1549
|
+
throwError2(state, "duplication of %YAML directive");
|
|
1545
1550
|
}
|
|
1546
1551
|
if (args.length !== 1) {
|
|
1547
|
-
|
|
1552
|
+
throwError2(state, "YAML directive accepts exactly one argument");
|
|
1548
1553
|
}
|
|
1549
1554
|
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
1550
1555
|
if (match === null) {
|
|
1551
|
-
|
|
1556
|
+
throwError2(state, "ill-formed argument of the YAML directive");
|
|
1552
1557
|
}
|
|
1553
1558
|
major = parseInt(match[1], 10);
|
|
1554
1559
|
minor = parseInt(match[2], 10);
|
|
1555
1560
|
if (major !== 1) {
|
|
1556
|
-
|
|
1561
|
+
throwError2(state, "unacceptable YAML version of the document");
|
|
1557
1562
|
}
|
|
1558
1563
|
state.version = args[0];
|
|
1559
1564
|
state.checkLineBreaks = minor < 2;
|
|
@@ -1564,18 +1569,18 @@ var require_loader = __commonJS({
|
|
|
1564
1569
|
TAG: function handleTagDirective(state, name, args) {
|
|
1565
1570
|
var handle, prefix;
|
|
1566
1571
|
if (args.length !== 2) {
|
|
1567
|
-
|
|
1572
|
+
throwError2(state, "TAG directive accepts exactly two arguments");
|
|
1568
1573
|
}
|
|
1569
1574
|
handle = args[0];
|
|
1570
1575
|
prefix = args[1];
|
|
1571
|
-
if (!
|
|
1572
|
-
|
|
1576
|
+
if (!PATTERN_TAG_HANDLE2.test(handle)) {
|
|
1577
|
+
throwError2(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
1573
1578
|
}
|
|
1574
1579
|
if (_hasOwnProperty.call(state.tagMap, handle)) {
|
|
1575
|
-
|
|
1580
|
+
throwError2(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
1576
1581
|
}
|
|
1577
|
-
if (!
|
|
1578
|
-
|
|
1582
|
+
if (!PATTERN_TAG_URI2.test(prefix)) {
|
|
1583
|
+
throwError2(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
1579
1584
|
}
|
|
1580
1585
|
state.tagMap[handle] = prefix;
|
|
1581
1586
|
}
|
|
@@ -1588,11 +1593,11 @@ var require_loader = __commonJS({
|
|
|
1588
1593
|
for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
|
1589
1594
|
_character = _result.charCodeAt(_position);
|
|
1590
1595
|
if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
|
|
1591
|
-
|
|
1596
|
+
throwError2(state, "expected valid JSON character");
|
|
1592
1597
|
}
|
|
1593
1598
|
}
|
|
1594
|
-
} else if (
|
|
1595
|
-
|
|
1599
|
+
} else if (PATTERN_NON_PRINTABLE2.test(_result)) {
|
|
1600
|
+
throwError2(state, "the stream contains non-printable characters");
|
|
1596
1601
|
}
|
|
1597
1602
|
state.result += _result;
|
|
1598
1603
|
}
|
|
@@ -1600,13 +1605,13 @@ var require_loader = __commonJS({
|
|
|
1600
1605
|
function mergeMappings(state, destination, source, overridableKeys) {
|
|
1601
1606
|
var sourceKeys, key, index, quantity;
|
|
1602
1607
|
if (!common.isObject(source)) {
|
|
1603
|
-
|
|
1608
|
+
throwError2(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
1604
1609
|
}
|
|
1605
1610
|
sourceKeys = Object.keys(source);
|
|
1606
1611
|
for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
1607
1612
|
key = sourceKeys[index];
|
|
1608
1613
|
if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
|
|
1609
|
-
|
|
1614
|
+
throwError2(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
|
|
1610
1615
|
}
|
|
1611
1616
|
if (!_hasOwnProperty.call(destination, key)) {
|
|
1612
1617
|
setProperty(destination, key, source[key]);
|
|
@@ -1620,7 +1625,7 @@ var require_loader = __commonJS({
|
|
|
1620
1625
|
keyNode = Array.prototype.slice.call(keyNode);
|
|
1621
1626
|
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
|
1622
1627
|
if (Array.isArray(keyNode[index])) {
|
|
1623
|
-
|
|
1628
|
+
throwError2(state, "nested arrays are not supported inside keys");
|
|
1624
1629
|
}
|
|
1625
1630
|
if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
|
|
1626
1631
|
keyNode[index] = "[object Object]";
|
|
@@ -1646,7 +1651,7 @@ var require_loader = __commonJS({
|
|
|
1646
1651
|
if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
|
|
1647
1652
|
state.line = startLine || state.line;
|
|
1648
1653
|
state.position = startPos || state.position;
|
|
1649
|
-
|
|
1654
|
+
throwError2(state, "duplicated mapping key");
|
|
1650
1655
|
}
|
|
1651
1656
|
setProperty(_result, keyNode, valueNode);
|
|
1652
1657
|
delete overridableKeys[keyNode];
|
|
@@ -1664,12 +1669,12 @@ var require_loader = __commonJS({
|
|
|
1664
1669
|
state.position++;
|
|
1665
1670
|
}
|
|
1666
1671
|
} else {
|
|
1667
|
-
|
|
1672
|
+
throwError2(state, "a line break is expected");
|
|
1668
1673
|
}
|
|
1669
1674
|
state.line += 1;
|
|
1670
1675
|
state.lineStart = state.position;
|
|
1671
1676
|
}
|
|
1672
|
-
function
|
|
1677
|
+
function skipSeparationSpace2(state, allowComments, checkIndent) {
|
|
1673
1678
|
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
|
|
1674
1679
|
while (ch !== 0) {
|
|
1675
1680
|
while (is_WHITE_SPACE(ch)) {
|
|
@@ -1698,7 +1703,7 @@ var require_loader = __commonJS({
|
|
|
1698
1703
|
}
|
|
1699
1704
|
return lineBreaks;
|
|
1700
1705
|
}
|
|
1701
|
-
function
|
|
1706
|
+
function testDocumentSeparator2(state) {
|
|
1702
1707
|
var _position = state.position, ch;
|
|
1703
1708
|
ch = state.input.charCodeAt(_position);
|
|
1704
1709
|
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
@@ -1717,7 +1722,7 @@ var require_loader = __commonJS({
|
|
|
1717
1722
|
state.result += common.repeat("\n", count - 1);
|
|
1718
1723
|
}
|
|
1719
1724
|
}
|
|
1720
|
-
function
|
|
1725
|
+
function readPlainScalar2(state, nodeIndent, withinFlowCollection) {
|
|
1721
1726
|
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
1722
1727
|
ch = state.input.charCodeAt(state.position);
|
|
1723
1728
|
if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
|
|
@@ -1744,13 +1749,13 @@ var require_loader = __commonJS({
|
|
|
1744
1749
|
if (is_WS_OR_EOL(preceding)) {
|
|
1745
1750
|
break;
|
|
1746
1751
|
}
|
|
1747
|
-
} else if (state.position === state.lineStart &&
|
|
1752
|
+
} else if (state.position === state.lineStart && testDocumentSeparator2(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
|
1748
1753
|
break;
|
|
1749
1754
|
} else if (is_EOL(ch)) {
|
|
1750
1755
|
_line = state.line;
|
|
1751
1756
|
_lineStart = state.lineStart;
|
|
1752
1757
|
_lineIndent = state.lineIndent;
|
|
1753
|
-
|
|
1758
|
+
skipSeparationSpace2(state, false, -1);
|
|
1754
1759
|
if (state.lineIndent >= nodeIndent) {
|
|
1755
1760
|
hasPendingContent = true;
|
|
1756
1761
|
ch = state.input.charCodeAt(state.position);
|
|
@@ -1782,7 +1787,7 @@ var require_loader = __commonJS({
|
|
|
1782
1787
|
state.result = _result;
|
|
1783
1788
|
return false;
|
|
1784
1789
|
}
|
|
1785
|
-
function
|
|
1790
|
+
function readSingleQuotedScalar2(state, nodeIndent) {
|
|
1786
1791
|
var ch, captureStart, captureEnd;
|
|
1787
1792
|
ch = state.input.charCodeAt(state.position);
|
|
1788
1793
|
if (ch !== 39) {
|
|
@@ -1805,18 +1810,18 @@ var require_loader = __commonJS({
|
|
|
1805
1810
|
}
|
|
1806
1811
|
} else if (is_EOL(ch)) {
|
|
1807
1812
|
captureSegment(state, captureStart, captureEnd, true);
|
|
1808
|
-
writeFoldedLines(state,
|
|
1813
|
+
writeFoldedLines(state, skipSeparationSpace2(state, false, nodeIndent));
|
|
1809
1814
|
captureStart = captureEnd = state.position;
|
|
1810
|
-
} else if (state.position === state.lineStart &&
|
|
1811
|
-
|
|
1815
|
+
} else if (state.position === state.lineStart && testDocumentSeparator2(state)) {
|
|
1816
|
+
throwError2(state, "unexpected end of the document within a single quoted scalar");
|
|
1812
1817
|
} else {
|
|
1813
1818
|
state.position++;
|
|
1814
1819
|
captureEnd = state.position;
|
|
1815
1820
|
}
|
|
1816
1821
|
}
|
|
1817
|
-
|
|
1822
|
+
throwError2(state, "unexpected end of the stream within a single quoted scalar");
|
|
1818
1823
|
}
|
|
1819
|
-
function
|
|
1824
|
+
function readDoubleQuotedScalar2(state, nodeIndent) {
|
|
1820
1825
|
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
|
1821
1826
|
ch = state.input.charCodeAt(state.position);
|
|
1822
1827
|
if (ch !== 34) {
|
|
@@ -1835,41 +1840,41 @@ var require_loader = __commonJS({
|
|
|
1835
1840
|
captureSegment(state, captureStart, state.position, true);
|
|
1836
1841
|
ch = state.input.charCodeAt(++state.position);
|
|
1837
1842
|
if (is_EOL(ch)) {
|
|
1838
|
-
|
|
1839
|
-
} else if (ch < 256 &&
|
|
1840
|
-
state.result +=
|
|
1843
|
+
skipSeparationSpace2(state, false, nodeIndent);
|
|
1844
|
+
} else if (ch < 256 && simpleEscapeCheck2[ch]) {
|
|
1845
|
+
state.result += simpleEscapeMap2[ch];
|
|
1841
1846
|
state.position++;
|
|
1842
|
-
} else if ((tmp =
|
|
1847
|
+
} else if ((tmp = escapedHexLen2(ch)) > 0) {
|
|
1843
1848
|
hexLength = tmp;
|
|
1844
1849
|
hexResult = 0;
|
|
1845
1850
|
for (; hexLength > 0; hexLength--) {
|
|
1846
1851
|
ch = state.input.charCodeAt(++state.position);
|
|
1847
|
-
if ((tmp =
|
|
1852
|
+
if ((tmp = fromHexCode2(ch)) >= 0) {
|
|
1848
1853
|
hexResult = (hexResult << 4) + tmp;
|
|
1849
1854
|
} else {
|
|
1850
|
-
|
|
1855
|
+
throwError2(state, "expected hexadecimal character");
|
|
1851
1856
|
}
|
|
1852
1857
|
}
|
|
1853
|
-
state.result +=
|
|
1858
|
+
state.result += charFromCodepoint2(hexResult);
|
|
1854
1859
|
state.position++;
|
|
1855
1860
|
} else {
|
|
1856
|
-
|
|
1861
|
+
throwError2(state, "unknown escape sequence");
|
|
1857
1862
|
}
|
|
1858
1863
|
captureStart = captureEnd = state.position;
|
|
1859
1864
|
} else if (is_EOL(ch)) {
|
|
1860
1865
|
captureSegment(state, captureStart, captureEnd, true);
|
|
1861
|
-
writeFoldedLines(state,
|
|
1866
|
+
writeFoldedLines(state, skipSeparationSpace2(state, false, nodeIndent));
|
|
1862
1867
|
captureStart = captureEnd = state.position;
|
|
1863
|
-
} else if (state.position === state.lineStart &&
|
|
1864
|
-
|
|
1868
|
+
} else if (state.position === state.lineStart && testDocumentSeparator2(state)) {
|
|
1869
|
+
throwError2(state, "unexpected end of the document within a double quoted scalar");
|
|
1865
1870
|
} else {
|
|
1866
1871
|
state.position++;
|
|
1867
1872
|
captureEnd = state.position;
|
|
1868
1873
|
}
|
|
1869
1874
|
}
|
|
1870
|
-
|
|
1875
|
+
throwError2(state, "unexpected end of the stream within a double quoted scalar");
|
|
1871
1876
|
}
|
|
1872
|
-
function
|
|
1877
|
+
function readFlowCollection2(state, nodeIndent) {
|
|
1873
1878
|
var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch;
|
|
1874
1879
|
ch = state.input.charCodeAt(state.position);
|
|
1875
1880
|
if (ch === 91) {
|
|
@@ -1888,7 +1893,7 @@ var require_loader = __commonJS({
|
|
|
1888
1893
|
}
|
|
1889
1894
|
ch = state.input.charCodeAt(++state.position);
|
|
1890
1895
|
while (ch !== 0) {
|
|
1891
|
-
|
|
1896
|
+
skipSeparationSpace2(state, true, nodeIndent);
|
|
1892
1897
|
ch = state.input.charCodeAt(state.position);
|
|
1893
1898
|
if (ch === terminator) {
|
|
1894
1899
|
state.position++;
|
|
@@ -1898,7 +1903,7 @@ var require_loader = __commonJS({
|
|
|
1898
1903
|
state.result = _result;
|
|
1899
1904
|
return true;
|
|
1900
1905
|
} else if (!readNext) {
|
|
1901
|
-
|
|
1906
|
+
throwError2(state, "missed comma between flow collection entries");
|
|
1902
1907
|
}
|
|
1903
1908
|
keyTag = keyNode = valueNode = null;
|
|
1904
1909
|
isPair = isExplicitPair = false;
|
|
@@ -1907,20 +1912,20 @@ var require_loader = __commonJS({
|
|
|
1907
1912
|
if (is_WS_OR_EOL(following)) {
|
|
1908
1913
|
isPair = isExplicitPair = true;
|
|
1909
1914
|
state.position++;
|
|
1910
|
-
|
|
1915
|
+
skipSeparationSpace2(state, true, nodeIndent);
|
|
1911
1916
|
}
|
|
1912
1917
|
}
|
|
1913
1918
|
_line = state.line;
|
|
1914
|
-
composeNode(state, nodeIndent,
|
|
1919
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN2, false, true);
|
|
1915
1920
|
keyTag = state.tag;
|
|
1916
1921
|
keyNode = state.result;
|
|
1917
|
-
|
|
1922
|
+
skipSeparationSpace2(state, true, nodeIndent);
|
|
1918
1923
|
ch = state.input.charCodeAt(state.position);
|
|
1919
1924
|
if ((isExplicitPair || state.line === _line) && ch === 58) {
|
|
1920
1925
|
isPair = true;
|
|
1921
1926
|
ch = state.input.charCodeAt(++state.position);
|
|
1922
|
-
|
|
1923
|
-
composeNode(state, nodeIndent,
|
|
1927
|
+
skipSeparationSpace2(state, true, nodeIndent);
|
|
1928
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN2, false, true);
|
|
1924
1929
|
valueNode = state.result;
|
|
1925
1930
|
}
|
|
1926
1931
|
if (isMapping) {
|
|
@@ -1930,7 +1935,7 @@ var require_loader = __commonJS({
|
|
|
1930
1935
|
} else {
|
|
1931
1936
|
_result.push(keyNode);
|
|
1932
1937
|
}
|
|
1933
|
-
|
|
1938
|
+
skipSeparationSpace2(state, true, nodeIndent);
|
|
1934
1939
|
ch = state.input.charCodeAt(state.position);
|
|
1935
1940
|
if (ch === 44) {
|
|
1936
1941
|
readNext = true;
|
|
@@ -1939,9 +1944,9 @@ var require_loader = __commonJS({
|
|
|
1939
1944
|
readNext = false;
|
|
1940
1945
|
}
|
|
1941
1946
|
}
|
|
1942
|
-
|
|
1947
|
+
throwError2(state, "unexpected end of the stream within a flow collection");
|
|
1943
1948
|
}
|
|
1944
|
-
function
|
|
1949
|
+
function readBlockScalar2(state, nodeIndent) {
|
|
1945
1950
|
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
|
1946
1951
|
ch = state.input.charCodeAt(state.position);
|
|
1947
1952
|
if (ch === 124) {
|
|
@@ -1959,16 +1964,16 @@ var require_loader = __commonJS({
|
|
|
1959
1964
|
if (CHOMPING_CLIP === chomping) {
|
|
1960
1965
|
chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
1961
1966
|
} else {
|
|
1962
|
-
|
|
1967
|
+
throwError2(state, "repeat of a chomping mode identifier");
|
|
1963
1968
|
}
|
|
1964
|
-
} else if ((tmp =
|
|
1969
|
+
} else if ((tmp = fromDecimalCode2(ch)) >= 0) {
|
|
1965
1970
|
if (tmp === 0) {
|
|
1966
|
-
|
|
1971
|
+
throwError2(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
1967
1972
|
} else if (!detectedIndent) {
|
|
1968
1973
|
textIndent = nodeIndent + tmp - 1;
|
|
1969
1974
|
detectedIndent = true;
|
|
1970
1975
|
} else {
|
|
1971
|
-
|
|
1976
|
+
throwError2(state, "repeat of an indentation width identifier");
|
|
1972
1977
|
}
|
|
1973
1978
|
} else {
|
|
1974
1979
|
break;
|
|
@@ -2037,7 +2042,7 @@ var require_loader = __commonJS({
|
|
|
2037
2042
|
}
|
|
2038
2043
|
return true;
|
|
2039
2044
|
}
|
|
2040
|
-
function
|
|
2045
|
+
function readBlockSequence2(state, nodeIndent) {
|
|
2041
2046
|
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
|
|
2042
2047
|
if (state.anchor !== null) {
|
|
2043
2048
|
state.anchorMap[state.anchor] = _result;
|
|
@@ -2053,7 +2058,7 @@ var require_loader = __commonJS({
|
|
|
2053
2058
|
}
|
|
2054
2059
|
detected = true;
|
|
2055
2060
|
state.position++;
|
|
2056
|
-
if (
|
|
2061
|
+
if (skipSeparationSpace2(state, true, -1)) {
|
|
2057
2062
|
if (state.lineIndent <= nodeIndent) {
|
|
2058
2063
|
_result.push(null);
|
|
2059
2064
|
ch = state.input.charCodeAt(state.position);
|
|
@@ -2061,12 +2066,12 @@ var require_loader = __commonJS({
|
|
|
2061
2066
|
}
|
|
2062
2067
|
}
|
|
2063
2068
|
_line = state.line;
|
|
2064
|
-
composeNode(state, nodeIndent,
|
|
2069
|
+
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN2, false, true);
|
|
2065
2070
|
_result.push(state.result);
|
|
2066
|
-
|
|
2071
|
+
skipSeparationSpace2(state, true, -1);
|
|
2067
2072
|
ch = state.input.charCodeAt(state.position);
|
|
2068
2073
|
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
2069
|
-
|
|
2074
|
+
throwError2(state, "bad indentation of a sequence entry");
|
|
2070
2075
|
} else if (state.lineIndent < nodeIndent) {
|
|
2071
2076
|
break;
|
|
2072
2077
|
}
|
|
@@ -2080,7 +2085,7 @@ var require_loader = __commonJS({
|
|
|
2080
2085
|
}
|
|
2081
2086
|
return false;
|
|
2082
2087
|
}
|
|
2083
|
-
function
|
|
2088
|
+
function readBlockMapping2(state, nodeIndent, flowIndent) {
|
|
2084
2089
|
var following, allowCompact, _line, _pos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
|
|
2085
2090
|
if (state.anchor !== null) {
|
|
2086
2091
|
state.anchorMap[state.anchor] = _result;
|
|
@@ -2103,11 +2108,11 @@ var require_loader = __commonJS({
|
|
|
2103
2108
|
atExplicitKey = false;
|
|
2104
2109
|
allowCompact = true;
|
|
2105
2110
|
} else {
|
|
2106
|
-
|
|
2111
|
+
throwError2(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
2107
2112
|
}
|
|
2108
2113
|
state.position += 1;
|
|
2109
2114
|
ch = following;
|
|
2110
|
-
} else if (composeNode(state, flowIndent,
|
|
2115
|
+
} else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT2, false, true)) {
|
|
2111
2116
|
if (state.line === _line) {
|
|
2112
2117
|
ch = state.input.charCodeAt(state.position);
|
|
2113
2118
|
while (is_WHITE_SPACE(ch)) {
|
|
@@ -2116,7 +2121,7 @@ var require_loader = __commonJS({
|
|
|
2116
2121
|
if (ch === 58) {
|
|
2117
2122
|
ch = state.input.charCodeAt(++state.position);
|
|
2118
2123
|
if (!is_WS_OR_EOL(ch)) {
|
|
2119
|
-
|
|
2124
|
+
throwError2(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
2120
2125
|
}
|
|
2121
2126
|
if (atExplicitKey) {
|
|
2122
2127
|
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
|
@@ -2128,14 +2133,14 @@ var require_loader = __commonJS({
|
|
|
2128
2133
|
keyTag = state.tag;
|
|
2129
2134
|
keyNode = state.result;
|
|
2130
2135
|
} else if (detected) {
|
|
2131
|
-
|
|
2136
|
+
throwError2(state, "can not read an implicit mapping pair; a colon is missed");
|
|
2132
2137
|
} else {
|
|
2133
2138
|
state.tag = _tag;
|
|
2134
2139
|
state.anchor = _anchor;
|
|
2135
2140
|
return true;
|
|
2136
2141
|
}
|
|
2137
2142
|
} else if (detected) {
|
|
2138
|
-
|
|
2143
|
+
throwError2(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
2139
2144
|
} else {
|
|
2140
2145
|
state.tag = _tag;
|
|
2141
2146
|
state.anchor = _anchor;
|
|
@@ -2145,7 +2150,7 @@ var require_loader = __commonJS({
|
|
|
2145
2150
|
break;
|
|
2146
2151
|
}
|
|
2147
2152
|
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
2148
|
-
if (composeNode(state, nodeIndent,
|
|
2153
|
+
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT2, true, allowCompact)) {
|
|
2149
2154
|
if (atExplicitKey) {
|
|
2150
2155
|
keyNode = state.result;
|
|
2151
2156
|
} else {
|
|
@@ -2156,11 +2161,11 @@ var require_loader = __commonJS({
|
|
|
2156
2161
|
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
|
|
2157
2162
|
keyTag = keyNode = valueNode = null;
|
|
2158
2163
|
}
|
|
2159
|
-
|
|
2164
|
+
skipSeparationSpace2(state, true, -1);
|
|
2160
2165
|
ch = state.input.charCodeAt(state.position);
|
|
2161
2166
|
}
|
|
2162
2167
|
if (state.lineIndent > nodeIndent && ch !== 0) {
|
|
2163
|
-
|
|
2168
|
+
throwError2(state, "bad indentation of a mapping entry");
|
|
2164
2169
|
} else if (state.lineIndent < nodeIndent) {
|
|
2165
2170
|
break;
|
|
2166
2171
|
}
|
|
@@ -2176,12 +2181,12 @@ var require_loader = __commonJS({
|
|
|
2176
2181
|
}
|
|
2177
2182
|
return detected;
|
|
2178
2183
|
}
|
|
2179
|
-
function
|
|
2184
|
+
function readTagProperty2(state) {
|
|
2180
2185
|
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
|
2181
2186
|
ch = state.input.charCodeAt(state.position);
|
|
2182
2187
|
if (ch !== 33) return false;
|
|
2183
2188
|
if (state.tag !== null) {
|
|
2184
|
-
|
|
2189
|
+
throwError2(state, "duplication of a tag property");
|
|
2185
2190
|
}
|
|
2186
2191
|
ch = state.input.charCodeAt(++state.position);
|
|
2187
2192
|
if (ch === 60) {
|
|
@@ -2203,31 +2208,31 @@ var require_loader = __commonJS({
|
|
|
2203
2208
|
tagName = state.input.slice(_position, state.position);
|
|
2204
2209
|
ch = state.input.charCodeAt(++state.position);
|
|
2205
2210
|
} else {
|
|
2206
|
-
|
|
2211
|
+
throwError2(state, "unexpected end of the stream within a verbatim tag");
|
|
2207
2212
|
}
|
|
2208
2213
|
} else {
|
|
2209
2214
|
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
2210
2215
|
if (ch === 33) {
|
|
2211
2216
|
if (!isNamed) {
|
|
2212
2217
|
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
2213
|
-
if (!
|
|
2214
|
-
|
|
2218
|
+
if (!PATTERN_TAG_HANDLE2.test(tagHandle)) {
|
|
2219
|
+
throwError2(state, "named tag handle cannot contain such characters");
|
|
2215
2220
|
}
|
|
2216
2221
|
isNamed = true;
|
|
2217
2222
|
_position = state.position + 1;
|
|
2218
2223
|
} else {
|
|
2219
|
-
|
|
2224
|
+
throwError2(state, "tag suffix cannot contain exclamation marks");
|
|
2220
2225
|
}
|
|
2221
2226
|
}
|
|
2222
2227
|
ch = state.input.charCodeAt(++state.position);
|
|
2223
2228
|
}
|
|
2224
2229
|
tagName = state.input.slice(_position, state.position);
|
|
2225
|
-
if (
|
|
2226
|
-
|
|
2230
|
+
if (PATTERN_FLOW_INDICATORS2.test(tagName)) {
|
|
2231
|
+
throwError2(state, "tag suffix cannot contain flow indicator characters");
|
|
2227
2232
|
}
|
|
2228
2233
|
}
|
|
2229
|
-
if (tagName && !
|
|
2230
|
-
|
|
2234
|
+
if (tagName && !PATTERN_TAG_URI2.test(tagName)) {
|
|
2235
|
+
throwError2(state, "tag name cannot contain such characters: " + tagName);
|
|
2231
2236
|
}
|
|
2232
2237
|
if (isVerbatim) {
|
|
2233
2238
|
state.tag = tagName;
|
|
@@ -2238,16 +2243,16 @@ var require_loader = __commonJS({
|
|
|
2238
2243
|
} else if (tagHandle === "!!") {
|
|
2239
2244
|
state.tag = "tag:yaml.org,2002:" + tagName;
|
|
2240
2245
|
} else {
|
|
2241
|
-
|
|
2246
|
+
throwError2(state, 'undeclared tag handle "' + tagHandle + '"');
|
|
2242
2247
|
}
|
|
2243
2248
|
return true;
|
|
2244
2249
|
}
|
|
2245
|
-
function
|
|
2250
|
+
function readAnchorProperty2(state) {
|
|
2246
2251
|
var _position, ch;
|
|
2247
2252
|
ch = state.input.charCodeAt(state.position);
|
|
2248
2253
|
if (ch !== 38) return false;
|
|
2249
2254
|
if (state.anchor !== null) {
|
|
2250
|
-
|
|
2255
|
+
throwError2(state, "duplication of an anchor property");
|
|
2251
2256
|
}
|
|
2252
2257
|
ch = state.input.charCodeAt(++state.position);
|
|
2253
2258
|
_position = state.position;
|
|
@@ -2255,12 +2260,12 @@ var require_loader = __commonJS({
|
|
|
2255
2260
|
ch = state.input.charCodeAt(++state.position);
|
|
2256
2261
|
}
|
|
2257
2262
|
if (state.position === _position) {
|
|
2258
|
-
|
|
2263
|
+
throwError2(state, "name of an anchor node must contain at least one character");
|
|
2259
2264
|
}
|
|
2260
2265
|
state.anchor = state.input.slice(_position, state.position);
|
|
2261
2266
|
return true;
|
|
2262
2267
|
}
|
|
2263
|
-
function
|
|
2268
|
+
function readAlias2(state) {
|
|
2264
2269
|
var _position, alias, ch;
|
|
2265
2270
|
ch = state.input.charCodeAt(state.position);
|
|
2266
2271
|
if (ch !== 42) return false;
|
|
@@ -2270,14 +2275,14 @@ var require_loader = __commonJS({
|
|
|
2270
2275
|
ch = state.input.charCodeAt(++state.position);
|
|
2271
2276
|
}
|
|
2272
2277
|
if (state.position === _position) {
|
|
2273
|
-
|
|
2278
|
+
throwError2(state, "name of an alias node must contain at least one character");
|
|
2274
2279
|
}
|
|
2275
2280
|
alias = state.input.slice(_position, state.position);
|
|
2276
2281
|
if (!_hasOwnProperty.call(state.anchorMap, alias)) {
|
|
2277
|
-
|
|
2282
|
+
throwError2(state, 'unidentified alias "' + alias + '"');
|
|
2278
2283
|
}
|
|
2279
2284
|
state.result = state.anchorMap[alias];
|
|
2280
|
-
|
|
2285
|
+
skipSeparationSpace2(state, true, -1);
|
|
2281
2286
|
return true;
|
|
2282
2287
|
}
|
|
2283
2288
|
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
@@ -2289,9 +2294,9 @@ var require_loader = __commonJS({
|
|
|
2289
2294
|
state.anchor = null;
|
|
2290
2295
|
state.kind = null;
|
|
2291
2296
|
state.result = null;
|
|
2292
|
-
allowBlockStyles = allowBlockScalars = allowBlockCollections =
|
|
2297
|
+
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT2 === nodeContext || CONTEXT_BLOCK_IN2 === nodeContext;
|
|
2293
2298
|
if (allowToSeek) {
|
|
2294
|
-
if (
|
|
2299
|
+
if (skipSeparationSpace2(state, true, -1)) {
|
|
2295
2300
|
atNewLine = true;
|
|
2296
2301
|
if (state.lineIndent > parentIndent) {
|
|
2297
2302
|
indentStatus = 1;
|
|
@@ -2303,8 +2308,8 @@ var require_loader = __commonJS({
|
|
|
2303
2308
|
}
|
|
2304
2309
|
}
|
|
2305
2310
|
if (indentStatus === 1) {
|
|
2306
|
-
while (
|
|
2307
|
-
if (
|
|
2311
|
+
while (readTagProperty2(state) || readAnchorProperty2(state)) {
|
|
2312
|
+
if (skipSeparationSpace2(state, true, -1)) {
|
|
2308
2313
|
atNewLine = true;
|
|
2309
2314
|
allowBlockCollections = allowBlockStyles;
|
|
2310
2315
|
if (state.lineIndent > parentIndent) {
|
|
@@ -2322,25 +2327,25 @@ var require_loader = __commonJS({
|
|
|
2322
2327
|
if (allowBlockCollections) {
|
|
2323
2328
|
allowBlockCollections = atNewLine || allowCompact;
|
|
2324
2329
|
}
|
|
2325
|
-
if (indentStatus === 1 ||
|
|
2326
|
-
if (
|
|
2330
|
+
if (indentStatus === 1 || CONTEXT_BLOCK_OUT2 === nodeContext) {
|
|
2331
|
+
if (CONTEXT_FLOW_IN2 === nodeContext || CONTEXT_FLOW_OUT2 === nodeContext) {
|
|
2327
2332
|
flowIndent = parentIndent;
|
|
2328
2333
|
} else {
|
|
2329
2334
|
flowIndent = parentIndent + 1;
|
|
2330
2335
|
}
|
|
2331
2336
|
blockIndent = state.position - state.lineStart;
|
|
2332
2337
|
if (indentStatus === 1) {
|
|
2333
|
-
if (allowBlockCollections && (
|
|
2338
|
+
if (allowBlockCollections && (readBlockSequence2(state, blockIndent) || readBlockMapping2(state, blockIndent, flowIndent)) || readFlowCollection2(state, flowIndent)) {
|
|
2334
2339
|
hasContent = true;
|
|
2335
2340
|
} else {
|
|
2336
|
-
if (allowBlockScalars &&
|
|
2341
|
+
if (allowBlockScalars && readBlockScalar2(state, flowIndent) || readSingleQuotedScalar2(state, flowIndent) || readDoubleQuotedScalar2(state, flowIndent)) {
|
|
2337
2342
|
hasContent = true;
|
|
2338
|
-
} else if (
|
|
2343
|
+
} else if (readAlias2(state)) {
|
|
2339
2344
|
hasContent = true;
|
|
2340
2345
|
if (state.tag !== null || state.anchor !== null) {
|
|
2341
|
-
|
|
2346
|
+
throwError2(state, "alias node should not have any properties");
|
|
2342
2347
|
}
|
|
2343
|
-
} else if (
|
|
2348
|
+
} else if (readPlainScalar2(state, flowIndent, CONTEXT_FLOW_IN2 === nodeContext)) {
|
|
2344
2349
|
hasContent = true;
|
|
2345
2350
|
if (state.tag === null) {
|
|
2346
2351
|
state.tag = "?";
|
|
@@ -2351,13 +2356,13 @@ var require_loader = __commonJS({
|
|
|
2351
2356
|
}
|
|
2352
2357
|
}
|
|
2353
2358
|
} else if (indentStatus === 0) {
|
|
2354
|
-
hasContent = allowBlockCollections &&
|
|
2359
|
+
hasContent = allowBlockCollections && readBlockSequence2(state, blockIndent);
|
|
2355
2360
|
}
|
|
2356
2361
|
}
|
|
2357
2362
|
if (state.tag !== null && state.tag !== "!") {
|
|
2358
2363
|
if (state.tag === "?") {
|
|
2359
2364
|
if (state.result !== null && state.kind !== "scalar") {
|
|
2360
|
-
|
|
2365
|
+
throwError2(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
|
2361
2366
|
}
|
|
2362
2367
|
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
2363
2368
|
type = state.implicitTypes[typeIndex];
|
|
@@ -2373,10 +2378,10 @@ var require_loader = __commonJS({
|
|
|
2373
2378
|
} else if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) {
|
|
2374
2379
|
type = state.typeMap[state.kind || "fallback"][state.tag];
|
|
2375
2380
|
if (state.result !== null && type.kind !== state.kind) {
|
|
2376
|
-
|
|
2381
|
+
throwError2(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
|
|
2377
2382
|
}
|
|
2378
2383
|
if (!type.resolve(state.result)) {
|
|
2379
|
-
|
|
2384
|
+
throwError2(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
2380
2385
|
} else {
|
|
2381
2386
|
state.result = type.construct(state.result);
|
|
2382
2387
|
if (state.anchor !== null) {
|
|
@@ -2384,7 +2389,7 @@ var require_loader = __commonJS({
|
|
|
2384
2389
|
}
|
|
2385
2390
|
}
|
|
2386
2391
|
} else {
|
|
2387
|
-
|
|
2392
|
+
throwError2(state, "unknown tag !<" + state.tag + ">");
|
|
2388
2393
|
}
|
|
2389
2394
|
}
|
|
2390
2395
|
if (state.listener !== null) {
|
|
@@ -2392,14 +2397,14 @@ var require_loader = __commonJS({
|
|
|
2392
2397
|
}
|
|
2393
2398
|
return state.tag !== null || state.anchor !== null || hasContent;
|
|
2394
2399
|
}
|
|
2395
|
-
function
|
|
2400
|
+
function readDocument2(state) {
|
|
2396
2401
|
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
2397
2402
|
state.version = null;
|
|
2398
2403
|
state.checkLineBreaks = state.legacy;
|
|
2399
2404
|
state.tagMap = {};
|
|
2400
2405
|
state.anchorMap = {};
|
|
2401
2406
|
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
2402
|
-
|
|
2407
|
+
skipSeparationSpace2(state, true, -1);
|
|
2403
2408
|
ch = state.input.charCodeAt(state.position);
|
|
2404
2409
|
if (state.lineIndent > 0 || ch !== 37) {
|
|
2405
2410
|
break;
|
|
@@ -2413,7 +2418,7 @@ var require_loader = __commonJS({
|
|
|
2413
2418
|
directiveName = state.input.slice(_position, state.position);
|
|
2414
2419
|
directiveArgs = [];
|
|
2415
2420
|
if (directiveName.length < 1) {
|
|
2416
|
-
|
|
2421
|
+
throwError2(state, "directive name must not be less than one character in length");
|
|
2417
2422
|
}
|
|
2418
2423
|
while (ch !== 0) {
|
|
2419
2424
|
while (is_WHITE_SPACE(ch)) {
|
|
@@ -2439,33 +2444,33 @@ var require_loader = __commonJS({
|
|
|
2439
2444
|
throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
|
2440
2445
|
}
|
|
2441
2446
|
}
|
|
2442
|
-
|
|
2447
|
+
skipSeparationSpace2(state, true, -1);
|
|
2443
2448
|
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
|
|
2444
2449
|
state.position += 3;
|
|
2445
|
-
|
|
2450
|
+
skipSeparationSpace2(state, true, -1);
|
|
2446
2451
|
} else if (hasDirectives) {
|
|
2447
|
-
|
|
2452
|
+
throwError2(state, "directives end mark is expected");
|
|
2448
2453
|
}
|
|
2449
|
-
composeNode(state, state.lineIndent - 1,
|
|
2450
|
-
|
|
2454
|
+
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT2, false, true);
|
|
2455
|
+
skipSeparationSpace2(state, true, -1);
|
|
2451
2456
|
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
|
|
2452
2457
|
throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
2453
2458
|
}
|
|
2454
2459
|
state.documents.push(state.result);
|
|
2455
|
-
if (state.position === state.lineStart &&
|
|
2460
|
+
if (state.position === state.lineStart && testDocumentSeparator2(state)) {
|
|
2456
2461
|
if (state.input.charCodeAt(state.position) === 46) {
|
|
2457
2462
|
state.position += 3;
|
|
2458
|
-
|
|
2463
|
+
skipSeparationSpace2(state, true, -1);
|
|
2459
2464
|
}
|
|
2460
2465
|
return;
|
|
2461
2466
|
}
|
|
2462
2467
|
if (state.position < state.length - 1) {
|
|
2463
|
-
|
|
2468
|
+
throwError2(state, "end of the stream or a document separator is expected");
|
|
2464
2469
|
} else {
|
|
2465
2470
|
return;
|
|
2466
2471
|
}
|
|
2467
2472
|
}
|
|
2468
|
-
function
|
|
2473
|
+
function loadDocuments2(input, options2) {
|
|
2469
2474
|
input = String(input);
|
|
2470
2475
|
options2 = options2 || {};
|
|
2471
2476
|
if (input.length !== 0) {
|
|
@@ -2480,7 +2485,7 @@ var require_loader = __commonJS({
|
|
|
2480
2485
|
var nullpos = input.indexOf("\0");
|
|
2481
2486
|
if (nullpos !== -1) {
|
|
2482
2487
|
state.position = nullpos;
|
|
2483
|
-
|
|
2488
|
+
throwError2(state, "null byte is not allowed in input");
|
|
2484
2489
|
}
|
|
2485
2490
|
state.input += "\0";
|
|
2486
2491
|
while (state.input.charCodeAt(state.position) === 32) {
|
|
@@ -2488,7 +2493,7 @@ var require_loader = __commonJS({
|
|
|
2488
2493
|
state.position += 1;
|
|
2489
2494
|
}
|
|
2490
2495
|
while (state.position < state.length - 1) {
|
|
2491
|
-
|
|
2496
|
+
readDocument2(state);
|
|
2492
2497
|
}
|
|
2493
2498
|
return state.documents;
|
|
2494
2499
|
}
|
|
@@ -2497,7 +2502,7 @@ var require_loader = __commonJS({
|
|
|
2497
2502
|
options2 = iterator;
|
|
2498
2503
|
iterator = null;
|
|
2499
2504
|
}
|
|
2500
|
-
var documents =
|
|
2505
|
+
var documents = loadDocuments2(input, options2);
|
|
2501
2506
|
if (typeof iterator !== "function") {
|
|
2502
2507
|
return documents;
|
|
2503
2508
|
}
|
|
@@ -2505,14 +2510,14 @@ var require_loader = __commonJS({
|
|
|
2505
2510
|
iterator(documents[index]);
|
|
2506
2511
|
}
|
|
2507
2512
|
}
|
|
2508
|
-
function
|
|
2509
|
-
var documents =
|
|
2513
|
+
function load2(input, options2) {
|
|
2514
|
+
var documents = loadDocuments2(input, options2);
|
|
2510
2515
|
if (documents.length === 0) {
|
|
2511
2516
|
return void 0;
|
|
2512
2517
|
} else if (documents.length === 1) {
|
|
2513
2518
|
return documents[0];
|
|
2514
2519
|
}
|
|
2515
|
-
throw new
|
|
2520
|
+
throw new YAMLException2("expected a single document in the stream, but found more");
|
|
2516
2521
|
}
|
|
2517
2522
|
function safeLoadAll(input, iterator, options2) {
|
|
2518
2523
|
if (typeof iterator === "object" && iterator !== null && typeof options2 === "undefined") {
|
|
@@ -2522,10 +2527,10 @@ var require_loader = __commonJS({
|
|
|
2522
2527
|
return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
|
|
2523
2528
|
}
|
|
2524
2529
|
function safeLoad(input, options2) {
|
|
2525
|
-
return
|
|
2530
|
+
return load2(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
|
|
2526
2531
|
}
|
|
2527
2532
|
module2.exports.loadAll = loadAll;
|
|
2528
|
-
module2.exports.load =
|
|
2533
|
+
module2.exports.load = load2;
|
|
2529
2534
|
module2.exports.safeLoadAll = safeLoadAll;
|
|
2530
2535
|
module2.exports.safeLoad = safeLoad;
|
|
2531
2536
|
}
|
|
@@ -2536,7 +2541,7 @@ var require_dumper = __commonJS({
|
|
|
2536
2541
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/dumper.js"(exports2, module2) {
|
|
2537
2542
|
"use strict";
|
|
2538
2543
|
var common = require_common();
|
|
2539
|
-
var
|
|
2544
|
+
var YAMLException2 = require_exception();
|
|
2540
2545
|
var DEFAULT_FULL_SCHEMA = require_default_full();
|
|
2541
2546
|
var DEFAULT_SAFE_SCHEMA = require_default_safe();
|
|
2542
2547
|
var _toString = Object.prototype.toString;
|
|
@@ -2565,22 +2570,22 @@ var require_dumper = __commonJS({
|
|
|
2565
2570
|
var CHAR_LEFT_CURLY_BRACKET = 123;
|
|
2566
2571
|
var CHAR_VERTICAL_LINE = 124;
|
|
2567
2572
|
var CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
2568
|
-
var
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2573
|
+
var ESCAPE_SEQUENCES2 = {};
|
|
2574
|
+
ESCAPE_SEQUENCES2[0] = "\\0";
|
|
2575
|
+
ESCAPE_SEQUENCES2[7] = "\\a";
|
|
2576
|
+
ESCAPE_SEQUENCES2[8] = "\\b";
|
|
2577
|
+
ESCAPE_SEQUENCES2[9] = "\\t";
|
|
2578
|
+
ESCAPE_SEQUENCES2[10] = "\\n";
|
|
2579
|
+
ESCAPE_SEQUENCES2[11] = "\\v";
|
|
2580
|
+
ESCAPE_SEQUENCES2[12] = "\\f";
|
|
2581
|
+
ESCAPE_SEQUENCES2[13] = "\\r";
|
|
2582
|
+
ESCAPE_SEQUENCES2[27] = "\\e";
|
|
2583
|
+
ESCAPE_SEQUENCES2[34] = '\\"';
|
|
2584
|
+
ESCAPE_SEQUENCES2[92] = "\\\\";
|
|
2585
|
+
ESCAPE_SEQUENCES2[133] = "\\N";
|
|
2586
|
+
ESCAPE_SEQUENCES2[160] = "\\_";
|
|
2587
|
+
ESCAPE_SEQUENCES2[8232] = "\\L";
|
|
2588
|
+
ESCAPE_SEQUENCES2[8233] = "\\P";
|
|
2584
2589
|
var DEPRECATED_BOOLEANS_SYNTAX = [
|
|
2585
2590
|
"y",
|
|
2586
2591
|
"Y",
|
|
@@ -2631,7 +2636,7 @@ var require_dumper = __commonJS({
|
|
|
2631
2636
|
handle = "U";
|
|
2632
2637
|
length = 8;
|
|
2633
2638
|
} else {
|
|
2634
|
-
throw new
|
|
2639
|
+
throw new YAMLException2("code point within a string may not be greater than 0xFFFFFFFF");
|
|
2635
2640
|
}
|
|
2636
2641
|
return "\\" + handle + common.repeat("0", length - string.length) + string;
|
|
2637
2642
|
}
|
|
@@ -2776,7 +2781,7 @@ var require_dumper = __commonJS({
|
|
|
2776
2781
|
case STYLE_DOUBLE:
|
|
2777
2782
|
return '"' + escapeString(string, lineWidth) + '"';
|
|
2778
2783
|
default:
|
|
2779
|
-
throw new
|
|
2784
|
+
throw new YAMLException2("impossible error: invalid scalar style");
|
|
2780
2785
|
}
|
|
2781
2786
|
})();
|
|
2782
2787
|
}
|
|
@@ -2846,7 +2851,7 @@ var require_dumper = __commonJS({
|
|
|
2846
2851
|
continue;
|
|
2847
2852
|
}
|
|
2848
2853
|
}
|
|
2849
|
-
escapeSeq =
|
|
2854
|
+
escapeSeq = ESCAPE_SEQUENCES2[char];
|
|
2850
2855
|
result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char);
|
|
2851
2856
|
}
|
|
2852
2857
|
return result;
|
|
@@ -2909,7 +2914,7 @@ var require_dumper = __commonJS({
|
|
|
2909
2914
|
} else if (typeof state.sortKeys === "function") {
|
|
2910
2915
|
objectKeyList.sort(state.sortKeys);
|
|
2911
2916
|
} else if (state.sortKeys) {
|
|
2912
|
-
throw new
|
|
2917
|
+
throw new YAMLException2("sortKeys must be a boolean or a function");
|
|
2913
2918
|
}
|
|
2914
2919
|
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
2915
2920
|
pairBuffer = "";
|
|
@@ -2961,7 +2966,7 @@ var require_dumper = __commonJS({
|
|
|
2961
2966
|
} else if (_hasOwnProperty.call(type.represent, style)) {
|
|
2962
2967
|
_result = type.represent[style](object, style);
|
|
2963
2968
|
} else {
|
|
2964
|
-
throw new
|
|
2969
|
+
throw new YAMLException2("!<" + type.tag + '> tag resolver accepts not "' + style + '" style');
|
|
2965
2970
|
}
|
|
2966
2971
|
state.dump = _result;
|
|
2967
2972
|
}
|
|
@@ -3025,7 +3030,7 @@ var require_dumper = __commonJS({
|
|
|
3025
3030
|
}
|
|
3026
3031
|
} else {
|
|
3027
3032
|
if (state.skipInvalid) return false;
|
|
3028
|
-
throw new
|
|
3033
|
+
throw new YAMLException2("unacceptable kind of an object to dump " + type);
|
|
3029
3034
|
}
|
|
3030
3035
|
if (state.tag !== null && state.tag !== "?") {
|
|
3031
3036
|
state.dump = "!<" + state.tag + "> " + state.dump;
|
|
@@ -3333,11 +3338,11 @@ var require_excerpt = __commonJS({
|
|
|
3333
3338
|
if (typeof opts.excerpt === "function") {
|
|
3334
3339
|
return opts.excerpt(file, opts);
|
|
3335
3340
|
}
|
|
3336
|
-
const
|
|
3337
|
-
if (
|
|
3341
|
+
const sep2 = file.data.excerpt_separator || opts.excerpt_separator;
|
|
3342
|
+
if (sep2 == null && (opts.excerpt === false || opts.excerpt == null)) {
|
|
3338
3343
|
return file;
|
|
3339
3344
|
}
|
|
3340
|
-
const delimiter2 = typeof opts.excerpt === "string" ? opts.excerpt :
|
|
3345
|
+
const delimiter2 = typeof opts.excerpt === "string" ? opts.excerpt : sep2 || opts.delimiters[0];
|
|
3341
3346
|
const idx = file.content.indexOf(delimiter2);
|
|
3342
3347
|
if (idx !== -1) {
|
|
3343
3348
|
file.excerpt = file.content.slice(0, idx);
|
|
@@ -3402,7 +3407,7 @@ var require_parse = __commonJS({
|
|
|
3402
3407
|
var require_gray_matter = __commonJS({
|
|
3403
3408
|
"node_modules/gray-matter/index.js"(exports2, module2) {
|
|
3404
3409
|
"use strict";
|
|
3405
|
-
var
|
|
3410
|
+
var fs5 = require("fs");
|
|
3406
3411
|
var sections = require_section_matter();
|
|
3407
3412
|
var defaults = require_defaults();
|
|
3408
3413
|
var stringify = require_stringify();
|
|
@@ -3486,7 +3491,7 @@ var require_gray_matter = __commonJS({
|
|
|
3486
3491
|
return stringify(file, data, options2);
|
|
3487
3492
|
};
|
|
3488
3493
|
matter2.read = function(filepath, options2) {
|
|
3489
|
-
const str2 =
|
|
3494
|
+
const str2 = fs5.readFileSync(filepath, "utf8");
|
|
3490
3495
|
const file = matter2(str2, options2);
|
|
3491
3496
|
file.path = filepath;
|
|
3492
3497
|
return file;
|
|
@@ -3515,8 +3520,14 @@ var require_gray_matter = __commonJS({
|
|
|
3515
3520
|
});
|
|
3516
3521
|
|
|
3517
3522
|
// src/skill-scripts/dispatch-task-execution.ts
|
|
3518
|
-
var
|
|
3519
|
-
|
|
3523
|
+
var dispatch_task_execution_exports = {};
|
|
3524
|
+
__export(dispatch_task_execution_exports, {
|
|
3525
|
+
resolveDispatchRoute: () => resolveDispatchRoute
|
|
3526
|
+
});
|
|
3527
|
+
module.exports = __toCommonJS(dispatch_task_execution_exports);
|
|
3528
|
+
var fs4 = __toESM(require("fs"));
|
|
3529
|
+
var path5 = __toESM(require("path"));
|
|
3530
|
+
var import_gray_matter = __toESM(require_gray_matter());
|
|
3520
3531
|
|
|
3521
3532
|
// src/types.ts
|
|
3522
3533
|
var SUPPORTED_HARNESSES = [
|
|
@@ -3528,14 +3539,110 @@ var SUPPORTED_HARNESSES = [
|
|
|
3528
3539
|
"opencode"
|
|
3529
3540
|
];
|
|
3530
3541
|
|
|
3531
|
-
// src/skill-scripts/shared/
|
|
3532
|
-
var fs = __toESM(require("fs"));
|
|
3542
|
+
// src/skill-scripts/shared/dispatch-target-selector.ts
|
|
3533
3543
|
var path = __toESM(require("path"));
|
|
3534
3544
|
var import_child_process = require("child_process");
|
|
3545
|
+
var executionTargetId = (target) => JSON.stringify([target.model, target.harness ?? null, target.reasoning_effort ?? null]);
|
|
3546
|
+
var runSelector = (scriptPath, input, timeoutMs) => {
|
|
3547
|
+
try {
|
|
3548
|
+
const nodeScript = /\.(?:cjs|mjs|js)$/.test(scriptPath);
|
|
3549
|
+
const stdout = nodeScript ? (0, import_child_process.execFileSync)(process.execPath, [scriptPath], {
|
|
3550
|
+
input,
|
|
3551
|
+
encoding: "utf8",
|
|
3552
|
+
timeout: timeoutMs,
|
|
3553
|
+
maxBuffer: 1024 * 1024,
|
|
3554
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
3555
|
+
}) : (0, import_child_process.execFileSync)(scriptPath, [], {
|
|
3556
|
+
input,
|
|
3557
|
+
encoding: "utf8",
|
|
3558
|
+
timeout: timeoutMs,
|
|
3559
|
+
maxBuffer: 1024 * 1024,
|
|
3560
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
3561
|
+
});
|
|
3562
|
+
return { ok: true, stdout };
|
|
3563
|
+
} catch {
|
|
3564
|
+
return { ok: false };
|
|
3565
|
+
}
|
|
3566
|
+
};
|
|
3567
|
+
var nativeDefault = (reason, detail) => ({ kind: "native-default", reason, detail });
|
|
3568
|
+
var resolveRepositoryScript = (projectRoot, configured) => {
|
|
3569
|
+
if (path.isAbsolute(configured)) return null;
|
|
3570
|
+
const root = path.resolve(projectRoot);
|
|
3571
|
+
const resolved = path.resolve(root, configured);
|
|
3572
|
+
return resolved === root || resolved.startsWith(`${root}${path.sep}`) ? resolved : null;
|
|
3573
|
+
};
|
|
3574
|
+
var selectDispatchTarget = (config, profileName, avoidedIds, options2) => {
|
|
3575
|
+
const profile = config.profiles.find((candidate) => candidate.name === profileName);
|
|
3576
|
+
if (!profile) {
|
|
3577
|
+
return nativeDefault(
|
|
3578
|
+
"profile-unavailable",
|
|
3579
|
+
`Execution profile "${profileName}" is not present in current configuration.`
|
|
3580
|
+
);
|
|
3581
|
+
}
|
|
3582
|
+
const candidates = profile.targets.map((target) => ({ id: executionTargetId(target), target }));
|
|
3583
|
+
const available = candidates.filter((candidate) => !avoidedIds.has(candidate.id));
|
|
3584
|
+
if (available.length === 0) {
|
|
3585
|
+
return nativeDefault(
|
|
3586
|
+
"targets-exhausted",
|
|
3587
|
+
`All ${candidates.length} configured target(s) for profile "${profileName}" were avoided.`
|
|
3588
|
+
);
|
|
3589
|
+
}
|
|
3590
|
+
if (config.resolverScript === void 0) {
|
|
3591
|
+
const selected2 = available[0];
|
|
3592
|
+
return { kind: "selected", ...selected2, source: "built-in" };
|
|
3593
|
+
}
|
|
3594
|
+
const scriptPath = resolveRepositoryScript(options2.projectRoot, config.resolverScript);
|
|
3595
|
+
if (!scriptPath) {
|
|
3596
|
+
return nativeDefault(
|
|
3597
|
+
"selector-failure",
|
|
3598
|
+
"Custom target selector path is not repository-relative."
|
|
3599
|
+
);
|
|
3600
|
+
}
|
|
3601
|
+
const input = {
|
|
3602
|
+
version: 1,
|
|
3603
|
+
task: { id: options2.taskId, profile: profileName },
|
|
3604
|
+
candidates,
|
|
3605
|
+
avoid: [...avoidedIds].sort()
|
|
3606
|
+
};
|
|
3607
|
+
const result = (options2.runSelector ?? runSelector)(
|
|
3608
|
+
scriptPath,
|
|
3609
|
+
JSON.stringify(input),
|
|
3610
|
+
options2.timeoutMs ?? 1e4
|
|
3611
|
+
);
|
|
3612
|
+
if (!result.ok || result.stdout === void 0) {
|
|
3613
|
+
return nativeDefault(
|
|
3614
|
+
"selector-failure",
|
|
3615
|
+
"Custom target selector did not complete successfully."
|
|
3616
|
+
);
|
|
3617
|
+
}
|
|
3618
|
+
let output;
|
|
3619
|
+
try {
|
|
3620
|
+
output = JSON.parse(result.stdout);
|
|
3621
|
+
} catch {
|
|
3622
|
+
return nativeDefault("selector-failure", "Custom target selector returned invalid JSON.");
|
|
3623
|
+
}
|
|
3624
|
+
if (typeof output !== "object" || output === null || Array.isArray(output) || Object.keys(output).length !== 1 || typeof output.target !== "string") {
|
|
3625
|
+
return nativeDefault("selector-failure", "Custom target selector returned an invalid result.");
|
|
3626
|
+
}
|
|
3627
|
+
const selectedId = output.target;
|
|
3628
|
+
const selected = candidates.find((candidate) => candidate.id === selectedId);
|
|
3629
|
+
if (!selected || avoidedIds.has(selected.id)) {
|
|
3630
|
+
return nativeDefault(
|
|
3631
|
+
"selector-failure",
|
|
3632
|
+
"Custom target selector returned an unknown or avoided target."
|
|
3633
|
+
);
|
|
3634
|
+
}
|
|
3635
|
+
return { kind: "selected", ...selected, source: "custom" };
|
|
3636
|
+
};
|
|
3637
|
+
|
|
3638
|
+
// src/skill-scripts/shared/external-dispatch.ts
|
|
3639
|
+
var fs = __toESM(require("fs"));
|
|
3640
|
+
var path2 = __toESM(require("path"));
|
|
3641
|
+
var import_child_process2 = require("child_process");
|
|
3535
3642
|
var taskPrompt = (request) => `Strikethroo external task dispatch \u2014 Plan ${request.planId}, Task ${request.taskId}.
|
|
3536
3643
|
Workspace: ${request.workspace}
|
|
3537
3644
|
Task file: ${request.taskFile}
|
|
3538
|
-
Before implementation, read and execute ${
|
|
3645
|
+
Before implementation, read and execute ${path2.join(
|
|
3539
3646
|
request.workspace,
|
|
3540
3647
|
".ai/strikethroo/config/hooks/PRE_TASK_EXECUTION.md"
|
|
3541
3648
|
)}. Halt if that hook fails.
|
|
@@ -3615,23 +3722,23 @@ var harnessKeys = [...SUPPORTED_HARNESSES].sort();
|
|
|
3615
3722
|
if (adapterKeys.join("\0") !== harnessKeys.join("\0")) {
|
|
3616
3723
|
throw new Error("External harness adapter registry does not cover SUPPORTED_HARNESSES exactly.");
|
|
3617
3724
|
}
|
|
3618
|
-
var executableOnPath = (executable) => (process.env.PATH ?? "").split(
|
|
3725
|
+
var executableOnPath = (executable) => (process.env.PATH ?? "").split(path2.delimiter).some((directory) => {
|
|
3619
3726
|
if (!directory) return false;
|
|
3620
|
-
const candidate =
|
|
3727
|
+
const candidate = path2.join(directory, executable);
|
|
3621
3728
|
try {
|
|
3622
3729
|
return fs.statSync(candidate).isFile();
|
|
3623
3730
|
} catch {
|
|
3624
3731
|
return false;
|
|
3625
3732
|
}
|
|
3626
3733
|
});
|
|
3627
|
-
var runProcess = (executable, argv, cwd, stdin, inheritOutput = false) => new Promise((
|
|
3734
|
+
var runProcess = (executable, argv, cwd, stdin, inheritOutput = false) => new Promise((resolve3, reject) => {
|
|
3628
3735
|
let settled = false;
|
|
3629
3736
|
const fail = (error) => {
|
|
3630
3737
|
if (settled) return;
|
|
3631
3738
|
settled = true;
|
|
3632
3739
|
reject(error);
|
|
3633
3740
|
};
|
|
3634
|
-
const child = (0,
|
|
3741
|
+
const child = (0, import_child_process2.spawn)(executable, argv, {
|
|
3635
3742
|
cwd,
|
|
3636
3743
|
shell: false,
|
|
3637
3744
|
stdio: [
|
|
@@ -3644,7 +3751,7 @@ var runProcess = (executable, argv, cwd, stdin, inheritOutput = false) => new Pr
|
|
|
3644
3751
|
child.once("close", (code) => {
|
|
3645
3752
|
if (settled) return;
|
|
3646
3753
|
settled = true;
|
|
3647
|
-
|
|
3754
|
+
resolve3({ exitCode: code ?? 1 });
|
|
3648
3755
|
});
|
|
3649
3756
|
if (stdin !== void 0) {
|
|
3650
3757
|
child.stdin.once("error", fail);
|
|
@@ -3719,64 +3826,2572 @@ var dispatchExternalTask = async (request, overrides = {}) => {
|
|
|
3719
3826
|
}
|
|
3720
3827
|
};
|
|
3721
3828
|
|
|
3722
|
-
// src/skill-scripts/shared/
|
|
3723
|
-
var
|
|
3724
|
-
var
|
|
3725
|
-
var
|
|
3726
|
-
var
|
|
3727
|
-
|
|
3829
|
+
// src/skill-scripts/shared/harness-availability.ts
|
|
3830
|
+
var fs2 = __toESM(require("fs"));
|
|
3831
|
+
var path3 = __toESM(require("path"));
|
|
3832
|
+
var import_child_process3 = require("child_process");
|
|
3833
|
+
var AVAILABILITY_REGISTRY_VERSION = 1;
|
|
3834
|
+
var AVAILABLE_TTL_MS = 30 * 60 * 1e3;
|
|
3835
|
+
var UNAVAILABLE_TTL_MS = 5 * 60 * 1e3;
|
|
3836
|
+
var PROBE_TIMEOUT_MS = 2e4;
|
|
3837
|
+
var AVAILABILITY_CACHE_RELATIVE_PATH = path3.join("runtime", "harness-availability.json");
|
|
3838
|
+
var PROBE_PROMPT = "Reply with OK.";
|
|
3839
|
+
var probeCommand = (executable, argv, cwd, stdin = PROBE_PROMPT) => ({ executable, argv, cwd, stdin });
|
|
3840
|
+
var HARNESS_AVAILABILITY_REGISTRY = {
|
|
3841
|
+
claude: {
|
|
3842
|
+
version: AVAILABILITY_REGISTRY_VERSION,
|
|
3843
|
+
executable: "claude",
|
|
3844
|
+
model: "claude-3-5-haiku-latest",
|
|
3845
|
+
buildCommand: (cwd) => probeCommand("claude", ["-p", "--model", "claude-3-5-haiku-latest"], cwd)
|
|
3846
|
+
},
|
|
3847
|
+
codex: {
|
|
3848
|
+
version: AVAILABILITY_REGISTRY_VERSION,
|
|
3849
|
+
executable: "codex",
|
|
3850
|
+
model: "gpt-5.1-codex-mini",
|
|
3851
|
+
buildCommand: (cwd) => probeCommand("codex", ["exec", "--model", "gpt-5.1-codex-mini", "-"], cwd)
|
|
3852
|
+
},
|
|
3853
|
+
cursor: {
|
|
3854
|
+
version: AVAILABILITY_REGISTRY_VERSION,
|
|
3855
|
+
executable: "cursor-agent",
|
|
3856
|
+
model: "cursor-small",
|
|
3857
|
+
buildCommand: (cwd) => probeCommand("cursor-agent", ["--print", "--model", "cursor-small"], cwd)
|
|
3858
|
+
},
|
|
3859
|
+
gemini: {
|
|
3860
|
+
version: AVAILABILITY_REGISTRY_VERSION,
|
|
3861
|
+
executable: "gemini",
|
|
3862
|
+
model: "gemini-2.5-flash-lite",
|
|
3863
|
+
buildCommand: (cwd) => probeCommand(
|
|
3864
|
+
"gemini",
|
|
3865
|
+
["--prompt", PROBE_PROMPT, "--model", "gemini-2.5-flash-lite"],
|
|
3866
|
+
cwd,
|
|
3867
|
+
""
|
|
3868
|
+
)
|
|
3869
|
+
},
|
|
3870
|
+
copilot: {
|
|
3871
|
+
version: AVAILABILITY_REGISTRY_VERSION,
|
|
3872
|
+
executable: "copilot",
|
|
3873
|
+
model: "gpt-4.1",
|
|
3874
|
+
buildCommand: (cwd) => probeCommand("copilot", ["-p", PROBE_PROMPT, "--model", "gpt-4.1"], cwd, "")
|
|
3875
|
+
},
|
|
3876
|
+
opencode: {
|
|
3877
|
+
version: AVAILABILITY_REGISTRY_VERSION,
|
|
3878
|
+
executable: "opencode",
|
|
3879
|
+
model: "openai/gpt-5-nano",
|
|
3880
|
+
buildCommand: (cwd) => probeCommand("opencode", ["run", "--model", "openai/gpt-5-nano", "-"], cwd)
|
|
3881
|
+
}
|
|
3882
|
+
};
|
|
3883
|
+
var registryKeys = Object.keys(HARNESS_AVAILABILITY_REGISTRY).sort();
|
|
3884
|
+
var harnessKeys2 = [...SUPPORTED_HARNESSES].sort();
|
|
3885
|
+
if (registryKeys.join("\0") !== harnessKeys2.join("\0")) {
|
|
3886
|
+
throw new Error("Harness availability registry does not cover SUPPORTED_HARNESSES exactly.");
|
|
3887
|
+
}
|
|
3888
|
+
for (const harness of SUPPORTED_HARNESSES) {
|
|
3889
|
+
const availability = HARNESS_AVAILABILITY_REGISTRY[harness];
|
|
3890
|
+
if (availability.executable !== EXTERNAL_HARNESS_ADAPTERS[harness].executable) {
|
|
3891
|
+
throw new Error(`Harness availability executable disagrees with the ${harness} adapter.`);
|
|
3892
|
+
}
|
|
3893
|
+
}
|
|
3894
|
+
var safeReason = (value, fallback) => {
|
|
3895
|
+
if (typeof value !== "string") return fallback;
|
|
3896
|
+
const firstLine = value.replace(/[\r\n]+/g, " ").trim().slice(0, 200);
|
|
3897
|
+
return firstLine || fallback;
|
|
3898
|
+
};
|
|
3899
|
+
var isOutcome = (value) => {
|
|
3900
|
+
if (!value || typeof value !== "object") return false;
|
|
3901
|
+
const entry = value;
|
|
3902
|
+
return typeof entry.available === "boolean" && typeof entry.observedAt === "number" && Number.isFinite(entry.observedAt) && typeof entry.expiresAt === "number" && Number.isFinite(entry.expiresAt) && typeof entry.reason === "string";
|
|
3903
|
+
};
|
|
3904
|
+
var readCache = (cachePath) => {
|
|
3905
|
+
try {
|
|
3906
|
+
const parsed = JSON.parse(fs2.readFileSync(cachePath, "utf8"));
|
|
3907
|
+
if (!parsed || typeof parsed !== "object") throw new Error("invalid cache");
|
|
3908
|
+
const record = parsed;
|
|
3909
|
+
if (record.version !== 1 || !record.harnesses || typeof record.harnesses !== "object") {
|
|
3910
|
+
throw new Error("invalid cache");
|
|
3911
|
+
}
|
|
3912
|
+
const harnesses = {};
|
|
3913
|
+
for (const harness of SUPPORTED_HARNESSES) {
|
|
3914
|
+
const candidate = record.harnesses[harness];
|
|
3915
|
+
if (isOutcome(candidate)) harnesses[harness] = candidate;
|
|
3916
|
+
}
|
|
3917
|
+
return { version: 1, harnesses };
|
|
3918
|
+
} catch {
|
|
3919
|
+
return { version: 1, harnesses: {} };
|
|
3920
|
+
}
|
|
3921
|
+
};
|
|
3922
|
+
var writeCache = (cachePath, harness, outcome) => {
|
|
3923
|
+
fs2.mkdirSync(path3.dirname(cachePath), { recursive: true });
|
|
3924
|
+
const cache = readCache(cachePath);
|
|
3925
|
+
const existing = cache.harnesses[harness];
|
|
3926
|
+
if (!existing || existing.observedAt <= outcome.observedAt) {
|
|
3927
|
+
cache.harnesses[harness] = {
|
|
3928
|
+
available: outcome.available,
|
|
3929
|
+
observedAt: outcome.observedAt,
|
|
3930
|
+
expiresAt: outcome.expiresAt,
|
|
3931
|
+
reason: outcome.reason
|
|
3932
|
+
};
|
|
3933
|
+
}
|
|
3934
|
+
const temporary = `${cachePath}.${process.pid}.${Math.random().toString(16).slice(2)}.tmp`;
|
|
3935
|
+
try {
|
|
3936
|
+
fs2.writeFileSync(temporary, `${JSON.stringify(cache, null, 2)}
|
|
3937
|
+
`, { mode: 384 });
|
|
3938
|
+
fs2.renameSync(temporary, cachePath);
|
|
3939
|
+
} finally {
|
|
3940
|
+
try {
|
|
3941
|
+
fs2.unlinkSync(temporary);
|
|
3942
|
+
} catch {
|
|
3943
|
+
}
|
|
3944
|
+
}
|
|
3945
|
+
};
|
|
3946
|
+
var runProbe = (command2, timeoutMs) => new Promise((resolve3) => {
|
|
3947
|
+
let settled = false;
|
|
3948
|
+
let diagnostics = "";
|
|
3949
|
+
const finish = (result) => {
|
|
3950
|
+
if (settled) return;
|
|
3951
|
+
settled = true;
|
|
3952
|
+
resolve3(result);
|
|
3953
|
+
};
|
|
3954
|
+
const child = (0, import_child_process3.spawn)(command2.executable, command2.argv, {
|
|
3955
|
+
cwd: command2.cwd,
|
|
3956
|
+
shell: false,
|
|
3957
|
+
stdio: ["pipe", "ignore", "pipe"]
|
|
3958
|
+
});
|
|
3959
|
+
const timer = setTimeout(() => {
|
|
3960
|
+
child.kill("SIGKILL");
|
|
3961
|
+
finish({ exitCode: 1, timedOut: true, detail: "Probe timed out." });
|
|
3962
|
+
}, timeoutMs);
|
|
3963
|
+
child.stderr?.on("data", (chunk) => {
|
|
3964
|
+
if (diagnostics.length < 400) diagnostics += String(chunk).slice(0, 400 - diagnostics.length);
|
|
3965
|
+
});
|
|
3966
|
+
child.once("error", (error) => {
|
|
3967
|
+
clearTimeout(timer);
|
|
3968
|
+
finish({ exitCode: 1, detail: error.message });
|
|
3969
|
+
});
|
|
3970
|
+
child.once("close", (code) => {
|
|
3971
|
+
clearTimeout(timer);
|
|
3972
|
+
finish({ exitCode: code ?? 1, detail: diagnostics });
|
|
3973
|
+
});
|
|
3974
|
+
child.stdin?.on("error", () => void 0);
|
|
3975
|
+
child.stdin?.end(command2.stdin);
|
|
3976
|
+
});
|
|
3977
|
+
var defaultDependencies = {
|
|
3978
|
+
now: Date.now,
|
|
3979
|
+
runProbe
|
|
3980
|
+
};
|
|
3981
|
+
var checkHarnessAvailability = async (request, overrides = {}) => {
|
|
3982
|
+
const active = { ...defaultDependencies, ...overrides };
|
|
3983
|
+
const now = active.now();
|
|
3984
|
+
if (request.harness === void 0 || request.harness === request.currentHarness) {
|
|
3985
|
+
return {
|
|
3986
|
+
harness: request.harness ?? request.currentHarness,
|
|
3987
|
+
available: true,
|
|
3988
|
+
observedAt: now,
|
|
3989
|
+
expiresAt: now,
|
|
3990
|
+
reason: "Native/current harness targets do not require a probe.",
|
|
3991
|
+
source: "bypass"
|
|
3992
|
+
};
|
|
3993
|
+
}
|
|
3994
|
+
const harness = request.harness;
|
|
3995
|
+
const cachePath = path3.join(request.strikethrooRoot, AVAILABILITY_CACHE_RELATIVE_PATH);
|
|
3996
|
+
const cached = readCache(cachePath).harnesses[harness];
|
|
3997
|
+
if (cached && cached.expiresAt > now) return { harness, ...cached, source: "cache" };
|
|
3998
|
+
const definition = HARNESS_AVAILABILITY_REGISTRY[harness];
|
|
3999
|
+
let probe;
|
|
3728
4000
|
try {
|
|
3729
|
-
|
|
3730
|
-
if (!parsed.matter) return { kind: "native-default" };
|
|
3731
|
-
data = parsed.data;
|
|
4001
|
+
probe = await active.runProbe(definition.buildCommand(request.workspace), PROBE_TIMEOUT_MS);
|
|
3732
4002
|
} catch (error) {
|
|
3733
|
-
|
|
3734
|
-
"invalid-frontmatter",
|
|
3735
|
-
`Task execution override was skipped: ${error instanceof Error ? error.message : "invalid YAML"}`
|
|
3736
|
-
);
|
|
4003
|
+
probe = { exitCode: 1, detail: error instanceof Error ? error.message : String(error) };
|
|
3737
4004
|
}
|
|
3738
|
-
|
|
3739
|
-
const
|
|
3740
|
-
|
|
3741
|
-
|
|
4005
|
+
const available = probe.exitCode === 0 && !probe.timedOut;
|
|
4006
|
+
const reason = available ? "Harness probe succeeded." : safeReason(
|
|
4007
|
+
probe.detail,
|
|
4008
|
+
probe.timedOut ? "Harness probe timed out." : "Harness probe failed."
|
|
4009
|
+
);
|
|
4010
|
+
const outcome = {
|
|
4011
|
+
harness,
|
|
4012
|
+
available,
|
|
4013
|
+
observedAt: now,
|
|
4014
|
+
expiresAt: now + (available ? AVAILABLE_TTL_MS : UNAVAILABLE_TTL_MS),
|
|
4015
|
+
reason,
|
|
4016
|
+
source: "probe"
|
|
4017
|
+
};
|
|
4018
|
+
try {
|
|
4019
|
+
writeCache(cachePath, harness, outcome);
|
|
4020
|
+
} catch {
|
|
3742
4021
|
}
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
4022
|
+
return outcome;
|
|
4023
|
+
};
|
|
4024
|
+
|
|
4025
|
+
// src/skill-scripts/shared/execution-routing.ts
|
|
4026
|
+
var fs3 = __toESM(require("fs"));
|
|
4027
|
+
var path4 = __toESM(require("path"));
|
|
4028
|
+
|
|
4029
|
+
// node_modules/js-yaml/dist/js-yaml.mjs
|
|
4030
|
+
var NOT_RESOLVED = /* @__PURE__ */ Symbol("NOT_RESOLVED");
|
|
4031
|
+
var MERGE_KEY = /* @__PURE__ */ Symbol("MERGE_KEY");
|
|
4032
|
+
function defineScalarTag(tagName, options2) {
|
|
4033
|
+
return {
|
|
4034
|
+
tagName,
|
|
4035
|
+
nodeKind: "scalar",
|
|
4036
|
+
implicit: options2.implicit ?? false,
|
|
4037
|
+
matchByTagPrefix: options2.matchByTagPrefix ?? false,
|
|
4038
|
+
implicitFirstChars: options2.implicitFirstChars ?? null,
|
|
4039
|
+
resolve: options2.resolve,
|
|
4040
|
+
identify: options2.identify ?? null,
|
|
4041
|
+
represent: options2.represent ?? ((data) => String(data)),
|
|
4042
|
+
representTagName: options2.representTagName ?? null
|
|
4043
|
+
};
|
|
4044
|
+
}
|
|
4045
|
+
function defineSequenceTag(tagName, options2) {
|
|
4046
|
+
const carrierIsResult = options2.finalize === void 0;
|
|
4047
|
+
return {
|
|
4048
|
+
tagName,
|
|
4049
|
+
nodeKind: "sequence",
|
|
4050
|
+
implicit: false,
|
|
4051
|
+
matchByTagPrefix: options2.matchByTagPrefix ?? false,
|
|
4052
|
+
create: options2.create,
|
|
4053
|
+
addItem: options2.addItem,
|
|
4054
|
+
finalize: options2.finalize ?? ((carrier) => carrier),
|
|
4055
|
+
carrierIsResult,
|
|
4056
|
+
identify: options2.identify ?? null,
|
|
4057
|
+
represent: options2.represent ?? ((data) => data),
|
|
4058
|
+
representTagName: options2.representTagName ?? null
|
|
4059
|
+
};
|
|
4060
|
+
}
|
|
4061
|
+
function defineMappingTag(tagName, options2) {
|
|
4062
|
+
const carrierIsResult = options2.finalize === void 0;
|
|
4063
|
+
return {
|
|
4064
|
+
tagName,
|
|
4065
|
+
nodeKind: "mapping",
|
|
4066
|
+
implicit: false,
|
|
4067
|
+
matchByTagPrefix: options2.matchByTagPrefix ?? false,
|
|
4068
|
+
create: options2.create,
|
|
4069
|
+
addPair: options2.addPair,
|
|
4070
|
+
has: options2.has,
|
|
4071
|
+
keys: options2.keys,
|
|
4072
|
+
get: options2.get,
|
|
4073
|
+
finalize: options2.finalize ?? ((carrier) => carrier),
|
|
4074
|
+
carrierIsResult,
|
|
4075
|
+
identify: options2.identify ?? null,
|
|
4076
|
+
represent: options2.represent ?? ((data) => data),
|
|
4077
|
+
representTagName: options2.representTagName ?? null
|
|
4078
|
+
};
|
|
4079
|
+
}
|
|
4080
|
+
var strTag = defineScalarTag("tag:yaml.org,2002:str", {
|
|
4081
|
+
resolve: (source) => source,
|
|
4082
|
+
identify: (data) => typeof data === "string"
|
|
4083
|
+
});
|
|
4084
|
+
var NULL_VALUES$1 = [
|
|
4085
|
+
"",
|
|
4086
|
+
"~",
|
|
4087
|
+
"null",
|
|
4088
|
+
"Null",
|
|
4089
|
+
"NULL"
|
|
4090
|
+
];
|
|
4091
|
+
var nullCoreTag = defineScalarTag("tag:yaml.org,2002:null", {
|
|
4092
|
+
implicit: true,
|
|
4093
|
+
implicitFirstChars: [
|
|
4094
|
+
"",
|
|
4095
|
+
"~",
|
|
4096
|
+
"n",
|
|
4097
|
+
"N"
|
|
4098
|
+
],
|
|
4099
|
+
resolve: (source) => {
|
|
4100
|
+
if (NULL_VALUES$1.indexOf(source) !== -1) return null;
|
|
4101
|
+
return NOT_RESOLVED;
|
|
4102
|
+
},
|
|
4103
|
+
identify: (object) => object === null,
|
|
4104
|
+
represent: () => "null"
|
|
4105
|
+
});
|
|
4106
|
+
var nullJsonTag = defineScalarTag("tag:yaml.org,2002:null", {
|
|
4107
|
+
implicit: true,
|
|
4108
|
+
implicitFirstChars: ["n"],
|
|
4109
|
+
resolve: (source, isExplicit) => {
|
|
4110
|
+
if (source === "null" || isExplicit && source === "") return null;
|
|
4111
|
+
return NOT_RESOLVED;
|
|
4112
|
+
},
|
|
4113
|
+
identify: (object) => object === null,
|
|
4114
|
+
represent: () => "null"
|
|
4115
|
+
});
|
|
4116
|
+
var NULL_VALUES = [
|
|
4117
|
+
"",
|
|
4118
|
+
"~",
|
|
4119
|
+
"null",
|
|
4120
|
+
"Null",
|
|
4121
|
+
"NULL"
|
|
4122
|
+
];
|
|
4123
|
+
var nullYaml11Tag = defineScalarTag("tag:yaml.org,2002:null", {
|
|
4124
|
+
implicit: true,
|
|
4125
|
+
implicitFirstChars: [
|
|
4126
|
+
"",
|
|
4127
|
+
"~",
|
|
4128
|
+
"n",
|
|
4129
|
+
"N"
|
|
4130
|
+
],
|
|
4131
|
+
resolve: (source) => {
|
|
4132
|
+
if (NULL_VALUES.indexOf(source) !== -1) return null;
|
|
4133
|
+
return NOT_RESOLVED;
|
|
4134
|
+
},
|
|
4135
|
+
identify: (object) => object === null,
|
|
4136
|
+
represent: () => "null"
|
|
4137
|
+
});
|
|
4138
|
+
var TRUE_VALUES$2 = [
|
|
4139
|
+
"true",
|
|
4140
|
+
"True",
|
|
4141
|
+
"TRUE"
|
|
4142
|
+
];
|
|
4143
|
+
var FALSE_VALUES$2 = [
|
|
4144
|
+
"false",
|
|
4145
|
+
"False",
|
|
4146
|
+
"FALSE"
|
|
4147
|
+
];
|
|
4148
|
+
var boolCoreTag = defineScalarTag("tag:yaml.org,2002:bool", {
|
|
4149
|
+
implicit: true,
|
|
4150
|
+
implicitFirstChars: [
|
|
4151
|
+
"t",
|
|
4152
|
+
"T",
|
|
4153
|
+
"f",
|
|
4154
|
+
"F"
|
|
4155
|
+
],
|
|
4156
|
+
resolve: (source) => {
|
|
4157
|
+
if (TRUE_VALUES$2.indexOf(source) !== -1) return true;
|
|
4158
|
+
if (FALSE_VALUES$2.indexOf(source) !== -1) return false;
|
|
4159
|
+
return NOT_RESOLVED;
|
|
4160
|
+
},
|
|
4161
|
+
identify: (object) => Object.prototype.toString.call(object) === "[object Boolean]",
|
|
4162
|
+
represent: (object) => object ? "true" : "false"
|
|
4163
|
+
});
|
|
4164
|
+
var TRUE_VALUES$1 = ["true"];
|
|
4165
|
+
var FALSE_VALUES$1 = ["false"];
|
|
4166
|
+
var boolJsonTag = defineScalarTag("tag:yaml.org,2002:bool", {
|
|
4167
|
+
implicit: true,
|
|
4168
|
+
implicitFirstChars: ["t", "f"],
|
|
4169
|
+
resolve: (source) => {
|
|
4170
|
+
if (TRUE_VALUES$1.indexOf(source) !== -1) return true;
|
|
4171
|
+
if (FALSE_VALUES$1.indexOf(source) !== -1) return false;
|
|
4172
|
+
return NOT_RESOLVED;
|
|
4173
|
+
},
|
|
4174
|
+
identify: (object) => Object.prototype.toString.call(object) === "[object Boolean]",
|
|
4175
|
+
represent: (object) => object ? "true" : "false"
|
|
4176
|
+
});
|
|
4177
|
+
var TRUE_VALUES = [
|
|
4178
|
+
"true",
|
|
4179
|
+
"True",
|
|
4180
|
+
"TRUE",
|
|
4181
|
+
"y",
|
|
4182
|
+
"Y",
|
|
4183
|
+
"yes",
|
|
4184
|
+
"Yes",
|
|
4185
|
+
"YES",
|
|
4186
|
+
"on",
|
|
4187
|
+
"On",
|
|
4188
|
+
"ON"
|
|
4189
|
+
];
|
|
4190
|
+
var FALSE_VALUES = [
|
|
4191
|
+
"false",
|
|
4192
|
+
"False",
|
|
4193
|
+
"FALSE",
|
|
4194
|
+
"n",
|
|
4195
|
+
"N",
|
|
4196
|
+
"no",
|
|
4197
|
+
"No",
|
|
4198
|
+
"NO",
|
|
4199
|
+
"off",
|
|
4200
|
+
"Off",
|
|
4201
|
+
"OFF"
|
|
4202
|
+
];
|
|
4203
|
+
var boolYaml11Tag = defineScalarTag("tag:yaml.org,2002:bool", {
|
|
4204
|
+
implicit: true,
|
|
4205
|
+
implicitFirstChars: [
|
|
4206
|
+
"y",
|
|
4207
|
+
"Y",
|
|
4208
|
+
"n",
|
|
4209
|
+
"N",
|
|
4210
|
+
"t",
|
|
4211
|
+
"T",
|
|
4212
|
+
"f",
|
|
4213
|
+
"F",
|
|
4214
|
+
"o",
|
|
4215
|
+
"O"
|
|
4216
|
+
],
|
|
4217
|
+
resolve: (source) => {
|
|
4218
|
+
if (TRUE_VALUES.indexOf(source) !== -1) return true;
|
|
4219
|
+
if (FALSE_VALUES.indexOf(source) !== -1) return false;
|
|
4220
|
+
return NOT_RESOLVED;
|
|
4221
|
+
},
|
|
4222
|
+
identify: (object) => Object.prototype.toString.call(object) === "[object Boolean]",
|
|
4223
|
+
represent: (object) => object ? "true" : "false"
|
|
4224
|
+
});
|
|
4225
|
+
var YAML_INTEGER_IMPLICIT_PATTERN$1 = /* @__PURE__ */ new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
4226
|
+
var YAML_INTEGER_EXPLICIT_PATTERN$1 = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
4227
|
+
function parseYamlInteger$2(source) {
|
|
4228
|
+
let value = source;
|
|
4229
|
+
let sign = 1;
|
|
4230
|
+
if (value[0] === "-" || value[0] === "+") {
|
|
4231
|
+
if (value[0] === "-") sign = -1;
|
|
4232
|
+
value = value.slice(1);
|
|
3746
4233
|
}
|
|
3747
|
-
if (
|
|
3748
|
-
|
|
4234
|
+
if (value.startsWith("0b")) return sign * parseInt(value.slice(2), 2);
|
|
4235
|
+
if (value.startsWith("0o")) return sign * parseInt(value.slice(2), 8);
|
|
4236
|
+
if (value.startsWith("0x")) return sign * parseInt(value.slice(2), 16);
|
|
4237
|
+
return sign * parseInt(value, 10);
|
|
4238
|
+
}
|
|
4239
|
+
function resolveYamlInteger$2(source, isExplicit) {
|
|
4240
|
+
if (isExplicit) {
|
|
4241
|
+
if (!YAML_INTEGER_EXPLICIT_PATTERN$1.test(source)) return NOT_RESOLVED;
|
|
4242
|
+
} else if (!YAML_INTEGER_IMPLICIT_PATTERN$1.test(source)) return NOT_RESOLVED;
|
|
4243
|
+
const result = parseYamlInteger$2(source);
|
|
4244
|
+
return Number.isFinite(result) ? result : NOT_RESOLVED;
|
|
4245
|
+
}
|
|
4246
|
+
var intCoreTag = defineScalarTag("tag:yaml.org,2002:int", {
|
|
4247
|
+
implicit: true,
|
|
4248
|
+
implicitFirstChars: [
|
|
4249
|
+
"-",
|
|
4250
|
+
"+",
|
|
4251
|
+
..."0123456789"
|
|
4252
|
+
],
|
|
4253
|
+
resolve: resolveYamlInteger$2,
|
|
4254
|
+
identify: (object) => Number.isInteger(object) && !Object.is(object, -0) && object.toString(10).indexOf("e") < 0,
|
|
4255
|
+
represent: (object) => object.toString(10)
|
|
4256
|
+
});
|
|
4257
|
+
var YAML_INTEGER_IMPLICIT_PATTERN = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)$");
|
|
4258
|
+
var YAML_INTEGER_EXPLICIT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
4259
|
+
function parseYamlInteger$1(source) {
|
|
4260
|
+
let value = source;
|
|
4261
|
+
let sign = 1;
|
|
4262
|
+
if (value[0] === "-" || value[0] === "+") {
|
|
4263
|
+
if (value[0] === "-") sign = -1;
|
|
4264
|
+
value = value.slice(1);
|
|
3749
4265
|
}
|
|
3750
|
-
if (
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
4266
|
+
if (value.startsWith("0b")) return sign * parseInt(value.slice(2), 2);
|
|
4267
|
+
if (value.startsWith("0o")) return sign * parseInt(value.slice(2), 8);
|
|
4268
|
+
if (value.startsWith("0x")) return sign * parseInt(value.slice(2), 16);
|
|
4269
|
+
return sign * parseInt(value, 10);
|
|
4270
|
+
}
|
|
4271
|
+
function resolveYamlInteger$1(source, isExplicit) {
|
|
4272
|
+
if (isExplicit) {
|
|
4273
|
+
if (!YAML_INTEGER_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED;
|
|
4274
|
+
} else if (!YAML_INTEGER_IMPLICIT_PATTERN.test(source)) return NOT_RESOLVED;
|
|
4275
|
+
const result = parseYamlInteger$1(source);
|
|
4276
|
+
return Number.isFinite(result) ? result : NOT_RESOLVED;
|
|
4277
|
+
}
|
|
4278
|
+
var intJsonTag = defineScalarTag("tag:yaml.org,2002:int", {
|
|
4279
|
+
implicit: true,
|
|
4280
|
+
implicitFirstChars: ["-", ..."0123456789"],
|
|
4281
|
+
resolve: resolveYamlInteger$1,
|
|
4282
|
+
identify: (object) => Number.isInteger(object) && !Object.is(object, -0) && object.toString(10).indexOf("e") < 0,
|
|
4283
|
+
represent: (object) => object.toString(10)
|
|
4284
|
+
});
|
|
4285
|
+
var YAML_INTEGER_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");
|
|
4286
|
+
function parseYamlInteger(source) {
|
|
4287
|
+
let value = source.replace(/_/g, "");
|
|
4288
|
+
let sign = 1;
|
|
4289
|
+
if (value[0] === "-" || value[0] === "+") {
|
|
4290
|
+
if (value[0] === "-") sign = -1;
|
|
4291
|
+
value = value.slice(1);
|
|
3755
4292
|
}
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
if (
|
|
3759
|
-
|
|
4293
|
+
if (value.startsWith("0b")) return sign * parseInt(value.slice(2), 2);
|
|
4294
|
+
if (value.startsWith("0x")) return sign * parseInt(value.slice(2), 16);
|
|
4295
|
+
if (value.includes(":")) {
|
|
4296
|
+
let result = 0;
|
|
4297
|
+
for (const part of value.split(":")) result = result * 60 + Number(part);
|
|
4298
|
+
return sign * result;
|
|
3760
4299
|
}
|
|
3761
|
-
if (
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
4300
|
+
if (value !== "0" && value[0] === "0") return sign * parseInt(value, 8);
|
|
4301
|
+
return sign * parseInt(value, 10);
|
|
4302
|
+
}
|
|
4303
|
+
function resolveYamlInteger(source) {
|
|
4304
|
+
if (!YAML_INTEGER_PATTERN.test(source)) return NOT_RESOLVED;
|
|
4305
|
+
const result = parseYamlInteger(source);
|
|
4306
|
+
return Number.isFinite(result) ? result : NOT_RESOLVED;
|
|
4307
|
+
}
|
|
4308
|
+
var intYaml11Tag = defineScalarTag("tag:yaml.org,2002:int", {
|
|
4309
|
+
implicit: true,
|
|
4310
|
+
implicitFirstChars: [
|
|
4311
|
+
"-",
|
|
4312
|
+
"+",
|
|
4313
|
+
..."0123456789"
|
|
4314
|
+
],
|
|
4315
|
+
resolve: resolveYamlInteger,
|
|
4316
|
+
identify: (object) => Number.isInteger(object) && !Object.is(object, -0) && object.toString(10).indexOf("e") < 0,
|
|
4317
|
+
represent: (object) => object.toString(10)
|
|
4318
|
+
});
|
|
4319
|
+
var YAML_FLOAT_PATTERN$1 = /* @__PURE__ */ new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
4320
|
+
var YAML_FLOAT_SPECIAL_PATTERN$1 = /* @__PURE__ */ new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
4321
|
+
function resolveYamlFloat$2(source) {
|
|
4322
|
+
if (!YAML_FLOAT_PATTERN$1.test(source)) return NOT_RESOLVED;
|
|
4323
|
+
let value = source.toLowerCase();
|
|
4324
|
+
const sign = value[0] === "-" ? -1 : 1;
|
|
4325
|
+
if ("+-".includes(value[0])) value = value.slice(1);
|
|
4326
|
+
if (value === ".inf") return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
4327
|
+
if (value === ".nan") return NaN;
|
|
4328
|
+
const result = sign * parseFloat(value);
|
|
4329
|
+
if (Number.isFinite(result) || YAML_FLOAT_SPECIAL_PATTERN$1.test(source)) return result;
|
|
4330
|
+
return NOT_RESOLVED;
|
|
4331
|
+
}
|
|
4332
|
+
function representYamlFloat$2(object) {
|
|
4333
|
+
if (isNaN(object)) return ".nan";
|
|
4334
|
+
if (object === Number.POSITIVE_INFINITY) return ".inf";
|
|
4335
|
+
if (object === Number.NEGATIVE_INFINITY) return "-.inf";
|
|
4336
|
+
if (Object.is(object, -0)) return "-0.0";
|
|
4337
|
+
const result = object.toString(10);
|
|
4338
|
+
return /^[-+]?[0-9]+e/.test(result) ? result.replace("e", ".e") : result;
|
|
4339
|
+
}
|
|
4340
|
+
var floatCoreTag = defineScalarTag("tag:yaml.org,2002:float", {
|
|
4341
|
+
implicit: true,
|
|
4342
|
+
implicitFirstChars: [
|
|
4343
|
+
"-",
|
|
4344
|
+
"+",
|
|
4345
|
+
".",
|
|
4346
|
+
..."0123456789"
|
|
4347
|
+
],
|
|
4348
|
+
resolve: resolveYamlFloat$2,
|
|
4349
|
+
identify: (object) => typeof object === "number" && (!Number.isInteger(object) || Object.is(object, -0) || object.toString(10).indexOf("e") >= 0),
|
|
4350
|
+
represent: representYamlFloat$2
|
|
4351
|
+
});
|
|
4352
|
+
var YAML_FLOAT_IMPLICIT_PATTERN = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$");
|
|
4353
|
+
var YAML_FLOAT_EXPLICIT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
4354
|
+
function resolveYamlFloat$1(source, isExplicit) {
|
|
4355
|
+
if (isExplicit) {
|
|
4356
|
+
if (!YAML_FLOAT_EXPLICIT_PATTERN.test(source)) return NOT_RESOLVED;
|
|
4357
|
+
let value = source.toLowerCase();
|
|
4358
|
+
const sign = value[0] === "-" ? -1 : 1;
|
|
4359
|
+
if ("+-".includes(value[0])) value = value.slice(1);
|
|
4360
|
+
if (value === ".inf") return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
4361
|
+
if (value === ".nan") return NaN;
|
|
4362
|
+
const result2 = sign * parseFloat(value);
|
|
4363
|
+
return Number.isFinite(result2) ? result2 : NOT_RESOLVED;
|
|
3766
4364
|
}
|
|
3767
|
-
if (!
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
4365
|
+
if (!YAML_FLOAT_IMPLICIT_PATTERN.test(source)) return NOT_RESOLVED;
|
|
4366
|
+
const result = Number(source);
|
|
4367
|
+
if (Number.isFinite(result)) return result;
|
|
4368
|
+
return NOT_RESOLVED;
|
|
4369
|
+
}
|
|
4370
|
+
function representYamlFloat$1(object) {
|
|
4371
|
+
if (isNaN(object)) return ".nan";
|
|
4372
|
+
if (object === Number.POSITIVE_INFINITY) return ".inf";
|
|
4373
|
+
if (object === Number.NEGATIVE_INFINITY) return "-.inf";
|
|
4374
|
+
if (Object.is(object, -0)) return "-0.0";
|
|
4375
|
+
const result = object.toString(10);
|
|
4376
|
+
return /^[-+]?[0-9]+e/.test(result) ? result.replace("e", ".e") : result;
|
|
4377
|
+
}
|
|
4378
|
+
var floatJsonTag = defineScalarTag("tag:yaml.org,2002:float", {
|
|
4379
|
+
implicit: true,
|
|
4380
|
+
implicitFirstChars: ["-", ..."0123456789"],
|
|
4381
|
+
resolve: resolveYamlFloat$1,
|
|
4382
|
+
identify: (object) => typeof object === "number" && (!Number.isInteger(object) || Object.is(object, -0) || object.toString(10).indexOf("e") >= 0),
|
|
4383
|
+
represent: representYamlFloat$1
|
|
4384
|
+
});
|
|
4385
|
+
var YAML_FLOAT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
4386
|
+
var YAML_FLOAT_SPECIAL_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
4387
|
+
function resolveYamlFloat(source) {
|
|
4388
|
+
if (!YAML_FLOAT_PATTERN.test(source)) return NOT_RESOLVED;
|
|
4389
|
+
let value = source.toLowerCase().replace(/_/g, "");
|
|
4390
|
+
const sign = value[0] === "-" ? -1 : 1;
|
|
4391
|
+
if ("+-".includes(value[0])) value = value.slice(1);
|
|
4392
|
+
if (value === ".inf") return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
4393
|
+
if (value === ".nan") return NaN;
|
|
4394
|
+
let result = 0;
|
|
4395
|
+
if (value.includes(":")) {
|
|
4396
|
+
for (const part of value.split(":")) result = result * 60 + Number(part);
|
|
4397
|
+
result *= sign;
|
|
4398
|
+
} else result = sign * parseFloat(value);
|
|
4399
|
+
if (Number.isFinite(result) || YAML_FLOAT_SPECIAL_PATTERN.test(source)) return result;
|
|
4400
|
+
return NOT_RESOLVED;
|
|
4401
|
+
}
|
|
4402
|
+
function representYamlFloat(object) {
|
|
4403
|
+
if (isNaN(object)) return ".nan";
|
|
4404
|
+
if (object === Number.POSITIVE_INFINITY) return ".inf";
|
|
4405
|
+
if (object === Number.NEGATIVE_INFINITY) return "-.inf";
|
|
4406
|
+
if (Object.is(object, -0)) return "-0.0";
|
|
4407
|
+
const result = object.toString(10);
|
|
4408
|
+
return /^[-+]?[0-9]+e/.test(result) ? result.replace("e", ".e") : result;
|
|
4409
|
+
}
|
|
4410
|
+
var floatYaml11Tag = defineScalarTag("tag:yaml.org,2002:float", {
|
|
4411
|
+
implicit: true,
|
|
4412
|
+
implicitFirstChars: [
|
|
4413
|
+
"-",
|
|
4414
|
+
"+",
|
|
4415
|
+
".",
|
|
4416
|
+
..."0123456789"
|
|
4417
|
+
],
|
|
4418
|
+
resolve: resolveYamlFloat,
|
|
4419
|
+
identify: (object) => typeof object === "number" && (!Number.isInteger(object) || Object.is(object, -0) || object.toString(10).indexOf("e") >= 0),
|
|
4420
|
+
represent: representYamlFloat
|
|
4421
|
+
});
|
|
4422
|
+
var mergeTag = defineScalarTag("tag:yaml.org,2002:merge", {
|
|
4423
|
+
implicit: true,
|
|
4424
|
+
implicitFirstChars: ["<"],
|
|
4425
|
+
resolve: (source, isExplicit) => {
|
|
4426
|
+
if (source === "<<" || isExplicit && source === "") return MERGE_KEY;
|
|
4427
|
+
return NOT_RESOLVED;
|
|
4428
|
+
}
|
|
4429
|
+
});
|
|
4430
|
+
var BASE64_PATTERN = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
4431
|
+
function resolveYamlBinary(source) {
|
|
4432
|
+
const input = source.replace(/\s/g, "");
|
|
4433
|
+
if (input.length % 4 !== 0 || !BASE64_PATTERN.test(input)) return NOT_RESOLVED;
|
|
4434
|
+
const binary = atob(input);
|
|
4435
|
+
const result = new Uint8Array(binary.length);
|
|
4436
|
+
for (let index = 0; index < binary.length; index++) result[index] = binary.charCodeAt(index);
|
|
4437
|
+
return result;
|
|
4438
|
+
}
|
|
4439
|
+
function representYamlBinary(object) {
|
|
4440
|
+
let binary = "";
|
|
4441
|
+
for (let index = 0; index < object.length; index++) binary += String.fromCharCode(object[index]);
|
|
4442
|
+
return btoa(binary);
|
|
4443
|
+
}
|
|
4444
|
+
var binaryTag = defineScalarTag("tag:yaml.org,2002:binary", {
|
|
4445
|
+
resolve: resolveYamlBinary,
|
|
4446
|
+
identify: (object) => Object.prototype.toString.call(object) === "[object Uint8Array]",
|
|
4447
|
+
represent: representYamlBinary
|
|
4448
|
+
});
|
|
4449
|
+
var YAML_DATE_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
|
|
4450
|
+
var YAML_TIMESTAMP_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
|
|
4451
|
+
function resolveYamlTimestamp(source) {
|
|
4452
|
+
let match = YAML_DATE_REGEXP.exec(source);
|
|
4453
|
+
if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(source);
|
|
4454
|
+
if (match === null) return NOT_RESOLVED;
|
|
4455
|
+
const year = +match[1];
|
|
4456
|
+
const month = +match[2] - 1;
|
|
4457
|
+
const day = +match[3];
|
|
4458
|
+
if (!match[4]) {
|
|
4459
|
+
const date2 = new Date(Date.UTC(year, month, day));
|
|
4460
|
+
if (date2.getUTCFullYear() !== year || date2.getUTCMonth() !== month || date2.getUTCDate() !== day) return NOT_RESOLVED;
|
|
4461
|
+
return date2;
|
|
4462
|
+
}
|
|
4463
|
+
const hour = +match[4];
|
|
4464
|
+
const minute = +match[5];
|
|
4465
|
+
const second = +match[6];
|
|
4466
|
+
let fraction = 0;
|
|
4467
|
+
if (hour > 23 || minute > 59 || second > 59) return NOT_RESOLVED;
|
|
4468
|
+
if (match[7]) {
|
|
4469
|
+
let value = match[7].slice(0, 3);
|
|
4470
|
+
while (value.length < 3) value += "0";
|
|
4471
|
+
fraction = +value;
|
|
4472
|
+
}
|
|
4473
|
+
const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
4474
|
+
if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month || date.getUTCDate() !== day) return NOT_RESOLVED;
|
|
4475
|
+
if (match[9]) {
|
|
4476
|
+
const offsetHour = +match[10];
|
|
4477
|
+
const offsetMinute = +(match[11] || 0);
|
|
4478
|
+
if (offsetHour > 23 || offsetMinute > 59) return NOT_RESOLVED;
|
|
4479
|
+
const offset = (offsetHour * 60 + offsetMinute) * 6e4;
|
|
4480
|
+
date.setTime(date.getTime() - (match[9] === "-" ? -offset : offset));
|
|
4481
|
+
}
|
|
4482
|
+
return date;
|
|
4483
|
+
}
|
|
4484
|
+
var timestampTag = defineScalarTag("tag:yaml.org,2002:timestamp", {
|
|
4485
|
+
implicit: true,
|
|
4486
|
+
implicitFirstChars: [..."0123456789"],
|
|
4487
|
+
resolve: resolveYamlTimestamp,
|
|
4488
|
+
identify: (object) => object instanceof Date,
|
|
4489
|
+
represent: (object) => object.toISOString()
|
|
4490
|
+
});
|
|
4491
|
+
var seqTag = defineSequenceTag("tag:yaml.org,2002:seq", {
|
|
4492
|
+
create: () => [],
|
|
4493
|
+
addItem: (container, item) => {
|
|
4494
|
+
container.push(item);
|
|
4495
|
+
},
|
|
4496
|
+
identify: Array.isArray
|
|
4497
|
+
});
|
|
4498
|
+
function isPlainObject(data) {
|
|
4499
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) return false;
|
|
4500
|
+
const prototype = Object.getPrototypeOf(data);
|
|
4501
|
+
return prototype === null || prototype === Object.prototype;
|
|
4502
|
+
}
|
|
4503
|
+
function pick(object, keys) {
|
|
4504
|
+
const result = {};
|
|
4505
|
+
for (const key of keys) if (object[key] !== void 0) result[key] = object[key];
|
|
4506
|
+
return result;
|
|
4507
|
+
}
|
|
4508
|
+
var omapTag = defineSequenceTag("tag:yaml.org,2002:omap", {
|
|
4509
|
+
create: () => ({
|
|
4510
|
+
list: [],
|
|
4511
|
+
seen: /* @__PURE__ */ new Set()
|
|
4512
|
+
}),
|
|
4513
|
+
addItem: (carrier, item) => {
|
|
4514
|
+
let key;
|
|
4515
|
+
if (item instanceof Map) {
|
|
4516
|
+
if (item.size !== 1) return "cannot resolve an ordered map item";
|
|
4517
|
+
key = item.keys().next().value;
|
|
4518
|
+
} else if (isPlainObject(item)) {
|
|
4519
|
+
const itemKeys = Object.keys(item);
|
|
4520
|
+
if (itemKeys.length !== 1) return "cannot resolve an ordered map item";
|
|
4521
|
+
key = itemKeys[0];
|
|
4522
|
+
} else return "cannot resolve an ordered map item";
|
|
4523
|
+
if (carrier.seen.has(key)) return "duplicate key in ordered map";
|
|
4524
|
+
carrier.seen.add(key);
|
|
4525
|
+
carrier.list.push(item);
|
|
4526
|
+
return "";
|
|
4527
|
+
},
|
|
4528
|
+
finalize: (carrier) => carrier.list
|
|
4529
|
+
});
|
|
4530
|
+
var pairsTag = defineSequenceTag("tag:yaml.org,2002:pairs", {
|
|
4531
|
+
create: () => [],
|
|
4532
|
+
addItem: (container, item) => {
|
|
4533
|
+
if (item instanceof Map) {
|
|
4534
|
+
if (item.size !== 1) return "cannot resolve a pairs item";
|
|
4535
|
+
container.push(item.entries().next().value);
|
|
4536
|
+
return "";
|
|
4537
|
+
}
|
|
4538
|
+
if (Object.prototype.toString.call(item) !== "[object Object]") return "cannot resolve a pairs item";
|
|
4539
|
+
const object = item;
|
|
4540
|
+
const keys = Object.keys(object);
|
|
4541
|
+
if (keys.length !== 1) return "cannot resolve a pairs item";
|
|
4542
|
+
container.push([keys[0], object[keys[0]]]);
|
|
4543
|
+
return "";
|
|
4544
|
+
}
|
|
4545
|
+
});
|
|
4546
|
+
var mapTag = defineMappingTag("tag:yaml.org,2002:map", {
|
|
4547
|
+
create: () => ({}),
|
|
4548
|
+
identify: isPlainObject,
|
|
4549
|
+
represent: (o) => {
|
|
4550
|
+
const map = /* @__PURE__ */ new Map();
|
|
4551
|
+
for (const key of Object.keys(o)) map.set(key, o[key]);
|
|
4552
|
+
return map;
|
|
4553
|
+
},
|
|
4554
|
+
addPair: (container, key, value) => {
|
|
4555
|
+
if (key !== null && typeof key === "object") return "object-based map does not support complex keys";
|
|
4556
|
+
const normalizedKey = String(key);
|
|
4557
|
+
if (normalizedKey === "__proto__") Object.defineProperty(container, normalizedKey, {
|
|
4558
|
+
value,
|
|
4559
|
+
enumerable: true,
|
|
4560
|
+
configurable: true,
|
|
4561
|
+
writable: true
|
|
4562
|
+
});
|
|
4563
|
+
else container[normalizedKey] = value;
|
|
4564
|
+
return "";
|
|
4565
|
+
},
|
|
4566
|
+
has: (container, key) => {
|
|
4567
|
+
if (key !== null && typeof key === "object") return false;
|
|
4568
|
+
return Object.prototype.hasOwnProperty.call(container, String(key));
|
|
4569
|
+
},
|
|
4570
|
+
keys: (container) => Object.keys(container),
|
|
4571
|
+
get: (container, key) => container[String(key)]
|
|
4572
|
+
});
|
|
4573
|
+
var setTag = defineMappingTag("tag:yaml.org,2002:set", {
|
|
4574
|
+
create: () => /* @__PURE__ */ new Set(),
|
|
4575
|
+
identify: (data) => data instanceof Set,
|
|
4576
|
+
represent: (data) => {
|
|
4577
|
+
const map = /* @__PURE__ */ new Map();
|
|
4578
|
+
for (const key of data) map.set(key, null);
|
|
4579
|
+
return map;
|
|
4580
|
+
},
|
|
4581
|
+
addPair: (container, key, value) => {
|
|
4582
|
+
if (value !== null) return "cannot resolve a set item";
|
|
4583
|
+
container.add(key);
|
|
4584
|
+
return "";
|
|
4585
|
+
},
|
|
4586
|
+
has: (container, key) => container.has(key),
|
|
4587
|
+
keys: (container) => container.keys(),
|
|
4588
|
+
get: () => null
|
|
4589
|
+
});
|
|
4590
|
+
function createTagDefinitionMap() {
|
|
4591
|
+
return {
|
|
4592
|
+
scalar: {},
|
|
4593
|
+
sequence: {},
|
|
4594
|
+
mapping: {}
|
|
4595
|
+
};
|
|
4596
|
+
}
|
|
4597
|
+
function createTagDefinitionListMap() {
|
|
4598
|
+
return {
|
|
4599
|
+
scalar: [],
|
|
4600
|
+
sequence: [],
|
|
4601
|
+
mapping: []
|
|
4602
|
+
};
|
|
4603
|
+
}
|
|
4604
|
+
function compileTags(tags) {
|
|
4605
|
+
const result = [];
|
|
4606
|
+
for (const tag of tags) {
|
|
4607
|
+
let index = result.length;
|
|
4608
|
+
for (let previousIndex = 0; previousIndex < result.length; previousIndex++) {
|
|
4609
|
+
const previous = result[previousIndex];
|
|
4610
|
+
if (previous.nodeKind === tag.nodeKind && previous.tagName === tag.tagName && previous.matchByTagPrefix === tag.matchByTagPrefix) {
|
|
4611
|
+
index = previousIndex;
|
|
4612
|
+
break;
|
|
4613
|
+
}
|
|
4614
|
+
}
|
|
4615
|
+
result[index] = tag;
|
|
4616
|
+
}
|
|
4617
|
+
return result;
|
|
4618
|
+
}
|
|
4619
|
+
var Schema = class Schema2 {
|
|
4620
|
+
tags;
|
|
4621
|
+
implicitScalarTags;
|
|
4622
|
+
implicitScalarByFirstChar;
|
|
4623
|
+
implicitScalarAnyFirstChar;
|
|
4624
|
+
defaultScalarTag;
|
|
4625
|
+
defaultSequenceTag;
|
|
4626
|
+
defaultMappingTag;
|
|
4627
|
+
exact;
|
|
4628
|
+
prefix;
|
|
4629
|
+
constructor(tags) {
|
|
4630
|
+
const compiledTags = compileTags(tags);
|
|
4631
|
+
const implicitScalarTags = [];
|
|
4632
|
+
const exact = createTagDefinitionMap();
|
|
4633
|
+
const prefix = createTagDefinitionListMap();
|
|
4634
|
+
for (const tag of compiledTags) {
|
|
4635
|
+
if (tag.nodeKind === "scalar" && tag.implicit) {
|
|
4636
|
+
if (tag.matchByTagPrefix) throw new Error("Implicit scalar tags cannot match by tag prefix");
|
|
4637
|
+
implicitScalarTags.push(tag);
|
|
4638
|
+
}
|
|
4639
|
+
switch (tag.nodeKind) {
|
|
4640
|
+
case "scalar":
|
|
4641
|
+
if (tag.matchByTagPrefix) prefix.scalar.push(tag);
|
|
4642
|
+
else exact.scalar[tag.tagName] = tag;
|
|
4643
|
+
break;
|
|
4644
|
+
case "sequence":
|
|
4645
|
+
if (tag.matchByTagPrefix) prefix.sequence.push(tag);
|
|
4646
|
+
else exact.sequence[tag.tagName] = tag;
|
|
4647
|
+
break;
|
|
4648
|
+
case "mapping":
|
|
4649
|
+
if (tag.matchByTagPrefix) prefix.mapping.push(tag);
|
|
4650
|
+
else exact.mapping[tag.tagName] = tag;
|
|
4651
|
+
break;
|
|
4652
|
+
}
|
|
4653
|
+
}
|
|
4654
|
+
const implicitScalarAnyFirstChar = implicitScalarTags.filter((tag) => tag.implicitFirstChars === null);
|
|
4655
|
+
const keys = /* @__PURE__ */ new Set();
|
|
4656
|
+
for (const tag of implicitScalarTags) if (tag.implicitFirstChars !== null) for (const key of tag.implicitFirstChars) keys.add(key);
|
|
4657
|
+
const implicitScalarByFirstChar = /* @__PURE__ */ new Map();
|
|
4658
|
+
for (const key of keys) implicitScalarByFirstChar.set(key, implicitScalarTags.filter((tag) => tag.implicitFirstChars === null || tag.implicitFirstChars.indexOf(key) !== -1));
|
|
4659
|
+
const defaultScalarTag = exact.scalar["tag:yaml.org,2002:str"];
|
|
4660
|
+
if (!defaultScalarTag) throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");
|
|
4661
|
+
this.tags = compiledTags;
|
|
4662
|
+
this.implicitScalarTags = implicitScalarTags;
|
|
4663
|
+
this.implicitScalarByFirstChar = implicitScalarByFirstChar;
|
|
4664
|
+
this.implicitScalarAnyFirstChar = implicitScalarAnyFirstChar;
|
|
4665
|
+
this.defaultScalarTag = defaultScalarTag;
|
|
4666
|
+
this.defaultSequenceTag = exact.sequence["tag:yaml.org,2002:seq"];
|
|
4667
|
+
this.defaultMappingTag = exact.mapping["tag:yaml.org,2002:map"];
|
|
4668
|
+
this.exact = exact;
|
|
4669
|
+
this.prefix = prefix;
|
|
4670
|
+
}
|
|
4671
|
+
withTags(...tags) {
|
|
4672
|
+
let flatTags = [];
|
|
4673
|
+
for (const tag of tags) flatTags = flatTags.concat(tag);
|
|
4674
|
+
return new Schema2([...this.tags, ...flatTags]);
|
|
4675
|
+
}
|
|
4676
|
+
};
|
|
4677
|
+
var FAILSAFE_SCHEMA = new Schema([
|
|
4678
|
+
strTag,
|
|
4679
|
+
seqTag,
|
|
4680
|
+
mapTag
|
|
4681
|
+
]);
|
|
4682
|
+
var JSON_SCHEMA = new Schema([
|
|
4683
|
+
...FAILSAFE_SCHEMA.tags,
|
|
4684
|
+
nullJsonTag,
|
|
4685
|
+
boolJsonTag,
|
|
4686
|
+
intJsonTag,
|
|
4687
|
+
floatJsonTag
|
|
4688
|
+
]);
|
|
4689
|
+
var CORE_SCHEMA = new Schema([
|
|
4690
|
+
...FAILSAFE_SCHEMA.tags,
|
|
4691
|
+
nullCoreTag,
|
|
4692
|
+
boolCoreTag,
|
|
4693
|
+
intCoreTag,
|
|
4694
|
+
floatCoreTag
|
|
4695
|
+
]);
|
|
4696
|
+
var YAML11_SCHEMA = new Schema([
|
|
4697
|
+
...FAILSAFE_SCHEMA.tags,
|
|
4698
|
+
nullYaml11Tag,
|
|
4699
|
+
boolYaml11Tag,
|
|
4700
|
+
intYaml11Tag,
|
|
4701
|
+
floatYaml11Tag,
|
|
4702
|
+
timestampTag,
|
|
4703
|
+
mergeTag,
|
|
4704
|
+
binaryTag,
|
|
4705
|
+
omapTag,
|
|
4706
|
+
pairsTag,
|
|
4707
|
+
setTag
|
|
4708
|
+
]);
|
|
4709
|
+
var realMapTag = defineMappingTag("tag:yaml.org,2002:map", {
|
|
4710
|
+
create: () => /* @__PURE__ */ new Map(),
|
|
4711
|
+
addPair: (container, key, value) => {
|
|
4712
|
+
container.set(key, value);
|
|
4713
|
+
return "";
|
|
4714
|
+
},
|
|
4715
|
+
has: (container, key) => container.has(key),
|
|
4716
|
+
keys: (container) => container.keys(),
|
|
4717
|
+
get: (container, key) => container.get(key),
|
|
4718
|
+
identify: (data) => data instanceof Map || isPlainObject(data),
|
|
4719
|
+
represent: (data) => {
|
|
4720
|
+
if (data instanceof Map) return data;
|
|
4721
|
+
const map = /* @__PURE__ */ new Map();
|
|
4722
|
+
const obj = data;
|
|
4723
|
+
for (const key of Object.keys(obj)) map.set(key, obj[key]);
|
|
4724
|
+
return map;
|
|
4725
|
+
}
|
|
4726
|
+
});
|
|
4727
|
+
function normalizeKey(key) {
|
|
4728
|
+
if (Array.isArray(key)) {
|
|
4729
|
+
const array = Array.prototype.slice.call(key);
|
|
4730
|
+
for (let index = 0; index < array.length; index++) {
|
|
4731
|
+
if (Array.isArray(array[index])) return null;
|
|
4732
|
+
if (typeof array[index] === "object" && Object.prototype.toString.call(array[index]) === "[object Object]") array[index] = "[object Object]";
|
|
4733
|
+
}
|
|
4734
|
+
return String(array);
|
|
4735
|
+
}
|
|
4736
|
+
if (typeof key === "object" && Object.prototype.toString.call(key) === "[object Object]") return "[object Object]";
|
|
4737
|
+
return String(key);
|
|
4738
|
+
}
|
|
4739
|
+
var legacyMapTag = defineMappingTag("tag:yaml.org,2002:map", {
|
|
4740
|
+
create: () => ({}),
|
|
4741
|
+
identify: isPlainObject,
|
|
4742
|
+
represent: (o) => {
|
|
4743
|
+
const map = /* @__PURE__ */ new Map();
|
|
4744
|
+
for (const key of Object.keys(o)) map.set(key, o[key]);
|
|
4745
|
+
return map;
|
|
4746
|
+
},
|
|
4747
|
+
addPair: (container, key, value) => {
|
|
4748
|
+
const normalizedKey = normalizeKey(key);
|
|
4749
|
+
if (normalizedKey === null) return "nested arrays are not supported inside keys";
|
|
4750
|
+
if (normalizedKey === "__proto__") Object.defineProperty(container, normalizedKey, {
|
|
4751
|
+
value,
|
|
4752
|
+
enumerable: true,
|
|
4753
|
+
configurable: true,
|
|
4754
|
+
writable: true
|
|
4755
|
+
});
|
|
4756
|
+
else container[normalizedKey] = value;
|
|
4757
|
+
return "";
|
|
4758
|
+
},
|
|
4759
|
+
has: (container, key) => {
|
|
4760
|
+
const normalizedKey = normalizeKey(key);
|
|
4761
|
+
return normalizedKey !== null && Object.prototype.hasOwnProperty.call(container, normalizedKey);
|
|
4762
|
+
},
|
|
4763
|
+
keys: (container) => Object.keys(container),
|
|
4764
|
+
get: (container, key) => container[String(key)]
|
|
4765
|
+
});
|
|
4766
|
+
var DEFAULT_SNIPPET_OPTIONS = {
|
|
4767
|
+
maxLength: 79,
|
|
4768
|
+
indent: 1,
|
|
4769
|
+
linesBefore: 3,
|
|
4770
|
+
linesAfter: 2
|
|
4771
|
+
};
|
|
4772
|
+
function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
|
|
4773
|
+
let head = "";
|
|
4774
|
+
let tail = "";
|
|
4775
|
+
const maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
|
4776
|
+
if (position - lineStart > maxHalfLength) {
|
|
4777
|
+
head = " ... ";
|
|
4778
|
+
lineStart = position - maxHalfLength + head.length;
|
|
4779
|
+
}
|
|
4780
|
+
if (lineEnd - position > maxHalfLength) {
|
|
4781
|
+
tail = " ...";
|
|
4782
|
+
lineEnd = position + maxHalfLength - tail.length;
|
|
4783
|
+
}
|
|
4784
|
+
return {
|
|
4785
|
+
str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
|
|
4786
|
+
pos: position - lineStart + head.length
|
|
4787
|
+
};
|
|
4788
|
+
}
|
|
4789
|
+
function padStart(string, max) {
|
|
4790
|
+
return " ".repeat(Math.max(max - string.length, 0)) + string;
|
|
4791
|
+
}
|
|
4792
|
+
function makeSnippet(mark, options2) {
|
|
4793
|
+
if (!mark.buffer) return null;
|
|
4794
|
+
const opts = {
|
|
4795
|
+
...DEFAULT_SNIPPET_OPTIONS,
|
|
4796
|
+
...options2
|
|
4797
|
+
};
|
|
4798
|
+
const re = /\r?\n|\r|\0/g;
|
|
4799
|
+
const lineStarts = [0];
|
|
4800
|
+
const lineEnds = [];
|
|
4801
|
+
let match;
|
|
4802
|
+
let foundLineNo = -1;
|
|
4803
|
+
while (match = re.exec(mark.buffer)) {
|
|
4804
|
+
lineEnds.push(match.index);
|
|
4805
|
+
lineStarts.push(match.index + match[0].length);
|
|
4806
|
+
if (mark.position <= match.index && foundLineNo < 0) foundLineNo = lineStarts.length - 2;
|
|
4807
|
+
}
|
|
4808
|
+
if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
|
|
4809
|
+
let result = "";
|
|
4810
|
+
const lineNoLength = Math.min(mark.line + opts.linesAfter, lineEnds.length).toString().length;
|
|
4811
|
+
const maxLineLength = opts.maxLength - (opts.indent + lineNoLength + 3);
|
|
4812
|
+
for (let i = 1; i <= opts.linesBefore; i++) {
|
|
4813
|
+
if (foundLineNo - i < 0) break;
|
|
4814
|
+
const line2 = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
|
|
4815
|
+
result = `${" ".repeat(opts.indent)}${padStart((mark.line - i + 1).toString(), lineNoLength)} | ${line2.str}
|
|
4816
|
+
${result}`;
|
|
4817
|
+
}
|
|
4818
|
+
const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
|
4819
|
+
result += `${" ".repeat(opts.indent)}${padStart((mark.line + 1).toString(), lineNoLength)} | ${line.str}
|
|
4820
|
+
`;
|
|
4821
|
+
result += `${"-".repeat(opts.indent + lineNoLength + 3 + line.pos)}^
|
|
4822
|
+
`;
|
|
4823
|
+
for (let i = 1; i <= opts.linesAfter; i++) {
|
|
4824
|
+
if (foundLineNo + i >= lineEnds.length) break;
|
|
4825
|
+
const line2 = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
|
|
4826
|
+
result += `${" ".repeat(opts.indent)}${padStart((mark.line + i + 1).toString(), lineNoLength)} | ${line2.str}
|
|
4827
|
+
`;
|
|
4828
|
+
}
|
|
4829
|
+
return result.replace(/\n$/, "");
|
|
4830
|
+
}
|
|
4831
|
+
function formatError(exception, compact) {
|
|
4832
|
+
let where = "";
|
|
4833
|
+
if (!exception.mark) return exception.reason;
|
|
4834
|
+
if (exception.mark.name) where += `in "${exception.mark.name}" `;
|
|
4835
|
+
where += `(${exception.mark.line + 1}:${exception.mark.column + 1})`;
|
|
4836
|
+
if (!compact && exception.mark.snippet) where += `
|
|
4837
|
+
|
|
4838
|
+
${exception.mark.snippet}`;
|
|
4839
|
+
return `${exception.reason} ${where}`;
|
|
4840
|
+
}
|
|
4841
|
+
var YAMLException = class extends Error {
|
|
4842
|
+
reason;
|
|
4843
|
+
mark;
|
|
4844
|
+
constructor(reason, mark) {
|
|
4845
|
+
super();
|
|
4846
|
+
this.name = "YAMLException";
|
|
4847
|
+
this.reason = reason;
|
|
4848
|
+
this.mark = mark;
|
|
4849
|
+
this.message = formatError(this, false);
|
|
4850
|
+
if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
|
|
4851
|
+
}
|
|
4852
|
+
toString(compact) {
|
|
4853
|
+
return `${this.name}: ${formatError(this, compact)}`;
|
|
4854
|
+
}
|
|
4855
|
+
};
|
|
4856
|
+
function throwErrorAt(source, position, message, filename = "") {
|
|
4857
|
+
let line = 0;
|
|
4858
|
+
let lineStart = 0;
|
|
4859
|
+
for (let index = 0; index < position; index++) {
|
|
4860
|
+
const ch = source.charCodeAt(index);
|
|
4861
|
+
if (ch === 10) {
|
|
4862
|
+
line++;
|
|
4863
|
+
lineStart = index + 1;
|
|
4864
|
+
} else if (ch === 13) {
|
|
4865
|
+
line++;
|
|
4866
|
+
if (source.charCodeAt(index + 1) === 10) index++;
|
|
4867
|
+
lineStart = index + 1;
|
|
4868
|
+
}
|
|
4869
|
+
}
|
|
4870
|
+
const mark = {
|
|
4871
|
+
name: filename,
|
|
4872
|
+
buffer: source,
|
|
4873
|
+
position,
|
|
4874
|
+
line,
|
|
4875
|
+
column: position - lineStart
|
|
4876
|
+
};
|
|
4877
|
+
mark.snippet = makeSnippet(mark);
|
|
4878
|
+
throw new YAMLException(message, mark);
|
|
4879
|
+
}
|
|
4880
|
+
var NO_RANGE$3 = -1;
|
|
4881
|
+
function simpleEscapeSequence(c) {
|
|
4882
|
+
switch (c) {
|
|
4883
|
+
case 48:
|
|
4884
|
+
return "\0";
|
|
4885
|
+
case 97:
|
|
4886
|
+
return "\x07";
|
|
4887
|
+
case 98:
|
|
4888
|
+
return "\b";
|
|
4889
|
+
case 116:
|
|
4890
|
+
return " ";
|
|
4891
|
+
case 9:
|
|
4892
|
+
return " ";
|
|
4893
|
+
case 110:
|
|
4894
|
+
return "\n";
|
|
4895
|
+
case 118:
|
|
4896
|
+
return "\v";
|
|
4897
|
+
case 102:
|
|
4898
|
+
return "\f";
|
|
4899
|
+
case 114:
|
|
4900
|
+
return "\r";
|
|
4901
|
+
case 101:
|
|
4902
|
+
return "\x1B";
|
|
4903
|
+
case 32:
|
|
4904
|
+
return " ";
|
|
4905
|
+
case 34:
|
|
4906
|
+
return '"';
|
|
4907
|
+
case 47:
|
|
4908
|
+
return "/";
|
|
4909
|
+
case 92:
|
|
4910
|
+
return "\\";
|
|
4911
|
+
case 78:
|
|
4912
|
+
return "\x85";
|
|
4913
|
+
case 95:
|
|
4914
|
+
return "\xA0";
|
|
4915
|
+
case 76:
|
|
4916
|
+
return "\u2028";
|
|
4917
|
+
case 80:
|
|
4918
|
+
return "\u2029";
|
|
4919
|
+
default:
|
|
4920
|
+
return "";
|
|
4921
|
+
}
|
|
4922
|
+
}
|
|
4923
|
+
var simpleEscapeCheck = new Array(256);
|
|
4924
|
+
var simpleEscapeMap = new Array(256);
|
|
4925
|
+
for (let i = 0; i < 256; i++) {
|
|
4926
|
+
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
|
4927
|
+
simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
4928
|
+
}
|
|
4929
|
+
function charFromCodepoint(c) {
|
|
4930
|
+
if (c <= 65535) return String.fromCharCode(c);
|
|
4931
|
+
return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
|
|
4932
|
+
}
|
|
4933
|
+
function fromHexCode$1(c) {
|
|
4934
|
+
if (c >= 48 && c <= 57) return c - 48;
|
|
4935
|
+
return (c | 32) - 97 + 10;
|
|
4936
|
+
}
|
|
4937
|
+
function escapedHexLen$1(c) {
|
|
4938
|
+
if (c === 120) return 2;
|
|
4939
|
+
if (c === 117) return 4;
|
|
4940
|
+
return 8;
|
|
4941
|
+
}
|
|
4942
|
+
function skipFoldedBreaks(input, position, end) {
|
|
4943
|
+
let breaks = 0;
|
|
4944
|
+
while (position < end) {
|
|
4945
|
+
const ch = input.charCodeAt(position);
|
|
4946
|
+
if (ch === 10) {
|
|
4947
|
+
breaks++;
|
|
4948
|
+
position++;
|
|
4949
|
+
} else if (ch === 13) {
|
|
4950
|
+
breaks++;
|
|
4951
|
+
position++;
|
|
4952
|
+
if (input.charCodeAt(position) === 10) position++;
|
|
4953
|
+
} else if (ch === 32 || ch === 9) position++;
|
|
4954
|
+
else break;
|
|
4955
|
+
}
|
|
4956
|
+
return {
|
|
4957
|
+
position,
|
|
4958
|
+
breaks
|
|
4959
|
+
};
|
|
4960
|
+
}
|
|
4961
|
+
function foldedBreaks(count) {
|
|
4962
|
+
if (count === 1) return " ";
|
|
4963
|
+
return "\n".repeat(count - 1);
|
|
4964
|
+
}
|
|
4965
|
+
function getPlainValue(input, start, end) {
|
|
4966
|
+
let result = "";
|
|
4967
|
+
let position = start;
|
|
4968
|
+
let captureStart = start;
|
|
4969
|
+
let captureEnd = start;
|
|
4970
|
+
while (position < end) {
|
|
4971
|
+
const ch = input.charCodeAt(position);
|
|
4972
|
+
if (ch === 10 || ch === 13) {
|
|
4973
|
+
result += input.slice(captureStart, captureEnd);
|
|
4974
|
+
const fold = skipFoldedBreaks(input, position, end);
|
|
4975
|
+
result += foldedBreaks(fold.breaks);
|
|
4976
|
+
position = captureStart = captureEnd = fold.position;
|
|
4977
|
+
} else {
|
|
4978
|
+
position++;
|
|
4979
|
+
if (ch !== 32 && ch !== 9) captureEnd = position;
|
|
4980
|
+
}
|
|
4981
|
+
}
|
|
4982
|
+
return result + input.slice(captureStart, captureEnd);
|
|
4983
|
+
}
|
|
4984
|
+
function getSingleQuotedValue(input, start, end) {
|
|
4985
|
+
let result = "";
|
|
4986
|
+
let position = start;
|
|
4987
|
+
let captureStart = start;
|
|
4988
|
+
let captureEnd = start;
|
|
4989
|
+
while (position < end) {
|
|
4990
|
+
const ch = input.charCodeAt(position);
|
|
4991
|
+
if (ch === 39) {
|
|
4992
|
+
result += input.slice(captureStart, position) + "'";
|
|
4993
|
+
position += 2;
|
|
4994
|
+
captureStart = captureEnd = position;
|
|
4995
|
+
} else if (ch === 10 || ch === 13) {
|
|
4996
|
+
result += input.slice(captureStart, captureEnd);
|
|
4997
|
+
const fold = skipFoldedBreaks(input, position, end);
|
|
4998
|
+
result += foldedBreaks(fold.breaks);
|
|
4999
|
+
position = captureStart = captureEnd = fold.position;
|
|
5000
|
+
} else {
|
|
5001
|
+
position++;
|
|
5002
|
+
if (ch !== 32 && ch !== 9) captureEnd = position;
|
|
5003
|
+
}
|
|
5004
|
+
}
|
|
5005
|
+
return result + input.slice(captureStart, end);
|
|
5006
|
+
}
|
|
5007
|
+
function getDoubleQuotedValue(input, start, end) {
|
|
5008
|
+
let result = "";
|
|
5009
|
+
let position = start;
|
|
5010
|
+
let captureStart = start;
|
|
5011
|
+
let captureEnd = start;
|
|
5012
|
+
while (position < end) {
|
|
5013
|
+
const ch = input.charCodeAt(position);
|
|
5014
|
+
if (ch === 92) {
|
|
5015
|
+
result += input.slice(captureStart, position);
|
|
5016
|
+
position++;
|
|
5017
|
+
const escaped = input.charCodeAt(position);
|
|
5018
|
+
if (escaped === 10 || escaped === 13) position = skipFoldedBreaks(input, position, end).position;
|
|
5019
|
+
else if (escaped < 256 && simpleEscapeCheck[escaped]) {
|
|
5020
|
+
result += simpleEscapeMap[escaped];
|
|
5021
|
+
position++;
|
|
5022
|
+
} else {
|
|
5023
|
+
let hexLength = escapedHexLen$1(escaped);
|
|
5024
|
+
let hexResult = 0;
|
|
5025
|
+
for (; hexLength > 0; hexLength--) {
|
|
5026
|
+
position++;
|
|
5027
|
+
const digit = fromHexCode$1(input.charCodeAt(position));
|
|
5028
|
+
hexResult = (hexResult << 4) + digit;
|
|
5029
|
+
}
|
|
5030
|
+
result += charFromCodepoint(hexResult);
|
|
5031
|
+
position++;
|
|
5032
|
+
}
|
|
5033
|
+
captureStart = captureEnd = position;
|
|
5034
|
+
} else if (ch === 10 || ch === 13) {
|
|
5035
|
+
result += input.slice(captureStart, captureEnd);
|
|
5036
|
+
const fold = skipFoldedBreaks(input, position, end);
|
|
5037
|
+
result += foldedBreaks(fold.breaks);
|
|
5038
|
+
position = captureStart = captureEnd = fold.position;
|
|
5039
|
+
} else {
|
|
5040
|
+
position++;
|
|
5041
|
+
if (ch !== 32 && ch !== 9) captureEnd = position;
|
|
5042
|
+
}
|
|
5043
|
+
}
|
|
5044
|
+
return result + input.slice(captureStart, end);
|
|
5045
|
+
}
|
|
5046
|
+
function getBlockValue(input, start, end, indent, chomping, folded) {
|
|
5047
|
+
const textIndent = indent < 0 ? 0 : indent;
|
|
5048
|
+
const region = input.slice(start, end).replace(/\r\n?/g, "\n");
|
|
5049
|
+
const lines = region === "" ? [] : (region.endsWith("\n") ? region.slice(0, -1) : region).split("\n");
|
|
5050
|
+
let result = "";
|
|
5051
|
+
let didReadContent = false;
|
|
5052
|
+
let emptyLines = 0;
|
|
5053
|
+
let atMoreIndented = false;
|
|
5054
|
+
for (const line of lines) {
|
|
5055
|
+
let column = 0;
|
|
5056
|
+
while (column < textIndent && line.charCodeAt(column) === 32) column++;
|
|
5057
|
+
if (indent < 0 || column >= line.length) {
|
|
5058
|
+
emptyLines++;
|
|
5059
|
+
continue;
|
|
5060
|
+
}
|
|
5061
|
+
const content = line.slice(textIndent);
|
|
5062
|
+
const first = content.charCodeAt(0);
|
|
5063
|
+
if (folded) if (first === 32 || first === 9) {
|
|
5064
|
+
atMoreIndented = true;
|
|
5065
|
+
result += "\n".repeat(didReadContent ? 1 + emptyLines : emptyLines);
|
|
5066
|
+
} else if (atMoreIndented) {
|
|
5067
|
+
atMoreIndented = false;
|
|
5068
|
+
result += "\n".repeat(emptyLines + 1);
|
|
5069
|
+
} else if (emptyLines === 0) {
|
|
5070
|
+
if (didReadContent) result += " ";
|
|
5071
|
+
} else result += "\n".repeat(emptyLines);
|
|
5072
|
+
else result += "\n".repeat(didReadContent ? 1 + emptyLines : emptyLines);
|
|
5073
|
+
result += content;
|
|
5074
|
+
didReadContent = true;
|
|
5075
|
+
emptyLines = 0;
|
|
5076
|
+
}
|
|
5077
|
+
if (chomping === 3) result += "\n".repeat(didReadContent ? 1 + emptyLines : emptyLines);
|
|
5078
|
+
else if (chomping !== 2) {
|
|
5079
|
+
if (didReadContent) result += "\n";
|
|
5080
|
+
}
|
|
5081
|
+
return result;
|
|
5082
|
+
}
|
|
5083
|
+
function getScalarValue(input, scalar) {
|
|
5084
|
+
if (scalar.valueStart === NO_RANGE$3) return "";
|
|
5085
|
+
const { valueStart, valueEnd } = scalar;
|
|
5086
|
+
if (scalar.fast) return input.slice(valueStart, valueEnd);
|
|
5087
|
+
switch (scalar.style) {
|
|
5088
|
+
case 2:
|
|
5089
|
+
return getSingleQuotedValue(input, valueStart, valueEnd);
|
|
5090
|
+
case 3:
|
|
5091
|
+
return getDoubleQuotedValue(input, valueStart, valueEnd);
|
|
5092
|
+
case 4:
|
|
5093
|
+
return getBlockValue(input, valueStart, valueEnd, scalar.indent, scalar.chomping, false);
|
|
5094
|
+
case 5:
|
|
5095
|
+
return getBlockValue(input, valueStart, valueEnd, scalar.indent, scalar.chomping, true);
|
|
5096
|
+
default:
|
|
5097
|
+
return getPlainValue(input, valueStart, valueEnd);
|
|
5098
|
+
}
|
|
5099
|
+
}
|
|
5100
|
+
var DEFAULT_TAG_HANDLERS = {
|
|
5101
|
+
"!": "!",
|
|
5102
|
+
"!!": "tag:yaml.org,2002:"
|
|
5103
|
+
};
|
|
5104
|
+
function tagNameFull(rawTag, tagHandlers) {
|
|
5105
|
+
if (rawTag.startsWith("!<") && rawTag.endsWith(">")) return decodeURIComponent(rawTag.slice(2, -1));
|
|
5106
|
+
const handleEnd = rawTag.indexOf("!", 1);
|
|
5107
|
+
const handle = handleEnd === -1 ? "!" : rawTag.slice(0, handleEnd + 1);
|
|
5108
|
+
const prefix = tagHandlers?.[handle] ?? DEFAULT_TAG_HANDLERS[handle] ?? handle;
|
|
5109
|
+
return decodeURIComponent(prefix) + decodeURIComponent(rawTag.slice(handle.length));
|
|
5110
|
+
}
|
|
5111
|
+
var NO_RANGE$2 = -1;
|
|
5112
|
+
var DEFAULT_CONSTRUCTOR_OPTIONS = {
|
|
5113
|
+
filename: "",
|
|
5114
|
+
schema: CORE_SCHEMA,
|
|
5115
|
+
json: false,
|
|
5116
|
+
maxTotalMergeKeys: 1e4,
|
|
5117
|
+
maxAliases: -1
|
|
5118
|
+
};
|
|
5119
|
+
function eventPosition$1(event) {
|
|
5120
|
+
if ("tagStart" in event && event.tagStart !== NO_RANGE$2) return event.tagStart;
|
|
5121
|
+
if ("anchorStart" in event && event.anchorStart !== NO_RANGE$2) return event.anchorStart;
|
|
5122
|
+
if ("valueStart" in event && event.valueStart !== NO_RANGE$2) return event.valueStart;
|
|
5123
|
+
if ("start" in event) return event.start;
|
|
5124
|
+
return 0;
|
|
5125
|
+
}
|
|
5126
|
+
function throwError$1(state, message) {
|
|
5127
|
+
throwErrorAt(state.source, state.position, message, state.filename);
|
|
5128
|
+
}
|
|
5129
|
+
function finalizeCollection(state, position, tag, carrier) {
|
|
5130
|
+
try {
|
|
5131
|
+
return tag.finalize(carrier);
|
|
5132
|
+
} catch (error) {
|
|
5133
|
+
if (error instanceof YAMLException) throw error;
|
|
5134
|
+
throwErrorAt(state.source, position, error instanceof Error ? error.message : String(error), state.filename);
|
|
5135
|
+
}
|
|
5136
|
+
}
|
|
5137
|
+
function lookupTag(exact, prefix, tagName) {
|
|
5138
|
+
const exactTag = exact[tagName];
|
|
5139
|
+
if (exactTag) return exactTag;
|
|
5140
|
+
for (const tag of prefix) if (tagName.startsWith(tag.tagName)) return tag;
|
|
5141
|
+
}
|
|
5142
|
+
function findExplicitTag(state, exact, prefix, tagName, nodeKind) {
|
|
5143
|
+
const tag = lookupTag(exact, prefix, tagName);
|
|
5144
|
+
if (tag) return tag;
|
|
5145
|
+
throwError$1(state, `unknown ${nodeKind} tag !<${tagName}>`);
|
|
5146
|
+
}
|
|
5147
|
+
function constructScalar(state, event) {
|
|
5148
|
+
const source = getScalarValue(state.source, event);
|
|
5149
|
+
const rawTag = event.tagStart === NO_RANGE$2 ? "" : state.source.slice(event.tagStart, event.tagEnd);
|
|
5150
|
+
const strTag2 = state.schema.defaultScalarTag;
|
|
5151
|
+
if (rawTag !== "") {
|
|
5152
|
+
if (rawTag === "!") return {
|
|
5153
|
+
value: source,
|
|
5154
|
+
tag: strTag2
|
|
5155
|
+
};
|
|
5156
|
+
const tagName = tagNameFull(rawTag, state.tagHandlers);
|
|
5157
|
+
const scalarTag = lookupTag(state.schema.exact.scalar, state.schema.prefix.scalar, tagName);
|
|
5158
|
+
if (scalarTag) {
|
|
5159
|
+
const result = scalarTag.resolve(source, true, tagName);
|
|
5160
|
+
if (result === NOT_RESOLVED) throwError$1(state, `cannot resolve a node with !<${tagName}> explicit tag`);
|
|
5161
|
+
return {
|
|
5162
|
+
value: result,
|
|
5163
|
+
tag: scalarTag
|
|
5164
|
+
};
|
|
5165
|
+
}
|
|
5166
|
+
const collectionTagDef = lookupTag(state.schema.exact.mapping, state.schema.prefix.mapping, tagName) ?? lookupTag(state.schema.exact.sequence, state.schema.prefix.sequence, tagName);
|
|
5167
|
+
if (collectionTagDef) {
|
|
5168
|
+
if (source !== "") throwError$1(state, `cannot resolve a node with !<${tagName}> explicit tag`);
|
|
5169
|
+
const carrier = collectionTagDef.create(tagName);
|
|
5170
|
+
return {
|
|
5171
|
+
value: collectionTagDef.carrierIsResult ? carrier : finalizeCollection(state, state.position, collectionTagDef, carrier),
|
|
5172
|
+
tag: collectionTagDef
|
|
5173
|
+
};
|
|
5174
|
+
}
|
|
5175
|
+
throwError$1(state, `unknown scalar tag !<${tagName}>`);
|
|
5176
|
+
}
|
|
5177
|
+
if (event.style === 1) {
|
|
5178
|
+
const candidates = state.schema.implicitScalarByFirstChar.get(source.charAt(0)) ?? state.schema.implicitScalarAnyFirstChar;
|
|
5179
|
+
for (const tag of candidates) {
|
|
5180
|
+
const result = tag.resolve(source, false, tag.tagName);
|
|
5181
|
+
if (result !== NOT_RESOLVED) return {
|
|
5182
|
+
value: result,
|
|
5183
|
+
tag
|
|
5184
|
+
};
|
|
5185
|
+
}
|
|
5186
|
+
}
|
|
5187
|
+
return {
|
|
5188
|
+
value: strTag2.resolve(source, false, strTag2.tagName),
|
|
5189
|
+
tag: strTag2
|
|
5190
|
+
};
|
|
5191
|
+
}
|
|
5192
|
+
function collectionTag(state, event, exact, prefix, defaultTagName, nodeKind) {
|
|
5193
|
+
const rawTag = event.tagStart === NO_RANGE$2 ? "" : state.source.slice(event.tagStart, event.tagEnd);
|
|
5194
|
+
const tagName = rawTag === "" || rawTag === "!" ? defaultTagName : tagNameFull(rawTag, state.tagHandlers);
|
|
5195
|
+
return {
|
|
5196
|
+
tagName,
|
|
5197
|
+
tag: findExplicitTag(state, exact, prefix, tagName, nodeKind)
|
|
5198
|
+
};
|
|
5199
|
+
}
|
|
5200
|
+
function isMappingTag(tag) {
|
|
5201
|
+
return tag.nodeKind === "mapping";
|
|
5202
|
+
}
|
|
5203
|
+
function mergeKeys(state, frame, source, sourceTag) {
|
|
5204
|
+
for (const sourceKey of sourceTag.keys(source)) {
|
|
5205
|
+
if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) throwError$1(state, `merge keys exceeded maxTotalMergeKeys (${state.maxTotalMergeKeys})`);
|
|
5206
|
+
if (frame.tag.has(frame.value, sourceKey)) continue;
|
|
5207
|
+
const err = frame.tag.addPair(frame.value, sourceKey, sourceTag.get(source, sourceKey));
|
|
5208
|
+
if (err) throwError$1(state, err);
|
|
5209
|
+
(frame.overridable ??= /* @__PURE__ */ new Set()).add(sourceKey);
|
|
5210
|
+
}
|
|
5211
|
+
}
|
|
5212
|
+
function mergeSource(state, frame, source, sourceTag) {
|
|
5213
|
+
state.position = frame.keyPosition;
|
|
5214
|
+
if (isMappingTag(sourceTag)) mergeKeys(state, frame, source, sourceTag);
|
|
5215
|
+
else if (sourceTag.nodeKind === "sequence" && Array.isArray(source)) for (const element of source) mergeKeys(state, frame, element, frame.tag);
|
|
5216
|
+
else throwError$1(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
5217
|
+
}
|
|
5218
|
+
function addMappingValue(state, frame, key, value, tag) {
|
|
5219
|
+
state.position = frame.keyPosition;
|
|
5220
|
+
if (key === MERGE_KEY) {
|
|
5221
|
+
mergeSource(state, frame, value, tag);
|
|
5222
|
+
return;
|
|
5223
|
+
}
|
|
5224
|
+
if (!state.json && frame.tag.has(frame.value, key) && !frame.overridable?.has(key)) throwError$1(state, "duplicated mapping key");
|
|
5225
|
+
const err = frame.tag.addPair(frame.value, key, value);
|
|
5226
|
+
if (err) throwError$1(state, err);
|
|
5227
|
+
frame.overridable?.delete(key);
|
|
5228
|
+
}
|
|
5229
|
+
function addValue(state, value, tag) {
|
|
5230
|
+
const frame = state.frames[state.frames.length - 1];
|
|
5231
|
+
if (frame.kind === "document") {
|
|
5232
|
+
frame.value = value;
|
|
5233
|
+
frame.hasValue = true;
|
|
5234
|
+
} else if (frame.kind === "sequence") {
|
|
5235
|
+
if (frame.merge) {
|
|
5236
|
+
if (!isMappingTag(tag)) throwError$1(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
5237
|
+
}
|
|
5238
|
+
const err = frame.tag.addItem(frame.value, value, frame.index++);
|
|
5239
|
+
if (err) throwError$1(state, err);
|
|
5240
|
+
} else if (frame.hasKey) {
|
|
5241
|
+
const key = frame.key;
|
|
5242
|
+
frame.key = void 0;
|
|
5243
|
+
frame.hasKey = false;
|
|
5244
|
+
addMappingValue(state, frame, key, value, tag);
|
|
5245
|
+
} else {
|
|
5246
|
+
frame.key = value;
|
|
5247
|
+
frame.keyPosition = state.position;
|
|
5248
|
+
frame.hasKey = true;
|
|
5249
|
+
}
|
|
5250
|
+
}
|
|
5251
|
+
function storeAnchor(state, event, value, tag, isValueFinal) {
|
|
5252
|
+
if (event.anchorStart !== NO_RANGE$2) {
|
|
5253
|
+
const anchor = {
|
|
5254
|
+
value,
|
|
5255
|
+
tag,
|
|
5256
|
+
isValueFinal
|
|
5257
|
+
};
|
|
5258
|
+
state.anchors.set(state.source.slice(event.anchorStart, event.anchorEnd), anchor);
|
|
5259
|
+
return anchor;
|
|
5260
|
+
}
|
|
5261
|
+
return null;
|
|
5262
|
+
}
|
|
5263
|
+
function constructFromEvents(events, options2) {
|
|
5264
|
+
const state = {
|
|
5265
|
+
...DEFAULT_CONSTRUCTOR_OPTIONS,
|
|
5266
|
+
...options2,
|
|
5267
|
+
events,
|
|
5268
|
+
documents: [],
|
|
5269
|
+
eventIndex: 0,
|
|
5270
|
+
position: 0,
|
|
5271
|
+
frames: [],
|
|
5272
|
+
anchors: /* @__PURE__ */ new Map(),
|
|
5273
|
+
tagHandlers: /* @__PURE__ */ Object.create(null),
|
|
5274
|
+
totalMergeKeys: 0,
|
|
5275
|
+
aliasCount: 0
|
|
5276
|
+
};
|
|
5277
|
+
while (state.eventIndex < state.events.length) {
|
|
5278
|
+
const event = state.events[state.eventIndex++];
|
|
5279
|
+
state.position = eventPosition$1(event);
|
|
5280
|
+
switch (event.type) {
|
|
5281
|
+
case 1:
|
|
5282
|
+
state.anchors = /* @__PURE__ */ new Map();
|
|
5283
|
+
state.aliasCount = 0;
|
|
5284
|
+
state.tagHandlers = /* @__PURE__ */ Object.create(null);
|
|
5285
|
+
for (const directive of event.directives) if (directive.kind === "tag") state.tagHandlers[directive.handle] = directive.prefix;
|
|
5286
|
+
state.frames.push({
|
|
5287
|
+
kind: "document",
|
|
5288
|
+
position: state.position,
|
|
5289
|
+
value: void 0,
|
|
5290
|
+
hasValue: false
|
|
5291
|
+
});
|
|
5292
|
+
break;
|
|
5293
|
+
case 4: {
|
|
5294
|
+
const { value, tag } = constructScalar(state, event);
|
|
5295
|
+
storeAnchor(state, event, value, tag, true);
|
|
5296
|
+
addValue(state, value, tag);
|
|
5297
|
+
break;
|
|
5298
|
+
}
|
|
5299
|
+
case 2: {
|
|
5300
|
+
const definition = collectionTag(state, event, state.schema.exact.sequence, state.schema.prefix.sequence, "tag:yaml.org,2002:seq", "sequence");
|
|
5301
|
+
const value = definition.tag.create(definition.tagName);
|
|
5302
|
+
const anchor = storeAnchor(state, event, value, definition.tag, definition.tag.carrierIsResult);
|
|
5303
|
+
const parent = state.frames[state.frames.length - 1];
|
|
5304
|
+
const merge = parent !== void 0 && parent.kind === "mapping" && parent.hasKey && parent.key === MERGE_KEY;
|
|
5305
|
+
state.frames.push({
|
|
5306
|
+
kind: "sequence",
|
|
5307
|
+
position: state.position,
|
|
5308
|
+
value,
|
|
5309
|
+
tag: definition.tag,
|
|
5310
|
+
anchor,
|
|
5311
|
+
index: 0,
|
|
5312
|
+
merge
|
|
5313
|
+
});
|
|
5314
|
+
break;
|
|
5315
|
+
}
|
|
5316
|
+
case 3: {
|
|
5317
|
+
const definition = collectionTag(state, event, state.schema.exact.mapping, state.schema.prefix.mapping, "tag:yaml.org,2002:map", "mapping");
|
|
5318
|
+
const value = definition.tag.create(definition.tagName);
|
|
5319
|
+
const anchor = storeAnchor(state, event, value, definition.tag, definition.tag.carrierIsResult);
|
|
5320
|
+
state.frames.push({
|
|
5321
|
+
kind: "mapping",
|
|
5322
|
+
position: state.position,
|
|
5323
|
+
value,
|
|
5324
|
+
tag: definition.tag,
|
|
5325
|
+
anchor,
|
|
5326
|
+
key: void 0,
|
|
5327
|
+
keyPosition: state.position,
|
|
5328
|
+
hasKey: false,
|
|
5329
|
+
overridable: null
|
|
5330
|
+
});
|
|
5331
|
+
break;
|
|
5332
|
+
}
|
|
5333
|
+
case 5: {
|
|
5334
|
+
if (state.maxAliases !== -1 && ++state.aliasCount > state.maxAliases) throwError$1(state, `aliases exceeded maxAliases (${state.maxAliases})`);
|
|
5335
|
+
const name = state.source.slice(event.anchorStart, event.anchorEnd);
|
|
5336
|
+
const anchor = state.anchors.get(name);
|
|
5337
|
+
if (!anchor) throwError$1(state, `unidentified alias "${name}"`);
|
|
5338
|
+
if (!anchor.isValueFinal) throwError$1(state, `recursive alias "${name}" is not supported for tag ${anchor.tag.tagName} because it uses finalize()`);
|
|
5339
|
+
addValue(state, anchor.value, anchor.tag);
|
|
5340
|
+
break;
|
|
5341
|
+
}
|
|
5342
|
+
case 6: {
|
|
5343
|
+
const frame = state.frames.pop();
|
|
5344
|
+
if (frame.kind === "document") state.documents.push(frame.value);
|
|
5345
|
+
else {
|
|
5346
|
+
const value = frame.tag.carrierIsResult ? frame.value : finalizeCollection(state, frame.position, frame.tag, frame.value);
|
|
5347
|
+
if (frame.anchor) {
|
|
5348
|
+
frame.anchor.value = value;
|
|
5349
|
+
frame.anchor.isValueFinal = true;
|
|
5350
|
+
}
|
|
5351
|
+
addValue(state, value, frame.tag);
|
|
5352
|
+
}
|
|
5353
|
+
break;
|
|
5354
|
+
}
|
|
5355
|
+
}
|
|
5356
|
+
}
|
|
5357
|
+
return state.documents;
|
|
5358
|
+
}
|
|
5359
|
+
var NO_RANGE$1 = -1;
|
|
5360
|
+
var HAS_OWN = Object.prototype.hasOwnProperty;
|
|
5361
|
+
var CONTEXT_FLOW_IN = 1;
|
|
5362
|
+
var CONTEXT_FLOW_OUT = 2;
|
|
5363
|
+
var CONTEXT_BLOCK_IN = 3;
|
|
5364
|
+
var CONTEXT_BLOCK_OUT = 4;
|
|
5365
|
+
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
5366
|
+
var PATTERN_FLOW_INDICATORS = /[,\[\]{}]/;
|
|
5367
|
+
var PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/;
|
|
5368
|
+
var NS_URI_CHAR = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`;
|
|
5369
|
+
var NS_TAG_CHAR = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`;
|
|
5370
|
+
var PATTERN_TAG_URI = new RegExp(`^(?:${NS_URI_CHAR})*$`);
|
|
5371
|
+
var PATTERN_TAG_SUFFIX = new RegExp(`^(?:${NS_TAG_CHAR})+$`);
|
|
5372
|
+
var PATTERN_TAG_PREFIX = new RegExp(`^(?:!(?:${NS_URI_CHAR})*|${NS_TAG_CHAR}(?:${NS_URI_CHAR})*)$`);
|
|
5373
|
+
var DEFAULT_PARSER_OPTIONS = {
|
|
5374
|
+
filename: "",
|
|
5375
|
+
maxDepth: 100
|
|
5376
|
+
};
|
|
5377
|
+
function addDocumentEvent(state, explicitStart, explicitEnd) {
|
|
5378
|
+
state.events.push({
|
|
5379
|
+
type: 1,
|
|
5380
|
+
explicitStart,
|
|
5381
|
+
explicitEnd,
|
|
5382
|
+
directives: state.directives
|
|
5383
|
+
});
|
|
5384
|
+
}
|
|
5385
|
+
function addSequenceEvent(state, start, anchorStart, anchorEnd, tagStart, tagEnd, style) {
|
|
5386
|
+
state.events.push({
|
|
5387
|
+
type: 2,
|
|
5388
|
+
start,
|
|
5389
|
+
anchorStart,
|
|
5390
|
+
anchorEnd,
|
|
5391
|
+
tagStart,
|
|
5392
|
+
tagEnd,
|
|
5393
|
+
style
|
|
5394
|
+
});
|
|
5395
|
+
}
|
|
5396
|
+
function addMappingEvent(state, start, anchorStart, anchorEnd, tagStart, tagEnd, style) {
|
|
5397
|
+
state.events.push({
|
|
5398
|
+
type: 3,
|
|
5399
|
+
start,
|
|
5400
|
+
anchorStart,
|
|
5401
|
+
anchorEnd,
|
|
5402
|
+
tagStart,
|
|
5403
|
+
tagEnd,
|
|
5404
|
+
style
|
|
5405
|
+
});
|
|
5406
|
+
}
|
|
5407
|
+
function addScalarEvent(state, valueStart, valueEnd, anchorStart, anchorEnd, tagStart, tagEnd, style, chomping = 1, indent = -1, fast = false) {
|
|
5408
|
+
state.events.push({
|
|
5409
|
+
type: 4,
|
|
5410
|
+
valueStart,
|
|
5411
|
+
valueEnd,
|
|
5412
|
+
anchorStart,
|
|
5413
|
+
anchorEnd,
|
|
5414
|
+
tagStart,
|
|
5415
|
+
tagEnd,
|
|
5416
|
+
style,
|
|
5417
|
+
chomping,
|
|
5418
|
+
indent,
|
|
5419
|
+
fast
|
|
5420
|
+
});
|
|
5421
|
+
}
|
|
5422
|
+
function addAliasEvent(state, anchorStart, anchorEnd) {
|
|
5423
|
+
state.events.push({
|
|
5424
|
+
type: 5,
|
|
5425
|
+
anchorStart,
|
|
5426
|
+
anchorEnd
|
|
5427
|
+
});
|
|
5428
|
+
}
|
|
5429
|
+
function addPopEvent(state) {
|
|
5430
|
+
state.events.push({ type: 6 });
|
|
5431
|
+
}
|
|
5432
|
+
function addEmptyScalarEvent(state) {
|
|
5433
|
+
addScalarEvent(state, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, 1);
|
|
5434
|
+
}
|
|
5435
|
+
function emptyProperties() {
|
|
5436
|
+
return {
|
|
5437
|
+
anchorStart: NO_RANGE$1,
|
|
5438
|
+
anchorEnd: NO_RANGE$1,
|
|
5439
|
+
tagStart: NO_RANGE$1,
|
|
5440
|
+
tagEnd: NO_RANGE$1
|
|
5441
|
+
};
|
|
5442
|
+
}
|
|
5443
|
+
function snapshotState(state) {
|
|
5444
|
+
return {
|
|
5445
|
+
position: state.position,
|
|
5446
|
+
line: state.line,
|
|
5447
|
+
lineStart: state.lineStart,
|
|
5448
|
+
lineIndent: state.lineIndent,
|
|
5449
|
+
firstTabInLine: state.firstTabInLine,
|
|
5450
|
+
eventsLength: state.events.length
|
|
5451
|
+
};
|
|
5452
|
+
}
|
|
5453
|
+
function restoreState(state, snapshot) {
|
|
5454
|
+
state.position = snapshot.position;
|
|
5455
|
+
state.line = snapshot.line;
|
|
5456
|
+
state.lineStart = snapshot.lineStart;
|
|
5457
|
+
state.lineIndent = snapshot.lineIndent;
|
|
5458
|
+
state.firstTabInLine = snapshot.firstTabInLine;
|
|
5459
|
+
state.events.length = snapshot.eventsLength;
|
|
5460
|
+
}
|
|
5461
|
+
function throwError(state, message) {
|
|
5462
|
+
throwErrorAt(state.input.slice(0, state.length), state.position, message, state.filename);
|
|
5463
|
+
}
|
|
5464
|
+
function isEol(c) {
|
|
5465
|
+
return c === 10 || c === 13;
|
|
5466
|
+
}
|
|
5467
|
+
function isWhiteSpace(c) {
|
|
5468
|
+
return c === 9 || c === 32;
|
|
5469
|
+
}
|
|
5470
|
+
function isWsOrEol(c) {
|
|
5471
|
+
return isWhiteSpace(c) || isEol(c);
|
|
5472
|
+
}
|
|
5473
|
+
function isWsOrEolOrEnd(c) {
|
|
5474
|
+
return c === 0 || isWsOrEol(c);
|
|
5475
|
+
}
|
|
5476
|
+
function isFlowIndicator(c) {
|
|
5477
|
+
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
5478
|
+
}
|
|
5479
|
+
function fromDecimalCode(c) {
|
|
5480
|
+
return c >= 48 && c <= 57 ? c - 48 : -1;
|
|
5481
|
+
}
|
|
5482
|
+
function fromHexCode(c) {
|
|
5483
|
+
if (c >= 48 && c <= 57) return c - 48;
|
|
5484
|
+
const lc = c | 32;
|
|
5485
|
+
if (lc >= 97 && lc <= 102) return lc - 97 + 10;
|
|
5486
|
+
return -1;
|
|
5487
|
+
}
|
|
5488
|
+
function escapedHexLen(c) {
|
|
5489
|
+
if (c === 120) return 2;
|
|
5490
|
+
if (c === 117) return 4;
|
|
5491
|
+
if (c === 85) return 8;
|
|
5492
|
+
return 0;
|
|
5493
|
+
}
|
|
5494
|
+
function isSimpleEscape(c) {
|
|
5495
|
+
return c === 48 || c === 97 || c === 98 || c === 116 || c === 9 || c === 110 || c === 118 || c === 102 || c === 114 || c === 101 || c === 32 || c === 34 || c === 47 || c === 92 || c === 78 || c === 95 || c === 76 || c === 80;
|
|
5496
|
+
}
|
|
5497
|
+
function consumeLineBreak(state) {
|
|
5498
|
+
if (state.input.charCodeAt(state.position) === 10) state.position++;
|
|
5499
|
+
else {
|
|
5500
|
+
state.position++;
|
|
5501
|
+
if (state.input.charCodeAt(state.position) === 10) state.position++;
|
|
5502
|
+
}
|
|
5503
|
+
state.line++;
|
|
5504
|
+
state.lineStart = state.position;
|
|
5505
|
+
state.lineIndent = 0;
|
|
5506
|
+
state.firstTabInLine = -1;
|
|
5507
|
+
}
|
|
5508
|
+
function skipSeparationSpace(state, allowComments) {
|
|
5509
|
+
let lineBreaks = 0;
|
|
5510
|
+
let ch = state.input.charCodeAt(state.position);
|
|
5511
|
+
let hasSeparation = state.position === state.lineStart || isWsOrEol(state.input.charCodeAt(state.position - 1));
|
|
5512
|
+
while (ch !== 0) {
|
|
5513
|
+
while (isWhiteSpace(ch)) {
|
|
5514
|
+
hasSeparation = true;
|
|
5515
|
+
if (ch === 9 && state.firstTabInLine === -1) state.firstTabInLine = state.position;
|
|
5516
|
+
ch = state.input.charCodeAt(++state.position);
|
|
5517
|
+
}
|
|
5518
|
+
if (allowComments && hasSeparation && ch === 35) do
|
|
5519
|
+
ch = state.input.charCodeAt(++state.position);
|
|
5520
|
+
while (!isEol(ch) && ch !== 0);
|
|
5521
|
+
if (!isEol(ch)) break;
|
|
5522
|
+
consumeLineBreak(state);
|
|
5523
|
+
lineBreaks++;
|
|
5524
|
+
hasSeparation = true;
|
|
5525
|
+
ch = state.input.charCodeAt(state.position);
|
|
5526
|
+
while (ch === 32) {
|
|
5527
|
+
state.lineIndent++;
|
|
5528
|
+
ch = state.input.charCodeAt(++state.position);
|
|
5529
|
+
}
|
|
5530
|
+
}
|
|
5531
|
+
return lineBreaks;
|
|
5532
|
+
}
|
|
5533
|
+
function testDocumentSeparator(state, position = state.position) {
|
|
5534
|
+
const ch = state.input.charCodeAt(position);
|
|
5535
|
+
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(position + 1) && ch === state.input.charCodeAt(position + 2)) {
|
|
5536
|
+
const following = state.input.charCodeAt(position + 3);
|
|
5537
|
+
return following === 0 || isWsOrEol(following);
|
|
5538
|
+
}
|
|
5539
|
+
return false;
|
|
5540
|
+
}
|
|
5541
|
+
function skipUntilLineEnd(state) {
|
|
5542
|
+
let ch = state.input.charCodeAt(state.position);
|
|
5543
|
+
while (ch !== 0 && !isEol(ch)) ch = state.input.charCodeAt(++state.position);
|
|
5544
|
+
}
|
|
5545
|
+
function checkPrintable(state, start, end) {
|
|
5546
|
+
if (PATTERN_NON_PRINTABLE.test(state.input.slice(start, end))) throwError(state, "the stream contains non-printable characters");
|
|
5547
|
+
}
|
|
5548
|
+
function readTagProperty(state, props, inFlow) {
|
|
5549
|
+
if (state.input.charCodeAt(state.position) !== 33) return false;
|
|
5550
|
+
if (props.tagStart !== NO_RANGE$1) throwError(state, "duplication of a tag property");
|
|
5551
|
+
const start = state.position;
|
|
5552
|
+
let isVerbatim = false;
|
|
5553
|
+
let isNamed = false;
|
|
5554
|
+
let tagHandle = "!";
|
|
5555
|
+
let ch = state.input.charCodeAt(++state.position);
|
|
5556
|
+
if (ch === 60) {
|
|
5557
|
+
isVerbatim = true;
|
|
5558
|
+
ch = state.input.charCodeAt(++state.position);
|
|
5559
|
+
} else if (ch === 33) {
|
|
5560
|
+
isNamed = true;
|
|
5561
|
+
tagHandle = "!!";
|
|
5562
|
+
ch = state.input.charCodeAt(++state.position);
|
|
5563
|
+
}
|
|
5564
|
+
let suffixStart = state.position;
|
|
5565
|
+
let tagName;
|
|
5566
|
+
if (isVerbatim) {
|
|
5567
|
+
while (ch !== 0 && ch !== 62) ch = state.input.charCodeAt(++state.position);
|
|
5568
|
+
if (ch !== 62) throwError(state, "unexpected end of the stream within a verbatim tag");
|
|
5569
|
+
tagName = state.input.slice(suffixStart, state.position);
|
|
5570
|
+
state.position++;
|
|
5571
|
+
} else {
|
|
5572
|
+
while (ch !== 0 && !isWsOrEol(ch) && !(inFlow && isFlowIndicator(ch))) {
|
|
5573
|
+
if (ch === 33) if (!isNamed) {
|
|
5574
|
+
tagHandle = state.input.slice(suffixStart - 1, state.position + 1);
|
|
5575
|
+
if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, "named tag handle cannot contain such characters");
|
|
5576
|
+
isNamed = true;
|
|
5577
|
+
suffixStart = state.position + 1;
|
|
5578
|
+
} else throwError(state, "tag suffix cannot contain exclamation marks");
|
|
5579
|
+
ch = state.input.charCodeAt(++state.position);
|
|
5580
|
+
}
|
|
5581
|
+
tagName = state.input.slice(suffixStart, state.position);
|
|
5582
|
+
if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, "tag suffix cannot contain flow indicator characters");
|
|
5583
|
+
}
|
|
5584
|
+
if (tagName && !(isVerbatim ? PATTERN_TAG_URI.test(tagName) : PATTERN_TAG_SUFFIX.test(tagName))) throwError(state, `tag name cannot contain such characters: ${tagName}`);
|
|
5585
|
+
if (!isVerbatim && tagHandle !== "!" && tagHandle !== "!!" && !HAS_OWN.call(state.tagHandlers, tagHandle)) throwError(state, `undeclared tag handle "${tagHandle}"`);
|
|
5586
|
+
props.tagStart = start;
|
|
5587
|
+
props.tagEnd = state.position;
|
|
5588
|
+
return true;
|
|
5589
|
+
}
|
|
5590
|
+
function readAnchorProperty(state, props) {
|
|
5591
|
+
if (state.input.charCodeAt(state.position) !== 38) return false;
|
|
5592
|
+
if (props.anchorStart !== NO_RANGE$1) throwError(state, "duplication of an anchor property");
|
|
5593
|
+
state.position++;
|
|
5594
|
+
const start = state.position;
|
|
5595
|
+
while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) state.position++;
|
|
5596
|
+
if (state.position === start) throwError(state, "name of an anchor node must contain at least one character");
|
|
5597
|
+
props.anchorStart = start;
|
|
5598
|
+
props.anchorEnd = state.position;
|
|
5599
|
+
return true;
|
|
5600
|
+
}
|
|
5601
|
+
function readAlias(state, props) {
|
|
5602
|
+
if (state.input.charCodeAt(state.position) !== 42) return false;
|
|
5603
|
+
if (props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1) throwError(state, "alias node should not have any properties");
|
|
5604
|
+
state.position++;
|
|
5605
|
+
const start = state.position;
|
|
5606
|
+
while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) state.position++;
|
|
5607
|
+
if (state.position === start) throwError(state, "name of an alias node must contain at least one character");
|
|
5608
|
+
addAliasEvent(state, start, state.position);
|
|
5609
|
+
return true;
|
|
5610
|
+
}
|
|
5611
|
+
function readFlowScalarBreak(state, nodeIndent) {
|
|
5612
|
+
skipSeparationSpace(state, false);
|
|
5613
|
+
if (state.lineIndent < nodeIndent) throwError(state, "deficient indentation");
|
|
5614
|
+
}
|
|
5615
|
+
function readSingleQuotedScalar(state, nodeIndent, props) {
|
|
5616
|
+
if (state.input.charCodeAt(state.position) !== 39) return false;
|
|
5617
|
+
state.position++;
|
|
5618
|
+
const start = state.position;
|
|
5619
|
+
let simple = true;
|
|
5620
|
+
while (state.input.charCodeAt(state.position) !== 0) {
|
|
5621
|
+
const ch = state.input.charCodeAt(state.position);
|
|
5622
|
+
if (ch === 39) {
|
|
5623
|
+
if (state.input.charCodeAt(state.position + 1) === 39) {
|
|
5624
|
+
simple = false;
|
|
5625
|
+
state.position += 2;
|
|
5626
|
+
continue;
|
|
5627
|
+
}
|
|
5628
|
+
const end = state.position;
|
|
5629
|
+
state.position++;
|
|
5630
|
+
addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 2, 1, -1, simple);
|
|
5631
|
+
return true;
|
|
5632
|
+
}
|
|
5633
|
+
if (isEol(ch)) {
|
|
5634
|
+
simple = false;
|
|
5635
|
+
readFlowScalarBreak(state, nodeIndent);
|
|
5636
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a single quoted scalar");
|
|
5637
|
+
else if (ch !== 9 && ch < 32) throwError(state, "expected valid JSON character");
|
|
5638
|
+
else state.position++;
|
|
5639
|
+
}
|
|
5640
|
+
throwError(state, "unexpected end of the stream within a single quoted scalar");
|
|
5641
|
+
}
|
|
5642
|
+
function readDoubleQuotedScalar(state, nodeIndent, props) {
|
|
5643
|
+
if (state.input.charCodeAt(state.position) !== 34) return false;
|
|
5644
|
+
state.position++;
|
|
5645
|
+
const start = state.position;
|
|
5646
|
+
let simple = true;
|
|
5647
|
+
while (state.input.charCodeAt(state.position) !== 0) {
|
|
5648
|
+
const ch = state.input.charCodeAt(state.position);
|
|
5649
|
+
if (ch === 34) {
|
|
5650
|
+
const end = state.position;
|
|
5651
|
+
state.position++;
|
|
5652
|
+
addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 3, 1, -1, simple);
|
|
5653
|
+
return true;
|
|
5654
|
+
}
|
|
5655
|
+
if (ch === 92) {
|
|
5656
|
+
simple = false;
|
|
5657
|
+
const escaped = state.input.charCodeAt(++state.position);
|
|
5658
|
+
if (isEol(escaped)) readFlowScalarBreak(state, nodeIndent);
|
|
5659
|
+
else if (isSimpleEscape(escaped)) state.position++;
|
|
5660
|
+
else {
|
|
5661
|
+
let hexLength = escapedHexLen(escaped);
|
|
5662
|
+
if (hexLength === 0) throwError(state, "unknown escape sequence");
|
|
5663
|
+
while (hexLength-- > 0) {
|
|
5664
|
+
state.position++;
|
|
5665
|
+
if (fromHexCode(state.input.charCodeAt(state.position)) < 0) throwError(state, "expected hexadecimal character");
|
|
5666
|
+
}
|
|
5667
|
+
state.position++;
|
|
5668
|
+
}
|
|
5669
|
+
} else if (isEol(ch)) {
|
|
5670
|
+
simple = false;
|
|
5671
|
+
readFlowScalarBreak(state, nodeIndent);
|
|
5672
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a double quoted scalar");
|
|
5673
|
+
else if (ch !== 9 && ch < 32) throwError(state, "expected valid JSON character");
|
|
5674
|
+
else state.position++;
|
|
5675
|
+
}
|
|
5676
|
+
throwError(state, "unexpected end of the stream within a double quoted scalar");
|
|
5677
|
+
}
|
|
5678
|
+
function readBlockScalar(state, parentIndent, props) {
|
|
5679
|
+
const ch = state.input.charCodeAt(state.position);
|
|
5680
|
+
let chomping = 1;
|
|
5681
|
+
let indent = -1;
|
|
5682
|
+
let detectedIndent = false;
|
|
5683
|
+
if (ch !== 124 && ch !== 62) return false;
|
|
5684
|
+
const style = ch === 124 ? 4 : 5;
|
|
5685
|
+
state.position++;
|
|
5686
|
+
while (state.input.charCodeAt(state.position) !== 0) {
|
|
5687
|
+
const current = state.input.charCodeAt(state.position);
|
|
5688
|
+
const digit = fromDecimalCode(current);
|
|
5689
|
+
if (current === 43 || current === 45) {
|
|
5690
|
+
if (chomping !== 1) throwError(state, "repeat of a chomping mode identifier");
|
|
5691
|
+
chomping = current === 43 ? 3 : 2;
|
|
5692
|
+
state.position++;
|
|
5693
|
+
} else if (digit >= 0) {
|
|
5694
|
+
if (digit === 0) throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
5695
|
+
if (detectedIndent) throwError(state, "repeat of an indentation width identifier");
|
|
5696
|
+
indent = parentIndent + digit - 1;
|
|
5697
|
+
detectedIndent = true;
|
|
5698
|
+
state.position++;
|
|
5699
|
+
} else break;
|
|
5700
|
+
}
|
|
5701
|
+
let hadWhitespace = false;
|
|
5702
|
+
while (isWhiteSpace(state.input.charCodeAt(state.position))) {
|
|
5703
|
+
hadWhitespace = true;
|
|
5704
|
+
state.position++;
|
|
5705
|
+
}
|
|
5706
|
+
if (hadWhitespace && state.input.charCodeAt(state.position) === 35) skipUntilLineEnd(state);
|
|
5707
|
+
if (isEol(state.input.charCodeAt(state.position))) consumeLineBreak(state);
|
|
5708
|
+
else if (state.input.charCodeAt(state.position) !== 0) throwError(state, "a line break is expected");
|
|
5709
|
+
let contentIndent = detectedIndent ? indent : -1;
|
|
5710
|
+
let maxLeadingIndent = 0;
|
|
5711
|
+
const valueStart = state.position;
|
|
5712
|
+
let valueEnd = state.position;
|
|
5713
|
+
while (state.input.charCodeAt(state.position) !== 0) {
|
|
5714
|
+
const linePosition = state.position;
|
|
5715
|
+
let column = 0;
|
|
5716
|
+
while (state.input.charCodeAt(linePosition + column) === 32) column++;
|
|
5717
|
+
const first = state.input.charCodeAt(linePosition + column);
|
|
5718
|
+
if (first === 0) {
|
|
5719
|
+
if (contentIndent >= 0) {
|
|
5720
|
+
if (column > contentIndent) valueEnd = linePosition + column;
|
|
5721
|
+
} else if (column > 0) valueEnd = linePosition + column;
|
|
5722
|
+
break;
|
|
5723
|
+
}
|
|
5724
|
+
if (linePosition === state.lineStart && testDocumentSeparator(state, linePosition)) break;
|
|
5725
|
+
if (!detectedIndent && contentIndent === -1 && isEol(first)) maxLeadingIndent = Math.max(maxLeadingIndent, column);
|
|
5726
|
+
if (!detectedIndent && contentIndent === -1 && !isEol(first)) {
|
|
5727
|
+
if (first === 9 && column < parentIndent) {
|
|
5728
|
+
state.position = linePosition + column;
|
|
5729
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
5730
|
+
}
|
|
5731
|
+
if (column < maxLeadingIndent) {
|
|
5732
|
+
state.position = linePosition + column;
|
|
5733
|
+
throwError(state, "bad indentation of a mapping entry");
|
|
5734
|
+
}
|
|
5735
|
+
}
|
|
5736
|
+
if (contentIndent === -1 && first !== 0 && !isEol(first) && column < parentIndent) {
|
|
5737
|
+
state.lineIndent = column;
|
|
5738
|
+
state.position = linePosition + column;
|
|
5739
|
+
break;
|
|
5740
|
+
}
|
|
5741
|
+
if (!detectedIndent && first !== 0 && !isEol(first) && contentIndent === -1) contentIndent = column;
|
|
5742
|
+
const requiredIndent = contentIndent === -1 ? parentIndent + 1 : contentIndent;
|
|
5743
|
+
if (first !== 0 && !isEol(first) && column < requiredIndent) {
|
|
5744
|
+
state.lineIndent = column;
|
|
5745
|
+
state.position = linePosition + column;
|
|
5746
|
+
break;
|
|
5747
|
+
}
|
|
5748
|
+
skipUntilLineEnd(state);
|
|
5749
|
+
valueEnd = state.position;
|
|
5750
|
+
if (isEol(state.input.charCodeAt(state.position))) {
|
|
5751
|
+
consumeLineBreak(state);
|
|
5752
|
+
valueEnd = state.position;
|
|
5753
|
+
}
|
|
5754
|
+
}
|
|
5755
|
+
checkPrintable(state, valueStart, valueEnd);
|
|
5756
|
+
addScalarEvent(state, valueStart, valueEnd, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, style, chomping, contentIndent);
|
|
5757
|
+
return true;
|
|
5758
|
+
}
|
|
5759
|
+
function canStartPlainScalar(state, nodeContext) {
|
|
5760
|
+
const ch = state.input.charCodeAt(state.position);
|
|
5761
|
+
const inFlow = nodeContext === CONTEXT_FLOW_IN;
|
|
5762
|
+
if (ch === 0 || isWsOrEol(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96 || inFlow && isFlowIndicator(ch)) return false;
|
|
5763
|
+
if (ch === 63 || ch === 45) {
|
|
5764
|
+
const following = state.input.charCodeAt(state.position + 1);
|
|
5765
|
+
if (isWsOrEolOrEnd(following) || inFlow && isFlowIndicator(following)) return false;
|
|
5766
|
+
}
|
|
5767
|
+
return true;
|
|
5768
|
+
}
|
|
5769
|
+
function readPlainScalar(state, nodeIndent, nodeContext, props) {
|
|
5770
|
+
if (!canStartPlainScalar(state, nodeContext)) return false;
|
|
5771
|
+
const start = state.position;
|
|
5772
|
+
let end = state.position;
|
|
5773
|
+
let ch = state.input.charCodeAt(state.position);
|
|
5774
|
+
const inFlow = nodeContext === CONTEXT_FLOW_IN;
|
|
5775
|
+
let multiline = false;
|
|
5776
|
+
while (ch !== 0) {
|
|
5777
|
+
if (state.position === state.lineStart && testDocumentSeparator(state)) break;
|
|
5778
|
+
if (ch === 58) {
|
|
5779
|
+
const following = state.input.charCodeAt(state.position + 1);
|
|
5780
|
+
if (isWsOrEolOrEnd(following) || inFlow && isFlowIndicator(following)) break;
|
|
5781
|
+
} else if (ch === 35) {
|
|
5782
|
+
if (isWsOrEol(state.input.charCodeAt(state.position - 1))) break;
|
|
5783
|
+
} else if (inFlow && isFlowIndicator(ch)) break;
|
|
5784
|
+
else if (isEol(ch)) {
|
|
5785
|
+
const savedPosition = state.position;
|
|
5786
|
+
const savedLine = state.line;
|
|
5787
|
+
const savedLineStart = state.lineStart;
|
|
5788
|
+
const savedLineIndent = state.lineIndent;
|
|
5789
|
+
skipSeparationSpace(state, false);
|
|
5790
|
+
if (state.lineIndent >= nodeIndent) {
|
|
5791
|
+
multiline = true;
|
|
5792
|
+
ch = state.input.charCodeAt(state.position);
|
|
5793
|
+
continue;
|
|
5794
|
+
}
|
|
5795
|
+
state.position = savedPosition;
|
|
5796
|
+
state.line = savedLine;
|
|
5797
|
+
state.lineStart = savedLineStart;
|
|
5798
|
+
state.lineIndent = savedLineIndent;
|
|
5799
|
+
break;
|
|
5800
|
+
}
|
|
5801
|
+
if (!isWhiteSpace(ch)) end = state.position + 1;
|
|
5802
|
+
ch = state.input.charCodeAt(++state.position);
|
|
5803
|
+
}
|
|
5804
|
+
if (end === start) return false;
|
|
5805
|
+
checkPrintable(state, start, end);
|
|
5806
|
+
addScalarEvent(state, start, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 1, 1, -1, !multiline);
|
|
5807
|
+
return true;
|
|
5808
|
+
}
|
|
5809
|
+
function skipFlowSeparationSpace(state, nodeIndent) {
|
|
5810
|
+
const startLine = state.line;
|
|
5811
|
+
skipSeparationSpace(state, true);
|
|
5812
|
+
if (state.line > startLine && state.lineIndent < nodeIndent || state.firstTabInLine !== -1 && state.lineIndent < nodeIndent) throwError(state, "deficient indentation");
|
|
5813
|
+
}
|
|
5814
|
+
function readFlowCollection(state, nodeIndent, props) {
|
|
5815
|
+
const ch = state.input.charCodeAt(state.position);
|
|
5816
|
+
const isMapping = ch === 123;
|
|
5817
|
+
const start = state.position;
|
|
5818
|
+
let readNext = true;
|
|
5819
|
+
if (ch !== 91 && ch !== 123) return false;
|
|
5820
|
+
const terminator = isMapping ? 125 : 93;
|
|
5821
|
+
if (isMapping) addMappingEvent(state, start, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 2);
|
|
5822
|
+
else addSequenceEvent(state, start, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 2);
|
|
5823
|
+
state.position++;
|
|
5824
|
+
while (state.input.charCodeAt(state.position) !== 0) {
|
|
5825
|
+
skipFlowSeparationSpace(state, nodeIndent);
|
|
5826
|
+
let ch2 = state.input.charCodeAt(state.position);
|
|
5827
|
+
if (ch2 === terminator) {
|
|
5828
|
+
state.position++;
|
|
5829
|
+
addPopEvent(state);
|
|
5830
|
+
return true;
|
|
5831
|
+
} else if (!readNext) throwError(state, "missed comma between flow collection entries");
|
|
5832
|
+
else if (ch2 === 44) throwError(state, "expected the node content, but found ','");
|
|
5833
|
+
let isPair = false;
|
|
5834
|
+
let isExplicitPair = false;
|
|
5835
|
+
if (ch2 === 63 && isWsOrEol(state.input.charCodeAt(state.position + 1))) {
|
|
5836
|
+
isPair = isExplicitPair = true;
|
|
5837
|
+
state.position += 1;
|
|
5838
|
+
skipFlowSeparationSpace(state, nodeIndent);
|
|
5839
|
+
}
|
|
5840
|
+
const entryLine = state.line;
|
|
5841
|
+
const entryStart = snapshotState(state);
|
|
5842
|
+
const keyWasRead = parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
5843
|
+
skipFlowSeparationSpace(state, nodeIndent);
|
|
5844
|
+
ch2 = state.input.charCodeAt(state.position);
|
|
5845
|
+
if ((isMapping || isExplicitPair || state.line === entryLine) && ch2 === 58) {
|
|
5846
|
+
isPair = true;
|
|
5847
|
+
state.position++;
|
|
5848
|
+
skipFlowSeparationSpace(state, nodeIndent);
|
|
5849
|
+
if (!isMapping) {
|
|
5850
|
+
restoreState(state, entryStart);
|
|
5851
|
+
addMappingEvent(state, entryStart.position, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, 2);
|
|
5852
|
+
if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) addEmptyScalarEvent(state);
|
|
5853
|
+
skipFlowSeparationSpace(state, nodeIndent);
|
|
5854
|
+
state.position++;
|
|
5855
|
+
skipFlowSeparationSpace(state, nodeIndent);
|
|
5856
|
+
} else if (!keyWasRead) addEmptyScalarEvent(state);
|
|
5857
|
+
if (!parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)) addEmptyScalarEvent(state);
|
|
5858
|
+
skipFlowSeparationSpace(state, nodeIndent);
|
|
5859
|
+
if (!isMapping) addPopEvent(state);
|
|
5860
|
+
} else if (isMapping && isPair) {
|
|
5861
|
+
if (!keyWasRead) addEmptyScalarEvent(state);
|
|
5862
|
+
addEmptyScalarEvent(state);
|
|
5863
|
+
} else if (isMapping) addEmptyScalarEvent(state);
|
|
5864
|
+
else if (isPair) {
|
|
5865
|
+
restoreState(state, entryStart);
|
|
5866
|
+
addMappingEvent(state, entryStart.position, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, NO_RANGE$1, 2);
|
|
5867
|
+
parseNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
5868
|
+
addEmptyScalarEvent(state);
|
|
5869
|
+
addPopEvent(state);
|
|
5870
|
+
}
|
|
5871
|
+
ch2 = state.input.charCodeAt(state.position);
|
|
5872
|
+
if (ch2 === 44) {
|
|
5873
|
+
readNext = true;
|
|
5874
|
+
state.position++;
|
|
5875
|
+
} else readNext = false;
|
|
5876
|
+
}
|
|
5877
|
+
throwError(state, "unexpected end of the stream within a flow collection");
|
|
5878
|
+
}
|
|
5879
|
+
function readBlockSequence(state, nodeIndent, props) {
|
|
5880
|
+
if (state.firstTabInLine !== -1 || state.input.charCodeAt(state.position) !== 45 || !isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) return false;
|
|
5881
|
+
addSequenceEvent(state, state.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 1);
|
|
5882
|
+
while (state.input.charCodeAt(state.position) === 45 && isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) {
|
|
5883
|
+
if (state.firstTabInLine !== -1) {
|
|
5884
|
+
state.position = state.firstTabInLine;
|
|
5885
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
5886
|
+
}
|
|
5887
|
+
const entryLine = state.line;
|
|
5888
|
+
state.position++;
|
|
5889
|
+
const hadBreak = skipSeparationSpace(state, true) > 0;
|
|
5890
|
+
if (state.firstTabInLine !== -1 && state.input.charCodeAt(state.position) === 45 && isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) throwError(state, "bad indentation of a sequence entry");
|
|
5891
|
+
if (hadBreak && state.lineIndent <= nodeIndent) addEmptyScalarEvent(state);
|
|
5892
|
+
else parseNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
5893
|
+
skipSeparationSpace(state, true);
|
|
5894
|
+
if (state.lineIndent < nodeIndent || state.position >= state.length) break;
|
|
5895
|
+
if (state.lineIndent > nodeIndent) throwError(state, "bad indentation of a sequence entry");
|
|
5896
|
+
if (state.line === entryLine && state.input.charCodeAt(state.position) === 45 && isWsOrEolOrEnd(state.input.charCodeAt(state.position + 1))) throwError(state, "bad indentation of a sequence entry");
|
|
5897
|
+
}
|
|
5898
|
+
addPopEvent(state);
|
|
5899
|
+
return true;
|
|
5900
|
+
}
|
|
5901
|
+
function readBlockMapping(state, nodeIndent, flowIndent, props) {
|
|
5902
|
+
let atExplicitKey = false;
|
|
5903
|
+
let detected = false;
|
|
5904
|
+
let mappingOpened = false;
|
|
5905
|
+
let pendingExplicitKey = false;
|
|
5906
|
+
if (state.firstTabInLine !== -1) return false;
|
|
5907
|
+
let ch = state.input.charCodeAt(state.position);
|
|
5908
|
+
while (ch !== 0) {
|
|
5909
|
+
if (!atExplicitKey && state.firstTabInLine !== -1) {
|
|
5910
|
+
state.position = state.firstTabInLine;
|
|
5911
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
5912
|
+
}
|
|
5913
|
+
const following = state.input.charCodeAt(state.position + 1);
|
|
5914
|
+
const entryLine = state.line;
|
|
5915
|
+
if ((ch === 63 || ch === 58) && isWsOrEolOrEnd(following)) {
|
|
5916
|
+
if (!mappingOpened) {
|
|
5917
|
+
addMappingEvent(state, state.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 1);
|
|
5918
|
+
mappingOpened = true;
|
|
5919
|
+
}
|
|
5920
|
+
if (ch === 63) {
|
|
5921
|
+
if (atExplicitKey) addEmptyScalarEvent(state);
|
|
5922
|
+
detected = true;
|
|
5923
|
+
atExplicitKey = true;
|
|
5924
|
+
} else if (atExplicitKey) atExplicitKey = false;
|
|
5925
|
+
else {
|
|
5926
|
+
addEmptyScalarEvent(state);
|
|
5927
|
+
detected = true;
|
|
5928
|
+
atExplicitKey = false;
|
|
5929
|
+
}
|
|
5930
|
+
state.position += 1;
|
|
5931
|
+
pendingExplicitKey = true;
|
|
5932
|
+
} else {
|
|
5933
|
+
if (atExplicitKey) {
|
|
5934
|
+
addEmptyScalarEvent(state);
|
|
5935
|
+
atExplicitKey = false;
|
|
5936
|
+
}
|
|
5937
|
+
const beforeKey = snapshotState(state);
|
|
5938
|
+
if (!parseNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) break;
|
|
5939
|
+
if (state.line === entryLine) {
|
|
5940
|
+
ch = state.input.charCodeAt(state.position);
|
|
5941
|
+
while (isWhiteSpace(ch)) ch = state.input.charCodeAt(++state.position);
|
|
5942
|
+
if (ch === 58) {
|
|
5943
|
+
ch = state.input.charCodeAt(++state.position);
|
|
5944
|
+
if (!isWsOrEolOrEnd(ch)) throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
5945
|
+
if (!mappingOpened) {
|
|
5946
|
+
restoreState(state, beforeKey);
|
|
5947
|
+
addMappingEvent(state, beforeKey.position, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 1);
|
|
5948
|
+
mappingOpened = true;
|
|
5949
|
+
parseNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true);
|
|
5950
|
+
ch = state.input.charCodeAt(state.position);
|
|
5951
|
+
while (isWhiteSpace(ch)) ch = state.input.charCodeAt(++state.position);
|
|
5952
|
+
state.position++;
|
|
5953
|
+
}
|
|
5954
|
+
detected = true;
|
|
5955
|
+
atExplicitKey = false;
|
|
5956
|
+
pendingExplicitKey = false;
|
|
5957
|
+
} else if (detected) throwError(state, "expected ':' after a mapping key");
|
|
5958
|
+
else {
|
|
5959
|
+
if (props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1) {
|
|
5960
|
+
restoreState(state, beforeKey);
|
|
5961
|
+
return false;
|
|
5962
|
+
}
|
|
5963
|
+
return true;
|
|
5964
|
+
}
|
|
5965
|
+
} else if (detected) throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
5966
|
+
else {
|
|
5967
|
+
if (props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1) {
|
|
5968
|
+
restoreState(state, beforeKey);
|
|
5969
|
+
return false;
|
|
5970
|
+
}
|
|
5971
|
+
return true;
|
|
5972
|
+
}
|
|
5973
|
+
}
|
|
5974
|
+
if (parseNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, pendingExplicitKey)) pendingExplicitKey = false;
|
|
5975
|
+
if (!atExplicitKey) {
|
|
5976
|
+
if (pendingExplicitKey) {
|
|
5977
|
+
addEmptyScalarEvent(state);
|
|
5978
|
+
pendingExplicitKey = false;
|
|
5979
|
+
}
|
|
5980
|
+
}
|
|
5981
|
+
skipSeparationSpace(state, true);
|
|
5982
|
+
ch = state.input.charCodeAt(state.position);
|
|
5983
|
+
if ((state.line === entryLine || state.lineIndent > nodeIndent) && ch !== 0) throwError(state, "bad indentation of a mapping entry");
|
|
5984
|
+
else if (state.lineIndent < nodeIndent) break;
|
|
5985
|
+
}
|
|
5986
|
+
if (!detected) return false;
|
|
5987
|
+
if (atExplicitKey) addEmptyScalarEvent(state);
|
|
5988
|
+
if (mappingOpened) addPopEvent(state);
|
|
5989
|
+
return true;
|
|
5990
|
+
}
|
|
5991
|
+
function parseNode(state, parentIndent, nodeContext, allowToSeek, allowCompact, allowPropertyMapping = true) {
|
|
5992
|
+
if (state.depth >= state.maxDepth) throwError(state, `nesting exceeded maxDepth (${state.maxDepth})`);
|
|
5993
|
+
state.depth++;
|
|
5994
|
+
let indentStatus = 1;
|
|
5995
|
+
let atNewLine = false;
|
|
5996
|
+
let hasContent = false;
|
|
5997
|
+
let propertyStart = null;
|
|
5998
|
+
const props = emptyProperties();
|
|
5999
|
+
let allowBlockScalars = nodeContext === CONTEXT_BLOCK_OUT || nodeContext === CONTEXT_BLOCK_IN;
|
|
6000
|
+
let allowBlockCollections = allowBlockScalars;
|
|
6001
|
+
const allowBlockStyles = allowBlockScalars;
|
|
6002
|
+
if (allowToSeek && skipSeparationSpace(state, true)) {
|
|
6003
|
+
atNewLine = true;
|
|
6004
|
+
if (state.lineIndent > parentIndent) indentStatus = 1;
|
|
6005
|
+
else if (state.lineIndent === parentIndent) indentStatus = 0;
|
|
6006
|
+
else indentStatus = -1;
|
|
6007
|
+
}
|
|
6008
|
+
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
6009
|
+
state.depth--;
|
|
6010
|
+
return false;
|
|
6011
|
+
}
|
|
6012
|
+
if (indentStatus === 1) while (true) {
|
|
6013
|
+
const ch = state.input.charCodeAt(state.position);
|
|
6014
|
+
const propertyState = snapshotState(state);
|
|
6015
|
+
if (atNewLine && indentStatus !== 1 && (ch === 33 || ch === 38)) break;
|
|
6016
|
+
if (atNewLine && allowBlockStyles && (props.tagStart !== NO_RANGE$1 || props.anchorStart !== NO_RANGE$1) && (ch === 33 || ch === 38)) {
|
|
6017
|
+
const fallbackState = snapshotState(state);
|
|
6018
|
+
const flowIndent = parentIndent + 1;
|
|
6019
|
+
if (readBlockMapping(state, state.position - state.lineStart, flowIndent, props) && state.events[fallbackState.eventsLength]?.type === 3) {
|
|
6020
|
+
state.depth--;
|
|
6021
|
+
return true;
|
|
6022
|
+
}
|
|
6023
|
+
restoreState(state, fallbackState);
|
|
6024
|
+
}
|
|
6025
|
+
if (atNewLine && (ch === 33 && props.tagStart !== NO_RANGE$1 || ch === 38 && props.anchorStart !== NO_RANGE$1)) break;
|
|
6026
|
+
if (!readTagProperty(state, props, nodeContext === CONTEXT_FLOW_IN) && !readAnchorProperty(state, props)) break;
|
|
6027
|
+
if (propertyStart === null) propertyStart = propertyState;
|
|
6028
|
+
if (skipSeparationSpace(state, true)) {
|
|
6029
|
+
atNewLine = true;
|
|
6030
|
+
allowBlockCollections = allowBlockStyles;
|
|
6031
|
+
if (state.lineIndent > parentIndent) indentStatus = 1;
|
|
6032
|
+
else if (state.lineIndent === parentIndent) indentStatus = 0;
|
|
6033
|
+
else indentStatus = -1;
|
|
6034
|
+
} else allowBlockCollections = false;
|
|
6035
|
+
}
|
|
6036
|
+
if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact;
|
|
6037
|
+
if (indentStatus === 1 || nodeContext === CONTEXT_BLOCK_OUT) {
|
|
6038
|
+
const flowIndent = nodeContext === CONTEXT_FLOW_IN || nodeContext === CONTEXT_FLOW_OUT ? parentIndent : parentIndent + 1;
|
|
6039
|
+
const blockIndent = state.position - state.lineStart;
|
|
6040
|
+
if (indentStatus === 1) if (allowBlockCollections && (readBlockSequence(state, blockIndent, props) || readBlockMapping(state, blockIndent, flowIndent, props)) || readFlowCollection(state, flowIndent, props)) hasContent = true;
|
|
6041
|
+
else {
|
|
6042
|
+
const ch = state.input.charCodeAt(state.position);
|
|
6043
|
+
if (propertyStart !== null && allowPropertyMapping && allowBlockStyles && !allowBlockCollections && ch !== 124 && ch !== 62) {
|
|
6044
|
+
const fallbackState = snapshotState(state);
|
|
6045
|
+
const propertyIndent = propertyStart.position - propertyStart.lineStart;
|
|
6046
|
+
restoreState(state, propertyStart);
|
|
6047
|
+
if (readBlockMapping(state, propertyIndent, flowIndent, emptyProperties()) && state.events[fallbackState.eventsLength]?.type === 3) hasContent = true;
|
|
6048
|
+
else restoreState(state, fallbackState);
|
|
6049
|
+
}
|
|
6050
|
+
if (!hasContent && (allowBlockScalars && readBlockScalar(state, flowIndent, props) || readSingleQuotedScalar(state, flowIndent, props) || readDoubleQuotedScalar(state, flowIndent, props) || readAlias(state, props) || readPlainScalar(state, flowIndent, nodeContext, props))) hasContent = true;
|
|
6051
|
+
}
|
|
6052
|
+
else if (indentStatus === 0) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent, props);
|
|
6053
|
+
}
|
|
6054
|
+
allowBlockScalars = allowBlockScalars && !hasContent;
|
|
6055
|
+
if (!hasContent && (props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1 || allowBlockScalars)) {
|
|
6056
|
+
addScalarEvent(state, NO_RANGE$1, NO_RANGE$1, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 1);
|
|
6057
|
+
hasContent = true;
|
|
6058
|
+
}
|
|
6059
|
+
state.depth--;
|
|
6060
|
+
return hasContent || props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1;
|
|
6061
|
+
}
|
|
6062
|
+
function readDirective(state) {
|
|
6063
|
+
if (state.lineIndent > 0 || state.input.charCodeAt(state.position) !== 37) return false;
|
|
6064
|
+
state.position++;
|
|
6065
|
+
const nameStart = state.position;
|
|
6066
|
+
while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position))) state.position++;
|
|
6067
|
+
const name = state.input.slice(nameStart, state.position);
|
|
6068
|
+
const args = [];
|
|
6069
|
+
if (name.length === 0) throwError(state, "directive name must not be less than one character in length");
|
|
6070
|
+
while (state.input.charCodeAt(state.position) !== 0 && !isEol(state.input.charCodeAt(state.position))) {
|
|
6071
|
+
while (isWhiteSpace(state.input.charCodeAt(state.position))) state.position++;
|
|
6072
|
+
if (state.input.charCodeAt(state.position) === 35 || isEol(state.input.charCodeAt(state.position)) || state.input.charCodeAt(state.position) === 0) break;
|
|
6073
|
+
const start = state.position;
|
|
6074
|
+
while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position))) state.position++;
|
|
6075
|
+
args.push(state.input.slice(start, state.position));
|
|
6076
|
+
}
|
|
6077
|
+
if (isEol(state.input.charCodeAt(state.position))) consumeLineBreak(state);
|
|
6078
|
+
if (name === "YAML") {
|
|
6079
|
+
if (state.directives.some((directive) => directive.kind === "yaml")) throwError(state, "duplication of %YAML directive");
|
|
6080
|
+
if (args.length !== 1) throwError(state, "YAML directive accepts exactly one argument");
|
|
6081
|
+
const match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
6082
|
+
if (match === null) throwError(state, "ill-formed argument of the YAML directive");
|
|
6083
|
+
if (parseInt(match[1], 10) !== 1) throwError(state, "unacceptable YAML version of the document");
|
|
6084
|
+
state.directives.push({
|
|
6085
|
+
kind: "yaml",
|
|
6086
|
+
version: args[0]
|
|
6087
|
+
});
|
|
6088
|
+
} else if (name === "TAG") {
|
|
6089
|
+
if (args.length !== 2) throwError(state, "TAG directive accepts exactly two arguments");
|
|
6090
|
+
const [handle, prefix] = args;
|
|
6091
|
+
if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
6092
|
+
if (HAS_OWN.call(state.tagHandlers, handle)) throwError(state, `there is a previously declared suffix for "${handle}" tag handle`);
|
|
6093
|
+
if (!PATTERN_TAG_PREFIX.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
6094
|
+
state.tagHandlers[handle] = prefix;
|
|
6095
|
+
state.directives.push({
|
|
6096
|
+
kind: "tag",
|
|
6097
|
+
handle,
|
|
6098
|
+
prefix
|
|
6099
|
+
});
|
|
6100
|
+
}
|
|
6101
|
+
return true;
|
|
6102
|
+
}
|
|
6103
|
+
function readDocument(state) {
|
|
6104
|
+
state.directives = [];
|
|
6105
|
+
state.tagHandlers = /* @__PURE__ */ Object.create(null);
|
|
6106
|
+
let hasDirectives = false;
|
|
6107
|
+
skipSeparationSpace(state, true);
|
|
6108
|
+
while (readDirective(state)) {
|
|
6109
|
+
hasDirectives = true;
|
|
6110
|
+
skipSeparationSpace(state, true);
|
|
6111
|
+
}
|
|
6112
|
+
let explicitStart = false;
|
|
6113
|
+
let explicitEnd = false;
|
|
6114
|
+
let allowCompact = true;
|
|
6115
|
+
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45 && isWsOrEolOrEnd(state.input.charCodeAt(state.position + 3))) {
|
|
6116
|
+
explicitStart = true;
|
|
6117
|
+
const markerLine = state.line;
|
|
6118
|
+
state.position += 3;
|
|
6119
|
+
skipSeparationSpace(state, true);
|
|
6120
|
+
allowCompact = state.line > markerLine;
|
|
6121
|
+
} else if (hasDirectives) throwError(state, "directives end mark is expected");
|
|
6122
|
+
const documentEventIndex = state.events.length;
|
|
6123
|
+
if (!explicitStart && state.position === state.lineStart && state.input.charCodeAt(state.position) === 46 && testDocumentSeparator(state)) {
|
|
6124
|
+
state.position += 3;
|
|
6125
|
+
skipSeparationSpace(state, true);
|
|
6126
|
+
return;
|
|
6127
|
+
}
|
|
6128
|
+
addDocumentEvent(state, explicitStart, false);
|
|
6129
|
+
if (!parseNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, allowCompact, allowCompact)) addEmptyScalarEvent(state);
|
|
6130
|
+
skipSeparationSpace(state, true);
|
|
6131
|
+
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
6132
|
+
explicitEnd = state.input.charCodeAt(state.position) === 46;
|
|
6133
|
+
if (explicitEnd) {
|
|
6134
|
+
const markerLine = state.line;
|
|
6135
|
+
state.position += 3;
|
|
6136
|
+
skipSeparationSpace(state, true);
|
|
6137
|
+
if (state.line === markerLine && state.position < state.length) throwError(state, "end of the stream or a document separator is expected");
|
|
6138
|
+
}
|
|
6139
|
+
}
|
|
6140
|
+
const documentEvent = state.events[documentEventIndex];
|
|
6141
|
+
if (documentEvent?.type === 1) documentEvent.explicitEnd = explicitEnd;
|
|
6142
|
+
addPopEvent(state);
|
|
6143
|
+
if (!explicitEnd && state.position < state.length && !(state.position === state.lineStart && testDocumentSeparator(state))) throwError(state, "end of the stream or a document separator is expected");
|
|
6144
|
+
}
|
|
6145
|
+
function parseEvents(input, options2) {
|
|
6146
|
+
const length = input.length;
|
|
6147
|
+
const state = {
|
|
6148
|
+
...DEFAULT_PARSER_OPTIONS,
|
|
6149
|
+
...options2,
|
|
6150
|
+
input: `${input}\0`,
|
|
6151
|
+
length,
|
|
6152
|
+
position: 0,
|
|
6153
|
+
line: 0,
|
|
6154
|
+
lineStart: 0,
|
|
6155
|
+
lineIndent: 0,
|
|
6156
|
+
firstTabInLine: -1,
|
|
6157
|
+
depth: 0,
|
|
6158
|
+
directives: [],
|
|
6159
|
+
tagHandlers: /* @__PURE__ */ Object.create(null),
|
|
6160
|
+
events: []
|
|
6161
|
+
};
|
|
6162
|
+
const nullpos = input.indexOf("\0");
|
|
6163
|
+
if (nullpos !== -1) throwErrorAt(input, nullpos, "null byte is not allowed in input", state.filename);
|
|
6164
|
+
if (state.input.charCodeAt(state.position) === 65279) state.position++;
|
|
6165
|
+
while (state.position < state.length) {
|
|
6166
|
+
skipSeparationSpace(state, true);
|
|
6167
|
+
if (state.position >= state.length) break;
|
|
6168
|
+
const documentStart = state.position;
|
|
6169
|
+
readDocument(state);
|
|
6170
|
+
if (state.position === documentStart)
|
|
6171
|
+
throwError(state, "can not read a document");
|
|
6172
|
+
}
|
|
6173
|
+
return state.events;
|
|
6174
|
+
}
|
|
6175
|
+
var DEFAULT_LOAD_OPTIONS = {
|
|
6176
|
+
...DEFAULT_PARSER_OPTIONS,
|
|
6177
|
+
...DEFAULT_CONSTRUCTOR_OPTIONS
|
|
6178
|
+
};
|
|
6179
|
+
function loadDocuments(input, options2 = {}) {
|
|
6180
|
+
const opts = {
|
|
6181
|
+
...DEFAULT_LOAD_OPTIONS,
|
|
6182
|
+
...options2
|
|
6183
|
+
};
|
|
6184
|
+
const source = String(input);
|
|
6185
|
+
const PARSER_OPT_KEYS = Object.keys(DEFAULT_PARSER_OPTIONS);
|
|
6186
|
+
const CONSTRUCTOR_OPT_KEYS = Object.keys(DEFAULT_CONSTRUCTOR_OPTIONS);
|
|
6187
|
+
return constructFromEvents(parseEvents(source, pick(opts, PARSER_OPT_KEYS)), {
|
|
6188
|
+
...pick(opts, CONSTRUCTOR_OPT_KEYS),
|
|
6189
|
+
source
|
|
6190
|
+
});
|
|
6191
|
+
}
|
|
6192
|
+
function load(input, options2) {
|
|
6193
|
+
const documents = loadDocuments(input, options2);
|
|
6194
|
+
if (documents.length === 0) throw new YAMLException("expected a document, but the input is empty");
|
|
6195
|
+
if (documents.length === 1) return documents[0];
|
|
6196
|
+
throw new YAMLException("expected a single document in the stream, but found more");
|
|
6197
|
+
}
|
|
6198
|
+
var ESCAPE_SEQUENCES = {};
|
|
6199
|
+
ESCAPE_SEQUENCES[0] = "\\0";
|
|
6200
|
+
ESCAPE_SEQUENCES[7] = "\\a";
|
|
6201
|
+
ESCAPE_SEQUENCES[8] = "\\b";
|
|
6202
|
+
ESCAPE_SEQUENCES[9] = "\\t";
|
|
6203
|
+
ESCAPE_SEQUENCES[10] = "\\n";
|
|
6204
|
+
ESCAPE_SEQUENCES[11] = "\\v";
|
|
6205
|
+
ESCAPE_SEQUENCES[12] = "\\f";
|
|
6206
|
+
ESCAPE_SEQUENCES[13] = "\\r";
|
|
6207
|
+
ESCAPE_SEQUENCES[27] = "\\e";
|
|
6208
|
+
ESCAPE_SEQUENCES[34] = '\\"';
|
|
6209
|
+
ESCAPE_SEQUENCES[92] = "\\\\";
|
|
6210
|
+
ESCAPE_SEQUENCES[133] = "\\N";
|
|
6211
|
+
ESCAPE_SEQUENCES[160] = "\\_";
|
|
6212
|
+
ESCAPE_SEQUENCES[8232] = "\\L";
|
|
6213
|
+
ESCAPE_SEQUENCES[8233] = "\\P";
|
|
6214
|
+
var DEFAULT_PRESENTER_OPTIONS = {
|
|
6215
|
+
indent: 2,
|
|
6216
|
+
seqNoIndent: false,
|
|
6217
|
+
seqInlineFirst: true,
|
|
6218
|
+
sortKeys: false,
|
|
6219
|
+
lineWidth: 80,
|
|
6220
|
+
flowBracketPadding: false,
|
|
6221
|
+
flowSkipCommaSpace: false,
|
|
6222
|
+
flowSkipColonSpace: false,
|
|
6223
|
+
quoteFlowKeys: false,
|
|
6224
|
+
quoteStyle: "single",
|
|
6225
|
+
forceQuotes: false,
|
|
6226
|
+
tagBeforeAnchor: false
|
|
6227
|
+
};
|
|
6228
|
+
var DEFAULT_DUMP_SCHEMA = YAML11_SCHEMA.withTags({
|
|
6229
|
+
...intYaml11Tag,
|
|
6230
|
+
resolve: (source, isExplicit, tagName) => {
|
|
6231
|
+
const result = intYaml11Tag.resolve(source, isExplicit, tagName);
|
|
6232
|
+
return result === NOT_RESOLVED ? intCoreTag.resolve(source, isExplicit, tagName) : result;
|
|
6233
|
+
}
|
|
6234
|
+
}, {
|
|
6235
|
+
...floatYaml11Tag,
|
|
6236
|
+
resolve: (source, isExplicit, tagName) => {
|
|
6237
|
+
const result = floatYaml11Tag.resolve(source, isExplicit, tagName);
|
|
6238
|
+
return result === NOT_RESOLVED ? floatCoreTag.resolve(source, isExplicit, tagName) : result;
|
|
6239
|
+
}
|
|
6240
|
+
});
|
|
6241
|
+
var DEFAULT_DUMP_OPTIONS = {
|
|
6242
|
+
...DEFAULT_PRESENTER_OPTIONS,
|
|
6243
|
+
schema: DEFAULT_DUMP_SCHEMA,
|
|
6244
|
+
skipInvalid: false,
|
|
6245
|
+
noRefs: false,
|
|
6246
|
+
flowLevel: -1,
|
|
6247
|
+
transform: () => {
|
|
6248
|
+
}
|
|
6249
|
+
};
|
|
6250
|
+
|
|
6251
|
+
// src/skill-scripts/shared/execution-routing.ts
|
|
6252
|
+
var WORKSPACE_CONFIG_RELPATH = path4.join("config", "config.yaml");
|
|
6253
|
+
var EXECUTION_ROUTING_SECTION = "execution_routing";
|
|
6254
|
+
var isPlainObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6255
|
+
var isNonEmptyString = (value) => typeof value === "string" && value.trim().length > 0;
|
|
6256
|
+
var validateTarget = (profileName, index, raw, supportedHarnesses, errors) => {
|
|
6257
|
+
const label = `profile "${profileName}" models[${index}]`;
|
|
6258
|
+
if (!isPlainObject2(raw)) {
|
|
6259
|
+
errors.push(`${label} must be a mapping with an exact "model" string.`);
|
|
6260
|
+
return null;
|
|
6261
|
+
}
|
|
6262
|
+
for (const key of Object.keys(raw)) {
|
|
6263
|
+
if (key !== "model" && key !== "harness" && key !== "reasoning_effort") {
|
|
6264
|
+
errors.push(`${label} has unknown key "${key}".`);
|
|
6265
|
+
return null;
|
|
6266
|
+
}
|
|
6267
|
+
}
|
|
6268
|
+
if (!isNonEmptyString(raw.model)) {
|
|
6269
|
+
errors.push(`${label} requires a non-empty exact "model" string.`);
|
|
6270
|
+
return null;
|
|
6271
|
+
}
|
|
6272
|
+
const target = { model: raw.model };
|
|
6273
|
+
if ("harness" in raw) {
|
|
6274
|
+
if (!isNonEmptyString(raw.harness)) {
|
|
6275
|
+
errors.push(`${label} "harness" must be a non-empty string when provided.`);
|
|
6276
|
+
return null;
|
|
6277
|
+
}
|
|
6278
|
+
if (!supportedHarnesses.includes(raw.harness)) {
|
|
6279
|
+
errors.push(`${label} harness "${raw.harness}" is not a supported harness.`);
|
|
6280
|
+
return null;
|
|
6281
|
+
}
|
|
6282
|
+
target.harness = raw.harness;
|
|
3772
6283
|
}
|
|
3773
|
-
if (
|
|
3774
|
-
|
|
3775
|
-
"
|
|
3776
|
-
|
|
6284
|
+
if ("reasoning_effort" in raw) {
|
|
6285
|
+
if (!isNonEmptyString(raw.reasoning_effort)) {
|
|
6286
|
+
errors.push(`${label} "reasoning_effort" must be a non-empty string when provided.`);
|
|
6287
|
+
return null;
|
|
6288
|
+
}
|
|
6289
|
+
target.reasoning_effort = raw.reasoning_effort;
|
|
6290
|
+
}
|
|
6291
|
+
return target;
|
|
6292
|
+
};
|
|
6293
|
+
var validateProfile = (name, raw, supportedHarnesses, errors) => {
|
|
6294
|
+
if (!isPlainObject2(raw)) {
|
|
6295
|
+
errors.push(`profile "${name}" must be a mapping with "description" and "models".`);
|
|
6296
|
+
return null;
|
|
6297
|
+
}
|
|
6298
|
+
if ("resolver" in raw) {
|
|
6299
|
+
errors.push(
|
|
6300
|
+
`profile "${name}" configures a per-profile resolver; only the single top-level "resolver" is supported.`
|
|
3777
6301
|
);
|
|
6302
|
+
return null;
|
|
6303
|
+
}
|
|
6304
|
+
for (const key of Object.keys(raw)) {
|
|
6305
|
+
if (key !== "description" && key !== "models") {
|
|
6306
|
+
errors.push(`profile "${name}" has unknown key "${key}".`);
|
|
6307
|
+
return null;
|
|
6308
|
+
}
|
|
3778
6309
|
}
|
|
3779
|
-
|
|
6310
|
+
if (!isNonEmptyString(raw.description)) {
|
|
6311
|
+
errors.push(`profile "${name}" requires a non-empty LLM-facing "description".`);
|
|
6312
|
+
return null;
|
|
6313
|
+
}
|
|
6314
|
+
if (!Array.isArray(raw.models) || raw.models.length === 0) {
|
|
6315
|
+
errors.push(`profile "${name}" requires a non-empty ordered "models" array.`);
|
|
6316
|
+
return null;
|
|
6317
|
+
}
|
|
6318
|
+
const targets = [];
|
|
6319
|
+
for (let i = 0; i < raw.models.length; i += 1) {
|
|
6320
|
+
const target = validateTarget(name, i, raw.models[i], supportedHarnesses, errors);
|
|
6321
|
+
if (!target) return null;
|
|
6322
|
+
targets.push(target);
|
|
6323
|
+
}
|
|
6324
|
+
return { name, description: raw.description.trim(), targets };
|
|
6325
|
+
};
|
|
6326
|
+
var loadRoutingConfig = (strikethrooRoot, supportedHarnesses) => {
|
|
6327
|
+
const configPath = path4.join(strikethrooRoot, WORKSPACE_CONFIG_RELPATH);
|
|
6328
|
+
let contents;
|
|
6329
|
+
try {
|
|
6330
|
+
contents = fs3.readFileSync(configPath, "utf8");
|
|
6331
|
+
} catch {
|
|
6332
|
+
return { kind: "no-config" };
|
|
6333
|
+
}
|
|
6334
|
+
const hasContent = contents.split(/\r?\n/).some((line) => {
|
|
6335
|
+
const trimmed = line.trim();
|
|
6336
|
+
return trimmed !== "" && !trimmed.startsWith("#");
|
|
6337
|
+
});
|
|
6338
|
+
if (!hasContent) return { kind: "disabled" };
|
|
6339
|
+
let document;
|
|
6340
|
+
try {
|
|
6341
|
+
document = load(contents);
|
|
6342
|
+
} catch (error) {
|
|
6343
|
+
return {
|
|
6344
|
+
kind: "invalid",
|
|
6345
|
+
errors: [
|
|
6346
|
+
`config.yaml is not valid YAML: ${error instanceof Error ? error.message : String(error)}`
|
|
6347
|
+
]
|
|
6348
|
+
};
|
|
6349
|
+
}
|
|
6350
|
+
if (document === null || document === void 0) return { kind: "disabled" };
|
|
6351
|
+
if (!isPlainObject2(document)) {
|
|
6352
|
+
return { kind: "invalid", errors: ["config.yaml must be a YAML mapping."] };
|
|
6353
|
+
}
|
|
6354
|
+
const section = document[EXECUTION_ROUTING_SECTION];
|
|
6355
|
+
if (section === null || section === void 0) return { kind: "disabled" };
|
|
6356
|
+
const errors = [];
|
|
6357
|
+
if (!isPlainObject2(section)) {
|
|
6358
|
+
return {
|
|
6359
|
+
kind: "invalid",
|
|
6360
|
+
errors: [`config.yaml "${EXECUTION_ROUTING_SECTION}" must be a YAML mapping.`]
|
|
6361
|
+
};
|
|
6362
|
+
}
|
|
6363
|
+
for (const key of Object.keys(section)) {
|
|
6364
|
+
if (key !== "profiles" && key !== "resolver") {
|
|
6365
|
+
errors.push(`${EXECUTION_ROUTING_SECTION} has unknown key "${key}".`);
|
|
6366
|
+
}
|
|
6367
|
+
}
|
|
6368
|
+
const rawProfiles = "profiles" in section && section.profiles == null ? {} : section.profiles;
|
|
6369
|
+
if (!("profiles" in section) || !isPlainObject2(rawProfiles)) {
|
|
6370
|
+
errors.push(`${EXECUTION_ROUTING_SECTION} requires a "profiles" mapping.`);
|
|
6371
|
+
return { kind: "invalid", errors };
|
|
6372
|
+
}
|
|
6373
|
+
const profiles = [];
|
|
6374
|
+
for (const [name, rawProfile] of Object.entries(rawProfiles)) {
|
|
6375
|
+
const profile = validateProfile(name, rawProfile, supportedHarnesses, errors);
|
|
6376
|
+
if (profile) profiles.push(profile);
|
|
6377
|
+
}
|
|
6378
|
+
let resolverScript;
|
|
6379
|
+
if ("resolver" in section) {
|
|
6380
|
+
const resolver = section.resolver;
|
|
6381
|
+
if (!isPlainObject2(resolver) || !isNonEmptyString(resolver.script)) {
|
|
6382
|
+
errors.push('resolver must be a mapping with a non-empty "script" path.');
|
|
6383
|
+
} else {
|
|
6384
|
+
for (const key of Object.keys(resolver)) {
|
|
6385
|
+
if (key !== "script") errors.push(`resolver has unknown key "${key}".`);
|
|
6386
|
+
}
|
|
6387
|
+
resolverScript = resolver.script;
|
|
6388
|
+
}
|
|
6389
|
+
}
|
|
6390
|
+
if (errors.length > 0) return { kind: "invalid", errors };
|
|
6391
|
+
if (profiles.length === 0) return { kind: "disabled" };
|
|
6392
|
+
const config = { profiles };
|
|
6393
|
+
if (resolverScript !== void 0) config.resolverScript = resolverScript;
|
|
6394
|
+
return { kind: "config", config };
|
|
3780
6395
|
};
|
|
3781
6396
|
|
|
3782
6397
|
// src/skill-scripts/dispatch-task-execution.ts
|
|
@@ -3786,36 +6401,132 @@ var emit = (result, exitCode) => {
|
|
|
3786
6401
|
process.exit(exitCode);
|
|
3787
6402
|
};
|
|
3788
6403
|
var errorMessage2 = (error) => error instanceof Error ? error.message : String(error);
|
|
6404
|
+
var encodeHandoff = (route) => Buffer.from(JSON.stringify({ version: 1, ...route }), "utf8").toString("base64url");
|
|
6405
|
+
var decodeHandoff = (encoded) => {
|
|
6406
|
+
let raw;
|
|
6407
|
+
try {
|
|
6408
|
+
raw = JSON.parse(Buffer.from(encoded, "base64url").toString("utf8"));
|
|
6409
|
+
} catch {
|
|
6410
|
+
throw new Error("Resolved execution handoff is not valid encoded JSON.");
|
|
6411
|
+
}
|
|
6412
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
6413
|
+
throw new Error("Resolved execution handoff must be an object.");
|
|
6414
|
+
}
|
|
6415
|
+
const value = raw;
|
|
6416
|
+
const allowed = ["version", "kind", "harness", "model", "reasoningEffort"];
|
|
6417
|
+
if (Object.keys(value).some((key) => !allowed.includes(key)) || value.version !== 1 || value.kind !== "external-override" || typeof value.harness !== "string" || !SUPPORTED_HARNESSES.includes(value.harness) || typeof value.model !== "string" || value.model.length === 0 || "reasoningEffort" in value && typeof value.reasoningEffort !== "string") {
|
|
6418
|
+
throw new Error("Resolved execution handoff has an invalid shape.");
|
|
6419
|
+
}
|
|
6420
|
+
return value;
|
|
6421
|
+
};
|
|
6422
|
+
var externalRoute = (harness, model, reasoningEffort) => {
|
|
6423
|
+
const exact = {
|
|
6424
|
+
kind: "external-override",
|
|
6425
|
+
harness,
|
|
6426
|
+
model,
|
|
6427
|
+
...reasoningEffort === void 0 ? {} : { reasoningEffort }
|
|
6428
|
+
};
|
|
6429
|
+
return { ...exact, handoff: encodeHandoff(exact) };
|
|
6430
|
+
};
|
|
6431
|
+
var readProfile = (taskMarkdown) => {
|
|
6432
|
+
const parsed = (0, import_gray_matter.default)(taskMarkdown, {});
|
|
6433
|
+
const profile = parsed.data.execution_profile;
|
|
6434
|
+
return typeof profile === "string" && profile.trim() ? profile : void 0;
|
|
6435
|
+
};
|
|
6436
|
+
var resolveDispatchRoute = async (request) => {
|
|
6437
|
+
const profile = readProfile(request.taskMarkdown);
|
|
6438
|
+
if (!profile) return { kind: "native-default" };
|
|
6439
|
+
const configResult = loadRoutingConfig(request.strikethrooRoot, SUPPORTED_HARNESSES);
|
|
6440
|
+
if (configResult.kind !== "config") {
|
|
6441
|
+
return {
|
|
6442
|
+
kind: "fallback",
|
|
6443
|
+
reason: "invalid-execution",
|
|
6444
|
+
detail: configResult.kind === "invalid" ? `Execution routing configuration is invalid: ${configResult.errors.join(" ")}` : `Execution profile "${profile}" cannot be resolved because routing is disabled.`
|
|
6445
|
+
};
|
|
6446
|
+
}
|
|
6447
|
+
const avoided = /* @__PURE__ */ new Set();
|
|
6448
|
+
const unavailable = [];
|
|
6449
|
+
const candidateCount = configResult.config.profiles.find((candidate) => candidate.name === profile)?.targets.length ?? 0;
|
|
6450
|
+
for (let attempt = 0; attempt < Math.max(1, candidateCount); attempt += 1) {
|
|
6451
|
+
const selection = selectDispatchTarget(configResult.config, profile, avoided, {
|
|
6452
|
+
projectRoot: request.workspace,
|
|
6453
|
+
taskId: request.taskId
|
|
6454
|
+
});
|
|
6455
|
+
if (selection.kind === "native-default") {
|
|
6456
|
+
return { kind: "fallback", reason: selection.reason, detail: selection.detail };
|
|
6457
|
+
}
|
|
6458
|
+
const harness = selection.target.harness;
|
|
6459
|
+
if (harness === void 0 || harness === request.currentHarness) {
|
|
6460
|
+
return {
|
|
6461
|
+
kind: "native-override",
|
|
6462
|
+
model: selection.target.model,
|
|
6463
|
+
...selection.target.reasoning_effort === void 0 ? {} : { reasoningEffort: selection.target.reasoning_effort }
|
|
6464
|
+
};
|
|
6465
|
+
}
|
|
6466
|
+
const availability = await checkHarnessAvailability({
|
|
6467
|
+
strikethrooRoot: request.strikethrooRoot,
|
|
6468
|
+
workspace: request.workspace,
|
|
6469
|
+
harness,
|
|
6470
|
+
currentHarness: request.currentHarness
|
|
6471
|
+
});
|
|
6472
|
+
if (availability.available) {
|
|
6473
|
+
return externalRoute(harness, selection.target.model, selection.target.reasoning_effort);
|
|
6474
|
+
}
|
|
6475
|
+
unavailable.push(
|
|
6476
|
+
`${harness} (${availability.source === "probe" ? "fresh" : availability.source})`
|
|
6477
|
+
);
|
|
6478
|
+
avoided.add(selection.id);
|
|
6479
|
+
}
|
|
6480
|
+
return {
|
|
6481
|
+
kind: "fallback",
|
|
6482
|
+
reason: "invalid-execution",
|
|
6483
|
+
detail: `All configured targets for execution profile "${profile}" are unavailable or exhausted.` + (unavailable.length === 0 ? "" : ` Observations: ${unavailable.join("; ")}`)
|
|
6484
|
+
};
|
|
6485
|
+
};
|
|
3789
6486
|
var main = async () => {
|
|
3790
6487
|
const args = process.argv.slice(2);
|
|
3791
|
-
const mode = args
|
|
3792
|
-
if (
|
|
6488
|
+
const mode = args.shift();
|
|
6489
|
+
if (mode !== "resolve" && mode !== "execute" || args.length < (mode === "execute" ? 6 : 5)) {
|
|
3793
6490
|
emit(
|
|
3794
6491
|
{
|
|
3795
6492
|
kind: "infrastructure-failure",
|
|
3796
|
-
detail: "Usage: dispatch-task-execution.cjs
|
|
6493
|
+
detail: "Usage: dispatch-task-execution.cjs resolve <task-file> <current-harness> <workspace> <plan-id> <task-id> | execute <handoff> <task-file> <current-harness> <workspace> <plan-id> <task-id>"
|
|
3797
6494
|
},
|
|
3798
6495
|
2
|
|
3799
6496
|
);
|
|
3800
6497
|
}
|
|
3801
|
-
const
|
|
3802
|
-
const
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
currentHarness,
|
|
3806
|
-
supportedHarnesses: SUPPORTED_HARNESSES
|
|
3807
|
-
});
|
|
3808
|
-
if (mode === "resolve") emit(policy, 0);
|
|
3809
|
-
if (policy.kind !== "external-override") {
|
|
3810
|
-
emit(policy.kind === "native-default" ? { kind: "native-default" } : policy, 0);
|
|
6498
|
+
const handoffArg = mode === "execute" ? args.shift() : void 0;
|
|
6499
|
+
const [taskFile, currentHarnessRaw, workspace, planId, taskId] = args;
|
|
6500
|
+
if (!taskFile || !currentHarnessRaw || !workspace || !planId || !taskId || !SUPPORTED_HARNESSES.includes(currentHarnessRaw)) {
|
|
6501
|
+
emit({ kind: "infrastructure-failure", detail: "Task dispatch arguments are invalid." }, 2);
|
|
3811
6502
|
}
|
|
3812
|
-
const
|
|
6503
|
+
const validTaskFile = taskFile;
|
|
6504
|
+
const validCurrentHarness = currentHarnessRaw;
|
|
6505
|
+
const validWorkspace = workspace;
|
|
6506
|
+
const validPlanId = planId;
|
|
6507
|
+
const validTaskId = taskId;
|
|
6508
|
+
const taskPath = path5.resolve(validTaskFile);
|
|
6509
|
+
const taskMarkdown = fs4.readFileSync(taskPath, "utf8");
|
|
6510
|
+
if (mode === "resolve") {
|
|
6511
|
+
emit(
|
|
6512
|
+
await resolveDispatchRoute({
|
|
6513
|
+
taskMarkdown,
|
|
6514
|
+
currentHarness: validCurrentHarness,
|
|
6515
|
+
workspace: path5.resolve(validWorkspace),
|
|
6516
|
+
strikethrooRoot: path5.join(path5.resolve(validWorkspace), ".ai", "strikethroo"),
|
|
6517
|
+
taskId: Number(validTaskId)
|
|
6518
|
+
}),
|
|
6519
|
+
0
|
|
6520
|
+
);
|
|
6521
|
+
}
|
|
6522
|
+
const handoff = decodeHandoff(handoffArg);
|
|
3813
6523
|
const result = await dispatchExternalTask({
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
6524
|
+
harness: handoff.harness,
|
|
6525
|
+
model: handoff.model,
|
|
6526
|
+
...handoff.reasoningEffort === void 0 ? {} : { reasoningEffort: handoff.reasoningEffort },
|
|
6527
|
+
workspace: path5.resolve(validWorkspace),
|
|
6528
|
+
planId: validPlanId,
|
|
6529
|
+
taskId: validTaskId,
|
|
3819
6530
|
taskFile: taskPath,
|
|
3820
6531
|
taskMarkdown
|
|
3821
6532
|
});
|
|
@@ -3833,6 +6544,10 @@ main().catch((error) => {
|
|
|
3833
6544
|
2
|
|
3834
6545
|
);
|
|
3835
6546
|
});
|
|
6547
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
6548
|
+
0 && (module.exports = {
|
|
6549
|
+
resolveDispatchRoute
|
|
6550
|
+
});
|
|
3836
6551
|
/*! Bundled license information:
|
|
3837
6552
|
|
|
3838
6553
|
is-extendable/index.js:
|
|
@@ -3850,4 +6565,7 @@ strip-bom-string/index.js:
|
|
|
3850
6565
|
* Copyright (c) 2015, 2017, Jon Schlinkert.
|
|
3851
6566
|
* Released under the MIT License.
|
|
3852
6567
|
*)
|
|
6568
|
+
|
|
6569
|
+
js-yaml/dist/js-yaml.mjs:
|
|
6570
|
+
(*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT *)
|
|
3853
6571
|
*/
|