@zenobius/opencode-skillful 1.0.0-next.6 → 1.1.0-next.3

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.
Files changed (3) hide show
  1. package/README.md +588 -48
  2. package/dist/index.js +2473 -1213
  3. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -27,509 +27,183 @@ var __export = (target, all) => {
27
27
  };
28
28
  var __require = import.meta.require;
29
29
 
30
- // node_modules/search-string/dist/node/utils.js
31
- var require_utils = __commonJS((exports, module) => {
32
- function getQuotePairMap(str2) {
33
- if (!str2)
34
- str2 = "";
35
- var quotePairMap = { single: {}, double: {} };
36
- var prevQuote = { single: -1, double: -1 };
37
- var prevChar = "";
38
- for (var i = 0;i < str2.length; i++) {
39
- var char = str2[i];
40
- if (prevChar !== "\\") {
41
- if (char === '"') {
42
- if (prevQuote.double >= 0) {
43
- quotePairMap.double[prevQuote.double] = true;
44
- quotePairMap.double[i] = true;
45
- prevQuote.double = -1;
46
- } else {
47
- prevQuote.double = i;
48
- }
49
- } else if (char === "'") {
50
- if (prevQuote.single >= 0) {
51
- quotePairMap.single[prevQuote.single] = true;
52
- quotePairMap.single[i] = true;
53
- prevQuote.single = -1;
54
- } else {
55
- prevQuote.single = i;
56
- }
57
- }
30
+ // node_modules/kind-of/index.js
31
+ var require_kind_of = __commonJS((exports, module) => {
32
+ var toString = Object.prototype.toString;
33
+ module.exports = function kindOf(val) {
34
+ if (val === undefined)
35
+ return "undefined";
36
+ if (val === null)
37
+ return "null";
38
+ var type = typeof val;
39
+ if (type === "boolean")
40
+ return "boolean";
41
+ if (type === "string")
42
+ return "string";
43
+ if (type === "number")
44
+ return "number";
45
+ if (type === "symbol")
46
+ return "symbol";
47
+ if (type === "function") {
48
+ return isGeneratorFn(val) ? "generatorfunction" : "function";
49
+ }
50
+ if (isArray(val))
51
+ return "array";
52
+ if (isBuffer(val))
53
+ return "buffer";
54
+ if (isArguments(val))
55
+ return "arguments";
56
+ if (isDate(val))
57
+ return "date";
58
+ if (isError(val))
59
+ return "error";
60
+ if (isRegexp(val))
61
+ return "regexp";
62
+ switch (ctorName(val)) {
63
+ case "Symbol":
64
+ return "symbol";
65
+ case "Promise":
66
+ return "promise";
67
+ case "WeakMap":
68
+ return "weakmap";
69
+ case "WeakSet":
70
+ return "weakset";
71
+ case "Map":
72
+ return "map";
73
+ case "Set":
74
+ return "set";
75
+ case "Int8Array":
76
+ return "int8array";
77
+ case "Uint8Array":
78
+ return "uint8array";
79
+ case "Uint8ClampedArray":
80
+ return "uint8clampedarray";
81
+ case "Int16Array":
82
+ return "int16array";
83
+ case "Uint16Array":
84
+ return "uint16array";
85
+ case "Int32Array":
86
+ return "int32array";
87
+ case "Uint32Array":
88
+ return "uint32array";
89
+ case "Float32Array":
90
+ return "float32array";
91
+ case "Float64Array":
92
+ return "float64array";
93
+ }
94
+ if (isGeneratorObj(val)) {
95
+ return "generator";
96
+ }
97
+ type = toString.call(val);
98
+ switch (type) {
99
+ case "[object Object]":
100
+ return "object";
101
+ case "[object Map Iterator]":
102
+ return "mapiterator";
103
+ case "[object Set Iterator]":
104
+ return "setiterator";
105
+ case "[object String Iterator]":
106
+ return "stringiterator";
107
+ case "[object Array Iterator]":
108
+ return "arrayiterator";
109
+ }
110
+ return type.slice(8, -1).toLowerCase().replace(/\s/g, "");
111
+ };
112
+ function ctorName(val) {
113
+ return typeof val.constructor === "function" ? val.constructor.name : null;
114
+ }
115
+ function isArray(val) {
116
+ if (Array.isArray)
117
+ return Array.isArray(val);
118
+ return val instanceof Array;
119
+ }
120
+ function isError(val) {
121
+ return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
122
+ }
123
+ function isDate(val) {
124
+ if (val instanceof Date)
125
+ return true;
126
+ return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
127
+ }
128
+ function isRegexp(val) {
129
+ if (val instanceof RegExp)
130
+ return true;
131
+ return typeof val.flags === "string" && typeof val.ignoreCase === "boolean" && typeof val.multiline === "boolean" && typeof val.global === "boolean";
132
+ }
133
+ function isGeneratorFn(name, val) {
134
+ return ctorName(name) === "GeneratorFunction";
135
+ }
136
+ function isGeneratorObj(val) {
137
+ return typeof val.throw === "function" && typeof val.return === "function" && typeof val.next === "function";
138
+ }
139
+ function isArguments(val) {
140
+ try {
141
+ if (typeof val.length === "number" && typeof val.callee === "function") {
142
+ return true;
143
+ }
144
+ } catch (err) {
145
+ if (err.message.indexOf("callee") !== -1) {
146
+ return true;
58
147
  }
59
- prevChar = char;
60
148
  }
61
- return quotePairMap;
149
+ return false;
62
150
  }
63
- module.exports = {
64
- getQuotePairMap
151
+ function isBuffer(val) {
152
+ if (val.constructor && typeof val.constructor.isBuffer === "function") {
153
+ return val.constructor.isBuffer(val);
154
+ }
155
+ return false;
156
+ }
157
+ });
158
+
159
+ // node_modules/is-extendable/index.js
160
+ var require_is_extendable = __commonJS((exports, module) => {
161
+ /*!
162
+ * is-extendable <https://github.com/jonschlinkert/is-extendable>
163
+ *
164
+ * Copyright (c) 2015, Jon Schlinkert.
165
+ * Licensed under the MIT License.
166
+ */
167
+ module.exports = function isExtendable(val) {
168
+ return typeof val !== "undefined" && val !== null && (typeof val === "object" || typeof val === "function");
65
169
  };
66
170
  });
67
171
 
68
- // node_modules/search-string/dist/node/searchString.js
69
- var require_searchString = __commonJS((exports, module) => {
70
- var _createClass = function() {
71
- function defineProperties(target, props) {
72
- for (var i = 0;i < props.length; i++) {
73
- var descriptor = props[i];
74
- descriptor.enumerable = descriptor.enumerable || false;
75
- descriptor.configurable = true;
76
- if ("value" in descriptor)
77
- descriptor.writable = true;
78
- Object.defineProperty(target, descriptor.key, descriptor);
172
+ // node_modules/extend-shallow/index.js
173
+ var require_extend_shallow = __commonJS((exports, module) => {
174
+ var isObject2 = require_is_extendable();
175
+ module.exports = function extend(o) {
176
+ if (!isObject2(o)) {
177
+ o = {};
178
+ }
179
+ var len = arguments.length;
180
+ for (var i = 1;i < len; i++) {
181
+ var obj = arguments[i];
182
+ if (isObject2(obj)) {
183
+ assign(o, obj);
79
184
  }
80
185
  }
81
- return function(Constructor, protoProps, staticProps) {
82
- if (protoProps)
83
- defineProperties(Constructor.prototype, protoProps);
84
- if (staticProps)
85
- defineProperties(Constructor, staticProps);
86
- return Constructor;
87
- };
88
- }();
89
- function _classCallCheck(instance, Constructor) {
90
- if (!(instance instanceof Constructor)) {
91
- throw new TypeError("Cannot call a class as a function");
186
+ return o;
187
+ };
188
+ function assign(a, b) {
189
+ for (var key in b) {
190
+ if (hasOwn(b, key)) {
191
+ a[key] = b[key];
192
+ }
92
193
  }
93
194
  }
94
- var _require = require_utils();
95
- var getQuotePairMap = _require.getQuotePairMap;
96
- var RESET = "RESET";
97
- var IN_OPERAND = "IN_OPERAND";
98
- var IN_TEXT = "IN_TEXT";
99
- var SINGLE_QUOTE = "SINGLE_QUOTE";
100
- var DOUBLE_QUOTE = "DOUBLE_QUOTE";
101
- var SearchString = function() {
102
- function SearchString2(conditionArray, textSegments) {
103
- _classCallCheck(this, SearchString2);
104
- this.conditionArray = conditionArray;
105
- this.textSegments = textSegments;
106
- this.string = "";
107
- this.isStringDirty = true;
108
- }
109
- _createClass(SearchString2, [{
110
- key: "getConditionArray",
111
- value: function getConditionArray() {
112
- return this.conditionArray;
113
- }
114
- }, {
115
- key: "getParsedQuery",
116
- value: function getParsedQuery() {
117
- var parsedQuery = { exclude: {} };
118
- this.conditionArray.forEach(function(condition) {
119
- if (condition.negated) {
120
- if (parsedQuery.exclude[condition.keyword]) {
121
- parsedQuery.exclude[condition.keyword].push(condition.value);
122
- } else {
123
- parsedQuery.exclude[condition.keyword] = [condition.value];
124
- }
125
- } else {
126
- if (parsedQuery[condition.keyword]) {
127
- parsedQuery[condition.keyword].push(condition.value);
128
- } else {
129
- parsedQuery[condition.keyword] = [condition.value];
130
- }
131
- }
132
- });
133
- return parsedQuery;
134
- }
135
- }, {
136
- key: "getAllText",
137
- value: function getAllText() {
138
- return this.textSegments ? this.textSegments.map(function(_ref) {
139
- var { text, negated } = _ref;
140
- return negated ? "-" + text : text;
141
- }).join(" ") : "";
142
- }
143
- }, {
144
- key: "getTextSegments",
145
- value: function getTextSegments() {
146
- return this.textSegments;
147
- }
148
- }, {
149
- key: "removeKeyword",
150
- value: function removeKeyword(keywordToRemove, negatedToRemove) {
151
- this.conditionArray = this.conditionArray.filter(function(_ref2) {
152
- var { keyword, negated } = _ref2;
153
- return keywordToRemove !== keyword || negatedToRemove !== negated;
154
- });
155
- this.isStringDirty = true;
156
- }
157
- }, {
158
- key: "addEntry",
159
- value: function addEntry(keyword, value, negated) {
160
- this.conditionArray.push({
161
- keyword,
162
- value,
163
- negated
164
- });
165
- this.isStringDirty = true;
166
- }
167
- }, {
168
- key: "removeEntry",
169
- value: function removeEntry(keyword, value, negated) {
170
- var index = this.conditionArray.findIndex(function(entry) {
171
- return entry.keyword === keyword && entry.value === value && entry.negated === negated;
172
- });
173
- if (index === -1)
174
- return;
175
- this.conditionArray.splice(index, 1);
176
- this.isStringDirty = true;
177
- }
178
- }, {
179
- key: "clone",
180
- value: function clone() {
181
- return new SearchString2(this.conditionArray.slice(0), this.textSegments.slice(0));
182
- }
183
- }, {
184
- key: "toString",
185
- value: function toString() {
186
- if (this.isStringDirty) {
187
- var conditionGroups = {};
188
- this.conditionArray.forEach(function(_ref3) {
189
- var { keyword, value, negated } = _ref3;
190
- var negatedStr = negated ? "-" : "";
191
- var conditionGroupKey = "" + negatedStr + keyword;
192
- if (conditionGroups[conditionGroupKey]) {
193
- conditionGroups[conditionGroupKey].push(value);
194
- } else {
195
- conditionGroups[conditionGroupKey] = [value];
196
- }
197
- });
198
- var conditionStr = "";
199
- Object.keys(conditionGroups).forEach(function(conditionGroupKey) {
200
- var values = conditionGroups[conditionGroupKey];
201
- var safeValues = values.filter(function(v) {
202
- return v;
203
- }).map(function(v) {
204
- var newV = "";
205
- var shouldQuote = false;
206
- for (var i = 0;i < v.length; i++) {
207
- var char = v[i];
208
- if (char === '"') {
209
- newV += "\\\"";
210
- } else {
211
- if (char === " " || char === ",") {
212
- shouldQuote = true;
213
- }
214
- newV += char;
215
- }
216
- }
217
- return shouldQuote ? '"' + newV + '"' : newV;
218
- });
219
- if (safeValues.length > 0) {
220
- conditionStr += " " + conditionGroupKey + ":" + safeValues.join(",");
221
- }
222
- });
223
- this.string = (conditionStr + " " + this.getAllText()).trim();
224
- this.isStringDirty = false;
225
- }
226
- return this.string;
227
- }
228
- }], [{
229
- key: "parse",
230
- value: function parse(str2) {
231
- var transformTextToConditions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
232
- if (!str2)
233
- str2 = "";
234
- var conditionArray = [];
235
- var textSegments = [];
236
- var addCondition = function addCondition(key, value, negated) {
237
- var arrayEntry = { keyword: key, value, negated };
238
- conditionArray.push(arrayEntry);
239
- };
240
- var addTextSegment = function addTextSegment(text, negated) {
241
- var hasTransform = false;
242
- transformTextToConditions.forEach(function(transform2) {
243
- var _transform2 = transform2(text), key = _transform2.key, value = _transform2.value;
244
- if (key && value) {
245
- addCondition(key, value, negated);
246
- hasTransform = true;
247
- }
248
- });
249
- if (!hasTransform) {
250
- textSegments.push({ text, negated });
251
- }
252
- };
253
- var state = undefined;
254
- var currentOperand = undefined;
255
- var isNegated = undefined;
256
- var currentText = undefined;
257
- var quoteState = undefined;
258
- var prevChar = undefined;
259
- var performReset = function performReset() {
260
- state = RESET;
261
- quoteState = RESET;
262
- currentOperand = "";
263
- currentText = "";
264
- isNegated = false;
265
- prevChar = "";
266
- };
267
- var inText = function inText() {
268
- return state === IN_TEXT;
269
- };
270
- var inOperand = function inOperand() {
271
- return state === IN_OPERAND;
272
- };
273
- var inSingleQuote = function inSingleQuote() {
274
- return quoteState === SINGLE_QUOTE;
275
- };
276
- var inDoubleQuote = function inDoubleQuote() {
277
- return quoteState === DOUBLE_QUOTE;
278
- };
279
- var inQuote = function inQuote() {
280
- return inSingleQuote() || inDoubleQuote();
281
- };
282
- performReset();
283
- var quotePairMap = getQuotePairMap(str2);
284
- for (var i = 0;i < str2.length; i++) {
285
- var char = str2[i];
286
- if (char === " ") {
287
- if (inOperand()) {
288
- if (inQuote()) {
289
- currentOperand += char;
290
- } else {
291
- addCondition(currentText, currentOperand, isNegated);
292
- performReset();
293
- }
294
- } else if (inText()) {
295
- if (inQuote()) {
296
- currentText += char;
297
- } else {
298
- addTextSegment(currentText, isNegated);
299
- performReset();
300
- }
301
- }
302
- } else if (char === "," && inOperand() && !inQuote()) {
303
- addCondition(currentText, currentOperand, isNegated);
304
- currentOperand = "";
305
- } else if (char === "-" && !inOperand() && !inText()) {
306
- isNegated = true;
307
- } else if (char === ":" && !inQuote()) {
308
- if (inOperand()) {
309
- currentOperand += char;
310
- } else if (inText()) {
311
- state = IN_OPERAND;
312
- }
313
- } else if (char === '"' && prevChar !== "\\" && !inSingleQuote()) {
314
- if (inDoubleQuote()) {
315
- quoteState = RESET;
316
- } else if (quotePairMap.double[i]) {
317
- quoteState = DOUBLE_QUOTE;
318
- } else if (inOperand()) {
319
- currentOperand += char;
320
- } else {
321
- currentText += char;
322
- }
323
- } else if (char === "'" && prevChar !== "\\" && !inDoubleQuote()) {
324
- if (inSingleQuote()) {
325
- quoteState = RESET;
326
- } else if (quotePairMap.single[i]) {
327
- quoteState = SINGLE_QUOTE;
328
- } else if (inOperand()) {
329
- currentOperand += char;
330
- } else {
331
- currentText += char;
332
- }
333
- } else if (char !== "\\") {
334
- if (inOperand()) {
335
- currentOperand += char;
336
- } else {
337
- currentText += char;
338
- state = IN_TEXT;
339
- }
340
- }
341
- prevChar = char;
342
- }
343
- if (inText()) {
344
- addTextSegment(currentText, isNegated);
345
- } else if (inOperand()) {
346
- addCondition(currentText, currentOperand, isNegated);
347
- }
348
- return new SearchString2(conditionArray, textSegments);
349
- }
350
- }]);
351
- return SearchString2;
352
- }();
353
- module.exports = SearchString;
354
- });
355
-
356
- // node_modules/kind-of/index.js
357
- var require_kind_of = __commonJS((exports, module) => {
358
- var toString = Object.prototype.toString;
359
- module.exports = function kindOf(val) {
360
- if (val === undefined)
361
- return "undefined";
362
- if (val === null)
363
- return "null";
364
- var type = typeof val;
365
- if (type === "boolean")
366
- return "boolean";
367
- if (type === "string")
368
- return "string";
369
- if (type === "number")
370
- return "number";
371
- if (type === "symbol")
372
- return "symbol";
373
- if (type === "function") {
374
- return isGeneratorFn(val) ? "generatorfunction" : "function";
375
- }
376
- if (isArray(val))
377
- return "array";
378
- if (isBuffer(val))
379
- return "buffer";
380
- if (isArguments(val))
381
- return "arguments";
382
- if (isDate(val))
383
- return "date";
384
- if (isError(val))
385
- return "error";
386
- if (isRegexp(val))
387
- return "regexp";
388
- switch (ctorName(val)) {
389
- case "Symbol":
390
- return "symbol";
391
- case "Promise":
392
- return "promise";
393
- case "WeakMap":
394
- return "weakmap";
395
- case "WeakSet":
396
- return "weakset";
397
- case "Map":
398
- return "map";
399
- case "Set":
400
- return "set";
401
- case "Int8Array":
402
- return "int8array";
403
- case "Uint8Array":
404
- return "uint8array";
405
- case "Uint8ClampedArray":
406
- return "uint8clampedarray";
407
- case "Int16Array":
408
- return "int16array";
409
- case "Uint16Array":
410
- return "uint16array";
411
- case "Int32Array":
412
- return "int32array";
413
- case "Uint32Array":
414
- return "uint32array";
415
- case "Float32Array":
416
- return "float32array";
417
- case "Float64Array":
418
- return "float64array";
419
- }
420
- if (isGeneratorObj(val)) {
421
- return "generator";
422
- }
423
- type = toString.call(val);
424
- switch (type) {
425
- case "[object Object]":
426
- return "object";
427
- case "[object Map Iterator]":
428
- return "mapiterator";
429
- case "[object Set Iterator]":
430
- return "setiterator";
431
- case "[object String Iterator]":
432
- return "stringiterator";
433
- case "[object Array Iterator]":
434
- return "arrayiterator";
435
- }
436
- return type.slice(8, -1).toLowerCase().replace(/\s/g, "");
437
- };
438
- function ctorName(val) {
439
- return typeof val.constructor === "function" ? val.constructor.name : null;
440
- }
441
- function isArray(val) {
442
- if (Array.isArray)
443
- return Array.isArray(val);
444
- return val instanceof Array;
445
- }
446
- function isError(val) {
447
- return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
448
- }
449
- function isDate(val) {
450
- if (val instanceof Date)
451
- return true;
452
- return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
453
- }
454
- function isRegexp(val) {
455
- if (val instanceof RegExp)
456
- return true;
457
- return typeof val.flags === "string" && typeof val.ignoreCase === "boolean" && typeof val.multiline === "boolean" && typeof val.global === "boolean";
458
- }
459
- function isGeneratorFn(name, val) {
460
- return ctorName(name) === "GeneratorFunction";
461
- }
462
- function isGeneratorObj(val) {
463
- return typeof val.throw === "function" && typeof val.return === "function" && typeof val.next === "function";
464
- }
465
- function isArguments(val) {
466
- try {
467
- if (typeof val.length === "number" && typeof val.callee === "function") {
468
- return true;
469
- }
470
- } catch (err) {
471
- if (err.message.indexOf("callee") !== -1) {
472
- return true;
473
- }
474
- }
475
- return false;
476
- }
477
- function isBuffer(val) {
478
- if (val.constructor && typeof val.constructor.isBuffer === "function") {
479
- return val.constructor.isBuffer(val);
480
- }
481
- return false;
482
- }
483
- });
484
-
485
- // node_modules/is-extendable/index.js
486
- var require_is_extendable = __commonJS((exports, module) => {
487
- /*!
488
- * is-extendable <https://github.com/jonschlinkert/is-extendable>
489
- *
490
- * Copyright (c) 2015, Jon Schlinkert.
491
- * Licensed under the MIT License.
492
- */
493
- module.exports = function isExtendable(val) {
494
- return typeof val !== "undefined" && val !== null && (typeof val === "object" || typeof val === "function");
495
- };
496
- });
497
-
498
- // node_modules/extend-shallow/index.js
499
- var require_extend_shallow = __commonJS((exports, module) => {
500
- var isObject2 = require_is_extendable();
501
- module.exports = function extend(o) {
502
- if (!isObject2(o)) {
503
- o = {};
504
- }
505
- var len = arguments.length;
506
- for (var i = 1;i < len; i++) {
507
- var obj = arguments[i];
508
- if (isObject2(obj)) {
509
- assign(o, obj);
510
- }
511
- }
512
- return o;
513
- };
514
- function assign(a, b) {
515
- for (var key in b) {
516
- if (hasOwn(b, key)) {
517
- a[key] = b[key];
518
- }
519
- }
520
- }
521
- function hasOwn(obj, key) {
522
- return Object.prototype.hasOwnProperty.call(obj, key);
523
- }
524
- });
525
-
526
- // node_modules/section-matter/index.js
527
- var require_section_matter = __commonJS((exports, module) => {
528
- var typeOf = require_kind_of();
529
- var extend2 = require_extend_shallow();
530
- module.exports = function(input, options2) {
531
- if (typeof options2 === "function") {
532
- options2 = { parse: options2 };
195
+ function hasOwn(obj, key) {
196
+ return Object.prototype.hasOwnProperty.call(obj, key);
197
+ }
198
+ });
199
+
200
+ // node_modules/section-matter/index.js
201
+ var require_section_matter = __commonJS((exports, module) => {
202
+ var typeOf = require_kind_of();
203
+ var extend2 = require_extend_shallow();
204
+ module.exports = function(input, options2) {
205
+ if (typeof options2 === "function") {
206
+ options2 = { parse: options2 };
533
207
  }
534
208
  var file2 = toObject(input);
535
209
  var defaults = { section_delimiter: "---", parse: identity };
@@ -3503,7 +3177,7 @@ var require_strip_bom_string = __commonJS((exports, module) => {
3503
3177
  });
3504
3178
 
3505
3179
  // node_modules/gray-matter/lib/utils.js
3506
- var require_utils2 = __commonJS((exports) => {
3180
+ var require_utils = __commonJS((exports) => {
3507
3181
  var stripBom = require_strip_bom_string();
3508
3182
  var typeOf = require_kind_of();
3509
3183
  exports.define = function(obj, key, val) {
@@ -3544,7 +3218,7 @@ var require_utils2 = __commonJS((exports) => {
3544
3218
  // node_modules/gray-matter/lib/defaults.js
3545
3219
  var require_defaults = __commonJS((exports, module) => {
3546
3220
  var engines = require_engines();
3547
- var utils = require_utils2();
3221
+ var utils = require_utils();
3548
3222
  module.exports = function(options2) {
3549
3223
  const opts = Object.assign({}, options2);
3550
3224
  opts.delimiters = utils.arrayify(opts.delims || opts.delimiters || "---");
@@ -3669,7 +3343,7 @@ var require_excerpt = __commonJS((exports, module) => {
3669
3343
  var require_to_file = __commonJS((exports, module) => {
3670
3344
  var typeOf = require_kind_of();
3671
3345
  var stringify = require_stringify();
3672
- var utils = require_utils2();
3346
+ var utils = require_utils();
3673
3347
  module.exports = function(file2) {
3674
3348
  if (typeOf(file2) !== "object") {
3675
3349
  file2 = { content: file2 };
@@ -3720,7 +3394,7 @@ var require_gray_matter = __commonJS((exports, module) => {
3720
3394
  var engines = require_engines();
3721
3395
  var toFile = require_to_file();
3722
3396
  var parse6 = require_parse();
3723
- var utils = require_utils2();
3397
+ var utils = require_utils();
3724
3398
  function matter(input, options2) {
3725
3399
  if (input === "") {
3726
3400
  return { data: {}, content: input, excerpt: "", orig: input };
@@ -3826,185 +3500,333 @@ var require_gray_matter = __commonJS((exports, module) => {
3826
3500
  module.exports = matter;
3827
3501
  });
3828
3502
 
3829
- // src/index.ts
3830
- import { join as join2 } from "path";
3831
-
3832
- // node_modules/env-paths/index.js
3833
- import path from "path";
3834
- import os from "os";
3835
- import process from "process";
3836
- var homedir = os.homedir();
3837
- var tmpdir = os.tmpdir();
3838
- var { env } = process;
3839
- var macos = (name) => {
3840
- const library = path.join(homedir, "Library");
3841
- return {
3842
- data: path.join(library, "Application Support", name),
3843
- config: path.join(library, "Preferences", name),
3844
- cache: path.join(library, "Caches", name),
3845
- log: path.join(library, "Logs", name),
3846
- temp: path.join(tmpdir, name)
3847
- };
3848
- };
3849
- var windows = (name) => {
3850
- const appData = env.APPDATA || path.join(homedir, "AppData", "Roaming");
3851
- const localAppData = env.LOCALAPPDATA || path.join(homedir, "AppData", "Local");
3852
- return {
3853
- data: path.join(localAppData, name, "Data"),
3854
- config: path.join(appData, name, "Config"),
3855
- cache: path.join(localAppData, name, "Cache"),
3856
- log: path.join(localAppData, name, "Log"),
3857
- temp: path.join(tmpdir, name)
3858
- };
3859
- };
3860
- var linux = (name) => {
3861
- const username = path.basename(homedir);
3862
- return {
3863
- data: path.join(env.XDG_DATA_HOME || path.join(homedir, ".local", "share"), name),
3864
- config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, ".config"), name),
3865
- cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, ".cache"), name),
3866
- log: path.join(env.XDG_STATE_HOME || path.join(homedir, ".local", "state"), name),
3867
- temp: path.join(tmpdir, username, name)
3868
- };
3869
- };
3870
- function envPaths(name, { suffix = "nodejs" } = {}) {
3871
- if (typeof name !== "string") {
3872
- throw new TypeError(`Expected a string, got ${typeof name}`);
3873
- }
3874
- if (suffix) {
3875
- name += `-${suffix}`;
3876
- }
3877
- if (process.platform === "darwin") {
3878
- return macos(name);
3879
- }
3880
- if (process.platform === "win32") {
3881
- return windows(name);
3882
- }
3883
- return linux(name);
3884
- }
3885
-
3886
- // node_modules/ramda/es/internal/_isPlaceholder.js
3887
- function _isPlaceholder(a) {
3888
- return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
3889
- }
3890
-
3891
- // node_modules/ramda/es/internal/_curry1.js
3892
- function _curry1(fn) {
3893
- return function f1(a) {
3894
- if (arguments.length === 0 || _isPlaceholder(a)) {
3895
- return f1;
3896
- } else {
3897
- return fn.apply(this, arguments);
3898
- }
3899
- };
3900
- }
3901
-
3902
- // node_modules/ramda/es/internal/_curry2.js
3903
- function _curry2(fn) {
3904
- return function f2(a, b) {
3905
- switch (arguments.length) {
3906
- case 0:
3907
- return f2;
3908
- case 1:
3909
- return _isPlaceholder(a) ? f2 : _curry1(function(_b) {
3910
- return fn(a, _b);
3911
- });
3912
- default:
3913
- return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function(_a) {
3914
- return fn(_a, b);
3915
- }) : _isPlaceholder(b) ? _curry1(function(_b) {
3916
- return fn(a, _b);
3917
- }) : fn(a, b);
3918
- }
3919
- };
3920
- }
3921
-
3922
- // node_modules/ramda/es/internal/_curry3.js
3923
- function _curry3(fn) {
3924
- return function f3(a, b, c) {
3925
- switch (arguments.length) {
3926
- case 0:
3927
- return f3;
3928
- case 1:
3929
- return _isPlaceholder(a) ? f3 : _curry2(function(_b, _c) {
3930
- return fn(a, _b, _c);
3931
- });
3932
- case 2:
3933
- return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function(_a, _c) {
3934
- return fn(_a, b, _c);
3935
- }) : _isPlaceholder(b) ? _curry2(function(_b, _c) {
3936
- return fn(a, _b, _c);
3937
- }) : _curry1(function(_c) {
3938
- return fn(a, b, _c);
3939
- });
3940
- default:
3941
- return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function(_a, _b) {
3942
- return fn(_a, _b, c);
3943
- }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function(_a, _c) {
3944
- return fn(_a, b, _c);
3945
- }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function(_b, _c) {
3946
- return fn(a, _b, _c);
3947
- }) : _isPlaceholder(a) ? _curry1(function(_a) {
3948
- return fn(_a, b, c);
3949
- }) : _isPlaceholder(b) ? _curry1(function(_b) {
3950
- return fn(a, _b, c);
3951
- }) : _isPlaceholder(c) ? _curry1(function(_c) {
3952
- return fn(a, b, _c);
3953
- }) : fn(a, b, c);
3954
- }
3955
- };
3956
- }
3957
-
3958
- // node_modules/ramda/es/internal/_has.js
3959
- function _has(prop, obj) {
3960
- return Object.prototype.hasOwnProperty.call(obj, prop);
3961
- }
3962
-
3963
- // node_modules/ramda/es/internal/_isObject.js
3964
- function _isObject(x) {
3965
- return Object.prototype.toString.call(x) === "[object Object]";
3966
- }
3967
-
3968
- // node_modules/ramda/es/mergeWithKey.js
3969
- var mergeWithKey = /* @__PURE__ */ _curry3(function mergeWithKey2(fn, l, r) {
3970
- var result = {};
3971
- var k;
3972
- l = l || {};
3973
- r = r || {};
3974
- for (k in l) {
3975
- if (_has(k, l)) {
3976
- result[k] = _has(k, r) ? fn(k, l[k], r[k]) : l[k];
3977
- }
3978
- }
3979
- for (k in r) {
3980
- if (_has(k, r) && !_has(k, result)) {
3981
- result[k] = r[k];
3503
+ // node_modules/search-string/dist/node/utils.js
3504
+ var require_utils2 = __commonJS((exports, module) => {
3505
+ function getQuotePairMap(str2) {
3506
+ if (!str2)
3507
+ str2 = "";
3508
+ var quotePairMap = { single: {}, double: {} };
3509
+ var prevQuote = { single: -1, double: -1 };
3510
+ var prevChar = "";
3511
+ for (var i = 0;i < str2.length; i++) {
3512
+ var char = str2[i];
3513
+ if (prevChar !== "\\") {
3514
+ if (char === '"') {
3515
+ if (prevQuote.double >= 0) {
3516
+ quotePairMap.double[prevQuote.double] = true;
3517
+ quotePairMap.double[i] = true;
3518
+ prevQuote.double = -1;
3519
+ } else {
3520
+ prevQuote.double = i;
3521
+ }
3522
+ } else if (char === "'") {
3523
+ if (prevQuote.single >= 0) {
3524
+ quotePairMap.single[prevQuote.single] = true;
3525
+ quotePairMap.single[i] = true;
3526
+ prevQuote.single = -1;
3527
+ } else {
3528
+ prevQuote.single = i;
3529
+ }
3530
+ }
3531
+ }
3532
+ prevChar = char;
3982
3533
  }
3534
+ return quotePairMap;
3983
3535
  }
3984
- return result;
3536
+ module.exports = {
3537
+ getQuotePairMap
3538
+ };
3985
3539
  });
3986
- var mergeWithKey_default = mergeWithKey;
3987
3540
 
3988
- // node_modules/ramda/es/mergeDeepWithKey.js
3989
- var mergeDeepWithKey = /* @__PURE__ */ _curry3(function mergeDeepWithKey2(fn, lObj, rObj) {
3990
- return mergeWithKey_default(function(k, lVal, rVal) {
3991
- if (_isObject(lVal) && _isObject(rVal)) {
3992
- return mergeDeepWithKey2(fn, lVal, rVal);
3993
- } else {
3994
- return fn(k, lVal, rVal);
3541
+ // node_modules/search-string/dist/node/searchString.js
3542
+ var require_searchString = __commonJS((exports, module) => {
3543
+ var _createClass = function() {
3544
+ function defineProperties(target, props) {
3545
+ for (var i = 0;i < props.length; i++) {
3546
+ var descriptor = props[i];
3547
+ descriptor.enumerable = descriptor.enumerable || false;
3548
+ descriptor.configurable = true;
3549
+ if ("value" in descriptor)
3550
+ descriptor.writable = true;
3551
+ Object.defineProperty(target, descriptor.key, descriptor);
3552
+ }
3995
3553
  }
3996
- }, lObj, rObj);
3554
+ return function(Constructor, protoProps, staticProps) {
3555
+ if (protoProps)
3556
+ defineProperties(Constructor.prototype, protoProps);
3557
+ if (staticProps)
3558
+ defineProperties(Constructor, staticProps);
3559
+ return Constructor;
3560
+ };
3561
+ }();
3562
+ function _classCallCheck(instance, Constructor) {
3563
+ if (!(instance instanceof Constructor)) {
3564
+ throw new TypeError("Cannot call a class as a function");
3565
+ }
3566
+ }
3567
+ var _require = require_utils2();
3568
+ var getQuotePairMap = _require.getQuotePairMap;
3569
+ var RESET = "RESET";
3570
+ var IN_OPERAND = "IN_OPERAND";
3571
+ var IN_TEXT = "IN_TEXT";
3572
+ var SINGLE_QUOTE = "SINGLE_QUOTE";
3573
+ var DOUBLE_QUOTE = "DOUBLE_QUOTE";
3574
+ var SearchString = function() {
3575
+ function SearchString2(conditionArray, textSegments) {
3576
+ _classCallCheck(this, SearchString2);
3577
+ this.conditionArray = conditionArray;
3578
+ this.textSegments = textSegments;
3579
+ this.string = "";
3580
+ this.isStringDirty = true;
3581
+ }
3582
+ _createClass(SearchString2, [{
3583
+ key: "getConditionArray",
3584
+ value: function getConditionArray() {
3585
+ return this.conditionArray;
3586
+ }
3587
+ }, {
3588
+ key: "getParsedQuery",
3589
+ value: function getParsedQuery() {
3590
+ var parsedQuery = { exclude: {} };
3591
+ this.conditionArray.forEach(function(condition) {
3592
+ if (condition.negated) {
3593
+ if (parsedQuery.exclude[condition.keyword]) {
3594
+ parsedQuery.exclude[condition.keyword].push(condition.value);
3595
+ } else {
3596
+ parsedQuery.exclude[condition.keyword] = [condition.value];
3597
+ }
3598
+ } else {
3599
+ if (parsedQuery[condition.keyword]) {
3600
+ parsedQuery[condition.keyword].push(condition.value);
3601
+ } else {
3602
+ parsedQuery[condition.keyword] = [condition.value];
3603
+ }
3604
+ }
3605
+ });
3606
+ return parsedQuery;
3607
+ }
3608
+ }, {
3609
+ key: "getAllText",
3610
+ value: function getAllText() {
3611
+ return this.textSegments ? this.textSegments.map(function(_ref) {
3612
+ var { text, negated } = _ref;
3613
+ return negated ? "-" + text : text;
3614
+ }).join(" ") : "";
3615
+ }
3616
+ }, {
3617
+ key: "getTextSegments",
3618
+ value: function getTextSegments() {
3619
+ return this.textSegments;
3620
+ }
3621
+ }, {
3622
+ key: "removeKeyword",
3623
+ value: function removeKeyword(keywordToRemove, negatedToRemove) {
3624
+ this.conditionArray = this.conditionArray.filter(function(_ref2) {
3625
+ var { keyword, negated } = _ref2;
3626
+ return keywordToRemove !== keyword || negatedToRemove !== negated;
3627
+ });
3628
+ this.isStringDirty = true;
3629
+ }
3630
+ }, {
3631
+ key: "addEntry",
3632
+ value: function addEntry(keyword, value, negated) {
3633
+ this.conditionArray.push({
3634
+ keyword,
3635
+ value,
3636
+ negated
3637
+ });
3638
+ this.isStringDirty = true;
3639
+ }
3640
+ }, {
3641
+ key: "removeEntry",
3642
+ value: function removeEntry(keyword, value, negated) {
3643
+ var index = this.conditionArray.findIndex(function(entry) {
3644
+ return entry.keyword === keyword && entry.value === value && entry.negated === negated;
3645
+ });
3646
+ if (index === -1)
3647
+ return;
3648
+ this.conditionArray.splice(index, 1);
3649
+ this.isStringDirty = true;
3650
+ }
3651
+ }, {
3652
+ key: "clone",
3653
+ value: function clone() {
3654
+ return new SearchString2(this.conditionArray.slice(0), this.textSegments.slice(0));
3655
+ }
3656
+ }, {
3657
+ key: "toString",
3658
+ value: function toString() {
3659
+ if (this.isStringDirty) {
3660
+ var conditionGroups = {};
3661
+ this.conditionArray.forEach(function(_ref3) {
3662
+ var { keyword, value, negated } = _ref3;
3663
+ var negatedStr = negated ? "-" : "";
3664
+ var conditionGroupKey = "" + negatedStr + keyword;
3665
+ if (conditionGroups[conditionGroupKey]) {
3666
+ conditionGroups[conditionGroupKey].push(value);
3667
+ } else {
3668
+ conditionGroups[conditionGroupKey] = [value];
3669
+ }
3670
+ });
3671
+ var conditionStr = "";
3672
+ Object.keys(conditionGroups).forEach(function(conditionGroupKey) {
3673
+ var values = conditionGroups[conditionGroupKey];
3674
+ var safeValues = values.filter(function(v) {
3675
+ return v;
3676
+ }).map(function(v) {
3677
+ var newV = "";
3678
+ var shouldQuote = false;
3679
+ for (var i = 0;i < v.length; i++) {
3680
+ var char = v[i];
3681
+ if (char === '"') {
3682
+ newV += "\\\"";
3683
+ } else {
3684
+ if (char === " " || char === ",") {
3685
+ shouldQuote = true;
3686
+ }
3687
+ newV += char;
3688
+ }
3689
+ }
3690
+ return shouldQuote ? '"' + newV + '"' : newV;
3691
+ });
3692
+ if (safeValues.length > 0) {
3693
+ conditionStr += " " + conditionGroupKey + ":" + safeValues.join(",");
3694
+ }
3695
+ });
3696
+ this.string = (conditionStr + " " + this.getAllText()).trim();
3697
+ this.isStringDirty = false;
3698
+ }
3699
+ return this.string;
3700
+ }
3701
+ }], [{
3702
+ key: "parse",
3703
+ value: function parse(str2) {
3704
+ var transformTextToConditions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3705
+ if (!str2)
3706
+ str2 = "";
3707
+ var conditionArray = [];
3708
+ var textSegments = [];
3709
+ var addCondition = function addCondition(key, value, negated) {
3710
+ var arrayEntry = { keyword: key, value, negated };
3711
+ conditionArray.push(arrayEntry);
3712
+ };
3713
+ var addTextSegment = function addTextSegment(text, negated) {
3714
+ var hasTransform = false;
3715
+ transformTextToConditions.forEach(function(transform2) {
3716
+ var _transform2 = transform2(text), key = _transform2.key, value = _transform2.value;
3717
+ if (key && value) {
3718
+ addCondition(key, value, negated);
3719
+ hasTransform = true;
3720
+ }
3721
+ });
3722
+ if (!hasTransform) {
3723
+ textSegments.push({ text, negated });
3724
+ }
3725
+ };
3726
+ var state = undefined;
3727
+ var currentOperand = undefined;
3728
+ var isNegated = undefined;
3729
+ var currentText = undefined;
3730
+ var quoteState = undefined;
3731
+ var prevChar = undefined;
3732
+ var performReset = function performReset() {
3733
+ state = RESET;
3734
+ quoteState = RESET;
3735
+ currentOperand = "";
3736
+ currentText = "";
3737
+ isNegated = false;
3738
+ prevChar = "";
3739
+ };
3740
+ var inText = function inText() {
3741
+ return state === IN_TEXT;
3742
+ };
3743
+ var inOperand = function inOperand() {
3744
+ return state === IN_OPERAND;
3745
+ };
3746
+ var inSingleQuote = function inSingleQuote() {
3747
+ return quoteState === SINGLE_QUOTE;
3748
+ };
3749
+ var inDoubleQuote = function inDoubleQuote() {
3750
+ return quoteState === DOUBLE_QUOTE;
3751
+ };
3752
+ var inQuote = function inQuote() {
3753
+ return inSingleQuote() || inDoubleQuote();
3754
+ };
3755
+ performReset();
3756
+ var quotePairMap = getQuotePairMap(str2);
3757
+ for (var i = 0;i < str2.length; i++) {
3758
+ var char = str2[i];
3759
+ if (char === " ") {
3760
+ if (inOperand()) {
3761
+ if (inQuote()) {
3762
+ currentOperand += char;
3763
+ } else {
3764
+ addCondition(currentText, currentOperand, isNegated);
3765
+ performReset();
3766
+ }
3767
+ } else if (inText()) {
3768
+ if (inQuote()) {
3769
+ currentText += char;
3770
+ } else {
3771
+ addTextSegment(currentText, isNegated);
3772
+ performReset();
3773
+ }
3774
+ }
3775
+ } else if (char === "," && inOperand() && !inQuote()) {
3776
+ addCondition(currentText, currentOperand, isNegated);
3777
+ currentOperand = "";
3778
+ } else if (char === "-" && !inOperand() && !inText()) {
3779
+ isNegated = true;
3780
+ } else if (char === ":" && !inQuote()) {
3781
+ if (inOperand()) {
3782
+ currentOperand += char;
3783
+ } else if (inText()) {
3784
+ state = IN_OPERAND;
3785
+ }
3786
+ } else if (char === '"' && prevChar !== "\\" && !inSingleQuote()) {
3787
+ if (inDoubleQuote()) {
3788
+ quoteState = RESET;
3789
+ } else if (quotePairMap.double[i]) {
3790
+ quoteState = DOUBLE_QUOTE;
3791
+ } else if (inOperand()) {
3792
+ currentOperand += char;
3793
+ } else {
3794
+ currentText += char;
3795
+ }
3796
+ } else if (char === "'" && prevChar !== "\\" && !inDoubleQuote()) {
3797
+ if (inSingleQuote()) {
3798
+ quoteState = RESET;
3799
+ } else if (quotePairMap.single[i]) {
3800
+ quoteState = SINGLE_QUOTE;
3801
+ } else if (inOperand()) {
3802
+ currentOperand += char;
3803
+ } else {
3804
+ currentText += char;
3805
+ }
3806
+ } else if (char !== "\\") {
3807
+ if (inOperand()) {
3808
+ currentOperand += char;
3809
+ } else {
3810
+ currentText += char;
3811
+ state = IN_TEXT;
3812
+ }
3813
+ }
3814
+ prevChar = char;
3815
+ }
3816
+ if (inText()) {
3817
+ addTextSegment(currentText, isNegated);
3818
+ } else if (inOperand()) {
3819
+ addCondition(currentText, currentOperand, isNegated);
3820
+ }
3821
+ return new SearchString2(conditionArray, textSegments);
3822
+ }
3823
+ }]);
3824
+ return SearchString2;
3825
+ }();
3826
+ module.exports = SearchString;
3997
3827
  });
3998
- var mergeDeepWithKey_default = mergeDeepWithKey;
3999
3828
 
4000
- // node_modules/ramda/es/mergeDeepLeft.js
4001
- var mergeDeepLeft = /* @__PURE__ */ _curry2(function mergeDeepLeft2(lObj, rObj) {
4002
- return mergeDeepWithKey_default(function(k, lVal, rVal) {
4003
- return lVal;
4004
- }, lObj, rObj);
4005
- });
4006
- var mergeDeepLeft_default = mergeDeepLeft;
4007
- // node_modules/zod/v4/classic/external.js
3829
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/external.js
4008
3830
  var exports_external = {};
4009
3831
  __export(exports_external, {
4010
3832
  xid: () => xid2,
@@ -4234,7 +4056,7 @@ __export(exports_external, {
4234
4056
  $brand: () => $brand
4235
4057
  });
4236
4058
 
4237
- // node_modules/zod/v4/core/index.js
4059
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/index.js
4238
4060
  var exports_core2 = {};
4239
4061
  __export(exports_core2, {
4240
4062
  version: () => version,
@@ -4498,7 +4320,7 @@ __export(exports_core2, {
4498
4320
  $ZodAny: () => $ZodAny
4499
4321
  });
4500
4322
 
4501
- // node_modules/zod/v4/core/core.js
4323
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/core.js
4502
4324
  var NEVER = Object.freeze({
4503
4325
  status: "aborted"
4504
4326
  });
@@ -4565,7 +4387,7 @@ function config(newConfig) {
4565
4387
  Object.assign(globalConfig, newConfig);
4566
4388
  return globalConfig;
4567
4389
  }
4568
- // node_modules/zod/v4/core/util.js
4390
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/util.js
4569
4391
  var exports_util = {};
4570
4392
  __export(exports_util, {
4571
4393
  unwrapMessage: () => unwrapMessage,
@@ -4733,10 +4555,10 @@ function mergeDefs(...defs) {
4733
4555
  function cloneDef(schema) {
4734
4556
  return mergeDefs(schema._zod.def);
4735
4557
  }
4736
- function getElementAtPath(obj, path2) {
4737
- if (!path2)
4558
+ function getElementAtPath(obj, path) {
4559
+ if (!path)
4738
4560
  return obj;
4739
- return path2.reduce((acc, key) => acc?.[key], obj);
4561
+ return path.reduce((acc, key) => acc?.[key], obj);
4740
4562
  }
4741
4563
  function promiseAllObject(promisesObj) {
4742
4564
  const keys = Object.keys(promisesObj);
@@ -5095,11 +4917,11 @@ function aborted(x, startIndex = 0) {
5095
4917
  }
5096
4918
  return false;
5097
4919
  }
5098
- function prefixIssues(path2, issues) {
4920
+ function prefixIssues(path, issues) {
5099
4921
  return issues.map((iss) => {
5100
4922
  var _a;
5101
4923
  (_a = iss).path ?? (_a.path = []);
5102
- iss.path.unshift(path2);
4924
+ iss.path.unshift(path);
5103
4925
  return iss;
5104
4926
  });
5105
4927
  }
@@ -5194,7 +5016,7 @@ class Class {
5194
5016
  constructor(..._args) {}
5195
5017
  }
5196
5018
 
5197
- // node_modules/zod/v4/core/errors.js
5019
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/errors.js
5198
5020
  var initializer = (inst, def) => {
5199
5021
  inst.name = "$ZodError";
5200
5022
  Object.defineProperty(inst, "_zod", {
@@ -5267,7 +5089,7 @@ function treeifyError(error, _mapper) {
5267
5089
  return issue2.message;
5268
5090
  };
5269
5091
  const result = { errors: [] };
5270
- const processError = (error2, path2 = []) => {
5092
+ const processError = (error2, path = []) => {
5271
5093
  var _a, _b;
5272
5094
  for (const issue2 of error2.issues) {
5273
5095
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -5277,7 +5099,7 @@ function treeifyError(error, _mapper) {
5277
5099
  } else if (issue2.code === "invalid_element") {
5278
5100
  processError({ issues: issue2.issues }, issue2.path);
5279
5101
  } else {
5280
- const fullpath = [...path2, ...issue2.path];
5102
+ const fullpath = [...path, ...issue2.path];
5281
5103
  if (fullpath.length === 0) {
5282
5104
  result.errors.push(mapper(issue2));
5283
5105
  continue;
@@ -5309,8 +5131,8 @@ function treeifyError(error, _mapper) {
5309
5131
  }
5310
5132
  function toDotPath(_path) {
5311
5133
  const segs = [];
5312
- const path2 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
5313
- for (const seg of path2) {
5134
+ const path = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
5135
+ for (const seg of path) {
5314
5136
  if (typeof seg === "number")
5315
5137
  segs.push(`[${seg}]`);
5316
5138
  else if (typeof seg === "symbol")
@@ -5337,7 +5159,7 @@ function prettifyError(error) {
5337
5159
  `);
5338
5160
  }
5339
5161
 
5340
- // node_modules/zod/v4/core/parse.js
5162
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/parse.js
5341
5163
  var _parse = (_Err) => (schema, value, _ctx, _params) => {
5342
5164
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
5343
5165
  const result = schema._zod.run({ value, issues: [] }, ctx);
@@ -5424,7 +5246,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
5424
5246
  return _safeParseAsync(_Err)(schema, value, _ctx);
5425
5247
  };
5426
5248
  var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
5427
- // node_modules/zod/v4/core/regexes.js
5249
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/regexes.js
5428
5250
  var exports_regexes = {};
5429
5251
  __export(exports_regexes, {
5430
5252
  xid: () => xid,
@@ -5576,7 +5398,7 @@ var sha512_hex = /^[0-9a-fA-F]{128}$/;
5576
5398
  var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
5577
5399
  var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
5578
5400
 
5579
- // node_modules/zod/v4/core/checks.js
5401
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/checks.js
5580
5402
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
5581
5403
  var _a;
5582
5404
  inst._zod ?? (inst._zod = {});
@@ -6117,7 +5939,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
6117
5939
  };
6118
5940
  });
6119
5941
 
6120
- // node_modules/zod/v4/core/doc.js
5942
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/doc.js
6121
5943
  class Doc {
6122
5944
  constructor(args = []) {
6123
5945
  this.content = [];
@@ -6155,14 +5977,14 @@ class Doc {
6155
5977
  }
6156
5978
  }
6157
5979
 
6158
- // node_modules/zod/v4/core/versions.js
5980
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/versions.js
6159
5981
  var version = {
6160
5982
  major: 4,
6161
5983
  minor: 1,
6162
5984
  patch: 8
6163
5985
  };
6164
5986
 
6165
- // node_modules/zod/v4/core/schemas.js
5987
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/schemas.js
6166
5988
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
6167
5989
  var _a;
6168
5990
  inst ?? (inst = {});
@@ -7985,7 +7807,7 @@ function handleRefineResult(result, payload, input, inst) {
7985
7807
  payload.issues.push(issue(_iss));
7986
7808
  }
7987
7809
  }
7988
- // node_modules/zod/v4/locales/index.js
7810
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/index.js
7989
7811
  var exports_locales = {};
7990
7812
  __export(exports_locales, {
7991
7813
  zhTW: () => zh_TW_default,
@@ -8036,7 +7858,7 @@ __export(exports_locales, {
8036
7858
  ar: () => ar_default
8037
7859
  });
8038
7860
 
8039
- // node_modules/zod/v4/locales/ar.js
7861
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ar.js
8040
7862
  var error = () => {
8041
7863
  const Sizable = {
8042
7864
  string: { unit: "\u062D\u0631\u0641", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
@@ -8152,7 +7974,7 @@ function ar_default() {
8152
7974
  localeError: error()
8153
7975
  };
8154
7976
  }
8155
- // node_modules/zod/v4/locales/az.js
7977
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/az.js
8156
7978
  var error2 = () => {
8157
7979
  const Sizable = {
8158
7980
  string: { unit: "simvol", verb: "olmal\u0131d\u0131r" },
@@ -8267,7 +8089,7 @@ function az_default() {
8267
8089
  localeError: error2()
8268
8090
  };
8269
8091
  }
8270
- // node_modules/zod/v4/locales/be.js
8092
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/be.js
8271
8093
  function getBelarusianPlural(count, one, few, many) {
8272
8094
  const absCount = Math.abs(count);
8273
8095
  const lastDigit = absCount % 10;
@@ -8431,7 +8253,7 @@ function be_default() {
8431
8253
  localeError: error3()
8432
8254
  };
8433
8255
  }
8434
- // node_modules/zod/v4/locales/ca.js
8256
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ca.js
8435
8257
  var error4 = () => {
8436
8258
  const Sizable = {
8437
8259
  string: { unit: "car\xE0cters", verb: "contenir" },
@@ -8548,7 +8370,7 @@ function ca_default() {
8548
8370
  localeError: error4()
8549
8371
  };
8550
8372
  }
8551
- // node_modules/zod/v4/locales/cs.js
8373
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/cs.js
8552
8374
  var error5 = () => {
8553
8375
  const Sizable = {
8554
8376
  string: { unit: "znak\u016F", verb: "m\xEDt" },
@@ -8683,7 +8505,7 @@ function cs_default() {
8683
8505
  localeError: error5()
8684
8506
  };
8685
8507
  }
8686
- // node_modules/zod/v4/locales/da.js
8508
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/da.js
8687
8509
  var error6 = () => {
8688
8510
  const Sizable = {
8689
8511
  string: { unit: "tegn", verb: "havde" },
@@ -8814,7 +8636,7 @@ function da_default() {
8814
8636
  localeError: error6()
8815
8637
  };
8816
8638
  }
8817
- // node_modules/zod/v4/locales/de.js
8639
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/de.js
8818
8640
  var error7 = () => {
8819
8641
  const Sizable = {
8820
8642
  string: { unit: "Zeichen", verb: "zu haben" },
@@ -8930,7 +8752,7 @@ function de_default() {
8930
8752
  localeError: error7()
8931
8753
  };
8932
8754
  }
8933
- // node_modules/zod/v4/locales/en.js
8755
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/en.js
8934
8756
  var parsedType = (data) => {
8935
8757
  const t = typeof data;
8936
8758
  switch (t) {
@@ -9047,7 +8869,7 @@ function en_default() {
9047
8869
  localeError: error8()
9048
8870
  };
9049
8871
  }
9050
- // node_modules/zod/v4/locales/eo.js
8872
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/eo.js
9051
8873
  var parsedType2 = (data) => {
9052
8874
  const t = typeof data;
9053
8875
  switch (t) {
@@ -9163,7 +8985,7 @@ function eo_default() {
9163
8985
  localeError: error9()
9164
8986
  };
9165
8987
  }
9166
- // node_modules/zod/v4/locales/es.js
8988
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/es.js
9167
8989
  var error10 = () => {
9168
8990
  const Sizable = {
9169
8991
  string: { unit: "caracteres", verb: "tener" },
@@ -9311,7 +9133,7 @@ function es_default() {
9311
9133
  localeError: error10()
9312
9134
  };
9313
9135
  }
9314
- // node_modules/zod/v4/locales/fa.js
9136
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/fa.js
9315
9137
  var error11 = () => {
9316
9138
  const Sizable = {
9317
9139
  string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
@@ -9433,7 +9255,7 @@ function fa_default() {
9433
9255
  localeError: error11()
9434
9256
  };
9435
9257
  }
9436
- // node_modules/zod/v4/locales/fi.js
9258
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/fi.js
9437
9259
  var error12 = () => {
9438
9260
  const Sizable = {
9439
9261
  string: { unit: "merkki\xE4", subject: "merkkijonon" },
@@ -9555,7 +9377,7 @@ function fi_default() {
9555
9377
  localeError: error12()
9556
9378
  };
9557
9379
  }
9558
- // node_modules/zod/v4/locales/fr.js
9380
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/fr.js
9559
9381
  var error13 = () => {
9560
9382
  const Sizable = {
9561
9383
  string: { unit: "caract\xE8res", verb: "avoir" },
@@ -9671,7 +9493,7 @@ function fr_default() {
9671
9493
  localeError: error13()
9672
9494
  };
9673
9495
  }
9674
- // node_modules/zod/v4/locales/fr-CA.js
9496
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/fr-CA.js
9675
9497
  var error14 = () => {
9676
9498
  const Sizable = {
9677
9499
  string: { unit: "caract\xE8res", verb: "avoir" },
@@ -9788,7 +9610,7 @@ function fr_CA_default() {
9788
9610
  localeError: error14()
9789
9611
  };
9790
9612
  }
9791
- // node_modules/zod/v4/locales/he.js
9613
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/he.js
9792
9614
  var error15 = () => {
9793
9615
  const Sizable = {
9794
9616
  string: { unit: "\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA", verb: "\u05DC\u05DB\u05DC\u05D5\u05DC" },
@@ -9904,7 +9726,7 @@ function he_default() {
9904
9726
  localeError: error15()
9905
9727
  };
9906
9728
  }
9907
- // node_modules/zod/v4/locales/hu.js
9729
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/hu.js
9908
9730
  var error16 = () => {
9909
9731
  const Sizable = {
9910
9732
  string: { unit: "karakter", verb: "legyen" },
@@ -10020,7 +9842,7 @@ function hu_default() {
10020
9842
  localeError: error16()
10021
9843
  };
10022
9844
  }
10023
- // node_modules/zod/v4/locales/id.js
9845
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/id.js
10024
9846
  var error17 = () => {
10025
9847
  const Sizable = {
10026
9848
  string: { unit: "karakter", verb: "memiliki" },
@@ -10136,7 +9958,7 @@ function id_default() {
10136
9958
  localeError: error17()
10137
9959
  };
10138
9960
  }
10139
- // node_modules/zod/v4/locales/is.js
9961
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/is.js
10140
9962
  var parsedType3 = (data) => {
10141
9963
  const t = typeof data;
10142
9964
  switch (t) {
@@ -10253,7 +10075,7 @@ function is_default() {
10253
10075
  localeError: error18()
10254
10076
  };
10255
10077
  }
10256
- // node_modules/zod/v4/locales/it.js
10078
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/it.js
10257
10079
  var error19 = () => {
10258
10080
  const Sizable = {
10259
10081
  string: { unit: "caratteri", verb: "avere" },
@@ -10369,7 +10191,7 @@ function it_default() {
10369
10191
  localeError: error19()
10370
10192
  };
10371
10193
  }
10372
- // node_modules/zod/v4/locales/ja.js
10194
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ja.js
10373
10195
  var error20 = () => {
10374
10196
  const Sizable = {
10375
10197
  string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
@@ -10484,7 +10306,7 @@ function ja_default() {
10484
10306
  localeError: error20()
10485
10307
  };
10486
10308
  }
10487
- // node_modules/zod/v4/locales/ka.js
10309
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ka.js
10488
10310
  var parsedType4 = (data) => {
10489
10311
  const t = typeof data;
10490
10312
  switch (t) {
@@ -10609,7 +10431,7 @@ function ka_default() {
10609
10431
  localeError: error21()
10610
10432
  };
10611
10433
  }
10612
- // node_modules/zod/v4/locales/km.js
10434
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/km.js
10613
10435
  var error22 = () => {
10614
10436
  const Sizable = {
10615
10437
  string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
@@ -10727,11 +10549,11 @@ function km_default() {
10727
10549
  };
10728
10550
  }
10729
10551
 
10730
- // node_modules/zod/v4/locales/kh.js
10552
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/kh.js
10731
10553
  function kh_default() {
10732
10554
  return km_default();
10733
10555
  }
10734
- // node_modules/zod/v4/locales/ko.js
10556
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ko.js
10735
10557
  var error23 = () => {
10736
10558
  const Sizable = {
10737
10559
  string: { unit: "\uBB38\uC790", verb: "to have" },
@@ -10852,7 +10674,7 @@ function ko_default() {
10852
10674
  localeError: error23()
10853
10675
  };
10854
10676
  }
10855
- // node_modules/zod/v4/locales/lt.js
10677
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/lt.js
10856
10678
  var parsedType5 = (data) => {
10857
10679
  const t = typeof data;
10858
10680
  return parsedTypeFromType(t, data);
@@ -11081,7 +10903,7 @@ function lt_default() {
11081
10903
  localeError: error24()
11082
10904
  };
11083
10905
  }
11084
- // node_modules/zod/v4/locales/mk.js
10906
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/mk.js
11085
10907
  var error25 = () => {
11086
10908
  const Sizable = {
11087
10909
  string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
@@ -11198,7 +11020,7 @@ function mk_default() {
11198
11020
  localeError: error25()
11199
11021
  };
11200
11022
  }
11201
- // node_modules/zod/v4/locales/ms.js
11023
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ms.js
11202
11024
  var error26 = () => {
11203
11025
  const Sizable = {
11204
11026
  string: { unit: "aksara", verb: "mempunyai" },
@@ -11314,7 +11136,7 @@ function ms_default() {
11314
11136
  localeError: error26()
11315
11137
  };
11316
11138
  }
11317
- // node_modules/zod/v4/locales/nl.js
11139
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/nl.js
11318
11140
  var error27 = () => {
11319
11141
  const Sizable = {
11320
11142
  string: { unit: "tekens" },
@@ -11431,7 +11253,7 @@ function nl_default() {
11431
11253
  localeError: error27()
11432
11254
  };
11433
11255
  }
11434
- // node_modules/zod/v4/locales/no.js
11256
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/no.js
11435
11257
  var error28 = () => {
11436
11258
  const Sizable = {
11437
11259
  string: { unit: "tegn", verb: "\xE5 ha" },
@@ -11547,7 +11369,7 @@ function no_default() {
11547
11369
  localeError: error28()
11548
11370
  };
11549
11371
  }
11550
- // node_modules/zod/v4/locales/ota.js
11372
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ota.js
11551
11373
  var error29 = () => {
11552
11374
  const Sizable = {
11553
11375
  string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
@@ -11663,7 +11485,7 @@ function ota_default() {
11663
11485
  localeError: error29()
11664
11486
  };
11665
11487
  }
11666
- // node_modules/zod/v4/locales/ps.js
11488
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ps.js
11667
11489
  var error30 = () => {
11668
11490
  const Sizable = {
11669
11491
  string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
@@ -11785,7 +11607,7 @@ function ps_default() {
11785
11607
  localeError: error30()
11786
11608
  };
11787
11609
  }
11788
- // node_modules/zod/v4/locales/pl.js
11610
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/pl.js
11789
11611
  var error31 = () => {
11790
11612
  const Sizable = {
11791
11613
  string: { unit: "znak\xF3w", verb: "mie\u0107" },
@@ -11902,7 +11724,7 @@ function pl_default() {
11902
11724
  localeError: error31()
11903
11725
  };
11904
11726
  }
11905
- // node_modules/zod/v4/locales/pt.js
11727
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/pt.js
11906
11728
  var error32 = () => {
11907
11729
  const Sizable = {
11908
11730
  string: { unit: "caracteres", verb: "ter" },
@@ -12018,7 +11840,7 @@ function pt_default() {
12018
11840
  localeError: error32()
12019
11841
  };
12020
11842
  }
12021
- // node_modules/zod/v4/locales/ru.js
11843
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ru.js
12022
11844
  function getRussianPlural(count, one, few, many) {
12023
11845
  const absCount = Math.abs(count);
12024
11846
  const lastDigit = absCount % 10;
@@ -12182,7 +12004,7 @@ function ru_default() {
12182
12004
  localeError: error33()
12183
12005
  };
12184
12006
  }
12185
- // node_modules/zod/v4/locales/sl.js
12007
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/sl.js
12186
12008
  var error34 = () => {
12187
12009
  const Sizable = {
12188
12010
  string: { unit: "znakov", verb: "imeti" },
@@ -12299,7 +12121,7 @@ function sl_default() {
12299
12121
  localeError: error34()
12300
12122
  };
12301
12123
  }
12302
- // node_modules/zod/v4/locales/sv.js
12124
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/sv.js
12303
12125
  var error35 = () => {
12304
12126
  const Sizable = {
12305
12127
  string: { unit: "tecken", verb: "att ha" },
@@ -12417,7 +12239,7 @@ function sv_default() {
12417
12239
  localeError: error35()
12418
12240
  };
12419
12241
  }
12420
- // node_modules/zod/v4/locales/ta.js
12242
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ta.js
12421
12243
  var error36 = () => {
12422
12244
  const Sizable = {
12423
12245
  string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
@@ -12534,7 +12356,7 @@ function ta_default() {
12534
12356
  localeError: error36()
12535
12357
  };
12536
12358
  }
12537
- // node_modules/zod/v4/locales/th.js
12359
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/th.js
12538
12360
  var error37 = () => {
12539
12361
  const Sizable = {
12540
12362
  string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
@@ -12651,7 +12473,7 @@ function th_default() {
12651
12473
  localeError: error37()
12652
12474
  };
12653
12475
  }
12654
- // node_modules/zod/v4/locales/tr.js
12476
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/tr.js
12655
12477
  var parsedType6 = (data) => {
12656
12478
  const t = typeof data;
12657
12479
  switch (t) {
@@ -12766,7 +12588,7 @@ function tr_default() {
12766
12588
  localeError: error38()
12767
12589
  };
12768
12590
  }
12769
- // node_modules/zod/v4/locales/uk.js
12591
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/uk.js
12770
12592
  var error39 = () => {
12771
12593
  const Sizable = {
12772
12594
  string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
@@ -12883,11 +12705,11 @@ function uk_default() {
12883
12705
  };
12884
12706
  }
12885
12707
 
12886
- // node_modules/zod/v4/locales/ua.js
12708
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ua.js
12887
12709
  function ua_default() {
12888
12710
  return uk_default();
12889
12711
  }
12890
- // node_modules/zod/v4/locales/ur.js
12712
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ur.js
12891
12713
  var error40 = () => {
12892
12714
  const Sizable = {
12893
12715
  string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
@@ -13004,7 +12826,7 @@ function ur_default() {
13004
12826
  localeError: error40()
13005
12827
  };
13006
12828
  }
13007
- // node_modules/zod/v4/locales/vi.js
12829
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/vi.js
13008
12830
  var error41 = () => {
13009
12831
  const Sizable = {
13010
12832
  string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
@@ -13120,7 +12942,7 @@ function vi_default() {
13120
12942
  localeError: error41()
13121
12943
  };
13122
12944
  }
13123
- // node_modules/zod/v4/locales/zh-CN.js
12945
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/zh-CN.js
13124
12946
  var error42 = () => {
13125
12947
  const Sizable = {
13126
12948
  string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
@@ -13236,7 +13058,7 @@ function zh_CN_default() {
13236
13058
  localeError: error42()
13237
13059
  };
13238
13060
  }
13239
- // node_modules/zod/v4/locales/zh-TW.js
13061
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/zh-TW.js
13240
13062
  var error43 = () => {
13241
13063
  const Sizable = {
13242
13064
  string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
@@ -13353,7 +13175,7 @@ function zh_TW_default() {
13353
13175
  localeError: error43()
13354
13176
  };
13355
13177
  }
13356
- // node_modules/zod/v4/locales/yo.js
13178
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/yo.js
13357
13179
  var error44 = () => {
13358
13180
  const Sizable = {
13359
13181
  string: { unit: "\xE0mi", verb: "n\xED" },
@@ -13468,7 +13290,7 @@ function yo_default() {
13468
13290
  localeError: error44()
13469
13291
  };
13470
13292
  }
13471
- // node_modules/zod/v4/core/registries.js
13293
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/registries.js
13472
13294
  var $output = Symbol("ZodOutput");
13473
13295
  var $input = Symbol("ZodInput");
13474
13296
 
@@ -13519,7 +13341,7 @@ function registry() {
13519
13341
  return new $ZodRegistry;
13520
13342
  }
13521
13343
  var globalRegistry = /* @__PURE__ */ registry();
13522
- // node_modules/zod/v4/core/api.js
13344
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/api.js
13523
13345
  function _string(Class2, params) {
13524
13346
  return new Class2({
13525
13347
  type: "string",
@@ -14397,7 +14219,7 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
14397
14219
  const inst = new Class2(def);
14398
14220
  return inst;
14399
14221
  }
14400
- // node_modules/zod/v4/core/to-json-schema.js
14222
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/to-json-schema.js
14401
14223
  class JSONSchemaGenerator {
14402
14224
  constructor(params) {
14403
14225
  this.counter = 0;
@@ -15201,9 +15023,9 @@ function isTransforming(_schema, _ctx) {
15201
15023
  }
15202
15024
  throw new Error(`Unknown schema type: ${def.type}`);
15203
15025
  }
15204
- // node_modules/zod/v4/core/json-schema.js
15026
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/json-schema.js
15205
15027
  var exports_json_schema = {};
15206
- // node_modules/zod/v4/classic/iso.js
15028
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/iso.js
15207
15029
  var exports_iso = {};
15208
15030
  __export(exports_iso, {
15209
15031
  time: () => time2,
@@ -15244,7 +15066,7 @@ function duration2(params) {
15244
15066
  return _isoDuration(ZodISODuration, params);
15245
15067
  }
15246
15068
 
15247
- // node_modules/zod/v4/classic/errors.js
15069
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/errors.js
15248
15070
  var initializer2 = (inst, issues) => {
15249
15071
  $ZodError.init(inst, issues);
15250
15072
  inst.name = "ZodError";
@@ -15279,7 +15101,7 @@ var ZodRealError = $constructor("ZodError", initializer2, {
15279
15101
  Parent: Error
15280
15102
  });
15281
15103
 
15282
- // node_modules/zod/v4/classic/parse.js
15104
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/parse.js
15283
15105
  var parse4 = /* @__PURE__ */ _parse(ZodRealError);
15284
15106
  var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
15285
15107
  var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -15293,7 +15115,7 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
15293
15115
  var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
15294
15116
  var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
15295
15117
 
15296
- // node_modules/zod/v4/classic/schemas.js
15118
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/schemas.js
15297
15119
  var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
15298
15120
  $ZodType.init(inst, def);
15299
15121
  inst.def = def;
@@ -16268,7 +16090,7 @@ function json(params) {
16268
16090
  function preprocess(fn, schema) {
16269
16091
  return pipe(transform(fn), schema);
16270
16092
  }
16271
- // node_modules/zod/v4/classic/compat.js
16093
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/compat.js
16272
16094
  var ZodIssueCode = {
16273
16095
  invalid_type: "invalid_type",
16274
16096
  too_big: "too_big",
@@ -16292,7 +16114,7 @@ function getErrorMap() {
16292
16114
  }
16293
16115
  var ZodFirstPartyTypeKind;
16294
16116
  (function(ZodFirstPartyTypeKind2) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
16295
- // node_modules/zod/v4/classic/coerce.js
16117
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/coerce.js
16296
16118
  var exports_coerce = {};
16297
16119
  __export(exports_coerce, {
16298
16120
  string: () => string3,
@@ -16317,85 +16139,1632 @@ function date4(params) {
16317
16139
  return _coercedDate(ZodDate, params);
16318
16140
  }
16319
16141
 
16320
- // node_modules/zod/v4/classic/external.js
16321
- config(en_default());
16322
- // node_modules/@opencode-ai/plugin/dist/tool.js
16323
- function tool(input) {
16324
- return input;
16142
+ // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/external.js
16143
+ config(en_default());
16144
+ // node_modules/@opencode-ai/plugin/dist/tool.js
16145
+ function tool(input) {
16146
+ return input;
16147
+ }
16148
+ tool.schema = exports_external;
16149
+ // src/lib/OpenCodeChat.ts
16150
+ function createInstructionInjector(ctx) {
16151
+ const sendPrompt = async (text, props) => {
16152
+ await ctx.client.session.prompt({
16153
+ path: { id: props.sessionId },
16154
+ body: {
16155
+ noReply: true,
16156
+ parts: [{ type: "text", text }]
16157
+ }
16158
+ });
16159
+ };
16160
+ return sendPrompt;
16161
+ }
16162
+
16163
+ // src/services/logger.ts
16164
+ var namespace = "[OpencodeSkillful]";
16165
+ function createLogger(config2) {
16166
+ function log(type, ...message) {
16167
+ const timestamp = new Date().toISOString();
16168
+ return [`${namespace}[${type}] ${timestamp} - `, ...message];
16169
+ }
16170
+ return {
16171
+ debug(...message) {
16172
+ if (!config2.debug)
16173
+ return;
16174
+ console.debug(...log("debug", ...message));
16175
+ },
16176
+ log(...message) {
16177
+ console.log(...log("log", ...message));
16178
+ },
16179
+ error(...message) {
16180
+ console.error(...log("error", ...message));
16181
+ },
16182
+ warn(...message) {
16183
+ console.warn(...log("warn", ...message));
16184
+ }
16185
+ };
16186
+ }
16187
+
16188
+ // src/services/SkillRegistry.ts
16189
+ var import_gray_matter = __toESM(require_gray_matter(), 1);
16190
+ import { dirname, basename, relative } from "path";
16191
+
16192
+ // src/lib/Identifiers.ts
16193
+ import { sep } from "path";
16194
+ function toolName(skillPath) {
16195
+ return skillPath.replace(/SKILL\.md$/, "").split(sep).filter(Boolean).join("_").replace(/-/g, "_");
16196
+ }
16197
+
16198
+ // src/lib/SkillFs.ts
16199
+ import { join } from "path";
16200
+ import { existsSync } from "fs";
16201
+
16202
+ // node_modules/mime/dist/types/other.js
16203
+ var types = {
16204
+ "application/prs.cww": ["cww"],
16205
+ "application/prs.xsf+xml": ["xsf"],
16206
+ "application/vnd.1000minds.decision-model+xml": ["1km"],
16207
+ "application/vnd.3gpp.pic-bw-large": ["plb"],
16208
+ "application/vnd.3gpp.pic-bw-small": ["psb"],
16209
+ "application/vnd.3gpp.pic-bw-var": ["pvb"],
16210
+ "application/vnd.3gpp2.tcap": ["tcap"],
16211
+ "application/vnd.3m.post-it-notes": ["pwn"],
16212
+ "application/vnd.accpac.simply.aso": ["aso"],
16213
+ "application/vnd.accpac.simply.imp": ["imp"],
16214
+ "application/vnd.acucobol": ["acu"],
16215
+ "application/vnd.acucorp": ["atc", "acutc"],
16216
+ "application/vnd.adobe.air-application-installer-package+zip": ["air"],
16217
+ "application/vnd.adobe.formscentral.fcdt": ["fcdt"],
16218
+ "application/vnd.adobe.fxp": ["fxp", "fxpl"],
16219
+ "application/vnd.adobe.xdp+xml": ["xdp"],
16220
+ "application/vnd.adobe.xfdf": ["*xfdf"],
16221
+ "application/vnd.age": ["age"],
16222
+ "application/vnd.ahead.space": ["ahead"],
16223
+ "application/vnd.airzip.filesecure.azf": ["azf"],
16224
+ "application/vnd.airzip.filesecure.azs": ["azs"],
16225
+ "application/vnd.amazon.ebook": ["azw"],
16226
+ "application/vnd.americandynamics.acc": ["acc"],
16227
+ "application/vnd.amiga.ami": ["ami"],
16228
+ "application/vnd.android.package-archive": ["apk"],
16229
+ "application/vnd.anser-web-certificate-issue-initiation": ["cii"],
16230
+ "application/vnd.anser-web-funds-transfer-initiation": ["fti"],
16231
+ "application/vnd.antix.game-component": ["atx"],
16232
+ "application/vnd.apple.installer+xml": ["mpkg"],
16233
+ "application/vnd.apple.keynote": ["key"],
16234
+ "application/vnd.apple.mpegurl": ["m3u8"],
16235
+ "application/vnd.apple.numbers": ["numbers"],
16236
+ "application/vnd.apple.pages": ["pages"],
16237
+ "application/vnd.apple.pkpass": ["pkpass"],
16238
+ "application/vnd.aristanetworks.swi": ["swi"],
16239
+ "application/vnd.astraea-software.iota": ["iota"],
16240
+ "application/vnd.audiograph": ["aep"],
16241
+ "application/vnd.autodesk.fbx": ["fbx"],
16242
+ "application/vnd.balsamiq.bmml+xml": ["bmml"],
16243
+ "application/vnd.blueice.multipass": ["mpm"],
16244
+ "application/vnd.bmi": ["bmi"],
16245
+ "application/vnd.businessobjects": ["rep"],
16246
+ "application/vnd.chemdraw+xml": ["cdxml"],
16247
+ "application/vnd.chipnuts.karaoke-mmd": ["mmd"],
16248
+ "application/vnd.cinderella": ["cdy"],
16249
+ "application/vnd.citationstyles.style+xml": ["csl"],
16250
+ "application/vnd.claymore": ["cla"],
16251
+ "application/vnd.cloanto.rp9": ["rp9"],
16252
+ "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"],
16253
+ "application/vnd.cluetrust.cartomobile-config": ["c11amc"],
16254
+ "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"],
16255
+ "application/vnd.commonspace": ["csp"],
16256
+ "application/vnd.contact.cmsg": ["cdbcmsg"],
16257
+ "application/vnd.cosmocaller": ["cmc"],
16258
+ "application/vnd.crick.clicker": ["clkx"],
16259
+ "application/vnd.crick.clicker.keyboard": ["clkk"],
16260
+ "application/vnd.crick.clicker.palette": ["clkp"],
16261
+ "application/vnd.crick.clicker.template": ["clkt"],
16262
+ "application/vnd.crick.clicker.wordbank": ["clkw"],
16263
+ "application/vnd.criticaltools.wbs+xml": ["wbs"],
16264
+ "application/vnd.ctc-posml": ["pml"],
16265
+ "application/vnd.cups-ppd": ["ppd"],
16266
+ "application/vnd.curl.car": ["car"],
16267
+ "application/vnd.curl.pcurl": ["pcurl"],
16268
+ "application/vnd.dart": ["dart"],
16269
+ "application/vnd.data-vision.rdz": ["rdz"],
16270
+ "application/vnd.dbf": ["dbf"],
16271
+ "application/vnd.dcmp+xml": ["dcmp"],
16272
+ "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"],
16273
+ "application/vnd.dece.ttml+xml": ["uvt", "uvvt"],
16274
+ "application/vnd.dece.unspecified": ["uvx", "uvvx"],
16275
+ "application/vnd.dece.zip": ["uvz", "uvvz"],
16276
+ "application/vnd.denovo.fcselayout-link": ["fe_launch"],
16277
+ "application/vnd.dna": ["dna"],
16278
+ "application/vnd.dolby.mlp": ["mlp"],
16279
+ "application/vnd.dpgraph": ["dpg"],
16280
+ "application/vnd.dreamfactory": ["dfac"],
16281
+ "application/vnd.ds-keypoint": ["kpxx"],
16282
+ "application/vnd.dvb.ait": ["ait"],
16283
+ "application/vnd.dvb.service": ["svc"],
16284
+ "application/vnd.dynageo": ["geo"],
16285
+ "application/vnd.ecowin.chart": ["mag"],
16286
+ "application/vnd.enliven": ["nml"],
16287
+ "application/vnd.epson.esf": ["esf"],
16288
+ "application/vnd.epson.msf": ["msf"],
16289
+ "application/vnd.epson.quickanime": ["qam"],
16290
+ "application/vnd.epson.salt": ["slt"],
16291
+ "application/vnd.epson.ssf": ["ssf"],
16292
+ "application/vnd.eszigno3+xml": ["es3", "et3"],
16293
+ "application/vnd.ezpix-album": ["ez2"],
16294
+ "application/vnd.ezpix-package": ["ez3"],
16295
+ "application/vnd.fdf": ["*fdf"],
16296
+ "application/vnd.fdsn.mseed": ["mseed"],
16297
+ "application/vnd.fdsn.seed": ["seed", "dataless"],
16298
+ "application/vnd.flographit": ["gph"],
16299
+ "application/vnd.fluxtime.clip": ["ftc"],
16300
+ "application/vnd.framemaker": ["fm", "frame", "maker", "book"],
16301
+ "application/vnd.frogans.fnc": ["fnc"],
16302
+ "application/vnd.frogans.ltf": ["ltf"],
16303
+ "application/vnd.fsc.weblaunch": ["fsc"],
16304
+ "application/vnd.fujitsu.oasys": ["oas"],
16305
+ "application/vnd.fujitsu.oasys2": ["oa2"],
16306
+ "application/vnd.fujitsu.oasys3": ["oa3"],
16307
+ "application/vnd.fujitsu.oasysgp": ["fg5"],
16308
+ "application/vnd.fujitsu.oasysprs": ["bh2"],
16309
+ "application/vnd.fujixerox.ddd": ["ddd"],
16310
+ "application/vnd.fujixerox.docuworks": ["xdw"],
16311
+ "application/vnd.fujixerox.docuworks.binder": ["xbd"],
16312
+ "application/vnd.fuzzysheet": ["fzs"],
16313
+ "application/vnd.genomatix.tuxedo": ["txd"],
16314
+ "application/vnd.geogebra.file": ["ggb"],
16315
+ "application/vnd.geogebra.slides": ["ggs"],
16316
+ "application/vnd.geogebra.tool": ["ggt"],
16317
+ "application/vnd.geometry-explorer": ["gex", "gre"],
16318
+ "application/vnd.geonext": ["gxt"],
16319
+ "application/vnd.geoplan": ["g2w"],
16320
+ "application/vnd.geospace": ["g3w"],
16321
+ "application/vnd.gmx": ["gmx"],
16322
+ "application/vnd.google-apps.document": ["gdoc"],
16323
+ "application/vnd.google-apps.drawing": ["gdraw"],
16324
+ "application/vnd.google-apps.form": ["gform"],
16325
+ "application/vnd.google-apps.jam": ["gjam"],
16326
+ "application/vnd.google-apps.map": ["gmap"],
16327
+ "application/vnd.google-apps.presentation": ["gslides"],
16328
+ "application/vnd.google-apps.script": ["gscript"],
16329
+ "application/vnd.google-apps.site": ["gsite"],
16330
+ "application/vnd.google-apps.spreadsheet": ["gsheet"],
16331
+ "application/vnd.google-earth.kml+xml": ["kml"],
16332
+ "application/vnd.google-earth.kmz": ["kmz"],
16333
+ "application/vnd.gov.sk.xmldatacontainer+xml": ["xdcf"],
16334
+ "application/vnd.grafeq": ["gqf", "gqs"],
16335
+ "application/vnd.groove-account": ["gac"],
16336
+ "application/vnd.groove-help": ["ghf"],
16337
+ "application/vnd.groove-identity-message": ["gim"],
16338
+ "application/vnd.groove-injector": ["grv"],
16339
+ "application/vnd.groove-tool-message": ["gtm"],
16340
+ "application/vnd.groove-tool-template": ["tpl"],
16341
+ "application/vnd.groove-vcard": ["vcg"],
16342
+ "application/vnd.hal+xml": ["hal"],
16343
+ "application/vnd.handheld-entertainment+xml": ["zmm"],
16344
+ "application/vnd.hbci": ["hbci"],
16345
+ "application/vnd.hhe.lesson-player": ["les"],
16346
+ "application/vnd.hp-hpgl": ["hpgl"],
16347
+ "application/vnd.hp-hpid": ["hpid"],
16348
+ "application/vnd.hp-hps": ["hps"],
16349
+ "application/vnd.hp-jlyt": ["jlt"],
16350
+ "application/vnd.hp-pcl": ["pcl"],
16351
+ "application/vnd.hp-pclxl": ["pclxl"],
16352
+ "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"],
16353
+ "application/vnd.ibm.minipay": ["mpy"],
16354
+ "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"],
16355
+ "application/vnd.ibm.rights-management": ["irm"],
16356
+ "application/vnd.ibm.secure-container": ["sc"],
16357
+ "application/vnd.iccprofile": ["icc", "icm"],
16358
+ "application/vnd.igloader": ["igl"],
16359
+ "application/vnd.immervision-ivp": ["ivp"],
16360
+ "application/vnd.immervision-ivu": ["ivu"],
16361
+ "application/vnd.insors.igm": ["igm"],
16362
+ "application/vnd.intercon.formnet": ["xpw", "xpx"],
16363
+ "application/vnd.intergeo": ["i2g"],
16364
+ "application/vnd.intu.qbo": ["qbo"],
16365
+ "application/vnd.intu.qfx": ["qfx"],
16366
+ "application/vnd.ipunplugged.rcprofile": ["rcprofile"],
16367
+ "application/vnd.irepository.package+xml": ["irp"],
16368
+ "application/vnd.is-xpr": ["xpr"],
16369
+ "application/vnd.isac.fcs": ["fcs"],
16370
+ "application/vnd.jam": ["jam"],
16371
+ "application/vnd.jcp.javame.midlet-rms": ["rms"],
16372
+ "application/vnd.jisp": ["jisp"],
16373
+ "application/vnd.joost.joda-archive": ["joda"],
16374
+ "application/vnd.kahootz": ["ktz", "ktr"],
16375
+ "application/vnd.kde.karbon": ["karbon"],
16376
+ "application/vnd.kde.kchart": ["chrt"],
16377
+ "application/vnd.kde.kformula": ["kfo"],
16378
+ "application/vnd.kde.kivio": ["flw"],
16379
+ "application/vnd.kde.kontour": ["kon"],
16380
+ "application/vnd.kde.kpresenter": ["kpr", "kpt"],
16381
+ "application/vnd.kde.kspread": ["ksp"],
16382
+ "application/vnd.kde.kword": ["kwd", "kwt"],
16383
+ "application/vnd.kenameaapp": ["htke"],
16384
+ "application/vnd.kidspiration": ["kia"],
16385
+ "application/vnd.kinar": ["kne", "knp"],
16386
+ "application/vnd.koan": ["skp", "skd", "skt", "skm"],
16387
+ "application/vnd.kodak-descriptor": ["sse"],
16388
+ "application/vnd.las.las+xml": ["lasxml"],
16389
+ "application/vnd.llamagraphics.life-balance.desktop": ["lbd"],
16390
+ "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"],
16391
+ "application/vnd.lotus-1-2-3": ["123"],
16392
+ "application/vnd.lotus-approach": ["apr"],
16393
+ "application/vnd.lotus-freelance": ["pre"],
16394
+ "application/vnd.lotus-notes": ["nsf"],
16395
+ "application/vnd.lotus-organizer": ["org"],
16396
+ "application/vnd.lotus-screencam": ["scm"],
16397
+ "application/vnd.lotus-wordpro": ["lwp"],
16398
+ "application/vnd.macports.portpkg": ["portpkg"],
16399
+ "application/vnd.mapbox-vector-tile": ["mvt"],
16400
+ "application/vnd.mcd": ["mcd"],
16401
+ "application/vnd.medcalcdata": ["mc1"],
16402
+ "application/vnd.mediastation.cdkey": ["cdkey"],
16403
+ "application/vnd.mfer": ["mwf"],
16404
+ "application/vnd.mfmp": ["mfm"],
16405
+ "application/vnd.micrografx.flo": ["flo"],
16406
+ "application/vnd.micrografx.igx": ["igx"],
16407
+ "application/vnd.mif": ["mif"],
16408
+ "application/vnd.mobius.daf": ["daf"],
16409
+ "application/vnd.mobius.dis": ["dis"],
16410
+ "application/vnd.mobius.mbk": ["mbk"],
16411
+ "application/vnd.mobius.mqy": ["mqy"],
16412
+ "application/vnd.mobius.msl": ["msl"],
16413
+ "application/vnd.mobius.plc": ["plc"],
16414
+ "application/vnd.mobius.txf": ["txf"],
16415
+ "application/vnd.mophun.application": ["mpn"],
16416
+ "application/vnd.mophun.certificate": ["mpc"],
16417
+ "application/vnd.mozilla.xul+xml": ["xul"],
16418
+ "application/vnd.ms-artgalry": ["cil"],
16419
+ "application/vnd.ms-cab-compressed": ["cab"],
16420
+ "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"],
16421
+ "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"],
16422
+ "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"],
16423
+ "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"],
16424
+ "application/vnd.ms-excel.template.macroenabled.12": ["xltm"],
16425
+ "application/vnd.ms-fontobject": ["eot"],
16426
+ "application/vnd.ms-htmlhelp": ["chm"],
16427
+ "application/vnd.ms-ims": ["ims"],
16428
+ "application/vnd.ms-lrm": ["lrm"],
16429
+ "application/vnd.ms-officetheme": ["thmx"],
16430
+ "application/vnd.ms-outlook": ["msg"],
16431
+ "application/vnd.ms-pki.seccat": ["cat"],
16432
+ "application/vnd.ms-pki.stl": ["*stl"],
16433
+ "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"],
16434
+ "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"],
16435
+ "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"],
16436
+ "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"],
16437
+ "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"],
16438
+ "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"],
16439
+ "application/vnd.ms-project": ["*mpp", "mpt"],
16440
+ "application/vnd.ms-visio.viewer": ["vdx"],
16441
+ "application/vnd.ms-word.document.macroenabled.12": ["docm"],
16442
+ "application/vnd.ms-word.template.macroenabled.12": ["dotm"],
16443
+ "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"],
16444
+ "application/vnd.ms-wpl": ["wpl"],
16445
+ "application/vnd.ms-xpsdocument": ["xps"],
16446
+ "application/vnd.mseq": ["mseq"],
16447
+ "application/vnd.musician": ["mus"],
16448
+ "application/vnd.muvee.style": ["msty"],
16449
+ "application/vnd.mynfc": ["taglet"],
16450
+ "application/vnd.nato.bindingdataobject+xml": ["bdo"],
16451
+ "application/vnd.neurolanguage.nlu": ["nlu"],
16452
+ "application/vnd.nitf": ["ntf", "nitf"],
16453
+ "application/vnd.noblenet-directory": ["nnd"],
16454
+ "application/vnd.noblenet-sealer": ["nns"],
16455
+ "application/vnd.noblenet-web": ["nnw"],
16456
+ "application/vnd.nokia.n-gage.ac+xml": ["*ac"],
16457
+ "application/vnd.nokia.n-gage.data": ["ngdat"],
16458
+ "application/vnd.nokia.n-gage.symbian.install": ["n-gage"],
16459
+ "application/vnd.nokia.radio-preset": ["rpst"],
16460
+ "application/vnd.nokia.radio-presets": ["rpss"],
16461
+ "application/vnd.novadigm.edm": ["edm"],
16462
+ "application/vnd.novadigm.edx": ["edx"],
16463
+ "application/vnd.novadigm.ext": ["ext"],
16464
+ "application/vnd.oasis.opendocument.chart": ["odc"],
16465
+ "application/vnd.oasis.opendocument.chart-template": ["otc"],
16466
+ "application/vnd.oasis.opendocument.database": ["odb"],
16467
+ "application/vnd.oasis.opendocument.formula": ["odf"],
16468
+ "application/vnd.oasis.opendocument.formula-template": ["odft"],
16469
+ "application/vnd.oasis.opendocument.graphics": ["odg"],
16470
+ "application/vnd.oasis.opendocument.graphics-template": ["otg"],
16471
+ "application/vnd.oasis.opendocument.image": ["odi"],
16472
+ "application/vnd.oasis.opendocument.image-template": ["oti"],
16473
+ "application/vnd.oasis.opendocument.presentation": ["odp"],
16474
+ "application/vnd.oasis.opendocument.presentation-template": ["otp"],
16475
+ "application/vnd.oasis.opendocument.spreadsheet": ["ods"],
16476
+ "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"],
16477
+ "application/vnd.oasis.opendocument.text": ["odt"],
16478
+ "application/vnd.oasis.opendocument.text-master": ["odm"],
16479
+ "application/vnd.oasis.opendocument.text-template": ["ott"],
16480
+ "application/vnd.oasis.opendocument.text-web": ["oth"],
16481
+ "application/vnd.olpc-sugar": ["xo"],
16482
+ "application/vnd.oma.dd2+xml": ["dd2"],
16483
+ "application/vnd.openblox.game+xml": ["obgx"],
16484
+ "application/vnd.openofficeorg.extension": ["oxt"],
16485
+ "application/vnd.openstreetmap.data+xml": ["osm"],
16486
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": [
16487
+ "pptx"
16488
+ ],
16489
+ "application/vnd.openxmlformats-officedocument.presentationml.slide": [
16490
+ "sldx"
16491
+ ],
16492
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow": [
16493
+ "ppsx"
16494
+ ],
16495
+ "application/vnd.openxmlformats-officedocument.presentationml.template": [
16496
+ "potx"
16497
+ ],
16498
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"],
16499
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template": [
16500
+ "xltx"
16501
+ ],
16502
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [
16503
+ "docx"
16504
+ ],
16505
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template": [
16506
+ "dotx"
16507
+ ],
16508
+ "application/vnd.osgeo.mapguide.package": ["mgp"],
16509
+ "application/vnd.osgi.dp": ["dp"],
16510
+ "application/vnd.osgi.subsystem": ["esa"],
16511
+ "application/vnd.palm": ["pdb", "pqa", "oprc"],
16512
+ "application/vnd.pawaafile": ["paw"],
16513
+ "application/vnd.pg.format": ["str"],
16514
+ "application/vnd.pg.osasli": ["ei6"],
16515
+ "application/vnd.picsel": ["efif"],
16516
+ "application/vnd.pmi.widget": ["wg"],
16517
+ "application/vnd.pocketlearn": ["plf"],
16518
+ "application/vnd.powerbuilder6": ["pbd"],
16519
+ "application/vnd.previewsystems.box": ["box"],
16520
+ "application/vnd.procrate.brushset": ["brushset"],
16521
+ "application/vnd.procreate.brush": ["brush"],
16522
+ "application/vnd.procreate.dream": ["drm"],
16523
+ "application/vnd.proteus.magazine": ["mgz"],
16524
+ "application/vnd.publishare-delta-tree": ["qps"],
16525
+ "application/vnd.pvi.ptid1": ["ptid"],
16526
+ "application/vnd.pwg-xhtml-print+xml": ["xhtm"],
16527
+ "application/vnd.quark.quarkxpress": [
16528
+ "qxd",
16529
+ "qxt",
16530
+ "qwd",
16531
+ "qwt",
16532
+ "qxl",
16533
+ "qxb"
16534
+ ],
16535
+ "application/vnd.rar": ["rar"],
16536
+ "application/vnd.realvnc.bed": ["bed"],
16537
+ "application/vnd.recordare.musicxml": ["mxl"],
16538
+ "application/vnd.recordare.musicxml+xml": ["musicxml"],
16539
+ "application/vnd.rig.cryptonote": ["cryptonote"],
16540
+ "application/vnd.rim.cod": ["cod"],
16541
+ "application/vnd.rn-realmedia": ["rm"],
16542
+ "application/vnd.rn-realmedia-vbr": ["rmvb"],
16543
+ "application/vnd.route66.link66+xml": ["link66"],
16544
+ "application/vnd.sailingtracker.track": ["st"],
16545
+ "application/vnd.seemail": ["see"],
16546
+ "application/vnd.sema": ["sema"],
16547
+ "application/vnd.semd": ["semd"],
16548
+ "application/vnd.semf": ["semf"],
16549
+ "application/vnd.shana.informed.formdata": ["ifm"],
16550
+ "application/vnd.shana.informed.formtemplate": ["itp"],
16551
+ "application/vnd.shana.informed.interchange": ["iif"],
16552
+ "application/vnd.shana.informed.package": ["ipk"],
16553
+ "application/vnd.simtech-mindmapper": ["twd", "twds"],
16554
+ "application/vnd.smaf": ["mmf"],
16555
+ "application/vnd.smart.teacher": ["teacher"],
16556
+ "application/vnd.software602.filler.form+xml": ["fo"],
16557
+ "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"],
16558
+ "application/vnd.spotfire.dxp": ["dxp"],
16559
+ "application/vnd.spotfire.sfs": ["sfs"],
16560
+ "application/vnd.stardivision.calc": ["sdc"],
16561
+ "application/vnd.stardivision.draw": ["sda"],
16562
+ "application/vnd.stardivision.impress": ["sdd"],
16563
+ "application/vnd.stardivision.math": ["smf"],
16564
+ "application/vnd.stardivision.writer": ["sdw", "vor"],
16565
+ "application/vnd.stardivision.writer-global": ["sgl"],
16566
+ "application/vnd.stepmania.package": ["smzip"],
16567
+ "application/vnd.stepmania.stepchart": ["sm"],
16568
+ "application/vnd.sun.wadl+xml": ["wadl"],
16569
+ "application/vnd.sun.xml.calc": ["sxc"],
16570
+ "application/vnd.sun.xml.calc.template": ["stc"],
16571
+ "application/vnd.sun.xml.draw": ["sxd"],
16572
+ "application/vnd.sun.xml.draw.template": ["std"],
16573
+ "application/vnd.sun.xml.impress": ["sxi"],
16574
+ "application/vnd.sun.xml.impress.template": ["sti"],
16575
+ "application/vnd.sun.xml.math": ["sxm"],
16576
+ "application/vnd.sun.xml.writer": ["sxw"],
16577
+ "application/vnd.sun.xml.writer.global": ["sxg"],
16578
+ "application/vnd.sun.xml.writer.template": ["stw"],
16579
+ "application/vnd.sus-calendar": ["sus", "susp"],
16580
+ "application/vnd.svd": ["svd"],
16581
+ "application/vnd.symbian.install": ["sis", "sisx"],
16582
+ "application/vnd.syncml+xml": ["xsm"],
16583
+ "application/vnd.syncml.dm+wbxml": ["bdm"],
16584
+ "application/vnd.syncml.dm+xml": ["xdm"],
16585
+ "application/vnd.syncml.dmddf+xml": ["ddf"],
16586
+ "application/vnd.tao.intent-module-archive": ["tao"],
16587
+ "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"],
16588
+ "application/vnd.tmobile-livetv": ["tmo"],
16589
+ "application/vnd.trid.tpt": ["tpt"],
16590
+ "application/vnd.triscape.mxs": ["mxs"],
16591
+ "application/vnd.trueapp": ["tra"],
16592
+ "application/vnd.ufdl": ["ufd", "ufdl"],
16593
+ "application/vnd.uiq.theme": ["utz"],
16594
+ "application/vnd.umajin": ["umj"],
16595
+ "application/vnd.unity": ["unityweb"],
16596
+ "application/vnd.uoml+xml": ["uoml", "uo"],
16597
+ "application/vnd.vcx": ["vcx"],
16598
+ "application/vnd.visio": ["vsd", "vst", "vss", "vsw", "vsdx", "vtx"],
16599
+ "application/vnd.visionary": ["vis"],
16600
+ "application/vnd.vsf": ["vsf"],
16601
+ "application/vnd.wap.wbxml": ["wbxml"],
16602
+ "application/vnd.wap.wmlc": ["wmlc"],
16603
+ "application/vnd.wap.wmlscriptc": ["wmlsc"],
16604
+ "application/vnd.webturbo": ["wtb"],
16605
+ "application/vnd.wolfram.player": ["nbp"],
16606
+ "application/vnd.wordperfect": ["wpd"],
16607
+ "application/vnd.wqd": ["wqd"],
16608
+ "application/vnd.wt.stf": ["stf"],
16609
+ "application/vnd.xara": ["xar"],
16610
+ "application/vnd.xfdl": ["xfdl"],
16611
+ "application/vnd.yamaha.hv-dic": ["hvd"],
16612
+ "application/vnd.yamaha.hv-script": ["hvs"],
16613
+ "application/vnd.yamaha.hv-voice": ["hvp"],
16614
+ "application/vnd.yamaha.openscoreformat": ["osf"],
16615
+ "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"],
16616
+ "application/vnd.yamaha.smaf-audio": ["saf"],
16617
+ "application/vnd.yamaha.smaf-phrase": ["spf"],
16618
+ "application/vnd.yellowriver-custom-menu": ["cmp"],
16619
+ "application/vnd.zul": ["zir", "zirz"],
16620
+ "application/vnd.zzazz.deck+xml": ["zaz"],
16621
+ "application/x-7z-compressed": ["7z"],
16622
+ "application/x-abiword": ["abw"],
16623
+ "application/x-ace-compressed": ["ace"],
16624
+ "application/x-apple-diskimage": ["*dmg"],
16625
+ "application/x-arj": ["arj"],
16626
+ "application/x-authorware-bin": ["aab", "x32", "u32", "vox"],
16627
+ "application/x-authorware-map": ["aam"],
16628
+ "application/x-authorware-seg": ["aas"],
16629
+ "application/x-bcpio": ["bcpio"],
16630
+ "application/x-bdoc": ["*bdoc"],
16631
+ "application/x-bittorrent": ["torrent"],
16632
+ "application/x-blender": ["blend"],
16633
+ "application/x-blorb": ["blb", "blorb"],
16634
+ "application/x-bzip": ["bz"],
16635
+ "application/x-bzip2": ["bz2", "boz"],
16636
+ "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"],
16637
+ "application/x-cdlink": ["vcd"],
16638
+ "application/x-cfs-compressed": ["cfs"],
16639
+ "application/x-chat": ["chat"],
16640
+ "application/x-chess-pgn": ["pgn"],
16641
+ "application/x-chrome-extension": ["crx"],
16642
+ "application/x-cocoa": ["cco"],
16643
+ "application/x-compressed": ["*rar"],
16644
+ "application/x-conference": ["nsc"],
16645
+ "application/x-cpio": ["cpio"],
16646
+ "application/x-csh": ["csh"],
16647
+ "application/x-debian-package": ["*deb", "udeb"],
16648
+ "application/x-dgc-compressed": ["dgc"],
16649
+ "application/x-director": [
16650
+ "dir",
16651
+ "dcr",
16652
+ "dxr",
16653
+ "cst",
16654
+ "cct",
16655
+ "cxt",
16656
+ "w3d",
16657
+ "fgd",
16658
+ "swa"
16659
+ ],
16660
+ "application/x-doom": ["wad"],
16661
+ "application/x-dtbncx+xml": ["ncx"],
16662
+ "application/x-dtbook+xml": ["dtb"],
16663
+ "application/x-dtbresource+xml": ["res"],
16664
+ "application/x-dvi": ["dvi"],
16665
+ "application/x-envoy": ["evy"],
16666
+ "application/x-eva": ["eva"],
16667
+ "application/x-font-bdf": ["bdf"],
16668
+ "application/x-font-ghostscript": ["gsf"],
16669
+ "application/x-font-linux-psf": ["psf"],
16670
+ "application/x-font-pcf": ["pcf"],
16671
+ "application/x-font-snf": ["snf"],
16672
+ "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"],
16673
+ "application/x-freearc": ["arc"],
16674
+ "application/x-futuresplash": ["spl"],
16675
+ "application/x-gca-compressed": ["gca"],
16676
+ "application/x-glulx": ["ulx"],
16677
+ "application/x-gnumeric": ["gnumeric"],
16678
+ "application/x-gramps-xml": ["gramps"],
16679
+ "application/x-gtar": ["gtar"],
16680
+ "application/x-hdf": ["hdf"],
16681
+ "application/x-httpd-php": ["php"],
16682
+ "application/x-install-instructions": ["install"],
16683
+ "application/x-ipynb+json": ["ipynb"],
16684
+ "application/x-iso9660-image": ["*iso"],
16685
+ "application/x-iwork-keynote-sffkey": ["*key"],
16686
+ "application/x-iwork-numbers-sffnumbers": ["*numbers"],
16687
+ "application/x-iwork-pages-sffpages": ["*pages"],
16688
+ "application/x-java-archive-diff": ["jardiff"],
16689
+ "application/x-java-jnlp-file": ["jnlp"],
16690
+ "application/x-keepass2": ["kdbx"],
16691
+ "application/x-latex": ["latex"],
16692
+ "application/x-lua-bytecode": ["luac"],
16693
+ "application/x-lzh-compressed": ["lzh", "lha"],
16694
+ "application/x-makeself": ["run"],
16695
+ "application/x-mie": ["mie"],
16696
+ "application/x-mobipocket-ebook": ["*prc", "mobi"],
16697
+ "application/x-ms-application": ["application"],
16698
+ "application/x-ms-shortcut": ["lnk"],
16699
+ "application/x-ms-wmd": ["wmd"],
16700
+ "application/x-ms-wmz": ["wmz"],
16701
+ "application/x-ms-xbap": ["xbap"],
16702
+ "application/x-msaccess": ["mdb"],
16703
+ "application/x-msbinder": ["obd"],
16704
+ "application/x-mscardfile": ["crd"],
16705
+ "application/x-msclip": ["clp"],
16706
+ "application/x-msdos-program": ["*exe"],
16707
+ "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"],
16708
+ "application/x-msmediaview": ["mvb", "m13", "m14"],
16709
+ "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"],
16710
+ "application/x-msmoney": ["mny"],
16711
+ "application/x-mspublisher": ["pub"],
16712
+ "application/x-msschedule": ["scd"],
16713
+ "application/x-msterminal": ["trm"],
16714
+ "application/x-mswrite": ["wri"],
16715
+ "application/x-netcdf": ["nc", "cdf"],
16716
+ "application/x-ns-proxy-autoconfig": ["pac"],
16717
+ "application/x-nzb": ["nzb"],
16718
+ "application/x-perl": ["pl", "pm"],
16719
+ "application/x-pilot": ["*prc", "*pdb"],
16720
+ "application/x-pkcs12": ["p12", "pfx"],
16721
+ "application/x-pkcs7-certificates": ["p7b", "spc"],
16722
+ "application/x-pkcs7-certreqresp": ["p7r"],
16723
+ "application/x-rar-compressed": ["*rar"],
16724
+ "application/x-redhat-package-manager": ["rpm"],
16725
+ "application/x-research-info-systems": ["ris"],
16726
+ "application/x-sea": ["sea"],
16727
+ "application/x-sh": ["sh"],
16728
+ "application/x-shar": ["shar"],
16729
+ "application/x-shockwave-flash": ["swf"],
16730
+ "application/x-silverlight-app": ["xap"],
16731
+ "application/x-sql": ["*sql"],
16732
+ "application/x-stuffit": ["sit"],
16733
+ "application/x-stuffitx": ["sitx"],
16734
+ "application/x-subrip": ["srt"],
16735
+ "application/x-sv4cpio": ["sv4cpio"],
16736
+ "application/x-sv4crc": ["sv4crc"],
16737
+ "application/x-t3vm-image": ["t3"],
16738
+ "application/x-tads": ["gam"],
16739
+ "application/x-tar": ["tar"],
16740
+ "application/x-tcl": ["tcl", "tk"],
16741
+ "application/x-tex": ["tex"],
16742
+ "application/x-tex-tfm": ["tfm"],
16743
+ "application/x-texinfo": ["texinfo", "texi"],
16744
+ "application/x-tgif": ["*obj"],
16745
+ "application/x-ustar": ["ustar"],
16746
+ "application/x-virtualbox-hdd": ["hdd"],
16747
+ "application/x-virtualbox-ova": ["ova"],
16748
+ "application/x-virtualbox-ovf": ["ovf"],
16749
+ "application/x-virtualbox-vbox": ["vbox"],
16750
+ "application/x-virtualbox-vbox-extpack": ["vbox-extpack"],
16751
+ "application/x-virtualbox-vdi": ["vdi"],
16752
+ "application/x-virtualbox-vhd": ["vhd"],
16753
+ "application/x-virtualbox-vmdk": ["vmdk"],
16754
+ "application/x-wais-source": ["src"],
16755
+ "application/x-web-app-manifest+json": ["webapp"],
16756
+ "application/x-x509-ca-cert": ["der", "crt", "pem"],
16757
+ "application/x-xfig": ["fig"],
16758
+ "application/x-xliff+xml": ["*xlf"],
16759
+ "application/x-xpinstall": ["xpi"],
16760
+ "application/x-xz": ["xz"],
16761
+ "application/x-zip-compressed": ["*zip"],
16762
+ "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"],
16763
+ "audio/vnd.dece.audio": ["uva", "uvva"],
16764
+ "audio/vnd.digital-winds": ["eol"],
16765
+ "audio/vnd.dra": ["dra"],
16766
+ "audio/vnd.dts": ["dts"],
16767
+ "audio/vnd.dts.hd": ["dtshd"],
16768
+ "audio/vnd.lucent.voice": ["lvp"],
16769
+ "audio/vnd.ms-playready.media.pya": ["pya"],
16770
+ "audio/vnd.nuera.ecelp4800": ["ecelp4800"],
16771
+ "audio/vnd.nuera.ecelp7470": ["ecelp7470"],
16772
+ "audio/vnd.nuera.ecelp9600": ["ecelp9600"],
16773
+ "audio/vnd.rip": ["rip"],
16774
+ "audio/x-aac": ["*aac"],
16775
+ "audio/x-aiff": ["aif", "aiff", "aifc"],
16776
+ "audio/x-caf": ["caf"],
16777
+ "audio/x-flac": ["flac"],
16778
+ "audio/x-m4a": ["*m4a"],
16779
+ "audio/x-matroska": ["mka"],
16780
+ "audio/x-mpegurl": ["m3u"],
16781
+ "audio/x-ms-wax": ["wax"],
16782
+ "audio/x-ms-wma": ["wma"],
16783
+ "audio/x-pn-realaudio": ["ram", "ra"],
16784
+ "audio/x-pn-realaudio-plugin": ["rmp"],
16785
+ "audio/x-realaudio": ["*ra"],
16786
+ "audio/x-wav": ["*wav"],
16787
+ "chemical/x-cdx": ["cdx"],
16788
+ "chemical/x-cif": ["cif"],
16789
+ "chemical/x-cmdf": ["cmdf"],
16790
+ "chemical/x-cml": ["cml"],
16791
+ "chemical/x-csml": ["csml"],
16792
+ "chemical/x-xyz": ["xyz"],
16793
+ "image/prs.btif": ["btif", "btf"],
16794
+ "image/prs.pti": ["pti"],
16795
+ "image/vnd.adobe.photoshop": ["psd"],
16796
+ "image/vnd.airzip.accelerator.azv": ["azv"],
16797
+ "image/vnd.blockfact.facti": ["facti"],
16798
+ "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"],
16799
+ "image/vnd.djvu": ["djvu", "djv"],
16800
+ "image/vnd.dvb.subtitle": ["*sub"],
16801
+ "image/vnd.dwg": ["dwg"],
16802
+ "image/vnd.dxf": ["dxf"],
16803
+ "image/vnd.fastbidsheet": ["fbs"],
16804
+ "image/vnd.fpx": ["fpx"],
16805
+ "image/vnd.fst": ["fst"],
16806
+ "image/vnd.fujixerox.edmics-mmr": ["mmr"],
16807
+ "image/vnd.fujixerox.edmics-rlc": ["rlc"],
16808
+ "image/vnd.microsoft.icon": ["ico"],
16809
+ "image/vnd.ms-dds": ["dds"],
16810
+ "image/vnd.ms-modi": ["mdi"],
16811
+ "image/vnd.ms-photo": ["wdp"],
16812
+ "image/vnd.net-fpx": ["npx"],
16813
+ "image/vnd.pco.b16": ["b16"],
16814
+ "image/vnd.tencent.tap": ["tap"],
16815
+ "image/vnd.valve.source.texture": ["vtf"],
16816
+ "image/vnd.wap.wbmp": ["wbmp"],
16817
+ "image/vnd.xiff": ["xif"],
16818
+ "image/vnd.zbrush.pcx": ["pcx"],
16819
+ "image/x-3ds": ["3ds"],
16820
+ "image/x-adobe-dng": ["dng"],
16821
+ "image/x-cmu-raster": ["ras"],
16822
+ "image/x-cmx": ["cmx"],
16823
+ "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"],
16824
+ "image/x-icon": ["*ico"],
16825
+ "image/x-jng": ["jng"],
16826
+ "image/x-mrsid-image": ["sid"],
16827
+ "image/x-ms-bmp": ["*bmp"],
16828
+ "image/x-pcx": ["*pcx"],
16829
+ "image/x-pict": ["pic", "pct"],
16830
+ "image/x-portable-anymap": ["pnm"],
16831
+ "image/x-portable-bitmap": ["pbm"],
16832
+ "image/x-portable-graymap": ["pgm"],
16833
+ "image/x-portable-pixmap": ["ppm"],
16834
+ "image/x-rgb": ["rgb"],
16835
+ "image/x-tga": ["tga"],
16836
+ "image/x-xbitmap": ["xbm"],
16837
+ "image/x-xpixmap": ["xpm"],
16838
+ "image/x-xwindowdump": ["xwd"],
16839
+ "message/vnd.wfa.wsc": ["wsc"],
16840
+ "model/vnd.bary": ["bary"],
16841
+ "model/vnd.cld": ["cld"],
16842
+ "model/vnd.collada+xml": ["dae"],
16843
+ "model/vnd.dwf": ["dwf"],
16844
+ "model/vnd.gdl": ["gdl"],
16845
+ "model/vnd.gtw": ["gtw"],
16846
+ "model/vnd.mts": ["*mts"],
16847
+ "model/vnd.opengex": ["ogex"],
16848
+ "model/vnd.parasolid.transmit.binary": ["x_b"],
16849
+ "model/vnd.parasolid.transmit.text": ["x_t"],
16850
+ "model/vnd.pytha.pyox": ["pyo", "pyox"],
16851
+ "model/vnd.sap.vds": ["vds"],
16852
+ "model/vnd.usda": ["usda"],
16853
+ "model/vnd.usdz+zip": ["usdz"],
16854
+ "model/vnd.valve.source.compiled-map": ["bsp"],
16855
+ "model/vnd.vtu": ["vtu"],
16856
+ "text/prs.lines.tag": ["dsc"],
16857
+ "text/vnd.curl": ["curl"],
16858
+ "text/vnd.curl.dcurl": ["dcurl"],
16859
+ "text/vnd.curl.mcurl": ["mcurl"],
16860
+ "text/vnd.curl.scurl": ["scurl"],
16861
+ "text/vnd.dvb.subtitle": ["sub"],
16862
+ "text/vnd.familysearch.gedcom": ["ged"],
16863
+ "text/vnd.fly": ["fly"],
16864
+ "text/vnd.fmi.flexstor": ["flx"],
16865
+ "text/vnd.graphviz": ["gv"],
16866
+ "text/vnd.in3d.3dml": ["3dml"],
16867
+ "text/vnd.in3d.spot": ["spot"],
16868
+ "text/vnd.sun.j2me.app-descriptor": ["jad"],
16869
+ "text/vnd.wap.wml": ["wml"],
16870
+ "text/vnd.wap.wmlscript": ["wmls"],
16871
+ "text/x-asm": ["s", "asm"],
16872
+ "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"],
16873
+ "text/x-component": ["htc"],
16874
+ "text/x-fortran": ["f", "for", "f77", "f90"],
16875
+ "text/x-handlebars-template": ["hbs"],
16876
+ "text/x-java-source": ["java"],
16877
+ "text/x-lua": ["lua"],
16878
+ "text/x-markdown": ["mkd"],
16879
+ "text/x-nfo": ["nfo"],
16880
+ "text/x-opml": ["opml"],
16881
+ "text/x-org": ["*org"],
16882
+ "text/x-pascal": ["p", "pas"],
16883
+ "text/x-processing": ["pde"],
16884
+ "text/x-sass": ["sass"],
16885
+ "text/x-scss": ["scss"],
16886
+ "text/x-setext": ["etx"],
16887
+ "text/x-sfv": ["sfv"],
16888
+ "text/x-suse-ymp": ["ymp"],
16889
+ "text/x-uuencode": ["uu"],
16890
+ "text/x-vcalendar": ["vcs"],
16891
+ "text/x-vcard": ["vcf"],
16892
+ "video/vnd.dece.hd": ["uvh", "uvvh"],
16893
+ "video/vnd.dece.mobile": ["uvm", "uvvm"],
16894
+ "video/vnd.dece.pd": ["uvp", "uvvp"],
16895
+ "video/vnd.dece.sd": ["uvs", "uvvs"],
16896
+ "video/vnd.dece.video": ["uvv", "uvvv"],
16897
+ "video/vnd.dvb.file": ["dvb"],
16898
+ "video/vnd.fvt": ["fvt"],
16899
+ "video/vnd.mpegurl": ["mxu", "m4u"],
16900
+ "video/vnd.ms-playready.media.pyv": ["pyv"],
16901
+ "video/vnd.uvvu.mp4": ["uvu", "uvvu"],
16902
+ "video/vnd.vivo": ["viv"],
16903
+ "video/x-f4v": ["f4v"],
16904
+ "video/x-fli": ["fli"],
16905
+ "video/x-flv": ["flv"],
16906
+ "video/x-m4v": ["m4v"],
16907
+ "video/x-matroska": ["mkv", "mk3d", "mks"],
16908
+ "video/x-mng": ["mng"],
16909
+ "video/x-ms-asf": ["asf", "asx"],
16910
+ "video/x-ms-vob": ["vob"],
16911
+ "video/x-ms-wm": ["wm"],
16912
+ "video/x-ms-wmv": ["wmv"],
16913
+ "video/x-ms-wmx": ["wmx"],
16914
+ "video/x-ms-wvx": ["wvx"],
16915
+ "video/x-msvideo": ["avi"],
16916
+ "video/x-sgi-movie": ["movie"],
16917
+ "video/x-smv": ["smv"],
16918
+ "x-conference/x-cooltalk": ["ice"]
16919
+ };
16920
+ Object.freeze(types);
16921
+ var other_default = types;
16922
+
16923
+ // node_modules/mime/dist/types/standard.js
16924
+ var types2 = {
16925
+ "application/andrew-inset": ["ez"],
16926
+ "application/appinstaller": ["appinstaller"],
16927
+ "application/applixware": ["aw"],
16928
+ "application/appx": ["appx"],
16929
+ "application/appxbundle": ["appxbundle"],
16930
+ "application/atom+xml": ["atom"],
16931
+ "application/atomcat+xml": ["atomcat"],
16932
+ "application/atomdeleted+xml": ["atomdeleted"],
16933
+ "application/atomsvc+xml": ["atomsvc"],
16934
+ "application/atsc-dwd+xml": ["dwd"],
16935
+ "application/atsc-held+xml": ["held"],
16936
+ "application/atsc-rsat+xml": ["rsat"],
16937
+ "application/automationml-aml+xml": ["aml"],
16938
+ "application/automationml-amlx+zip": ["amlx"],
16939
+ "application/bdoc": ["bdoc"],
16940
+ "application/calendar+xml": ["xcs"],
16941
+ "application/ccxml+xml": ["ccxml"],
16942
+ "application/cdfx+xml": ["cdfx"],
16943
+ "application/cdmi-capability": ["cdmia"],
16944
+ "application/cdmi-container": ["cdmic"],
16945
+ "application/cdmi-domain": ["cdmid"],
16946
+ "application/cdmi-object": ["cdmio"],
16947
+ "application/cdmi-queue": ["cdmiq"],
16948
+ "application/cpl+xml": ["cpl"],
16949
+ "application/cu-seeme": ["cu"],
16950
+ "application/cwl": ["cwl"],
16951
+ "application/dash+xml": ["mpd"],
16952
+ "application/dash-patch+xml": ["mpp"],
16953
+ "application/davmount+xml": ["davmount"],
16954
+ "application/dicom": ["dcm"],
16955
+ "application/docbook+xml": ["dbk"],
16956
+ "application/dssc+der": ["dssc"],
16957
+ "application/dssc+xml": ["xdssc"],
16958
+ "application/ecmascript": ["ecma"],
16959
+ "application/emma+xml": ["emma"],
16960
+ "application/emotionml+xml": ["emotionml"],
16961
+ "application/epub+zip": ["epub"],
16962
+ "application/exi": ["exi"],
16963
+ "application/express": ["exp"],
16964
+ "application/fdf": ["fdf"],
16965
+ "application/fdt+xml": ["fdt"],
16966
+ "application/font-tdpfr": ["pfr"],
16967
+ "application/geo+json": ["geojson"],
16968
+ "application/gml+xml": ["gml"],
16969
+ "application/gpx+xml": ["gpx"],
16970
+ "application/gxf": ["gxf"],
16971
+ "application/gzip": ["gz"],
16972
+ "application/hjson": ["hjson"],
16973
+ "application/hyperstudio": ["stk"],
16974
+ "application/inkml+xml": ["ink", "inkml"],
16975
+ "application/ipfix": ["ipfix"],
16976
+ "application/its+xml": ["its"],
16977
+ "application/java-archive": ["jar", "war", "ear"],
16978
+ "application/java-serialized-object": ["ser"],
16979
+ "application/java-vm": ["class"],
16980
+ "application/javascript": ["*js"],
16981
+ "application/json": ["json", "map"],
16982
+ "application/json5": ["json5"],
16983
+ "application/jsonml+json": ["jsonml"],
16984
+ "application/ld+json": ["jsonld"],
16985
+ "application/lgr+xml": ["lgr"],
16986
+ "application/lost+xml": ["lostxml"],
16987
+ "application/mac-binhex40": ["hqx"],
16988
+ "application/mac-compactpro": ["cpt"],
16989
+ "application/mads+xml": ["mads"],
16990
+ "application/manifest+json": ["webmanifest"],
16991
+ "application/marc": ["mrc"],
16992
+ "application/marcxml+xml": ["mrcx"],
16993
+ "application/mathematica": ["ma", "nb", "mb"],
16994
+ "application/mathml+xml": ["mathml"],
16995
+ "application/mbox": ["mbox"],
16996
+ "application/media-policy-dataset+xml": ["mpf"],
16997
+ "application/mediaservercontrol+xml": ["mscml"],
16998
+ "application/metalink+xml": ["metalink"],
16999
+ "application/metalink4+xml": ["meta4"],
17000
+ "application/mets+xml": ["mets"],
17001
+ "application/mmt-aei+xml": ["maei"],
17002
+ "application/mmt-usd+xml": ["musd"],
17003
+ "application/mods+xml": ["mods"],
17004
+ "application/mp21": ["m21", "mp21"],
17005
+ "application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"],
17006
+ "application/msix": ["msix"],
17007
+ "application/msixbundle": ["msixbundle"],
17008
+ "application/msword": ["doc", "dot"],
17009
+ "application/mxf": ["mxf"],
17010
+ "application/n-quads": ["nq"],
17011
+ "application/n-triples": ["nt"],
17012
+ "application/node": ["cjs"],
17013
+ "application/octet-stream": [
17014
+ "bin",
17015
+ "dms",
17016
+ "lrf",
17017
+ "mar",
17018
+ "so",
17019
+ "dist",
17020
+ "distz",
17021
+ "pkg",
17022
+ "bpk",
17023
+ "dump",
17024
+ "elc",
17025
+ "deploy",
17026
+ "exe",
17027
+ "dll",
17028
+ "deb",
17029
+ "dmg",
17030
+ "iso",
17031
+ "img",
17032
+ "msi",
17033
+ "msp",
17034
+ "msm",
17035
+ "buffer"
17036
+ ],
17037
+ "application/oda": ["oda"],
17038
+ "application/oebps-package+xml": ["opf"],
17039
+ "application/ogg": ["ogx"],
17040
+ "application/omdoc+xml": ["omdoc"],
17041
+ "application/onenote": [
17042
+ "onetoc",
17043
+ "onetoc2",
17044
+ "onetmp",
17045
+ "onepkg",
17046
+ "one",
17047
+ "onea"
17048
+ ],
17049
+ "application/oxps": ["oxps"],
17050
+ "application/p2p-overlay+xml": ["relo"],
17051
+ "application/patch-ops-error+xml": ["xer"],
17052
+ "application/pdf": ["pdf"],
17053
+ "application/pgp-encrypted": ["pgp"],
17054
+ "application/pgp-keys": ["asc"],
17055
+ "application/pgp-signature": ["sig", "*asc"],
17056
+ "application/pics-rules": ["prf"],
17057
+ "application/pkcs10": ["p10"],
17058
+ "application/pkcs7-mime": ["p7m", "p7c"],
17059
+ "application/pkcs7-signature": ["p7s"],
17060
+ "application/pkcs8": ["p8"],
17061
+ "application/pkix-attr-cert": ["ac"],
17062
+ "application/pkix-cert": ["cer"],
17063
+ "application/pkix-crl": ["crl"],
17064
+ "application/pkix-pkipath": ["pkipath"],
17065
+ "application/pkixcmp": ["pki"],
17066
+ "application/pls+xml": ["pls"],
17067
+ "application/postscript": ["ai", "eps", "ps"],
17068
+ "application/provenance+xml": ["provx"],
17069
+ "application/pskc+xml": ["pskcxml"],
17070
+ "application/raml+yaml": ["raml"],
17071
+ "application/rdf+xml": ["rdf", "owl"],
17072
+ "application/reginfo+xml": ["rif"],
17073
+ "application/relax-ng-compact-syntax": ["rnc"],
17074
+ "application/resource-lists+xml": ["rl"],
17075
+ "application/resource-lists-diff+xml": ["rld"],
17076
+ "application/rls-services+xml": ["rs"],
17077
+ "application/route-apd+xml": ["rapd"],
17078
+ "application/route-s-tsid+xml": ["sls"],
17079
+ "application/route-usd+xml": ["rusd"],
17080
+ "application/rpki-ghostbusters": ["gbr"],
17081
+ "application/rpki-manifest": ["mft"],
17082
+ "application/rpki-roa": ["roa"],
17083
+ "application/rsd+xml": ["rsd"],
17084
+ "application/rss+xml": ["rss"],
17085
+ "application/rtf": ["rtf"],
17086
+ "application/sbml+xml": ["sbml"],
17087
+ "application/scvp-cv-request": ["scq"],
17088
+ "application/scvp-cv-response": ["scs"],
17089
+ "application/scvp-vp-request": ["spq"],
17090
+ "application/scvp-vp-response": ["spp"],
17091
+ "application/sdp": ["sdp"],
17092
+ "application/senml+xml": ["senmlx"],
17093
+ "application/sensml+xml": ["sensmlx"],
17094
+ "application/set-payment-initiation": ["setpay"],
17095
+ "application/set-registration-initiation": ["setreg"],
17096
+ "application/shf+xml": ["shf"],
17097
+ "application/sieve": ["siv", "sieve"],
17098
+ "application/smil+xml": ["smi", "smil"],
17099
+ "application/sparql-query": ["rq"],
17100
+ "application/sparql-results+xml": ["srx"],
17101
+ "application/sql": ["sql"],
17102
+ "application/srgs": ["gram"],
17103
+ "application/srgs+xml": ["grxml"],
17104
+ "application/sru+xml": ["sru"],
17105
+ "application/ssdl+xml": ["ssdl"],
17106
+ "application/ssml+xml": ["ssml"],
17107
+ "application/swid+xml": ["swidtag"],
17108
+ "application/tei+xml": ["tei", "teicorpus"],
17109
+ "application/thraud+xml": ["tfi"],
17110
+ "application/timestamped-data": ["tsd"],
17111
+ "application/toml": ["toml"],
17112
+ "application/trig": ["trig"],
17113
+ "application/ttml+xml": ["ttml"],
17114
+ "application/ubjson": ["ubj"],
17115
+ "application/urc-ressheet+xml": ["rsheet"],
17116
+ "application/urc-targetdesc+xml": ["td"],
17117
+ "application/voicexml+xml": ["vxml"],
17118
+ "application/wasm": ["wasm"],
17119
+ "application/watcherinfo+xml": ["wif"],
17120
+ "application/widget": ["wgt"],
17121
+ "application/winhlp": ["hlp"],
17122
+ "application/wsdl+xml": ["wsdl"],
17123
+ "application/wspolicy+xml": ["wspolicy"],
17124
+ "application/xaml+xml": ["xaml"],
17125
+ "application/xcap-att+xml": ["xav"],
17126
+ "application/xcap-caps+xml": ["xca"],
17127
+ "application/xcap-diff+xml": ["xdf"],
17128
+ "application/xcap-el+xml": ["xel"],
17129
+ "application/xcap-ns+xml": ["xns"],
17130
+ "application/xenc+xml": ["xenc"],
17131
+ "application/xfdf": ["xfdf"],
17132
+ "application/xhtml+xml": ["xhtml", "xht"],
17133
+ "application/xliff+xml": ["xlf"],
17134
+ "application/xml": ["xml", "xsl", "xsd", "rng"],
17135
+ "application/xml-dtd": ["dtd"],
17136
+ "application/xop+xml": ["xop"],
17137
+ "application/xproc+xml": ["xpl"],
17138
+ "application/xslt+xml": ["*xsl", "xslt"],
17139
+ "application/xspf+xml": ["xspf"],
17140
+ "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"],
17141
+ "application/yang": ["yang"],
17142
+ "application/yin+xml": ["yin"],
17143
+ "application/zip": ["zip"],
17144
+ "application/zip+dotlottie": ["lottie"],
17145
+ "audio/3gpp": ["*3gpp"],
17146
+ "audio/aac": ["adts", "aac"],
17147
+ "audio/adpcm": ["adp"],
17148
+ "audio/amr": ["amr"],
17149
+ "audio/basic": ["au", "snd"],
17150
+ "audio/midi": ["mid", "midi", "kar", "rmi"],
17151
+ "audio/mobile-xmf": ["mxmf"],
17152
+ "audio/mp3": ["*mp3"],
17153
+ "audio/mp4": ["m4a", "mp4a", "m4b"],
17154
+ "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"],
17155
+ "audio/ogg": ["oga", "ogg", "spx", "opus"],
17156
+ "audio/s3m": ["s3m"],
17157
+ "audio/silk": ["sil"],
17158
+ "audio/wav": ["wav"],
17159
+ "audio/wave": ["*wav"],
17160
+ "audio/webm": ["weba"],
17161
+ "audio/xm": ["xm"],
17162
+ "font/collection": ["ttc"],
17163
+ "font/otf": ["otf"],
17164
+ "font/ttf": ["ttf"],
17165
+ "font/woff": ["woff"],
17166
+ "font/woff2": ["woff2"],
17167
+ "image/aces": ["exr"],
17168
+ "image/apng": ["apng"],
17169
+ "image/avci": ["avci"],
17170
+ "image/avcs": ["avcs"],
17171
+ "image/avif": ["avif"],
17172
+ "image/bmp": ["bmp", "dib"],
17173
+ "image/cgm": ["cgm"],
17174
+ "image/dicom-rle": ["drle"],
17175
+ "image/dpx": ["dpx"],
17176
+ "image/emf": ["emf"],
17177
+ "image/fits": ["fits"],
17178
+ "image/g3fax": ["g3"],
17179
+ "image/gif": ["gif"],
17180
+ "image/heic": ["heic"],
17181
+ "image/heic-sequence": ["heics"],
17182
+ "image/heif": ["heif"],
17183
+ "image/heif-sequence": ["heifs"],
17184
+ "image/hej2k": ["hej2"],
17185
+ "image/ief": ["ief"],
17186
+ "image/jaii": ["jaii"],
17187
+ "image/jais": ["jais"],
17188
+ "image/jls": ["jls"],
17189
+ "image/jp2": ["jp2", "jpg2"],
17190
+ "image/jpeg": ["jpg", "jpeg", "jpe"],
17191
+ "image/jph": ["jph"],
17192
+ "image/jphc": ["jhc"],
17193
+ "image/jpm": ["jpm", "jpgm"],
17194
+ "image/jpx": ["jpx", "jpf"],
17195
+ "image/jxl": ["jxl"],
17196
+ "image/jxr": ["jxr"],
17197
+ "image/jxra": ["jxra"],
17198
+ "image/jxrs": ["jxrs"],
17199
+ "image/jxs": ["jxs"],
17200
+ "image/jxsc": ["jxsc"],
17201
+ "image/jxsi": ["jxsi"],
17202
+ "image/jxss": ["jxss"],
17203
+ "image/ktx": ["ktx"],
17204
+ "image/ktx2": ["ktx2"],
17205
+ "image/pjpeg": ["jfif"],
17206
+ "image/png": ["png"],
17207
+ "image/sgi": ["sgi"],
17208
+ "image/svg+xml": ["svg", "svgz"],
17209
+ "image/t38": ["t38"],
17210
+ "image/tiff": ["tif", "tiff"],
17211
+ "image/tiff-fx": ["tfx"],
17212
+ "image/webp": ["webp"],
17213
+ "image/wmf": ["wmf"],
17214
+ "message/disposition-notification": ["disposition-notification"],
17215
+ "message/global": ["u8msg"],
17216
+ "message/global-delivery-status": ["u8dsn"],
17217
+ "message/global-disposition-notification": ["u8mdn"],
17218
+ "message/global-headers": ["u8hdr"],
17219
+ "message/rfc822": ["eml", "mime", "mht", "mhtml"],
17220
+ "model/3mf": ["3mf"],
17221
+ "model/gltf+json": ["gltf"],
17222
+ "model/gltf-binary": ["glb"],
17223
+ "model/iges": ["igs", "iges"],
17224
+ "model/jt": ["jt"],
17225
+ "model/mesh": ["msh", "mesh", "silo"],
17226
+ "model/mtl": ["mtl"],
17227
+ "model/obj": ["obj"],
17228
+ "model/prc": ["prc"],
17229
+ "model/step": ["step", "stp", "stpnc", "p21", "210"],
17230
+ "model/step+xml": ["stpx"],
17231
+ "model/step+zip": ["stpz"],
17232
+ "model/step-xml+zip": ["stpxz"],
17233
+ "model/stl": ["stl"],
17234
+ "model/u3d": ["u3d"],
17235
+ "model/vrml": ["wrl", "vrml"],
17236
+ "model/x3d+binary": ["*x3db", "x3dbz"],
17237
+ "model/x3d+fastinfoset": ["x3db"],
17238
+ "model/x3d+vrml": ["*x3dv", "x3dvz"],
17239
+ "model/x3d+xml": ["x3d", "x3dz"],
17240
+ "model/x3d-vrml": ["x3dv"],
17241
+ "text/cache-manifest": ["appcache", "manifest"],
17242
+ "text/calendar": ["ics", "ifb"],
17243
+ "text/coffeescript": ["coffee", "litcoffee"],
17244
+ "text/css": ["css"],
17245
+ "text/csv": ["csv"],
17246
+ "text/html": ["html", "htm", "shtml"],
17247
+ "text/jade": ["jade"],
17248
+ "text/javascript": ["js", "mjs"],
17249
+ "text/jsx": ["jsx"],
17250
+ "text/less": ["less"],
17251
+ "text/markdown": ["md", "markdown"],
17252
+ "text/mathml": ["mml"],
17253
+ "text/mdx": ["mdx"],
17254
+ "text/n3": ["n3"],
17255
+ "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"],
17256
+ "text/richtext": ["rtx"],
17257
+ "text/rtf": ["*rtf"],
17258
+ "text/sgml": ["sgml", "sgm"],
17259
+ "text/shex": ["shex"],
17260
+ "text/slim": ["slim", "slm"],
17261
+ "text/spdx": ["spdx"],
17262
+ "text/stylus": ["stylus", "styl"],
17263
+ "text/tab-separated-values": ["tsv"],
17264
+ "text/troff": ["t", "tr", "roff", "man", "me", "ms"],
17265
+ "text/turtle": ["ttl"],
17266
+ "text/uri-list": ["uri", "uris", "urls"],
17267
+ "text/vcard": ["vcard"],
17268
+ "text/vtt": ["vtt"],
17269
+ "text/wgsl": ["wgsl"],
17270
+ "text/xml": ["*xml"],
17271
+ "text/yaml": ["yaml", "yml"],
17272
+ "video/3gpp": ["3gp", "3gpp"],
17273
+ "video/3gpp2": ["3g2"],
17274
+ "video/h261": ["h261"],
17275
+ "video/h263": ["h263"],
17276
+ "video/h264": ["h264"],
17277
+ "video/iso.segment": ["m4s"],
17278
+ "video/jpeg": ["jpgv"],
17279
+ "video/jpm": ["*jpm", "*jpgm"],
17280
+ "video/mj2": ["mj2", "mjp2"],
17281
+ "video/mp2t": ["ts", "m2t", "m2ts", "mts"],
17282
+ "video/mp4": ["mp4", "mp4v", "mpg4"],
17283
+ "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"],
17284
+ "video/ogg": ["ogv"],
17285
+ "video/quicktime": ["qt", "mov"],
17286
+ "video/webm": ["webm"]
17287
+ };
17288
+ Object.freeze(types2);
17289
+ var standard_default = types2;
17290
+
17291
+ // node_modules/mime/dist/src/Mime.js
17292
+ var __classPrivateFieldGet = function(receiver, state, kind, f) {
17293
+ if (kind === "a" && !f)
17294
+ throw new TypeError("Private accessor was defined without a getter");
17295
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
17296
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
17297
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
17298
+ };
17299
+ var _Mime_extensionToType;
17300
+ var _Mime_typeToExtension;
17301
+ var _Mime_typeToExtensions;
17302
+
17303
+ class Mime {
17304
+ constructor(...args) {
17305
+ _Mime_extensionToType.set(this, new Map);
17306
+ _Mime_typeToExtension.set(this, new Map);
17307
+ _Mime_typeToExtensions.set(this, new Map);
17308
+ for (const arg of args) {
17309
+ this.define(arg);
17310
+ }
17311
+ }
17312
+ define(typeMap, force = false) {
17313
+ for (let [type, extensions] of Object.entries(typeMap)) {
17314
+ type = type.toLowerCase();
17315
+ extensions = extensions.map((ext) => ext.toLowerCase());
17316
+ if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, "f").has(type)) {
17317
+ __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").set(type, new Set);
17318
+ }
17319
+ const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type);
17320
+ let first = true;
17321
+ for (let extension of extensions) {
17322
+ const starred = extension.startsWith("*");
17323
+ extension = starred ? extension.slice(1) : extension;
17324
+ allExtensions?.add(extension);
17325
+ if (first) {
17326
+ __classPrivateFieldGet(this, _Mime_typeToExtension, "f").set(type, extension);
17327
+ }
17328
+ first = false;
17329
+ if (starred)
17330
+ continue;
17331
+ const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(extension);
17332
+ if (currentType && currentType != type && !force) {
17333
+ throw new Error(`"${type} -> ${extension}" conflicts with "${currentType} -> ${extension}". Pass \`force=true\` to override this definition.`);
17334
+ }
17335
+ __classPrivateFieldGet(this, _Mime_extensionToType, "f").set(extension, type);
17336
+ }
17337
+ }
17338
+ return this;
17339
+ }
17340
+ getType(path) {
17341
+ if (typeof path !== "string")
17342
+ return null;
17343
+ const last = path.replace(/^.*[/\\]/s, "").toLowerCase();
17344
+ const ext = last.replace(/^.*\./s, "").toLowerCase();
17345
+ const hasPath = last.length < path.length;
17346
+ const hasDot = ext.length < last.length - 1;
17347
+ if (!hasDot && hasPath)
17348
+ return null;
17349
+ return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
17350
+ }
17351
+ getExtension(type) {
17352
+ if (typeof type !== "string")
17353
+ return null;
17354
+ type = type?.split?.(";")[0];
17355
+ return (type && __classPrivateFieldGet(this, _Mime_typeToExtension, "f").get(type.trim().toLowerCase())) ?? null;
17356
+ }
17357
+ getAllExtensions(type) {
17358
+ if (typeof type !== "string")
17359
+ return null;
17360
+ return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type.toLowerCase()) ?? null;
17361
+ }
17362
+ _freeze() {
17363
+ this.define = () => {
17364
+ throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
17365
+ };
17366
+ Object.freeze(this);
17367
+ for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").values()) {
17368
+ Object.freeze(extensions);
17369
+ }
17370
+ return this;
17371
+ }
17372
+ _getTestState() {
17373
+ return {
17374
+ types: __classPrivateFieldGet(this, _Mime_extensionToType, "f"),
17375
+ extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, "f")
17376
+ };
17377
+ }
17378
+ }
17379
+ _Mime_extensionToType = new WeakMap, _Mime_typeToExtension = new WeakMap, _Mime_typeToExtensions = new WeakMap;
17380
+ var Mime_default = Mime;
17381
+
17382
+ // node_modules/mime/dist/src/index.js
17383
+ var src_default = new Mime_default(standard_default, other_default)._freeze();
17384
+
17385
+ // src/lib/SkillFs.ts
17386
+ var readSkillFile = async (path) => {
17387
+ const file2 = Bun.file(path);
17388
+ return file2.text();
17389
+ };
17390
+ var listSkillFiles = (skillPath, subdirectory) => {
17391
+ const glob = new Bun.Glob(join(subdirectory, "**", "*"));
17392
+ return Array.from(glob.scanSync({ cwd: skillPath, absolute: true }));
17393
+ };
17394
+ var findSkillPaths = async (basePath) => {
17395
+ const glob = new Bun.Glob("**/SKILL.md");
17396
+ const results = [];
17397
+ for await (const path of glob.scan({ cwd: basePath, absolute: true })) {
17398
+ results.push(path);
17399
+ }
17400
+ return results;
17401
+ };
17402
+ var doesPathExist = (path) => {
17403
+ return existsSync(path);
17404
+ };
17405
+ var detectMimeType = (filePath) => {
17406
+ return src_default.getType(filePath) || "application/octet-stream";
17407
+ };
17408
+
17409
+ // src/services/SkillSearcher.ts
17410
+ var import_search_string = __toESM(require_searchString(), 1);
17411
+ function parseQuery(queryString) {
17412
+ const queries = Array.isArray(queryString) ? queryString : [queryString];
17413
+ const textSegments = queries.map((query) => {
17414
+ const instance = import_search_string.default.parse(query);
17415
+ return instance.getTextSegments();
17416
+ }).flat();
17417
+ const include = textSegments.filter((s) => !s.negated).map((s) => s.text.toLowerCase()).filter((s) => s.trim().length > 0);
17418
+ const exclude = textSegments.filter((s) => s.negated).map((s) => s.text.toLowerCase()).filter((s) => s.trim().length > 0);
17419
+ return {
17420
+ include,
17421
+ exclude,
17422
+ originalQuery: queries.filter((q) => q.trim().length > 0),
17423
+ hasExclusions: exclude.length > 0,
17424
+ termCount: textSegments.length
17425
+ };
17426
+ }
17427
+ function rankSkill(skill, includeTerms) {
17428
+ const skillName = skill.name.toLowerCase();
17429
+ const skillDesc = skill.description.toLowerCase();
17430
+ let nameMatches = 0;
17431
+ let descMatches = 0;
17432
+ for (const term of includeTerms) {
17433
+ if (skillName.includes(term)) {
17434
+ nameMatches++;
17435
+ } else if (skillDesc.includes(term)) {
17436
+ descMatches++;
17437
+ }
17438
+ }
17439
+ let exactBonus = 0;
17440
+ if (includeTerms.length === 1 && skillName === includeTerms[0]) {
17441
+ exactBonus = 10;
17442
+ }
17443
+ const totalScore = nameMatches * 3 + descMatches * 1 + exactBonus;
17444
+ return { skill, nameMatches, descMatches, totalScore };
17445
+ }
17446
+ function shouldIncludeSkill(skill, excludeTerms) {
17447
+ if (excludeTerms.length === 0) {
17448
+ return true;
17449
+ }
17450
+ const haystack = `${skill.name} ${skill.description}`.toLowerCase();
17451
+ return !excludeTerms.some((term) => haystack.includes(term));
17452
+ }
17453
+ function generateFeedback(query, matchCount) {
17454
+ const parts = [];
17455
+ if (query.include.length > 0) {
17456
+ parts.push(`Searching for: "**${query.originalQuery.join(" ")}**"`);
17457
+ } else {
17458
+ parts.push(`No include search terms provided`);
17459
+ }
17460
+ if (query.hasExclusions) {
17461
+ parts.push(`Excluding: **${query.exclude.join(", ")}**`);
17462
+ }
17463
+ if (matchCount === 0) {
17464
+ parts.push(`No matches found`);
17465
+ parts.push(`- Try different or fewer search terms.`);
17466
+ parts.push(`- Use skill_find("*") to list all skills.`);
17467
+ } else if (matchCount === 1) {
17468
+ parts.push(`Found 1 match`);
17469
+ } else {
17470
+ parts.push(`Found ${matchCount} matches`);
17471
+ }
17472
+ return parts.join(" | ");
17473
+ }
17474
+ function createSkillSearcher(registry2) {
17475
+ function resolveQuery(queryString) {
17476
+ const query = parseQuery(queryString);
17477
+ const skills = registry2.skills;
17478
+ const output = {
17479
+ matches: [],
17480
+ totalMatches: 0,
17481
+ totalSkills: registry2.skills.length,
17482
+ feedback: "",
17483
+ query
17484
+ };
17485
+ if (queryString === "" || queryString === "*" || query.include.length === 1 && query.include[0] === "*" || query.include.length === 0 && query.hasExclusions === false) {
17486
+ output.matches = skills;
17487
+ output.totalMatches = skills.length;
17488
+ output.feedback = `Listing all ${skills.length} skills`;
17489
+ return output;
17490
+ }
17491
+ let results = skills.filter((skill) => {
17492
+ const haystack = `${skill.toolName} ${skill.name} ${skill.description}`.toLowerCase();
17493
+ return query.include.every((term) => haystack.includes(term));
17494
+ });
17495
+ output.matches = results;
17496
+ output.totalMatches = results.length;
17497
+ output.feedback = generateFeedback(query, results.length);
17498
+ return output;
17499
+ }
17500
+ return function search(queryString) {
17501
+ const resolved = resolveQuery(queryString);
17502
+ const results = resolved.matches.filter((skill) => shouldIncludeSkill(skill, resolved.query.exclude));
17503
+ const totalMatches = results.length;
17504
+ const ranked = results.map((skill) => rankSkill(skill, resolved.query.include)).sort((a, b) => {
17505
+ if (b.totalScore !== a.totalScore) {
17506
+ return b.totalScore - a.totalScore;
17507
+ }
17508
+ if (b.nameMatches !== a.nameMatches) {
17509
+ return b.nameMatches - a.nameMatches;
17510
+ }
17511
+ return a.skill.name.localeCompare(b.skill.name);
17512
+ });
17513
+ const matches = ranked.map((r) => r.skill);
17514
+ return {
17515
+ matches,
17516
+ totalMatches,
17517
+ feedback: resolved.feedback,
17518
+ query: resolved.query,
17519
+ totalSkills: registry2.skills.length
17520
+ };
17521
+ };
17522
+ }
17523
+
17524
+ // src/lib/ReadyStateMachine.ts
17525
+ function createReadyStateMachine() {
17526
+ const state = {
17527
+ status: "idle",
17528
+ watchers: new Set
17529
+ };
17530
+ const setStatus = (newStatus) => {
17531
+ state.status = newStatus;
17532
+ state.watchers.forEach((watcher) => watcher(state.status));
17533
+ };
17534
+ const watchReady = (callback) => {
17535
+ state.watchers.add(callback);
17536
+ return () => {
17537
+ state.watchers.delete(callback);
17538
+ };
17539
+ };
17540
+ const whenReady = async () => {
17541
+ while (state.status !== "ready" && state.status !== "error") {
17542
+ await new Promise((resolve) => {
17543
+ const unsubscribe = watchReady(() => {
17544
+ unsubscribe();
17545
+ resolve(null);
17546
+ });
17547
+ });
17548
+ }
17549
+ if (state.status === "error") {
17550
+ throw new Error("Ready state machine failed to initialize");
17551
+ }
17552
+ };
17553
+ return {
17554
+ setStatus,
17555
+ watchReady,
17556
+ whenReady
17557
+ };
17558
+ }
17559
+
17560
+ // src/services/SkillRegistry.ts
17561
+ var SkillFrontmatterSchema = tool.schema.object({
17562
+ name: tool.schema.string().optional(),
17563
+ description: tool.schema.string().min(20, "Description must be at least 20 characters for discoverability"),
17564
+ license: tool.schema.string().optional(),
17565
+ "allowed-tools": tool.schema.array(tool.schema.string()).optional(),
17566
+ metadata: tool.schema.record(tool.schema.string(), tool.schema.string()).optional()
17567
+ });
17568
+ function createSkillRegistryController() {
17569
+ const store = new Map;
17570
+ const controller = {
17571
+ ready: createReadyStateMachine(),
17572
+ get skills() {
17573
+ return Array.from(store.values()).sort((a, b) => a.name.localeCompare(b.name));
17574
+ },
17575
+ get ids() {
17576
+ return Array.from(store.keys()).sort();
17577
+ },
17578
+ delete(_key) {
17579
+ store.delete(_key);
17580
+ },
17581
+ clear: () => store.clear(),
17582
+ has: (key) => store.has(key),
17583
+ get: (key) => store.get(key),
17584
+ set: (key, skill) => {
17585
+ store.set(key, skill);
17586
+ }
17587
+ };
17588
+ return controller;
16325
17589
  }
16326
- tool.schema = exports_external;
16327
- // src/services/OpenCodeChat.ts
16328
- function createInstructionInjector(ctx) {
16329
- const sendPrompt = async (text, props) => {
16330
- await ctx.client.session.prompt({
16331
- path: { id: props.sessionId },
16332
- body: {
16333
- noReply: true,
16334
- parts: [{ type: "text", text }]
17590
+ async function createSkillRegistry(config2, logger) {
17591
+ const controller = createSkillRegistryController();
17592
+ const debug = {
17593
+ discovered: 0,
17594
+ parsed: 0,
17595
+ rejected: 0,
17596
+ errors: []
17597
+ };
17598
+ const initialise = async () => {
17599
+ controller.ready.setStatus("loading");
17600
+ try {
17601
+ const paths = [];
17602
+ const existingBasePaths = config2.basePaths.filter(doesPathExist);
17603
+ if (existingBasePaths.length === 0) {
17604
+ logger.warn("[OpencodeSkillful] No valid base paths found for skill discovery:", config2.basePaths);
17605
+ controller.ready.setStatus("ready");
17606
+ return;
17607
+ }
17608
+ logger.debug("[SkillRegistryController] Discovering skills in base paths:", existingBasePaths);
17609
+ for (const basePath of existingBasePaths) {
17610
+ const found = await findSkillPaths(basePath);
17611
+ paths.push(...found);
17612
+ }
17613
+ logger.debug("[SkillRegistryController] skills.discovered", paths.length);
17614
+ debug.discovered = paths.length;
17615
+ if (paths.length === 0) {
17616
+ controller.ready.setStatus("ready");
17617
+ logger.debug("[SkillRegistryController] No skills found");
17618
+ return;
17619
+ }
17620
+ const results = await register(...paths);
17621
+ logger.debug("[SkillRegistryController] skills.initialise results", results);
17622
+ debug.parsed = results.parsed;
17623
+ debug.rejected = results.rejected;
17624
+ debug.errors = results.errors;
17625
+ controller.ready.setStatus("ready");
17626
+ } catch (error45) {
17627
+ const errorMessage = error45 instanceof Error ? error45.message : String(error45);
17628
+ logger.error("[SkillRegistryController] Initialization failed:", errorMessage);
17629
+ controller.ready.setStatus("error");
17630
+ }
17631
+ };
17632
+ const matchBasePath = (absolutePath) => {
17633
+ for (const basePath of config2.basePaths) {
17634
+ if (absolutePath.startsWith(basePath)) {
17635
+ return basePath;
17636
+ }
17637
+ }
17638
+ return null;
17639
+ };
17640
+ const register = async (...paths) => {
17641
+ logger.debug(`[SkillRegistryController] register [${paths.length}] skills`);
17642
+ const summary = {
17643
+ discovered: paths.length,
17644
+ parsed: 0,
17645
+ rejected: 0,
17646
+ errors: []
17647
+ };
17648
+ for await (const path of paths) {
17649
+ try {
17650
+ const content = await readSkillFile(path);
17651
+ const skill = await parseSkill({
17652
+ skillPath: path,
17653
+ basePath: matchBasePath(path) || "",
17654
+ content
17655
+ });
17656
+ if (!skill) {
17657
+ summary.rejected++;
17658
+ summary.errors.push(`[NOSKILLERROR] Failed to parse skill at ${path}`);
17659
+ logger.debug("[SkillRegistryController] error [NOSKILLERROR]", path, "=> NO SKILL");
17660
+ continue;
17661
+ }
17662
+ controller.set(skill.toolName, skill);
17663
+ summary.parsed++;
17664
+ } catch (error45) {
17665
+ summary.rejected++;
17666
+ summary.errors.push(error45 instanceof Error ? error45.message : `[UNKNOWNERROR] Unknown error at ${path}`);
17667
+ continue;
16335
17668
  }
17669
+ }
17670
+ logger.debug("errors", JSON.stringify(summary.errors, null, 2));
17671
+ return summary;
17672
+ };
17673
+ const isSkillPath = (path) => {
17674
+ return path.endsWith("SKILL.md") && config2.basePaths.some((basePath) => path.startsWith(basePath));
17675
+ };
17676
+ const getToolnameFromSkillPath = (path) => {
17677
+ if (!isSkillPath(path)) {
17678
+ return null;
17679
+ }
17680
+ const relativePath = relative(config2.basePaths.find((basePath) => path.startsWith(basePath)) || "", path);
17681
+ return toolName(relativePath);
17682
+ };
17683
+ const search = createSkillSearcher(controller);
17684
+ return {
17685
+ config: config2,
17686
+ controller,
17687
+ initialise,
17688
+ register,
17689
+ isSkillPath,
17690
+ getToolnameFromSkillPath,
17691
+ search,
17692
+ debug,
17693
+ logger
17694
+ };
17695
+ }
17696
+ async function parseSkill(args) {
17697
+ const relativePath = relative(args.basePath, args.skillPath);
17698
+ if (!relativePath) {
17699
+ throw new Error(`\u274C Skill path does not match expected pattern: ${args.skillPath}`);
17700
+ }
17701
+ if (!args.content) {
17702
+ throw new Error(`\u274C Unable to read skill file: ${args.skillPath}`);
17703
+ }
17704
+ const parsed = import_gray_matter.default(args.content);
17705
+ const frontmatter = SkillFrontmatterSchema.safeParse(parsed.data);
17706
+ if (!frontmatter.success) {
17707
+ throw new Error(`[FrontMatterInvalid] ${args.skillPath} [${JSON.stringify(frontmatter.error.issues)}]`, {
17708
+ cause: frontmatter.error
16336
17709
  });
17710
+ }
17711
+ const shortName = basename(dirname(args.skillPath));
17712
+ const skillFullPath = dirname(args.skillPath);
17713
+ const scriptPaths = listSkillFiles(skillFullPath, "scripts");
17714
+ const referencePaths = listSkillFiles(skillFullPath, "references");
17715
+ const assetPaths = listSkillFiles(skillFullPath, "assets");
17716
+ return {
17717
+ allowedTools: frontmatter.data["allowed-tools"],
17718
+ content: parsed.content.trim(),
17719
+ description: frontmatter.data.description,
17720
+ fullPath: skillFullPath,
17721
+ toolName: toolName(relativePath),
17722
+ license: frontmatter.data.license,
17723
+ metadata: frontmatter.data.metadata,
17724
+ name: shortName,
17725
+ path: args.skillPath,
17726
+ scripts: createSkillResourceMap(skillFullPath, scriptPaths),
17727
+ references: createSkillResourceMap(skillFullPath, referencePaths),
17728
+ assets: createSkillResourceMap(skillFullPath, assetPaths)
16337
17729
  };
16338
- return sendPrompt;
16339
17730
  }
16340
-
16341
- // src/services/SkillFs.ts
16342
- import { join } from "path";
16343
- import { existsSync } from "fs";
16344
- var readSkillFile = async (path2) => {
16345
- const file2 = Bun.file(path2);
16346
- return file2.text();
16347
- };
16348
- var listSkillFiles = (skillPath, subdirectory) => {
16349
- const glob = new Bun.Glob(join(subdirectory, "**", "*"));
16350
- return Array.from(glob.scanSync({ cwd: skillPath, absolute: true }));
16351
- };
16352
- var findSkillPaths = async (basePath) => {
16353
- const results = [];
16354
- const glob = new Bun.Glob("**/SKILL.md");
16355
- for await (const match of glob.scan({ cwd: basePath })) {
16356
- results.push(createDiscoveredSkillPath(basePath, match));
17731
+ function createSkillResourceMap(skillPath, filePaths) {
17732
+ const output = new Map;
17733
+ for (const filePath of filePaths) {
17734
+ const relativePath = relative(skillPath, filePath);
17735
+ output.set(relativePath, {
17736
+ absolutePath: filePath,
17737
+ mimeType: detectMimeType(filePath)
17738
+ });
16357
17739
  }
16358
- return results;
16359
- };
16360
- var doesPathExist = (path2) => {
16361
- return existsSync(path2);
16362
- };
16363
- var detectMimeType = (filePath) => {
16364
- const ext = filePath.toLowerCase().split(".").pop() || "";
16365
- const mimeTypes = {
16366
- sh: "application/x-sh",
16367
- bash: "application/x-sh",
16368
- zsh: "application/x-sh",
16369
- py: "text/x-python",
16370
- js: "application/javascript",
16371
- ts: "application/typescript",
16372
- node: "application/javascript",
16373
- md: "text/markdown",
16374
- txt: "text/plain",
16375
- pdf: "application/pdf",
16376
- svg: "image/svg+xml",
16377
- png: "image/png",
16378
- jpg: "image/jpeg",
16379
- jpeg: "image/jpeg",
16380
- gif: "image/gif",
16381
- webp: "image/webp",
16382
- json: "application/json",
16383
- yaml: "application/yaml",
16384
- yml: "application/yaml",
16385
- xml: "application/xml",
16386
- csv: "text/csv",
16387
- html: "text/html",
16388
- css: "text/css"
16389
- };
16390
- return mimeTypes[ext] || "application/octet-stream";
16391
- };
16392
- function createDiscoveredSkillPath(basePath, relativeSkillPath) {
16393
- return {
16394
- basePath,
16395
- absolutePath: join(basePath, relativeSkillPath)
17740
+ return output;
17741
+ }
17742
+
17743
+ // src/tools/SkillFinder.ts
17744
+ function createSkillFinder(provider) {
17745
+ return async (args) => {
17746
+ await provider.controller.ready.whenReady();
17747
+ const result = provider.search(args.query);
17748
+ const skills = result.matches.map((skill) => ({
17749
+ name: skill.toolName,
17750
+ description: skill.description
17751
+ }));
17752
+ return {
17753
+ query: args.query,
17754
+ skills,
17755
+ summary: {
17756
+ total: provider.controller.skills.length,
17757
+ matches: result.totalMatches,
17758
+ feedback: result.feedback
17759
+ },
17760
+ debug: provider.debug
17761
+ };
16396
17762
  };
16397
17763
  }
16398
17764
 
17765
+ // src/tools/SkillResourceReader.ts
17766
+ import path from "path";
17767
+
16399
17768
  // src/services/SkillResourceResolver.ts
16400
17769
  function createSkillResourceResolver(provider) {
16401
17770
  const resolveResourceMap = (skill, type) => {
@@ -16410,7 +17779,7 @@ function createSkillResourceResolver(provider) {
16410
17779
  }
16411
17780
  };
16412
17781
  return async (args) => {
16413
- const skill = provider.registry.get(args.skill_name);
17782
+ const skill = provider.controller.get(args.skill_name);
16414
17783
  if (!skill) {
16415
17784
  throw new Error(`Skill not found: ${args.skill_name}`);
16416
17785
  }
@@ -16435,432 +17804,253 @@ function createSkillResourceResolver(provider) {
16435
17804
  };
16436
17805
  }
16437
17806
 
17807
+ // src/types.ts
17808
+ var ResourceTypes = ["script", "asset", "reference"];
17809
+ var assertIsValidResourceType = (type) => {
17810
+ if (!ResourceTypes.includes(type)) {
17811
+ throw new Error(`Invalid resource type: ${type}`);
17812
+ }
17813
+ };
17814
+
16438
17815
  // src/tools/SkillResourceReader.ts
16439
- function createToolResourceReader(ctx, provider) {
16440
- const sendPrompt = createInstructionInjector(ctx);
17816
+ function createSkillResourceReader(provider) {
16441
17817
  const skillResourceResolver = createSkillResourceResolver(provider);
16442
- return tool({
16443
- description: `Read a resource file from a skill.`,
16444
- args: {
16445
- skill_name: tool.schema.string().describe("The skill id to read the resource from."),
16446
- relative_path: tool.schema.string().describe("The relative path to the resource file within the skill directory.")
16447
- },
16448
- execute: async (args, toolCtx) => {
16449
- const resource = await skillResourceResolver({
16450
- skill_name: args.skill_name,
16451
- type: "reference",
16452
- relative_path: args.relative_path
16453
- });
16454
- await sendPrompt(`<Resource skill="${args.skill_name}" path="${args.relative_path}" type="${resource.mimeType}">${resource.content}</Resource>`, { sessionId: toolCtx.sessionID });
16455
- return `
16456
- Load Skill Resource
16457
-
16458
- skill: ${args.skill_name}
16459
- resource: ${args.relative_path}
16460
- type: ${resource.mimeType}
16461
- `;
16462
- }
16463
- });
17818
+ return async (args) => {
17819
+ await provider.controller.ready.whenReady();
17820
+ const [type, ...restPath] = args.relative_path.split("/");
17821
+ assertIsValidResourceType(type);
17822
+ const resource = await skillResourceResolver({
17823
+ skill_name: args.skill_name,
17824
+ type,
17825
+ relative_path: path.join(...restPath)
17826
+ });
17827
+ const injection = {
17828
+ skill_name: args.skill_name,
17829
+ resource_path: args.relative_path,
17830
+ resource_mimetype: resource.mimeType,
17831
+ content: resource.content
17832
+ };
17833
+ return {
17834
+ injection
17835
+ };
17836
+ };
16464
17837
  }
16465
17838
 
16466
17839
  // src/tools/SkillUser.ts
16467
- function createUseSkillsTool(ctx, provider) {
16468
- const skillLoader = createSkillLoader(provider.registry);
16469
- const sendPrompt = createInstructionInjector(ctx);
16470
- return tool({
16471
- description: "Load one or more skills into the chat. Provide an array of skill names to load them as user messages.",
16472
- args: {
16473
- skill_names: tool.schema.array(tool.schema.string()).min(1, "Must provide at least one skill name")
16474
- },
16475
- execute: async (args, toolCtx) => {
16476
- const results = await skillLoader(args.skill_names, async (content) => {
16477
- sendPrompt(content, { sessionId: toolCtx.sessionID });
16478
- });
16479
- return results;
16480
- }
16481
- });
16482
- }
16483
- function createSkillLoader(registry2) {
16484
- function renderResources(skill) {
16485
- const resources = [
16486
- ...Array.from(skill.references || []),
16487
- ...Array.from(skill.assets || []),
16488
- ...Array.from(skill.scripts || [])
16489
- ].map(([relativePath, resourceData]) => `<SkillResource relative-path="${relativePath}" absolute-path="${resourceData.absolutePath}" mime-type="${resourceData.mimeType}"/>`).join(`
16490
- `);
16491
- return resources;
16492
- }
16493
- function render(skill) {
16494
- const resources = renderResources(skill);
16495
- const content = `
16496
- <Skill>
16497
- <SkillName>${skill.name}</SkillName>
16498
- <SkillDescription>${skill.description}</SkillDescription>
16499
- ${resources && `<SkillResources>${resources}</SkillResources>`}
16500
- <SkillContent>${skill.content}</SkillContent>
16501
- </Skill>
16502
- `;
16503
- return content;
16504
- }
16505
- async function loadSkills(skillNames, onLoad) {
17840
+ function createSkillLoader(provider) {
17841
+ const registry2 = provider.controller;
17842
+ async function loadSkills(skillNames) {
17843
+ await provider.controller.ready.whenReady();
16506
17844
  const loaded = [];
16507
17845
  const notFound = [];
16508
- for (const skillName of skillNames) {
16509
- const skill = registry2.get(skillName);
16510
- if (!skill) {
16511
- notFound.push(skillName);
16512
- continue;
17846
+ for (const name of skillNames) {
17847
+ const skill = registry2.get(name);
17848
+ if (skill) {
17849
+ loaded.push(skill);
17850
+ } else {
17851
+ notFound.push(name);
16513
17852
  }
16514
- await onLoad(render(skill));
16515
- loaded.push(skill.toolName);
16516
17853
  }
16517
- return JSON.stringify({ loaded, notFound });
17854
+ return {
17855
+ loaded,
17856
+ notFound
17857
+ };
16518
17858
  }
16519
17859
  return loadSkills;
16520
17860
  }
16521
17861
 
16522
- // src/tools/SkillFinder.ts
16523
- function createFindSkillsTool(_ctx, provider) {
16524
- return tool({
16525
- description: `Search for skills using natural query syntax`,
16526
- args: {
16527
- query: tool.schema.union([tool.schema.string(), tool.schema.array(tool.schema.string())]).describe(`The search query. Supports natural syntax, negation (-term), quoted phrases ("exact match"), and path prefixes (e.g., "experts/"). Use "*" or leave empty to list all skills.`)
16528
- },
16529
- execute: async (args) => {
16530
- const result = provider.searcher(args.query);
16531
- const results = result.matches.map((skill) => `<Skill skill_name="${skill.toolName}" skill_shortname="${skill.name}">${skill.description}</Skill>`).join(`
16532
- `);
16533
- const debugInfo = provider.debug ? `
16534
- <Debug>
16535
- <Discovered>${provider.debug.discovered}</Discovered>
16536
- <Parsed>${provider.debug.parsed}</Parsed>
16537
- <Rejected>${provider.debug.rejected}</Rejected>
16538
- <Duplicates>${provider.debug.duplicates}</Duplicates>
16539
- <Errors>
16540
- ${provider.debug.errors.map((e) => `<Error>${e}</Error>`).join(`
16541
- `)}
16542
- </Errors>
16543
- </Debug>` : "";
16544
- return `<SkillSearchResults query="${args.query}">
16545
- <Skills>
16546
- ${results}
16547
- </Skills>
16548
- <Summary>
16549
- <Total>${provider.registry.skills.length}</Total>
16550
- <Matches>${result.totalMatches}</Matches>
16551
- <Feedback>${result.feedback}</Feedback>
16552
- ${debugInfo}
16553
- </Summary>
16554
- </SkillSearchResults>`;
16555
- }
16556
- });
16557
- }
16558
-
16559
- // src/services/ScriptResourceExecutor.ts
16560
- var Bun2 =globalThis.Bun;
16561
- function createScriptResourceExecutor(provider) {
16562
- const skillResourceResolver = createSkillResourceResolver(provider);
16563
- return async function(args) {
16564
- const script = await skillResourceResolver({
16565
- skill_name: args.skill_name,
16566
- type: "script",
16567
- relative_path: args.relative_path
16568
- });
16569
- const result = await Bun2.$`${script.absolute_path} ${args.args ?? []}`;
16570
- return result;
17862
+ // src/api.ts
17863
+ var createApi = async (config2) => {
17864
+ const logger = createLogger(config2);
17865
+ const registry2 = await createSkillRegistry(config2, logger);
17866
+ return {
17867
+ registry: registry2,
17868
+ logger,
17869
+ findSkills: createSkillFinder(registry2),
17870
+ readResource: createSkillResourceReader(registry2),
17871
+ loadSkill: createSkillLoader(registry2)
16571
17872
  };
16572
- }
17873
+ };
16573
17874
 
16574
- // src/tools/SkillScriptExec.ts
16575
- function createSkillScriptExecTool(ctx, provider) {
16576
- const sendPrompt = createInstructionInjector(ctx);
16577
- const scriptResourceExecutor = createScriptResourceExecutor(provider);
16578
- return tool({
16579
- description: "Execute scripts from skill resources with arguments",
16580
- args: {
16581
- skill_name: tool.schema.string(),
16582
- relative_path: tool.schema.string(),
16583
- args: tool.schema.array(tool.schema.string()).optional()
16584
- },
16585
- execute: async (args, toolCtx) => {
16586
- const execResult = await scriptResourceExecutor({
16587
- skill_name: args.skill_name,
16588
- relative_path: args.relative_path,
16589
- args: args.args
16590
- });
16591
- await sendPrompt(`Executed script from skill "${args.skill_name}": ${args.relative_path}
17875
+ // src/config.ts
17876
+ import { join as join2 } from "path";
16592
17877
 
16593
- Exit Code: ${execResult.exitCode}
16594
- STDOUT: ${execResult.stdout}
16595
- STDERR: ${execResult.stderr}`, { sessionId: toolCtx.sessionID });
16596
- return execResult.text();
16597
- }
16598
- });
17878
+ // node_modules/ramda/es/internal/_isPlaceholder.js
17879
+ function _isPlaceholder(a) {
17880
+ return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
16599
17881
  }
16600
17882
 
16601
- // src/services/SkillSearcher.ts
16602
- var import_search_string = __toESM(require_searchString(), 1);
16603
- function parseQuery(queryString) {
16604
- const queries = Array.isArray(queryString) ? queryString : [queryString];
16605
- const textSegments = queries.map((query) => {
16606
- const instance = import_search_string.default.parse(query);
16607
- return instance.getTextSegments();
16608
- }).flat();
16609
- const include = textSegments.filter((s) => !s.negated).map((s) => s.text.toLowerCase()).filter((s) => s.trim().length > 0);
16610
- const exclude = textSegments.filter((s) => s.negated).map((s) => s.text.toLowerCase()).filter((s) => s.trim().length > 0);
16611
- return {
16612
- include,
16613
- exclude,
16614
- originalQuery: queries.filter((q) => q.trim().length > 0),
16615
- hasExclusions: exclude.length > 0,
16616
- termCount: textSegments.length
16617
- };
16618
- }
16619
- function rankSkill(skill, includeTerms) {
16620
- const skillName = skill.name.toLowerCase();
16621
- const skillDesc = skill.description.toLowerCase();
16622
- let nameMatches = 0;
16623
- let descMatches = 0;
16624
- for (const term of includeTerms) {
16625
- if (skillName.includes(term)) {
16626
- nameMatches++;
16627
- } else if (skillDesc.includes(term)) {
16628
- descMatches++;
17883
+ // node_modules/ramda/es/internal/_curry1.js
17884
+ function _curry1(fn) {
17885
+ return function f1(a) {
17886
+ if (arguments.length === 0 || _isPlaceholder(a)) {
17887
+ return f1;
17888
+ } else {
17889
+ return fn.apply(this, arguments);
16629
17890
  }
16630
- }
16631
- let exactBonus = 0;
16632
- if (includeTerms.length === 1 && skillName === includeTerms[0]) {
16633
- exactBonus = 10;
16634
- }
16635
- const totalScore = nameMatches * 3 + descMatches * 1 + exactBonus;
16636
- return { skill, nameMatches, descMatches, totalScore };
16637
- }
16638
- function shouldIncludeSkill(skill, excludeTerms) {
16639
- if (excludeTerms.length === 0) {
16640
- return true;
16641
- }
16642
- const haystack = `${skill.name} ${skill.description}`.toLowerCase();
16643
- return !excludeTerms.some((term) => haystack.includes(term));
17891
+ };
16644
17892
  }
16645
- function createSkillSearcher(registry2) {
16646
- function resolveQuery(queryString) {
16647
- const query = parseQuery(queryString);
16648
- const skills = registry2.skills;
16649
- const output = {
16650
- matches: [],
16651
- totalMatches: 0,
16652
- totalSkills: registry2.skills.length,
16653
- feedback: "",
16654
- query
16655
- };
16656
- if (queryString === "" || queryString === "*") {
16657
- output.matches = skills;
16658
- output.totalMatches = skills.length;
16659
- output.feedback = `\u2705 Listing all ${skills.length} skills`;
16660
- return output;
16661
- }
16662
- if (query.include.length === 0) {
16663
- output.feedback = `\u274C No valid search terms provided in query "${queryString}"`;
16664
- return output;
17893
+
17894
+ // node_modules/ramda/es/internal/_curry2.js
17895
+ function _curry2(fn) {
17896
+ return function f2(a, b) {
17897
+ switch (arguments.length) {
17898
+ case 0:
17899
+ return f2;
17900
+ case 1:
17901
+ return _isPlaceholder(a) ? f2 : _curry1(function(_b) {
17902
+ return fn(a, _b);
17903
+ });
17904
+ default:
17905
+ return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function(_a) {
17906
+ return fn(_a, b);
17907
+ }) : _isPlaceholder(b) ? _curry1(function(_b) {
17908
+ return fn(a, _b);
17909
+ }) : fn(a, b);
16665
17910
  }
16666
- let results = skills.filter((skill) => {
16667
- const haystack = `${skill.toolName} ${skill.name} ${skill.description}`.toLowerCase();
16668
- return query.include.every((term) => haystack.includes(term));
16669
- });
16670
- output.matches = results;
16671
- output.totalMatches = results.length;
16672
- output.feedback = `\u2705 Found ${results.length} matches for query "${queryString}"`;
16673
- return output;
16674
- }
16675
- return function search(queryString) {
16676
- const resolved = resolveQuery(queryString);
16677
- const feedback = resolved.feedback;
16678
- const query = resolved.query;
16679
- const results = resolved.matches.filter((skill) => shouldIncludeSkill(skill, resolved.query.exclude));
16680
- const totalMatches = results.length;
16681
- const ranked = results.map((skill) => rankSkill(skill, query.include)).sort((a, b) => {
16682
- if (b.totalScore !== a.totalScore) {
16683
- return b.totalScore - a.totalScore;
16684
- }
16685
- if (b.nameMatches !== a.nameMatches) {
16686
- return b.nameMatches - a.nameMatches;
16687
- }
16688
- return a.skill.name.localeCompare(b.skill.name);
16689
- });
16690
- const matches = ranked.map((r) => r.skill);
16691
- return {
16692
- matches,
16693
- totalMatches,
16694
- feedback,
16695
- query,
16696
- totalSkills: registry2.skills.length
16697
- };
16698
17911
  };
16699
17912
  }
16700
17913
 
16701
- // src/services/SkillProvider.ts
16702
- function createSkillProvider(args) {
16703
- return {
16704
- registry: args.controller,
16705
- searcher: createSkillSearcher(args.controller),
16706
- debug: args.debug,
16707
- logger: args.logger
17914
+ // node_modules/ramda/es/internal/_curry3.js
17915
+ function _curry3(fn) {
17916
+ return function f3(a, b, c) {
17917
+ switch (arguments.length) {
17918
+ case 0:
17919
+ return f3;
17920
+ case 1:
17921
+ return _isPlaceholder(a) ? f3 : _curry2(function(_b, _c) {
17922
+ return fn(a, _b, _c);
17923
+ });
17924
+ case 2:
17925
+ return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function(_a, _c) {
17926
+ return fn(_a, b, _c);
17927
+ }) : _isPlaceholder(b) ? _curry2(function(_b, _c) {
17928
+ return fn(a, _b, _c);
17929
+ }) : _curry1(function(_c) {
17930
+ return fn(a, b, _c);
17931
+ });
17932
+ default:
17933
+ return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function(_a, _b) {
17934
+ return fn(_a, _b, c);
17935
+ }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function(_a, _c) {
17936
+ return fn(_a, b, _c);
17937
+ }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function(_b, _c) {
17938
+ return fn(a, _b, _c);
17939
+ }) : _isPlaceholder(a) ? _curry1(function(_a) {
17940
+ return fn(_a, b, c);
17941
+ }) : _isPlaceholder(b) ? _curry1(function(_b) {
17942
+ return fn(a, _b, c);
17943
+ }) : _isPlaceholder(c) ? _curry1(function(_c) {
17944
+ return fn(a, b, _c);
17945
+ }) : fn(a, b, c);
17946
+ }
16708
17947
  };
16709
17948
  }
16710
17949
 
16711
- // src/services/SkillRegistry.ts
16712
- var import_gray_matter = __toESM(require_gray_matter(), 1);
16713
- import { dirname, basename, relative } from "path";
17950
+ // node_modules/ramda/es/internal/_has.js
17951
+ function _has(prop, obj) {
17952
+ return Object.prototype.hasOwnProperty.call(obj, prop);
17953
+ }
16714
17954
 
16715
- // src/services/identifiers.ts
16716
- import { sep } from "path";
16717
- function toolName(skillPath) {
16718
- return skillPath.replace(/SKILL\.md$/, "").split(sep).filter(Boolean).join("_").replace(/-/g, "_");
17955
+ // node_modules/ramda/es/internal/_isObject.js
17956
+ function _isObject(x) {
17957
+ return Object.prototype.toString.call(x) === "[object Object]";
16719
17958
  }
16720
17959
 
16721
- // src/services/SkillRegistry.ts
16722
- var SkillFrontmatterSchema = tool.schema.object({
16723
- name: tool.schema.string().optional(),
16724
- description: tool.schema.string().min(20, "Description must be at least 20 characters for discoverability"),
16725
- license: tool.schema.string().optional(),
16726
- "allowed-tools": tool.schema.array(tool.schema.string()).optional(),
16727
- metadata: tool.schema.record(tool.schema.string(), tool.schema.string()).optional()
16728
- });
16729
- function createSkillRegistryController(skills) {
16730
- const registry2 = new Map(!skills ? [] : skills.map((skill) => [skill.toolName, skill]));
16731
- return {
16732
- get skills() {
16733
- return Array.from(registry2.values()).sort((a, b) => a.name.localeCompare(b.name));
16734
- },
16735
- get ids() {
16736
- return Array.from(registry2.keys()).sort();
16737
- },
16738
- has: (key) => registry2.has(key),
16739
- get: (key) => registry2.get(key),
16740
- add: (key, skill) => {
16741
- registry2.set(key, skill);
17960
+ // node_modules/ramda/es/mergeWithKey.js
17961
+ var mergeWithKey = /* @__PURE__ */ _curry3(function mergeWithKey2(fn, l, r) {
17962
+ var result = {};
17963
+ var k;
17964
+ l = l || {};
17965
+ r = r || {};
17966
+ for (k in l) {
17967
+ if (_has(k, l)) {
17968
+ result[k] = _has(k, r) ? fn(k, l[k], r[k]) : l[k];
16742
17969
  }
16743
- };
16744
- }
16745
- async function createSkillRegistry(config2, logger) {
16746
- const controller = createSkillRegistryController();
16747
- const debug = {
16748
- discovered: 0,
16749
- parsed: 0,
16750
- rejected: 0,
16751
- duplicates: 0,
16752
- errors: []
16753
- };
16754
- const basePaths = config2.basePaths.filter(doesPathExist);
16755
- const matches = [];
16756
- for (const basePath of basePaths) {
16757
- const found = await findSkillPaths(basePath);
16758
- matches.push(...found);
16759
17970
  }
16760
- logger.debug("[SkillRegistryController] skills.discovered", matches.map((m) => m.absolutePath));
16761
- debug.discovered = matches.length;
16762
- const dupes = [];
16763
- for await (const match of matches) {
16764
- try {
16765
- const content = await readSkillFile(match.absolutePath);
16766
- logger.debug("[SkillRegistryController] readSkill", match.absolutePath);
16767
- const skill = await parseSkill(match, content);
16768
- logger.debug("[SkillRegistryController] parseSkill", match.absolutePath, skill);
16769
- if (!skill) {
16770
- debug.rejected++;
16771
- debug.errors.push(`[NOSKILLERROR] Failed to parse skill at ${match.absolutePath}`);
16772
- continue;
16773
- }
16774
- if (controller.has(skill.toolName)) {
16775
- dupes.push(skill.toolName);
16776
- debug.rejected++;
16777
- debug.errors.push(`[DUPESKILL] Duplicate skill name: ${skill.toolName}`);
16778
- continue;
16779
- }
16780
- controller.add(skill.toolName, skill);
16781
- debug.parsed++;
16782
- } catch (error45) {
16783
- debug.rejected++;
16784
- debug.errors.push(error45 instanceof Error ? error45.message : `[UNKNOWNERROR] Unknown error at ${match.absolutePath}`);
16785
- continue;
17971
+ for (k in r) {
17972
+ if (_has(k, r) && !_has(k, result)) {
17973
+ result[k] = r[k];
16786
17974
  }
16787
17975
  }
16788
- logger.debug("errors", JSON.stringify(debug.errors, null, 2));
16789
- return { controller, debug };
16790
- }
16791
- async function parseSkill(skillPath, content) {
16792
- const relativePath = relative(skillPath.basePath, skillPath.absolutePath);
16793
- if (!relativePath) {
16794
- throw new Error(`\u274C Skill path does not match expected pattern: ${skillPath.absolutePath}`);
16795
- }
16796
- if (!content) {
16797
- throw new Error(`\u274C Unable to read skill file: ${skillPath.absolutePath}`);
16798
- }
16799
- const parsed = import_gray_matter.default(content);
16800
- const frontmatter = SkillFrontmatterSchema.safeParse(parsed.data);
16801
- if (!frontmatter.success) {
16802
- throw new Error(`[FrontMatterInvalid] ${skillPath.absolutePath} [${JSON.stringify(frontmatter.error.issues)}]`, {
16803
- cause: frontmatter.error
16804
- });
16805
- }
16806
- const shortName = basename(dirname(skillPath.absolutePath));
16807
- const skillFullPath = dirname(skillPath.absolutePath);
16808
- const scriptPaths = listSkillFiles(skillFullPath, "scripts");
16809
- const referencePaths = listSkillFiles(skillFullPath, "references");
16810
- const assetPaths = listSkillFiles(skillFullPath, "assets");
17976
+ return result;
17977
+ });
17978
+ var mergeWithKey_default = mergeWithKey;
17979
+
17980
+ // node_modules/ramda/es/mergeDeepWithKey.js
17981
+ var mergeDeepWithKey = /* @__PURE__ */ _curry3(function mergeDeepWithKey2(fn, lObj, rObj) {
17982
+ return mergeWithKey_default(function(k, lVal, rVal) {
17983
+ if (_isObject(lVal) && _isObject(rVal)) {
17984
+ return mergeDeepWithKey2(fn, lVal, rVal);
17985
+ } else {
17986
+ return fn(k, lVal, rVal);
17987
+ }
17988
+ }, lObj, rObj);
17989
+ });
17990
+ var mergeDeepWithKey_default = mergeDeepWithKey;
17991
+
17992
+ // node_modules/ramda/es/mergeDeepLeft.js
17993
+ var mergeDeepLeft = /* @__PURE__ */ _curry2(function mergeDeepLeft2(lObj, rObj) {
17994
+ return mergeDeepWithKey_default(function(k, lVal, rVal) {
17995
+ return lVal;
17996
+ }, lObj, rObj);
17997
+ });
17998
+ var mergeDeepLeft_default = mergeDeepLeft;
17999
+ // node_modules/env-paths/index.js
18000
+ import path2 from "path";
18001
+ import os from "os";
18002
+ import process from "process";
18003
+ var homedir = os.homedir();
18004
+ var tmpdir = os.tmpdir();
18005
+ var { env } = process;
18006
+ var macos = (name) => {
18007
+ const library = path2.join(homedir, "Library");
16811
18008
  return {
16812
- allowedTools: frontmatter.data["allowed-tools"],
16813
- content: parsed.content.trim(),
16814
- description: frontmatter.data.description,
16815
- fullPath: skillFullPath,
16816
- toolName: toolName(relativePath),
16817
- license: frontmatter.data.license,
16818
- metadata: frontmatter.data.metadata,
16819
- name: shortName,
16820
- path: skillPath.absolutePath,
16821
- scripts: createSkillResourceMap(skillFullPath, scriptPaths),
16822
- references: createSkillResourceMap(skillFullPath, referencePaths),
16823
- assets: createSkillResourceMap(skillFullPath, assetPaths)
18009
+ data: path2.join(library, "Application Support", name),
18010
+ config: path2.join(library, "Preferences", name),
18011
+ cache: path2.join(library, "Caches", name),
18012
+ log: path2.join(library, "Logs", name),
18013
+ temp: path2.join(tmpdir, name)
16824
18014
  };
16825
- }
16826
- function createSkillResourceMap(skillPath, filePaths) {
16827
- const output = new Map;
16828
- for (const filePath of filePaths) {
16829
- const relativePath = relative(skillPath, filePath);
16830
- output.set(relativePath, {
16831
- absolutePath: filePath,
16832
- mimeType: detectMimeType(filePath)
16833
- });
16834
- }
16835
- return output;
16836
- }
16837
-
16838
- // src/services/logger.ts
16839
- var namespace = "[OpencodeSkillful]";
16840
- function createLogger(config2) {
16841
- function log(type, ...message) {
16842
- const timestamp = new Date().toISOString();
16843
- return [`${namespace}[${type}] ${timestamp} - `, ...message];
16844
- }
18015
+ };
18016
+ var windows = (name) => {
18017
+ const appData = env.APPDATA || path2.join(homedir, "AppData", "Roaming");
18018
+ const localAppData = env.LOCALAPPDATA || path2.join(homedir, "AppData", "Local");
16845
18019
  return {
16846
- debug(...message) {
16847
- if (!config2.debug)
16848
- return;
16849
- console.debug(...log("debug", ...message));
16850
- },
16851
- log(...message) {
16852
- console.log(...log("log", ...message));
16853
- },
16854
- error(...message) {
16855
- console.error(...log("error", ...message));
16856
- },
16857
- warn(...message) {
16858
- console.warn(...log("warn", ...message));
16859
- }
18020
+ data: path2.join(localAppData, name, "Data"),
18021
+ config: path2.join(appData, name, "Config"),
18022
+ cache: path2.join(localAppData, name, "Cache"),
18023
+ log: path2.join(localAppData, name, "Log"),
18024
+ temp: path2.join(tmpdir, name)
18025
+ };
18026
+ };
18027
+ var linux = (name) => {
18028
+ const username = path2.basename(homedir);
18029
+ return {
18030
+ data: path2.join(env.XDG_DATA_HOME || path2.join(homedir, ".local", "share"), name),
18031
+ config: path2.join(env.XDG_CONFIG_HOME || path2.join(homedir, ".config"), name),
18032
+ cache: path2.join(env.XDG_CACHE_HOME || path2.join(homedir, ".cache"), name),
18033
+ log: path2.join(env.XDG_STATE_HOME || path2.join(homedir, ".local", "state"), name),
18034
+ temp: path2.join(tmpdir, username, name)
16860
18035
  };
18036
+ };
18037
+ function envPaths(name, { suffix = "nodejs" } = {}) {
18038
+ if (typeof name !== "string") {
18039
+ throw new TypeError(`Expected a string, got ${typeof name}`);
18040
+ }
18041
+ if (suffix) {
18042
+ name += `-${suffix}`;
18043
+ }
18044
+ if (process.platform === "darwin") {
18045
+ return macos(name);
18046
+ }
18047
+ if (process.platform === "win32") {
18048
+ return windows(name);
18049
+ }
18050
+ return linux(name);
16861
18051
  }
16862
18052
 
16863
- // src/index.ts
18053
+ // src/config.ts
16864
18054
  var OpenCodePaths = envPaths("opencode", { suffix: "" });
16865
18055
  async function getPluginConfig(ctx) {
16866
18056
  const base = {
@@ -16872,21 +18062,91 @@ async function getPluginConfig(ctx) {
16872
18062
  };
16873
18063
  return mergeDeepLeft_default({}, base);
16874
18064
  }
18065
+
18066
+ // src/lib/xml.ts
18067
+ function escapeXml(str2) {
18068
+ return String(str2).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
18069
+ }
18070
+ function jsonToXml(json2, rootElement = "root") {
18071
+ let xml = `<${rootElement}>`;
18072
+ for (const key in json2) {
18073
+ if (!Object.hasOwn(json2, key)) {
18074
+ continue;
18075
+ }
18076
+ if (typeof key !== "string") {
18077
+ continue;
18078
+ }
18079
+ const value = Object.getOwnPropertyDescriptor(json2, key)?.value;
18080
+ if (Array.isArray(value)) {
18081
+ for (const item of value) {
18082
+ xml += jsonToXml(item, key);
18083
+ }
18084
+ } else if (typeof value === "object" && value !== null) {
18085
+ xml += jsonToXml(value, key);
18086
+ } else if (value !== undefined && value !== null) {
18087
+ xml += `<${key}>${escapeXml(String(value))}</${key}>`;
18088
+ } else {
18089
+ xml += `<${key}/>`;
18090
+ }
18091
+ }
18092
+ xml += `</${rootElement}>`;
18093
+ return xml;
18094
+ }
18095
+
18096
+ // src/index.ts
16875
18097
  var SkillsPlugin = async (ctx) => {
16876
18098
  const config2 = await getPluginConfig(ctx);
16877
- const logger = createLogger(config2);
16878
- const registry2 = await createSkillRegistry(config2, logger);
16879
- const provider = createSkillProvider({
16880
- config: config2,
16881
- logger,
16882
- ...registry2
16883
- });
18099
+ const api2 = await createApi(config2);
18100
+ const sendPrompt = createInstructionInjector(ctx);
18101
+ api2.registry.initialise();
16884
18102
  return {
16885
18103
  tool: {
16886
- skill_use: createUseSkillsTool(ctx, provider),
16887
- skill_find: createFindSkillsTool(ctx, provider),
16888
- skill_resource: createToolResourceReader(ctx, provider),
16889
- skill_exec: createSkillScriptExecTool(ctx, provider)
18104
+ skill_use: tool({
18105
+ description: "Load one or more skills into the chat. Provide an array of skill names to load them as user messages.",
18106
+ args: {
18107
+ skill_names: tool.schema.array(tool.schema.string()).describe("An array of skill names to load.")
18108
+ },
18109
+ execute: async (args, toolCtx) => {
18110
+ const results = await api2.loadSkill(args.skill_names);
18111
+ for await (const skill of results.loaded) {
18112
+ await sendPrompt(jsonToXml(skill, "Skill"), { sessionId: toolCtx.sessionID });
18113
+ }
18114
+ return JSON.stringify({
18115
+ loaded: results.loaded.map((skill) => skill.toolName),
18116
+ not_found: results.notFound
18117
+ });
18118
+ }
18119
+ }),
18120
+ skill_find: tool({
18121
+ description: `Search for skills using natural query syntax`,
18122
+ args: {
18123
+ query: tool.schema.union([tool.schema.string(), tool.schema.array(tool.schema.string())]).describe("The search query string or array of strings.")
18124
+ },
18125
+ execute: async (args) => {
18126
+ const results = await api2.findSkills(args);
18127
+ const output = jsonToXml(results, "SkillSearchResults");
18128
+ return output;
18129
+ }
18130
+ }),
18131
+ skill_resource: tool({
18132
+ description: `Read a resource file from a skill.`,
18133
+ args: {
18134
+ skill_name: tool.schema.string().describe("The skill id to read the resource from."),
18135
+ relative_path: tool.schema.string().describe("The relative path to the resource file within the skill directory.")
18136
+ },
18137
+ execute: async (args, toolCtx) => {
18138
+ const result = await api2.readResource(args);
18139
+ if (!result.injection) {
18140
+ throw new Error("Failed to read resource");
18141
+ }
18142
+ await sendPrompt(jsonToXml(result.injection), { sessionId: toolCtx.sessionID });
18143
+ return JSON.stringify({
18144
+ result: "Resource injected successfully",
18145
+ resource_path: result.injection.resource_path,
18146
+ resource_mimetype: result.injection.resource_mimetype
18147
+ });
18148
+ }
18149
+ })
16890
18150
  }
16891
18151
  };
16892
18152
  };