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
|
@@ -6,3517 +6,26 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
|
|
29
|
-
// node_modules/kind-of/index.js
|
|
30
|
-
var require_kind_of = __commonJS({
|
|
31
|
-
"node_modules/kind-of/index.js"(exports2, module2) {
|
|
32
|
-
var toString = Object.prototype.toString;
|
|
33
|
-
module2.exports = function kindOf(val) {
|
|
34
|
-
if (val === void 0) return "undefined";
|
|
35
|
-
if (val === null) return "null";
|
|
36
|
-
var type = typeof val;
|
|
37
|
-
if (type === "boolean") return "boolean";
|
|
38
|
-
if (type === "string") return "string";
|
|
39
|
-
if (type === "number") return "number";
|
|
40
|
-
if (type === "symbol") return "symbol";
|
|
41
|
-
if (type === "function") {
|
|
42
|
-
return isGeneratorFn(val) ? "generatorfunction" : "function";
|
|
43
|
-
}
|
|
44
|
-
if (isArray(val)) return "array";
|
|
45
|
-
if (isBuffer(val)) return "buffer";
|
|
46
|
-
if (isArguments(val)) return "arguments";
|
|
47
|
-
if (isDate(val)) return "date";
|
|
48
|
-
if (isError(val)) return "error";
|
|
49
|
-
if (isRegexp(val)) return "regexp";
|
|
50
|
-
switch (ctorName(val)) {
|
|
51
|
-
case "Symbol":
|
|
52
|
-
return "symbol";
|
|
53
|
-
case "Promise":
|
|
54
|
-
return "promise";
|
|
55
|
-
// Set, Map, WeakSet, WeakMap
|
|
56
|
-
case "WeakMap":
|
|
57
|
-
return "weakmap";
|
|
58
|
-
case "WeakSet":
|
|
59
|
-
return "weakset";
|
|
60
|
-
case "Map":
|
|
61
|
-
return "map";
|
|
62
|
-
case "Set":
|
|
63
|
-
return "set";
|
|
64
|
-
// 8-bit typed arrays
|
|
65
|
-
case "Int8Array":
|
|
66
|
-
return "int8array";
|
|
67
|
-
case "Uint8Array":
|
|
68
|
-
return "uint8array";
|
|
69
|
-
case "Uint8ClampedArray":
|
|
70
|
-
return "uint8clampedarray";
|
|
71
|
-
// 16-bit typed arrays
|
|
72
|
-
case "Int16Array":
|
|
73
|
-
return "int16array";
|
|
74
|
-
case "Uint16Array":
|
|
75
|
-
return "uint16array";
|
|
76
|
-
// 32-bit typed arrays
|
|
77
|
-
case "Int32Array":
|
|
78
|
-
return "int32array";
|
|
79
|
-
case "Uint32Array":
|
|
80
|
-
return "uint32array";
|
|
81
|
-
case "Float32Array":
|
|
82
|
-
return "float32array";
|
|
83
|
-
case "Float64Array":
|
|
84
|
-
return "float64array";
|
|
85
|
-
}
|
|
86
|
-
if (isGeneratorObj(val)) {
|
|
87
|
-
return "generator";
|
|
88
|
-
}
|
|
89
|
-
type = toString.call(val);
|
|
90
|
-
switch (type) {
|
|
91
|
-
case "[object Object]":
|
|
92
|
-
return "object";
|
|
93
|
-
// iterators
|
|
94
|
-
case "[object Map Iterator]":
|
|
95
|
-
return "mapiterator";
|
|
96
|
-
case "[object Set Iterator]":
|
|
97
|
-
return "setiterator";
|
|
98
|
-
case "[object String Iterator]":
|
|
99
|
-
return "stringiterator";
|
|
100
|
-
case "[object Array Iterator]":
|
|
101
|
-
return "arrayiterator";
|
|
102
|
-
}
|
|
103
|
-
return type.slice(8, -1).toLowerCase().replace(/\s/g, "");
|
|
104
|
-
};
|
|
105
|
-
function ctorName(val) {
|
|
106
|
-
return typeof val.constructor === "function" ? val.constructor.name : null;
|
|
107
|
-
}
|
|
108
|
-
function isArray(val) {
|
|
109
|
-
if (Array.isArray) return Array.isArray(val);
|
|
110
|
-
return val instanceof Array;
|
|
111
|
-
}
|
|
112
|
-
function isError(val) {
|
|
113
|
-
return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
|
|
114
|
-
}
|
|
115
|
-
function isDate(val) {
|
|
116
|
-
if (val instanceof Date) return true;
|
|
117
|
-
return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
|
|
118
|
-
}
|
|
119
|
-
function isRegexp(val) {
|
|
120
|
-
if (val instanceof RegExp) return true;
|
|
121
|
-
return typeof val.flags === "string" && typeof val.ignoreCase === "boolean" && typeof val.multiline === "boolean" && typeof val.global === "boolean";
|
|
122
|
-
}
|
|
123
|
-
function isGeneratorFn(name, val) {
|
|
124
|
-
return ctorName(name) === "GeneratorFunction";
|
|
125
|
-
}
|
|
126
|
-
function isGeneratorObj(val) {
|
|
127
|
-
return typeof val.throw === "function" && typeof val.return === "function" && typeof val.next === "function";
|
|
128
|
-
}
|
|
129
|
-
function isArguments(val) {
|
|
130
|
-
try {
|
|
131
|
-
if (typeof val.length === "number" && typeof val.callee === "function") {
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
} catch (err) {
|
|
135
|
-
if (err.message.indexOf("callee") !== -1) {
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
function isBuffer(val) {
|
|
142
|
-
if (val.constructor && typeof val.constructor.isBuffer === "function") {
|
|
143
|
-
return val.constructor.isBuffer(val);
|
|
144
|
-
}
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
// node_modules/is-extendable/index.js
|
|
151
|
-
var require_is_extendable = __commonJS({
|
|
152
|
-
"node_modules/is-extendable/index.js"(exports2, module2) {
|
|
153
|
-
"use strict";
|
|
154
|
-
module2.exports = function isExtendable(val) {
|
|
155
|
-
return typeof val !== "undefined" && val !== null && (typeof val === "object" || typeof val === "function");
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
// node_modules/extend-shallow/index.js
|
|
161
|
-
var require_extend_shallow = __commonJS({
|
|
162
|
-
"node_modules/extend-shallow/index.js"(exports2, module2) {
|
|
163
|
-
"use strict";
|
|
164
|
-
var isObject = require_is_extendable();
|
|
165
|
-
module2.exports = function extend(o) {
|
|
166
|
-
if (!isObject(o)) {
|
|
167
|
-
o = {};
|
|
168
|
-
}
|
|
169
|
-
var len = arguments.length;
|
|
170
|
-
for (var i = 1; i < len; i++) {
|
|
171
|
-
var obj = arguments[i];
|
|
172
|
-
if (isObject(obj)) {
|
|
173
|
-
assign(o, obj);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return o;
|
|
177
|
-
};
|
|
178
|
-
function assign(a, b) {
|
|
179
|
-
for (var key in b) {
|
|
180
|
-
if (hasOwn2(b, key)) {
|
|
181
|
-
a[key] = b[key];
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
function hasOwn2(obj, key) {
|
|
186
|
-
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
// node_modules/section-matter/index.js
|
|
192
|
-
var require_section_matter = __commonJS({
|
|
193
|
-
"node_modules/section-matter/index.js"(exports2, module2) {
|
|
194
|
-
"use strict";
|
|
195
|
-
var typeOf = require_kind_of();
|
|
196
|
-
var extend = require_extend_shallow();
|
|
197
|
-
module2.exports = function(input, options2) {
|
|
198
|
-
if (typeof options2 === "function") {
|
|
199
|
-
options2 = { parse: options2 };
|
|
200
|
-
}
|
|
201
|
-
var file = toObject(input);
|
|
202
|
-
var defaults = { section_delimiter: "---", parse: identity };
|
|
203
|
-
var opts = extend({}, defaults, options2);
|
|
204
|
-
var delim = opts.section_delimiter;
|
|
205
|
-
var lines = file.content.split(/\r?\n/);
|
|
206
|
-
var sections = null;
|
|
207
|
-
var section = createSection();
|
|
208
|
-
var content = [];
|
|
209
|
-
var stack = [];
|
|
210
|
-
function initSections(val) {
|
|
211
|
-
file.content = val;
|
|
212
|
-
sections = [];
|
|
213
|
-
content = [];
|
|
214
|
-
}
|
|
215
|
-
function closeSection(val) {
|
|
216
|
-
if (stack.length) {
|
|
217
|
-
section.key = getKey(stack[0], delim);
|
|
218
|
-
section.content = val;
|
|
219
|
-
opts.parse(section, sections);
|
|
220
|
-
sections.push(section);
|
|
221
|
-
section = createSection();
|
|
222
|
-
content = [];
|
|
223
|
-
stack = [];
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
for (var i = 0; i < lines.length; i++) {
|
|
227
|
-
var line = lines[i];
|
|
228
|
-
var len = stack.length;
|
|
229
|
-
var ln = line.trim();
|
|
230
|
-
if (isDelimiter(ln, delim)) {
|
|
231
|
-
if (ln.length === 3 && i !== 0) {
|
|
232
|
-
if (len === 0 || len === 2) {
|
|
233
|
-
content.push(line);
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
236
|
-
stack.push(ln);
|
|
237
|
-
section.data = content.join("\n");
|
|
238
|
-
content = [];
|
|
239
|
-
continue;
|
|
240
|
-
}
|
|
241
|
-
if (sections === null) {
|
|
242
|
-
initSections(content.join("\n"));
|
|
243
|
-
}
|
|
244
|
-
if (len === 2) {
|
|
245
|
-
closeSection(content.join("\n"));
|
|
246
|
-
}
|
|
247
|
-
stack.push(ln);
|
|
248
|
-
continue;
|
|
249
|
-
}
|
|
250
|
-
content.push(line);
|
|
251
|
-
}
|
|
252
|
-
if (sections === null) {
|
|
253
|
-
initSections(content.join("\n"));
|
|
254
|
-
} else {
|
|
255
|
-
closeSection(content.join("\n"));
|
|
256
|
-
}
|
|
257
|
-
file.sections = sections;
|
|
258
|
-
return file;
|
|
259
|
-
};
|
|
260
|
-
function isDelimiter(line, delim) {
|
|
261
|
-
if (line.slice(0, delim.length) !== delim) {
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
if (line.charAt(delim.length + 1) === delim.slice(-1)) {
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
|
-
return true;
|
|
268
|
-
}
|
|
269
|
-
function toObject(input) {
|
|
270
|
-
if (typeOf(input) !== "object") {
|
|
271
|
-
input = { content: input };
|
|
272
|
-
}
|
|
273
|
-
if (typeof input.content !== "string" && !isBuffer(input.content)) {
|
|
274
|
-
throw new TypeError("expected a buffer or string");
|
|
275
|
-
}
|
|
276
|
-
input.content = input.content.toString();
|
|
277
|
-
input.sections = [];
|
|
278
|
-
return input;
|
|
279
|
-
}
|
|
280
|
-
function getKey(val, delim) {
|
|
281
|
-
return val ? val.slice(delim.length).trim() : "";
|
|
282
|
-
}
|
|
283
|
-
function createSection() {
|
|
284
|
-
return { key: "", data: "", content: "" };
|
|
285
|
-
}
|
|
286
|
-
function identity(val) {
|
|
287
|
-
return val;
|
|
288
|
-
}
|
|
289
|
-
function isBuffer(val) {
|
|
290
|
-
if (val && val.constructor && typeof val.constructor.isBuffer === "function") {
|
|
291
|
-
return val.constructor.isBuffer(val);
|
|
292
|
-
}
|
|
293
|
-
return false;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/common.js
|
|
299
|
-
var require_common = __commonJS({
|
|
300
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/common.js"(exports2, module2) {
|
|
301
|
-
"use strict";
|
|
302
|
-
function isNothing(subject) {
|
|
303
|
-
return typeof subject === "undefined" || subject === null;
|
|
304
|
-
}
|
|
305
|
-
function isObject(subject) {
|
|
306
|
-
return typeof subject === "object" && subject !== null;
|
|
307
|
-
}
|
|
308
|
-
function toArray(sequence) {
|
|
309
|
-
if (Array.isArray(sequence)) return sequence;
|
|
310
|
-
else if (isNothing(sequence)) return [];
|
|
311
|
-
return [sequence];
|
|
312
|
-
}
|
|
313
|
-
function extend(target, source) {
|
|
314
|
-
var index, length, key, sourceKeys;
|
|
315
|
-
if (source) {
|
|
316
|
-
sourceKeys = Object.keys(source);
|
|
317
|
-
for (index = 0, length = sourceKeys.length; index < length; index += 1) {
|
|
318
|
-
key = sourceKeys[index];
|
|
319
|
-
target[key] = source[key];
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
return target;
|
|
323
|
-
}
|
|
324
|
-
function repeat(string, count) {
|
|
325
|
-
var result = "", cycle;
|
|
326
|
-
for (cycle = 0; cycle < count; cycle += 1) {
|
|
327
|
-
result += string;
|
|
328
|
-
}
|
|
329
|
-
return result;
|
|
330
|
-
}
|
|
331
|
-
function isNegativeZero(number) {
|
|
332
|
-
return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
|
|
333
|
-
}
|
|
334
|
-
module2.exports.isNothing = isNothing;
|
|
335
|
-
module2.exports.isObject = isObject;
|
|
336
|
-
module2.exports.toArray = toArray;
|
|
337
|
-
module2.exports.repeat = repeat;
|
|
338
|
-
module2.exports.isNegativeZero = isNegativeZero;
|
|
339
|
-
module2.exports.extend = extend;
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/exception.js
|
|
344
|
-
var require_exception = __commonJS({
|
|
345
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/exception.js"(exports2, module2) {
|
|
346
|
-
"use strict";
|
|
347
|
-
function YAMLException2(reason, mark) {
|
|
348
|
-
Error.call(this);
|
|
349
|
-
this.name = "YAMLException";
|
|
350
|
-
this.reason = reason;
|
|
351
|
-
this.mark = mark;
|
|
352
|
-
this.message = (this.reason || "(unknown reason)") + (this.mark ? " " + this.mark.toString() : "");
|
|
353
|
-
if (Error.captureStackTrace) {
|
|
354
|
-
Error.captureStackTrace(this, this.constructor);
|
|
355
|
-
} else {
|
|
356
|
-
this.stack = new Error().stack || "";
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
YAMLException2.prototype = Object.create(Error.prototype);
|
|
360
|
-
YAMLException2.prototype.constructor = YAMLException2;
|
|
361
|
-
YAMLException2.prototype.toString = function toString(compact) {
|
|
362
|
-
var result = this.name + ": ";
|
|
363
|
-
result += this.reason || "(unknown reason)";
|
|
364
|
-
if (!compact && this.mark) {
|
|
365
|
-
result += " " + this.mark.toString();
|
|
366
|
-
}
|
|
367
|
-
return result;
|
|
368
|
-
};
|
|
369
|
-
module2.exports = YAMLException2;
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/mark.js
|
|
374
|
-
var require_mark = __commonJS({
|
|
375
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/mark.js"(exports2, module2) {
|
|
376
|
-
"use strict";
|
|
377
|
-
var common = require_common();
|
|
378
|
-
function Mark(name, buffer, position, line, column) {
|
|
379
|
-
this.name = name;
|
|
380
|
-
this.buffer = buffer;
|
|
381
|
-
this.position = position;
|
|
382
|
-
this.line = line;
|
|
383
|
-
this.column = column;
|
|
384
|
-
}
|
|
385
|
-
Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
|
|
386
|
-
var head, start, tail, end, snippet;
|
|
387
|
-
if (!this.buffer) return null;
|
|
388
|
-
indent = indent || 4;
|
|
389
|
-
maxLength = maxLength || 75;
|
|
390
|
-
head = "";
|
|
391
|
-
start = this.position;
|
|
392
|
-
while (start > 0 && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(start - 1)) === -1) {
|
|
393
|
-
start -= 1;
|
|
394
|
-
if (this.position - start > maxLength / 2 - 1) {
|
|
395
|
-
head = " ... ";
|
|
396
|
-
start += 5;
|
|
397
|
-
break;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
tail = "";
|
|
401
|
-
end = this.position;
|
|
402
|
-
while (end < this.buffer.length && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(end)) === -1) {
|
|
403
|
-
end += 1;
|
|
404
|
-
if (end - this.position > maxLength / 2 - 1) {
|
|
405
|
-
tail = " ... ";
|
|
406
|
-
end -= 5;
|
|
407
|
-
break;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
snippet = this.buffer.slice(start, end);
|
|
411
|
-
return common.repeat(" ", indent) + head + snippet + tail + "\n" + common.repeat(" ", indent + this.position - start + head.length) + "^";
|
|
412
|
-
};
|
|
413
|
-
Mark.prototype.toString = function toString(compact) {
|
|
414
|
-
var snippet, where = "";
|
|
415
|
-
if (this.name) {
|
|
416
|
-
where += 'in "' + this.name + '" ';
|
|
417
|
-
}
|
|
418
|
-
where += "at line " + (this.line + 1) + ", column " + (this.column + 1);
|
|
419
|
-
if (!compact) {
|
|
420
|
-
snippet = this.getSnippet();
|
|
421
|
-
if (snippet) {
|
|
422
|
-
where += ":\n" + snippet;
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
return where;
|
|
426
|
-
};
|
|
427
|
-
module2.exports = Mark;
|
|
428
|
-
}
|
|
429
|
-
});
|
|
430
|
-
|
|
431
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type.js
|
|
432
|
-
var require_type = __commonJS({
|
|
433
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type.js"(exports2, module2) {
|
|
434
|
-
"use strict";
|
|
435
|
-
var YAMLException2 = require_exception();
|
|
436
|
-
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
437
|
-
"kind",
|
|
438
|
-
"resolve",
|
|
439
|
-
"construct",
|
|
440
|
-
"instanceOf",
|
|
441
|
-
"predicate",
|
|
442
|
-
"represent",
|
|
443
|
-
"defaultStyle",
|
|
444
|
-
"styleAliases"
|
|
445
|
-
];
|
|
446
|
-
var YAML_NODE_KINDS = [
|
|
447
|
-
"scalar",
|
|
448
|
-
"sequence",
|
|
449
|
-
"mapping"
|
|
450
|
-
];
|
|
451
|
-
function compileStyleAliases(map) {
|
|
452
|
-
var result = {};
|
|
453
|
-
if (map !== null) {
|
|
454
|
-
Object.keys(map).forEach(function(style) {
|
|
455
|
-
map[style].forEach(function(alias) {
|
|
456
|
-
result[String(alias)] = style;
|
|
457
|
-
});
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
return result;
|
|
461
|
-
}
|
|
462
|
-
function Type(tag, options2) {
|
|
463
|
-
options2 = options2 || {};
|
|
464
|
-
Object.keys(options2).forEach(function(name) {
|
|
465
|
-
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
|
466
|
-
throw new YAMLException2('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
this.tag = tag;
|
|
470
|
-
this.kind = options2["kind"] || null;
|
|
471
|
-
this.resolve = options2["resolve"] || function() {
|
|
472
|
-
return true;
|
|
473
|
-
};
|
|
474
|
-
this.construct = options2["construct"] || function(data) {
|
|
475
|
-
return data;
|
|
476
|
-
};
|
|
477
|
-
this.instanceOf = options2["instanceOf"] || null;
|
|
478
|
-
this.predicate = options2["predicate"] || null;
|
|
479
|
-
this.represent = options2["represent"] || null;
|
|
480
|
-
this.defaultStyle = options2["defaultStyle"] || null;
|
|
481
|
-
this.styleAliases = compileStyleAliases(options2["styleAliases"] || null);
|
|
482
|
-
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
|
483
|
-
throw new YAMLException2('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
module2.exports = Type;
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
|
|
490
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema.js
|
|
491
|
-
var require_schema = __commonJS({
|
|
492
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema.js"(exports2, module2) {
|
|
493
|
-
"use strict";
|
|
494
|
-
var common = require_common();
|
|
495
|
-
var YAMLException2 = require_exception();
|
|
496
|
-
var Type = require_type();
|
|
497
|
-
function compileList(schema, name, result) {
|
|
498
|
-
var exclude = [];
|
|
499
|
-
schema.include.forEach(function(includedSchema) {
|
|
500
|
-
result = compileList(includedSchema, name, result);
|
|
501
|
-
});
|
|
502
|
-
schema[name].forEach(function(currentType) {
|
|
503
|
-
result.forEach(function(previousType, previousIndex) {
|
|
504
|
-
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
|
|
505
|
-
exclude.push(previousIndex);
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
result.push(currentType);
|
|
509
|
-
});
|
|
510
|
-
return result.filter(function(type, index) {
|
|
511
|
-
return exclude.indexOf(index) === -1;
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
|
-
function compileMap() {
|
|
515
|
-
var result = {
|
|
516
|
-
scalar: {},
|
|
517
|
-
sequence: {},
|
|
518
|
-
mapping: {},
|
|
519
|
-
fallback: {}
|
|
520
|
-
}, index, length;
|
|
521
|
-
function collectType(type) {
|
|
522
|
-
result[type.kind][type.tag] = result["fallback"][type.tag] = type;
|
|
523
|
-
}
|
|
524
|
-
for (index = 0, length = arguments.length; index < length; index += 1) {
|
|
525
|
-
arguments[index].forEach(collectType);
|
|
526
|
-
}
|
|
527
|
-
return result;
|
|
528
|
-
}
|
|
529
|
-
function Schema3(definition) {
|
|
530
|
-
this.include = definition.include || [];
|
|
531
|
-
this.implicit = definition.implicit || [];
|
|
532
|
-
this.explicit = definition.explicit || [];
|
|
533
|
-
this.implicit.forEach(function(type) {
|
|
534
|
-
if (type.loadKind && type.loadKind !== "scalar") {
|
|
535
|
-
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
|
-
}
|
|
537
|
-
});
|
|
538
|
-
this.compiledImplicit = compileList(this, "implicit", []);
|
|
539
|
-
this.compiledExplicit = compileList(this, "explicit", []);
|
|
540
|
-
this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
|
|
541
|
-
}
|
|
542
|
-
Schema3.DEFAULT = null;
|
|
543
|
-
Schema3.create = function createSchema() {
|
|
544
|
-
var schemas, types;
|
|
545
|
-
switch (arguments.length) {
|
|
546
|
-
case 1:
|
|
547
|
-
schemas = Schema3.DEFAULT;
|
|
548
|
-
types = arguments[0];
|
|
549
|
-
break;
|
|
550
|
-
case 2:
|
|
551
|
-
schemas = arguments[0];
|
|
552
|
-
types = arguments[1];
|
|
553
|
-
break;
|
|
554
|
-
default:
|
|
555
|
-
throw new YAMLException2("Wrong number of arguments for Schema.create function");
|
|
556
|
-
}
|
|
557
|
-
schemas = common.toArray(schemas);
|
|
558
|
-
types = common.toArray(types);
|
|
559
|
-
if (!schemas.every(function(schema) {
|
|
560
|
-
return schema instanceof Schema3;
|
|
561
|
-
})) {
|
|
562
|
-
throw new YAMLException2("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
|
|
563
|
-
}
|
|
564
|
-
if (!types.every(function(type) {
|
|
565
|
-
return type instanceof Type;
|
|
566
|
-
})) {
|
|
567
|
-
throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
568
|
-
}
|
|
569
|
-
return new Schema3({
|
|
570
|
-
include: schemas,
|
|
571
|
-
explicit: types
|
|
572
|
-
});
|
|
573
|
-
};
|
|
574
|
-
module2.exports = Schema3;
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
|
|
578
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/str.js
|
|
579
|
-
var require_str = __commonJS({
|
|
580
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/str.js"(exports2, module2) {
|
|
581
|
-
"use strict";
|
|
582
|
-
var Type = require_type();
|
|
583
|
-
module2.exports = new Type("tag:yaml.org,2002:str", {
|
|
584
|
-
kind: "scalar",
|
|
585
|
-
construct: function(data) {
|
|
586
|
-
return data !== null ? data : "";
|
|
587
|
-
}
|
|
588
|
-
});
|
|
589
|
-
}
|
|
590
|
-
});
|
|
591
|
-
|
|
592
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/seq.js
|
|
593
|
-
var require_seq = __commonJS({
|
|
594
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/seq.js"(exports2, module2) {
|
|
595
|
-
"use strict";
|
|
596
|
-
var Type = require_type();
|
|
597
|
-
module2.exports = new Type("tag:yaml.org,2002:seq", {
|
|
598
|
-
kind: "sequence",
|
|
599
|
-
construct: function(data) {
|
|
600
|
-
return data !== null ? data : [];
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
});
|
|
605
|
-
|
|
606
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/map.js
|
|
607
|
-
var require_map = __commonJS({
|
|
608
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/map.js"(exports2, module2) {
|
|
609
|
-
"use strict";
|
|
610
|
-
var Type = require_type();
|
|
611
|
-
module2.exports = new Type("tag:yaml.org,2002:map", {
|
|
612
|
-
kind: "mapping",
|
|
613
|
-
construct: function(data) {
|
|
614
|
-
return data !== null ? data : {};
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
|
-
|
|
620
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js
|
|
621
|
-
var require_failsafe = __commonJS({
|
|
622
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js"(exports2, module2) {
|
|
623
|
-
"use strict";
|
|
624
|
-
var Schema3 = require_schema();
|
|
625
|
-
module2.exports = new Schema3({
|
|
626
|
-
explicit: [
|
|
627
|
-
require_str(),
|
|
628
|
-
require_seq(),
|
|
629
|
-
require_map()
|
|
630
|
-
]
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
});
|
|
634
|
-
|
|
635
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/null.js
|
|
636
|
-
var require_null = __commonJS({
|
|
637
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/null.js"(exports2, module2) {
|
|
638
|
-
"use strict";
|
|
639
|
-
var Type = require_type();
|
|
640
|
-
function resolveYamlNull(data) {
|
|
641
|
-
if (data === null) return true;
|
|
642
|
-
var max = data.length;
|
|
643
|
-
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
|
|
644
|
-
}
|
|
645
|
-
function constructYamlNull() {
|
|
646
|
-
return null;
|
|
647
|
-
}
|
|
648
|
-
function isNull(object) {
|
|
649
|
-
return object === null;
|
|
650
|
-
}
|
|
651
|
-
module2.exports = new Type("tag:yaml.org,2002:null", {
|
|
652
|
-
kind: "scalar",
|
|
653
|
-
resolve: resolveYamlNull,
|
|
654
|
-
construct: constructYamlNull,
|
|
655
|
-
predicate: isNull,
|
|
656
|
-
represent: {
|
|
657
|
-
canonical: function() {
|
|
658
|
-
return "~";
|
|
659
|
-
},
|
|
660
|
-
lowercase: function() {
|
|
661
|
-
return "null";
|
|
662
|
-
},
|
|
663
|
-
uppercase: function() {
|
|
664
|
-
return "NULL";
|
|
665
|
-
},
|
|
666
|
-
camelcase: function() {
|
|
667
|
-
return "Null";
|
|
668
|
-
}
|
|
669
|
-
},
|
|
670
|
-
defaultStyle: "lowercase"
|
|
671
|
-
});
|
|
672
|
-
}
|
|
673
|
-
});
|
|
674
|
-
|
|
675
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/bool.js
|
|
676
|
-
var require_bool = __commonJS({
|
|
677
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/bool.js"(exports2, module2) {
|
|
678
|
-
"use strict";
|
|
679
|
-
var Type = require_type();
|
|
680
|
-
function resolveYamlBoolean(data) {
|
|
681
|
-
if (data === null) return false;
|
|
682
|
-
var max = data.length;
|
|
683
|
-
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
|
|
684
|
-
}
|
|
685
|
-
function constructYamlBoolean(data) {
|
|
686
|
-
return data === "true" || data === "True" || data === "TRUE";
|
|
687
|
-
}
|
|
688
|
-
function isBoolean(object) {
|
|
689
|
-
return Object.prototype.toString.call(object) === "[object Boolean]";
|
|
690
|
-
}
|
|
691
|
-
module2.exports = new Type("tag:yaml.org,2002:bool", {
|
|
692
|
-
kind: "scalar",
|
|
693
|
-
resolve: resolveYamlBoolean,
|
|
694
|
-
construct: constructYamlBoolean,
|
|
695
|
-
predicate: isBoolean,
|
|
696
|
-
represent: {
|
|
697
|
-
lowercase: function(object) {
|
|
698
|
-
return object ? "true" : "false";
|
|
699
|
-
},
|
|
700
|
-
uppercase: function(object) {
|
|
701
|
-
return object ? "TRUE" : "FALSE";
|
|
702
|
-
},
|
|
703
|
-
camelcase: function(object) {
|
|
704
|
-
return object ? "True" : "False";
|
|
705
|
-
}
|
|
706
|
-
},
|
|
707
|
-
defaultStyle: "lowercase"
|
|
708
|
-
});
|
|
709
|
-
}
|
|
710
|
-
});
|
|
711
|
-
|
|
712
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/int.js
|
|
713
|
-
var require_int = __commonJS({
|
|
714
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/int.js"(exports2, module2) {
|
|
715
|
-
"use strict";
|
|
716
|
-
var common = require_common();
|
|
717
|
-
var Type = require_type();
|
|
718
|
-
function isHexCode(c) {
|
|
719
|
-
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
|
720
|
-
}
|
|
721
|
-
function isOctCode(c) {
|
|
722
|
-
return 48 <= c && c <= 55;
|
|
723
|
-
}
|
|
724
|
-
function isDecCode(c) {
|
|
725
|
-
return 48 <= c && c <= 57;
|
|
726
|
-
}
|
|
727
|
-
function resolveYamlInteger2(data) {
|
|
728
|
-
if (data === null) return false;
|
|
729
|
-
var max = data.length, index = 0, hasDigits = false, ch;
|
|
730
|
-
if (!max) return false;
|
|
731
|
-
ch = data[index];
|
|
732
|
-
if (ch === "-" || ch === "+") {
|
|
733
|
-
ch = data[++index];
|
|
734
|
-
}
|
|
735
|
-
if (ch === "0") {
|
|
736
|
-
if (index + 1 === max) return true;
|
|
737
|
-
ch = data[++index];
|
|
738
|
-
if (ch === "b") {
|
|
739
|
-
index++;
|
|
740
|
-
for (; index < max; index++) {
|
|
741
|
-
ch = data[index];
|
|
742
|
-
if (ch === "_") continue;
|
|
743
|
-
if (ch !== "0" && ch !== "1") return false;
|
|
744
|
-
hasDigits = true;
|
|
745
|
-
}
|
|
746
|
-
return hasDigits && ch !== "_";
|
|
747
|
-
}
|
|
748
|
-
if (ch === "x") {
|
|
749
|
-
index++;
|
|
750
|
-
for (; index < max; index++) {
|
|
751
|
-
ch = data[index];
|
|
752
|
-
if (ch === "_") continue;
|
|
753
|
-
if (!isHexCode(data.charCodeAt(index))) return false;
|
|
754
|
-
hasDigits = true;
|
|
755
|
-
}
|
|
756
|
-
return hasDigits && ch !== "_";
|
|
757
|
-
}
|
|
758
|
-
for (; index < max; index++) {
|
|
759
|
-
ch = data[index];
|
|
760
|
-
if (ch === "_") continue;
|
|
761
|
-
if (!isOctCode(data.charCodeAt(index))) return false;
|
|
762
|
-
hasDigits = true;
|
|
763
|
-
}
|
|
764
|
-
return hasDigits && ch !== "_";
|
|
765
|
-
}
|
|
766
|
-
if (ch === "_") return false;
|
|
767
|
-
for (; index < max; index++) {
|
|
768
|
-
ch = data[index];
|
|
769
|
-
if (ch === "_") continue;
|
|
770
|
-
if (ch === ":") break;
|
|
771
|
-
if (!isDecCode(data.charCodeAt(index))) {
|
|
772
|
-
return false;
|
|
773
|
-
}
|
|
774
|
-
hasDigits = true;
|
|
775
|
-
}
|
|
776
|
-
if (!hasDigits || ch === "_") return false;
|
|
777
|
-
if (ch !== ":") return true;
|
|
778
|
-
return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
|
|
779
|
-
}
|
|
780
|
-
function constructYamlInteger(data) {
|
|
781
|
-
var value = data, sign = 1, ch, base, digits = [];
|
|
782
|
-
if (value.indexOf("_") !== -1) {
|
|
783
|
-
value = value.replace(/_/g, "");
|
|
784
|
-
}
|
|
785
|
-
ch = value[0];
|
|
786
|
-
if (ch === "-" || ch === "+") {
|
|
787
|
-
if (ch === "-") sign = -1;
|
|
788
|
-
value = value.slice(1);
|
|
789
|
-
ch = value[0];
|
|
790
|
-
}
|
|
791
|
-
if (value === "0") return 0;
|
|
792
|
-
if (ch === "0") {
|
|
793
|
-
if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
|
|
794
|
-
if (value[1] === "x") return sign * parseInt(value, 16);
|
|
795
|
-
return sign * parseInt(value, 8);
|
|
796
|
-
}
|
|
797
|
-
if (value.indexOf(":") !== -1) {
|
|
798
|
-
value.split(":").forEach(function(v) {
|
|
799
|
-
digits.unshift(parseInt(v, 10));
|
|
800
|
-
});
|
|
801
|
-
value = 0;
|
|
802
|
-
base = 1;
|
|
803
|
-
digits.forEach(function(d) {
|
|
804
|
-
value += d * base;
|
|
805
|
-
base *= 60;
|
|
806
|
-
});
|
|
807
|
-
return sign * value;
|
|
808
|
-
}
|
|
809
|
-
return sign * parseInt(value, 10);
|
|
810
|
-
}
|
|
811
|
-
function isInteger(object) {
|
|
812
|
-
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
|
|
813
|
-
}
|
|
814
|
-
module2.exports = new Type("tag:yaml.org,2002:int", {
|
|
815
|
-
kind: "scalar",
|
|
816
|
-
resolve: resolveYamlInteger2,
|
|
817
|
-
construct: constructYamlInteger,
|
|
818
|
-
predicate: isInteger,
|
|
819
|
-
represent: {
|
|
820
|
-
binary: function(obj) {
|
|
821
|
-
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
|
822
|
-
},
|
|
823
|
-
octal: function(obj) {
|
|
824
|
-
return obj >= 0 ? "0" + obj.toString(8) : "-0" + obj.toString(8).slice(1);
|
|
825
|
-
},
|
|
826
|
-
decimal: function(obj) {
|
|
827
|
-
return obj.toString(10);
|
|
828
|
-
},
|
|
829
|
-
/* eslint-disable max-len */
|
|
830
|
-
hexadecimal: function(obj) {
|
|
831
|
-
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
|
832
|
-
}
|
|
833
|
-
},
|
|
834
|
-
defaultStyle: "decimal",
|
|
835
|
-
styleAliases: {
|
|
836
|
-
binary: [2, "bin"],
|
|
837
|
-
octal: [8, "oct"],
|
|
838
|
-
decimal: [10, "dec"],
|
|
839
|
-
hexadecimal: [16, "hex"]
|
|
840
|
-
}
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
});
|
|
844
|
-
|
|
845
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/float.js
|
|
846
|
-
var require_float = __commonJS({
|
|
847
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/float.js"(exports2, module2) {
|
|
848
|
-
"use strict";
|
|
849
|
-
var common = require_common();
|
|
850
|
-
var Type = require_type();
|
|
851
|
-
var YAML_FLOAT_PATTERN2 = new RegExp(
|
|
852
|
-
// 2.5e4, 2.5 and integers
|
|
853
|
-
"^(?:[-+]?(?: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
|
-
);
|
|
855
|
-
function resolveYamlFloat2(data) {
|
|
856
|
-
if (data === null) return false;
|
|
857
|
-
if (!YAML_FLOAT_PATTERN2.test(data) || // Quick hack to not allow integers end with `_`
|
|
858
|
-
// Probably should update regexp & check speed
|
|
859
|
-
data[data.length - 1] === "_") {
|
|
860
|
-
return false;
|
|
861
|
-
}
|
|
862
|
-
return true;
|
|
863
|
-
}
|
|
864
|
-
function constructYamlFloat(data) {
|
|
865
|
-
var value, sign, base, digits;
|
|
866
|
-
value = data.replace(/_/g, "").toLowerCase();
|
|
867
|
-
sign = value[0] === "-" ? -1 : 1;
|
|
868
|
-
digits = [];
|
|
869
|
-
if ("+-".indexOf(value[0]) >= 0) {
|
|
870
|
-
value = value.slice(1);
|
|
871
|
-
}
|
|
872
|
-
if (value === ".inf") {
|
|
873
|
-
return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
874
|
-
} else if (value === ".nan") {
|
|
875
|
-
return NaN;
|
|
876
|
-
} else if (value.indexOf(":") >= 0) {
|
|
877
|
-
value.split(":").forEach(function(v) {
|
|
878
|
-
digits.unshift(parseFloat(v, 10));
|
|
879
|
-
});
|
|
880
|
-
value = 0;
|
|
881
|
-
base = 1;
|
|
882
|
-
digits.forEach(function(d) {
|
|
883
|
-
value += d * base;
|
|
884
|
-
base *= 60;
|
|
885
|
-
});
|
|
886
|
-
return sign * value;
|
|
887
|
-
}
|
|
888
|
-
return sign * parseFloat(value, 10);
|
|
889
|
-
}
|
|
890
|
-
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
891
|
-
function representYamlFloat2(object, style) {
|
|
892
|
-
var res;
|
|
893
|
-
if (isNaN(object)) {
|
|
894
|
-
switch (style) {
|
|
895
|
-
case "lowercase":
|
|
896
|
-
return ".nan";
|
|
897
|
-
case "uppercase":
|
|
898
|
-
return ".NAN";
|
|
899
|
-
case "camelcase":
|
|
900
|
-
return ".NaN";
|
|
901
|
-
}
|
|
902
|
-
} else if (Number.POSITIVE_INFINITY === object) {
|
|
903
|
-
switch (style) {
|
|
904
|
-
case "lowercase":
|
|
905
|
-
return ".inf";
|
|
906
|
-
case "uppercase":
|
|
907
|
-
return ".INF";
|
|
908
|
-
case "camelcase":
|
|
909
|
-
return ".Inf";
|
|
910
|
-
}
|
|
911
|
-
} else if (Number.NEGATIVE_INFINITY === object) {
|
|
912
|
-
switch (style) {
|
|
913
|
-
case "lowercase":
|
|
914
|
-
return "-.inf";
|
|
915
|
-
case "uppercase":
|
|
916
|
-
return "-.INF";
|
|
917
|
-
case "camelcase":
|
|
918
|
-
return "-.Inf";
|
|
919
|
-
}
|
|
920
|
-
} else if (common.isNegativeZero(object)) {
|
|
921
|
-
return "-0.0";
|
|
922
|
-
}
|
|
923
|
-
res = object.toString(10);
|
|
924
|
-
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
|
925
|
-
}
|
|
926
|
-
function isFloat(object) {
|
|
927
|
-
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
|
|
928
|
-
}
|
|
929
|
-
module2.exports = new Type("tag:yaml.org,2002:float", {
|
|
930
|
-
kind: "scalar",
|
|
931
|
-
resolve: resolveYamlFloat2,
|
|
932
|
-
construct: constructYamlFloat,
|
|
933
|
-
predicate: isFloat,
|
|
934
|
-
represent: representYamlFloat2,
|
|
935
|
-
defaultStyle: "lowercase"
|
|
936
|
-
});
|
|
937
|
-
}
|
|
938
|
-
});
|
|
939
|
-
|
|
940
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/json.js
|
|
941
|
-
var require_json = __commonJS({
|
|
942
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/json.js"(exports2, module2) {
|
|
943
|
-
"use strict";
|
|
944
|
-
var Schema3 = require_schema();
|
|
945
|
-
module2.exports = new Schema3({
|
|
946
|
-
include: [
|
|
947
|
-
require_failsafe()
|
|
948
|
-
],
|
|
949
|
-
implicit: [
|
|
950
|
-
require_null(),
|
|
951
|
-
require_bool(),
|
|
952
|
-
require_int(),
|
|
953
|
-
require_float()
|
|
954
|
-
]
|
|
955
|
-
});
|
|
956
|
-
}
|
|
957
|
-
});
|
|
958
|
-
|
|
959
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/core.js
|
|
960
|
-
var require_core = __commonJS({
|
|
961
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/core.js"(exports2, module2) {
|
|
962
|
-
"use strict";
|
|
963
|
-
var Schema3 = require_schema();
|
|
964
|
-
module2.exports = new Schema3({
|
|
965
|
-
include: [
|
|
966
|
-
require_json()
|
|
967
|
-
]
|
|
968
|
-
});
|
|
969
|
-
}
|
|
970
|
-
});
|
|
971
|
-
|
|
972
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/timestamp.js
|
|
973
|
-
var require_timestamp = __commonJS({
|
|
974
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/timestamp.js"(exports2, module2) {
|
|
975
|
-
"use strict";
|
|
976
|
-
var Type = require_type();
|
|
977
|
-
var YAML_DATE_REGEXP2 = new RegExp(
|
|
978
|
-
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
979
|
-
);
|
|
980
|
-
var YAML_TIMESTAMP_REGEXP2 = new RegExp(
|
|
981
|
-
"^([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
|
-
);
|
|
983
|
-
function resolveYamlTimestamp2(data) {
|
|
984
|
-
if (data === null) return false;
|
|
985
|
-
if (YAML_DATE_REGEXP2.exec(data) !== null) return true;
|
|
986
|
-
if (YAML_TIMESTAMP_REGEXP2.exec(data) !== null) return true;
|
|
987
|
-
return false;
|
|
988
|
-
}
|
|
989
|
-
function constructYamlTimestamp(data) {
|
|
990
|
-
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
991
|
-
match = YAML_DATE_REGEXP2.exec(data);
|
|
992
|
-
if (match === null) match = YAML_TIMESTAMP_REGEXP2.exec(data);
|
|
993
|
-
if (match === null) throw new Error("Date resolve error");
|
|
994
|
-
year = +match[1];
|
|
995
|
-
month = +match[2] - 1;
|
|
996
|
-
day = +match[3];
|
|
997
|
-
if (!match[4]) {
|
|
998
|
-
return new Date(Date.UTC(year, month, day));
|
|
999
|
-
}
|
|
1000
|
-
hour = +match[4];
|
|
1001
|
-
minute = +match[5];
|
|
1002
|
-
second = +match[6];
|
|
1003
|
-
if (match[7]) {
|
|
1004
|
-
fraction = match[7].slice(0, 3);
|
|
1005
|
-
while (fraction.length < 3) {
|
|
1006
|
-
fraction += "0";
|
|
1007
|
-
}
|
|
1008
|
-
fraction = +fraction;
|
|
1009
|
-
}
|
|
1010
|
-
if (match[9]) {
|
|
1011
|
-
tz_hour = +match[10];
|
|
1012
|
-
tz_minute = +(match[11] || 0);
|
|
1013
|
-
delta = (tz_hour * 60 + tz_minute) * 6e4;
|
|
1014
|
-
if (match[9] === "-") delta = -delta;
|
|
1015
|
-
}
|
|
1016
|
-
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
1017
|
-
if (delta) date.setTime(date.getTime() - delta);
|
|
1018
|
-
return date;
|
|
1019
|
-
}
|
|
1020
|
-
function representYamlTimestamp(object) {
|
|
1021
|
-
return object.toISOString();
|
|
1022
|
-
}
|
|
1023
|
-
module2.exports = new Type("tag:yaml.org,2002:timestamp", {
|
|
1024
|
-
kind: "scalar",
|
|
1025
|
-
resolve: resolveYamlTimestamp2,
|
|
1026
|
-
construct: constructYamlTimestamp,
|
|
1027
|
-
instanceOf: Date,
|
|
1028
|
-
represent: representYamlTimestamp
|
|
1029
|
-
});
|
|
1030
|
-
}
|
|
1031
|
-
});
|
|
1032
|
-
|
|
1033
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/merge.js
|
|
1034
|
-
var require_merge = __commonJS({
|
|
1035
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/merge.js"(exports2, module2) {
|
|
1036
|
-
"use strict";
|
|
1037
|
-
var Type = require_type();
|
|
1038
|
-
function resolveYamlMerge(data) {
|
|
1039
|
-
return data === "<<" || data === null;
|
|
1040
|
-
}
|
|
1041
|
-
module2.exports = new Type("tag:yaml.org,2002:merge", {
|
|
1042
|
-
kind: "scalar",
|
|
1043
|
-
resolve: resolveYamlMerge
|
|
1044
|
-
});
|
|
1045
|
-
}
|
|
1046
|
-
});
|
|
1047
|
-
|
|
1048
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/binary.js
|
|
1049
|
-
var require_binary = __commonJS({
|
|
1050
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/binary.js"(exports2, module2) {
|
|
1051
|
-
"use strict";
|
|
1052
|
-
var NodeBuffer;
|
|
1053
|
-
try {
|
|
1054
|
-
_require = require;
|
|
1055
|
-
NodeBuffer = _require("buffer").Buffer;
|
|
1056
|
-
} catch (__) {
|
|
1057
|
-
}
|
|
1058
|
-
var _require;
|
|
1059
|
-
var Type = require_type();
|
|
1060
|
-
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
1061
|
-
function resolveYamlBinary2(data) {
|
|
1062
|
-
if (data === null) return false;
|
|
1063
|
-
var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
|
|
1064
|
-
for (idx = 0; idx < max; idx++) {
|
|
1065
|
-
code = map.indexOf(data.charAt(idx));
|
|
1066
|
-
if (code > 64) continue;
|
|
1067
|
-
if (code < 0) return false;
|
|
1068
|
-
bitlen += 6;
|
|
1069
|
-
}
|
|
1070
|
-
return bitlen % 8 === 0;
|
|
1071
|
-
}
|
|
1072
|
-
function constructYamlBinary(data) {
|
|
1073
|
-
var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = [];
|
|
1074
|
-
for (idx = 0; idx < max; idx++) {
|
|
1075
|
-
if (idx % 4 === 0 && idx) {
|
|
1076
|
-
result.push(bits >> 16 & 255);
|
|
1077
|
-
result.push(bits >> 8 & 255);
|
|
1078
|
-
result.push(bits & 255);
|
|
1079
|
-
}
|
|
1080
|
-
bits = bits << 6 | map.indexOf(input.charAt(idx));
|
|
1081
|
-
}
|
|
1082
|
-
tailbits = max % 4 * 6;
|
|
1083
|
-
if (tailbits === 0) {
|
|
1084
|
-
result.push(bits >> 16 & 255);
|
|
1085
|
-
result.push(bits >> 8 & 255);
|
|
1086
|
-
result.push(bits & 255);
|
|
1087
|
-
} else if (tailbits === 18) {
|
|
1088
|
-
result.push(bits >> 10 & 255);
|
|
1089
|
-
result.push(bits >> 2 & 255);
|
|
1090
|
-
} else if (tailbits === 12) {
|
|
1091
|
-
result.push(bits >> 4 & 255);
|
|
1092
|
-
}
|
|
1093
|
-
if (NodeBuffer) {
|
|
1094
|
-
return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
|
|
1095
|
-
}
|
|
1096
|
-
return result;
|
|
1097
|
-
}
|
|
1098
|
-
function representYamlBinary2(object) {
|
|
1099
|
-
var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
|
|
1100
|
-
for (idx = 0; idx < max; idx++) {
|
|
1101
|
-
if (idx % 3 === 0 && idx) {
|
|
1102
|
-
result += map[bits >> 18 & 63];
|
|
1103
|
-
result += map[bits >> 12 & 63];
|
|
1104
|
-
result += map[bits >> 6 & 63];
|
|
1105
|
-
result += map[bits & 63];
|
|
1106
|
-
}
|
|
1107
|
-
bits = (bits << 8) + object[idx];
|
|
1108
|
-
}
|
|
1109
|
-
tail = max % 3;
|
|
1110
|
-
if (tail === 0) {
|
|
1111
|
-
result += map[bits >> 18 & 63];
|
|
1112
|
-
result += map[bits >> 12 & 63];
|
|
1113
|
-
result += map[bits >> 6 & 63];
|
|
1114
|
-
result += map[bits & 63];
|
|
1115
|
-
} else if (tail === 2) {
|
|
1116
|
-
result += map[bits >> 10 & 63];
|
|
1117
|
-
result += map[bits >> 4 & 63];
|
|
1118
|
-
result += map[bits << 2 & 63];
|
|
1119
|
-
result += map[64];
|
|
1120
|
-
} else if (tail === 1) {
|
|
1121
|
-
result += map[bits >> 2 & 63];
|
|
1122
|
-
result += map[bits << 4 & 63];
|
|
1123
|
-
result += map[64];
|
|
1124
|
-
result += map[64];
|
|
1125
|
-
}
|
|
1126
|
-
return result;
|
|
1127
|
-
}
|
|
1128
|
-
function isBinary(object) {
|
|
1129
|
-
return NodeBuffer && NodeBuffer.isBuffer(object);
|
|
1130
|
-
}
|
|
1131
|
-
module2.exports = new Type("tag:yaml.org,2002:binary", {
|
|
1132
|
-
kind: "scalar",
|
|
1133
|
-
resolve: resolveYamlBinary2,
|
|
1134
|
-
construct: constructYamlBinary,
|
|
1135
|
-
predicate: isBinary,
|
|
1136
|
-
represent: representYamlBinary2
|
|
1137
|
-
});
|
|
1138
|
-
}
|
|
1139
|
-
});
|
|
1140
|
-
|
|
1141
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/omap.js
|
|
1142
|
-
var require_omap = __commonJS({
|
|
1143
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/omap.js"(exports2, module2) {
|
|
1144
|
-
"use strict";
|
|
1145
|
-
var Type = require_type();
|
|
1146
|
-
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1147
|
-
var _toString = Object.prototype.toString;
|
|
1148
|
-
function resolveYamlOmap(data) {
|
|
1149
|
-
if (data === null) return true;
|
|
1150
|
-
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
1151
|
-
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1152
|
-
pair = object[index];
|
|
1153
|
-
pairHasKey = false;
|
|
1154
|
-
if (_toString.call(pair) !== "[object Object]") return false;
|
|
1155
|
-
for (pairKey in pair) {
|
|
1156
|
-
if (_hasOwnProperty.call(pair, pairKey)) {
|
|
1157
|
-
if (!pairHasKey) pairHasKey = true;
|
|
1158
|
-
else return false;
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
if (!pairHasKey) return false;
|
|
1162
|
-
if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
|
|
1163
|
-
else return false;
|
|
1164
|
-
}
|
|
1165
|
-
return true;
|
|
1166
|
-
}
|
|
1167
|
-
function constructYamlOmap(data) {
|
|
1168
|
-
return data !== null ? data : [];
|
|
1169
|
-
}
|
|
1170
|
-
module2.exports = new Type("tag:yaml.org,2002:omap", {
|
|
1171
|
-
kind: "sequence",
|
|
1172
|
-
resolve: resolveYamlOmap,
|
|
1173
|
-
construct: constructYamlOmap
|
|
1174
|
-
});
|
|
1175
|
-
}
|
|
1176
|
-
});
|
|
1177
|
-
|
|
1178
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/pairs.js
|
|
1179
|
-
var require_pairs = __commonJS({
|
|
1180
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/pairs.js"(exports2, module2) {
|
|
1181
|
-
"use strict";
|
|
1182
|
-
var Type = require_type();
|
|
1183
|
-
var _toString = Object.prototype.toString;
|
|
1184
|
-
function resolveYamlPairs(data) {
|
|
1185
|
-
if (data === null) return true;
|
|
1186
|
-
var index, length, pair, keys, result, object = data;
|
|
1187
|
-
result = new Array(object.length);
|
|
1188
|
-
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1189
|
-
pair = object[index];
|
|
1190
|
-
if (_toString.call(pair) !== "[object Object]") return false;
|
|
1191
|
-
keys = Object.keys(pair);
|
|
1192
|
-
if (keys.length !== 1) return false;
|
|
1193
|
-
result[index] = [keys[0], pair[keys[0]]];
|
|
1194
|
-
}
|
|
1195
|
-
return true;
|
|
1196
|
-
}
|
|
1197
|
-
function constructYamlPairs(data) {
|
|
1198
|
-
if (data === null) return [];
|
|
1199
|
-
var index, length, pair, keys, result, object = data;
|
|
1200
|
-
result = new Array(object.length);
|
|
1201
|
-
for (index = 0, length = object.length; index < length; index += 1) {
|
|
1202
|
-
pair = object[index];
|
|
1203
|
-
keys = Object.keys(pair);
|
|
1204
|
-
result[index] = [keys[0], pair[keys[0]]];
|
|
1205
|
-
}
|
|
1206
|
-
return result;
|
|
1207
|
-
}
|
|
1208
|
-
module2.exports = new Type("tag:yaml.org,2002:pairs", {
|
|
1209
|
-
kind: "sequence",
|
|
1210
|
-
resolve: resolveYamlPairs,
|
|
1211
|
-
construct: constructYamlPairs
|
|
1212
|
-
});
|
|
1213
|
-
}
|
|
1214
|
-
});
|
|
1215
|
-
|
|
1216
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/set.js
|
|
1217
|
-
var require_set = __commonJS({
|
|
1218
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/set.js"(exports2, module2) {
|
|
1219
|
-
"use strict";
|
|
1220
|
-
var Type = require_type();
|
|
1221
|
-
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1222
|
-
function resolveYamlSet(data) {
|
|
1223
|
-
if (data === null) return true;
|
|
1224
|
-
var key, object = data;
|
|
1225
|
-
for (key in object) {
|
|
1226
|
-
if (_hasOwnProperty.call(object, key)) {
|
|
1227
|
-
if (object[key] !== null) return false;
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
return true;
|
|
1231
|
-
}
|
|
1232
|
-
function constructYamlSet(data) {
|
|
1233
|
-
return data !== null ? data : {};
|
|
1234
|
-
}
|
|
1235
|
-
module2.exports = new Type("tag:yaml.org,2002:set", {
|
|
1236
|
-
kind: "mapping",
|
|
1237
|
-
resolve: resolveYamlSet,
|
|
1238
|
-
construct: constructYamlSet
|
|
1239
|
-
});
|
|
1240
|
-
}
|
|
1241
|
-
});
|
|
1242
|
-
|
|
1243
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js
|
|
1244
|
-
var require_default_safe = __commonJS({
|
|
1245
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js"(exports2, module2) {
|
|
1246
|
-
"use strict";
|
|
1247
|
-
var Schema3 = require_schema();
|
|
1248
|
-
module2.exports = new Schema3({
|
|
1249
|
-
include: [
|
|
1250
|
-
require_core()
|
|
1251
|
-
],
|
|
1252
|
-
implicit: [
|
|
1253
|
-
require_timestamp(),
|
|
1254
|
-
require_merge()
|
|
1255
|
-
],
|
|
1256
|
-
explicit: [
|
|
1257
|
-
require_binary(),
|
|
1258
|
-
require_omap(),
|
|
1259
|
-
require_pairs(),
|
|
1260
|
-
require_set()
|
|
1261
|
-
]
|
|
1262
|
-
});
|
|
1263
|
-
}
|
|
1264
|
-
});
|
|
1265
|
-
|
|
1266
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js
|
|
1267
|
-
var require_undefined = __commonJS({
|
|
1268
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js"(exports2, module2) {
|
|
1269
|
-
"use strict";
|
|
1270
|
-
var Type = require_type();
|
|
1271
|
-
function resolveJavascriptUndefined() {
|
|
1272
|
-
return true;
|
|
1273
|
-
}
|
|
1274
|
-
function constructJavascriptUndefined() {
|
|
1275
|
-
return void 0;
|
|
1276
|
-
}
|
|
1277
|
-
function representJavascriptUndefined() {
|
|
1278
|
-
return "";
|
|
1279
|
-
}
|
|
1280
|
-
function isUndefined(object) {
|
|
1281
|
-
return typeof object === "undefined";
|
|
1282
|
-
}
|
|
1283
|
-
module2.exports = new Type("tag:yaml.org,2002:js/undefined", {
|
|
1284
|
-
kind: "scalar",
|
|
1285
|
-
resolve: resolveJavascriptUndefined,
|
|
1286
|
-
construct: constructJavascriptUndefined,
|
|
1287
|
-
predicate: isUndefined,
|
|
1288
|
-
represent: representJavascriptUndefined
|
|
1289
|
-
});
|
|
1290
|
-
}
|
|
1291
|
-
});
|
|
1292
|
-
|
|
1293
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js
|
|
1294
|
-
var require_regexp = __commonJS({
|
|
1295
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js"(exports2, module2) {
|
|
1296
|
-
"use strict";
|
|
1297
|
-
var Type = require_type();
|
|
1298
|
-
function resolveJavascriptRegExp(data) {
|
|
1299
|
-
if (data === null) return false;
|
|
1300
|
-
if (data.length === 0) return false;
|
|
1301
|
-
var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
|
|
1302
|
-
if (regexp[0] === "/") {
|
|
1303
|
-
if (tail) modifiers = tail[1];
|
|
1304
|
-
if (modifiers.length > 3) return false;
|
|
1305
|
-
if (regexp[regexp.length - modifiers.length - 1] !== "/") return false;
|
|
1306
|
-
}
|
|
1307
|
-
return true;
|
|
1308
|
-
}
|
|
1309
|
-
function constructJavascriptRegExp(data) {
|
|
1310
|
-
var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
|
|
1311
|
-
if (regexp[0] === "/") {
|
|
1312
|
-
if (tail) modifiers = tail[1];
|
|
1313
|
-
regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
|
|
1314
|
-
}
|
|
1315
|
-
return new RegExp(regexp, modifiers);
|
|
1316
|
-
}
|
|
1317
|
-
function representJavascriptRegExp(object) {
|
|
1318
|
-
var result = "/" + object.source + "/";
|
|
1319
|
-
if (object.global) result += "g";
|
|
1320
|
-
if (object.multiline) result += "m";
|
|
1321
|
-
if (object.ignoreCase) result += "i";
|
|
1322
|
-
return result;
|
|
1323
|
-
}
|
|
1324
|
-
function isRegExp(object) {
|
|
1325
|
-
return Object.prototype.toString.call(object) === "[object RegExp]";
|
|
1326
|
-
}
|
|
1327
|
-
module2.exports = new Type("tag:yaml.org,2002:js/regexp", {
|
|
1328
|
-
kind: "scalar",
|
|
1329
|
-
resolve: resolveJavascriptRegExp,
|
|
1330
|
-
construct: constructJavascriptRegExp,
|
|
1331
|
-
predicate: isRegExp,
|
|
1332
|
-
represent: representJavascriptRegExp
|
|
1333
|
-
});
|
|
1334
|
-
}
|
|
1335
|
-
});
|
|
1336
|
-
|
|
1337
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/function.js
|
|
1338
|
-
var require_function = __commonJS({
|
|
1339
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/function.js"(exports2, module2) {
|
|
1340
|
-
"use strict";
|
|
1341
|
-
var esprima;
|
|
1342
|
-
try {
|
|
1343
|
-
_require = require;
|
|
1344
|
-
esprima = _require("esprima");
|
|
1345
|
-
} catch (_) {
|
|
1346
|
-
if (typeof window !== "undefined") esprima = window.esprima;
|
|
1347
|
-
}
|
|
1348
|
-
var _require;
|
|
1349
|
-
var Type = require_type();
|
|
1350
|
-
function resolveJavascriptFunction(data) {
|
|
1351
|
-
if (data === null) return false;
|
|
1352
|
-
try {
|
|
1353
|
-
var source = "(" + data + ")", ast = esprima.parse(source, { range: true });
|
|
1354
|
-
if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") {
|
|
1355
|
-
return false;
|
|
1356
|
-
}
|
|
1357
|
-
return true;
|
|
1358
|
-
} catch (err) {
|
|
1359
|
-
return false;
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
function constructJavascriptFunction(data) {
|
|
1363
|
-
var source = "(" + data + ")", ast = esprima.parse(source, { range: true }), params = [], body;
|
|
1364
|
-
if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") {
|
|
1365
|
-
throw new Error("Failed to resolve function");
|
|
1366
|
-
}
|
|
1367
|
-
ast.body[0].expression.params.forEach(function(param) {
|
|
1368
|
-
params.push(param.name);
|
|
1369
|
-
});
|
|
1370
|
-
body = ast.body[0].expression.body.range;
|
|
1371
|
-
if (ast.body[0].expression.body.type === "BlockStatement") {
|
|
1372
|
-
return new Function(params, source.slice(body[0] + 1, body[1] - 1));
|
|
1373
|
-
}
|
|
1374
|
-
return new Function(params, "return " + source.slice(body[0], body[1]));
|
|
1375
|
-
}
|
|
1376
|
-
function representJavascriptFunction(object) {
|
|
1377
|
-
return object.toString();
|
|
1378
|
-
}
|
|
1379
|
-
function isFunction(object) {
|
|
1380
|
-
return Object.prototype.toString.call(object) === "[object Function]";
|
|
1381
|
-
}
|
|
1382
|
-
module2.exports = new Type("tag:yaml.org,2002:js/function", {
|
|
1383
|
-
kind: "scalar",
|
|
1384
|
-
resolve: resolveJavascriptFunction,
|
|
1385
|
-
construct: constructJavascriptFunction,
|
|
1386
|
-
predicate: isFunction,
|
|
1387
|
-
represent: representJavascriptFunction
|
|
1388
|
-
});
|
|
1389
|
-
}
|
|
1390
|
-
});
|
|
1391
|
-
|
|
1392
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/default_full.js
|
|
1393
|
-
var require_default_full = __commonJS({
|
|
1394
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/default_full.js"(exports2, module2) {
|
|
1395
|
-
"use strict";
|
|
1396
|
-
var Schema3 = require_schema();
|
|
1397
|
-
module2.exports = Schema3.DEFAULT = new Schema3({
|
|
1398
|
-
include: [
|
|
1399
|
-
require_default_safe()
|
|
1400
|
-
],
|
|
1401
|
-
explicit: [
|
|
1402
|
-
require_undefined(),
|
|
1403
|
-
require_regexp(),
|
|
1404
|
-
require_function()
|
|
1405
|
-
]
|
|
1406
|
-
});
|
|
1407
|
-
}
|
|
1408
|
-
});
|
|
1409
|
-
|
|
1410
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/loader.js
|
|
1411
|
-
var require_loader = __commonJS({
|
|
1412
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/loader.js"(exports2, module2) {
|
|
1413
|
-
"use strict";
|
|
1414
|
-
var common = require_common();
|
|
1415
|
-
var YAMLException2 = require_exception();
|
|
1416
|
-
var Mark = require_mark();
|
|
1417
|
-
var DEFAULT_SAFE_SCHEMA = require_default_safe();
|
|
1418
|
-
var DEFAULT_FULL_SCHEMA = require_default_full();
|
|
1419
|
-
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1420
|
-
var CONTEXT_FLOW_IN2 = 1;
|
|
1421
|
-
var CONTEXT_FLOW_OUT2 = 2;
|
|
1422
|
-
var CONTEXT_BLOCK_IN2 = 3;
|
|
1423
|
-
var CONTEXT_BLOCK_OUT2 = 4;
|
|
1424
|
-
var CHOMPING_CLIP = 1;
|
|
1425
|
-
var CHOMPING_STRIP = 2;
|
|
1426
|
-
var CHOMPING_KEEP = 3;
|
|
1427
|
-
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
|
-
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
1429
|
-
var PATTERN_FLOW_INDICATORS2 = /[,\[\]\{\}]/;
|
|
1430
|
-
var PATTERN_TAG_HANDLE2 = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
1431
|
-
var PATTERN_TAG_URI2 = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
1432
|
-
function _class(obj) {
|
|
1433
|
-
return Object.prototype.toString.call(obj);
|
|
1434
|
-
}
|
|
1435
|
-
function is_EOL(c) {
|
|
1436
|
-
return c === 10 || c === 13;
|
|
1437
|
-
}
|
|
1438
|
-
function is_WHITE_SPACE(c) {
|
|
1439
|
-
return c === 9 || c === 32;
|
|
1440
|
-
}
|
|
1441
|
-
function is_WS_OR_EOL(c) {
|
|
1442
|
-
return c === 9 || c === 32 || c === 10 || c === 13;
|
|
1443
|
-
}
|
|
1444
|
-
function is_FLOW_INDICATOR(c) {
|
|
1445
|
-
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
1446
|
-
}
|
|
1447
|
-
function fromHexCode2(c) {
|
|
1448
|
-
var lc;
|
|
1449
|
-
if (48 <= c && c <= 57) {
|
|
1450
|
-
return c - 48;
|
|
1451
|
-
}
|
|
1452
|
-
lc = c | 32;
|
|
1453
|
-
if (97 <= lc && lc <= 102) {
|
|
1454
|
-
return lc - 97 + 10;
|
|
1455
|
-
}
|
|
1456
|
-
return -1;
|
|
1457
|
-
}
|
|
1458
|
-
function escapedHexLen2(c) {
|
|
1459
|
-
if (c === 120) {
|
|
1460
|
-
return 2;
|
|
1461
|
-
}
|
|
1462
|
-
if (c === 117) {
|
|
1463
|
-
return 4;
|
|
1464
|
-
}
|
|
1465
|
-
if (c === 85) {
|
|
1466
|
-
return 8;
|
|
1467
|
-
}
|
|
1468
|
-
return 0;
|
|
1469
|
-
}
|
|
1470
|
-
function fromDecimalCode2(c) {
|
|
1471
|
-
if (48 <= c && c <= 57) {
|
|
1472
|
-
return c - 48;
|
|
1473
|
-
}
|
|
1474
|
-
return -1;
|
|
1475
|
-
}
|
|
1476
|
-
function simpleEscapeSequence2(c) {
|
|
1477
|
-
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
|
-
}
|
|
1479
|
-
function charFromCodepoint2(c) {
|
|
1480
|
-
if (c <= 65535) {
|
|
1481
|
-
return String.fromCharCode(c);
|
|
1482
|
-
}
|
|
1483
|
-
return String.fromCharCode(
|
|
1484
|
-
(c - 65536 >> 10) + 55296,
|
|
1485
|
-
(c - 65536 & 1023) + 56320
|
|
1486
|
-
);
|
|
1487
|
-
}
|
|
1488
|
-
function setProperty(object, key, value) {
|
|
1489
|
-
if (key === "__proto__") {
|
|
1490
|
-
Object.defineProperty(object, key, {
|
|
1491
|
-
configurable: true,
|
|
1492
|
-
enumerable: true,
|
|
1493
|
-
writable: true,
|
|
1494
|
-
value
|
|
1495
|
-
});
|
|
1496
|
-
} else {
|
|
1497
|
-
object[key] = value;
|
|
1498
|
-
}
|
|
1499
|
-
}
|
|
1500
|
-
var simpleEscapeCheck2 = new Array(256);
|
|
1501
|
-
var simpleEscapeMap2 = new Array(256);
|
|
1502
|
-
for (i = 0; i < 256; i++) {
|
|
1503
|
-
simpleEscapeCheck2[i] = simpleEscapeSequence2(i) ? 1 : 0;
|
|
1504
|
-
simpleEscapeMap2[i] = simpleEscapeSequence2(i);
|
|
1505
|
-
}
|
|
1506
|
-
var i;
|
|
1507
|
-
function State(input, options2) {
|
|
1508
|
-
this.input = input;
|
|
1509
|
-
this.filename = options2["filename"] || null;
|
|
1510
|
-
this.schema = options2["schema"] || DEFAULT_FULL_SCHEMA;
|
|
1511
|
-
this.onWarning = options2["onWarning"] || null;
|
|
1512
|
-
this.legacy = options2["legacy"] || false;
|
|
1513
|
-
this.json = options2["json"] || false;
|
|
1514
|
-
this.listener = options2["listener"] || null;
|
|
1515
|
-
this.maxTotalMergeKeys = typeof options2["maxTotalMergeKeys"] === "number" ? options2["maxTotalMergeKeys"] : 1e4;
|
|
1516
|
-
this.implicitTypes = this.schema.compiledImplicit;
|
|
1517
|
-
this.typeMap = this.schema.compiledTypeMap;
|
|
1518
|
-
this.length = input.length;
|
|
1519
|
-
this.position = 0;
|
|
1520
|
-
this.line = 0;
|
|
1521
|
-
this.lineStart = 0;
|
|
1522
|
-
this.lineIndent = 0;
|
|
1523
|
-
this.totalMergeKeys = 0;
|
|
1524
|
-
this.documents = [];
|
|
1525
|
-
}
|
|
1526
|
-
function generateError(state, message) {
|
|
1527
|
-
return new YAMLException2(
|
|
1528
|
-
message,
|
|
1529
|
-
new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart)
|
|
1530
|
-
);
|
|
1531
|
-
}
|
|
1532
|
-
function throwError2(state, message) {
|
|
1533
|
-
throw generateError(state, message);
|
|
1534
|
-
}
|
|
1535
|
-
function throwWarning(state, message) {
|
|
1536
|
-
if (state.onWarning) {
|
|
1537
|
-
state.onWarning.call(null, generateError(state, message));
|
|
1538
|
-
}
|
|
1539
|
-
}
|
|
1540
|
-
var directiveHandlers = {
|
|
1541
|
-
YAML: function handleYamlDirective(state, name, args) {
|
|
1542
|
-
var match, major, minor;
|
|
1543
|
-
if (state.version !== null) {
|
|
1544
|
-
throwError2(state, "duplication of %YAML directive");
|
|
1545
|
-
}
|
|
1546
|
-
if (args.length !== 1) {
|
|
1547
|
-
throwError2(state, "YAML directive accepts exactly one argument");
|
|
1548
|
-
}
|
|
1549
|
-
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
1550
|
-
if (match === null) {
|
|
1551
|
-
throwError2(state, "ill-formed argument of the YAML directive");
|
|
1552
|
-
}
|
|
1553
|
-
major = parseInt(match[1], 10);
|
|
1554
|
-
minor = parseInt(match[2], 10);
|
|
1555
|
-
if (major !== 1) {
|
|
1556
|
-
throwError2(state, "unacceptable YAML version of the document");
|
|
1557
|
-
}
|
|
1558
|
-
state.version = args[0];
|
|
1559
|
-
state.checkLineBreaks = minor < 2;
|
|
1560
|
-
if (minor !== 1 && minor !== 2) {
|
|
1561
|
-
throwWarning(state, "unsupported YAML version of the document");
|
|
1562
|
-
}
|
|
1563
|
-
},
|
|
1564
|
-
TAG: function handleTagDirective(state, name, args) {
|
|
1565
|
-
var handle, prefix;
|
|
1566
|
-
if (args.length !== 2) {
|
|
1567
|
-
throwError2(state, "TAG directive accepts exactly two arguments");
|
|
1568
|
-
}
|
|
1569
|
-
handle = args[0];
|
|
1570
|
-
prefix = args[1];
|
|
1571
|
-
if (!PATTERN_TAG_HANDLE2.test(handle)) {
|
|
1572
|
-
throwError2(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
1573
|
-
}
|
|
1574
|
-
if (_hasOwnProperty.call(state.tagMap, handle)) {
|
|
1575
|
-
throwError2(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
1576
|
-
}
|
|
1577
|
-
if (!PATTERN_TAG_URI2.test(prefix)) {
|
|
1578
|
-
throwError2(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
1579
|
-
}
|
|
1580
|
-
state.tagMap[handle] = prefix;
|
|
1581
|
-
}
|
|
1582
|
-
};
|
|
1583
|
-
function captureSegment(state, start, end, checkJson) {
|
|
1584
|
-
var _position, _length, _character, _result;
|
|
1585
|
-
if (start < end) {
|
|
1586
|
-
_result = state.input.slice(start, end);
|
|
1587
|
-
if (checkJson) {
|
|
1588
|
-
for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
|
1589
|
-
_character = _result.charCodeAt(_position);
|
|
1590
|
-
if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
|
|
1591
|
-
throwError2(state, "expected valid JSON character");
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1594
|
-
} else if (PATTERN_NON_PRINTABLE2.test(_result)) {
|
|
1595
|
-
throwError2(state, "the stream contains non-printable characters");
|
|
1596
|
-
}
|
|
1597
|
-
state.result += _result;
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
function mergeMappings(state, destination, source, overridableKeys) {
|
|
1601
|
-
var sourceKeys, key, index, quantity;
|
|
1602
|
-
if (!common.isObject(source)) {
|
|
1603
|
-
throwError2(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
1604
|
-
}
|
|
1605
|
-
sourceKeys = Object.keys(source);
|
|
1606
|
-
for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
1607
|
-
key = sourceKeys[index];
|
|
1608
|
-
if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
|
|
1609
|
-
throwError2(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
|
|
1610
|
-
}
|
|
1611
|
-
if (!_hasOwnProperty.call(destination, key)) {
|
|
1612
|
-
setProperty(destination, key, source[key]);
|
|
1613
|
-
overridableKeys[key] = true;
|
|
1614
|
-
}
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
|
|
1618
|
-
var index, quantity;
|
|
1619
|
-
if (Array.isArray(keyNode)) {
|
|
1620
|
-
keyNode = Array.prototype.slice.call(keyNode);
|
|
1621
|
-
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
|
1622
|
-
if (Array.isArray(keyNode[index])) {
|
|
1623
|
-
throwError2(state, "nested arrays are not supported inside keys");
|
|
1624
|
-
}
|
|
1625
|
-
if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
|
|
1626
|
-
keyNode[index] = "[object Object]";
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
|
|
1631
|
-
keyNode = "[object Object]";
|
|
1632
|
-
}
|
|
1633
|
-
keyNode = String(keyNode);
|
|
1634
|
-
if (_result === null) {
|
|
1635
|
-
_result = {};
|
|
1636
|
-
}
|
|
1637
|
-
if (keyTag === "tag:yaml.org,2002:merge") {
|
|
1638
|
-
if (Array.isArray(valueNode)) {
|
|
1639
|
-
for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
|
1640
|
-
mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
1641
|
-
}
|
|
1642
|
-
} else {
|
|
1643
|
-
mergeMappings(state, _result, valueNode, overridableKeys);
|
|
1644
|
-
}
|
|
1645
|
-
} else {
|
|
1646
|
-
if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
|
|
1647
|
-
state.line = startLine || state.line;
|
|
1648
|
-
state.position = startPos || state.position;
|
|
1649
|
-
throwError2(state, "duplicated mapping key");
|
|
1650
|
-
}
|
|
1651
|
-
setProperty(_result, keyNode, valueNode);
|
|
1652
|
-
delete overridableKeys[keyNode];
|
|
1653
|
-
}
|
|
1654
|
-
return _result;
|
|
1655
|
-
}
|
|
1656
|
-
function readLineBreak(state) {
|
|
1657
|
-
var ch;
|
|
1658
|
-
ch = state.input.charCodeAt(state.position);
|
|
1659
|
-
if (ch === 10) {
|
|
1660
|
-
state.position++;
|
|
1661
|
-
} else if (ch === 13) {
|
|
1662
|
-
state.position++;
|
|
1663
|
-
if (state.input.charCodeAt(state.position) === 10) {
|
|
1664
|
-
state.position++;
|
|
1665
|
-
}
|
|
1666
|
-
} else {
|
|
1667
|
-
throwError2(state, "a line break is expected");
|
|
1668
|
-
}
|
|
1669
|
-
state.line += 1;
|
|
1670
|
-
state.lineStart = state.position;
|
|
1671
|
-
}
|
|
1672
|
-
function skipSeparationSpace2(state, allowComments, checkIndent) {
|
|
1673
|
-
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
|
|
1674
|
-
while (ch !== 0) {
|
|
1675
|
-
while (is_WHITE_SPACE(ch)) {
|
|
1676
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1677
|
-
}
|
|
1678
|
-
if (allowComments && ch === 35) {
|
|
1679
|
-
do {
|
|
1680
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1681
|
-
} while (ch !== 10 && ch !== 13 && ch !== 0);
|
|
1682
|
-
}
|
|
1683
|
-
if (is_EOL(ch)) {
|
|
1684
|
-
readLineBreak(state);
|
|
1685
|
-
ch = state.input.charCodeAt(state.position);
|
|
1686
|
-
lineBreaks++;
|
|
1687
|
-
state.lineIndent = 0;
|
|
1688
|
-
while (ch === 32) {
|
|
1689
|
-
state.lineIndent++;
|
|
1690
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1691
|
-
}
|
|
1692
|
-
} else {
|
|
1693
|
-
break;
|
|
1694
|
-
}
|
|
1695
|
-
}
|
|
1696
|
-
if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
|
|
1697
|
-
throwWarning(state, "deficient indentation");
|
|
1698
|
-
}
|
|
1699
|
-
return lineBreaks;
|
|
1700
|
-
}
|
|
1701
|
-
function testDocumentSeparator2(state) {
|
|
1702
|
-
var _position = state.position, ch;
|
|
1703
|
-
ch = state.input.charCodeAt(_position);
|
|
1704
|
-
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
1705
|
-
_position += 3;
|
|
1706
|
-
ch = state.input.charCodeAt(_position);
|
|
1707
|
-
if (ch === 0 || is_WS_OR_EOL(ch)) {
|
|
1708
|
-
return true;
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
return false;
|
|
1712
|
-
}
|
|
1713
|
-
function writeFoldedLines(state, count) {
|
|
1714
|
-
if (count === 1) {
|
|
1715
|
-
state.result += " ";
|
|
1716
|
-
} else if (count > 1) {
|
|
1717
|
-
state.result += common.repeat("\n", count - 1);
|
|
1718
|
-
}
|
|
1719
|
-
}
|
|
1720
|
-
function readPlainScalar2(state, nodeIndent, withinFlowCollection) {
|
|
1721
|
-
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
1722
|
-
ch = state.input.charCodeAt(state.position);
|
|
1723
|
-
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) {
|
|
1724
|
-
return false;
|
|
1725
|
-
}
|
|
1726
|
-
if (ch === 63 || ch === 45) {
|
|
1727
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
1728
|
-
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
1729
|
-
return false;
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
state.kind = "scalar";
|
|
1733
|
-
state.result = "";
|
|
1734
|
-
captureStart = captureEnd = state.position;
|
|
1735
|
-
hasPendingContent = false;
|
|
1736
|
-
while (ch !== 0) {
|
|
1737
|
-
if (ch === 58) {
|
|
1738
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
1739
|
-
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
1740
|
-
break;
|
|
1741
|
-
}
|
|
1742
|
-
} else if (ch === 35) {
|
|
1743
|
-
preceding = state.input.charCodeAt(state.position - 1);
|
|
1744
|
-
if (is_WS_OR_EOL(preceding)) {
|
|
1745
|
-
break;
|
|
1746
|
-
}
|
|
1747
|
-
} else if (state.position === state.lineStart && testDocumentSeparator2(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
|
1748
|
-
break;
|
|
1749
|
-
} else if (is_EOL(ch)) {
|
|
1750
|
-
_line = state.line;
|
|
1751
|
-
_lineStart = state.lineStart;
|
|
1752
|
-
_lineIndent = state.lineIndent;
|
|
1753
|
-
skipSeparationSpace2(state, false, -1);
|
|
1754
|
-
if (state.lineIndent >= nodeIndent) {
|
|
1755
|
-
hasPendingContent = true;
|
|
1756
|
-
ch = state.input.charCodeAt(state.position);
|
|
1757
|
-
continue;
|
|
1758
|
-
} else {
|
|
1759
|
-
state.position = captureEnd;
|
|
1760
|
-
state.line = _line;
|
|
1761
|
-
state.lineStart = _lineStart;
|
|
1762
|
-
state.lineIndent = _lineIndent;
|
|
1763
|
-
break;
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
if (hasPendingContent) {
|
|
1767
|
-
captureSegment(state, captureStart, captureEnd, false);
|
|
1768
|
-
writeFoldedLines(state, state.line - _line);
|
|
1769
|
-
captureStart = captureEnd = state.position;
|
|
1770
|
-
hasPendingContent = false;
|
|
1771
|
-
}
|
|
1772
|
-
if (!is_WHITE_SPACE(ch)) {
|
|
1773
|
-
captureEnd = state.position + 1;
|
|
1774
|
-
}
|
|
1775
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1776
|
-
}
|
|
1777
|
-
captureSegment(state, captureStart, captureEnd, false);
|
|
1778
|
-
if (state.result) {
|
|
1779
|
-
return true;
|
|
1780
|
-
}
|
|
1781
|
-
state.kind = _kind;
|
|
1782
|
-
state.result = _result;
|
|
1783
|
-
return false;
|
|
1784
|
-
}
|
|
1785
|
-
function readSingleQuotedScalar2(state, nodeIndent) {
|
|
1786
|
-
var ch, captureStart, captureEnd;
|
|
1787
|
-
ch = state.input.charCodeAt(state.position);
|
|
1788
|
-
if (ch !== 39) {
|
|
1789
|
-
return false;
|
|
1790
|
-
}
|
|
1791
|
-
state.kind = "scalar";
|
|
1792
|
-
state.result = "";
|
|
1793
|
-
state.position++;
|
|
1794
|
-
captureStart = captureEnd = state.position;
|
|
1795
|
-
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
1796
|
-
if (ch === 39) {
|
|
1797
|
-
captureSegment(state, captureStart, state.position, true);
|
|
1798
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1799
|
-
if (ch === 39) {
|
|
1800
|
-
captureStart = state.position;
|
|
1801
|
-
state.position++;
|
|
1802
|
-
captureEnd = state.position;
|
|
1803
|
-
} else {
|
|
1804
|
-
return true;
|
|
1805
|
-
}
|
|
1806
|
-
} else if (is_EOL(ch)) {
|
|
1807
|
-
captureSegment(state, captureStart, captureEnd, true);
|
|
1808
|
-
writeFoldedLines(state, skipSeparationSpace2(state, false, nodeIndent));
|
|
1809
|
-
captureStart = captureEnd = state.position;
|
|
1810
|
-
} else if (state.position === state.lineStart && testDocumentSeparator2(state)) {
|
|
1811
|
-
throwError2(state, "unexpected end of the document within a single quoted scalar");
|
|
1812
|
-
} else {
|
|
1813
|
-
state.position++;
|
|
1814
|
-
captureEnd = state.position;
|
|
1815
|
-
}
|
|
1816
|
-
}
|
|
1817
|
-
throwError2(state, "unexpected end of the stream within a single quoted scalar");
|
|
1818
|
-
}
|
|
1819
|
-
function readDoubleQuotedScalar2(state, nodeIndent) {
|
|
1820
|
-
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
|
1821
|
-
ch = state.input.charCodeAt(state.position);
|
|
1822
|
-
if (ch !== 34) {
|
|
1823
|
-
return false;
|
|
1824
|
-
}
|
|
1825
|
-
state.kind = "scalar";
|
|
1826
|
-
state.result = "";
|
|
1827
|
-
state.position++;
|
|
1828
|
-
captureStart = captureEnd = state.position;
|
|
1829
|
-
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
1830
|
-
if (ch === 34) {
|
|
1831
|
-
captureSegment(state, captureStart, state.position, true);
|
|
1832
|
-
state.position++;
|
|
1833
|
-
return true;
|
|
1834
|
-
} else if (ch === 92) {
|
|
1835
|
-
captureSegment(state, captureStart, state.position, true);
|
|
1836
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1837
|
-
if (is_EOL(ch)) {
|
|
1838
|
-
skipSeparationSpace2(state, false, nodeIndent);
|
|
1839
|
-
} else if (ch < 256 && simpleEscapeCheck2[ch]) {
|
|
1840
|
-
state.result += simpleEscapeMap2[ch];
|
|
1841
|
-
state.position++;
|
|
1842
|
-
} else if ((tmp = escapedHexLen2(ch)) > 0) {
|
|
1843
|
-
hexLength = tmp;
|
|
1844
|
-
hexResult = 0;
|
|
1845
|
-
for (; hexLength > 0; hexLength--) {
|
|
1846
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1847
|
-
if ((tmp = fromHexCode2(ch)) >= 0) {
|
|
1848
|
-
hexResult = (hexResult << 4) + tmp;
|
|
1849
|
-
} else {
|
|
1850
|
-
throwError2(state, "expected hexadecimal character");
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
state.result += charFromCodepoint2(hexResult);
|
|
1854
|
-
state.position++;
|
|
1855
|
-
} else {
|
|
1856
|
-
throwError2(state, "unknown escape sequence");
|
|
1857
|
-
}
|
|
1858
|
-
captureStart = captureEnd = state.position;
|
|
1859
|
-
} else if (is_EOL(ch)) {
|
|
1860
|
-
captureSegment(state, captureStart, captureEnd, true);
|
|
1861
|
-
writeFoldedLines(state, skipSeparationSpace2(state, false, nodeIndent));
|
|
1862
|
-
captureStart = captureEnd = state.position;
|
|
1863
|
-
} else if (state.position === state.lineStart && testDocumentSeparator2(state)) {
|
|
1864
|
-
throwError2(state, "unexpected end of the document within a double quoted scalar");
|
|
1865
|
-
} else {
|
|
1866
|
-
state.position++;
|
|
1867
|
-
captureEnd = state.position;
|
|
1868
|
-
}
|
|
1869
|
-
}
|
|
1870
|
-
throwError2(state, "unexpected end of the stream within a double quoted scalar");
|
|
1871
|
-
}
|
|
1872
|
-
function readFlowCollection2(state, nodeIndent) {
|
|
1873
|
-
var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch;
|
|
1874
|
-
ch = state.input.charCodeAt(state.position);
|
|
1875
|
-
if (ch === 91) {
|
|
1876
|
-
terminator = 93;
|
|
1877
|
-
isMapping = false;
|
|
1878
|
-
_result = [];
|
|
1879
|
-
} else if (ch === 123) {
|
|
1880
|
-
terminator = 125;
|
|
1881
|
-
isMapping = true;
|
|
1882
|
-
_result = {};
|
|
1883
|
-
} else {
|
|
1884
|
-
return false;
|
|
1885
|
-
}
|
|
1886
|
-
if (state.anchor !== null) {
|
|
1887
|
-
state.anchorMap[state.anchor] = _result;
|
|
1888
|
-
}
|
|
1889
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1890
|
-
while (ch !== 0) {
|
|
1891
|
-
skipSeparationSpace2(state, true, nodeIndent);
|
|
1892
|
-
ch = state.input.charCodeAt(state.position);
|
|
1893
|
-
if (ch === terminator) {
|
|
1894
|
-
state.position++;
|
|
1895
|
-
state.tag = _tag;
|
|
1896
|
-
state.anchor = _anchor;
|
|
1897
|
-
state.kind = isMapping ? "mapping" : "sequence";
|
|
1898
|
-
state.result = _result;
|
|
1899
|
-
return true;
|
|
1900
|
-
} else if (!readNext) {
|
|
1901
|
-
throwError2(state, "missed comma between flow collection entries");
|
|
1902
|
-
}
|
|
1903
|
-
keyTag = keyNode = valueNode = null;
|
|
1904
|
-
isPair = isExplicitPair = false;
|
|
1905
|
-
if (ch === 63) {
|
|
1906
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
1907
|
-
if (is_WS_OR_EOL(following)) {
|
|
1908
|
-
isPair = isExplicitPair = true;
|
|
1909
|
-
state.position++;
|
|
1910
|
-
skipSeparationSpace2(state, true, nodeIndent);
|
|
1911
|
-
}
|
|
1912
|
-
}
|
|
1913
|
-
_line = state.line;
|
|
1914
|
-
composeNode(state, nodeIndent, CONTEXT_FLOW_IN2, false, true);
|
|
1915
|
-
keyTag = state.tag;
|
|
1916
|
-
keyNode = state.result;
|
|
1917
|
-
skipSeparationSpace2(state, true, nodeIndent);
|
|
1918
|
-
ch = state.input.charCodeAt(state.position);
|
|
1919
|
-
if ((isExplicitPair || state.line === _line) && ch === 58) {
|
|
1920
|
-
isPair = true;
|
|
1921
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1922
|
-
skipSeparationSpace2(state, true, nodeIndent);
|
|
1923
|
-
composeNode(state, nodeIndent, CONTEXT_FLOW_IN2, false, true);
|
|
1924
|
-
valueNode = state.result;
|
|
1925
|
-
}
|
|
1926
|
-
if (isMapping) {
|
|
1927
|
-
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
|
|
1928
|
-
} else if (isPair) {
|
|
1929
|
-
_result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
|
|
1930
|
-
} else {
|
|
1931
|
-
_result.push(keyNode);
|
|
1932
|
-
}
|
|
1933
|
-
skipSeparationSpace2(state, true, nodeIndent);
|
|
1934
|
-
ch = state.input.charCodeAt(state.position);
|
|
1935
|
-
if (ch === 44) {
|
|
1936
|
-
readNext = true;
|
|
1937
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1938
|
-
} else {
|
|
1939
|
-
readNext = false;
|
|
1940
|
-
}
|
|
1941
|
-
}
|
|
1942
|
-
throwError2(state, "unexpected end of the stream within a flow collection");
|
|
1943
|
-
}
|
|
1944
|
-
function readBlockScalar2(state, nodeIndent) {
|
|
1945
|
-
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
|
1946
|
-
ch = state.input.charCodeAt(state.position);
|
|
1947
|
-
if (ch === 124) {
|
|
1948
|
-
folding = false;
|
|
1949
|
-
} else if (ch === 62) {
|
|
1950
|
-
folding = true;
|
|
1951
|
-
} else {
|
|
1952
|
-
return false;
|
|
1953
|
-
}
|
|
1954
|
-
state.kind = "scalar";
|
|
1955
|
-
state.result = "";
|
|
1956
|
-
while (ch !== 0) {
|
|
1957
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1958
|
-
if (ch === 43 || ch === 45) {
|
|
1959
|
-
if (CHOMPING_CLIP === chomping) {
|
|
1960
|
-
chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
1961
|
-
} else {
|
|
1962
|
-
throwError2(state, "repeat of a chomping mode identifier");
|
|
1963
|
-
}
|
|
1964
|
-
} else if ((tmp = fromDecimalCode2(ch)) >= 0) {
|
|
1965
|
-
if (tmp === 0) {
|
|
1966
|
-
throwError2(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
1967
|
-
} else if (!detectedIndent) {
|
|
1968
|
-
textIndent = nodeIndent + tmp - 1;
|
|
1969
|
-
detectedIndent = true;
|
|
1970
|
-
} else {
|
|
1971
|
-
throwError2(state, "repeat of an indentation width identifier");
|
|
1972
|
-
}
|
|
1973
|
-
} else {
|
|
1974
|
-
break;
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
if (is_WHITE_SPACE(ch)) {
|
|
1978
|
-
do {
|
|
1979
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1980
|
-
} while (is_WHITE_SPACE(ch));
|
|
1981
|
-
if (ch === 35) {
|
|
1982
|
-
do {
|
|
1983
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1984
|
-
} while (!is_EOL(ch) && ch !== 0);
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
while (ch !== 0) {
|
|
1988
|
-
readLineBreak(state);
|
|
1989
|
-
state.lineIndent = 0;
|
|
1990
|
-
ch = state.input.charCodeAt(state.position);
|
|
1991
|
-
while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
|
|
1992
|
-
state.lineIndent++;
|
|
1993
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1994
|
-
}
|
|
1995
|
-
if (!detectedIndent && state.lineIndent > textIndent) {
|
|
1996
|
-
textIndent = state.lineIndent;
|
|
1997
|
-
}
|
|
1998
|
-
if (is_EOL(ch)) {
|
|
1999
|
-
emptyLines++;
|
|
2000
|
-
continue;
|
|
2001
|
-
}
|
|
2002
|
-
if (state.lineIndent < textIndent) {
|
|
2003
|
-
if (chomping === CHOMPING_KEEP) {
|
|
2004
|
-
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
2005
|
-
} else if (chomping === CHOMPING_CLIP) {
|
|
2006
|
-
if (didReadContent) {
|
|
2007
|
-
state.result += "\n";
|
|
2008
|
-
}
|
|
2009
|
-
}
|
|
2010
|
-
break;
|
|
2011
|
-
}
|
|
2012
|
-
if (folding) {
|
|
2013
|
-
if (is_WHITE_SPACE(ch)) {
|
|
2014
|
-
atMoreIndented = true;
|
|
2015
|
-
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
2016
|
-
} else if (atMoreIndented) {
|
|
2017
|
-
atMoreIndented = false;
|
|
2018
|
-
state.result += common.repeat("\n", emptyLines + 1);
|
|
2019
|
-
} else if (emptyLines === 0) {
|
|
2020
|
-
if (didReadContent) {
|
|
2021
|
-
state.result += " ";
|
|
2022
|
-
}
|
|
2023
|
-
} else {
|
|
2024
|
-
state.result += common.repeat("\n", emptyLines);
|
|
2025
|
-
}
|
|
2026
|
-
} else {
|
|
2027
|
-
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
2028
|
-
}
|
|
2029
|
-
didReadContent = true;
|
|
2030
|
-
detectedIndent = true;
|
|
2031
|
-
emptyLines = 0;
|
|
2032
|
-
captureStart = state.position;
|
|
2033
|
-
while (!is_EOL(ch) && ch !== 0) {
|
|
2034
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2035
|
-
}
|
|
2036
|
-
captureSegment(state, captureStart, state.position, false);
|
|
2037
|
-
}
|
|
2038
|
-
return true;
|
|
2039
|
-
}
|
|
2040
|
-
function readBlockSequence2(state, nodeIndent) {
|
|
2041
|
-
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
|
|
2042
|
-
if (state.anchor !== null) {
|
|
2043
|
-
state.anchorMap[state.anchor] = _result;
|
|
2044
|
-
}
|
|
2045
|
-
ch = state.input.charCodeAt(state.position);
|
|
2046
|
-
while (ch !== 0) {
|
|
2047
|
-
if (ch !== 45) {
|
|
2048
|
-
break;
|
|
2049
|
-
}
|
|
2050
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
2051
|
-
if (!is_WS_OR_EOL(following)) {
|
|
2052
|
-
break;
|
|
2053
|
-
}
|
|
2054
|
-
detected = true;
|
|
2055
|
-
state.position++;
|
|
2056
|
-
if (skipSeparationSpace2(state, true, -1)) {
|
|
2057
|
-
if (state.lineIndent <= nodeIndent) {
|
|
2058
|
-
_result.push(null);
|
|
2059
|
-
ch = state.input.charCodeAt(state.position);
|
|
2060
|
-
continue;
|
|
2061
|
-
}
|
|
2062
|
-
}
|
|
2063
|
-
_line = state.line;
|
|
2064
|
-
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN2, false, true);
|
|
2065
|
-
_result.push(state.result);
|
|
2066
|
-
skipSeparationSpace2(state, true, -1);
|
|
2067
|
-
ch = state.input.charCodeAt(state.position);
|
|
2068
|
-
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
2069
|
-
throwError2(state, "bad indentation of a sequence entry");
|
|
2070
|
-
} else if (state.lineIndent < nodeIndent) {
|
|
2071
|
-
break;
|
|
2072
|
-
}
|
|
2073
|
-
}
|
|
2074
|
-
if (detected) {
|
|
2075
|
-
state.tag = _tag;
|
|
2076
|
-
state.anchor = _anchor;
|
|
2077
|
-
state.kind = "sequence";
|
|
2078
|
-
state.result = _result;
|
|
2079
|
-
return true;
|
|
2080
|
-
}
|
|
2081
|
-
return false;
|
|
2082
|
-
}
|
|
2083
|
-
function readBlockMapping2(state, nodeIndent, flowIndent) {
|
|
2084
|
-
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
|
-
if (state.anchor !== null) {
|
|
2086
|
-
state.anchorMap[state.anchor] = _result;
|
|
2087
|
-
}
|
|
2088
|
-
ch = state.input.charCodeAt(state.position);
|
|
2089
|
-
while (ch !== 0) {
|
|
2090
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
2091
|
-
_line = state.line;
|
|
2092
|
-
_pos = state.position;
|
|
2093
|
-
if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
|
|
2094
|
-
if (ch === 63) {
|
|
2095
|
-
if (atExplicitKey) {
|
|
2096
|
-
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
|
2097
|
-
keyTag = keyNode = valueNode = null;
|
|
2098
|
-
}
|
|
2099
|
-
detected = true;
|
|
2100
|
-
atExplicitKey = true;
|
|
2101
|
-
allowCompact = true;
|
|
2102
|
-
} else if (atExplicitKey) {
|
|
2103
|
-
atExplicitKey = false;
|
|
2104
|
-
allowCompact = true;
|
|
2105
|
-
} else {
|
|
2106
|
-
throwError2(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
2107
|
-
}
|
|
2108
|
-
state.position += 1;
|
|
2109
|
-
ch = following;
|
|
2110
|
-
} else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT2, false, true)) {
|
|
2111
|
-
if (state.line === _line) {
|
|
2112
|
-
ch = state.input.charCodeAt(state.position);
|
|
2113
|
-
while (is_WHITE_SPACE(ch)) {
|
|
2114
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2115
|
-
}
|
|
2116
|
-
if (ch === 58) {
|
|
2117
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2118
|
-
if (!is_WS_OR_EOL(ch)) {
|
|
2119
|
-
throwError2(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
2120
|
-
}
|
|
2121
|
-
if (atExplicitKey) {
|
|
2122
|
-
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
|
2123
|
-
keyTag = keyNode = valueNode = null;
|
|
2124
|
-
}
|
|
2125
|
-
detected = true;
|
|
2126
|
-
atExplicitKey = false;
|
|
2127
|
-
allowCompact = false;
|
|
2128
|
-
keyTag = state.tag;
|
|
2129
|
-
keyNode = state.result;
|
|
2130
|
-
} else if (detected) {
|
|
2131
|
-
throwError2(state, "can not read an implicit mapping pair; a colon is missed");
|
|
2132
|
-
} else {
|
|
2133
|
-
state.tag = _tag;
|
|
2134
|
-
state.anchor = _anchor;
|
|
2135
|
-
return true;
|
|
2136
|
-
}
|
|
2137
|
-
} else if (detected) {
|
|
2138
|
-
throwError2(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
2139
|
-
} else {
|
|
2140
|
-
state.tag = _tag;
|
|
2141
|
-
state.anchor = _anchor;
|
|
2142
|
-
return true;
|
|
2143
|
-
}
|
|
2144
|
-
} else {
|
|
2145
|
-
break;
|
|
2146
|
-
}
|
|
2147
|
-
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
2148
|
-
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT2, true, allowCompact)) {
|
|
2149
|
-
if (atExplicitKey) {
|
|
2150
|
-
keyNode = state.result;
|
|
2151
|
-
} else {
|
|
2152
|
-
valueNode = state.result;
|
|
2153
|
-
}
|
|
2154
|
-
}
|
|
2155
|
-
if (!atExplicitKey) {
|
|
2156
|
-
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
|
|
2157
|
-
keyTag = keyNode = valueNode = null;
|
|
2158
|
-
}
|
|
2159
|
-
skipSeparationSpace2(state, true, -1);
|
|
2160
|
-
ch = state.input.charCodeAt(state.position);
|
|
2161
|
-
}
|
|
2162
|
-
if (state.lineIndent > nodeIndent && ch !== 0) {
|
|
2163
|
-
throwError2(state, "bad indentation of a mapping entry");
|
|
2164
|
-
} else if (state.lineIndent < nodeIndent) {
|
|
2165
|
-
break;
|
|
2166
|
-
}
|
|
2167
|
-
}
|
|
2168
|
-
if (atExplicitKey) {
|
|
2169
|
-
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
|
2170
|
-
}
|
|
2171
|
-
if (detected) {
|
|
2172
|
-
state.tag = _tag;
|
|
2173
|
-
state.anchor = _anchor;
|
|
2174
|
-
state.kind = "mapping";
|
|
2175
|
-
state.result = _result;
|
|
2176
|
-
}
|
|
2177
|
-
return detected;
|
|
2178
|
-
}
|
|
2179
|
-
function readTagProperty2(state) {
|
|
2180
|
-
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
|
2181
|
-
ch = state.input.charCodeAt(state.position);
|
|
2182
|
-
if (ch !== 33) return false;
|
|
2183
|
-
if (state.tag !== null) {
|
|
2184
|
-
throwError2(state, "duplication of a tag property");
|
|
2185
|
-
}
|
|
2186
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2187
|
-
if (ch === 60) {
|
|
2188
|
-
isVerbatim = true;
|
|
2189
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2190
|
-
} else if (ch === 33) {
|
|
2191
|
-
isNamed = true;
|
|
2192
|
-
tagHandle = "!!";
|
|
2193
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2194
|
-
} else {
|
|
2195
|
-
tagHandle = "!";
|
|
2196
|
-
}
|
|
2197
|
-
_position = state.position;
|
|
2198
|
-
if (isVerbatim) {
|
|
2199
|
-
do {
|
|
2200
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2201
|
-
} while (ch !== 0 && ch !== 62);
|
|
2202
|
-
if (state.position < state.length) {
|
|
2203
|
-
tagName = state.input.slice(_position, state.position);
|
|
2204
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2205
|
-
} else {
|
|
2206
|
-
throwError2(state, "unexpected end of the stream within a verbatim tag");
|
|
2207
|
-
}
|
|
2208
|
-
} else {
|
|
2209
|
-
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
2210
|
-
if (ch === 33) {
|
|
2211
|
-
if (!isNamed) {
|
|
2212
|
-
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
2213
|
-
if (!PATTERN_TAG_HANDLE2.test(tagHandle)) {
|
|
2214
|
-
throwError2(state, "named tag handle cannot contain such characters");
|
|
2215
|
-
}
|
|
2216
|
-
isNamed = true;
|
|
2217
|
-
_position = state.position + 1;
|
|
2218
|
-
} else {
|
|
2219
|
-
throwError2(state, "tag suffix cannot contain exclamation marks");
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2223
|
-
}
|
|
2224
|
-
tagName = state.input.slice(_position, state.position);
|
|
2225
|
-
if (PATTERN_FLOW_INDICATORS2.test(tagName)) {
|
|
2226
|
-
throwError2(state, "tag suffix cannot contain flow indicator characters");
|
|
2227
|
-
}
|
|
2228
|
-
}
|
|
2229
|
-
if (tagName && !PATTERN_TAG_URI2.test(tagName)) {
|
|
2230
|
-
throwError2(state, "tag name cannot contain such characters: " + tagName);
|
|
2231
|
-
}
|
|
2232
|
-
if (isVerbatim) {
|
|
2233
|
-
state.tag = tagName;
|
|
2234
|
-
} else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
|
|
2235
|
-
state.tag = state.tagMap[tagHandle] + tagName;
|
|
2236
|
-
} else if (tagHandle === "!") {
|
|
2237
|
-
state.tag = "!" + tagName;
|
|
2238
|
-
} else if (tagHandle === "!!") {
|
|
2239
|
-
state.tag = "tag:yaml.org,2002:" + tagName;
|
|
2240
|
-
} else {
|
|
2241
|
-
throwError2(state, 'undeclared tag handle "' + tagHandle + '"');
|
|
2242
|
-
}
|
|
2243
|
-
return true;
|
|
2244
|
-
}
|
|
2245
|
-
function readAnchorProperty2(state) {
|
|
2246
|
-
var _position, ch;
|
|
2247
|
-
ch = state.input.charCodeAt(state.position);
|
|
2248
|
-
if (ch !== 38) return false;
|
|
2249
|
-
if (state.anchor !== null) {
|
|
2250
|
-
throwError2(state, "duplication of an anchor property");
|
|
2251
|
-
}
|
|
2252
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2253
|
-
_position = state.position;
|
|
2254
|
-
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
2255
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2256
|
-
}
|
|
2257
|
-
if (state.position === _position) {
|
|
2258
|
-
throwError2(state, "name of an anchor node must contain at least one character");
|
|
2259
|
-
}
|
|
2260
|
-
state.anchor = state.input.slice(_position, state.position);
|
|
2261
|
-
return true;
|
|
2262
|
-
}
|
|
2263
|
-
function readAlias2(state) {
|
|
2264
|
-
var _position, alias, ch;
|
|
2265
|
-
ch = state.input.charCodeAt(state.position);
|
|
2266
|
-
if (ch !== 42) return false;
|
|
2267
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2268
|
-
_position = state.position;
|
|
2269
|
-
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
2270
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2271
|
-
}
|
|
2272
|
-
if (state.position === _position) {
|
|
2273
|
-
throwError2(state, "name of an alias node must contain at least one character");
|
|
2274
|
-
}
|
|
2275
|
-
alias = state.input.slice(_position, state.position);
|
|
2276
|
-
if (!_hasOwnProperty.call(state.anchorMap, alias)) {
|
|
2277
|
-
throwError2(state, 'unidentified alias "' + alias + '"');
|
|
2278
|
-
}
|
|
2279
|
-
state.result = state.anchorMap[alias];
|
|
2280
|
-
skipSeparationSpace2(state, true, -1);
|
|
2281
|
-
return true;
|
|
2282
|
-
}
|
|
2283
|
-
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
2284
|
-
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, type, flowIndent, blockIndent;
|
|
2285
|
-
if (state.listener !== null) {
|
|
2286
|
-
state.listener("open", state);
|
|
2287
|
-
}
|
|
2288
|
-
state.tag = null;
|
|
2289
|
-
state.anchor = null;
|
|
2290
|
-
state.kind = null;
|
|
2291
|
-
state.result = null;
|
|
2292
|
-
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT2 === nodeContext || CONTEXT_BLOCK_IN2 === nodeContext;
|
|
2293
|
-
if (allowToSeek) {
|
|
2294
|
-
if (skipSeparationSpace2(state, true, -1)) {
|
|
2295
|
-
atNewLine = true;
|
|
2296
|
-
if (state.lineIndent > parentIndent) {
|
|
2297
|
-
indentStatus = 1;
|
|
2298
|
-
} else if (state.lineIndent === parentIndent) {
|
|
2299
|
-
indentStatus = 0;
|
|
2300
|
-
} else if (state.lineIndent < parentIndent) {
|
|
2301
|
-
indentStatus = -1;
|
|
2302
|
-
}
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
if (indentStatus === 1) {
|
|
2306
|
-
while (readTagProperty2(state) || readAnchorProperty2(state)) {
|
|
2307
|
-
if (skipSeparationSpace2(state, true, -1)) {
|
|
2308
|
-
atNewLine = true;
|
|
2309
|
-
allowBlockCollections = allowBlockStyles;
|
|
2310
|
-
if (state.lineIndent > parentIndent) {
|
|
2311
|
-
indentStatus = 1;
|
|
2312
|
-
} else if (state.lineIndent === parentIndent) {
|
|
2313
|
-
indentStatus = 0;
|
|
2314
|
-
} else if (state.lineIndent < parentIndent) {
|
|
2315
|
-
indentStatus = -1;
|
|
2316
|
-
}
|
|
2317
|
-
} else {
|
|
2318
|
-
allowBlockCollections = false;
|
|
2319
|
-
}
|
|
2320
|
-
}
|
|
2321
|
-
}
|
|
2322
|
-
if (allowBlockCollections) {
|
|
2323
|
-
allowBlockCollections = atNewLine || allowCompact;
|
|
2324
|
-
}
|
|
2325
|
-
if (indentStatus === 1 || CONTEXT_BLOCK_OUT2 === nodeContext) {
|
|
2326
|
-
if (CONTEXT_FLOW_IN2 === nodeContext || CONTEXT_FLOW_OUT2 === nodeContext) {
|
|
2327
|
-
flowIndent = parentIndent;
|
|
2328
|
-
} else {
|
|
2329
|
-
flowIndent = parentIndent + 1;
|
|
2330
|
-
}
|
|
2331
|
-
blockIndent = state.position - state.lineStart;
|
|
2332
|
-
if (indentStatus === 1) {
|
|
2333
|
-
if (allowBlockCollections && (readBlockSequence2(state, blockIndent) || readBlockMapping2(state, blockIndent, flowIndent)) || readFlowCollection2(state, flowIndent)) {
|
|
2334
|
-
hasContent = true;
|
|
2335
|
-
} else {
|
|
2336
|
-
if (allowBlockScalars && readBlockScalar2(state, flowIndent) || readSingleQuotedScalar2(state, flowIndent) || readDoubleQuotedScalar2(state, flowIndent)) {
|
|
2337
|
-
hasContent = true;
|
|
2338
|
-
} else if (readAlias2(state)) {
|
|
2339
|
-
hasContent = true;
|
|
2340
|
-
if (state.tag !== null || state.anchor !== null) {
|
|
2341
|
-
throwError2(state, "alias node should not have any properties");
|
|
2342
|
-
}
|
|
2343
|
-
} else if (readPlainScalar2(state, flowIndent, CONTEXT_FLOW_IN2 === nodeContext)) {
|
|
2344
|
-
hasContent = true;
|
|
2345
|
-
if (state.tag === null) {
|
|
2346
|
-
state.tag = "?";
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
if (state.anchor !== null) {
|
|
2350
|
-
state.anchorMap[state.anchor] = state.result;
|
|
2351
|
-
}
|
|
2352
|
-
}
|
|
2353
|
-
} else if (indentStatus === 0) {
|
|
2354
|
-
hasContent = allowBlockCollections && readBlockSequence2(state, blockIndent);
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
if (state.tag !== null && state.tag !== "!") {
|
|
2358
|
-
if (state.tag === "?") {
|
|
2359
|
-
if (state.result !== null && state.kind !== "scalar") {
|
|
2360
|
-
throwError2(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
|
2361
|
-
}
|
|
2362
|
-
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
2363
|
-
type = state.implicitTypes[typeIndex];
|
|
2364
|
-
if (type.resolve(state.result)) {
|
|
2365
|
-
state.result = type.construct(state.result);
|
|
2366
|
-
state.tag = type.tag;
|
|
2367
|
-
if (state.anchor !== null) {
|
|
2368
|
-
state.anchorMap[state.anchor] = state.result;
|
|
2369
|
-
}
|
|
2370
|
-
break;
|
|
2371
|
-
}
|
|
2372
|
-
}
|
|
2373
|
-
} else if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) {
|
|
2374
|
-
type = state.typeMap[state.kind || "fallback"][state.tag];
|
|
2375
|
-
if (state.result !== null && type.kind !== state.kind) {
|
|
2376
|
-
throwError2(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
|
|
2377
|
-
}
|
|
2378
|
-
if (!type.resolve(state.result)) {
|
|
2379
|
-
throwError2(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
2380
|
-
} else {
|
|
2381
|
-
state.result = type.construct(state.result);
|
|
2382
|
-
if (state.anchor !== null) {
|
|
2383
|
-
state.anchorMap[state.anchor] = state.result;
|
|
2384
|
-
}
|
|
2385
|
-
}
|
|
2386
|
-
} else {
|
|
2387
|
-
throwError2(state, "unknown tag !<" + state.tag + ">");
|
|
2388
|
-
}
|
|
2389
|
-
}
|
|
2390
|
-
if (state.listener !== null) {
|
|
2391
|
-
state.listener("close", state);
|
|
2392
|
-
}
|
|
2393
|
-
return state.tag !== null || state.anchor !== null || hasContent;
|
|
2394
|
-
}
|
|
2395
|
-
function readDocument2(state) {
|
|
2396
|
-
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
2397
|
-
state.version = null;
|
|
2398
|
-
state.checkLineBreaks = state.legacy;
|
|
2399
|
-
state.tagMap = {};
|
|
2400
|
-
state.anchorMap = {};
|
|
2401
|
-
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
2402
|
-
skipSeparationSpace2(state, true, -1);
|
|
2403
|
-
ch = state.input.charCodeAt(state.position);
|
|
2404
|
-
if (state.lineIndent > 0 || ch !== 37) {
|
|
2405
|
-
break;
|
|
2406
|
-
}
|
|
2407
|
-
hasDirectives = true;
|
|
2408
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2409
|
-
_position = state.position;
|
|
2410
|
-
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
2411
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2412
|
-
}
|
|
2413
|
-
directiveName = state.input.slice(_position, state.position);
|
|
2414
|
-
directiveArgs = [];
|
|
2415
|
-
if (directiveName.length < 1) {
|
|
2416
|
-
throwError2(state, "directive name must not be less than one character in length");
|
|
2417
|
-
}
|
|
2418
|
-
while (ch !== 0) {
|
|
2419
|
-
while (is_WHITE_SPACE(ch)) {
|
|
2420
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2421
|
-
}
|
|
2422
|
-
if (ch === 35) {
|
|
2423
|
-
do {
|
|
2424
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2425
|
-
} while (ch !== 0 && !is_EOL(ch));
|
|
2426
|
-
break;
|
|
2427
|
-
}
|
|
2428
|
-
if (is_EOL(ch)) break;
|
|
2429
|
-
_position = state.position;
|
|
2430
|
-
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
2431
|
-
ch = state.input.charCodeAt(++state.position);
|
|
2432
|
-
}
|
|
2433
|
-
directiveArgs.push(state.input.slice(_position, state.position));
|
|
2434
|
-
}
|
|
2435
|
-
if (ch !== 0) readLineBreak(state);
|
|
2436
|
-
if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
|
|
2437
|
-
directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
2438
|
-
} else {
|
|
2439
|
-
throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
|
2440
|
-
}
|
|
2441
|
-
}
|
|
2442
|
-
skipSeparationSpace2(state, true, -1);
|
|
2443
|
-
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
|
-
state.position += 3;
|
|
2445
|
-
skipSeparationSpace2(state, true, -1);
|
|
2446
|
-
} else if (hasDirectives) {
|
|
2447
|
-
throwError2(state, "directives end mark is expected");
|
|
2448
|
-
}
|
|
2449
|
-
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT2, false, true);
|
|
2450
|
-
skipSeparationSpace2(state, true, -1);
|
|
2451
|
-
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
|
|
2452
|
-
throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
2453
|
-
}
|
|
2454
|
-
state.documents.push(state.result);
|
|
2455
|
-
if (state.position === state.lineStart && testDocumentSeparator2(state)) {
|
|
2456
|
-
if (state.input.charCodeAt(state.position) === 46) {
|
|
2457
|
-
state.position += 3;
|
|
2458
|
-
skipSeparationSpace2(state, true, -1);
|
|
2459
|
-
}
|
|
2460
|
-
return;
|
|
2461
|
-
}
|
|
2462
|
-
if (state.position < state.length - 1) {
|
|
2463
|
-
throwError2(state, "end of the stream or a document separator is expected");
|
|
2464
|
-
} else {
|
|
2465
|
-
return;
|
|
2466
|
-
}
|
|
2467
|
-
}
|
|
2468
|
-
function loadDocuments2(input, options2) {
|
|
2469
|
-
input = String(input);
|
|
2470
|
-
options2 = options2 || {};
|
|
2471
|
-
if (input.length !== 0) {
|
|
2472
|
-
if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
|
|
2473
|
-
input += "\n";
|
|
2474
|
-
}
|
|
2475
|
-
if (input.charCodeAt(0) === 65279) {
|
|
2476
|
-
input = input.slice(1);
|
|
2477
|
-
}
|
|
2478
|
-
}
|
|
2479
|
-
var state = new State(input, options2);
|
|
2480
|
-
var nullpos = input.indexOf("\0");
|
|
2481
|
-
if (nullpos !== -1) {
|
|
2482
|
-
state.position = nullpos;
|
|
2483
|
-
throwError2(state, "null byte is not allowed in input");
|
|
2484
|
-
}
|
|
2485
|
-
state.input += "\0";
|
|
2486
|
-
while (state.input.charCodeAt(state.position) === 32) {
|
|
2487
|
-
state.lineIndent += 1;
|
|
2488
|
-
state.position += 1;
|
|
2489
|
-
}
|
|
2490
|
-
while (state.position < state.length - 1) {
|
|
2491
|
-
readDocument2(state);
|
|
2492
|
-
}
|
|
2493
|
-
return state.documents;
|
|
2494
|
-
}
|
|
2495
|
-
function loadAll(input, iterator, options2) {
|
|
2496
|
-
if (iterator !== null && typeof iterator === "object" && typeof options2 === "undefined") {
|
|
2497
|
-
options2 = iterator;
|
|
2498
|
-
iterator = null;
|
|
2499
|
-
}
|
|
2500
|
-
var documents = loadDocuments2(input, options2);
|
|
2501
|
-
if (typeof iterator !== "function") {
|
|
2502
|
-
return documents;
|
|
2503
|
-
}
|
|
2504
|
-
for (var index = 0, length = documents.length; index < length; index += 1) {
|
|
2505
|
-
iterator(documents[index]);
|
|
2506
|
-
}
|
|
2507
|
-
}
|
|
2508
|
-
function load2(input, options2) {
|
|
2509
|
-
var documents = loadDocuments2(input, options2);
|
|
2510
|
-
if (documents.length === 0) {
|
|
2511
|
-
return void 0;
|
|
2512
|
-
} else if (documents.length === 1) {
|
|
2513
|
-
return documents[0];
|
|
2514
|
-
}
|
|
2515
|
-
throw new YAMLException2("expected a single document in the stream, but found more");
|
|
2516
|
-
}
|
|
2517
|
-
function safeLoadAll(input, iterator, options2) {
|
|
2518
|
-
if (typeof iterator === "object" && iterator !== null && typeof options2 === "undefined") {
|
|
2519
|
-
options2 = iterator;
|
|
2520
|
-
iterator = null;
|
|
2521
|
-
}
|
|
2522
|
-
return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
|
|
2523
|
-
}
|
|
2524
|
-
function safeLoad(input, options2) {
|
|
2525
|
-
return load2(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
|
|
2526
|
-
}
|
|
2527
|
-
module2.exports.loadAll = loadAll;
|
|
2528
|
-
module2.exports.load = load2;
|
|
2529
|
-
module2.exports.safeLoadAll = safeLoadAll;
|
|
2530
|
-
module2.exports.safeLoad = safeLoad;
|
|
2531
|
-
}
|
|
2532
|
-
});
|
|
2533
|
-
|
|
2534
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/dumper.js
|
|
2535
|
-
var require_dumper = __commonJS({
|
|
2536
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/dumper.js"(exports2, module2) {
|
|
2537
|
-
"use strict";
|
|
2538
|
-
var common = require_common();
|
|
2539
|
-
var YAMLException2 = require_exception();
|
|
2540
|
-
var DEFAULT_FULL_SCHEMA = require_default_full();
|
|
2541
|
-
var DEFAULT_SAFE_SCHEMA = require_default_safe();
|
|
2542
|
-
var _toString = Object.prototype.toString;
|
|
2543
|
-
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2544
|
-
var CHAR_TAB = 9;
|
|
2545
|
-
var CHAR_LINE_FEED = 10;
|
|
2546
|
-
var CHAR_CARRIAGE_RETURN = 13;
|
|
2547
|
-
var CHAR_SPACE = 32;
|
|
2548
|
-
var CHAR_EXCLAMATION = 33;
|
|
2549
|
-
var CHAR_DOUBLE_QUOTE = 34;
|
|
2550
|
-
var CHAR_SHARP = 35;
|
|
2551
|
-
var CHAR_PERCENT = 37;
|
|
2552
|
-
var CHAR_AMPERSAND = 38;
|
|
2553
|
-
var CHAR_SINGLE_QUOTE = 39;
|
|
2554
|
-
var CHAR_ASTERISK = 42;
|
|
2555
|
-
var CHAR_COMMA = 44;
|
|
2556
|
-
var CHAR_MINUS = 45;
|
|
2557
|
-
var CHAR_COLON = 58;
|
|
2558
|
-
var CHAR_EQUALS = 61;
|
|
2559
|
-
var CHAR_GREATER_THAN = 62;
|
|
2560
|
-
var CHAR_QUESTION = 63;
|
|
2561
|
-
var CHAR_COMMERCIAL_AT = 64;
|
|
2562
|
-
var CHAR_LEFT_SQUARE_BRACKET = 91;
|
|
2563
|
-
var CHAR_RIGHT_SQUARE_BRACKET = 93;
|
|
2564
|
-
var CHAR_GRAVE_ACCENT = 96;
|
|
2565
|
-
var CHAR_LEFT_CURLY_BRACKET = 123;
|
|
2566
|
-
var CHAR_VERTICAL_LINE = 124;
|
|
2567
|
-
var CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
2568
|
-
var ESCAPE_SEQUENCES2 = {};
|
|
2569
|
-
ESCAPE_SEQUENCES2[0] = "\\0";
|
|
2570
|
-
ESCAPE_SEQUENCES2[7] = "\\a";
|
|
2571
|
-
ESCAPE_SEQUENCES2[8] = "\\b";
|
|
2572
|
-
ESCAPE_SEQUENCES2[9] = "\\t";
|
|
2573
|
-
ESCAPE_SEQUENCES2[10] = "\\n";
|
|
2574
|
-
ESCAPE_SEQUENCES2[11] = "\\v";
|
|
2575
|
-
ESCAPE_SEQUENCES2[12] = "\\f";
|
|
2576
|
-
ESCAPE_SEQUENCES2[13] = "\\r";
|
|
2577
|
-
ESCAPE_SEQUENCES2[27] = "\\e";
|
|
2578
|
-
ESCAPE_SEQUENCES2[34] = '\\"';
|
|
2579
|
-
ESCAPE_SEQUENCES2[92] = "\\\\";
|
|
2580
|
-
ESCAPE_SEQUENCES2[133] = "\\N";
|
|
2581
|
-
ESCAPE_SEQUENCES2[160] = "\\_";
|
|
2582
|
-
ESCAPE_SEQUENCES2[8232] = "\\L";
|
|
2583
|
-
ESCAPE_SEQUENCES2[8233] = "\\P";
|
|
2584
|
-
var DEPRECATED_BOOLEANS_SYNTAX = [
|
|
2585
|
-
"y",
|
|
2586
|
-
"Y",
|
|
2587
|
-
"yes",
|
|
2588
|
-
"Yes",
|
|
2589
|
-
"YES",
|
|
2590
|
-
"on",
|
|
2591
|
-
"On",
|
|
2592
|
-
"ON",
|
|
2593
|
-
"n",
|
|
2594
|
-
"N",
|
|
2595
|
-
"no",
|
|
2596
|
-
"No",
|
|
2597
|
-
"NO",
|
|
2598
|
-
"off",
|
|
2599
|
-
"Off",
|
|
2600
|
-
"OFF"
|
|
2601
|
-
];
|
|
2602
|
-
function compileStyleMap(schema, map) {
|
|
2603
|
-
var result, keys, index, length, tag, style, type;
|
|
2604
|
-
if (map === null) return {};
|
|
2605
|
-
result = {};
|
|
2606
|
-
keys = Object.keys(map);
|
|
2607
|
-
for (index = 0, length = keys.length; index < length; index += 1) {
|
|
2608
|
-
tag = keys[index];
|
|
2609
|
-
style = String(map[tag]);
|
|
2610
|
-
if (tag.slice(0, 2) === "!!") {
|
|
2611
|
-
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
2612
|
-
}
|
|
2613
|
-
type = schema.compiledTypeMap["fallback"][tag];
|
|
2614
|
-
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
2615
|
-
style = type.styleAliases[style];
|
|
2616
|
-
}
|
|
2617
|
-
result[tag] = style;
|
|
2618
|
-
}
|
|
2619
|
-
return result;
|
|
2620
|
-
}
|
|
2621
|
-
function encodeHex(character) {
|
|
2622
|
-
var string, handle, length;
|
|
2623
|
-
string = character.toString(16).toUpperCase();
|
|
2624
|
-
if (character <= 255) {
|
|
2625
|
-
handle = "x";
|
|
2626
|
-
length = 2;
|
|
2627
|
-
} else if (character <= 65535) {
|
|
2628
|
-
handle = "u";
|
|
2629
|
-
length = 4;
|
|
2630
|
-
} else if (character <= 4294967295) {
|
|
2631
|
-
handle = "U";
|
|
2632
|
-
length = 8;
|
|
2633
|
-
} else {
|
|
2634
|
-
throw new YAMLException2("code point within a string may not be greater than 0xFFFFFFFF");
|
|
2635
|
-
}
|
|
2636
|
-
return "\\" + handle + common.repeat("0", length - string.length) + string;
|
|
2637
|
-
}
|
|
2638
|
-
function State(options2) {
|
|
2639
|
-
this.schema = options2["schema"] || DEFAULT_FULL_SCHEMA;
|
|
2640
|
-
this.indent = Math.max(1, options2["indent"] || 2);
|
|
2641
|
-
this.noArrayIndent = options2["noArrayIndent"] || false;
|
|
2642
|
-
this.skipInvalid = options2["skipInvalid"] || false;
|
|
2643
|
-
this.flowLevel = common.isNothing(options2["flowLevel"]) ? -1 : options2["flowLevel"];
|
|
2644
|
-
this.styleMap = compileStyleMap(this.schema, options2["styles"] || null);
|
|
2645
|
-
this.sortKeys = options2["sortKeys"] || false;
|
|
2646
|
-
this.lineWidth = options2["lineWidth"] || 80;
|
|
2647
|
-
this.noRefs = options2["noRefs"] || false;
|
|
2648
|
-
this.noCompatMode = options2["noCompatMode"] || false;
|
|
2649
|
-
this.condenseFlow = options2["condenseFlow"] || false;
|
|
2650
|
-
this.implicitTypes = this.schema.compiledImplicit;
|
|
2651
|
-
this.explicitTypes = this.schema.compiledExplicit;
|
|
2652
|
-
this.tag = null;
|
|
2653
|
-
this.result = "";
|
|
2654
|
-
this.duplicates = [];
|
|
2655
|
-
this.usedDuplicates = null;
|
|
2656
|
-
}
|
|
2657
|
-
function indentString(string, spaces) {
|
|
2658
|
-
var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
|
|
2659
|
-
while (position < length) {
|
|
2660
|
-
next = string.indexOf("\n", position);
|
|
2661
|
-
if (next === -1) {
|
|
2662
|
-
line = string.slice(position);
|
|
2663
|
-
position = length;
|
|
2664
|
-
} else {
|
|
2665
|
-
line = string.slice(position, next + 1);
|
|
2666
|
-
position = next + 1;
|
|
2667
|
-
}
|
|
2668
|
-
if (line.length && line !== "\n") result += ind;
|
|
2669
|
-
result += line;
|
|
2670
|
-
}
|
|
2671
|
-
return result;
|
|
2672
|
-
}
|
|
2673
|
-
function generateNextLine(state, level) {
|
|
2674
|
-
return "\n" + common.repeat(" ", state.indent * level);
|
|
2675
|
-
}
|
|
2676
|
-
function testImplicitResolving(state, str2) {
|
|
2677
|
-
var index, length, type;
|
|
2678
|
-
for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
|
|
2679
|
-
type = state.implicitTypes[index];
|
|
2680
|
-
if (type.resolve(str2)) {
|
|
2681
|
-
return true;
|
|
2682
|
-
}
|
|
2683
|
-
}
|
|
2684
|
-
return false;
|
|
2685
|
-
}
|
|
2686
|
-
function isWhitespace(c) {
|
|
2687
|
-
return c === CHAR_SPACE || c === CHAR_TAB;
|
|
2688
|
-
}
|
|
2689
|
-
function isPrintable(c) {
|
|
2690
|
-
return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== 65279 || 65536 <= c && c <= 1114111;
|
|
2691
|
-
}
|
|
2692
|
-
function isNsChar(c) {
|
|
2693
|
-
return isPrintable(c) && !isWhitespace(c) && c !== 65279 && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
2694
|
-
}
|
|
2695
|
-
function isPlainSafe(c, prev) {
|
|
2696
|
-
return isPrintable(c) && c !== 65279 && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_COLON && (c !== CHAR_SHARP || prev && isNsChar(prev));
|
|
2697
|
-
}
|
|
2698
|
-
function isPlainSafeFirst(c) {
|
|
2699
|
-
return isPrintable(c) && c !== 65279 && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
|
|
2700
|
-
}
|
|
2701
|
-
function needIndentIndicator(string) {
|
|
2702
|
-
var leadingSpaceRe = /^\n* /;
|
|
2703
|
-
return leadingSpaceRe.test(string);
|
|
2704
|
-
}
|
|
2705
|
-
var STYLE_PLAIN = 1;
|
|
2706
|
-
var STYLE_SINGLE = 2;
|
|
2707
|
-
var STYLE_LITERAL = 3;
|
|
2708
|
-
var STYLE_FOLDED = 4;
|
|
2709
|
-
var STYLE_DOUBLE = 5;
|
|
2710
|
-
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
|
|
2711
|
-
var i;
|
|
2712
|
-
var char, prev_char;
|
|
2713
|
-
var hasLineBreak = false;
|
|
2714
|
-
var hasFoldableLine = false;
|
|
2715
|
-
var shouldTrackWidth = lineWidth !== -1;
|
|
2716
|
-
var previousLineBreak = -1;
|
|
2717
|
-
var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1));
|
|
2718
|
-
if (singleLineOnly) {
|
|
2719
|
-
for (i = 0; i < string.length; i++) {
|
|
2720
|
-
char = string.charCodeAt(i);
|
|
2721
|
-
if (!isPrintable(char)) {
|
|
2722
|
-
return STYLE_DOUBLE;
|
|
2723
|
-
}
|
|
2724
|
-
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
|
2725
|
-
plain = plain && isPlainSafe(char, prev_char);
|
|
2726
|
-
}
|
|
2727
|
-
} else {
|
|
2728
|
-
for (i = 0; i < string.length; i++) {
|
|
2729
|
-
char = string.charCodeAt(i);
|
|
2730
|
-
if (char === CHAR_LINE_FEED) {
|
|
2731
|
-
hasLineBreak = true;
|
|
2732
|
-
if (shouldTrackWidth) {
|
|
2733
|
-
hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
|
|
2734
|
-
i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
2735
|
-
previousLineBreak = i;
|
|
2736
|
-
}
|
|
2737
|
-
} else if (!isPrintable(char)) {
|
|
2738
|
-
return STYLE_DOUBLE;
|
|
2739
|
-
}
|
|
2740
|
-
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
|
2741
|
-
plain = plain && isPlainSafe(char, prev_char);
|
|
2742
|
-
}
|
|
2743
|
-
hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
|
|
2744
|
-
}
|
|
2745
|
-
if (!hasLineBreak && !hasFoldableLine) {
|
|
2746
|
-
return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE;
|
|
2747
|
-
}
|
|
2748
|
-
if (indentPerLevel > 9 && needIndentIndicator(string)) {
|
|
2749
|
-
return STYLE_DOUBLE;
|
|
2750
|
-
}
|
|
2751
|
-
return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
|
2752
|
-
}
|
|
2753
|
-
function writeScalar(state, string, level, iskey) {
|
|
2754
|
-
state.dump = (function() {
|
|
2755
|
-
if (string.length === 0) {
|
|
2756
|
-
return "''";
|
|
2757
|
-
}
|
|
2758
|
-
if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
|
|
2759
|
-
return "'" + string + "'";
|
|
2760
|
-
}
|
|
2761
|
-
var indent = state.indent * Math.max(1, level);
|
|
2762
|
-
var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
|
2763
|
-
var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
|
|
2764
|
-
function testAmbiguity(string2) {
|
|
2765
|
-
return testImplicitResolving(state, string2);
|
|
2766
|
-
}
|
|
2767
|
-
switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
|
|
2768
|
-
case STYLE_PLAIN:
|
|
2769
|
-
return string;
|
|
2770
|
-
case STYLE_SINGLE:
|
|
2771
|
-
return "'" + string.replace(/'/g, "''") + "'";
|
|
2772
|
-
case STYLE_LITERAL:
|
|
2773
|
-
return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
|
|
2774
|
-
case STYLE_FOLDED:
|
|
2775
|
-
return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
|
2776
|
-
case STYLE_DOUBLE:
|
|
2777
|
-
return '"' + escapeString(string, lineWidth) + '"';
|
|
2778
|
-
default:
|
|
2779
|
-
throw new YAMLException2("impossible error: invalid scalar style");
|
|
2780
|
-
}
|
|
2781
|
-
})();
|
|
2782
|
-
}
|
|
2783
|
-
function blockHeader(string, indentPerLevel) {
|
|
2784
|
-
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
|
|
2785
|
-
var clip = string[string.length - 1] === "\n";
|
|
2786
|
-
var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
|
|
2787
|
-
var chomp = keep ? "+" : clip ? "" : "-";
|
|
2788
|
-
return indentIndicator + chomp + "\n";
|
|
2789
|
-
}
|
|
2790
|
-
function dropEndingNewline(string) {
|
|
2791
|
-
return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
|
|
2792
|
-
}
|
|
2793
|
-
function foldString(string, width) {
|
|
2794
|
-
var lineRe = /(\n+)([^\n]*)/g;
|
|
2795
|
-
var result = (function() {
|
|
2796
|
-
var nextLF = string.indexOf("\n");
|
|
2797
|
-
nextLF = nextLF !== -1 ? nextLF : string.length;
|
|
2798
|
-
lineRe.lastIndex = nextLF;
|
|
2799
|
-
return foldLine(string.slice(0, nextLF), width);
|
|
2800
|
-
})();
|
|
2801
|
-
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
2802
|
-
var moreIndented;
|
|
2803
|
-
var match;
|
|
2804
|
-
while (match = lineRe.exec(string)) {
|
|
2805
|
-
var prefix = match[1], line = match[2];
|
|
2806
|
-
moreIndented = line[0] === " ";
|
|
2807
|
-
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
2808
|
-
prevMoreIndented = moreIndented;
|
|
2809
|
-
}
|
|
2810
|
-
return result;
|
|
2811
|
-
}
|
|
2812
|
-
function foldLine(line, width) {
|
|
2813
|
-
if (line === "" || line[0] === " ") return line;
|
|
2814
|
-
var breakRe = / [^ ]/g;
|
|
2815
|
-
var match;
|
|
2816
|
-
var start = 0, end, curr = 0, next = 0;
|
|
2817
|
-
var result = "";
|
|
2818
|
-
while (match = breakRe.exec(line)) {
|
|
2819
|
-
next = match.index;
|
|
2820
|
-
if (next - start > width) {
|
|
2821
|
-
end = curr > start ? curr : next;
|
|
2822
|
-
result += "\n" + line.slice(start, end);
|
|
2823
|
-
start = end + 1;
|
|
2824
|
-
}
|
|
2825
|
-
curr = next;
|
|
2826
|
-
}
|
|
2827
|
-
result += "\n";
|
|
2828
|
-
if (line.length - start > width && curr > start) {
|
|
2829
|
-
result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
|
|
2830
|
-
} else {
|
|
2831
|
-
result += line.slice(start);
|
|
2832
|
-
}
|
|
2833
|
-
return result.slice(1);
|
|
2834
|
-
}
|
|
2835
|
-
function escapeString(string) {
|
|
2836
|
-
var result = "";
|
|
2837
|
-
var char, nextChar;
|
|
2838
|
-
var escapeSeq;
|
|
2839
|
-
for (var i = 0; i < string.length; i++) {
|
|
2840
|
-
char = string.charCodeAt(i);
|
|
2841
|
-
if (char >= 55296 && char <= 56319) {
|
|
2842
|
-
nextChar = string.charCodeAt(i + 1);
|
|
2843
|
-
if (nextChar >= 56320 && nextChar <= 57343) {
|
|
2844
|
-
result += encodeHex((char - 55296) * 1024 + nextChar - 56320 + 65536);
|
|
2845
|
-
i++;
|
|
2846
|
-
continue;
|
|
2847
|
-
}
|
|
2848
|
-
}
|
|
2849
|
-
escapeSeq = ESCAPE_SEQUENCES2[char];
|
|
2850
|
-
result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char);
|
|
2851
|
-
}
|
|
2852
|
-
return result;
|
|
2853
|
-
}
|
|
2854
|
-
function writeFlowSequence(state, level, object) {
|
|
2855
|
-
var _result = "", _tag = state.tag, index, length;
|
|
2856
|
-
for (index = 0, length = object.length; index < length; index += 1) {
|
|
2857
|
-
if (writeNode(state, level, object[index], false, false)) {
|
|
2858
|
-
if (index !== 0) _result += "," + (!state.condenseFlow ? " " : "");
|
|
2859
|
-
_result += state.dump;
|
|
2860
|
-
}
|
|
2861
|
-
}
|
|
2862
|
-
state.tag = _tag;
|
|
2863
|
-
state.dump = "[" + _result + "]";
|
|
2864
|
-
}
|
|
2865
|
-
function writeBlockSequence(state, level, object, compact) {
|
|
2866
|
-
var _result = "", _tag = state.tag, index, length;
|
|
2867
|
-
for (index = 0, length = object.length; index < length; index += 1) {
|
|
2868
|
-
if (writeNode(state, level + 1, object[index], true, true)) {
|
|
2869
|
-
if (!compact || index !== 0) {
|
|
2870
|
-
_result += generateNextLine(state, level);
|
|
2871
|
-
}
|
|
2872
|
-
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
2873
|
-
_result += "-";
|
|
2874
|
-
} else {
|
|
2875
|
-
_result += "- ";
|
|
2876
|
-
}
|
|
2877
|
-
_result += state.dump;
|
|
2878
|
-
}
|
|
2879
|
-
}
|
|
2880
|
-
state.tag = _tag;
|
|
2881
|
-
state.dump = _result || "[]";
|
|
2882
|
-
}
|
|
2883
|
-
function writeFlowMapping(state, level, object) {
|
|
2884
|
-
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
|
|
2885
|
-
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
2886
|
-
pairBuffer = "";
|
|
2887
|
-
if (index !== 0) pairBuffer += ", ";
|
|
2888
|
-
if (state.condenseFlow) pairBuffer += '"';
|
|
2889
|
-
objectKey = objectKeyList[index];
|
|
2890
|
-
objectValue = object[objectKey];
|
|
2891
|
-
if (!writeNode(state, level, objectKey, false, false)) {
|
|
2892
|
-
continue;
|
|
2893
|
-
}
|
|
2894
|
-
if (state.dump.length > 1024) pairBuffer += "? ";
|
|
2895
|
-
pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
|
|
2896
|
-
if (!writeNode(state, level, objectValue, false, false)) {
|
|
2897
|
-
continue;
|
|
2898
|
-
}
|
|
2899
|
-
pairBuffer += state.dump;
|
|
2900
|
-
_result += pairBuffer;
|
|
2901
|
-
}
|
|
2902
|
-
state.tag = _tag;
|
|
2903
|
-
state.dump = "{" + _result + "}";
|
|
2904
|
-
}
|
|
2905
|
-
function writeBlockMapping(state, level, object, compact) {
|
|
2906
|
-
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
|
|
2907
|
-
if (state.sortKeys === true) {
|
|
2908
|
-
objectKeyList.sort();
|
|
2909
|
-
} else if (typeof state.sortKeys === "function") {
|
|
2910
|
-
objectKeyList.sort(state.sortKeys);
|
|
2911
|
-
} else if (state.sortKeys) {
|
|
2912
|
-
throw new YAMLException2("sortKeys must be a boolean or a function");
|
|
2913
|
-
}
|
|
2914
|
-
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
2915
|
-
pairBuffer = "";
|
|
2916
|
-
if (!compact || index !== 0) {
|
|
2917
|
-
pairBuffer += generateNextLine(state, level);
|
|
2918
|
-
}
|
|
2919
|
-
objectKey = objectKeyList[index];
|
|
2920
|
-
objectValue = object[objectKey];
|
|
2921
|
-
if (!writeNode(state, level + 1, objectKey, true, true, true)) {
|
|
2922
|
-
continue;
|
|
2923
|
-
}
|
|
2924
|
-
explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
|
|
2925
|
-
if (explicitPair) {
|
|
2926
|
-
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
2927
|
-
pairBuffer += "?";
|
|
2928
|
-
} else {
|
|
2929
|
-
pairBuffer += "? ";
|
|
2930
|
-
}
|
|
2931
|
-
}
|
|
2932
|
-
pairBuffer += state.dump;
|
|
2933
|
-
if (explicitPair) {
|
|
2934
|
-
pairBuffer += generateNextLine(state, level);
|
|
2935
|
-
}
|
|
2936
|
-
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
|
|
2937
|
-
continue;
|
|
2938
|
-
}
|
|
2939
|
-
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
2940
|
-
pairBuffer += ":";
|
|
2941
|
-
} else {
|
|
2942
|
-
pairBuffer += ": ";
|
|
2943
|
-
}
|
|
2944
|
-
pairBuffer += state.dump;
|
|
2945
|
-
_result += pairBuffer;
|
|
2946
|
-
}
|
|
2947
|
-
state.tag = _tag;
|
|
2948
|
-
state.dump = _result || "{}";
|
|
2949
|
-
}
|
|
2950
|
-
function detectType(state, object, explicit) {
|
|
2951
|
-
var _result, typeList, index, length, type, style;
|
|
2952
|
-
typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
|
2953
|
-
for (index = 0, length = typeList.length; index < length; index += 1) {
|
|
2954
|
-
type = typeList[index];
|
|
2955
|
-
if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) {
|
|
2956
|
-
state.tag = explicit ? type.tag : "?";
|
|
2957
|
-
if (type.represent) {
|
|
2958
|
-
style = state.styleMap[type.tag] || type.defaultStyle;
|
|
2959
|
-
if (_toString.call(type.represent) === "[object Function]") {
|
|
2960
|
-
_result = type.represent(object, style);
|
|
2961
|
-
} else if (_hasOwnProperty.call(type.represent, style)) {
|
|
2962
|
-
_result = type.represent[style](object, style);
|
|
2963
|
-
} else {
|
|
2964
|
-
throw new YAMLException2("!<" + type.tag + '> tag resolver accepts not "' + style + '" style');
|
|
2965
|
-
}
|
|
2966
|
-
state.dump = _result;
|
|
2967
|
-
}
|
|
2968
|
-
return true;
|
|
2969
|
-
}
|
|
2970
|
-
}
|
|
2971
|
-
return false;
|
|
2972
|
-
}
|
|
2973
|
-
function writeNode(state, level, object, block, compact, iskey) {
|
|
2974
|
-
state.tag = null;
|
|
2975
|
-
state.dump = object;
|
|
2976
|
-
if (!detectType(state, object, false)) {
|
|
2977
|
-
detectType(state, object, true);
|
|
2978
|
-
}
|
|
2979
|
-
var type = _toString.call(state.dump);
|
|
2980
|
-
if (block) {
|
|
2981
|
-
block = state.flowLevel < 0 || state.flowLevel > level;
|
|
2982
|
-
}
|
|
2983
|
-
var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate;
|
|
2984
|
-
if (objectOrArray) {
|
|
2985
|
-
duplicateIndex = state.duplicates.indexOf(object);
|
|
2986
|
-
duplicate = duplicateIndex !== -1;
|
|
2987
|
-
}
|
|
2988
|
-
if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
|
|
2989
|
-
compact = false;
|
|
2990
|
-
}
|
|
2991
|
-
if (duplicate && state.usedDuplicates[duplicateIndex]) {
|
|
2992
|
-
state.dump = "*ref_" + duplicateIndex;
|
|
2993
|
-
} else {
|
|
2994
|
-
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
|
|
2995
|
-
state.usedDuplicates[duplicateIndex] = true;
|
|
2996
|
-
}
|
|
2997
|
-
if (type === "[object Object]") {
|
|
2998
|
-
if (block && Object.keys(state.dump).length !== 0) {
|
|
2999
|
-
writeBlockMapping(state, level, state.dump, compact);
|
|
3000
|
-
if (duplicate) {
|
|
3001
|
-
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
3002
|
-
}
|
|
3003
|
-
} else {
|
|
3004
|
-
writeFlowMapping(state, level, state.dump);
|
|
3005
|
-
if (duplicate) {
|
|
3006
|
-
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
3007
|
-
}
|
|
3008
|
-
}
|
|
3009
|
-
} else if (type === "[object Array]") {
|
|
3010
|
-
var arrayLevel = state.noArrayIndent && level > 0 ? level - 1 : level;
|
|
3011
|
-
if (block && state.dump.length !== 0) {
|
|
3012
|
-
writeBlockSequence(state, arrayLevel, state.dump, compact);
|
|
3013
|
-
if (duplicate) {
|
|
3014
|
-
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
3015
|
-
}
|
|
3016
|
-
} else {
|
|
3017
|
-
writeFlowSequence(state, arrayLevel, state.dump);
|
|
3018
|
-
if (duplicate) {
|
|
3019
|
-
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
3020
|
-
}
|
|
3021
|
-
}
|
|
3022
|
-
} else if (type === "[object String]") {
|
|
3023
|
-
if (state.tag !== "?") {
|
|
3024
|
-
writeScalar(state, state.dump, level, iskey);
|
|
3025
|
-
}
|
|
3026
|
-
} else {
|
|
3027
|
-
if (state.skipInvalid) return false;
|
|
3028
|
-
throw new YAMLException2("unacceptable kind of an object to dump " + type);
|
|
3029
|
-
}
|
|
3030
|
-
if (state.tag !== null && state.tag !== "?") {
|
|
3031
|
-
state.dump = "!<" + state.tag + "> " + state.dump;
|
|
3032
|
-
}
|
|
3033
|
-
}
|
|
3034
|
-
return true;
|
|
3035
|
-
}
|
|
3036
|
-
function getDuplicateReferences(object, state) {
|
|
3037
|
-
var objects = [], duplicatesIndexes = [], index, length;
|
|
3038
|
-
inspectNode(object, objects, duplicatesIndexes);
|
|
3039
|
-
for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
|
|
3040
|
-
state.duplicates.push(objects[duplicatesIndexes[index]]);
|
|
3041
|
-
}
|
|
3042
|
-
state.usedDuplicates = new Array(length);
|
|
3043
|
-
}
|
|
3044
|
-
function inspectNode(object, objects, duplicatesIndexes) {
|
|
3045
|
-
var objectKeyList, index, length;
|
|
3046
|
-
if (object !== null && typeof object === "object") {
|
|
3047
|
-
index = objects.indexOf(object);
|
|
3048
|
-
if (index !== -1) {
|
|
3049
|
-
if (duplicatesIndexes.indexOf(index) === -1) {
|
|
3050
|
-
duplicatesIndexes.push(index);
|
|
3051
|
-
}
|
|
3052
|
-
} else {
|
|
3053
|
-
objects.push(object);
|
|
3054
|
-
if (Array.isArray(object)) {
|
|
3055
|
-
for (index = 0, length = object.length; index < length; index += 1) {
|
|
3056
|
-
inspectNode(object[index], objects, duplicatesIndexes);
|
|
3057
|
-
}
|
|
3058
|
-
} else {
|
|
3059
|
-
objectKeyList = Object.keys(object);
|
|
3060
|
-
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
3061
|
-
inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
|
|
3062
|
-
}
|
|
3063
|
-
}
|
|
3064
|
-
}
|
|
3065
|
-
}
|
|
3066
|
-
}
|
|
3067
|
-
function dump(input, options2) {
|
|
3068
|
-
options2 = options2 || {};
|
|
3069
|
-
var state = new State(options2);
|
|
3070
|
-
if (!state.noRefs) getDuplicateReferences(input, state);
|
|
3071
|
-
if (writeNode(state, 0, input, true, true)) return state.dump + "\n";
|
|
3072
|
-
return "";
|
|
3073
|
-
}
|
|
3074
|
-
function safeDump(input, options2) {
|
|
3075
|
-
return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
|
|
3076
|
-
}
|
|
3077
|
-
module2.exports.dump = dump;
|
|
3078
|
-
module2.exports.safeDump = safeDump;
|
|
3079
|
-
}
|
|
3080
|
-
});
|
|
3081
|
-
|
|
3082
|
-
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml.js
|
|
3083
|
-
var require_js_yaml = __commonJS({
|
|
3084
|
-
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml.js"(exports2, module2) {
|
|
3085
|
-
"use strict";
|
|
3086
|
-
var loader = require_loader();
|
|
3087
|
-
var dumper = require_dumper();
|
|
3088
|
-
function deprecated(name) {
|
|
3089
|
-
return function() {
|
|
3090
|
-
throw new Error("Function " + name + " is deprecated and cannot be used.");
|
|
3091
|
-
};
|
|
3092
|
-
}
|
|
3093
|
-
module2.exports.Type = require_type();
|
|
3094
|
-
module2.exports.Schema = require_schema();
|
|
3095
|
-
module2.exports.FAILSAFE_SCHEMA = require_failsafe();
|
|
3096
|
-
module2.exports.JSON_SCHEMA = require_json();
|
|
3097
|
-
module2.exports.CORE_SCHEMA = require_core();
|
|
3098
|
-
module2.exports.DEFAULT_SAFE_SCHEMA = require_default_safe();
|
|
3099
|
-
module2.exports.DEFAULT_FULL_SCHEMA = require_default_full();
|
|
3100
|
-
module2.exports.load = loader.load;
|
|
3101
|
-
module2.exports.loadAll = loader.loadAll;
|
|
3102
|
-
module2.exports.safeLoad = loader.safeLoad;
|
|
3103
|
-
module2.exports.safeLoadAll = loader.safeLoadAll;
|
|
3104
|
-
module2.exports.dump = dumper.dump;
|
|
3105
|
-
module2.exports.safeDump = dumper.safeDump;
|
|
3106
|
-
module2.exports.YAMLException = require_exception();
|
|
3107
|
-
module2.exports.MINIMAL_SCHEMA = require_failsafe();
|
|
3108
|
-
module2.exports.SAFE_SCHEMA = require_default_safe();
|
|
3109
|
-
module2.exports.DEFAULT_SCHEMA = require_default_full();
|
|
3110
|
-
module2.exports.scan = deprecated("scan");
|
|
3111
|
-
module2.exports.parse = deprecated("parse");
|
|
3112
|
-
module2.exports.compose = deprecated("compose");
|
|
3113
|
-
module2.exports.addConstructor = deprecated("addConstructor");
|
|
3114
|
-
}
|
|
3115
|
-
});
|
|
3116
|
-
|
|
3117
|
-
// node_modules/gray-matter/node_modules/js-yaml/index.js
|
|
3118
|
-
var require_js_yaml2 = __commonJS({
|
|
3119
|
-
"node_modules/gray-matter/node_modules/js-yaml/index.js"(exports2, module2) {
|
|
3120
|
-
"use strict";
|
|
3121
|
-
var yaml2 = require_js_yaml();
|
|
3122
|
-
module2.exports = yaml2;
|
|
3123
|
-
}
|
|
3124
|
-
});
|
|
3125
|
-
|
|
3126
|
-
// node_modules/gray-matter/lib/engines.js
|
|
3127
|
-
var require_engines = __commonJS({
|
|
3128
|
-
"node_modules/gray-matter/lib/engines.js"(exports, module) {
|
|
3129
|
-
"use strict";
|
|
3130
|
-
var yaml = require_js_yaml2();
|
|
3131
|
-
var engines = exports = module.exports;
|
|
3132
|
-
engines.yaml = {
|
|
3133
|
-
parse: yaml.safeLoad.bind(yaml),
|
|
3134
|
-
stringify: yaml.safeDump.bind(yaml)
|
|
3135
|
-
};
|
|
3136
|
-
engines.json = {
|
|
3137
|
-
parse: JSON.parse.bind(JSON),
|
|
3138
|
-
stringify: function(obj, options2) {
|
|
3139
|
-
const opts = Object.assign({ replacer: null, space: 2 }, options2);
|
|
3140
|
-
return JSON.stringify(obj, opts.replacer, opts.space);
|
|
3141
|
-
}
|
|
3142
|
-
};
|
|
3143
|
-
engines.javascript = {
|
|
3144
|
-
parse: function parse(str, options, wrap) {
|
|
3145
|
-
try {
|
|
3146
|
-
if (wrap !== false) {
|
|
3147
|
-
str = "(function() {\nreturn " + str.trim() + ";\n}());";
|
|
3148
|
-
}
|
|
3149
|
-
return eval(str) || {};
|
|
3150
|
-
} catch (err) {
|
|
3151
|
-
if (wrap !== false && /(unexpected|identifier)/i.test(err.message)) {
|
|
3152
|
-
return parse(str, options, false);
|
|
3153
|
-
}
|
|
3154
|
-
throw new SyntaxError(err);
|
|
3155
|
-
}
|
|
3156
|
-
},
|
|
3157
|
-
stringify: function() {
|
|
3158
|
-
throw new Error("stringifying JavaScript is not supported");
|
|
3159
|
-
}
|
|
3160
|
-
};
|
|
3161
|
-
}
|
|
3162
|
-
});
|
|
3163
|
-
|
|
3164
|
-
// node_modules/strip-bom-string/index.js
|
|
3165
|
-
var require_strip_bom_string = __commonJS({
|
|
3166
|
-
"node_modules/strip-bom-string/index.js"(exports2, module2) {
|
|
3167
|
-
"use strict";
|
|
3168
|
-
module2.exports = function(str2) {
|
|
3169
|
-
if (typeof str2 === "string" && str2.charAt(0) === "\uFEFF") {
|
|
3170
|
-
return str2.slice(1);
|
|
3171
|
-
}
|
|
3172
|
-
return str2;
|
|
3173
|
-
};
|
|
3174
|
-
}
|
|
3175
|
-
});
|
|
3176
|
-
|
|
3177
|
-
// node_modules/gray-matter/lib/utils.js
|
|
3178
|
-
var require_utils = __commonJS({
|
|
3179
|
-
"node_modules/gray-matter/lib/utils.js"(exports2) {
|
|
3180
|
-
"use strict";
|
|
3181
|
-
var stripBom = require_strip_bom_string();
|
|
3182
|
-
var typeOf = require_kind_of();
|
|
3183
|
-
exports2.define = function(obj, key, val) {
|
|
3184
|
-
Reflect.defineProperty(obj, key, {
|
|
3185
|
-
enumerable: false,
|
|
3186
|
-
configurable: true,
|
|
3187
|
-
writable: true,
|
|
3188
|
-
value: val
|
|
3189
|
-
});
|
|
3190
|
-
};
|
|
3191
|
-
exports2.isBuffer = function(val) {
|
|
3192
|
-
return typeOf(val) === "buffer";
|
|
3193
|
-
};
|
|
3194
|
-
exports2.isObject = function(val) {
|
|
3195
|
-
return typeOf(val) === "object";
|
|
3196
|
-
};
|
|
3197
|
-
exports2.toBuffer = function(input) {
|
|
3198
|
-
return typeof input === "string" ? Buffer.from(input) : input;
|
|
3199
|
-
};
|
|
3200
|
-
exports2.toString = function(input) {
|
|
3201
|
-
if (exports2.isBuffer(input)) return stripBom(String(input));
|
|
3202
|
-
if (typeof input !== "string") {
|
|
3203
|
-
throw new TypeError("expected input to be a string or buffer");
|
|
3204
|
-
}
|
|
3205
|
-
return stripBom(input);
|
|
3206
|
-
};
|
|
3207
|
-
exports2.arrayify = function(val) {
|
|
3208
|
-
return val ? Array.isArray(val) ? val : [val] : [];
|
|
3209
|
-
};
|
|
3210
|
-
exports2.startsWith = function(str2, substr, len) {
|
|
3211
|
-
if (typeof len !== "number") len = substr.length;
|
|
3212
|
-
return str2.slice(0, len) === substr;
|
|
3213
|
-
};
|
|
3214
|
-
}
|
|
3215
|
-
});
|
|
3216
|
-
|
|
3217
|
-
// node_modules/gray-matter/lib/defaults.js
|
|
3218
|
-
var require_defaults = __commonJS({
|
|
3219
|
-
"node_modules/gray-matter/lib/defaults.js"(exports2, module2) {
|
|
3220
|
-
"use strict";
|
|
3221
|
-
var engines2 = require_engines();
|
|
3222
|
-
var utils = require_utils();
|
|
3223
|
-
module2.exports = function(options2) {
|
|
3224
|
-
const opts = Object.assign({}, options2);
|
|
3225
|
-
opts.delimiters = utils.arrayify(opts.delims || opts.delimiters || "---");
|
|
3226
|
-
if (opts.delimiters.length === 1) {
|
|
3227
|
-
opts.delimiters.push(opts.delimiters[0]);
|
|
3228
|
-
}
|
|
3229
|
-
opts.language = (opts.language || opts.lang || "yaml").toLowerCase();
|
|
3230
|
-
opts.engines = Object.assign({}, engines2, opts.parsers, opts.engines);
|
|
3231
|
-
return opts;
|
|
3232
|
-
};
|
|
3233
|
-
}
|
|
3234
|
-
});
|
|
3235
|
-
|
|
3236
|
-
// node_modules/gray-matter/lib/engine.js
|
|
3237
|
-
var require_engine = __commonJS({
|
|
3238
|
-
"node_modules/gray-matter/lib/engine.js"(exports2, module2) {
|
|
3239
|
-
"use strict";
|
|
3240
|
-
module2.exports = function(name, options2) {
|
|
3241
|
-
let engine = options2.engines[name] || options2.engines[aliase(name)];
|
|
3242
|
-
if (typeof engine === "undefined") {
|
|
3243
|
-
throw new Error('gray-matter engine "' + name + '" is not registered');
|
|
3244
|
-
}
|
|
3245
|
-
if (typeof engine === "function") {
|
|
3246
|
-
engine = { parse: engine };
|
|
3247
|
-
}
|
|
3248
|
-
return engine;
|
|
3249
|
-
};
|
|
3250
|
-
function aliase(name) {
|
|
3251
|
-
switch (name.toLowerCase()) {
|
|
3252
|
-
case "js":
|
|
3253
|
-
case "javascript":
|
|
3254
|
-
return "javascript";
|
|
3255
|
-
case "coffee":
|
|
3256
|
-
case "coffeescript":
|
|
3257
|
-
case "cson":
|
|
3258
|
-
return "coffee";
|
|
3259
|
-
case "yaml":
|
|
3260
|
-
case "yml":
|
|
3261
|
-
return "yaml";
|
|
3262
|
-
default: {
|
|
3263
|
-
return name;
|
|
3264
|
-
}
|
|
3265
|
-
}
|
|
3266
|
-
}
|
|
3267
|
-
}
|
|
3268
|
-
});
|
|
3269
|
-
|
|
3270
|
-
// node_modules/gray-matter/lib/stringify.js
|
|
3271
|
-
var require_stringify = __commonJS({
|
|
3272
|
-
"node_modules/gray-matter/lib/stringify.js"(exports2, module2) {
|
|
3273
|
-
"use strict";
|
|
3274
|
-
var typeOf = require_kind_of();
|
|
3275
|
-
var getEngine = require_engine();
|
|
3276
|
-
var defaults = require_defaults();
|
|
3277
|
-
module2.exports = function(file, data, options2) {
|
|
3278
|
-
if (data == null && options2 == null) {
|
|
3279
|
-
switch (typeOf(file)) {
|
|
3280
|
-
case "object":
|
|
3281
|
-
data = file.data;
|
|
3282
|
-
options2 = {};
|
|
3283
|
-
break;
|
|
3284
|
-
case "string":
|
|
3285
|
-
return file;
|
|
3286
|
-
default: {
|
|
3287
|
-
throw new TypeError("expected file to be a string or object");
|
|
3288
|
-
}
|
|
3289
|
-
}
|
|
3290
|
-
}
|
|
3291
|
-
const str2 = file.content;
|
|
3292
|
-
const opts = defaults(options2);
|
|
3293
|
-
if (data == null) {
|
|
3294
|
-
if (!opts.data) return file;
|
|
3295
|
-
data = opts.data;
|
|
3296
|
-
}
|
|
3297
|
-
const language = file.language || opts.language;
|
|
3298
|
-
const engine = getEngine(language, opts);
|
|
3299
|
-
if (typeof engine.stringify !== "function") {
|
|
3300
|
-
throw new TypeError('expected "' + language + '.stringify" to be a function');
|
|
3301
|
-
}
|
|
3302
|
-
data = Object.assign({}, file.data, data);
|
|
3303
|
-
const open = opts.delimiters[0];
|
|
3304
|
-
const close = opts.delimiters[1];
|
|
3305
|
-
const matter2 = engine.stringify(data, options2).trim();
|
|
3306
|
-
let buf = "";
|
|
3307
|
-
if (matter2 !== "{}") {
|
|
3308
|
-
buf = newline(open) + newline(matter2) + newline(close);
|
|
3309
|
-
}
|
|
3310
|
-
if (typeof file.excerpt === "string" && file.excerpt !== "") {
|
|
3311
|
-
if (str2.indexOf(file.excerpt.trim()) === -1) {
|
|
3312
|
-
buf += newline(file.excerpt) + newline(close);
|
|
3313
|
-
}
|
|
3314
|
-
}
|
|
3315
|
-
return buf + newline(str2);
|
|
3316
|
-
};
|
|
3317
|
-
function newline(str2) {
|
|
3318
|
-
return str2.slice(-1) !== "\n" ? str2 + "\n" : str2;
|
|
3319
|
-
}
|
|
3320
|
-
}
|
|
3321
|
-
});
|
|
3322
|
-
|
|
3323
|
-
// node_modules/gray-matter/lib/excerpt.js
|
|
3324
|
-
var require_excerpt = __commonJS({
|
|
3325
|
-
"node_modules/gray-matter/lib/excerpt.js"(exports2, module2) {
|
|
3326
|
-
"use strict";
|
|
3327
|
-
var defaults = require_defaults();
|
|
3328
|
-
module2.exports = function(file, options2) {
|
|
3329
|
-
const opts = defaults(options2);
|
|
3330
|
-
if (file.data == null) {
|
|
3331
|
-
file.data = {};
|
|
3332
|
-
}
|
|
3333
|
-
if (typeof opts.excerpt === "function") {
|
|
3334
|
-
return opts.excerpt(file, opts);
|
|
3335
|
-
}
|
|
3336
|
-
const sep = file.data.excerpt_separator || opts.excerpt_separator;
|
|
3337
|
-
if (sep == null && (opts.excerpt === false || opts.excerpt == null)) {
|
|
3338
|
-
return file;
|
|
3339
|
-
}
|
|
3340
|
-
const delimiter2 = typeof opts.excerpt === "string" ? opts.excerpt : sep || opts.delimiters[0];
|
|
3341
|
-
const idx = file.content.indexOf(delimiter2);
|
|
3342
|
-
if (idx !== -1) {
|
|
3343
|
-
file.excerpt = file.content.slice(0, idx);
|
|
3344
|
-
}
|
|
3345
|
-
return file;
|
|
3346
|
-
};
|
|
3347
|
-
}
|
|
3348
|
-
});
|
|
3349
|
-
|
|
3350
|
-
// node_modules/gray-matter/lib/to-file.js
|
|
3351
|
-
var require_to_file = __commonJS({
|
|
3352
|
-
"node_modules/gray-matter/lib/to-file.js"(exports2, module2) {
|
|
3353
|
-
"use strict";
|
|
3354
|
-
var typeOf = require_kind_of();
|
|
3355
|
-
var stringify = require_stringify();
|
|
3356
|
-
var utils = require_utils();
|
|
3357
|
-
module2.exports = function(file) {
|
|
3358
|
-
if (typeOf(file) !== "object") {
|
|
3359
|
-
file = { content: file };
|
|
3360
|
-
}
|
|
3361
|
-
if (typeOf(file.data) !== "object") {
|
|
3362
|
-
file.data = {};
|
|
3363
|
-
}
|
|
3364
|
-
if (file.contents && file.content == null) {
|
|
3365
|
-
file.content = file.contents;
|
|
3366
|
-
}
|
|
3367
|
-
utils.define(file, "orig", utils.toBuffer(file.content));
|
|
3368
|
-
utils.define(file, "language", file.language || "");
|
|
3369
|
-
utils.define(file, "matter", file.matter || "");
|
|
3370
|
-
utils.define(file, "stringify", function(data, options2) {
|
|
3371
|
-
if (options2 && options2.language) {
|
|
3372
|
-
file.language = options2.language;
|
|
3373
|
-
}
|
|
3374
|
-
return stringify(file, data, options2);
|
|
3375
|
-
});
|
|
3376
|
-
file.content = utils.toString(file.content);
|
|
3377
|
-
file.isEmpty = false;
|
|
3378
|
-
file.excerpt = "";
|
|
3379
|
-
return file;
|
|
3380
|
-
};
|
|
3381
|
-
}
|
|
3382
|
-
});
|
|
3383
|
-
|
|
3384
|
-
// node_modules/gray-matter/lib/parse.js
|
|
3385
|
-
var require_parse = __commonJS({
|
|
3386
|
-
"node_modules/gray-matter/lib/parse.js"(exports2, module2) {
|
|
3387
|
-
"use strict";
|
|
3388
|
-
var getEngine = require_engine();
|
|
3389
|
-
var defaults = require_defaults();
|
|
3390
|
-
module2.exports = function(language, str2, options2) {
|
|
3391
|
-
const opts = defaults(options2);
|
|
3392
|
-
const engine = getEngine(language, opts);
|
|
3393
|
-
if (typeof engine.parse !== "function") {
|
|
3394
|
-
throw new TypeError('expected "' + language + '.parse" to be a function');
|
|
3395
|
-
}
|
|
3396
|
-
return engine.parse(str2, opts);
|
|
3397
|
-
};
|
|
3398
|
-
}
|
|
3399
|
-
});
|
|
3400
|
-
|
|
3401
|
-
// node_modules/gray-matter/index.js
|
|
3402
|
-
var require_gray_matter = __commonJS({
|
|
3403
|
-
"node_modules/gray-matter/index.js"(exports2, module2) {
|
|
3404
|
-
"use strict";
|
|
3405
|
-
var fs7 = require("fs");
|
|
3406
|
-
var sections = require_section_matter();
|
|
3407
|
-
var defaults = require_defaults();
|
|
3408
|
-
var stringify = require_stringify();
|
|
3409
|
-
var excerpt = require_excerpt();
|
|
3410
|
-
var engines2 = require_engines();
|
|
3411
|
-
var toFile = require_to_file();
|
|
3412
|
-
var parse2 = require_parse();
|
|
3413
|
-
var utils = require_utils();
|
|
3414
|
-
function matter2(input, options2) {
|
|
3415
|
-
if (input === "") {
|
|
3416
|
-
return { data: {}, content: input, excerpt: "", orig: input };
|
|
3417
|
-
}
|
|
3418
|
-
let file = toFile(input);
|
|
3419
|
-
const cached = matter2.cache[file.content];
|
|
3420
|
-
if (!options2) {
|
|
3421
|
-
if (cached) {
|
|
3422
|
-
file = Object.assign({}, cached);
|
|
3423
|
-
file.orig = cached.orig;
|
|
3424
|
-
return file;
|
|
3425
|
-
}
|
|
3426
|
-
matter2.cache[file.content] = file;
|
|
3427
|
-
}
|
|
3428
|
-
return parseMatter(file, options2);
|
|
3429
|
-
}
|
|
3430
|
-
function parseMatter(file, options2) {
|
|
3431
|
-
const opts = defaults(options2);
|
|
3432
|
-
const open = opts.delimiters[0];
|
|
3433
|
-
const close = "\n" + opts.delimiters[1];
|
|
3434
|
-
let str2 = file.content;
|
|
3435
|
-
if (opts.language) {
|
|
3436
|
-
file.language = opts.language;
|
|
3437
|
-
}
|
|
3438
|
-
const openLen = open.length;
|
|
3439
|
-
if (!utils.startsWith(str2, open, openLen)) {
|
|
3440
|
-
excerpt(file, opts);
|
|
3441
|
-
return file;
|
|
3442
|
-
}
|
|
3443
|
-
if (str2.charAt(openLen) === open.slice(-1)) {
|
|
3444
|
-
return file;
|
|
3445
|
-
}
|
|
3446
|
-
str2 = str2.slice(openLen);
|
|
3447
|
-
const len = str2.length;
|
|
3448
|
-
const language = matter2.language(str2, opts);
|
|
3449
|
-
if (language.name) {
|
|
3450
|
-
file.language = language.name;
|
|
3451
|
-
str2 = str2.slice(language.raw.length);
|
|
3452
|
-
}
|
|
3453
|
-
let closeIndex = str2.indexOf(close);
|
|
3454
|
-
if (closeIndex === -1) {
|
|
3455
|
-
closeIndex = len;
|
|
3456
|
-
}
|
|
3457
|
-
file.matter = str2.slice(0, closeIndex);
|
|
3458
|
-
const block = file.matter.replace(/^\s*#[^\n]+/gm, "").trim();
|
|
3459
|
-
if (block === "") {
|
|
3460
|
-
file.isEmpty = true;
|
|
3461
|
-
file.empty = file.content;
|
|
3462
|
-
file.data = {};
|
|
3463
|
-
} else {
|
|
3464
|
-
file.data = parse2(file.language, file.matter, opts);
|
|
3465
|
-
}
|
|
3466
|
-
if (closeIndex === len) {
|
|
3467
|
-
file.content = "";
|
|
3468
|
-
} else {
|
|
3469
|
-
file.content = str2.slice(closeIndex + close.length);
|
|
3470
|
-
if (file.content[0] === "\r") {
|
|
3471
|
-
file.content = file.content.slice(1);
|
|
3472
|
-
}
|
|
3473
|
-
if (file.content[0] === "\n") {
|
|
3474
|
-
file.content = file.content.slice(1);
|
|
3475
|
-
}
|
|
3476
|
-
}
|
|
3477
|
-
excerpt(file, opts);
|
|
3478
|
-
if (opts.sections === true || typeof opts.section === "function") {
|
|
3479
|
-
sections(file, opts.section);
|
|
3480
|
-
}
|
|
3481
|
-
return file;
|
|
3482
|
-
}
|
|
3483
|
-
matter2.engines = engines2;
|
|
3484
|
-
matter2.stringify = function(file, data, options2) {
|
|
3485
|
-
if (typeof file === "string") file = matter2(file, options2);
|
|
3486
|
-
return stringify(file, data, options2);
|
|
3487
|
-
};
|
|
3488
|
-
matter2.read = function(filepath, options2) {
|
|
3489
|
-
const str2 = fs7.readFileSync(filepath, "utf8");
|
|
3490
|
-
const file = matter2(str2, options2);
|
|
3491
|
-
file.path = filepath;
|
|
3492
|
-
return file;
|
|
3493
|
-
};
|
|
3494
|
-
matter2.test = function(str2, options2) {
|
|
3495
|
-
return utils.startsWith(str2, defaults(options2).delimiters[0]);
|
|
3496
|
-
};
|
|
3497
|
-
matter2.language = function(str2, options2) {
|
|
3498
|
-
const opts = defaults(options2);
|
|
3499
|
-
const open = opts.delimiters[0];
|
|
3500
|
-
if (matter2.test(str2)) {
|
|
3501
|
-
str2 = str2.slice(open.length);
|
|
3502
|
-
}
|
|
3503
|
-
const language = str2.slice(0, str2.search(/\r?\n/));
|
|
3504
|
-
return {
|
|
3505
|
-
raw: language,
|
|
3506
|
-
name: language ? language.trim() : ""
|
|
3507
|
-
};
|
|
3508
|
-
};
|
|
3509
|
-
matter2.cache = {};
|
|
3510
|
-
matter2.clearCache = function() {
|
|
3511
|
-
matter2.cache = {};
|
|
3512
|
-
};
|
|
3513
|
-
module2.exports = matter2;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
3514
14
|
}
|
|
3515
|
-
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
3516
25
|
|
|
3517
26
|
// src/skill-scripts/route-task-execution.ts
|
|
3518
|
-
var
|
|
3519
|
-
var
|
|
27
|
+
var fs5 = __toESM(require("fs"));
|
|
28
|
+
var path5 = __toESM(require("path"));
|
|
3520
29
|
|
|
3521
30
|
// src/types.ts
|
|
3522
31
|
var SUPPORTED_HARNESSES = [
|
|
@@ -3736,120 +245,59 @@ var resolvePlan = (input, startPath = process.cwd()) => {
|
|
|
3736
245
|
return resolveByIdInAncestry(planId, startPath);
|
|
3737
246
|
};
|
|
3738
247
|
|
|
3739
|
-
// src/skill-scripts/shared/execution-policy.ts
|
|
3740
|
-
var import_gray_matter = __toESM(require_gray_matter());
|
|
3741
|
-
var fallback = (reason, detail) => ({ kind: "fallback", reason, detail });
|
|
3742
|
-
var hasOwn = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
3743
|
-
var readTaskExecutionPolicy = (taskMarkdown, context) => {
|
|
3744
|
-
let data;
|
|
3745
|
-
try {
|
|
3746
|
-
const parsed = (0, import_gray_matter.default)(taskMarkdown, {});
|
|
3747
|
-
if (!parsed.matter) return { kind: "native-default" };
|
|
3748
|
-
data = parsed.data;
|
|
3749
|
-
} catch (error) {
|
|
3750
|
-
return fallback(
|
|
3751
|
-
"invalid-frontmatter",
|
|
3752
|
-
`Task execution override was skipped: ${error instanceof Error ? error.message : "invalid YAML"}`
|
|
3753
|
-
);
|
|
3754
|
-
}
|
|
3755
|
-
if (!hasOwn(data, "execution")) return { kind: "native-default" };
|
|
3756
|
-
const execution = data.execution;
|
|
3757
|
-
if (!execution || Array.isArray(execution) || typeof execution !== "object") {
|
|
3758
|
-
return fallback("invalid-execution", "Task execution override must be a YAML mapping.");
|
|
3759
|
-
}
|
|
3760
|
-
const policy = execution;
|
|
3761
|
-
if (!hasOwn(policy, "model")) {
|
|
3762
|
-
return fallback("missing-model", "Task execution override requires an exact model string.");
|
|
3763
|
-
}
|
|
3764
|
-
if (typeof policy.model !== "string" || policy.model.length === 0) {
|
|
3765
|
-
return fallback("invalid-model", "Task execution model must be a non-empty string.");
|
|
3766
|
-
}
|
|
3767
|
-
if (hasOwn(policy, "reasoning_effort") && typeof policy.reasoning_effort !== "string") {
|
|
3768
|
-
return fallback(
|
|
3769
|
-
"invalid-reasoning-effort",
|
|
3770
|
-
"Task reasoning_effort must be a string when provided."
|
|
3771
|
-
);
|
|
3772
|
-
}
|
|
3773
|
-
const model = policy.model;
|
|
3774
|
-
const reasoningEffort = policy.reasoning_effort;
|
|
3775
|
-
if (!hasOwn(policy, "harness")) {
|
|
3776
|
-
return reasoningEffort === void 0 ? { kind: "native-override", model } : { kind: "native-override", model, reasoningEffort };
|
|
3777
|
-
}
|
|
3778
|
-
if (typeof policy.harness !== "string" || policy.harness.length === 0) {
|
|
3779
|
-
return fallback(
|
|
3780
|
-
"invalid-harness",
|
|
3781
|
-
"Task execution harness must be a non-empty string when provided."
|
|
3782
|
-
);
|
|
3783
|
-
}
|
|
3784
|
-
if (!context.supportedHarnesses.includes(policy.harness)) {
|
|
3785
|
-
return fallback(
|
|
3786
|
-
"unsupported-harness",
|
|
3787
|
-
`Task execution harness "${policy.harness}" is not supported.`
|
|
3788
|
-
);
|
|
3789
|
-
}
|
|
3790
|
-
if (policy.harness === context.currentHarness) {
|
|
3791
|
-
return fallback(
|
|
3792
|
-
"same-orchestrator-harness",
|
|
3793
|
-
"Task execution harness must differ from the current orchestrator."
|
|
3794
|
-
);
|
|
3795
|
-
}
|
|
3796
|
-
return reasoningEffort === void 0 ? { kind: "external-override", harness: policy.harness, model } : { kind: "external-override", harness: policy.harness, model, reasoningEffort };
|
|
3797
|
-
};
|
|
3798
|
-
|
|
3799
248
|
// src/skill-scripts/shared/execution-routing.ts
|
|
3800
|
-
var
|
|
3801
|
-
var
|
|
3802
|
-
var import_child_process = require("child_process");
|
|
249
|
+
var fs4 = __toESM(require("fs"));
|
|
250
|
+
var path4 = __toESM(require("path"));
|
|
3803
251
|
|
|
3804
252
|
// node_modules/js-yaml/dist/js-yaml.mjs
|
|
3805
253
|
var NOT_RESOLVED = /* @__PURE__ */ Symbol("NOT_RESOLVED");
|
|
3806
254
|
var MERGE_KEY = /* @__PURE__ */ Symbol("MERGE_KEY");
|
|
3807
|
-
function defineScalarTag(tagName,
|
|
255
|
+
function defineScalarTag(tagName, options) {
|
|
3808
256
|
return {
|
|
3809
257
|
tagName,
|
|
3810
258
|
nodeKind: "scalar",
|
|
3811
|
-
implicit:
|
|
3812
|
-
matchByTagPrefix:
|
|
3813
|
-
implicitFirstChars:
|
|
3814
|
-
resolve:
|
|
3815
|
-
identify:
|
|
3816
|
-
represent:
|
|
3817
|
-
representTagName:
|
|
259
|
+
implicit: options.implicit ?? false,
|
|
260
|
+
matchByTagPrefix: options.matchByTagPrefix ?? false,
|
|
261
|
+
implicitFirstChars: options.implicitFirstChars ?? null,
|
|
262
|
+
resolve: options.resolve,
|
|
263
|
+
identify: options.identify ?? null,
|
|
264
|
+
represent: options.represent ?? ((data) => String(data)),
|
|
265
|
+
representTagName: options.representTagName ?? null
|
|
3818
266
|
};
|
|
3819
267
|
}
|
|
3820
|
-
function defineSequenceTag(tagName,
|
|
3821
|
-
const carrierIsResult =
|
|
268
|
+
function defineSequenceTag(tagName, options) {
|
|
269
|
+
const carrierIsResult = options.finalize === void 0;
|
|
3822
270
|
return {
|
|
3823
271
|
tagName,
|
|
3824
272
|
nodeKind: "sequence",
|
|
3825
273
|
implicit: false,
|
|
3826
|
-
matchByTagPrefix:
|
|
3827
|
-
create:
|
|
3828
|
-
addItem:
|
|
3829
|
-
finalize:
|
|
274
|
+
matchByTagPrefix: options.matchByTagPrefix ?? false,
|
|
275
|
+
create: options.create,
|
|
276
|
+
addItem: options.addItem,
|
|
277
|
+
finalize: options.finalize ?? ((carrier) => carrier),
|
|
3830
278
|
carrierIsResult,
|
|
3831
|
-
identify:
|
|
3832
|
-
represent:
|
|
3833
|
-
representTagName:
|
|
279
|
+
identify: options.identify ?? null,
|
|
280
|
+
represent: options.represent ?? ((data) => data),
|
|
281
|
+
representTagName: options.representTagName ?? null
|
|
3834
282
|
};
|
|
3835
283
|
}
|
|
3836
|
-
function defineMappingTag(tagName,
|
|
3837
|
-
const carrierIsResult =
|
|
284
|
+
function defineMappingTag(tagName, options) {
|
|
285
|
+
const carrierIsResult = options.finalize === void 0;
|
|
3838
286
|
return {
|
|
3839
287
|
tagName,
|
|
3840
288
|
nodeKind: "mapping",
|
|
3841
289
|
implicit: false,
|
|
3842
|
-
matchByTagPrefix:
|
|
3843
|
-
create:
|
|
3844
|
-
addPair:
|
|
3845
|
-
has:
|
|
3846
|
-
keys:
|
|
3847
|
-
get:
|
|
3848
|
-
finalize:
|
|
290
|
+
matchByTagPrefix: options.matchByTagPrefix ?? false,
|
|
291
|
+
create: options.create,
|
|
292
|
+
addPair: options.addPair,
|
|
293
|
+
has: options.has,
|
|
294
|
+
keys: options.keys,
|
|
295
|
+
get: options.get,
|
|
296
|
+
finalize: options.finalize ?? ((carrier) => carrier),
|
|
3849
297
|
carrierIsResult,
|
|
3850
|
-
identify:
|
|
3851
|
-
represent:
|
|
3852
|
-
representTagName:
|
|
298
|
+
identify: options.identify ?? null,
|
|
299
|
+
represent: options.represent ?? ((data) => data),
|
|
300
|
+
representTagName: options.representTagName ?? null
|
|
3853
301
|
};
|
|
3854
302
|
}
|
|
3855
303
|
var strTag = defineScalarTag("tag:yaml.org,2002:str", {
|
|
@@ -4564,11 +1012,11 @@ function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
|
|
|
4564
1012
|
function padStart(string, max) {
|
|
4565
1013
|
return " ".repeat(Math.max(max - string.length, 0)) + string;
|
|
4566
1014
|
}
|
|
4567
|
-
function makeSnippet(mark,
|
|
1015
|
+
function makeSnippet(mark, options) {
|
|
4568
1016
|
if (!mark.buffer) return null;
|
|
4569
1017
|
const opts = {
|
|
4570
1018
|
...DEFAULT_SNIPPET_OPTIONS,
|
|
4571
|
-
...
|
|
1019
|
+
...options
|
|
4572
1020
|
};
|
|
4573
1021
|
const re = /\r?\n|\r|\0/g;
|
|
4574
1022
|
const lineStarts = [0];
|
|
@@ -5035,10 +1483,10 @@ function storeAnchor(state, event, value, tag, isValueFinal) {
|
|
|
5035
1483
|
}
|
|
5036
1484
|
return null;
|
|
5037
1485
|
}
|
|
5038
|
-
function constructFromEvents(events,
|
|
1486
|
+
function constructFromEvents(events, options) {
|
|
5039
1487
|
const state = {
|
|
5040
1488
|
...DEFAULT_CONSTRUCTOR_OPTIONS,
|
|
5041
|
-
...
|
|
1489
|
+
...options,
|
|
5042
1490
|
events,
|
|
5043
1491
|
documents: [],
|
|
5044
1492
|
eventIndex: 0,
|
|
@@ -5917,11 +2365,11 @@ function readDocument(state) {
|
|
|
5917
2365
|
addPopEvent(state);
|
|
5918
2366
|
if (!explicitEnd && state.position < state.length && !(state.position === state.lineStart && testDocumentSeparator(state))) throwError(state, "end of the stream or a document separator is expected");
|
|
5919
2367
|
}
|
|
5920
|
-
function parseEvents(input,
|
|
2368
|
+
function parseEvents(input, options) {
|
|
5921
2369
|
const length = input.length;
|
|
5922
2370
|
const state = {
|
|
5923
2371
|
...DEFAULT_PARSER_OPTIONS,
|
|
5924
|
-
...
|
|
2372
|
+
...options,
|
|
5925
2373
|
input: `${input}\0`,
|
|
5926
2374
|
length,
|
|
5927
2375
|
position: 0,
|
|
@@ -5951,10 +2399,10 @@ var DEFAULT_LOAD_OPTIONS = {
|
|
|
5951
2399
|
...DEFAULT_PARSER_OPTIONS,
|
|
5952
2400
|
...DEFAULT_CONSTRUCTOR_OPTIONS
|
|
5953
2401
|
};
|
|
5954
|
-
function loadDocuments(input,
|
|
2402
|
+
function loadDocuments(input, options = {}) {
|
|
5955
2403
|
const opts = {
|
|
5956
2404
|
...DEFAULT_LOAD_OPTIONS,
|
|
5957
|
-
...
|
|
2405
|
+
...options
|
|
5958
2406
|
};
|
|
5959
2407
|
const source = String(input);
|
|
5960
2408
|
const PARSER_OPT_KEYS = Object.keys(DEFAULT_PARSER_OPTIONS);
|
|
@@ -5964,8 +2412,8 @@ function loadDocuments(input, options2 = {}) {
|
|
|
5964
2412
|
source
|
|
5965
2413
|
});
|
|
5966
2414
|
}
|
|
5967
|
-
function load(input,
|
|
5968
|
-
const documents = loadDocuments(input,
|
|
2415
|
+
function load(input, options) {
|
|
2416
|
+
const documents = loadDocuments(input, options);
|
|
5969
2417
|
if (documents.length === 0) throw new YAMLException("expected a document, but the input is empty");
|
|
5970
2418
|
if (documents.length === 1) return documents[0];
|
|
5971
2419
|
throw new YAMLException("expected a single document in the stream, but found more");
|
|
@@ -6023,108 +2471,8 @@ var DEFAULT_DUMP_OPTIONS = {
|
|
|
6023
2471
|
}
|
|
6024
2472
|
};
|
|
6025
2473
|
|
|
6026
|
-
// src/skill-scripts/shared/external-dispatch.ts
|
|
6027
|
-
var fs4 = __toESM(require("fs"));
|
|
6028
|
-
var path4 = __toESM(require("path"));
|
|
6029
|
-
var taskPrompt = (request) => `Strikethroo external task dispatch \u2014 Plan ${request.planId}, Task ${request.taskId}.
|
|
6030
|
-
Workspace: ${request.workspace}
|
|
6031
|
-
Task file: ${request.taskFile}
|
|
6032
|
-
Before implementation, read and execute ${path4.join(
|
|
6033
|
-
request.workspace,
|
|
6034
|
-
".ai/strikethroo/config/hooks/PRE_TASK_EXECUTION.md"
|
|
6035
|
-
)}. Halt if that hook fails.
|
|
6036
|
-
|
|
6037
|
-
Read and implement this task. Preserve dependency validation, status transitions, evidence reporting, and error-hook handling. Report failures clearly.
|
|
6038
|
-
|
|
6039
|
-
${request.taskMarkdown}`;
|
|
6040
|
-
var command = (executable, argv, request) => ({
|
|
6041
|
-
executable,
|
|
6042
|
-
argv,
|
|
6043
|
-
cwd: request.workspace,
|
|
6044
|
-
stdin: taskPrompt(request)
|
|
6045
|
-
});
|
|
6046
|
-
var EXTERNAL_HARNESS_ADAPTERS = {
|
|
6047
|
-
claude: {
|
|
6048
|
-
executable: "claude",
|
|
6049
|
-
buildCommand: (request) => command(
|
|
6050
|
-
"claude",
|
|
6051
|
-
[
|
|
6052
|
-
"-p",
|
|
6053
|
-
"--model",
|
|
6054
|
-
request.model,
|
|
6055
|
-
...request.reasoningEffort === void 0 ? [] : ["--effort", request.reasoningEffort]
|
|
6056
|
-
],
|
|
6057
|
-
request
|
|
6058
|
-
),
|
|
6059
|
-
authenticationArgv: () => ["auth", "status"]
|
|
6060
|
-
},
|
|
6061
|
-
codex: {
|
|
6062
|
-
executable: "codex",
|
|
6063
|
-
buildCommand: (request) => command(
|
|
6064
|
-
"codex",
|
|
6065
|
-
[
|
|
6066
|
-
"exec",
|
|
6067
|
-
"--model",
|
|
6068
|
-
request.model,
|
|
6069
|
-
...request.reasoningEffort === void 0 ? [] : ["--config", `model_reasoning_effort=${request.reasoningEffort}`],
|
|
6070
|
-
"-"
|
|
6071
|
-
],
|
|
6072
|
-
request
|
|
6073
|
-
),
|
|
6074
|
-
authenticationArgv: () => ["login", "status"]
|
|
6075
|
-
},
|
|
6076
|
-
cursor: {
|
|
6077
|
-
executable: "cursor-agent",
|
|
6078
|
-
buildCommand: (request) => command("cursor-agent", ["--print", "--model", request.model], request),
|
|
6079
|
-
authenticationArgv: () => ["status"]
|
|
6080
|
-
},
|
|
6081
|
-
gemini: {
|
|
6082
|
-
executable: "gemini",
|
|
6083
|
-
buildCommand: (request) => command("gemini", ["--prompt", "", "--model", request.model], request),
|
|
6084
|
-
authenticationArgv: () => ["auth", "status"]
|
|
6085
|
-
},
|
|
6086
|
-
copilot: {
|
|
6087
|
-
executable: "copilot",
|
|
6088
|
-
buildCommand: (request) => command("copilot", ["-p", "", "--model", request.model], request),
|
|
6089
|
-
authenticationArgv: () => ["auth", "status"]
|
|
6090
|
-
},
|
|
6091
|
-
opencode: {
|
|
6092
|
-
executable: "opencode",
|
|
6093
|
-
buildCommand: (request) => command(
|
|
6094
|
-
"opencode",
|
|
6095
|
-
[
|
|
6096
|
-
"run",
|
|
6097
|
-
"--model",
|
|
6098
|
-
request.model,
|
|
6099
|
-
...request.reasoningEffort === void 0 ? [] : ["--variant", request.reasoningEffort],
|
|
6100
|
-
"-"
|
|
6101
|
-
],
|
|
6102
|
-
request
|
|
6103
|
-
),
|
|
6104
|
-
authenticationArgv: () => ["auth", "list"]
|
|
6105
|
-
}
|
|
6106
|
-
};
|
|
6107
|
-
var adapterKeys = Object.keys(EXTERNAL_HARNESS_ADAPTERS).sort();
|
|
6108
|
-
var harnessKeys = [...SUPPORTED_HARNESSES].sort();
|
|
6109
|
-
if (adapterKeys.join("\0") !== harnessKeys.join("\0")) {
|
|
6110
|
-
throw new Error("External harness adapter registry does not cover SUPPORTED_HARNESSES exactly.");
|
|
6111
|
-
}
|
|
6112
|
-
var executableOnPath = (executable) => (process.env.PATH ?? "").split(path4.delimiter).some((directory) => {
|
|
6113
|
-
if (!directory) return false;
|
|
6114
|
-
const candidate = path4.join(directory, executable);
|
|
6115
|
-
try {
|
|
6116
|
-
return fs4.statSync(candidate).isFile();
|
|
6117
|
-
} catch {
|
|
6118
|
-
return false;
|
|
6119
|
-
}
|
|
6120
|
-
});
|
|
6121
|
-
var harnessExecutableAvailable = (harness) => {
|
|
6122
|
-
const adapter = EXTERNAL_HARNESS_ADAPTERS[harness];
|
|
6123
|
-
return adapter ? executableOnPath(adapter.executable) : false;
|
|
6124
|
-
};
|
|
6125
|
-
|
|
6126
2474
|
// src/skill-scripts/shared/execution-routing.ts
|
|
6127
|
-
var WORKSPACE_CONFIG_RELPATH =
|
|
2475
|
+
var WORKSPACE_CONFIG_RELPATH = path4.join("config", "config.yaml");
|
|
6128
2476
|
var EXECUTION_ROUTING_SECTION = "execution_routing";
|
|
6129
2477
|
var isPlainObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6130
2478
|
var isNonEmptyString = (value) => typeof value === "string" && value.trim().length > 0;
|
|
@@ -6199,10 +2547,10 @@ var validateProfile = (name, raw, supportedHarnesses, errors) => {
|
|
|
6199
2547
|
return { name, description: raw.description.trim(), targets };
|
|
6200
2548
|
};
|
|
6201
2549
|
var loadRoutingConfig = (strikethrooRoot, supportedHarnesses) => {
|
|
6202
|
-
const configPath =
|
|
2550
|
+
const configPath = path4.join(strikethrooRoot, WORKSPACE_CONFIG_RELPATH);
|
|
6203
2551
|
let contents;
|
|
6204
2552
|
try {
|
|
6205
|
-
contents =
|
|
2553
|
+
contents = fs4.readFileSync(configPath, "utf8");
|
|
6206
2554
|
} catch {
|
|
6207
2555
|
return { kind: "no-config" };
|
|
6208
2556
|
}
|
|
@@ -6304,106 +2652,7 @@ var validateAssignments = (rawMap, taskIds, profileNames) => {
|
|
|
6304
2652
|
if (errors.length > 0) return { kind: "invalid", errors };
|
|
6305
2653
|
return { kind: "assignments", assignments };
|
|
6306
2654
|
};
|
|
6307
|
-
var
|
|
6308
|
-
try {
|
|
6309
|
-
const isNodeScript = /\.(cjs|mjs|js)$/.test(scriptPath);
|
|
6310
|
-
const stdout = isNodeScript ? (0, import_child_process.execFileSync)(process.execPath, [scriptPath], { input, encoding: "utf8" }) : (0, import_child_process.execFileSync)(scriptPath, { input, encoding: "utf8" });
|
|
6311
|
-
return { stdout };
|
|
6312
|
-
} catch (error) {
|
|
6313
|
-
return { error: error instanceof Error ? error.message : String(error) };
|
|
6314
|
-
}
|
|
6315
|
-
};
|
|
6316
|
-
var selectTargets = (config, assignments, options2) => {
|
|
6317
|
-
const profilesByName = new Map(config.profiles.map((p) => [p.name, p]));
|
|
6318
|
-
const tasks = [...assignments.entries()].sort(([a], [b]) => a - b).map(([id, profileName]) => {
|
|
6319
|
-
const profile = profilesByName.get(profileName);
|
|
6320
|
-
if (!profile) throw new Error(`unvalidated profile "${profileName}"`);
|
|
6321
|
-
return { id, profile: profileName, candidates: profile.targets };
|
|
6322
|
-
});
|
|
6323
|
-
if (!config.resolverScript) {
|
|
6324
|
-
const isHarnessAvailable = options2.harnessAvailable ?? harnessExecutableAvailable;
|
|
6325
|
-
const random = options2.random ?? Math.random;
|
|
6326
|
-
const selections2 = /* @__PURE__ */ new Map();
|
|
6327
|
-
for (const task of tasks) {
|
|
6328
|
-
const fallback2 = task.candidates[0];
|
|
6329
|
-
if (!fallback2) throw new Error(`profile "${task.profile}" has no targets`);
|
|
6330
|
-
const available = task.candidates.filter(
|
|
6331
|
-
(candidate) => candidate.harness === void 0 || isHarnessAvailable(candidate.harness)
|
|
6332
|
-
);
|
|
6333
|
-
const pool = available.length > 0 ? available : [fallback2];
|
|
6334
|
-
const chosen = pool[Math.floor(random() * pool.length)] ?? fallback2;
|
|
6335
|
-
selections2.set(task.id, chosen);
|
|
6336
|
-
}
|
|
6337
|
-
return { kind: "selected", selections: selections2 };
|
|
6338
|
-
}
|
|
6339
|
-
const scriptPath = path5.resolve(options2.projectRoot, config.resolverScript);
|
|
6340
|
-
if (!fs5.existsSync(scriptPath)) {
|
|
6341
|
-
return {
|
|
6342
|
-
kind: "resolver-failure",
|
|
6343
|
-
detail: `custom resolver script not found: ${scriptPath}`
|
|
6344
|
-
};
|
|
6345
|
-
}
|
|
6346
|
-
const request = JSON.stringify({ planId: options2.planId, tasks });
|
|
6347
|
-
const outcome = runCustomResolver(scriptPath, request);
|
|
6348
|
-
if ("error" in outcome) {
|
|
6349
|
-
return { kind: "resolver-failure", detail: `custom resolver failed: ${outcome.error}` };
|
|
6350
|
-
}
|
|
6351
|
-
let parsed;
|
|
6352
|
-
try {
|
|
6353
|
-
parsed = JSON.parse(outcome.stdout);
|
|
6354
|
-
} catch {
|
|
6355
|
-
return {
|
|
6356
|
-
kind: "resolver-failure",
|
|
6357
|
-
detail: "custom resolver did not print a JSON object on stdout."
|
|
6358
|
-
};
|
|
6359
|
-
}
|
|
6360
|
-
if (!isPlainObject2(parsed) || !isPlainObject2(parsed.selections)) {
|
|
6361
|
-
return {
|
|
6362
|
-
kind: "resolver-failure",
|
|
6363
|
-
detail: 'custom resolver output must be {"selections": {"<taskId>": <candidateIndex>}}.'
|
|
6364
|
-
};
|
|
6365
|
-
}
|
|
6366
|
-
const rawSelections = parsed.selections;
|
|
6367
|
-
const selections = /* @__PURE__ */ new Map();
|
|
6368
|
-
for (const task of tasks) {
|
|
6369
|
-
const raw = rawSelections[String(task.id)];
|
|
6370
|
-
if (typeof raw !== "number" || !Number.isInteger(raw)) {
|
|
6371
|
-
return {
|
|
6372
|
-
kind: "resolver-failure",
|
|
6373
|
-
detail: `custom resolver returned no integer candidate index for task ${task.id}.`
|
|
6374
|
-
};
|
|
6375
|
-
}
|
|
6376
|
-
const target = task.candidates[raw];
|
|
6377
|
-
if (raw < 0 || !target) {
|
|
6378
|
-
return {
|
|
6379
|
-
kind: "resolver-failure",
|
|
6380
|
-
detail: `custom resolver selected candidate ${raw} for task ${task.id}, which is outside profile "${task.profile}"'s configured targets.`
|
|
6381
|
-
};
|
|
6382
|
-
}
|
|
6383
|
-
selections.set(task.id, target);
|
|
6384
|
-
}
|
|
6385
|
-
const extras = Object.keys(rawSelections).filter(
|
|
6386
|
-
(key) => !tasks.some((task) => String(task.id) === key)
|
|
6387
|
-
);
|
|
6388
|
-
if (extras.length > 0) {
|
|
6389
|
-
return {
|
|
6390
|
-
kind: "resolver-failure",
|
|
6391
|
-
detail: `custom resolver returned selections for unknown task IDs: ${extras.join(", ")}.`
|
|
6392
|
-
};
|
|
6393
|
-
}
|
|
6394
|
-
return { kind: "selected", selections };
|
|
6395
|
-
};
|
|
6396
|
-
var toExecutionMapping = (target, currentHarness) => {
|
|
6397
|
-
const execution = { model: target.model };
|
|
6398
|
-
if (target.harness !== void 0 && target.harness !== currentHarness) {
|
|
6399
|
-
execution.harness = target.harness;
|
|
6400
|
-
}
|
|
6401
|
-
if (target.reasoning_effort !== void 0) {
|
|
6402
|
-
execution.reasoning_effort = target.reasoning_effort;
|
|
6403
|
-
}
|
|
6404
|
-
return execution;
|
|
6405
|
-
};
|
|
6406
|
-
var writeExecutionFrontmatter = (taskMarkdown, execution) => {
|
|
2655
|
+
var writeExecutionProfileFrontmatter = (taskMarkdown, profile) => {
|
|
6407
2656
|
const match = taskMarkdown.match(/^(---\r?\n)([\s\S]*?)(\r?\n---)/);
|
|
6408
2657
|
if (!match) throw new Error("missing frontmatter");
|
|
6409
2658
|
const opening = match[1];
|
|
@@ -6417,6 +2666,7 @@ var writeExecutionFrontmatter = (taskMarkdown, execution) => {
|
|
|
6417
2666
|
const kept = [];
|
|
6418
2667
|
let inExecutionBlock = false;
|
|
6419
2668
|
for (const line of lines) {
|
|
2669
|
+
if (/^execution_profile\s*:/.test(line)) continue;
|
|
6420
2670
|
if (/^execution\s*:/.test(line)) {
|
|
6421
2671
|
inExecutionBlock = true;
|
|
6422
2672
|
continue;
|
|
@@ -6425,15 +2675,7 @@ var writeExecutionFrontmatter = (taskMarkdown, execution) => {
|
|
|
6425
2675
|
inExecutionBlock = false;
|
|
6426
2676
|
kept.push(line);
|
|
6427
2677
|
}
|
|
6428
|
-
const
|
|
6429
|
-
if (execution.harness !== void 0) {
|
|
6430
|
-
executionLines.push(` harness: ${JSON.stringify(execution.harness)}`);
|
|
6431
|
-
}
|
|
6432
|
-
executionLines.push(` model: ${JSON.stringify(execution.model)}`);
|
|
6433
|
-
if (execution.reasoning_effort !== void 0) {
|
|
6434
|
-
executionLines.push(` reasoning_effort: ${JSON.stringify(execution.reasoning_effort)}`);
|
|
6435
|
-
}
|
|
6436
|
-
const newFrontmatter = [...kept, ...executionLines].join(eol);
|
|
2678
|
+
const newFrontmatter = [...kept, `execution_profile: ${JSON.stringify(profile)}`].join(eol);
|
|
6437
2679
|
return `${opening}${newFrontmatter}${closing}${taskMarkdown.slice(match[0].length)}`;
|
|
6438
2680
|
};
|
|
6439
2681
|
|
|
@@ -6446,15 +2688,15 @@ var emit = (result, exitCode) => {
|
|
|
6446
2688
|
var usage = () => emit(
|
|
6447
2689
|
{
|
|
6448
2690
|
kind: "infrastructure-failure",
|
|
6449
|
-
detail: "Usage: route-task-execution.cjs profiles <plan-id> | route-task-execution.cjs apply <plan-id> <assignment-json-file>
|
|
2691
|
+
detail: "Usage: route-task-execution.cjs profiles <plan-id> | route-task-execution.cjs apply <plan-id> <assignment-json-file>"
|
|
6450
2692
|
},
|
|
6451
2693
|
2
|
|
6452
2694
|
);
|
|
6453
2695
|
var readTaskDocuments = (planDir) => {
|
|
6454
|
-
const tasksDir =
|
|
2696
|
+
const tasksDir = path5.join(planDir, "tasks");
|
|
6455
2697
|
let entries;
|
|
6456
2698
|
try {
|
|
6457
|
-
entries =
|
|
2699
|
+
entries = fs5.readdirSync(tasksDir, { withFileTypes: true });
|
|
6458
2700
|
} catch {
|
|
6459
2701
|
return { kind: "invalid", errors: [`no tasks directory at ${tasksDir}.`] };
|
|
6460
2702
|
}
|
|
@@ -6464,8 +2706,8 @@ var readTaskDocuments = (planDir) => {
|
|
|
6464
2706
|
const taskFiles = entries.filter((e) => e.isFile() && e.name.endsWith(".md")).map((e) => e.name).sort();
|
|
6465
2707
|
for (const name of taskFiles) {
|
|
6466
2708
|
const entry = { name };
|
|
6467
|
-
const file =
|
|
6468
|
-
const content =
|
|
2709
|
+
const file = path5.join(tasksDir, entry.name);
|
|
2710
|
+
const content = fs5.readFileSync(file, "utf8");
|
|
6469
2711
|
const id = extractPlanId(content, file);
|
|
6470
2712
|
if (id === null) {
|
|
6471
2713
|
errors.push(`task file ${entry.name} has no integer id in its frontmatter.`);
|
|
@@ -6483,12 +2725,6 @@ var readTaskDocuments = (planDir) => {
|
|
|
6483
2725
|
if (errors.length > 0) return { kind: "invalid", errors };
|
|
6484
2726
|
return { kind: "tasks", tasks };
|
|
6485
2727
|
};
|
|
6486
|
-
var policyMatchesExecution = (policy, execution) => {
|
|
6487
|
-
if (execution.harness !== void 0) {
|
|
6488
|
-
return policy.kind === "external-override" && policy.harness === execution.harness && policy.model === execution.model && policy.reasoningEffort === execution.reasoning_effort;
|
|
6489
|
-
}
|
|
6490
|
-
return policy.kind === "native-override" && policy.model === execution.model && policy.reasoningEffort === execution.reasoning_effort;
|
|
6491
|
-
};
|
|
6492
2728
|
var main = () => {
|
|
6493
2729
|
const [mode, planIdArg, ...rest] = process.argv.slice(2);
|
|
6494
2730
|
if (mode !== "profiles" && mode !== "apply" || !planIdArg) usage();
|
|
@@ -6520,17 +2756,8 @@ var main = () => {
|
|
|
6520
2756
|
0
|
|
6521
2757
|
);
|
|
6522
2758
|
}
|
|
6523
|
-
const [assignmentFile,
|
|
6524
|
-
if (!assignmentFile ||
|
|
6525
|
-
if (!SUPPORTED_HARNESSES.includes(currentHarness)) {
|
|
6526
|
-
emit(
|
|
6527
|
-
{
|
|
6528
|
-
kind: "infrastructure-failure",
|
|
6529
|
-
detail: `current harness "${currentHarness}" is not a supported harness.`
|
|
6530
|
-
},
|
|
6531
|
-
2
|
|
6532
|
-
);
|
|
6533
|
-
}
|
|
2759
|
+
const [assignmentFile, ...extraArgs] = rest;
|
|
2760
|
+
if (!assignmentFile || extraArgs.length > 0) usage();
|
|
6534
2761
|
const documents = readTaskDocuments(resolved.planDir);
|
|
6535
2762
|
if (documents.kind === "invalid") {
|
|
6536
2763
|
emit({ kind: "invalid-tasks", errors: documents.errors }, 1);
|
|
@@ -6538,7 +2765,7 @@ var main = () => {
|
|
|
6538
2765
|
}
|
|
6539
2766
|
let rawMap;
|
|
6540
2767
|
try {
|
|
6541
|
-
rawMap = JSON.parse(
|
|
2768
|
+
rawMap = JSON.parse(fs5.readFileSync(assignmentFile, "utf8"));
|
|
6542
2769
|
} catch (error) {
|
|
6543
2770
|
emit(
|
|
6544
2771
|
{
|
|
@@ -6560,70 +2787,51 @@ var main = () => {
|
|
|
6560
2787
|
emit({ kind: "invalid-assignments", errors: assignmentResult.errors }, 1);
|
|
6561
2788
|
return;
|
|
6562
2789
|
}
|
|
6563
|
-
const projectRoot = path6.dirname(path6.dirname(resolved.strikethrooRoot));
|
|
6564
|
-
const selection = selectTargets(config, assignmentResult.assignments, {
|
|
6565
|
-
planId: resolved.planId,
|
|
6566
|
-
projectRoot
|
|
6567
|
-
});
|
|
6568
|
-
if (selection.kind === "resolver-failure") {
|
|
6569
|
-
emit({ kind: "resolver-failure", detail: selection.detail }, 1);
|
|
6570
|
-
return;
|
|
6571
|
-
}
|
|
6572
|
-
const policyContext = {
|
|
6573
|
-
currentHarness,
|
|
6574
|
-
supportedHarnesses: SUPPORTED_HARNESSES
|
|
6575
|
-
};
|
|
6576
2790
|
const staged = [];
|
|
6577
2791
|
for (const task of documents.tasks) {
|
|
6578
|
-
const
|
|
6579
|
-
if (!
|
|
6580
|
-
emit({ kind: "routing-failure", detail: `no
|
|
2792
|
+
const profile = assignmentResult.assignments.get(task.id);
|
|
2793
|
+
if (!profile) {
|
|
2794
|
+
emit({ kind: "routing-failure", detail: `no profile assigned for task ${task.id}.` }, 1);
|
|
6581
2795
|
return;
|
|
6582
2796
|
}
|
|
6583
|
-
const execution = toExecutionMapping(target, currentHarness);
|
|
6584
2797
|
let next;
|
|
6585
2798
|
try {
|
|
6586
|
-
next =
|
|
2799
|
+
next = writeExecutionProfileFrontmatter(task.content, profile);
|
|
6587
2800
|
} catch (error) {
|
|
6588
2801
|
emit(
|
|
6589
2802
|
{
|
|
6590
2803
|
kind: "routing-failure",
|
|
6591
|
-
detail: `task ${task.id} (${
|
|
2804
|
+
detail: `task ${task.id} (${path5.basename(task.file)}): ${error instanceof Error ? error.message : String(error)}`
|
|
6592
2805
|
},
|
|
6593
2806
|
1
|
|
6594
2807
|
);
|
|
6595
2808
|
return;
|
|
6596
2809
|
}
|
|
6597
|
-
|
|
6598
|
-
if (!policyMatchesExecution(policy, execution)) {
|
|
2810
|
+
if (!next.includes(`execution_profile: ${JSON.stringify(profile)}`)) {
|
|
6599
2811
|
emit(
|
|
6600
|
-
{
|
|
6601
|
-
kind: "routing-failure",
|
|
6602
|
-
detail: `task ${task.id} would not verify after routing (${policy.kind}${"detail" in policy ? `: ${policy.detail}` : ""}).`
|
|
6603
|
-
},
|
|
2812
|
+
{ kind: "routing-failure", detail: `task ${task.id} would not verify after routing.` },
|
|
6604
2813
|
1
|
|
6605
2814
|
);
|
|
6606
2815
|
return;
|
|
6607
2816
|
}
|
|
6608
|
-
staged.push({ task, next,
|
|
2817
|
+
staged.push({ task, next, profile });
|
|
6609
2818
|
}
|
|
6610
2819
|
const written = [];
|
|
6611
2820
|
try {
|
|
6612
2821
|
for (const { task, next } of staged) {
|
|
6613
|
-
|
|
2822
|
+
fs5.writeFileSync(task.file, next);
|
|
6614
2823
|
written.push(task);
|
|
6615
2824
|
}
|
|
6616
|
-
for (const { task,
|
|
6617
|
-
const reread =
|
|
6618
|
-
|
|
6619
|
-
if (!policyMatchesExecution(policy, execution)) {
|
|
2825
|
+
for (const { task, next } of staged) {
|
|
2826
|
+
const reread = fs5.readFileSync(task.file, "utf8");
|
|
2827
|
+
if (reread !== next) {
|
|
6620
2828
|
throw new Error(`task ${task.id} failed post-write verification.`);
|
|
6621
2829
|
}
|
|
6622
2830
|
}
|
|
6623
2831
|
} catch (error) {
|
|
6624
2832
|
for (const task of written) {
|
|
6625
2833
|
try {
|
|
6626
|
-
|
|
2834
|
+
fs5.writeFileSync(task.file, task.content);
|
|
6627
2835
|
} catch {
|
|
6628
2836
|
}
|
|
6629
2837
|
}
|
|
@@ -6639,10 +2847,10 @@ var main = () => {
|
|
|
6639
2847
|
emit(
|
|
6640
2848
|
{
|
|
6641
2849
|
kind: "routed",
|
|
6642
|
-
tasks: staged.map(({ task,
|
|
2850
|
+
tasks: staged.map(({ task, profile }) => ({
|
|
6643
2851
|
id: task.id,
|
|
6644
2852
|
file: task.file,
|
|
6645
|
-
|
|
2853
|
+
executionProfile: profile
|
|
6646
2854
|
}))
|
|
6647
2855
|
},
|
|
6648
2856
|
0
|
|
@@ -6661,22 +2869,6 @@ try {
|
|
|
6661
2869
|
}
|
|
6662
2870
|
/*! Bundled license information:
|
|
6663
2871
|
|
|
6664
|
-
is-extendable/index.js:
|
|
6665
|
-
(*!
|
|
6666
|
-
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
|
6667
|
-
*
|
|
6668
|
-
* Copyright (c) 2015, Jon Schlinkert.
|
|
6669
|
-
* Licensed under the MIT License.
|
|
6670
|
-
*)
|
|
6671
|
-
|
|
6672
|
-
strip-bom-string/index.js:
|
|
6673
|
-
(*!
|
|
6674
|
-
* strip-bom-string <https://github.com/jonschlinkert/strip-bom-string>
|
|
6675
|
-
*
|
|
6676
|
-
* Copyright (c) 2015, 2017, Jon Schlinkert.
|
|
6677
|
-
* Released under the MIT License.
|
|
6678
|
-
*)
|
|
6679
|
-
|
|
6680
2872
|
js-yaml/dist/js-yaml.mjs:
|
|
6681
2873
|
(*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT *)
|
|
6682
2874
|
*/
|