@tec-explorer/skillpot 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +21 -0
- package/dist/cli.mjs +354 -196
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -973,8 +973,8 @@ var require_command = __commonJS({
|
|
|
973
973
|
"node_modules/commander/lib/command.js"(exports) {
|
|
974
974
|
var EventEmitter3 = __require("node:events").EventEmitter;
|
|
975
975
|
var childProcess = __require("node:child_process");
|
|
976
|
-
var
|
|
977
|
-
var
|
|
976
|
+
var path18 = __require("node:path");
|
|
977
|
+
var fs16 = __require("node:fs");
|
|
978
978
|
var process13 = __require("node:process");
|
|
979
979
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
980
980
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -1906,11 +1906,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1906
1906
|
let launchWithNode = false;
|
|
1907
1907
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1908
1908
|
function findFile(baseDir, baseName) {
|
|
1909
|
-
const localBin =
|
|
1910
|
-
if (
|
|
1911
|
-
if (sourceExt.includes(
|
|
1909
|
+
const localBin = path18.resolve(baseDir, baseName);
|
|
1910
|
+
if (fs16.existsSync(localBin)) return localBin;
|
|
1911
|
+
if (sourceExt.includes(path18.extname(baseName))) return void 0;
|
|
1912
1912
|
const foundExt = sourceExt.find(
|
|
1913
|
-
(ext) =>
|
|
1913
|
+
(ext) => fs16.existsSync(`${localBin}${ext}`)
|
|
1914
1914
|
);
|
|
1915
1915
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
1916
1916
|
return void 0;
|
|
@@ -1922,21 +1922,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1922
1922
|
if (this._scriptPath) {
|
|
1923
1923
|
let resolvedScriptPath;
|
|
1924
1924
|
try {
|
|
1925
|
-
resolvedScriptPath =
|
|
1925
|
+
resolvedScriptPath = fs16.realpathSync(this._scriptPath);
|
|
1926
1926
|
} catch (err) {
|
|
1927
1927
|
resolvedScriptPath = this._scriptPath;
|
|
1928
1928
|
}
|
|
1929
|
-
executableDir =
|
|
1930
|
-
|
|
1929
|
+
executableDir = path18.resolve(
|
|
1930
|
+
path18.dirname(resolvedScriptPath),
|
|
1931
1931
|
executableDir
|
|
1932
1932
|
);
|
|
1933
1933
|
}
|
|
1934
1934
|
if (executableDir) {
|
|
1935
1935
|
let localFile = findFile(executableDir, executableFile);
|
|
1936
1936
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
1937
|
-
const legacyName =
|
|
1937
|
+
const legacyName = path18.basename(
|
|
1938
1938
|
this._scriptPath,
|
|
1939
|
-
|
|
1939
|
+
path18.extname(this._scriptPath)
|
|
1940
1940
|
);
|
|
1941
1941
|
if (legacyName !== this._name) {
|
|
1942
1942
|
localFile = findFile(
|
|
@@ -1947,7 +1947,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1947
1947
|
}
|
|
1948
1948
|
executableFile = localFile || executableFile;
|
|
1949
1949
|
}
|
|
1950
|
-
launchWithNode = sourceExt.includes(
|
|
1950
|
+
launchWithNode = sourceExt.includes(path18.extname(executableFile));
|
|
1951
1951
|
let proc;
|
|
1952
1952
|
if (process13.platform !== "win32") {
|
|
1953
1953
|
if (launchWithNode) {
|
|
@@ -2787,7 +2787,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2787
2787
|
* @return {Command}
|
|
2788
2788
|
*/
|
|
2789
2789
|
nameFromFilename(filename) {
|
|
2790
|
-
this._name =
|
|
2790
|
+
this._name = path18.basename(filename, path18.extname(filename));
|
|
2791
2791
|
return this;
|
|
2792
2792
|
}
|
|
2793
2793
|
/**
|
|
@@ -2801,9 +2801,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2801
2801
|
* @param {string} [path]
|
|
2802
2802
|
* @return {(string|null|Command)}
|
|
2803
2803
|
*/
|
|
2804
|
-
executableDir(
|
|
2805
|
-
if (
|
|
2806
|
-
this._executableDir =
|
|
2804
|
+
executableDir(path19) {
|
|
2805
|
+
if (path19 === void 0) return this._executableDir;
|
|
2806
|
+
this._executableDir = path19;
|
|
2807
2807
|
return this;
|
|
2808
2808
|
}
|
|
2809
2809
|
/**
|
|
@@ -3182,17 +3182,17 @@ var require_visit = __commonJS({
|
|
|
3182
3182
|
visit.BREAK = BREAK;
|
|
3183
3183
|
visit.SKIP = SKIP;
|
|
3184
3184
|
visit.REMOVE = REMOVE;
|
|
3185
|
-
function visit_(key, node, visitor,
|
|
3186
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
3185
|
+
function visit_(key, node, visitor, path18) {
|
|
3186
|
+
const ctrl = callVisitor(key, node, visitor, path18);
|
|
3187
3187
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
3188
|
-
replaceNode(key,
|
|
3189
|
-
return visit_(key, ctrl, visitor,
|
|
3188
|
+
replaceNode(key, path18, ctrl);
|
|
3189
|
+
return visit_(key, ctrl, visitor, path18);
|
|
3190
3190
|
}
|
|
3191
3191
|
if (typeof ctrl !== "symbol") {
|
|
3192
3192
|
if (identity.isCollection(node)) {
|
|
3193
|
-
|
|
3193
|
+
path18 = Object.freeze(path18.concat(node));
|
|
3194
3194
|
for (let i = 0; i < node.items.length; ++i) {
|
|
3195
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
3195
|
+
const ci = visit_(i, node.items[i], visitor, path18);
|
|
3196
3196
|
if (typeof ci === "number")
|
|
3197
3197
|
i = ci - 1;
|
|
3198
3198
|
else if (ci === BREAK)
|
|
@@ -3203,13 +3203,13 @@ var require_visit = __commonJS({
|
|
|
3203
3203
|
}
|
|
3204
3204
|
}
|
|
3205
3205
|
} else if (identity.isPair(node)) {
|
|
3206
|
-
|
|
3207
|
-
const ck = visit_("key", node.key, visitor,
|
|
3206
|
+
path18 = Object.freeze(path18.concat(node));
|
|
3207
|
+
const ck = visit_("key", node.key, visitor, path18);
|
|
3208
3208
|
if (ck === BREAK)
|
|
3209
3209
|
return BREAK;
|
|
3210
3210
|
else if (ck === REMOVE)
|
|
3211
3211
|
node.key = null;
|
|
3212
|
-
const cv = visit_("value", node.value, visitor,
|
|
3212
|
+
const cv = visit_("value", node.value, visitor, path18);
|
|
3213
3213
|
if (cv === BREAK)
|
|
3214
3214
|
return BREAK;
|
|
3215
3215
|
else if (cv === REMOVE)
|
|
@@ -3230,17 +3230,17 @@ var require_visit = __commonJS({
|
|
|
3230
3230
|
visitAsync.BREAK = BREAK;
|
|
3231
3231
|
visitAsync.SKIP = SKIP;
|
|
3232
3232
|
visitAsync.REMOVE = REMOVE;
|
|
3233
|
-
async function visitAsync_(key, node, visitor,
|
|
3234
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
3233
|
+
async function visitAsync_(key, node, visitor, path18) {
|
|
3234
|
+
const ctrl = await callVisitor(key, node, visitor, path18);
|
|
3235
3235
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
3236
|
-
replaceNode(key,
|
|
3237
|
-
return visitAsync_(key, ctrl, visitor,
|
|
3236
|
+
replaceNode(key, path18, ctrl);
|
|
3237
|
+
return visitAsync_(key, ctrl, visitor, path18);
|
|
3238
3238
|
}
|
|
3239
3239
|
if (typeof ctrl !== "symbol") {
|
|
3240
3240
|
if (identity.isCollection(node)) {
|
|
3241
|
-
|
|
3241
|
+
path18 = Object.freeze(path18.concat(node));
|
|
3242
3242
|
for (let i = 0; i < node.items.length; ++i) {
|
|
3243
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
3243
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path18);
|
|
3244
3244
|
if (typeof ci === "number")
|
|
3245
3245
|
i = ci - 1;
|
|
3246
3246
|
else if (ci === BREAK)
|
|
@@ -3251,13 +3251,13 @@ var require_visit = __commonJS({
|
|
|
3251
3251
|
}
|
|
3252
3252
|
}
|
|
3253
3253
|
} else if (identity.isPair(node)) {
|
|
3254
|
-
|
|
3255
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
3254
|
+
path18 = Object.freeze(path18.concat(node));
|
|
3255
|
+
const ck = await visitAsync_("key", node.key, visitor, path18);
|
|
3256
3256
|
if (ck === BREAK)
|
|
3257
3257
|
return BREAK;
|
|
3258
3258
|
else if (ck === REMOVE)
|
|
3259
3259
|
node.key = null;
|
|
3260
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
3260
|
+
const cv = await visitAsync_("value", node.value, visitor, path18);
|
|
3261
3261
|
if (cv === BREAK)
|
|
3262
3262
|
return BREAK;
|
|
3263
3263
|
else if (cv === REMOVE)
|
|
@@ -3284,23 +3284,23 @@ var require_visit = __commonJS({
|
|
|
3284
3284
|
}
|
|
3285
3285
|
return visitor;
|
|
3286
3286
|
}
|
|
3287
|
-
function callVisitor(key, node, visitor,
|
|
3287
|
+
function callVisitor(key, node, visitor, path18) {
|
|
3288
3288
|
if (typeof visitor === "function")
|
|
3289
|
-
return visitor(key, node,
|
|
3289
|
+
return visitor(key, node, path18);
|
|
3290
3290
|
if (identity.isMap(node))
|
|
3291
|
-
return visitor.Map?.(key, node,
|
|
3291
|
+
return visitor.Map?.(key, node, path18);
|
|
3292
3292
|
if (identity.isSeq(node))
|
|
3293
|
-
return visitor.Seq?.(key, node,
|
|
3293
|
+
return visitor.Seq?.(key, node, path18);
|
|
3294
3294
|
if (identity.isPair(node))
|
|
3295
|
-
return visitor.Pair?.(key, node,
|
|
3295
|
+
return visitor.Pair?.(key, node, path18);
|
|
3296
3296
|
if (identity.isScalar(node))
|
|
3297
|
-
return visitor.Scalar?.(key, node,
|
|
3297
|
+
return visitor.Scalar?.(key, node, path18);
|
|
3298
3298
|
if (identity.isAlias(node))
|
|
3299
|
-
return visitor.Alias?.(key, node,
|
|
3299
|
+
return visitor.Alias?.(key, node, path18);
|
|
3300
3300
|
return void 0;
|
|
3301
3301
|
}
|
|
3302
|
-
function replaceNode(key,
|
|
3303
|
-
const parent =
|
|
3302
|
+
function replaceNode(key, path18, node) {
|
|
3303
|
+
const parent = path18[path18.length - 1];
|
|
3304
3304
|
if (identity.isCollection(parent)) {
|
|
3305
3305
|
parent.items[key] = node;
|
|
3306
3306
|
} else if (identity.isPair(parent)) {
|
|
@@ -3910,10 +3910,10 @@ var require_Collection = __commonJS({
|
|
|
3910
3910
|
var createNode2 = require_createNode();
|
|
3911
3911
|
var identity = require_identity();
|
|
3912
3912
|
var Node = require_Node();
|
|
3913
|
-
function collectionFromPath(schema,
|
|
3913
|
+
function collectionFromPath(schema, path18, value) {
|
|
3914
3914
|
let v = value;
|
|
3915
|
-
for (let i =
|
|
3916
|
-
const k =
|
|
3915
|
+
for (let i = path18.length - 1; i >= 0; --i) {
|
|
3916
|
+
const k = path18[i];
|
|
3917
3917
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
3918
3918
|
const a = [];
|
|
3919
3919
|
a[k] = v;
|
|
@@ -3932,7 +3932,7 @@ var require_Collection = __commonJS({
|
|
|
3932
3932
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
3933
3933
|
});
|
|
3934
3934
|
}
|
|
3935
|
-
var isEmptyPath = (
|
|
3935
|
+
var isEmptyPath = (path18) => path18 == null || typeof path18 === "object" && !!path18[Symbol.iterator]().next().done;
|
|
3936
3936
|
var Collection = class extends Node.NodeBase {
|
|
3937
3937
|
constructor(type, schema) {
|
|
3938
3938
|
super(type);
|
|
@@ -3962,11 +3962,11 @@ var require_Collection = __commonJS({
|
|
|
3962
3962
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
3963
3963
|
* that already exists in the map.
|
|
3964
3964
|
*/
|
|
3965
|
-
addIn(
|
|
3966
|
-
if (isEmptyPath(
|
|
3965
|
+
addIn(path18, value) {
|
|
3966
|
+
if (isEmptyPath(path18))
|
|
3967
3967
|
this.add(value);
|
|
3968
3968
|
else {
|
|
3969
|
-
const [key, ...rest] =
|
|
3969
|
+
const [key, ...rest] = path18;
|
|
3970
3970
|
const node = this.get(key, true);
|
|
3971
3971
|
if (identity.isCollection(node))
|
|
3972
3972
|
node.addIn(rest, value);
|
|
@@ -3980,8 +3980,8 @@ var require_Collection = __commonJS({
|
|
|
3980
3980
|
* Removes a value from the collection.
|
|
3981
3981
|
* @returns `true` if the item was found and removed.
|
|
3982
3982
|
*/
|
|
3983
|
-
deleteIn(
|
|
3984
|
-
const [key, ...rest] =
|
|
3983
|
+
deleteIn(path18) {
|
|
3984
|
+
const [key, ...rest] = path18;
|
|
3985
3985
|
if (rest.length === 0)
|
|
3986
3986
|
return this.delete(key);
|
|
3987
3987
|
const node = this.get(key, true);
|
|
@@ -3995,8 +3995,8 @@ var require_Collection = __commonJS({
|
|
|
3995
3995
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
3996
3996
|
* `true` (collections are always returned intact).
|
|
3997
3997
|
*/
|
|
3998
|
-
getIn(
|
|
3999
|
-
const [key, ...rest] =
|
|
3998
|
+
getIn(path18, keepScalar) {
|
|
3999
|
+
const [key, ...rest] = path18;
|
|
4000
4000
|
const node = this.get(key, true);
|
|
4001
4001
|
if (rest.length === 0)
|
|
4002
4002
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
@@ -4014,8 +4014,8 @@ var require_Collection = __commonJS({
|
|
|
4014
4014
|
/**
|
|
4015
4015
|
* Checks if the collection includes a value with the key `key`.
|
|
4016
4016
|
*/
|
|
4017
|
-
hasIn(
|
|
4018
|
-
const [key, ...rest] =
|
|
4017
|
+
hasIn(path18) {
|
|
4018
|
+
const [key, ...rest] = path18;
|
|
4019
4019
|
if (rest.length === 0)
|
|
4020
4020
|
return this.has(key);
|
|
4021
4021
|
const node = this.get(key, true);
|
|
@@ -4025,8 +4025,8 @@ var require_Collection = __commonJS({
|
|
|
4025
4025
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
4026
4026
|
* boolean to add/remove the item from the set.
|
|
4027
4027
|
*/
|
|
4028
|
-
setIn(
|
|
4029
|
-
const [key, ...rest] =
|
|
4028
|
+
setIn(path18, value) {
|
|
4029
|
+
const [key, ...rest] = path18;
|
|
4030
4030
|
if (rest.length === 0) {
|
|
4031
4031
|
this.set(key, value);
|
|
4032
4032
|
} else {
|
|
@@ -4573,7 +4573,7 @@ var require_stringify = __commonJS({
|
|
|
4573
4573
|
props.push(doc.directives.tagString(tag));
|
|
4574
4574
|
return props.join(" ");
|
|
4575
4575
|
}
|
|
4576
|
-
function
|
|
4576
|
+
function stringify3(item, ctx, onComment, onChompKeep) {
|
|
4577
4577
|
if (identity.isPair(item))
|
|
4578
4578
|
return item.toString(ctx, onComment, onChompKeep);
|
|
4579
4579
|
if (identity.isAlias(item)) {
|
|
@@ -4602,7 +4602,7 @@ var require_stringify = __commonJS({
|
|
|
4602
4602
|
${ctx.indent}${str}`;
|
|
4603
4603
|
}
|
|
4604
4604
|
exports.createStringifyContext = createStringifyContext;
|
|
4605
|
-
exports.stringify =
|
|
4605
|
+
exports.stringify = stringify3;
|
|
4606
4606
|
}
|
|
4607
4607
|
});
|
|
4608
4608
|
|
|
@@ -4612,7 +4612,7 @@ var require_stringifyPair = __commonJS({
|
|
|
4612
4612
|
"use strict";
|
|
4613
4613
|
var identity = require_identity();
|
|
4614
4614
|
var Scalar = require_Scalar();
|
|
4615
|
-
var
|
|
4615
|
+
var stringify3 = require_stringify();
|
|
4616
4616
|
var stringifyComment = require_stringifyComment();
|
|
4617
4617
|
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
4618
4618
|
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
@@ -4634,7 +4634,7 @@ var require_stringifyPair = __commonJS({
|
|
|
4634
4634
|
});
|
|
4635
4635
|
let keyCommentDone = false;
|
|
4636
4636
|
let chompKeep = false;
|
|
4637
|
-
let str =
|
|
4637
|
+
let str = stringify3.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
|
|
4638
4638
|
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
|
|
4639
4639
|
if (simpleKeys)
|
|
4640
4640
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
@@ -4686,7 +4686,7 @@ ${indent}:`;
|
|
|
4686
4686
|
ctx.indent = ctx.indent.substring(2);
|
|
4687
4687
|
}
|
|
4688
4688
|
let valueCommentDone = false;
|
|
4689
|
-
const valueStr =
|
|
4689
|
+
const valueStr = stringify3.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
|
|
4690
4690
|
let ws = " ";
|
|
4691
4691
|
if (keyComment || vsb || vcb) {
|
|
4692
4692
|
ws = vsb ? "\n" : "";
|
|
@@ -4827,7 +4827,7 @@ var require_addPairToJSMap = __commonJS({
|
|
|
4827
4827
|
"use strict";
|
|
4828
4828
|
var log = require_log();
|
|
4829
4829
|
var merge = require_merge();
|
|
4830
|
-
var
|
|
4830
|
+
var stringify3 = require_stringify();
|
|
4831
4831
|
var identity = require_identity();
|
|
4832
4832
|
var toJS = require_toJS();
|
|
4833
4833
|
function addPairToJSMap(ctx, map, { key, value }) {
|
|
@@ -4863,7 +4863,7 @@ var require_addPairToJSMap = __commonJS({
|
|
|
4863
4863
|
if (typeof jsKey !== "object")
|
|
4864
4864
|
return String(jsKey);
|
|
4865
4865
|
if (identity.isNode(key) && ctx?.doc) {
|
|
4866
|
-
const strCtx =
|
|
4866
|
+
const strCtx = stringify3.createStringifyContext(ctx.doc, {});
|
|
4867
4867
|
strCtx.anchors = /* @__PURE__ */ new Set();
|
|
4868
4868
|
for (const node of ctx.anchors.keys())
|
|
4869
4869
|
strCtx.anchors.add(node.anchor);
|
|
@@ -4930,12 +4930,12 @@ var require_stringifyCollection = __commonJS({
|
|
|
4930
4930
|
"node_modules/yaml/dist/stringify/stringifyCollection.js"(exports) {
|
|
4931
4931
|
"use strict";
|
|
4932
4932
|
var identity = require_identity();
|
|
4933
|
-
var
|
|
4933
|
+
var stringify3 = require_stringify();
|
|
4934
4934
|
var stringifyComment = require_stringifyComment();
|
|
4935
4935
|
function stringifyCollection(collection, ctx, options) {
|
|
4936
4936
|
const flow = ctx.inFlow ?? collection.flow;
|
|
4937
|
-
const
|
|
4938
|
-
return
|
|
4937
|
+
const stringify4 = flow ? stringifyFlowCollection : stringifyBlockCollection;
|
|
4938
|
+
return stringify4(collection, ctx, options);
|
|
4939
4939
|
}
|
|
4940
4940
|
function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
|
|
4941
4941
|
const { indent, options: { commentString } } = ctx;
|
|
@@ -4960,7 +4960,7 @@ var require_stringifyCollection = __commonJS({
|
|
|
4960
4960
|
}
|
|
4961
4961
|
}
|
|
4962
4962
|
chompKeep = false;
|
|
4963
|
-
let str2 =
|
|
4963
|
+
let str2 = stringify3.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
|
|
4964
4964
|
if (comment2)
|
|
4965
4965
|
str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2));
|
|
4966
4966
|
if (chompKeep && comment2)
|
|
@@ -5027,7 +5027,7 @@ ${indent}${line}` : "\n";
|
|
|
5027
5027
|
}
|
|
5028
5028
|
if (comment)
|
|
5029
5029
|
reqNewline = true;
|
|
5030
|
-
let str =
|
|
5030
|
+
let str = stringify3.stringify(item, itemCtx, () => comment = null);
|
|
5031
5031
|
reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n"));
|
|
5032
5032
|
if (i < items.length - 1) {
|
|
5033
5033
|
str += ",";
|
|
@@ -6388,7 +6388,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
6388
6388
|
"node_modules/yaml/dist/stringify/stringifyDocument.js"(exports) {
|
|
6389
6389
|
"use strict";
|
|
6390
6390
|
var identity = require_identity();
|
|
6391
|
-
var
|
|
6391
|
+
var stringify3 = require_stringify();
|
|
6392
6392
|
var stringifyComment = require_stringifyComment();
|
|
6393
6393
|
function stringifyDocument(doc, options) {
|
|
6394
6394
|
const lines = [];
|
|
@@ -6403,7 +6403,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
6403
6403
|
}
|
|
6404
6404
|
if (hasDirectives)
|
|
6405
6405
|
lines.push("---");
|
|
6406
|
-
const ctx =
|
|
6406
|
+
const ctx = stringify3.createStringifyContext(doc, options);
|
|
6407
6407
|
const { commentString } = ctx.options;
|
|
6408
6408
|
if (doc.commentBefore) {
|
|
6409
6409
|
if (lines.length !== 1)
|
|
@@ -6425,7 +6425,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
6425
6425
|
contentComment = doc.contents.comment;
|
|
6426
6426
|
}
|
|
6427
6427
|
const onChompKeep = contentComment ? void 0 : () => chompKeep = true;
|
|
6428
|
-
let body =
|
|
6428
|
+
let body = stringify3.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
|
|
6429
6429
|
if (contentComment)
|
|
6430
6430
|
body += stringifyComment.lineComment(body, "", commentString(contentComment));
|
|
6431
6431
|
if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
|
|
@@ -6433,7 +6433,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
6433
6433
|
} else
|
|
6434
6434
|
lines.push(body);
|
|
6435
6435
|
} else {
|
|
6436
|
-
lines.push(
|
|
6436
|
+
lines.push(stringify3.stringify(doc.contents, ctx));
|
|
6437
6437
|
}
|
|
6438
6438
|
if (doc.directives?.docEnd) {
|
|
6439
6439
|
if (doc.comment) {
|
|
@@ -6541,9 +6541,9 @@ var require_Document = __commonJS({
|
|
|
6541
6541
|
this.contents.add(value);
|
|
6542
6542
|
}
|
|
6543
6543
|
/** Adds a value to the document. */
|
|
6544
|
-
addIn(
|
|
6544
|
+
addIn(path18, value) {
|
|
6545
6545
|
if (assertCollection(this.contents))
|
|
6546
|
-
this.contents.addIn(
|
|
6546
|
+
this.contents.addIn(path18, value);
|
|
6547
6547
|
}
|
|
6548
6548
|
/**
|
|
6549
6549
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -6618,14 +6618,14 @@ var require_Document = __commonJS({
|
|
|
6618
6618
|
* Removes a value from the document.
|
|
6619
6619
|
* @returns `true` if the item was found and removed.
|
|
6620
6620
|
*/
|
|
6621
|
-
deleteIn(
|
|
6622
|
-
if (Collection.isEmptyPath(
|
|
6621
|
+
deleteIn(path18) {
|
|
6622
|
+
if (Collection.isEmptyPath(path18)) {
|
|
6623
6623
|
if (this.contents == null)
|
|
6624
6624
|
return false;
|
|
6625
6625
|
this.contents = null;
|
|
6626
6626
|
return true;
|
|
6627
6627
|
}
|
|
6628
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
6628
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path18) : false;
|
|
6629
6629
|
}
|
|
6630
6630
|
/**
|
|
6631
6631
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -6640,10 +6640,10 @@ var require_Document = __commonJS({
|
|
|
6640
6640
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
6641
6641
|
* `true` (collections are always returned intact).
|
|
6642
6642
|
*/
|
|
6643
|
-
getIn(
|
|
6644
|
-
if (Collection.isEmptyPath(
|
|
6643
|
+
getIn(path18, keepScalar) {
|
|
6644
|
+
if (Collection.isEmptyPath(path18))
|
|
6645
6645
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
6646
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
6646
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path18, keepScalar) : void 0;
|
|
6647
6647
|
}
|
|
6648
6648
|
/**
|
|
6649
6649
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -6654,10 +6654,10 @@ var require_Document = __commonJS({
|
|
|
6654
6654
|
/**
|
|
6655
6655
|
* Checks if the document includes a value at `path`.
|
|
6656
6656
|
*/
|
|
6657
|
-
hasIn(
|
|
6658
|
-
if (Collection.isEmptyPath(
|
|
6657
|
+
hasIn(path18) {
|
|
6658
|
+
if (Collection.isEmptyPath(path18))
|
|
6659
6659
|
return this.contents !== void 0;
|
|
6660
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
6660
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path18) : false;
|
|
6661
6661
|
}
|
|
6662
6662
|
/**
|
|
6663
6663
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -6674,13 +6674,13 @@ var require_Document = __commonJS({
|
|
|
6674
6674
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
6675
6675
|
* boolean to add/remove the item from the set.
|
|
6676
6676
|
*/
|
|
6677
|
-
setIn(
|
|
6678
|
-
if (Collection.isEmptyPath(
|
|
6677
|
+
setIn(path18, value) {
|
|
6678
|
+
if (Collection.isEmptyPath(path18)) {
|
|
6679
6679
|
this.contents = value;
|
|
6680
6680
|
} else if (this.contents == null) {
|
|
6681
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
6681
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path18), value);
|
|
6682
6682
|
} else if (assertCollection(this.contents)) {
|
|
6683
|
-
this.contents.setIn(
|
|
6683
|
+
this.contents.setIn(path18, value);
|
|
6684
6684
|
}
|
|
6685
6685
|
}
|
|
6686
6686
|
/**
|
|
@@ -8568,7 +8568,7 @@ var require_cst_scalar = __commonJS({
|
|
|
8568
8568
|
var require_cst_stringify = __commonJS({
|
|
8569
8569
|
"node_modules/yaml/dist/parse/cst-stringify.js"(exports) {
|
|
8570
8570
|
"use strict";
|
|
8571
|
-
var
|
|
8571
|
+
var stringify3 = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst);
|
|
8572
8572
|
function stringifyToken(token) {
|
|
8573
8573
|
switch (token.type) {
|
|
8574
8574
|
case "block-scalar": {
|
|
@@ -8621,7 +8621,7 @@ var require_cst_stringify = __commonJS({
|
|
|
8621
8621
|
res += stringifyToken(value);
|
|
8622
8622
|
return res;
|
|
8623
8623
|
}
|
|
8624
|
-
exports.stringify =
|
|
8624
|
+
exports.stringify = stringify3;
|
|
8625
8625
|
}
|
|
8626
8626
|
});
|
|
8627
8627
|
|
|
@@ -8640,9 +8640,9 @@ var require_cst_visit = __commonJS({
|
|
|
8640
8640
|
visit.BREAK = BREAK;
|
|
8641
8641
|
visit.SKIP = SKIP;
|
|
8642
8642
|
visit.REMOVE = REMOVE;
|
|
8643
|
-
visit.itemAtPath = (cst,
|
|
8643
|
+
visit.itemAtPath = (cst, path18) => {
|
|
8644
8644
|
let item = cst;
|
|
8645
|
-
for (const [field, index] of
|
|
8645
|
+
for (const [field, index] of path18) {
|
|
8646
8646
|
const tok = item?.[field];
|
|
8647
8647
|
if (tok && "items" in tok) {
|
|
8648
8648
|
item = tok.items[index];
|
|
@@ -8651,23 +8651,23 @@ var require_cst_visit = __commonJS({
|
|
|
8651
8651
|
}
|
|
8652
8652
|
return item;
|
|
8653
8653
|
};
|
|
8654
|
-
visit.parentCollection = (cst,
|
|
8655
|
-
const parent = visit.itemAtPath(cst,
|
|
8656
|
-
const field =
|
|
8654
|
+
visit.parentCollection = (cst, path18) => {
|
|
8655
|
+
const parent = visit.itemAtPath(cst, path18.slice(0, -1));
|
|
8656
|
+
const field = path18[path18.length - 1][0];
|
|
8657
8657
|
const coll = parent?.[field];
|
|
8658
8658
|
if (coll && "items" in coll)
|
|
8659
8659
|
return coll;
|
|
8660
8660
|
throw new Error("Parent collection not found");
|
|
8661
8661
|
};
|
|
8662
|
-
function _visit(
|
|
8663
|
-
let ctrl = visitor(item,
|
|
8662
|
+
function _visit(path18, item, visitor) {
|
|
8663
|
+
let ctrl = visitor(item, path18);
|
|
8664
8664
|
if (typeof ctrl === "symbol")
|
|
8665
8665
|
return ctrl;
|
|
8666
8666
|
for (const field of ["key", "value"]) {
|
|
8667
8667
|
const token = item[field];
|
|
8668
8668
|
if (token && "items" in token) {
|
|
8669
8669
|
for (let i = 0; i < token.items.length; ++i) {
|
|
8670
|
-
const ci = _visit(Object.freeze(
|
|
8670
|
+
const ci = _visit(Object.freeze(path18.concat([[field, i]])), token.items[i], visitor);
|
|
8671
8671
|
if (typeof ci === "number")
|
|
8672
8672
|
i = ci - 1;
|
|
8673
8673
|
else if (ci === BREAK)
|
|
@@ -8678,10 +8678,10 @@ var require_cst_visit = __commonJS({
|
|
|
8678
8678
|
}
|
|
8679
8679
|
}
|
|
8680
8680
|
if (typeof ctrl === "function" && field === "key")
|
|
8681
|
-
ctrl = ctrl(item,
|
|
8681
|
+
ctrl = ctrl(item, path18);
|
|
8682
8682
|
}
|
|
8683
8683
|
}
|
|
8684
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
8684
|
+
return typeof ctrl === "function" ? ctrl(item, path18) : ctrl;
|
|
8685
8685
|
}
|
|
8686
8686
|
exports.visit = visit;
|
|
8687
8687
|
}
|
|
@@ -9983,14 +9983,14 @@ var require_parser = __commonJS({
|
|
|
9983
9983
|
case "scalar":
|
|
9984
9984
|
case "single-quoted-scalar":
|
|
9985
9985
|
case "double-quoted-scalar": {
|
|
9986
|
-
const
|
|
9986
|
+
const fs16 = this.flowScalar(this.type);
|
|
9987
9987
|
if (atNextItem || it.value) {
|
|
9988
|
-
map.items.push({ start, key:
|
|
9988
|
+
map.items.push({ start, key: fs16, sep: [] });
|
|
9989
9989
|
this.onKeyLine = true;
|
|
9990
9990
|
} else if (it.sep) {
|
|
9991
|
-
this.stack.push(
|
|
9991
|
+
this.stack.push(fs16);
|
|
9992
9992
|
} else {
|
|
9993
|
-
Object.assign(it, { key:
|
|
9993
|
+
Object.assign(it, { key: fs16, sep: [] });
|
|
9994
9994
|
this.onKeyLine = true;
|
|
9995
9995
|
}
|
|
9996
9996
|
return;
|
|
@@ -10118,13 +10118,13 @@ var require_parser = __commonJS({
|
|
|
10118
10118
|
case "scalar":
|
|
10119
10119
|
case "single-quoted-scalar":
|
|
10120
10120
|
case "double-quoted-scalar": {
|
|
10121
|
-
const
|
|
10121
|
+
const fs16 = this.flowScalar(this.type);
|
|
10122
10122
|
if (!it || it.value)
|
|
10123
|
-
fc.items.push({ start: [], key:
|
|
10123
|
+
fc.items.push({ start: [], key: fs16, sep: [] });
|
|
10124
10124
|
else if (it.sep)
|
|
10125
|
-
this.stack.push(
|
|
10125
|
+
this.stack.push(fs16);
|
|
10126
10126
|
else
|
|
10127
|
-
Object.assign(it, { key:
|
|
10127
|
+
Object.assign(it, { key: fs16, sep: [] });
|
|
10128
10128
|
return;
|
|
10129
10129
|
}
|
|
10130
10130
|
case "flow-map-end":
|
|
@@ -10332,7 +10332,7 @@ var require_public_api = __commonJS({
|
|
|
10332
10332
|
}
|
|
10333
10333
|
return doc;
|
|
10334
10334
|
}
|
|
10335
|
-
function
|
|
10335
|
+
function parse4(src, reviver, options) {
|
|
10336
10336
|
let _reviver = void 0;
|
|
10337
10337
|
if (typeof reviver === "function") {
|
|
10338
10338
|
_reviver = reviver;
|
|
@@ -10351,7 +10351,7 @@ var require_public_api = __commonJS({
|
|
|
10351
10351
|
}
|
|
10352
10352
|
return doc.toJS(Object.assign({ reviver: _reviver }, options));
|
|
10353
10353
|
}
|
|
10354
|
-
function
|
|
10354
|
+
function stringify3(value, replacer, options) {
|
|
10355
10355
|
let _replacer = null;
|
|
10356
10356
|
if (typeof replacer === "function" || Array.isArray(replacer)) {
|
|
10357
10357
|
_replacer = replacer;
|
|
@@ -10373,10 +10373,10 @@ var require_public_api = __commonJS({
|
|
|
10373
10373
|
return value.toString(options);
|
|
10374
10374
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
10375
10375
|
}
|
|
10376
|
-
exports.parse =
|
|
10376
|
+
exports.parse = parse4;
|
|
10377
10377
|
exports.parseAllDocuments = parseAllDocuments;
|
|
10378
10378
|
exports.parseDocument = parseDocument;
|
|
10379
|
-
exports.stringify =
|
|
10379
|
+
exports.stringify = stringify3;
|
|
10380
10380
|
}
|
|
10381
10381
|
});
|
|
10382
10382
|
|
|
@@ -33138,10 +33138,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
33138
33138
|
var setErrorHandler = null;
|
|
33139
33139
|
var setSuspenseHandler = null;
|
|
33140
33140
|
{
|
|
33141
|
-
var copyWithDeleteImpl = function(obj,
|
|
33142
|
-
var key =
|
|
33141
|
+
var copyWithDeleteImpl = function(obj, path18, index2) {
|
|
33142
|
+
var key = path18[index2];
|
|
33143
33143
|
var updated = isArray(obj) ? obj.slice() : assign({}, obj);
|
|
33144
|
-
if (index2 + 1 ===
|
|
33144
|
+
if (index2 + 1 === path18.length) {
|
|
33145
33145
|
if (isArray(updated)) {
|
|
33146
33146
|
updated.splice(key, 1);
|
|
33147
33147
|
} else {
|
|
@@ -33149,11 +33149,11 @@ var require_react_reconciler_development = __commonJS({
|
|
|
33149
33149
|
}
|
|
33150
33150
|
return updated;
|
|
33151
33151
|
}
|
|
33152
|
-
updated[key] = copyWithDeleteImpl(obj[key],
|
|
33152
|
+
updated[key] = copyWithDeleteImpl(obj[key], path18, index2 + 1);
|
|
33153
33153
|
return updated;
|
|
33154
33154
|
};
|
|
33155
|
-
var copyWithDelete = function(obj,
|
|
33156
|
-
return copyWithDeleteImpl(obj,
|
|
33155
|
+
var copyWithDelete = function(obj, path18) {
|
|
33156
|
+
return copyWithDeleteImpl(obj, path18, 0);
|
|
33157
33157
|
};
|
|
33158
33158
|
var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
|
|
33159
33159
|
var oldKey = oldPath[index2];
|
|
@@ -33191,17 +33191,17 @@ var require_react_reconciler_development = __commonJS({
|
|
|
33191
33191
|
}
|
|
33192
33192
|
return copyWithRenameImpl(obj, oldPath, newPath, 0);
|
|
33193
33193
|
};
|
|
33194
|
-
var copyWithSetImpl = function(obj,
|
|
33195
|
-
if (index2 >=
|
|
33194
|
+
var copyWithSetImpl = function(obj, path18, index2, value) {
|
|
33195
|
+
if (index2 >= path18.length) {
|
|
33196
33196
|
return value;
|
|
33197
33197
|
}
|
|
33198
|
-
var key =
|
|
33198
|
+
var key = path18[index2];
|
|
33199
33199
|
var updated = isArray(obj) ? obj.slice() : assign({}, obj);
|
|
33200
|
-
updated[key] = copyWithSetImpl(obj[key],
|
|
33200
|
+
updated[key] = copyWithSetImpl(obj[key], path18, index2 + 1, value);
|
|
33201
33201
|
return updated;
|
|
33202
33202
|
};
|
|
33203
|
-
var copyWithSet = function(obj,
|
|
33204
|
-
return copyWithSetImpl(obj,
|
|
33203
|
+
var copyWithSet = function(obj, path18, value) {
|
|
33204
|
+
return copyWithSetImpl(obj, path18, 0, value);
|
|
33205
33205
|
};
|
|
33206
33206
|
var findHook = function(fiber, id) {
|
|
33207
33207
|
var currentHook2 = fiber.memoizedState;
|
|
@@ -33211,10 +33211,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
33211
33211
|
}
|
|
33212
33212
|
return currentHook2;
|
|
33213
33213
|
};
|
|
33214
|
-
overrideHookState = function(fiber, id,
|
|
33214
|
+
overrideHookState = function(fiber, id, path18, value) {
|
|
33215
33215
|
var hook = findHook(fiber, id);
|
|
33216
33216
|
if (hook !== null) {
|
|
33217
|
-
var newState = copyWithSet(hook.memoizedState,
|
|
33217
|
+
var newState = copyWithSet(hook.memoizedState, path18, value);
|
|
33218
33218
|
hook.memoizedState = newState;
|
|
33219
33219
|
hook.baseState = newState;
|
|
33220
33220
|
fiber.memoizedProps = assign({}, fiber.memoizedProps);
|
|
@@ -33224,10 +33224,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
33224
33224
|
}
|
|
33225
33225
|
}
|
|
33226
33226
|
};
|
|
33227
|
-
overrideHookStateDeletePath = function(fiber, id,
|
|
33227
|
+
overrideHookStateDeletePath = function(fiber, id, path18) {
|
|
33228
33228
|
var hook = findHook(fiber, id);
|
|
33229
33229
|
if (hook !== null) {
|
|
33230
|
-
var newState = copyWithDelete(hook.memoizedState,
|
|
33230
|
+
var newState = copyWithDelete(hook.memoizedState, path18);
|
|
33231
33231
|
hook.memoizedState = newState;
|
|
33232
33232
|
hook.baseState = newState;
|
|
33233
33233
|
fiber.memoizedProps = assign({}, fiber.memoizedProps);
|
|
@@ -33250,8 +33250,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
33250
33250
|
}
|
|
33251
33251
|
}
|
|
33252
33252
|
};
|
|
33253
|
-
overrideProps = function(fiber,
|
|
33254
|
-
fiber.pendingProps = copyWithSet(fiber.memoizedProps,
|
|
33253
|
+
overrideProps = function(fiber, path18, value) {
|
|
33254
|
+
fiber.pendingProps = copyWithSet(fiber.memoizedProps, path18, value);
|
|
33255
33255
|
if (fiber.alternate) {
|
|
33256
33256
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
33257
33257
|
}
|
|
@@ -33260,8 +33260,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
33260
33260
|
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
|
|
33261
33261
|
}
|
|
33262
33262
|
};
|
|
33263
|
-
overridePropsDeletePath = function(fiber,
|
|
33264
|
-
fiber.pendingProps = copyWithDelete(fiber.memoizedProps,
|
|
33263
|
+
overridePropsDeletePath = function(fiber, path18) {
|
|
33264
|
+
fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path18);
|
|
33265
33265
|
if (fiber.alternate) {
|
|
33266
33266
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
33267
33267
|
}
|
|
@@ -35551,7 +35551,7 @@ var require_extension = __commonJS({
|
|
|
35551
35551
|
if (dest[name] === void 0) dest[name] = [elem];
|
|
35552
35552
|
else dest[name].push(elem);
|
|
35553
35553
|
}
|
|
35554
|
-
function
|
|
35554
|
+
function parse4(header) {
|
|
35555
35555
|
const offers = /* @__PURE__ */ Object.create(null);
|
|
35556
35556
|
let params = /* @__PURE__ */ Object.create(null);
|
|
35557
35557
|
let mustUnescape = false;
|
|
@@ -35691,7 +35691,7 @@ var require_extension = __commonJS({
|
|
|
35691
35691
|
}).join(", ");
|
|
35692
35692
|
}).join(", ");
|
|
35693
35693
|
}
|
|
35694
|
-
module.exports = { format, parse:
|
|
35694
|
+
module.exports = { format, parse: parse4 };
|
|
35695
35695
|
}
|
|
35696
35696
|
});
|
|
35697
35697
|
|
|
@@ -35725,7 +35725,7 @@ var require_websocket = __commonJS({
|
|
|
35725
35725
|
var {
|
|
35726
35726
|
EventTarget: { addEventListener, removeEventListener }
|
|
35727
35727
|
} = require_event_target();
|
|
35728
|
-
var { format, parse:
|
|
35728
|
+
var { format, parse: parse4 } = require_extension();
|
|
35729
35729
|
var { toBuffer } = require_buffer_util();
|
|
35730
35730
|
var kAborted = Symbol("kAborted");
|
|
35731
35731
|
var protocolVersions = [8, 13];
|
|
@@ -36402,7 +36402,7 @@ var require_websocket = __commonJS({
|
|
|
36402
36402
|
}
|
|
36403
36403
|
let extensions;
|
|
36404
36404
|
try {
|
|
36405
|
-
extensions =
|
|
36405
|
+
extensions = parse4(secWebSocketExtensions);
|
|
36406
36406
|
} catch (err) {
|
|
36407
36407
|
const message = "Invalid Sec-WebSocket-Extensions header";
|
|
36408
36408
|
abortHandshake(websocket, socket, message);
|
|
@@ -36694,7 +36694,7 @@ var require_subprotocol = __commonJS({
|
|
|
36694
36694
|
"node_modules/ws/lib/subprotocol.js"(exports, module) {
|
|
36695
36695
|
"use strict";
|
|
36696
36696
|
var { tokenChars } = require_validation();
|
|
36697
|
-
function
|
|
36697
|
+
function parse4(header) {
|
|
36698
36698
|
const protocols = /* @__PURE__ */ new Set();
|
|
36699
36699
|
let start = -1;
|
|
36700
36700
|
let end = -1;
|
|
@@ -36730,7 +36730,7 @@ var require_subprotocol = __commonJS({
|
|
|
36730
36730
|
protocols.add(protocol);
|
|
36731
36731
|
return protocols;
|
|
36732
36732
|
}
|
|
36733
|
-
module.exports = { parse:
|
|
36733
|
+
module.exports = { parse: parse4 };
|
|
36734
36734
|
}
|
|
36735
36735
|
});
|
|
36736
36736
|
|
|
@@ -38583,6 +38583,7 @@ var require_jsx_runtime = __commonJS({
|
|
|
38583
38583
|
});
|
|
38584
38584
|
|
|
38585
38585
|
// src/cli.ts
|
|
38586
|
+
import path17 from "node:path";
|
|
38586
38587
|
import * as readline2 from "node:readline";
|
|
38587
38588
|
|
|
38588
38589
|
// node_modules/commander/esm.mjs
|
|
@@ -39430,8 +39431,128 @@ function runAudit() {
|
|
|
39430
39431
|
return { agents, generatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
39431
39432
|
}
|
|
39432
39433
|
|
|
39433
|
-
// src/core/
|
|
39434
|
+
// src/core/team-sync.ts
|
|
39435
|
+
var import_yaml3 = __toESM(require_dist());
|
|
39434
39436
|
import fs9 from "node:fs";
|
|
39437
|
+
function loadManifest(file) {
|
|
39438
|
+
if (!fs9.existsSync(file)) throw new Error(`\u6E05\u5355\u4E0D\u5B58\u5728\uFF1A${file}`);
|
|
39439
|
+
let data = null;
|
|
39440
|
+
try {
|
|
39441
|
+
data = (0, import_yaml3.parse)(fs9.readFileSync(file, "utf8"));
|
|
39442
|
+
} catch (e) {
|
|
39443
|
+
throw new Error(`\u6E05\u5355\u89E3\u6790\u5931\u8D25\uFF1A${e instanceof Error ? e.message : String(e)}`);
|
|
39444
|
+
}
|
|
39445
|
+
if (!data || typeof data !== "object" || !data.skills || typeof data.skills !== "object") {
|
|
39446
|
+
throw new Error(`\u6E05\u5355\u683C\u5F0F\u4E0D\u5408\u6CD5\uFF1A${file}\uFF08\u9700\u8981 version: 1 \u4E0E skills \u5B57\u6BB5\uFF09`);
|
|
39447
|
+
}
|
|
39448
|
+
return { version: 1, skills: data.skills };
|
|
39449
|
+
}
|
|
39450
|
+
function exportManifest(file, names) {
|
|
39451
|
+
const config = loadConfig();
|
|
39452
|
+
const all = Object.entries(config.skills);
|
|
39453
|
+
const picked = names?.length ? all.filter(([n]) => names.includes(n)) : all;
|
|
39454
|
+
if (!picked.length) throw new Error("\u4E2D\u592E\u4ED3\u5E93\u4E3A\u7A7A\uFF08\u6216\u672A\u5339\u914D\u5230\u6307\u5B9A skill\uFF09\uFF0C\u65E0\u53EF\u5BFC\u51FA\u5185\u5BB9");
|
|
39455
|
+
const warnings = [];
|
|
39456
|
+
const skills = {};
|
|
39457
|
+
for (const [n, e] of picked) {
|
|
39458
|
+
skills[n] = {
|
|
39459
|
+
source: e.source,
|
|
39460
|
+
checksum: e.checksum,
|
|
39461
|
+
expose: Object.fromEntries(Object.entries(e.expose).filter(([, v]) => v === true))
|
|
39462
|
+
};
|
|
39463
|
+
if (e.source.startsWith("local:")) {
|
|
39464
|
+
warnings.push(
|
|
39465
|
+
`'${n}' \u4E3A local \u6765\u6E90\uFF08${e.source}\uFF09\u2014\u2014\u961F\u53CB\u65E0\u6CD5\u4ECE\u672C\u673A\u8DEF\u5F84\u5BF9\u9F50\uFF0C\u5EFA\u8BAE\u6539\u4E3A git \u6E90\u540E\u91CD\u65B0\u5BFC\u51FA`
|
|
39466
|
+
);
|
|
39467
|
+
}
|
|
39468
|
+
}
|
|
39469
|
+
const manifest = { version: 1, skills };
|
|
39470
|
+
fs9.writeFileSync(file, (0, import_yaml3.stringify)(manifest));
|
|
39471
|
+
return { manifest, file, warnings };
|
|
39472
|
+
}
|
|
39473
|
+
function applyExpose(name, expose) {
|
|
39474
|
+
const enabled = [];
|
|
39475
|
+
for (const [agent, on] of Object.entries(expose ?? {})) {
|
|
39476
|
+
if (on !== true) continue;
|
|
39477
|
+
try {
|
|
39478
|
+
const r = enableSkill(name, [agent]);
|
|
39479
|
+
if (r.linked.length) enabled.push(agent);
|
|
39480
|
+
} catch {
|
|
39481
|
+
}
|
|
39482
|
+
}
|
|
39483
|
+
return enabled;
|
|
39484
|
+
}
|
|
39485
|
+
async function syncManifest(file, opts = {}) {
|
|
39486
|
+
const manifest = loadManifest(file);
|
|
39487
|
+
const config = loadConfig();
|
|
39488
|
+
const out = [];
|
|
39489
|
+
for (const [name, entry] of Object.entries(manifest.skills)) {
|
|
39490
|
+
try {
|
|
39491
|
+
const installed = !!config.skills[name];
|
|
39492
|
+
const src = entry.source.replace(/^git:/, "");
|
|
39493
|
+
if (entry.source.startsWith("local:")) {
|
|
39494
|
+
out.push({
|
|
39495
|
+
skill: name,
|
|
39496
|
+
action: installed ? "ok" : "skip",
|
|
39497
|
+
detail: installed ? "local \u6765\u6E90\uFF0C\u8DF3\u8FC7\u5BF9\u9F50\uFF08\u4EC5\u672C\u673A\u6709\u610F\u4E49\uFF09" : `local \u6765\u6E90\uFF08${entry.source}\uFF09\u5728\u672C\u673A\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u5B89\u88C5`
|
|
39498
|
+
});
|
|
39499
|
+
continue;
|
|
39500
|
+
}
|
|
39501
|
+
if (!isGitSource(src)) {
|
|
39502
|
+
out.push({ skill: name, action: "skip", detail: `\u4E0D\u652F\u6301\u7684\u6765\u6E90\uFF1A${entry.source}` });
|
|
39503
|
+
continue;
|
|
39504
|
+
}
|
|
39505
|
+
if (!installed) {
|
|
39506
|
+
if (opts.dryRun) {
|
|
39507
|
+
out.push({ skill: name, action: "install", dryRun: true });
|
|
39508
|
+
continue;
|
|
39509
|
+
}
|
|
39510
|
+
const r = await addSkill(src, { name, for: Object.entries(entry.expose ?? {}).filter(([, v]) => v === true).map(([a]) => a) });
|
|
39511
|
+
let detail = r.checksum === entry.checksum ? void 0 : "\u5DF2\u5B89\u88C5\uFF0C\u4F46\u4E0E\u6E05\u5355 checksum \u4E0D\u4E00\u81F4\uFF08\u8FDC\u7AEF\u53EF\u80FD\u5DF2\u66F4\u65B0\uFF09";
|
|
39512
|
+
out.push({ skill: name, action: "install", detail });
|
|
39513
|
+
continue;
|
|
39514
|
+
}
|
|
39515
|
+
if (entry.checksum && dirChecksum(skillDir(name)) !== entry.checksum) {
|
|
39516
|
+
if (opts.dryRun) {
|
|
39517
|
+
out.push({
|
|
39518
|
+
skill: name,
|
|
39519
|
+
action: "reinstall",
|
|
39520
|
+
dryRun: true,
|
|
39521
|
+
detail: "\u672C\u673A\u7248\u672C\u4E0E\u6E05\u5355\u9501\u5B9A\u7684 checksum \u4E0D\u4E00\u81F4\uFF0C\u5C06\u91CD\u88C5\u5BF9\u9F50"
|
|
39522
|
+
});
|
|
39523
|
+
continue;
|
|
39524
|
+
}
|
|
39525
|
+
uninstallSkill(name);
|
|
39526
|
+
const r = await addSkill(src, { name, for: Object.entries(entry.expose ?? {}).filter(([, v]) => v === true).map(([a]) => a) });
|
|
39527
|
+
out.push({
|
|
39528
|
+
skill: name,
|
|
39529
|
+
action: "reinstall",
|
|
39530
|
+
detail: r.checksum === entry.checksum ? "\u5DF2\u91CD\u88C5\u5BF9\u9F50\u6E05\u5355\u7248\u672C" : "\u5DF2\u91CD\u88C5\uFF0C\u4F46\u4ECD\u4E0E\u6E05\u5355 checksum \u4E0D\u4E00\u81F4\uFF08\u8FDC\u7AEF\u53EF\u80FD\u5DF2\u66F4\u65B0\uFF0C\u5EFA\u8BAE\u66F4\u65B0\u6E05\u5355\uFF09"
|
|
39531
|
+
});
|
|
39532
|
+
continue;
|
|
39533
|
+
}
|
|
39534
|
+
applyExpose(name, entry.expose);
|
|
39535
|
+
out.push({ skill: name, action: "ok" });
|
|
39536
|
+
} catch (e) {
|
|
39537
|
+
out.push({
|
|
39538
|
+
skill: name,
|
|
39539
|
+
action: "error",
|
|
39540
|
+
detail: e instanceof Error ? e.message : String(e)
|
|
39541
|
+
});
|
|
39542
|
+
}
|
|
39543
|
+
}
|
|
39544
|
+
return out;
|
|
39545
|
+
}
|
|
39546
|
+
var SYNC_ACTION_LABELS = {
|
|
39547
|
+
install: "\u5B89\u88C5",
|
|
39548
|
+
reinstall: "\u91CD\u88C5\u5BF9\u9F50",
|
|
39549
|
+
ok: "\u5DF2\u4E00\u81F4",
|
|
39550
|
+
skip: "\u8DF3\u8FC7",
|
|
39551
|
+
error: "\u5931\u8D25"
|
|
39552
|
+
};
|
|
39553
|
+
|
|
39554
|
+
// src/core/doctor.ts
|
|
39555
|
+
import fs10 from "node:fs";
|
|
39435
39556
|
import path12 from "node:path";
|
|
39436
39557
|
function runDoctor() {
|
|
39437
39558
|
const issues = [];
|
|
@@ -39439,16 +39560,16 @@ function runDoctor() {
|
|
|
39439
39560
|
const state = loadState();
|
|
39440
39561
|
const home = agentHome();
|
|
39441
39562
|
for (const [name, entry] of Object.entries(config.skills)) {
|
|
39442
|
-
if (!
|
|
39563
|
+
if (!fs10.existsSync(path12.join(skillDir(name), "SKILL.md"))) {
|
|
39443
39564
|
issues.push({
|
|
39444
39565
|
level: "error",
|
|
39445
39566
|
message: `config \u4E2D\u7684 '${name}' \u5728\u4E2D\u592E\u4ED3\u5E93\u7F3A\u5931\uFF08source=${entry.source}\uFF09`
|
|
39446
39567
|
});
|
|
39447
39568
|
}
|
|
39448
39569
|
}
|
|
39449
|
-
if (
|
|
39450
|
-
for (const e of
|
|
39451
|
-
if (e.isDirectory() && !config.skills[e.name] &&
|
|
39570
|
+
if (fs10.existsSync(storeDir())) {
|
|
39571
|
+
for (const e of fs10.readdirSync(storeDir(), { withFileTypes: true })) {
|
|
39572
|
+
if (e.isDirectory() && !config.skills[e.name] && fs10.existsSync(path12.join(storeDir(), e.name, "SKILL.md"))) {
|
|
39452
39573
|
issues.push({
|
|
39453
39574
|
level: "warn",
|
|
39454
39575
|
message: `\u4E2D\u592E\u4ED3\u5E93\u4E2D\u7684 '${e.name}' \u672A\u767B\u8BB0\u8FDB config\uFF08\u624B\u52A8\u62F7\u5165\uFF1F\uFF09`,
|
|
@@ -39460,7 +39581,7 @@ function runDoctor() {
|
|
|
39460
39581
|
for (const link2 of state.links) {
|
|
39461
39582
|
let st = null;
|
|
39462
39583
|
try {
|
|
39463
|
-
st =
|
|
39584
|
+
st = fs10.lstatSync(link2.link_path);
|
|
39464
39585
|
} catch {
|
|
39465
39586
|
}
|
|
39466
39587
|
if (!st) {
|
|
@@ -39478,7 +39599,7 @@ function runDoctor() {
|
|
|
39478
39599
|
});
|
|
39479
39600
|
continue;
|
|
39480
39601
|
}
|
|
39481
|
-
if (!
|
|
39602
|
+
if (!fs10.existsSync(link2.link_path)) {
|
|
39482
39603
|
issues.push({
|
|
39483
39604
|
level: "error",
|
|
39484
39605
|
message: `\u65AD\u94FE\uFF1A${link2.link_path} \u6307\u5411\u7684\u76EE\u6807\u4E0D\u5B58\u5728`,
|
|
@@ -39488,10 +39609,10 @@ function runDoctor() {
|
|
|
39488
39609
|
}
|
|
39489
39610
|
for (const agent of AGENTS) {
|
|
39490
39611
|
const dir = agent.skillsDir(home);
|
|
39491
|
-
if (!
|
|
39612
|
+
if (!fs10.existsSync(dir)) continue;
|
|
39492
39613
|
let entries = [];
|
|
39493
39614
|
try {
|
|
39494
|
-
entries =
|
|
39615
|
+
entries = fs10.readdirSync(dir, { withFileTypes: true });
|
|
39495
39616
|
} catch {
|
|
39496
39617
|
continue;
|
|
39497
39618
|
}
|
|
@@ -39500,7 +39621,7 @@ function runDoctor() {
|
|
|
39500
39621
|
const linkPath = path12.join(dir, e.name);
|
|
39501
39622
|
let target = "";
|
|
39502
39623
|
try {
|
|
39503
|
-
target =
|
|
39624
|
+
target = fs10.readlinkSync(linkPath);
|
|
39504
39625
|
} catch {
|
|
39505
39626
|
continue;
|
|
39506
39627
|
}
|
|
@@ -39517,7 +39638,7 @@ function runDoctor() {
|
|
|
39517
39638
|
for (const [name, entry] of Object.entries(config.skills)) {
|
|
39518
39639
|
for (const agent of AGENTS) {
|
|
39519
39640
|
const target = path12.join(agent.skillsDir(home), name);
|
|
39520
|
-
const exposed =
|
|
39641
|
+
const exposed = fs10.existsSync(target);
|
|
39521
39642
|
const wanted = entry.expose[agent.id] === true;
|
|
39522
39643
|
if (wanted && !exposed) {
|
|
39523
39644
|
issues.push({
|
|
@@ -39542,7 +39663,7 @@ function fixDoctor() {
|
|
|
39542
39663
|
state.links = state.links.filter((l) => {
|
|
39543
39664
|
let ok = false;
|
|
39544
39665
|
try {
|
|
39545
|
-
ok =
|
|
39666
|
+
ok = fs10.existsSync(l.link_path) && fs10.lstatSync(l.link_path).isSymbolicLink();
|
|
39546
39667
|
} catch {
|
|
39547
39668
|
ok = false;
|
|
39548
39669
|
}
|
|
@@ -39555,10 +39676,10 @@ function fixDoctor() {
|
|
|
39555
39676
|
saveState(state);
|
|
39556
39677
|
const config = loadConfig();
|
|
39557
39678
|
for (const [name, entry] of Object.entries(config.skills)) {
|
|
39558
|
-
if (!
|
|
39679
|
+
if (!fs10.existsSync(path12.join(skillDir(name), "SKILL.md"))) continue;
|
|
39559
39680
|
for (const agent of AGENTS) {
|
|
39560
39681
|
const target = path12.join(agent.skillsDir(agentHome()), name);
|
|
39561
|
-
const exposed =
|
|
39682
|
+
const exposed = fs10.existsSync(target);
|
|
39562
39683
|
const wanted = entry.expose[agent.id] === true;
|
|
39563
39684
|
if (wanted && !exposed) {
|
|
39564
39685
|
try {
|
|
@@ -39580,7 +39701,7 @@ function fixDoctor() {
|
|
|
39580
39701
|
function isOurSymlink(target, state, skill, agentId) {
|
|
39581
39702
|
let isLink = false;
|
|
39582
39703
|
try {
|
|
39583
|
-
isLink =
|
|
39704
|
+
isLink = fs10.lstatSync(target).isSymbolicLink();
|
|
39584
39705
|
} catch {
|
|
39585
39706
|
return false;
|
|
39586
39707
|
}
|
|
@@ -39591,13 +39712,13 @@ function isOurSymlink(target, state, skill, agentId) {
|
|
|
39591
39712
|
if (inLedger) return true;
|
|
39592
39713
|
let real = null;
|
|
39593
39714
|
try {
|
|
39594
|
-
real =
|
|
39715
|
+
real = fs10.realpathSync(target);
|
|
39595
39716
|
} catch {
|
|
39596
39717
|
return false;
|
|
39597
39718
|
}
|
|
39598
39719
|
let storeReal = null;
|
|
39599
39720
|
try {
|
|
39600
|
-
storeReal =
|
|
39721
|
+
storeReal = fs10.realpathSync(skillDir(skill));
|
|
39601
39722
|
} catch {
|
|
39602
39723
|
return false;
|
|
39603
39724
|
}
|
|
@@ -39605,20 +39726,20 @@ function isOurSymlink(target, state, skill, agentId) {
|
|
|
39605
39726
|
}
|
|
39606
39727
|
function sameRealPath(a, b) {
|
|
39607
39728
|
try {
|
|
39608
|
-
return
|
|
39729
|
+
return fs10.realpathSync(a) === fs10.realpathSync(b);
|
|
39609
39730
|
} catch {
|
|
39610
39731
|
return false;
|
|
39611
39732
|
}
|
|
39612
39733
|
}
|
|
39613
39734
|
|
|
39614
39735
|
// src/core/adopt.ts
|
|
39615
|
-
import
|
|
39736
|
+
import fs11 from "node:fs";
|
|
39616
39737
|
import path13 from "node:path";
|
|
39617
39738
|
function isManagedByStore(dir) {
|
|
39618
39739
|
try {
|
|
39619
|
-
if (!
|
|
39620
|
-
const real =
|
|
39621
|
-
const storeReal =
|
|
39740
|
+
if (!fs11.lstatSync(dir).isSymbolicLink()) return false;
|
|
39741
|
+
const real = fs11.realpathSync(dir);
|
|
39742
|
+
const storeReal = fs11.realpathSync(storeDir());
|
|
39622
39743
|
return real === storeReal || real.startsWith(storeReal + path13.sep);
|
|
39623
39744
|
} catch {
|
|
39624
39745
|
return false;
|
|
@@ -39628,13 +39749,13 @@ function scanAgentSkills(agentId) {
|
|
|
39628
39749
|
const agent = getAgent(agentId);
|
|
39629
39750
|
if (!agent) throw new Error(`\u672A\u77E5 agent '${agentId}'`);
|
|
39630
39751
|
const dir = agent.skillsDir(agentHome());
|
|
39631
|
-
if (!
|
|
39752
|
+
if (!fs11.existsSync(dir)) return [];
|
|
39632
39753
|
const out = [];
|
|
39633
|
-
for (const e of
|
|
39754
|
+
for (const e of fs11.readdirSync(dir, { withFileTypes: true })) {
|
|
39634
39755
|
if (e.name.startsWith(".")) continue;
|
|
39635
39756
|
if (!e.isDirectory() && !e.isSymbolicLink()) continue;
|
|
39636
39757
|
const p = path13.join(dir, e.name);
|
|
39637
|
-
if (!
|
|
39758
|
+
if (!fs11.existsSync(path13.join(p, "SKILL.md"))) continue;
|
|
39638
39759
|
out.push({ name: e.name, path: p });
|
|
39639
39760
|
}
|
|
39640
39761
|
return out;
|
|
@@ -39642,7 +39763,7 @@ function scanAgentSkills(agentId) {
|
|
|
39642
39763
|
function scanAdoptable(agentId) {
|
|
39643
39764
|
return scanAgentSkills(agentId).filter((s) => {
|
|
39644
39765
|
try {
|
|
39645
|
-
return !
|
|
39766
|
+
return !fs11.lstatSync(s.path).isSymbolicLink();
|
|
39646
39767
|
} catch {
|
|
39647
39768
|
return false;
|
|
39648
39769
|
}
|
|
@@ -39673,7 +39794,7 @@ function adoptSkills(opts = {}) {
|
|
|
39673
39794
|
}
|
|
39674
39795
|
let isOwnSymlink = false;
|
|
39675
39796
|
try {
|
|
39676
|
-
isOwnSymlink =
|
|
39797
|
+
isOwnSymlink = fs11.lstatSync(skill.path).isSymbolicLink();
|
|
39677
39798
|
} catch {
|
|
39678
39799
|
}
|
|
39679
39800
|
if (isOwnSymlink) {
|
|
@@ -39693,7 +39814,7 @@ function adoptSkills(opts = {}) {
|
|
|
39693
39814
|
items.push({ agent: agentId, name: skill.name, path: skill.path, status: "skipped-invalid", detail: "\u76EE\u5F55\u540D\u4E0D\u5408\u6CD5" });
|
|
39694
39815
|
continue;
|
|
39695
39816
|
}
|
|
39696
|
-
const existsInStore = !!config.skills[name] ||
|
|
39817
|
+
const existsInStore = !!config.skills[name] || fs11.existsSync(skillDir(name));
|
|
39697
39818
|
if (opts.dryRun) {
|
|
39698
39819
|
items.push({
|
|
39699
39820
|
agent: agentId,
|
|
@@ -39750,7 +39871,7 @@ function adoptSkills(opts = {}) {
|
|
|
39750
39871
|
saveConfig(config);
|
|
39751
39872
|
for (const mv of pendingMoves) {
|
|
39752
39873
|
try {
|
|
39753
|
-
|
|
39874
|
+
fs11.rmSync(mv.path, { recursive: true, force: true });
|
|
39754
39875
|
enableSkill(mv.name, [mv.agentId]);
|
|
39755
39876
|
items.push({
|
|
39756
39877
|
agent: mv.agentId,
|
|
@@ -39785,7 +39906,7 @@ function adoptSkills(opts = {}) {
|
|
|
39785
39906
|
}
|
|
39786
39907
|
|
|
39787
39908
|
// src/core/update.ts
|
|
39788
|
-
import
|
|
39909
|
+
import fs12 from "node:fs";
|
|
39789
39910
|
import os3 from "node:os";
|
|
39790
39911
|
import path14 from "node:path";
|
|
39791
39912
|
import { execFile as execFile3 } from "node:child_process";
|
|
@@ -39796,7 +39917,7 @@ function diffTree(oldDir, newDir) {
|
|
|
39796
39917
|
const collect = (root) => {
|
|
39797
39918
|
const map = /* @__PURE__ */ new Map();
|
|
39798
39919
|
const walk = (d) => {
|
|
39799
|
-
for (const e of
|
|
39920
|
+
for (const e of fs12.readdirSync(d, { withFileTypes: true })) {
|
|
39800
39921
|
if (IGNORED2.has(e.name)) continue;
|
|
39801
39922
|
const p = path14.join(d, e.name);
|
|
39802
39923
|
if (e.isDirectory()) walk(p);
|
|
@@ -39811,7 +39932,7 @@ function diffTree(oldDir, newDir) {
|
|
|
39811
39932
|
const diff2 = { added: [], removed: [], modified: [] };
|
|
39812
39933
|
for (const [rel, p] of newFiles) {
|
|
39813
39934
|
if (!oldFiles.has(rel)) diff2.added.push(rel);
|
|
39814
|
-
else if (
|
|
39935
|
+
else if (fs12.readFileSync(p) !== fs12.readFileSync(oldFiles.get(rel))) diff2.modified.push(rel);
|
|
39815
39936
|
}
|
|
39816
39937
|
for (const rel of oldFiles.keys()) if (!newFiles.has(rel)) diff2.removed.push(rel);
|
|
39817
39938
|
for (const k of ["added", "removed", "modified"]) diff2[k].sort();
|
|
@@ -39822,19 +39943,19 @@ function parseGitSource(source) {
|
|
|
39822
39943
|
}
|
|
39823
39944
|
async function fetchRemote(repoSpec) {
|
|
39824
39945
|
const [url, sub] = repoSpec.split("#");
|
|
39825
|
-
const cloneDir =
|
|
39946
|
+
const cloneDir = fs12.mkdtempSync(path14.join(os3.tmpdir(), "skillpot-update-"));
|
|
39826
39947
|
try {
|
|
39827
39948
|
await execFileP3("git", ["clone", "--depth", "1", url, cloneDir], {
|
|
39828
39949
|
timeout: 3e5,
|
|
39829
39950
|
maxBuffer: 16 * 1024 * 1024
|
|
39830
39951
|
});
|
|
39831
39952
|
const contentDir = sub ? path14.join(cloneDir, sub) : cloneDir;
|
|
39832
|
-
if (!
|
|
39953
|
+
if (!fs12.existsSync(path14.join(contentDir, "SKILL.md"))) {
|
|
39833
39954
|
throw new Error(`\u8FDC\u7AEF ${sub ? `#${sub} ` : ""}\u4E2D\u6CA1\u6709 SKILL.md`);
|
|
39834
39955
|
}
|
|
39835
39956
|
return { checksum: dirChecksum(contentDir), cloneDir, sub };
|
|
39836
39957
|
} catch (e) {
|
|
39837
|
-
|
|
39958
|
+
fs12.rmSync(cloneDir, { recursive: true, force: true });
|
|
39838
39959
|
throw e;
|
|
39839
39960
|
}
|
|
39840
39961
|
}
|
|
@@ -39853,7 +39974,7 @@ async function updateSkills(name, opts = {}) {
|
|
|
39853
39974
|
results.push({ skill: n, status: "local", detail: entry.source });
|
|
39854
39975
|
continue;
|
|
39855
39976
|
}
|
|
39856
|
-
if (!
|
|
39977
|
+
if (!fs12.existsSync(skillDir(n))) {
|
|
39857
39978
|
results.push({ skill: n, status: "error", detail: "\u4E2D\u592E\u4ED3\u5E93\u7F3A\u5931" });
|
|
39858
39979
|
continue;
|
|
39859
39980
|
}
|
|
@@ -39875,13 +39996,13 @@ async function updateSkills(name, opts = {}) {
|
|
|
39875
39996
|
});
|
|
39876
39997
|
continue;
|
|
39877
39998
|
}
|
|
39878
|
-
const staging =
|
|
39999
|
+
const staging = fs12.mkdtempSync(path14.join(os3.tmpdir(), "skillpot-new-"));
|
|
39879
40000
|
try {
|
|
39880
|
-
|
|
39881
|
-
|
|
39882
|
-
|
|
40001
|
+
fs12.cpSync(srcDir, staging, { recursive: true });
|
|
40002
|
+
fs12.rmSync(skillDir(n), { recursive: true, force: true });
|
|
40003
|
+
fs12.cpSync(staging, skillDir(n), { recursive: true });
|
|
39883
40004
|
} finally {
|
|
39884
|
-
|
|
40005
|
+
fs12.rmSync(staging, { recursive: true, force: true });
|
|
39885
40006
|
}
|
|
39886
40007
|
entry.checksum = dirChecksum(skillDir(n));
|
|
39887
40008
|
entry.installed_at = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -39892,7 +40013,7 @@ async function updateSkills(name, opts = {}) {
|
|
|
39892
40013
|
diff: diff2
|
|
39893
40014
|
});
|
|
39894
40015
|
} finally {
|
|
39895
|
-
|
|
40016
|
+
fs12.rmSync(fetched.cloneDir, { recursive: true, force: true });
|
|
39896
40017
|
}
|
|
39897
40018
|
} catch (e) {
|
|
39898
40019
|
results.push({ skill: n, status: "error", detail: e instanceof Error ? e.message : String(e) });
|
|
@@ -39906,15 +40027,15 @@ async function updateSkills(name, opts = {}) {
|
|
|
39906
40027
|
import readline from "node:readline";
|
|
39907
40028
|
|
|
39908
40029
|
// src/core/skill-detail.ts
|
|
39909
|
-
import
|
|
40030
|
+
import fs13 from "node:fs";
|
|
39910
40031
|
import path15 from "node:path";
|
|
39911
40032
|
function readSkillDetail(name) {
|
|
39912
40033
|
const dir = skillDir(name);
|
|
39913
40034
|
const mdPath = path15.join(dir, "SKILL.md");
|
|
39914
|
-
if (!
|
|
40035
|
+
if (!fs13.existsSync(mdPath)) return null;
|
|
39915
40036
|
const files = [];
|
|
39916
40037
|
const walk = (d) => {
|
|
39917
|
-
for (const e of
|
|
40038
|
+
for (const e of fs13.readdirSync(d, { withFileTypes: true })) {
|
|
39918
40039
|
const p = path15.join(d, e.name);
|
|
39919
40040
|
if (e.isDirectory()) {
|
|
39920
40041
|
files.push(path15.relative(dir, p) + "/");
|
|
@@ -39929,7 +40050,7 @@ function readSkillDetail(name) {
|
|
|
39929
40050
|
name,
|
|
39930
40051
|
meta: readSkillMeta(dir),
|
|
39931
40052
|
files: files.sort(),
|
|
39932
|
-
skillMd:
|
|
40053
|
+
skillMd: fs13.readFileSync(mdPath, "utf8")
|
|
39933
40054
|
};
|
|
39934
40055
|
}
|
|
39935
40056
|
|
|
@@ -40060,7 +40181,7 @@ function startMcpServer() {
|
|
|
40060
40181
|
|
|
40061
40182
|
// src/core/gui-server.ts
|
|
40062
40183
|
import crypto3 from "node:crypto";
|
|
40063
|
-
import
|
|
40184
|
+
import fs14 from "node:fs";
|
|
40064
40185
|
import http from "node:http";
|
|
40065
40186
|
import path16 from "node:path";
|
|
40066
40187
|
import { spawn } from "node:child_process";
|
|
@@ -40176,7 +40297,7 @@ async function handleApiRequest(method, pathname, query, body, expectedToken, go
|
|
|
40176
40297
|
let inStore = false;
|
|
40177
40298
|
try {
|
|
40178
40299
|
const n = sanitizeSkillName(s.name);
|
|
40179
|
-
inStore = !!config.skills[n] ||
|
|
40300
|
+
inStore = !!config.skills[n] || fs14.existsSync(skillDir(n));
|
|
40180
40301
|
} catch {
|
|
40181
40302
|
valid = false;
|
|
40182
40303
|
}
|
|
@@ -40351,13 +40472,13 @@ function guiDistDir() {
|
|
|
40351
40472
|
path16.resolve(fileURLToPath(new URL("../../dist/gui/", import.meta.url)))
|
|
40352
40473
|
];
|
|
40353
40474
|
for (const dir of candidates) {
|
|
40354
|
-
if (
|
|
40475
|
+
if (fs14.existsSync(path16.join(dir, "index.html"))) return dir;
|
|
40355
40476
|
}
|
|
40356
40477
|
return candidates[0];
|
|
40357
40478
|
}
|
|
40358
40479
|
function serveStatic(pathname, res) {
|
|
40359
40480
|
const root = guiDistDir();
|
|
40360
|
-
if (!
|
|
40481
|
+
if (!fs14.existsSync(path16.join(root, "index.html"))) {
|
|
40361
40482
|
res.writeHead(503, { "content-type": "text/plain; charset=utf-8" });
|
|
40362
40483
|
res.end("GUI \u524D\u7AEF\u672A\u6784\u5EFA\uFF1A\u5728\u9879\u76EE\u6839\u76EE\u5F55\u8FD0\u884C npm run build:gui\uFF08npm \u53D1\u5E03\u5305\u5185\u5DF2\u81EA\u5E26\uFF09\u3002");
|
|
40363
40484
|
return;
|
|
@@ -40369,7 +40490,7 @@ function serveStatic(pathname, res) {
|
|
|
40369
40490
|
res.end("forbidden");
|
|
40370
40491
|
return;
|
|
40371
40492
|
}
|
|
40372
|
-
if (!
|
|
40493
|
+
if (!fs14.existsSync(file) || fs14.statSync(file).isDirectory()) {
|
|
40373
40494
|
file = path16.join(root, "index.html");
|
|
40374
40495
|
}
|
|
40375
40496
|
const ext = path16.extname(file).toLowerCase();
|
|
@@ -40377,7 +40498,7 @@ function serveStatic(pathname, res) {
|
|
|
40377
40498
|
"content-type": MIME[ext] ?? "application/octet-stream",
|
|
40378
40499
|
"cache-control": rel.startsWith("assets/") ? "public, max-age=31536000, immutable" : "no-store"
|
|
40379
40500
|
});
|
|
40380
|
-
|
|
40501
|
+
fs14.createReadStream(file).pipe(res);
|
|
40381
40502
|
}
|
|
40382
40503
|
async function startGuiServer(opts = {}) {
|
|
40383
40504
|
const token = crypto3.randomBytes(16).toString("hex");
|
|
@@ -45061,7 +45182,7 @@ var FocusContext_default = FocusContext;
|
|
|
45061
45182
|
// node_modules/ink/build/components/ErrorOverview.js
|
|
45062
45183
|
var import_react8 = __toESM(require_react(), 1);
|
|
45063
45184
|
var import_stack_utils = __toESM(require_stack_utils(), 1);
|
|
45064
|
-
import * as
|
|
45185
|
+
import * as fs15 from "node:fs";
|
|
45065
45186
|
import { cwd } from "node:process";
|
|
45066
45187
|
|
|
45067
45188
|
// node_modules/convert-to-spaces/dist/index.js
|
|
@@ -45151,8 +45272,8 @@ function Text({ color, backgroundColor, dimColor = false, bold = false, italic =
|
|
|
45151
45272
|
}
|
|
45152
45273
|
|
|
45153
45274
|
// node_modules/ink/build/components/ErrorOverview.js
|
|
45154
|
-
var cleanupPath = (
|
|
45155
|
-
return
|
|
45275
|
+
var cleanupPath = (path18) => {
|
|
45276
|
+
return path18?.replace(`file://${cwd()}/`, "");
|
|
45156
45277
|
};
|
|
45157
45278
|
var stackUtils = new import_stack_utils.default({
|
|
45158
45279
|
cwd: cwd(),
|
|
@@ -45164,8 +45285,8 @@ function ErrorOverview({ error }) {
|
|
|
45164
45285
|
const filePath = cleanupPath(origin?.file);
|
|
45165
45286
|
let excerpt;
|
|
45166
45287
|
let lineWidth = 0;
|
|
45167
|
-
if (filePath && origin?.line &&
|
|
45168
|
-
const sourceCode =
|
|
45288
|
+
if (filePath && origin?.line && fs15.existsSync(filePath)) {
|
|
45289
|
+
const sourceCode = fs15.readFileSync(filePath, "utf8");
|
|
45169
45290
|
excerpt = dist_default3(sourceCode, origin.line);
|
|
45170
45291
|
if (excerpt) {
|
|
45171
45292
|
for (const { line } of excerpt) {
|
|
@@ -46626,6 +46747,43 @@ program2.command("market [url]").description("\u6D4F\u89C8\u6280\u80FD\u6E90\u91
|
|
|
46626
46747
|
);
|
|
46627
46748
|
})
|
|
46628
46749
|
);
|
|
46750
|
+
program2.command("sync").description("\u56E2\u961F\u5BF9\u9F50\uFF1A\u6309\u9879\u76EE\u6E05\u5355\uFF08\u9ED8\u8BA4 ./.skillpot.yaml\uFF09\u5B89\u88C5/\u5BF9\u9F50 skill \u5E76\u5E94\u7528\u5F00\u653E\u77E9\u9635").option("--file <path>", "\u6E05\u5355\u8DEF\u5F84\uFF08\u9ED8\u8BA4 ./.skillpot.yaml\uFF09").option("--export", "\u628A\u5F53\u524D\u4E2D\u592E\u4ED3\u5E93\u5BFC\u51FA\u4E3A\u6E05\u5355\uFF08\u914D\u5408 --file/--skill\uFF09").option("--skill <skills>", "\u5BFC\u51FA\u65F6\u4EC5\u5BFC\u51FA\u6307\u5B9A skill\uFF08\u9017\u53F7\u5206\u9694\uFF09").option("--dry-run", "\u53EA\u5C55\u793A\u5C06\u5BF9\u9F50\u7684\u52A8\u4F5C\uFF0C\u4E0D\u505A\u4EFB\u4F55\u53D8\u66F4").action(
|
|
46751
|
+
run(async (opts) => {
|
|
46752
|
+
const file = path17.resolve(opts.file ?? ".skillpot.yaml");
|
|
46753
|
+
if (opts.export) {
|
|
46754
|
+
const { manifest, warnings } = exportManifest(file, opts.skill?.split(","));
|
|
46755
|
+
console.log(import_picocolors2.default.green(`\u2714 \u5DF2\u5BFC\u51FA ${Object.keys(manifest.skills).length} \u4E2A skill \u2192 ${file}`));
|
|
46756
|
+
for (const w of warnings) console.log(import_picocolors2.default.yellow(`\u26A0 ${w}`));
|
|
46757
|
+
console.log(import_picocolors2.default.dim("\u63D0\u4EA4\u8FDB\u9879\u76EE\u4ED3\u5E93\u540E\uFF0C\u56E2\u961F\u6210\u5458\u6267\u884C skillpot sync \u5373\u53EF\u4E00\u952E\u5BF9\u9F50"));
|
|
46758
|
+
return;
|
|
46759
|
+
}
|
|
46760
|
+
const items = await syncManifest(file, { dryRun: opts.dryRun });
|
|
46761
|
+
if (!items.length) {
|
|
46762
|
+
console.log(import_picocolors2.default.dim("\u6E05\u5355\u4E3A\u7A7A\uFF0C\u65E0\u53EF\u5BF9\u9F50\u5185\u5BB9"));
|
|
46763
|
+
return;
|
|
46764
|
+
}
|
|
46765
|
+
console.log(
|
|
46766
|
+
renderTable(
|
|
46767
|
+
["Skill", "\u52A8\u4F5C", "\u8BF4\u660E"],
|
|
46768
|
+
items.map((i) => [
|
|
46769
|
+
i.skill,
|
|
46770
|
+
SYNC_ACTION_LABELS[i.action] + (i.dryRun ? "\uFF08\u5C06\u6267\u884C\uFF09" : ""),
|
|
46771
|
+
i.detail ?? ""
|
|
46772
|
+
])
|
|
46773
|
+
)
|
|
46774
|
+
);
|
|
46775
|
+
const counts = items.reduce((m, i) => {
|
|
46776
|
+
m[i.action] = (m[i.action] ?? 0) + 1;
|
|
46777
|
+
return m;
|
|
46778
|
+
}, {});
|
|
46779
|
+
const summary = Object.entries(counts).map(([k, v]) => `${SYNC_ACTION_LABELS[k] ?? k} ${v}`).join("\uFF0C");
|
|
46780
|
+
console.log(
|
|
46781
|
+
opts.dryRun ? import_picocolors2.default.dim(`\u4EE5\u4E0A\u4E3A\u8BD5\u8FD0\u884C\u7ED3\u679C\uFF08--dry-run\uFF09\uFF0C\u672A\u505A\u4EFB\u4F55\u53D8\u66F4\u3002${summary}`) : import_picocolors2.default.green(`\u5BF9\u9F50\u5B8C\u6210\uFF1A${summary}`)
|
|
46782
|
+
);
|
|
46783
|
+
const errors = items.filter((i) => i.action === "error");
|
|
46784
|
+
if (errors.length) process.exitCode = 1;
|
|
46785
|
+
})
|
|
46786
|
+
);
|
|
46629
46787
|
for (const cmd of program2.commands) cmd.allowExcessArguments(false);
|
|
46630
46788
|
await program2.parseAsync(process.argv);
|
|
46631
46789
|
/*! Bundled license information:
|