@packmind/cli 0.29.1 → 0.30.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/main.cjs +980 -498
- package/package.json +13 -15
package/main.cjs
CHANGED
|
@@ -371,32 +371,32 @@ var init_supports_color = __esm({
|
|
|
371
371
|
});
|
|
372
372
|
|
|
373
373
|
// node_modules/chalk/source/utilities.js
|
|
374
|
-
function stringReplaceAll(
|
|
375
|
-
let index =
|
|
374
|
+
function stringReplaceAll(string20, substring, replacer) {
|
|
375
|
+
let index = string20.indexOf(substring);
|
|
376
376
|
if (index === -1) {
|
|
377
|
-
return
|
|
377
|
+
return string20;
|
|
378
378
|
}
|
|
379
379
|
const substringLength = substring.length;
|
|
380
380
|
let endIndex = 0;
|
|
381
381
|
let returnValue = "";
|
|
382
382
|
do {
|
|
383
|
-
returnValue +=
|
|
383
|
+
returnValue += string20.slice(endIndex, index) + substring + replacer;
|
|
384
384
|
endIndex = index + substringLength;
|
|
385
|
-
index =
|
|
385
|
+
index = string20.indexOf(substring, endIndex);
|
|
386
386
|
} while (index !== -1);
|
|
387
|
-
returnValue +=
|
|
387
|
+
returnValue += string20.slice(endIndex);
|
|
388
388
|
return returnValue;
|
|
389
389
|
}
|
|
390
|
-
function stringEncaseCRLFWithFirstIndex(
|
|
390
|
+
function stringEncaseCRLFWithFirstIndex(string20, prefix, postfix, index) {
|
|
391
391
|
let endIndex = 0;
|
|
392
392
|
let returnValue = "";
|
|
393
393
|
do {
|
|
394
|
-
const gotCR =
|
|
395
|
-
returnValue +=
|
|
394
|
+
const gotCR = string20[index - 1] === "\r";
|
|
395
|
+
returnValue += string20.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
396
396
|
endIndex = index + 1;
|
|
397
|
-
index =
|
|
397
|
+
index = string20.indexOf("\n", endIndex);
|
|
398
398
|
} while (index !== -1);
|
|
399
|
-
returnValue +=
|
|
399
|
+
returnValue += string20.slice(endIndex);
|
|
400
400
|
return returnValue;
|
|
401
401
|
}
|
|
402
402
|
var init_utilities = __esm({
|
|
@@ -434,9 +434,9 @@ var init_source = __esm({
|
|
|
434
434
|
init_utilities();
|
|
435
435
|
init_ansi_styles();
|
|
436
436
|
({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default);
|
|
437
|
-
GENERATOR = Symbol("GENERATOR");
|
|
438
|
-
STYLER = Symbol("STYLER");
|
|
439
|
-
IS_EMPTY = Symbol("IS_EMPTY");
|
|
437
|
+
GENERATOR = /* @__PURE__ */ Symbol("GENERATOR");
|
|
438
|
+
STYLER = /* @__PURE__ */ Symbol("STYLER");
|
|
439
|
+
IS_EMPTY = /* @__PURE__ */ Symbol("IS_EMPTY");
|
|
440
440
|
levelMapping = [
|
|
441
441
|
"ansi",
|
|
442
442
|
"ansi",
|
|
@@ -555,26 +555,26 @@ var init_source = __esm({
|
|
|
555
555
|
builder[IS_EMPTY] = _isEmpty;
|
|
556
556
|
return builder;
|
|
557
557
|
};
|
|
558
|
-
applyStyle = (self,
|
|
559
|
-
if (self.level <= 0 || !
|
|
560
|
-
return self[IS_EMPTY] ? "" :
|
|
558
|
+
applyStyle = (self, string20) => {
|
|
559
|
+
if (self.level <= 0 || !string20) {
|
|
560
|
+
return self[IS_EMPTY] ? "" : string20;
|
|
561
561
|
}
|
|
562
562
|
let styler = self[STYLER];
|
|
563
563
|
if (styler === void 0) {
|
|
564
|
-
return
|
|
564
|
+
return string20;
|
|
565
565
|
}
|
|
566
566
|
const { openAll, closeAll } = styler;
|
|
567
|
-
if (
|
|
567
|
+
if (string20.includes("\x1B")) {
|
|
568
568
|
while (styler !== void 0) {
|
|
569
|
-
|
|
569
|
+
string20 = stringReplaceAll(string20, styler.close, styler.open);
|
|
570
570
|
styler = styler.parent;
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
|
-
const lfIndex =
|
|
573
|
+
const lfIndex = string20.indexOf("\n");
|
|
574
574
|
if (lfIndex !== -1) {
|
|
575
|
-
|
|
575
|
+
string20 = stringEncaseCRLFWithFirstIndex(string20, closeAll, openAll, lfIndex);
|
|
576
576
|
}
|
|
577
|
-
return openAll +
|
|
577
|
+
return openAll + string20 + closeAll;
|
|
578
578
|
};
|
|
579
579
|
Object.defineProperties(createChalk.prototype, styles2);
|
|
580
580
|
chalk = createChalk();
|
|
@@ -842,7 +842,7 @@ var require_types = __commonJS({
|
|
|
842
842
|
"use strict";
|
|
843
843
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
844
844
|
exports2.boolean = exports2.string = exports2.number = void 0;
|
|
845
|
-
exports2.optional =
|
|
845
|
+
exports2.optional = optional18;
|
|
846
846
|
exports2.array = array2;
|
|
847
847
|
var type_1 = require_type();
|
|
848
848
|
exports2.number = {
|
|
@@ -869,7 +869,7 @@ var require_types = __commonJS({
|
|
|
869
869
|
return false;
|
|
870
870
|
}
|
|
871
871
|
};
|
|
872
|
-
function
|
|
872
|
+
function optional18(t) {
|
|
873
873
|
return {
|
|
874
874
|
...t,
|
|
875
875
|
defaultValue() {
|
|
@@ -892,7 +892,7 @@ var require_types = __commonJS({
|
|
|
892
892
|
var require_flag = __commonJS({
|
|
893
893
|
"node_modules/cmd-ts/dist/cjs/flag.js"(exports2) {
|
|
894
894
|
"use strict";
|
|
895
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
895
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
896
896
|
if (k2 === void 0) k2 = k;
|
|
897
897
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
898
898
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -901,16 +901,16 @@ var require_flag = __commonJS({
|
|
|
901
901
|
} };
|
|
902
902
|
}
|
|
903
903
|
Object.defineProperty(o, k2, desc);
|
|
904
|
-
} : function(o, m, k, k2) {
|
|
904
|
+
}) : (function(o, m, k, k2) {
|
|
905
905
|
if (k2 === void 0) k2 = k;
|
|
906
906
|
o[k2] = m[k];
|
|
907
|
-
});
|
|
908
|
-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
907
|
+
}));
|
|
908
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
909
909
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
910
|
-
} : function(o, v) {
|
|
910
|
+
}) : function(o, v) {
|
|
911
911
|
o["default"] = v;
|
|
912
912
|
});
|
|
913
|
-
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
913
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
914
914
|
var ownKeys = function(o) {
|
|
915
915
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
916
916
|
var ar = [];
|
|
@@ -928,7 +928,7 @@ var require_flag = __commonJS({
|
|
|
928
928
|
__setModuleDefault(result, mod);
|
|
929
929
|
return result;
|
|
930
930
|
};
|
|
931
|
-
}();
|
|
931
|
+
})();
|
|
932
932
|
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
933
933
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
934
934
|
};
|
|
@@ -1097,7 +1097,7 @@ var require_flag = __commonJS({
|
|
|
1097
1097
|
var require_circuitbreaker = __commonJS({
|
|
1098
1098
|
"node_modules/cmd-ts/dist/cjs/circuitbreaker.js"(exports2) {
|
|
1099
1099
|
"use strict";
|
|
1100
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1100
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
1101
1101
|
if (k2 === void 0) k2 = k;
|
|
1102
1102
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1103
1103
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -1106,16 +1106,16 @@ var require_circuitbreaker = __commonJS({
|
|
|
1106
1106
|
} };
|
|
1107
1107
|
}
|
|
1108
1108
|
Object.defineProperty(o, k2, desc);
|
|
1109
|
-
} : function(o, m, k, k2) {
|
|
1109
|
+
}) : (function(o, m, k, k2) {
|
|
1110
1110
|
if (k2 === void 0) k2 = k;
|
|
1111
1111
|
o[k2] = m[k];
|
|
1112
|
-
});
|
|
1113
|
-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
1112
|
+
}));
|
|
1113
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
1114
1114
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1115
|
-
} : function(o, v) {
|
|
1115
|
+
}) : function(o, v) {
|
|
1116
1116
|
o["default"] = v;
|
|
1117
1117
|
});
|
|
1118
|
-
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
1118
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
1119
1119
|
var ownKeys = function(o) {
|
|
1120
1120
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
1121
1121
|
var ar = [];
|
|
@@ -1133,7 +1133,7 @@ var require_circuitbreaker = __commonJS({
|
|
|
1133
1133
|
__setModuleDefault(result, mod);
|
|
1134
1134
|
return result;
|
|
1135
1135
|
};
|
|
1136
|
-
}();
|
|
1136
|
+
})();
|
|
1137
1137
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1138
1138
|
exports2.versionFlag = exports2.helpFlag = void 0;
|
|
1139
1139
|
exports2.handleCircuitBreaker = handleCircuitBreaker;
|
|
@@ -1214,7 +1214,7 @@ var require_circuitbreaker = __commonJS({
|
|
|
1214
1214
|
var require_positional = __commonJS({
|
|
1215
1215
|
"node_modules/cmd-ts/dist/cjs/positional.js"(exports2) {
|
|
1216
1216
|
"use strict";
|
|
1217
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1217
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
1218
1218
|
if (k2 === void 0) k2 = k;
|
|
1219
1219
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1220
1220
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -1223,16 +1223,16 @@ var require_positional = __commonJS({
|
|
|
1223
1223
|
} };
|
|
1224
1224
|
}
|
|
1225
1225
|
Object.defineProperty(o, k2, desc);
|
|
1226
|
-
} : function(o, m, k, k2) {
|
|
1226
|
+
}) : (function(o, m, k, k2) {
|
|
1227
1227
|
if (k2 === void 0) k2 = k;
|
|
1228
1228
|
o[k2] = m[k];
|
|
1229
|
-
});
|
|
1230
|
-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
1229
|
+
}));
|
|
1230
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
1231
1231
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1232
|
-
} : function(o, v) {
|
|
1232
|
+
}) : function(o, v) {
|
|
1233
1233
|
o["default"] = v;
|
|
1234
1234
|
});
|
|
1235
|
-
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
1235
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
1236
1236
|
var ownKeys = function(o) {
|
|
1237
1237
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
1238
1238
|
var ar = [];
|
|
@@ -1250,12 +1250,12 @@ var require_positional = __commonJS({
|
|
|
1250
1250
|
__setModuleDefault(result, mod);
|
|
1251
1251
|
return result;
|
|
1252
1252
|
};
|
|
1253
|
-
}();
|
|
1253
|
+
})();
|
|
1254
1254
|
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
1255
1255
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1256
1256
|
};
|
|
1257
1257
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1258
|
-
exports2.positional =
|
|
1258
|
+
exports2.positional = positional12;
|
|
1259
1259
|
var chalk_1 = __importDefault((init_source(), __toCommonJS(source_exports)));
|
|
1260
1260
|
var Result = __importStar(require_Result());
|
|
1261
1261
|
var types_1 = require_types();
|
|
@@ -1295,8 +1295,8 @@ var require_positional = __commonJS({
|
|
|
1295
1295
|
var _a2;
|
|
1296
1296
|
const positionals = nodes.filter((node) => node.type === "positionalArgument" && !visitedNodes.has(node));
|
|
1297
1297
|
const defaultValueFn = (_a2 = config.defaultValue) !== null && _a2 !== void 0 ? _a2 : config.type.defaultValue;
|
|
1298
|
-
const
|
|
1299
|
-
if (!
|
|
1298
|
+
const positional13 = positionals[0];
|
|
1299
|
+
if (!positional13) {
|
|
1300
1300
|
if (defaultValueFn) {
|
|
1301
1301
|
return Result.ok(defaultValueFn());
|
|
1302
1302
|
}
|
|
@@ -1309,13 +1309,13 @@ var require_positional = __commonJS({
|
|
|
1309
1309
|
]
|
|
1310
1310
|
});
|
|
1311
1311
|
}
|
|
1312
|
-
visitedNodes.add(
|
|
1313
|
-
const decoded = await Result.safeAsync(config.type.from(
|
|
1312
|
+
visitedNodes.add(positional13);
|
|
1313
|
+
const decoded = await Result.safeAsync(config.type.from(positional13.raw));
|
|
1314
1314
|
if (Result.isErr(decoded)) {
|
|
1315
1315
|
return Result.err({
|
|
1316
1316
|
errors: [
|
|
1317
1317
|
{
|
|
1318
|
-
nodes: [
|
|
1318
|
+
nodes: [positional13],
|
|
1319
1319
|
message: decoded.error.message
|
|
1320
1320
|
}
|
|
1321
1321
|
]
|
|
@@ -1325,7 +1325,7 @@ var require_positional = __commonJS({
|
|
|
1325
1325
|
}
|
|
1326
1326
|
};
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1328
|
+
function positional12(config) {
|
|
1329
1329
|
return fullPositional({
|
|
1330
1330
|
type: types_1.string,
|
|
1331
1331
|
...config
|
|
@@ -1338,7 +1338,7 @@ var require_positional = __commonJS({
|
|
|
1338
1338
|
var require_subcommands = __commonJS({
|
|
1339
1339
|
"node_modules/cmd-ts/dist/cjs/subcommands.js"(exports2) {
|
|
1340
1340
|
"use strict";
|
|
1341
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1341
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
1342
1342
|
if (k2 === void 0) k2 = k;
|
|
1343
1343
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1344
1344
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -1347,16 +1347,16 @@ var require_subcommands = __commonJS({
|
|
|
1347
1347
|
} };
|
|
1348
1348
|
}
|
|
1349
1349
|
Object.defineProperty(o, k2, desc);
|
|
1350
|
-
} : function(o, m, k, k2) {
|
|
1350
|
+
}) : (function(o, m, k, k2) {
|
|
1351
1351
|
if (k2 === void 0) k2 = k;
|
|
1352
1352
|
o[k2] = m[k];
|
|
1353
|
-
});
|
|
1354
|
-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
1353
|
+
}));
|
|
1354
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
1355
1355
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1356
|
-
} : function(o, v) {
|
|
1356
|
+
}) : function(o, v) {
|
|
1357
1357
|
o["default"] = v;
|
|
1358
1358
|
});
|
|
1359
|
-
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
1359
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
1360
1360
|
var ownKeys = function(o) {
|
|
1361
1361
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
1362
1362
|
var ar = [];
|
|
@@ -1374,18 +1374,18 @@ var require_subcommands = __commonJS({
|
|
|
1374
1374
|
__setModuleDefault(result, mod);
|
|
1375
1375
|
return result;
|
|
1376
1376
|
};
|
|
1377
|
-
}();
|
|
1377
|
+
})();
|
|
1378
1378
|
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
1379
1379
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1380
1380
|
};
|
|
1381
1381
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1382
|
-
exports2.subcommands =
|
|
1382
|
+
exports2.subcommands = subcommands11;
|
|
1383
1383
|
var chalk_1 = __importDefault((init_source(), __toCommonJS(source_exports)));
|
|
1384
1384
|
var didyoumean_1 = __importDefault(require_didYouMean_1_2_1());
|
|
1385
1385
|
var Result = __importStar(require_Result());
|
|
1386
1386
|
var circuitbreaker_1 = require_circuitbreaker();
|
|
1387
1387
|
var positional_1 = require_positional();
|
|
1388
|
-
function
|
|
1388
|
+
function subcommands11(config) {
|
|
1389
1389
|
const circuitbreaker = (0, circuitbreaker_1.createCircuitBreaker)(!!config.version);
|
|
1390
1390
|
const type = {
|
|
1391
1391
|
async from(str) {
|
|
@@ -1578,14 +1578,14 @@ var strip_ansi_exports = {};
|
|
|
1578
1578
|
__export(strip_ansi_exports, {
|
|
1579
1579
|
default: () => stripAnsi
|
|
1580
1580
|
});
|
|
1581
|
-
function stripAnsi(
|
|
1582
|
-
if (typeof
|
|
1583
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof
|
|
1581
|
+
function stripAnsi(string20) {
|
|
1582
|
+
if (typeof string20 !== "string") {
|
|
1583
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string20}\``);
|
|
1584
1584
|
}
|
|
1585
|
-
if (!
|
|
1586
|
-
return
|
|
1585
|
+
if (!string20.includes("\x1B") && !string20.includes("\x9B")) {
|
|
1586
|
+
return string20;
|
|
1587
1587
|
}
|
|
1588
|
-
return
|
|
1588
|
+
return string20.replace(regex, "");
|
|
1589
1589
|
}
|
|
1590
1590
|
var regex;
|
|
1591
1591
|
var init_strip_ansi = __esm({
|
|
@@ -1660,7 +1660,7 @@ var require_utils = __commonJS({
|
|
|
1660
1660
|
var require_command = __commonJS({
|
|
1661
1661
|
"node_modules/cmd-ts/dist/cjs/command.js"(exports2) {
|
|
1662
1662
|
"use strict";
|
|
1663
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1663
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
1664
1664
|
if (k2 === void 0) k2 = k;
|
|
1665
1665
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1666
1666
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -1669,16 +1669,16 @@ var require_command = __commonJS({
|
|
|
1669
1669
|
} };
|
|
1670
1670
|
}
|
|
1671
1671
|
Object.defineProperty(o, k2, desc);
|
|
1672
|
-
} : function(o, m, k, k2) {
|
|
1672
|
+
}) : (function(o, m, k, k2) {
|
|
1673
1673
|
if (k2 === void 0) k2 = k;
|
|
1674
1674
|
o[k2] = m[k];
|
|
1675
|
-
});
|
|
1676
|
-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
1675
|
+
}));
|
|
1676
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
1677
1677
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1678
|
-
} : function(o, v) {
|
|
1678
|
+
}) : function(o, v) {
|
|
1679
1679
|
o["default"] = v;
|
|
1680
1680
|
});
|
|
1681
|
-
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
1681
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
1682
1682
|
var ownKeys = function(o) {
|
|
1683
1683
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
1684
1684
|
var ar = [];
|
|
@@ -1696,17 +1696,17 @@ var require_command = __commonJS({
|
|
|
1696
1696
|
__setModuleDefault(result, mod);
|
|
1697
1697
|
return result;
|
|
1698
1698
|
};
|
|
1699
|
-
}();
|
|
1699
|
+
})();
|
|
1700
1700
|
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
1701
1701
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1702
1702
|
};
|
|
1703
1703
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1704
|
-
exports2.command =
|
|
1704
|
+
exports2.command = command34;
|
|
1705
1705
|
var chalk_1 = __importDefault((init_source(), __toCommonJS(source_exports)));
|
|
1706
1706
|
var Result = __importStar(require_Result());
|
|
1707
1707
|
var circuitbreaker_1 = require_circuitbreaker();
|
|
1708
1708
|
var utils_1 = require_utils();
|
|
1709
|
-
function
|
|
1709
|
+
function command34(config) {
|
|
1710
1710
|
const argEntries = (0, utils_1.entries)(config.args);
|
|
1711
1711
|
const circuitbreaker = (0, circuitbreaker_1.createCircuitBreaker)(!!config.version);
|
|
1712
1712
|
return {
|
|
@@ -1826,7 +1826,7 @@ var require_command = __commonJS({
|
|
|
1826
1826
|
var require_option = __commonJS({
|
|
1827
1827
|
"node_modules/cmd-ts/dist/cjs/option.js"(exports2) {
|
|
1828
1828
|
"use strict";
|
|
1829
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1829
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
1830
1830
|
if (k2 === void 0) k2 = k;
|
|
1831
1831
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1832
1832
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -1835,16 +1835,16 @@ var require_option = __commonJS({
|
|
|
1835
1835
|
} };
|
|
1836
1836
|
}
|
|
1837
1837
|
Object.defineProperty(o, k2, desc);
|
|
1838
|
-
} : function(o, m, k, k2) {
|
|
1838
|
+
}) : (function(o, m, k, k2) {
|
|
1839
1839
|
if (k2 === void 0) k2 = k;
|
|
1840
1840
|
o[k2] = m[k];
|
|
1841
|
-
});
|
|
1842
|
-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
1841
|
+
}));
|
|
1842
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
1843
1843
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1844
|
-
} : function(o, v) {
|
|
1844
|
+
}) : function(o, v) {
|
|
1845
1845
|
o["default"] = v;
|
|
1846
1846
|
});
|
|
1847
|
-
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
1847
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
1848
1848
|
var ownKeys = function(o) {
|
|
1849
1849
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
1850
1850
|
var ar = [];
|
|
@@ -1862,7 +1862,7 @@ var require_option = __commonJS({
|
|
|
1862
1862
|
__setModuleDefault(result, mod);
|
|
1863
1863
|
return result;
|
|
1864
1864
|
};
|
|
1865
|
-
}();
|
|
1865
|
+
})();
|
|
1866
1866
|
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
1867
1867
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1868
1868
|
};
|
|
@@ -3087,8 +3087,8 @@ var require_tokenizer = __commonJS({
|
|
|
3087
3087
|
tokens.push(token);
|
|
3088
3088
|
overallIndex += token.raw.length;
|
|
3089
3089
|
};
|
|
3090
|
-
for (const [stringIndex,
|
|
3091
|
-
const chars = [...
|
|
3090
|
+
for (const [stringIndex, string20] of (0, utils_1.enumerate)(strings)) {
|
|
3091
|
+
const chars = [...string20];
|
|
3092
3092
|
for (let i = 0; i < chars.length; i++) {
|
|
3093
3093
|
if (chars[i] === "-" && chars[i + 1] === "-") {
|
|
3094
3094
|
push({ type: "longPrefix", raw: "--", index: overallIndex });
|
|
@@ -3183,7 +3183,7 @@ var require_runner = __commonJS({
|
|
|
3183
3183
|
var require_restPositionals = __commonJS({
|
|
3184
3184
|
"node_modules/cmd-ts/dist/cjs/restPositionals.js"(exports2) {
|
|
3185
3185
|
"use strict";
|
|
3186
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3186
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3187
3187
|
if (k2 === void 0) k2 = k;
|
|
3188
3188
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3189
3189
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -3192,16 +3192,16 @@ var require_restPositionals = __commonJS({
|
|
|
3192
3192
|
} };
|
|
3193
3193
|
}
|
|
3194
3194
|
Object.defineProperty(o, k2, desc);
|
|
3195
|
-
} : function(o, m, k, k2) {
|
|
3195
|
+
}) : (function(o, m, k, k2) {
|
|
3196
3196
|
if (k2 === void 0) k2 = k;
|
|
3197
3197
|
o[k2] = m[k];
|
|
3198
|
-
});
|
|
3199
|
-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
3198
|
+
}));
|
|
3199
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
3200
3200
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3201
|
-
} : function(o, v) {
|
|
3201
|
+
}) : function(o, v) {
|
|
3202
3202
|
o["default"] = v;
|
|
3203
3203
|
});
|
|
3204
|
-
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
3204
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
3205
3205
|
var ownKeys = function(o) {
|
|
3206
3206
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
3207
3207
|
var ar = [];
|
|
@@ -3219,7 +3219,7 @@ var require_restPositionals = __commonJS({
|
|
|
3219
3219
|
__setModuleDefault(result, mod);
|
|
3220
3220
|
return result;
|
|
3221
3221
|
};
|
|
3222
|
-
}();
|
|
3222
|
+
})();
|
|
3223
3223
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
3224
3224
|
exports2.restPositionals = restPositionals5;
|
|
3225
3225
|
var Result = __importStar(require_Result());
|
|
@@ -3244,14 +3244,14 @@ var require_restPositionals = __commonJS({
|
|
|
3244
3244
|
const positionals = nodes.filter((node) => node.type === "positionalArgument" && !visitedNodes.has(node));
|
|
3245
3245
|
const results = [];
|
|
3246
3246
|
const errors = [];
|
|
3247
|
-
for (const
|
|
3248
|
-
visitedNodes.add(
|
|
3249
|
-
const decoded = await Result.safeAsync(config.type.from(
|
|
3247
|
+
for (const positional12 of positionals) {
|
|
3248
|
+
visitedNodes.add(positional12);
|
|
3249
|
+
const decoded = await Result.safeAsync(config.type.from(positional12.raw));
|
|
3250
3250
|
if (Result.isOk(decoded)) {
|
|
3251
3251
|
results.push(decoded.value);
|
|
3252
3252
|
} else {
|
|
3253
3253
|
errors.push({
|
|
3254
|
-
nodes: [
|
|
3254
|
+
nodes: [positional12],
|
|
3255
3255
|
message: decoded.error.message
|
|
3256
3256
|
});
|
|
3257
3257
|
}
|
|
@@ -3278,7 +3278,7 @@ var require_restPositionals = __commonJS({
|
|
|
3278
3278
|
var require_multiflag = __commonJS({
|
|
3279
3279
|
"node_modules/cmd-ts/dist/cjs/multiflag.js"(exports2) {
|
|
3280
3280
|
"use strict";
|
|
3281
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3281
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3282
3282
|
if (k2 === void 0) k2 = k;
|
|
3283
3283
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3284
3284
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -3287,16 +3287,16 @@ var require_multiflag = __commonJS({
|
|
|
3287
3287
|
} };
|
|
3288
3288
|
}
|
|
3289
3289
|
Object.defineProperty(o, k2, desc);
|
|
3290
|
-
} : function(o, m, k, k2) {
|
|
3290
|
+
}) : (function(o, m, k, k2) {
|
|
3291
3291
|
if (k2 === void 0) k2 = k;
|
|
3292
3292
|
o[k2] = m[k];
|
|
3293
|
-
});
|
|
3294
|
-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
3293
|
+
}));
|
|
3294
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
3295
3295
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3296
|
-
} : function(o, v) {
|
|
3296
|
+
}) : function(o, v) {
|
|
3297
3297
|
o["default"] = v;
|
|
3298
3298
|
});
|
|
3299
|
-
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
3299
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
3300
3300
|
var ownKeys = function(o) {
|
|
3301
3301
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
3302
3302
|
var ar = [];
|
|
@@ -3314,7 +3314,7 @@ var require_multiflag = __commonJS({
|
|
|
3314
3314
|
__setModuleDefault(result, mod);
|
|
3315
3315
|
return result;
|
|
3316
3316
|
};
|
|
3317
|
-
}();
|
|
3317
|
+
})();
|
|
3318
3318
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
3319
3319
|
exports2.multiflag = multiflag;
|
|
3320
3320
|
var Result = __importStar(require_Result());
|
|
@@ -3389,7 +3389,7 @@ var require_multiflag = __commonJS({
|
|
|
3389
3389
|
var require_multioption = __commonJS({
|
|
3390
3390
|
"node_modules/cmd-ts/dist/cjs/multioption.js"(exports2) {
|
|
3391
3391
|
"use strict";
|
|
3392
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3392
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3393
3393
|
if (k2 === void 0) k2 = k;
|
|
3394
3394
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3395
3395
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -3398,16 +3398,16 @@ var require_multioption = __commonJS({
|
|
|
3398
3398
|
} };
|
|
3399
3399
|
}
|
|
3400
3400
|
Object.defineProperty(o, k2, desc);
|
|
3401
|
-
} : function(o, m, k, k2) {
|
|
3401
|
+
}) : (function(o, m, k, k2) {
|
|
3402
3402
|
if (k2 === void 0) k2 = k;
|
|
3403
3403
|
o[k2] = m[k];
|
|
3404
|
-
});
|
|
3405
|
-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
3404
|
+
}));
|
|
3405
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
3406
3406
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3407
|
-
} : function(o, v) {
|
|
3407
|
+
}) : function(o, v) {
|
|
3408
3408
|
o["default"] = v;
|
|
3409
3409
|
});
|
|
3410
|
-
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
3410
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
3411
3411
|
var ownKeys = function(o) {
|
|
3412
3412
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
3413
3413
|
var ar = [];
|
|
@@ -3425,7 +3425,7 @@ var require_multioption = __commonJS({
|
|
|
3425
3425
|
__setModuleDefault(result, mod);
|
|
3426
3426
|
return result;
|
|
3427
3427
|
};
|
|
3428
|
-
}();
|
|
3428
|
+
})();
|
|
3429
3429
|
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
3430
3430
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
3431
3431
|
};
|
|
@@ -3561,7 +3561,7 @@ var require_multioption = __commonJS({
|
|
|
3561
3561
|
var require_union = __commonJS({
|
|
3562
3562
|
"node_modules/cmd-ts/dist/cjs/union.js"(exports2) {
|
|
3563
3563
|
"use strict";
|
|
3564
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3564
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3565
3565
|
if (k2 === void 0) k2 = k;
|
|
3566
3566
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3567
3567
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -3570,16 +3570,16 @@ var require_union = __commonJS({
|
|
|
3570
3570
|
} };
|
|
3571
3571
|
}
|
|
3572
3572
|
Object.defineProperty(o, k2, desc);
|
|
3573
|
-
} : function(o, m, k, k2) {
|
|
3573
|
+
}) : (function(o, m, k, k2) {
|
|
3574
3574
|
if (k2 === void 0) k2 = k;
|
|
3575
3575
|
o[k2] = m[k];
|
|
3576
|
-
});
|
|
3577
|
-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
3576
|
+
}));
|
|
3577
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
3578
3578
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3579
|
-
} : function(o, v) {
|
|
3579
|
+
}) : function(o, v) {
|
|
3580
3580
|
o["default"] = v;
|
|
3581
3581
|
});
|
|
3582
|
-
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
3582
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
3583
3583
|
var ownKeys = function(o) {
|
|
3584
3584
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
3585
3585
|
var ar = [];
|
|
@@ -3597,7 +3597,7 @@ var require_union = __commonJS({
|
|
|
3597
3597
|
__setModuleDefault(result, mod);
|
|
3598
3598
|
return result;
|
|
3599
3599
|
};
|
|
3600
|
-
}();
|
|
3600
|
+
})();
|
|
3601
3601
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
3602
3602
|
exports2.union = union;
|
|
3603
3603
|
var Result = __importStar(require_Result());
|
|
@@ -3649,7 +3649,7 @@ var require_oneOf = __commonJS({
|
|
|
3649
3649
|
var require_rest = __commonJS({
|
|
3650
3650
|
"node_modules/cmd-ts/dist/cjs/rest.js"(exports2) {
|
|
3651
3651
|
"use strict";
|
|
3652
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3652
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3653
3653
|
if (k2 === void 0) k2 = k;
|
|
3654
3654
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3655
3655
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -3658,16 +3658,16 @@ var require_rest = __commonJS({
|
|
|
3658
3658
|
} };
|
|
3659
3659
|
}
|
|
3660
3660
|
Object.defineProperty(o, k2, desc);
|
|
3661
|
-
} : function(o, m, k, k2) {
|
|
3661
|
+
}) : (function(o, m, k, k2) {
|
|
3662
3662
|
if (k2 === void 0) k2 = k;
|
|
3663
3663
|
o[k2] = m[k];
|
|
3664
|
-
});
|
|
3665
|
-
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
3664
|
+
}));
|
|
3665
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
3666
3666
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3667
|
-
} : function(o, v) {
|
|
3667
|
+
}) : function(o, v) {
|
|
3668
3668
|
o["default"] = v;
|
|
3669
3669
|
});
|
|
3670
|
-
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
3670
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
|
|
3671
3671
|
var ownKeys = function(o) {
|
|
3672
3672
|
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
3673
3673
|
var ar = [];
|
|
@@ -3685,7 +3685,7 @@ var require_rest = __commonJS({
|
|
|
3685
3685
|
__setModuleDefault(result, mod);
|
|
3686
3686
|
return result;
|
|
3687
3687
|
};
|
|
3688
|
-
}();
|
|
3688
|
+
})();
|
|
3689
3689
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
3690
3690
|
exports2.rest = rest;
|
|
3691
3691
|
var Result = __importStar(require_Result());
|
|
@@ -3763,7 +3763,7 @@ var require_rest = __commonJS({
|
|
|
3763
3763
|
var require_cjs = __commonJS({
|
|
3764
3764
|
"node_modules/cmd-ts/dist/cjs/index.js"(exports2) {
|
|
3765
3765
|
"use strict";
|
|
3766
|
-
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
3766
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
3767
3767
|
if (k2 === void 0) k2 = k;
|
|
3768
3768
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3769
3769
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -3772,10 +3772,10 @@ var require_cjs = __commonJS({
|
|
|
3772
3772
|
} };
|
|
3773
3773
|
}
|
|
3774
3774
|
Object.defineProperty(o, k2, desc);
|
|
3775
|
-
} : function(o, m, k, k2) {
|
|
3775
|
+
}) : (function(o, m, k, k2) {
|
|
3776
3776
|
if (k2 === void 0) k2 = k;
|
|
3777
3777
|
o[k2] = m[k];
|
|
3778
|
-
});
|
|
3778
|
+
}));
|
|
3779
3779
|
var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
3780
3780
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
3781
3781
|
};
|
|
@@ -3855,7 +3855,7 @@ var require_package = __commonJS({
|
|
|
3855
3855
|
"apps/cli/package.json"(exports2, module2) {
|
|
3856
3856
|
module2.exports = {
|
|
3857
3857
|
name: "@packmind/cli",
|
|
3858
|
-
version: "0.
|
|
3858
|
+
version: "0.30.0",
|
|
3859
3859
|
description: "A command-line interface for Packmind linting and code quality checks",
|
|
3860
3860
|
private: false,
|
|
3861
3861
|
bin: {
|
|
@@ -3891,7 +3891,6 @@ var require_package = __commonJS({
|
|
|
3891
3891
|
},
|
|
3892
3892
|
dependencies: {
|
|
3893
3893
|
"@types/inquirer": "^9.0.9",
|
|
3894
|
-
diff: "^8.0.3",
|
|
3895
3894
|
inquirer: "^13.0.2",
|
|
3896
3895
|
zod: "^4.3.5",
|
|
3897
3896
|
semver: "^7.7.4",
|
|
@@ -3905,7 +3904,7 @@ var require_package = __commonJS({
|
|
|
3905
3904
|
});
|
|
3906
3905
|
|
|
3907
3906
|
// apps/cli/src/main.ts
|
|
3908
|
-
var
|
|
3907
|
+
var import_cmd_ts44 = __toESM(require_cjs());
|
|
3909
3908
|
|
|
3910
3909
|
// apps/cli/src/infra/commands/LinterCommand.ts
|
|
3911
3910
|
var import_cmd_ts = __toESM(require_cjs());
|
|
@@ -4085,6 +4084,7 @@ var VALID_CODING_AGENTS = [
|
|
|
4085
4084
|
"packmind",
|
|
4086
4085
|
"junie",
|
|
4087
4086
|
"claude",
|
|
4087
|
+
"claude_plugin",
|
|
4088
4088
|
"cursor",
|
|
4089
4089
|
"copilot",
|
|
4090
4090
|
"agents_md",
|
|
@@ -4134,6 +4134,12 @@ var AGENT_CAPABILITIES = {
|
|
|
4134
4134
|
recipes: false
|
|
4135
4135
|
},
|
|
4136
4136
|
claude: { skills: true, standards: true, commands: true, recipes: true },
|
|
4137
|
+
claude_plugin: {
|
|
4138
|
+
skills: true,
|
|
4139
|
+
standards: false,
|
|
4140
|
+
commands: true,
|
|
4141
|
+
recipes: true
|
|
4142
|
+
},
|
|
4137
4143
|
cursor: { skills: true, standards: true, commands: true, recipes: true },
|
|
4138
4144
|
copilot: { skills: true, standards: true, commands: true, recipes: true },
|
|
4139
4145
|
continue: { skills: false, standards: true, commands: true, recipes: true },
|
|
@@ -4154,6 +4160,7 @@ var CodingAgents = {
|
|
|
4154
4160
|
packmind: "packmind",
|
|
4155
4161
|
junie: "junie",
|
|
4156
4162
|
claude: "claude",
|
|
4163
|
+
claude_plugin: "claude_plugin",
|
|
4157
4164
|
cursor: "cursor",
|
|
4158
4165
|
copilot: "copilot",
|
|
4159
4166
|
agents_md: "agents_md",
|
|
@@ -4170,6 +4177,11 @@ var CODING_AGENT_ARTEFACT_PATHS = {
|
|
|
4170
4177
|
standard: ".claude/rules/",
|
|
4171
4178
|
skill: ".claude/skills/"
|
|
4172
4179
|
},
|
|
4180
|
+
claude_plugin: {
|
|
4181
|
+
command: "",
|
|
4182
|
+
standard: "",
|
|
4183
|
+
skill: ""
|
|
4184
|
+
},
|
|
4173
4185
|
cursor: {
|
|
4174
4186
|
command: ".cursor/commands/",
|
|
4175
4187
|
standard: ".cursor/rules/",
|
|
@@ -4379,6 +4391,7 @@ var RENDER_MODE_ORDER = [
|
|
|
4379
4391
|
"JUNIE" /* JUNIE */,
|
|
4380
4392
|
"GH_COPILOT" /* GH_COPILOT */,
|
|
4381
4393
|
"CLAUDE" /* CLAUDE */,
|
|
4394
|
+
"CLAUDE_PLUGIN" /* CLAUDE_PLUGIN */,
|
|
4382
4395
|
"CURSOR" /* CURSOR */,
|
|
4383
4396
|
"GITLAB_DUO" /* GITLAB_DUO */,
|
|
4384
4397
|
"CONTINUE" /* CONTINUE */
|
|
@@ -4405,6 +4418,7 @@ var RENDER_MODE_TO_CODING_AGENT = {
|
|
|
4405
4418
|
["JUNIE" /* JUNIE */]: CodingAgents.junie,
|
|
4406
4419
|
["GH_COPILOT" /* GH_COPILOT */]: CodingAgents.copilot,
|
|
4407
4420
|
["CLAUDE" /* CLAUDE */]: CodingAgents.claude,
|
|
4421
|
+
["CLAUDE_PLUGIN" /* CLAUDE_PLUGIN */]: CodingAgents.claude_plugin,
|
|
4408
4422
|
["CURSOR" /* CURSOR */]: CodingAgents.cursor,
|
|
4409
4423
|
["GITLAB_DUO" /* GITLAB_DUO */]: CodingAgents.gitlab_duo,
|
|
4410
4424
|
["CONTINUE" /* CONTINUE */]: CodingAgents.continue,
|
|
@@ -4451,6 +4465,20 @@ var DeploymentCompletedEvent = class extends UserEvent {
|
|
|
4451
4465
|
}
|
|
4452
4466
|
};
|
|
4453
4467
|
|
|
4468
|
+
// packages/types/src/deployments/events/PluginDeletedEvent.ts
|
|
4469
|
+
var PluginDeletedEvent = class extends UserEvent {
|
|
4470
|
+
static {
|
|
4471
|
+
this.eventName = "deployments.plugin.deleted";
|
|
4472
|
+
}
|
|
4473
|
+
};
|
|
4474
|
+
|
|
4475
|
+
// packages/types/src/deployments/events/PluginRenderedEvent.ts
|
|
4476
|
+
var PluginRenderedEvent = class extends UserEvent {
|
|
4477
|
+
static {
|
|
4478
|
+
this.eventName = "deployments.plugin.rendered";
|
|
4479
|
+
}
|
|
4480
|
+
};
|
|
4481
|
+
|
|
4454
4482
|
// packages/types/src/git/GitRepoId.ts
|
|
4455
4483
|
var createGitRepoId = brandedIdFactory();
|
|
4456
4484
|
|
|
@@ -5360,8 +5388,8 @@ var ExecuteSingleFileAstUseCase = class _ExecuteSingleFileAstUseCase {
|
|
|
5360
5388
|
static {
|
|
5361
5389
|
this.fallbackRuleContent = "adhoc-rule";
|
|
5362
5390
|
}
|
|
5363
|
-
async execute(
|
|
5364
|
-
const { program, fileContent, language } =
|
|
5391
|
+
async execute(command34) {
|
|
5392
|
+
const { program, fileContent, language } = command34;
|
|
5365
5393
|
const result = await this.linterExecutionUseCase.execute({
|
|
5366
5394
|
filePath: "cli-single-file",
|
|
5367
5395
|
fileContent,
|
|
@@ -5745,8 +5773,8 @@ var GetGitRemoteUrlUseCase = class {
|
|
|
5745
5773
|
constructor(gitRemoteUrlService = new GitService()) {
|
|
5746
5774
|
this.gitRemoteUrlService = gitRemoteUrlService;
|
|
5747
5775
|
}
|
|
5748
|
-
async execute(
|
|
5749
|
-
const { path: repoPath, origin: origin9 } =
|
|
5776
|
+
async execute(command34) {
|
|
5777
|
+
const { path: repoPath, origin: origin9 } = command34;
|
|
5750
5778
|
return this.gitRemoteUrlService.getGitRemoteUrl(repoPath, origin9);
|
|
5751
5779
|
}
|
|
5752
5780
|
};
|
|
@@ -5898,8 +5926,8 @@ var ListFilesInDirectoryUseCase = class {
|
|
|
5898
5926
|
constructor(listFiles = new ListFiles()) {
|
|
5899
5927
|
this.listFiles = listFiles;
|
|
5900
5928
|
}
|
|
5901
|
-
async execute(
|
|
5902
|
-
const { path: directoryPath, extensions, excludes = [] } =
|
|
5929
|
+
async execute(command34) {
|
|
5930
|
+
const { path: directoryPath, extensions, excludes = [] } = command34;
|
|
5903
5931
|
const files = await this.listFiles.listFilesInDirectory(
|
|
5904
5932
|
directoryPath,
|
|
5905
5933
|
extensions,
|
|
@@ -6014,7 +6042,7 @@ var LintFilesAgainstRuleUseCase = class {
|
|
|
6014
6042
|
};
|
|
6015
6043
|
};
|
|
6016
6044
|
}
|
|
6017
|
-
async execute(
|
|
6045
|
+
async execute(command34) {
|
|
6018
6046
|
const {
|
|
6019
6047
|
path: userPath,
|
|
6020
6048
|
draftMode,
|
|
@@ -6023,7 +6051,7 @@ var LintFilesAgainstRuleUseCase = class {
|
|
|
6023
6051
|
language,
|
|
6024
6052
|
diffMode,
|
|
6025
6053
|
ignorePatterns
|
|
6026
|
-
} =
|
|
6054
|
+
} = command34;
|
|
6027
6055
|
this.logger.debug(
|
|
6028
6056
|
`Starting linting: path="${userPath}", draftMode=${!!draftMode}, standardSlug="${standardSlug || "N/A"}", ruleId="${ruleId || "N/A"}", language="${language || "N/A"}", diffMode="${diffMode ?? "none"}"`
|
|
6029
6057
|
);
|
|
@@ -6339,8 +6367,8 @@ var LintFilesAgainstRuleUseCase = class {
|
|
|
6339
6367
|
return null;
|
|
6340
6368
|
}
|
|
6341
6369
|
}
|
|
6342
|
-
async executeProgramsForFile(
|
|
6343
|
-
const result = await this.services.linterExecutionUseCase.execute(
|
|
6370
|
+
async executeProgramsForFile(command34) {
|
|
6371
|
+
const result = await this.services.linterExecutionUseCase.execute(command34);
|
|
6344
6372
|
return result.violations;
|
|
6345
6373
|
}
|
|
6346
6374
|
extractExtensionFromFile(filePath) {
|
|
@@ -6363,8 +6391,8 @@ var LintFilesFromConfigUseCase = class {
|
|
|
6363
6391
|
this.logger = logger2;
|
|
6364
6392
|
this.detectionProgramsCache = /* @__PURE__ */ new Map();
|
|
6365
6393
|
}
|
|
6366
|
-
async execute(
|
|
6367
|
-
const { path: userPath, diffMode, ignorePatterns } =
|
|
6394
|
+
async execute(command34) {
|
|
6395
|
+
const { path: userPath, diffMode, ignorePatterns } = command34;
|
|
6368
6396
|
this.logger.debug(
|
|
6369
6397
|
`Starting local linting: path="${userPath}", diffMode="${diffMode ?? "none"}"`
|
|
6370
6398
|
);
|
|
@@ -6624,8 +6652,8 @@ var LintFilesFromConfigUseCase = class {
|
|
|
6624
6652
|
return null;
|
|
6625
6653
|
}
|
|
6626
6654
|
}
|
|
6627
|
-
async executeProgramsForFile(
|
|
6628
|
-
const result = await this.services.linterExecutionUseCase.execute(
|
|
6655
|
+
async executeProgramsForFile(command34) {
|
|
6656
|
+
const result = await this.services.linterExecutionUseCase.execute(command34);
|
|
6629
6657
|
return result.violations;
|
|
6630
6658
|
}
|
|
6631
6659
|
extractExtensionFromFile(filePath) {
|
|
@@ -6801,13 +6829,13 @@ var PackmindHttpClient = class {
|
|
|
6801
6829
|
var ChangeProposalGateway = class {
|
|
6802
6830
|
constructor(httpClient) {
|
|
6803
6831
|
this.httpClient = httpClient;
|
|
6804
|
-
this.batchCreate = async (
|
|
6832
|
+
this.batchCreate = async (command34) => {
|
|
6805
6833
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
6806
6834
|
return this.httpClient.request(
|
|
6807
|
-
`/api/v0/organizations/${organizationId}/spaces/${
|
|
6835
|
+
`/api/v0/organizations/${organizationId}/spaces/${command34.spaceId}/change-proposals/batch`,
|
|
6808
6836
|
{
|
|
6809
6837
|
method: "POST",
|
|
6810
|
-
body: { proposals:
|
|
6838
|
+
body: { proposals: command34.proposals },
|
|
6811
6839
|
onError: (response) => {
|
|
6812
6840
|
if (response.status === 404) {
|
|
6813
6841
|
throw new CommunityEditionError("change proposals");
|
|
@@ -6816,29 +6844,29 @@ var ChangeProposalGateway = class {
|
|
|
6816
6844
|
}
|
|
6817
6845
|
);
|
|
6818
6846
|
};
|
|
6819
|
-
this.batchApply = async (
|
|
6847
|
+
this.batchApply = async (command34) => {
|
|
6820
6848
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
6821
6849
|
return this.httpClient.request(
|
|
6822
6850
|
`/api/v0/organizations/${organizationId}/playbook/apply`,
|
|
6823
6851
|
{
|
|
6824
6852
|
method: "POST",
|
|
6825
6853
|
body: {
|
|
6826
|
-
proposals:
|
|
6827
|
-
message:
|
|
6828
|
-
...
|
|
6829
|
-
directUpdate:
|
|
6854
|
+
proposals: command34.proposals,
|
|
6855
|
+
message: command34.message,
|
|
6856
|
+
...command34.directUpdate !== void 0 && {
|
|
6857
|
+
directUpdate: command34.directUpdate
|
|
6830
6858
|
}
|
|
6831
6859
|
}
|
|
6832
6860
|
}
|
|
6833
6861
|
);
|
|
6834
6862
|
};
|
|
6835
|
-
this.check = async (
|
|
6863
|
+
this.check = async (command34) => {
|
|
6836
6864
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
6837
6865
|
return this.httpClient.request(
|
|
6838
|
-
`/api/v0/organizations/${organizationId}/spaces/${
|
|
6866
|
+
`/api/v0/organizations/${organizationId}/spaces/${command34.spaceId}/change-proposals/check`,
|
|
6839
6867
|
{
|
|
6840
6868
|
method: "POST",
|
|
6841
|
-
body: { proposals:
|
|
6869
|
+
body: { proposals: command34.proposals },
|
|
6842
6870
|
onError: (response) => {
|
|
6843
6871
|
if (response.status === 404) {
|
|
6844
6872
|
throw new CommunityEditionError("change proposals");
|
|
@@ -6854,13 +6882,13 @@ var ChangeProposalGateway = class {
|
|
|
6854
6882
|
var LinterGateway = class {
|
|
6855
6883
|
constructor(httpClient) {
|
|
6856
6884
|
this.httpClient = httpClient;
|
|
6857
|
-
this.getDraftDetectionProgramsForRule = async (
|
|
6885
|
+
this.getDraftDetectionProgramsForRule = async (command34) => {
|
|
6858
6886
|
const payload = {
|
|
6859
|
-
standardSlug:
|
|
6860
|
-
ruleId:
|
|
6887
|
+
standardSlug: command34.standardSlug,
|
|
6888
|
+
ruleId: command34.ruleId
|
|
6861
6889
|
};
|
|
6862
|
-
if (
|
|
6863
|
-
payload.language =
|
|
6890
|
+
if (command34.language) {
|
|
6891
|
+
payload.language = command34.language;
|
|
6864
6892
|
}
|
|
6865
6893
|
return this.httpClient.request("/api/v0/list-draft-detection-program", {
|
|
6866
6894
|
method: "POST",
|
|
@@ -6872,13 +6900,13 @@ var LinterGateway = class {
|
|
|
6872
6900
|
}
|
|
6873
6901
|
});
|
|
6874
6902
|
};
|
|
6875
|
-
this.getActiveDetectionProgramsForRule = async (
|
|
6903
|
+
this.getActiveDetectionProgramsForRule = async (command34) => {
|
|
6876
6904
|
const payload = {
|
|
6877
|
-
standardSlug:
|
|
6878
|
-
ruleId:
|
|
6905
|
+
standardSlug: command34.standardSlug,
|
|
6906
|
+
ruleId: command34.ruleId
|
|
6879
6907
|
};
|
|
6880
|
-
if (
|
|
6881
|
-
payload.language =
|
|
6908
|
+
if (command34.language) {
|
|
6909
|
+
payload.language = command34.language;
|
|
6882
6910
|
}
|
|
6883
6911
|
return this.httpClient.request("/api/v0/list-active-detection-program", {
|
|
6884
6912
|
method: "POST",
|
|
@@ -6890,13 +6918,13 @@ var LinterGateway = class {
|
|
|
6890
6918
|
}
|
|
6891
6919
|
});
|
|
6892
6920
|
};
|
|
6893
|
-
this.getDetectionProgramsForPackages = async (
|
|
6921
|
+
this.getDetectionProgramsForPackages = async (command34) => {
|
|
6894
6922
|
const response = await this.httpClient.request(
|
|
6895
6923
|
"/api/v0/detection-programs-for-packages",
|
|
6896
6924
|
{
|
|
6897
6925
|
method: "POST",
|
|
6898
6926
|
body: {
|
|
6899
|
-
packagesSlugs:
|
|
6927
|
+
packagesSlugs: command34.packagesSlugs
|
|
6900
6928
|
},
|
|
6901
6929
|
onError: (response2) => {
|
|
6902
6930
|
if (response2.status === 404) {
|
|
@@ -6907,10 +6935,10 @@ var LinterGateway = class {
|
|
|
6907
6935
|
);
|
|
6908
6936
|
return handleScopeInTargetsResponse(response);
|
|
6909
6937
|
};
|
|
6910
|
-
this.trackLinterExecution = async (
|
|
6938
|
+
this.trackLinterExecution = async (command34) => {
|
|
6911
6939
|
return this.httpClient.request(`/api/v0/track-execution`, {
|
|
6912
6940
|
method: "POST",
|
|
6913
|
-
body:
|
|
6941
|
+
body: command34
|
|
6914
6942
|
});
|
|
6915
6943
|
};
|
|
6916
6944
|
}
|
|
@@ -6964,27 +6992,27 @@ var SpacesGateway = class {
|
|
|
6964
6992
|
var SkillsGateway = class {
|
|
6965
6993
|
constructor(httpClient) {
|
|
6966
6994
|
this.httpClient = httpClient;
|
|
6967
|
-
this.upload = async (
|
|
6995
|
+
this.upload = async (command34) => {
|
|
6968
6996
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
6969
6997
|
return this.httpClient.request(
|
|
6970
|
-
`/api/v0/organizations/${organizationId}/spaces/${
|
|
6998
|
+
`/api/v0/organizations/${organizationId}/spaces/${command34.spaceId}/skills/upload`,
|
|
6971
6999
|
{
|
|
6972
7000
|
method: "POST",
|
|
6973
|
-
body:
|
|
7001
|
+
body: command34
|
|
6974
7002
|
}
|
|
6975
7003
|
);
|
|
6976
7004
|
};
|
|
6977
|
-
this.getDefaults = async (
|
|
7005
|
+
this.getDefaults = async (command34) => {
|
|
6978
7006
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
6979
7007
|
const queryParams = new URLSearchParams();
|
|
6980
|
-
if (
|
|
7008
|
+
if (command34.includeBeta) {
|
|
6981
7009
|
queryParams.set("includeBeta", "true");
|
|
6982
|
-
} else if (
|
|
6983
|
-
queryParams.set("cliVersion",
|
|
7010
|
+
} else if (command34.cliVersion) {
|
|
7011
|
+
queryParams.set("cliVersion", command34.cliVersion);
|
|
6984
7012
|
}
|
|
6985
|
-
if (
|
|
7013
|
+
if (command34.agents !== void 0) {
|
|
6986
7014
|
queryParams.append("agentsConfigOverride", "true");
|
|
6987
|
-
|
|
7015
|
+
command34.agents.forEach((agent) => {
|
|
6988
7016
|
queryParams.append("agent", agent);
|
|
6989
7017
|
});
|
|
6990
7018
|
}
|
|
@@ -6993,10 +7021,10 @@ var SkillsGateway = class {
|
|
|
6993
7021
|
`/api/v0/organizations/${organizationId}/skills/default${queryString ? `?${queryString}` : ""}`
|
|
6994
7022
|
);
|
|
6995
7023
|
};
|
|
6996
|
-
this.list = async (
|
|
7024
|
+
this.list = async (command34) => {
|
|
6997
7025
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
6998
7026
|
return this.httpClient.request(
|
|
6999
|
-
`/api/v0/organizations/${organizationId}/spaces/${
|
|
7027
|
+
`/api/v0/organizations/${organizationId}/spaces/${command34.spaceId}/skills`
|
|
7000
7028
|
);
|
|
7001
7029
|
};
|
|
7002
7030
|
}
|
|
@@ -7006,17 +7034,17 @@ var SkillsGateway = class {
|
|
|
7006
7034
|
var CommandsGateway = class {
|
|
7007
7035
|
constructor(httpClient) {
|
|
7008
7036
|
this.httpClient = httpClient;
|
|
7009
|
-
this.create = async (
|
|
7037
|
+
this.create = async (command34) => {
|
|
7010
7038
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7011
7039
|
return this.httpClient.request(
|
|
7012
|
-
`/api/v0/organizations/${organizationId}/spaces/${
|
|
7013
|
-
{ method: "POST", body:
|
|
7040
|
+
`/api/v0/organizations/${organizationId}/spaces/${command34.spaceId}/recipes`,
|
|
7041
|
+
{ method: "POST", body: command34 }
|
|
7014
7042
|
);
|
|
7015
7043
|
};
|
|
7016
|
-
this.list = async (
|
|
7044
|
+
this.list = async (command34) => {
|
|
7017
7045
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7018
7046
|
const listRecipesResponse = await this.httpClient.request(
|
|
7019
|
-
`/api/v0/organizations/${organizationId}/spaces/${
|
|
7047
|
+
`/api/v0/organizations/${organizationId}/spaces/${command34.spaceId}/recipes`
|
|
7020
7048
|
);
|
|
7021
7049
|
if (listRecipesResponse instanceof Array) {
|
|
7022
7050
|
return { recipes: listRecipesResponse };
|
|
@@ -7057,10 +7085,10 @@ var StandardsGateway = class {
|
|
|
7057
7085
|
}
|
|
7058
7086
|
);
|
|
7059
7087
|
};
|
|
7060
|
-
this.list = async (
|
|
7088
|
+
this.list = async (command34) => {
|
|
7061
7089
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7062
7090
|
return this.httpClient.request(
|
|
7063
|
-
`/api/v0/organizations/${organizationId}/spaces/${
|
|
7091
|
+
`/api/v0/organizations/${organizationId}/spaces/${command34.spaceId}/standards`
|
|
7064
7092
|
);
|
|
7065
7093
|
};
|
|
7066
7094
|
}
|
|
@@ -7071,10 +7099,10 @@ var PackagesGateway = class {
|
|
|
7071
7099
|
constructor(apiKey, httpClient) {
|
|
7072
7100
|
this.apiKey = apiKey;
|
|
7073
7101
|
this.httpClient = httpClient;
|
|
7074
|
-
this.list = async (
|
|
7102
|
+
this.list = async (command34) => {
|
|
7075
7103
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7076
7104
|
return this.httpClient.request(
|
|
7077
|
-
`/api/v0/organizations/${organizationId}/spaces/${
|
|
7105
|
+
`/api/v0/organizations/${organizationId}/spaces/${command34.spaceId}/packages`
|
|
7078
7106
|
);
|
|
7079
7107
|
};
|
|
7080
7108
|
this.getSummary = async ({
|
|
@@ -7086,24 +7114,24 @@ var PackagesGateway = class {
|
|
|
7086
7114
|
`/api/v0/organizations/${organizationId}/spaces/${spaceId}/packages/summary/${encodeURIComponent(slug6)}`
|
|
7087
7115
|
);
|
|
7088
7116
|
};
|
|
7089
|
-
this.create = async (
|
|
7117
|
+
this.create = async (command34) => {
|
|
7090
7118
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7091
7119
|
return this.httpClient.request(
|
|
7092
|
-
`/api/v0/organizations/${organizationId}/spaces/${
|
|
7120
|
+
`/api/v0/organizations/${organizationId}/spaces/${command34.spaceId}/packages`,
|
|
7093
7121
|
{
|
|
7094
7122
|
method: "POST",
|
|
7095
|
-
body:
|
|
7123
|
+
body: command34
|
|
7096
7124
|
}
|
|
7097
7125
|
);
|
|
7098
7126
|
};
|
|
7099
|
-
this.addArtefacts = async (
|
|
7127
|
+
this.addArtefacts = async (command34) => {
|
|
7100
7128
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7101
|
-
const { packageId, spaceId } =
|
|
7129
|
+
const { packageId, spaceId } = command34;
|
|
7102
7130
|
return this.httpClient.request(
|
|
7103
7131
|
`/api/v0/organizations/${organizationId}/spaces/${spaceId}/packages/${packageId}/add-artifacts`,
|
|
7104
7132
|
{
|
|
7105
7133
|
method: "POST",
|
|
7106
|
-
body:
|
|
7134
|
+
body: command34
|
|
7107
7135
|
}
|
|
7108
7136
|
);
|
|
7109
7137
|
};
|
|
@@ -7114,31 +7142,31 @@ var PackagesGateway = class {
|
|
|
7114
7142
|
var DeploymentGateway = class {
|
|
7115
7143
|
constructor(httpClient) {
|
|
7116
7144
|
this.httpClient = httpClient;
|
|
7117
|
-
this.pull = async (
|
|
7145
|
+
this.pull = async (command34) => {
|
|
7118
7146
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7119
7147
|
const queryParams = new URLSearchParams();
|
|
7120
|
-
if (
|
|
7121
|
-
|
|
7148
|
+
if (command34.packagesSlugs && command34.packagesSlugs.length > 0) {
|
|
7149
|
+
command34.packagesSlugs.forEach((slug6) => {
|
|
7122
7150
|
queryParams.append("packageSlug", slug6);
|
|
7123
7151
|
});
|
|
7124
7152
|
}
|
|
7125
|
-
if (
|
|
7126
|
-
|
|
7153
|
+
if (command34.previousPackagesSlugs && command34.previousPackagesSlugs.length > 0) {
|
|
7154
|
+
command34.previousPackagesSlugs.forEach((slug6) => {
|
|
7127
7155
|
queryParams.append("previousPackageSlug", slug6);
|
|
7128
7156
|
});
|
|
7129
7157
|
}
|
|
7130
|
-
if (
|
|
7131
|
-
queryParams.append("gitRemoteUrl",
|
|
7158
|
+
if (command34.gitRemoteUrl) {
|
|
7159
|
+
queryParams.append("gitRemoteUrl", command34.gitRemoteUrl);
|
|
7132
7160
|
}
|
|
7133
|
-
if (
|
|
7134
|
-
queryParams.append("gitBranch",
|
|
7161
|
+
if (command34.gitBranch) {
|
|
7162
|
+
queryParams.append("gitBranch", command34.gitBranch);
|
|
7135
7163
|
}
|
|
7136
|
-
if (
|
|
7137
|
-
queryParams.append("relativePath",
|
|
7164
|
+
if (command34.relativePath) {
|
|
7165
|
+
queryParams.append("relativePath", command34.relativePath);
|
|
7138
7166
|
}
|
|
7139
|
-
if (
|
|
7167
|
+
if (command34.agents !== void 0) {
|
|
7140
7168
|
queryParams.append("agentsConfigOverride", "true");
|
|
7141
|
-
|
|
7169
|
+
command34.agents.forEach((agent) => {
|
|
7142
7170
|
queryParams.append("agent", agent);
|
|
7143
7171
|
});
|
|
7144
7172
|
}
|
|
@@ -7146,71 +7174,101 @@ var DeploymentGateway = class {
|
|
|
7146
7174
|
`/api/v0/organizations/${organizationId}/pull?${queryParams.toString()}`
|
|
7147
7175
|
);
|
|
7148
7176
|
};
|
|
7149
|
-
this.install = async (
|
|
7177
|
+
this.install = async (command34) => {
|
|
7150
7178
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7151
7179
|
return this.httpClient.request(
|
|
7152
7180
|
`/api/v0/organizations/${organizationId}/install`,
|
|
7153
7181
|
{
|
|
7154
7182
|
method: "POST",
|
|
7155
7183
|
body: {
|
|
7156
|
-
packagesSlugs:
|
|
7157
|
-
packmindLockFile:
|
|
7158
|
-
...
|
|
7159
|
-
...
|
|
7184
|
+
packagesSlugs: command34.packagesSlugs,
|
|
7185
|
+
packmindLockFile: command34.packmindLockFile,
|
|
7186
|
+
...command34.relativePath && { relativePath: command34.relativePath },
|
|
7187
|
+
...command34.agents !== void 0 && { agents: command34.agents }
|
|
7160
7188
|
}
|
|
7161
7189
|
}
|
|
7162
7190
|
);
|
|
7163
7191
|
};
|
|
7164
|
-
this.getDeployed = async (
|
|
7192
|
+
this.getDeployed = async (command34) => {
|
|
7165
7193
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7166
7194
|
return this.httpClient.request(
|
|
7167
7195
|
`/api/v0/organizations/${organizationId}/deployed-content`,
|
|
7168
7196
|
{
|
|
7169
7197
|
method: "POST",
|
|
7170
7198
|
body: {
|
|
7171
|
-
packagesSlugs:
|
|
7172
|
-
gitRemoteUrl:
|
|
7173
|
-
gitBranch:
|
|
7174
|
-
relativePath:
|
|
7175
|
-
...
|
|
7199
|
+
packagesSlugs: command34.packagesSlugs,
|
|
7200
|
+
gitRemoteUrl: command34.gitRemoteUrl,
|
|
7201
|
+
gitBranch: command34.gitBranch,
|
|
7202
|
+
relativePath: command34.relativePath,
|
|
7203
|
+
...command34.agents !== void 0 && { agents: command34.agents }
|
|
7176
7204
|
}
|
|
7177
7205
|
}
|
|
7178
7206
|
);
|
|
7179
7207
|
};
|
|
7180
|
-
this.getContentByVersions = async (
|
|
7208
|
+
this.getContentByVersions = async (command34) => {
|
|
7181
7209
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7182
7210
|
return this.httpClient.request(
|
|
7183
7211
|
`/api/v0/organizations/${organizationId}/content-by-versions`,
|
|
7184
7212
|
{
|
|
7185
7213
|
method: "POST",
|
|
7186
7214
|
body: {
|
|
7187
|
-
artifacts:
|
|
7188
|
-
...
|
|
7215
|
+
artifacts: command34.artifacts,
|
|
7216
|
+
...command34.agents !== void 0 && { agents: command34.agents }
|
|
7189
7217
|
}
|
|
7190
7218
|
}
|
|
7191
7219
|
);
|
|
7192
7220
|
};
|
|
7193
|
-
this.notifyDistribution = async (
|
|
7221
|
+
this.notifyDistribution = async (command34) => {
|
|
7194
7222
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7195
7223
|
return this.httpClient.request(
|
|
7196
7224
|
`/api/v0/organizations/${organizationId}/deployments`,
|
|
7197
7225
|
{
|
|
7198
7226
|
method: "POST",
|
|
7199
|
-
body:
|
|
7227
|
+
body: command34
|
|
7200
7228
|
}
|
|
7201
7229
|
);
|
|
7202
7230
|
};
|
|
7203
|
-
this.notifyArtefactsDistribution = async (
|
|
7231
|
+
this.notifyArtefactsDistribution = async (command34) => {
|
|
7204
7232
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7205
7233
|
return this.httpClient.request(
|
|
7206
7234
|
`/api/v0/organizations/${organizationId}/deployments/notify-artifacts-distribution`,
|
|
7207
7235
|
{
|
|
7208
7236
|
method: "POST",
|
|
7209
7237
|
body: {
|
|
7210
|
-
gitRemoteUrl:
|
|
7211
|
-
gitBranch:
|
|
7212
|
-
relativePath:
|
|
7213
|
-
packmindLockFile:
|
|
7238
|
+
gitRemoteUrl: command34.gitRemoteUrl,
|
|
7239
|
+
gitBranch: command34.gitBranch,
|
|
7240
|
+
relativePath: command34.relativePath,
|
|
7241
|
+
packmindLockFile: command34.packmindLockFile
|
|
7242
|
+
}
|
|
7243
|
+
}
|
|
7244
|
+
);
|
|
7245
|
+
};
|
|
7246
|
+
this.renderPlugin = async (command34) => {
|
|
7247
|
+
const { organizationId } = this.httpClient.getAuthContext();
|
|
7248
|
+
return this.httpClient.request(
|
|
7249
|
+
`/api/v0/organizations/${organizationId}/plugins/render`,
|
|
7250
|
+
{
|
|
7251
|
+
method: "POST",
|
|
7252
|
+
body: {
|
|
7253
|
+
packageSlug: command34.packageSlug,
|
|
7254
|
+
mode: command34.mode,
|
|
7255
|
+
pluginRoot: command34.pluginRoot,
|
|
7256
|
+
pluginName: command34.pluginName,
|
|
7257
|
+
gitRemoteUrl: command34.gitRemoteUrl,
|
|
7258
|
+
gitBranch: command34.gitBranch
|
|
7259
|
+
}
|
|
7260
|
+
}
|
|
7261
|
+
);
|
|
7262
|
+
};
|
|
7263
|
+
this.trackPluginDeleted = async (command34) => {
|
|
7264
|
+
const { organizationId } = this.httpClient.getAuthContext();
|
|
7265
|
+
return this.httpClient.request(
|
|
7266
|
+
`/api/v0/organizations/${organizationId}/plugins/track-deleted`,
|
|
7267
|
+
{
|
|
7268
|
+
method: "POST",
|
|
7269
|
+
body: {
|
|
7270
|
+
packageSlug: command34.packageSlug,
|
|
7271
|
+
gitRemoteUrl: command34.gitRemoteUrl
|
|
7214
7272
|
}
|
|
7215
7273
|
}
|
|
7216
7274
|
);
|
|
@@ -7222,13 +7280,13 @@ var DeploymentGateway = class {
|
|
|
7222
7280
|
);
|
|
7223
7281
|
};
|
|
7224
7282
|
}
|
|
7225
|
-
async updateRenderModeConfiguration(
|
|
7283
|
+
async updateRenderModeConfiguration(command34) {
|
|
7226
7284
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7227
7285
|
await this.httpClient.request(
|
|
7228
7286
|
`/api/v0/organizations/${organizationId}/deployments/renderModeConfiguration`,
|
|
7229
7287
|
{
|
|
7230
7288
|
method: "POST",
|
|
7231
|
-
body: { activeRenderModes:
|
|
7289
|
+
body: { activeRenderModes: command34.activeRenderModes }
|
|
7232
7290
|
}
|
|
7233
7291
|
);
|
|
7234
7292
|
}
|
|
@@ -9028,8 +9086,8 @@ var ExecuteLinterProgramsUseCase = class {
|
|
|
9028
9086
|
this.linterAstAdapter = linterAstAdapter;
|
|
9029
9087
|
this.logger = logger2;
|
|
9030
9088
|
}
|
|
9031
|
-
async execute(
|
|
9032
|
-
const { filePath, fileContent, language, programs } =
|
|
9089
|
+
async execute(command34) {
|
|
9090
|
+
const { filePath, fileContent, language, programs } = command34;
|
|
9033
9091
|
if (programs.length === 0) {
|
|
9034
9092
|
return {
|
|
9035
9093
|
file: filePath,
|
|
@@ -9848,8 +9906,8 @@ var InstallPackagesUseCase = class {
|
|
|
9848
9906
|
constructor(packmindGateway) {
|
|
9849
9907
|
this.packmindGateway = packmindGateway;
|
|
9850
9908
|
}
|
|
9851
|
-
async execute(
|
|
9852
|
-
const baseDirectory =
|
|
9909
|
+
async execute(command34) {
|
|
9910
|
+
const baseDirectory = command34.baseDirectory || process.cwd();
|
|
9853
9911
|
const result = {
|
|
9854
9912
|
filesCreated: 0,
|
|
9855
9913
|
filesUpdated: 0,
|
|
@@ -9861,12 +9919,12 @@ var InstallPackagesUseCase = class {
|
|
|
9861
9919
|
skillDirectoriesDeleted: 0
|
|
9862
9920
|
};
|
|
9863
9921
|
const response = await this.packmindGateway.deployment.pull({
|
|
9864
|
-
packagesSlugs:
|
|
9865
|
-
previousPackagesSlugs:
|
|
9866
|
-
gitRemoteUrl:
|
|
9867
|
-
gitBranch:
|
|
9868
|
-
relativePath:
|
|
9869
|
-
agents:
|
|
9922
|
+
packagesSlugs: command34.packagesSlugs,
|
|
9923
|
+
previousPackagesSlugs: command34.previousPackagesSlugs,
|
|
9924
|
+
gitRemoteUrl: command34.gitRemoteUrl,
|
|
9925
|
+
gitBranch: command34.gitBranch,
|
|
9926
|
+
relativePath: command34.relativePath,
|
|
9927
|
+
agents: command34.agents
|
|
9870
9928
|
});
|
|
9871
9929
|
const filteredCreateOrUpdate = response.fileUpdates.createOrUpdate.filter(
|
|
9872
9930
|
(file) => file.path !== "packmind.json"
|
|
@@ -10207,7 +10265,33 @@ function stripFullStandardLinkFooter(content) {
|
|
|
10207
10265
|
);
|
|
10208
10266
|
}
|
|
10209
10267
|
|
|
10268
|
+
// apps/cli/src/domain/entities/PackageSlug.ts
|
|
10269
|
+
function isFullParsedPackageSlug(tbd) {
|
|
10270
|
+
const asFullParsedPackageSlug = tbd;
|
|
10271
|
+
return asFullParsedPackageSlug.spaceSlug !== void 0 && asFullParsedPackageSlug.packageSlug !== void 0;
|
|
10272
|
+
}
|
|
10273
|
+
function parsePackageSlug(slug6) {
|
|
10274
|
+
const slugs = slug6.split("/");
|
|
10275
|
+
if (slugs.length === 1) {
|
|
10276
|
+
return { packageSlug: slugs[0] };
|
|
10277
|
+
}
|
|
10278
|
+
if (slugs.length == 2) {
|
|
10279
|
+
return {
|
|
10280
|
+
spaceSlug: slugs[0].startsWith("@") ? slugs[0].slice(1) : slugs[0],
|
|
10281
|
+
packageSlug: slugs[1]
|
|
10282
|
+
};
|
|
10283
|
+
}
|
|
10284
|
+
throw new Error(`Invalid package syntax: ${slugs}`);
|
|
10285
|
+
}
|
|
10286
|
+
function displayableParsedPackageSlug(parsedPackageSlug) {
|
|
10287
|
+
if (isFullParsedPackageSlug(parsedPackageSlug)) {
|
|
10288
|
+
return `@${parsedPackageSlug.spaceSlug}/${parsedPackageSlug.packageSlug}`;
|
|
10289
|
+
}
|
|
10290
|
+
return parsedPackageSlug.packageSlug;
|
|
10291
|
+
}
|
|
10292
|
+
|
|
10210
10293
|
// apps/cli/src/application/useCases/InstallUseCase.ts
|
|
10294
|
+
var import_assert = __toESM(require("assert"));
|
|
10211
10295
|
var InstallUseCase = class {
|
|
10212
10296
|
constructor(packmindGateway, lockFileRepository, configFileRepository, spaceService) {
|
|
10213
10297
|
this.packmindGateway = packmindGateway;
|
|
@@ -10215,8 +10299,8 @@ var InstallUseCase = class {
|
|
|
10215
10299
|
this.configFileRepository = configFileRepository;
|
|
10216
10300
|
this.spaceService = spaceService;
|
|
10217
10301
|
}
|
|
10218
|
-
async execute(
|
|
10219
|
-
const baseDirectory =
|
|
10302
|
+
async execute(command34) {
|
|
10303
|
+
const baseDirectory = command34.baseDirectory || process.cwd();
|
|
10220
10304
|
const result = {
|
|
10221
10305
|
filesCreated: 0,
|
|
10222
10306
|
filesUpdated: 0,
|
|
@@ -10246,7 +10330,7 @@ var InstallUseCase = class {
|
|
|
10246
10330
|
},
|
|
10247
10331
|
resolvedAgents: []
|
|
10248
10332
|
};
|
|
10249
|
-
const hasExplicitPackages =
|
|
10333
|
+
const hasExplicitPackages = command34.packages && command34.packages.length > 0;
|
|
10250
10334
|
const configExistedBefore = await this.configFileRepository.configExists(baseDirectory);
|
|
10251
10335
|
const lockFile = await this.lockFileRepository.read(baseDirectory);
|
|
10252
10336
|
const config = await this.configFileRepository.readConfig(baseDirectory);
|
|
@@ -10267,19 +10351,23 @@ var InstallUseCase = class {
|
|
|
10267
10351
|
packageSlugs: [],
|
|
10268
10352
|
agents: [],
|
|
10269
10353
|
artifacts: {},
|
|
10270
|
-
...
|
|
10354
|
+
...command34.skipInstalledAt ? {} : { installedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
10271
10355
|
};
|
|
10272
|
-
effectiveLockFile.cliVersion =
|
|
10356
|
+
effectiveLockFile.cliVersion = command34.cliVersion;
|
|
10273
10357
|
let packagesSlugs;
|
|
10274
10358
|
let normalizedPackages = [];
|
|
10275
10359
|
if (hasExplicitPackages) {
|
|
10276
|
-
|
|
10360
|
+
const explicitPackageSlugs = (command34.packages ?? []).map(
|
|
10361
|
+
displayableParsedPackageSlug
|
|
10362
|
+
);
|
|
10363
|
+
normalizedPackages = await this.normalizePackageSlugs(explicitPackageSlugs);
|
|
10277
10364
|
await this.validatePackageAccess(normalizedPackages);
|
|
10278
10365
|
const normalizedConfigPackages = config ? await this.normalizeAndSaveConfigPackages(baseDirectory, config) : [];
|
|
10279
10366
|
packagesSlugs = [
|
|
10280
10367
|
.../* @__PURE__ */ new Set([...normalizedConfigPackages, ...normalizedPackages])
|
|
10281
10368
|
];
|
|
10282
10369
|
} else {
|
|
10370
|
+
(0, import_assert.default)(config);
|
|
10283
10371
|
packagesSlugs = await this.normalizeAndSaveConfigPackages(
|
|
10284
10372
|
baseDirectory,
|
|
10285
10373
|
config
|
|
@@ -10299,8 +10387,8 @@ var InstallUseCase = class {
|
|
|
10299
10387
|
}
|
|
10300
10388
|
return result;
|
|
10301
10389
|
}
|
|
10302
|
-
const installAgents = this.resolveInstallAgents(
|
|
10303
|
-
const stripPathPrefix =
|
|
10390
|
+
const installAgents = this.resolveInstallAgents(command34, config);
|
|
10391
|
+
const stripPathPrefix = command34.homeAgent ? getAgentHomeDirPrefix(command34.homeAgent) ?? void 0 : void 0;
|
|
10304
10392
|
const response = await this.packmindGateway.deployment.install({
|
|
10305
10393
|
packagesSlugs,
|
|
10306
10394
|
packmindLockFile: effectiveLockFile,
|
|
@@ -10440,10 +10528,10 @@ var InstallUseCase = class {
|
|
|
10440
10528
|
} catch {
|
|
10441
10529
|
}
|
|
10442
10530
|
}
|
|
10443
|
-
if (
|
|
10531
|
+
if (command34.skipInstalledAt) {
|
|
10444
10532
|
delete lockFileToPersist.installedAt;
|
|
10445
10533
|
}
|
|
10446
|
-
lockFileToPersist.cliVersion =
|
|
10534
|
+
lockFileToPersist.cliVersion = command34.cliVersion;
|
|
10447
10535
|
if (stripPathPrefix) {
|
|
10448
10536
|
lockFileToPersist = this.stripLockFileArtifactPaths(
|
|
10449
10537
|
lockFileToPersist,
|
|
@@ -10472,9 +10560,9 @@ var InstallUseCase = class {
|
|
|
10472
10560
|
async normalizePackageSlugs(slugs) {
|
|
10473
10561
|
return normalizePackageSlugs(slugs, this.spaceService);
|
|
10474
10562
|
}
|
|
10475
|
-
resolveInstallAgents(
|
|
10476
|
-
if (
|
|
10477
|
-
return [
|
|
10563
|
+
resolveInstallAgents(command34, config) {
|
|
10564
|
+
if (command34.homeAgent) {
|
|
10565
|
+
return [command34.homeAgent];
|
|
10478
10566
|
}
|
|
10479
10567
|
return config?.agents;
|
|
10480
10568
|
}
|
|
@@ -10788,8 +10876,8 @@ var UninstallUseCase = class {
|
|
|
10788
10876
|
this.spaceService = spaceService;
|
|
10789
10877
|
this.installUseCase = installUseCase;
|
|
10790
10878
|
}
|
|
10791
|
-
async execute(
|
|
10792
|
-
const baseDirectory =
|
|
10879
|
+
async execute(command34) {
|
|
10880
|
+
const baseDirectory = command34.baseDirectory || process.cwd();
|
|
10793
10881
|
const config = await this.configFileRepository.readConfig(baseDirectory);
|
|
10794
10882
|
if (!config) {
|
|
10795
10883
|
const configFileExists = await this.configFileRepository.configExists(baseDirectory);
|
|
@@ -10803,7 +10891,7 @@ var UninstallUseCase = class {
|
|
|
10803
10891
|
);
|
|
10804
10892
|
}
|
|
10805
10893
|
const normalized = await normalizePackageSlugs(
|
|
10806
|
-
|
|
10894
|
+
command34.packages,
|
|
10807
10895
|
this.spaceService
|
|
10808
10896
|
);
|
|
10809
10897
|
const notInstalled = normalized.filter((pkg) => !(pkg in config.packages));
|
|
@@ -10826,7 +10914,7 @@ ${pkgList}`
|
|
|
10826
10914
|
try {
|
|
10827
10915
|
return await this.installUseCase.execute({
|
|
10828
10916
|
baseDirectory,
|
|
10829
|
-
cliVersion:
|
|
10917
|
+
cliVersion: command34.cliVersion
|
|
10830
10918
|
});
|
|
10831
10919
|
} catch (error) {
|
|
10832
10920
|
await this.configFileRepository.updateConfig(
|
|
@@ -10868,8 +10956,8 @@ var InstallDefaultSkillsUseCase = class {
|
|
|
10868
10956
|
constructor(repositories) {
|
|
10869
10957
|
this.repositories = repositories;
|
|
10870
10958
|
}
|
|
10871
|
-
async execute(
|
|
10872
|
-
const baseDirectory =
|
|
10959
|
+
async execute(command34) {
|
|
10960
|
+
const baseDirectory = command34.baseDirectory || process.cwd();
|
|
10873
10961
|
await this.bootstrapEmptyDirectory(baseDirectory);
|
|
10874
10962
|
const result = {
|
|
10875
10963
|
filesCreated: 0,
|
|
@@ -10879,21 +10967,24 @@ var InstallDefaultSkillsUseCase = class {
|
|
|
10879
10967
|
skippedIncompatibleSkillNames: [],
|
|
10880
10968
|
incompatibleInstalledSkills: []
|
|
10881
10969
|
};
|
|
10882
|
-
|
|
10883
|
-
|
|
10970
|
+
let agents = command34.agents;
|
|
10971
|
+
if (!agents || agents.length === 0) {
|
|
10972
|
+
const config = await this.repositories.configFileRepository.readConfig(baseDirectory);
|
|
10973
|
+
agents = config?.agents;
|
|
10974
|
+
}
|
|
10884
10975
|
const response = await this.repositories.packmindGateway.skills.getDefaults(
|
|
10885
10976
|
{
|
|
10886
|
-
cliVersion:
|
|
10887
|
-
includeBeta:
|
|
10977
|
+
cliVersion: command34.cliVersion,
|
|
10978
|
+
includeBeta: command34.includeBeta,
|
|
10888
10979
|
agents
|
|
10889
10980
|
}
|
|
10890
10981
|
);
|
|
10891
10982
|
result.skippedSkillsCount = response.skippedSkillsCount;
|
|
10892
10983
|
const incompatibleInstalledMap = /* @__PURE__ */ new Map();
|
|
10893
10984
|
const incompatibleSkillDirs = /* @__PURE__ */ new Map();
|
|
10894
|
-
if (
|
|
10985
|
+
if (command34.cliVersion) {
|
|
10895
10986
|
for (const file of response.fileUpdates.createOrUpdate) {
|
|
10896
|
-
if (path9.basename(file.path) === "SKILL.md" && file.content && this.isVersionConstraintViolated(file.content,
|
|
10987
|
+
if (path9.basename(file.path) === "SKILL.md" && file.content && this.isVersionConstraintViolated(file.content, command34.cliVersion)) {
|
|
10897
10988
|
const dir = path9.dirname(file.path);
|
|
10898
10989
|
const skillName = this.getSkillName(file.content) ?? path9.basename(dir);
|
|
10899
10990
|
incompatibleSkillDirs.set(dir, skillName);
|
|
@@ -10904,9 +10995,9 @@ var InstallDefaultSkillsUseCase = class {
|
|
|
10904
10995
|
for (const file of response.fileUpdates.createOrUpdate) {
|
|
10905
10996
|
try {
|
|
10906
10997
|
if (!file.content) continue;
|
|
10907
|
-
const isIncompatible =
|
|
10998
|
+
const isIncompatible = command34.cliVersion && (this.isVersionConstraintViolated(
|
|
10908
10999
|
file.content,
|
|
10909
|
-
|
|
11000
|
+
command34.cliVersion
|
|
10910
11001
|
) || this.isUnderIncompatibleSkillDir(
|
|
10911
11002
|
file.path,
|
|
10912
11003
|
incompatibleSkillDirs
|
|
@@ -10949,7 +11040,7 @@ var InstallDefaultSkillsUseCase = class {
|
|
|
10949
11040
|
await this.mergeLockFileSlice(
|
|
10950
11041
|
baseDirectory,
|
|
10951
11042
|
response.lockFileSlice ?? {},
|
|
10952
|
-
|
|
11043
|
+
command34.cliVersion
|
|
10953
11044
|
);
|
|
10954
11045
|
return result;
|
|
10955
11046
|
}
|
|
@@ -11103,8 +11194,8 @@ var EnsureCliVersionUseCase = class {
|
|
|
11103
11194
|
this.lockFileRepository = lockFileRepository;
|
|
11104
11195
|
this.installDefaultSkillsUseCase = installDefaultSkillsUseCase;
|
|
11105
11196
|
}
|
|
11106
|
-
async execute(
|
|
11107
|
-
const { baseDirectory, currentCliVersion, includeBeta } =
|
|
11197
|
+
async execute(command34) {
|
|
11198
|
+
const { baseDirectory, currentCliVersion, includeBeta } = command34;
|
|
11108
11199
|
const lockFile = await this.lockFileRepository.read(baseDirectory);
|
|
11109
11200
|
if (!lockFile) {
|
|
11110
11201
|
return { kind: "no-lockfile" };
|
|
@@ -11140,10 +11231,10 @@ var ListPackagesUseCase = class {
|
|
|
11140
11231
|
this.packmindGateway = packmindGateway;
|
|
11141
11232
|
this.spaceService = spaceService;
|
|
11142
11233
|
}
|
|
11143
|
-
async execute(
|
|
11144
|
-
if (
|
|
11234
|
+
async execute(command34) {
|
|
11235
|
+
if (command34.spaceId) {
|
|
11145
11236
|
const response = await this.packmindGateway.packages.list({
|
|
11146
|
-
spaceId:
|
|
11237
|
+
spaceId: command34.spaceId
|
|
11147
11238
|
});
|
|
11148
11239
|
return response.packages;
|
|
11149
11240
|
}
|
|
@@ -11162,8 +11253,8 @@ var GetPackageSummaryUseCase = class {
|
|
|
11162
11253
|
constructor(gateway) {
|
|
11163
11254
|
this.gateway = gateway;
|
|
11164
11255
|
}
|
|
11165
|
-
async execute(
|
|
11166
|
-
return this.gateway.packages.getSummary(
|
|
11256
|
+
async execute(command34) {
|
|
11257
|
+
return this.gateway.packages.getSummary(command34);
|
|
11167
11258
|
}
|
|
11168
11259
|
};
|
|
11169
11260
|
|
|
@@ -11458,8 +11549,8 @@ var LoginUseCase = class {
|
|
|
11458
11549
|
startCallbackServer: deps?.startCallbackServer ?? defaultStartCallbackServer
|
|
11459
11550
|
};
|
|
11460
11551
|
}
|
|
11461
|
-
async execute(
|
|
11462
|
-
const { host, code: providedCode } =
|
|
11552
|
+
async execute(command34) {
|
|
11553
|
+
const { host, code: providedCode } = command34;
|
|
11463
11554
|
let code;
|
|
11464
11555
|
if (providedCode) {
|
|
11465
11556
|
code = providedCode;
|
|
@@ -11841,10 +11932,10 @@ var CheckCliVersionUseCase = class {
|
|
|
11841
11932
|
now: deps?.now ?? (() => /* @__PURE__ */ new Date())
|
|
11842
11933
|
};
|
|
11843
11934
|
}
|
|
11844
|
-
async execute(
|
|
11845
|
-
const cached = this.readFreshCache(
|
|
11935
|
+
async execute(command34) {
|
|
11936
|
+
const cached = this.readFreshCache(command34.currentVersion);
|
|
11846
11937
|
if (cached) {
|
|
11847
|
-
return this.toResult(
|
|
11938
|
+
return this.toResult(command34.currentVersion, cached.latestVersion);
|
|
11848
11939
|
}
|
|
11849
11940
|
const fetchPromise = this.deps.fetchLatestVersion(this.deps.fetchFn);
|
|
11850
11941
|
fetchPromise.catch(() => void 0);
|
|
@@ -11862,7 +11953,7 @@ var CheckCliVersionUseCase = class {
|
|
|
11862
11953
|
latestVersion,
|
|
11863
11954
|
checkedAt: this.deps.now()
|
|
11864
11955
|
});
|
|
11865
|
-
return this.toResult(
|
|
11956
|
+
return this.toResult(command34.currentVersion, latestVersion);
|
|
11866
11957
|
} catch {
|
|
11867
11958
|
return null;
|
|
11868
11959
|
}
|
|
@@ -12310,10 +12401,10 @@ var ListStandardsUseCase = class {
|
|
|
12310
12401
|
this.packmindGateway = packmindGateway;
|
|
12311
12402
|
this.spaceService = spaceService;
|
|
12312
12403
|
}
|
|
12313
|
-
async execute(
|
|
12314
|
-
if (
|
|
12404
|
+
async execute(command34) {
|
|
12405
|
+
if (command34.spaceId) {
|
|
12315
12406
|
const response = await this.packmindGateway.standards.list({
|
|
12316
|
-
spaceId:
|
|
12407
|
+
spaceId: command34.spaceId
|
|
12317
12408
|
});
|
|
12318
12409
|
return response.standards;
|
|
12319
12410
|
}
|
|
@@ -12333,10 +12424,10 @@ var ListCommandsUseCase = class {
|
|
|
12333
12424
|
this.packmindGateway = packmindGateway;
|
|
12334
12425
|
this.spaceService = spaceService;
|
|
12335
12426
|
}
|
|
12336
|
-
async execute(
|
|
12337
|
-
if (
|
|
12427
|
+
async execute(command34) {
|
|
12428
|
+
if (command34.spaceId) {
|
|
12338
12429
|
const response = await this.packmindGateway.commands.list({
|
|
12339
|
-
spaceId:
|
|
12430
|
+
spaceId: command34.spaceId
|
|
12340
12431
|
});
|
|
12341
12432
|
return response.recipes;
|
|
12342
12433
|
}
|
|
@@ -12356,10 +12447,10 @@ var ListSkillsUseCase = class {
|
|
|
12356
12447
|
this.packmindGateway = packmindGateway;
|
|
12357
12448
|
this.spaceService = spaceService;
|
|
12358
12449
|
}
|
|
12359
|
-
async execute(
|
|
12360
|
-
if (
|
|
12450
|
+
async execute(command34) {
|
|
12451
|
+
if (command34.spaceId) {
|
|
12361
12452
|
const skills = await this.packmindGateway.skills.list({
|
|
12362
|
-
spaceId:
|
|
12453
|
+
spaceId: command34.spaceId
|
|
12363
12454
|
});
|
|
12364
12455
|
return skills.map((s) => ({
|
|
12365
12456
|
slug: s.slug,
|
|
@@ -12534,8 +12625,8 @@ var UploadSkillUseCase = class {
|
|
|
12534
12625
|
constructor(deps) {
|
|
12535
12626
|
this.deps = deps;
|
|
12536
12627
|
}
|
|
12537
|
-
async execute(
|
|
12538
|
-
const files = await readSkillDirectory(
|
|
12628
|
+
async execute(command34) {
|
|
12629
|
+
const files = await readSkillDirectory(command34.skillPath);
|
|
12539
12630
|
if (!files.find((f) => f.relativePath === "SKILL.md")) {
|
|
12540
12631
|
throw new Error("SKILL.md not found in skill directory");
|
|
12541
12632
|
}
|
|
@@ -12549,7 +12640,7 @@ var UploadSkillUseCase = class {
|
|
|
12549
12640
|
if (totalSize > 10 * 1024 * 1024) {
|
|
12550
12641
|
throw new Error(`Skill size (${totalSize} bytes) exceeds 10MB limit`);
|
|
12551
12642
|
}
|
|
12552
|
-
const space = await this.getSpace(
|
|
12643
|
+
const space = await this.getSpace(command34.spaceSlug);
|
|
12553
12644
|
const payload = {
|
|
12554
12645
|
files: files.map((f) => ({
|
|
12555
12646
|
path: f.relativePath,
|
|
@@ -12561,7 +12652,7 @@ var UploadSkillUseCase = class {
|
|
|
12561
12652
|
const uploadSkillResponse = await this.deps.gateway.skills.upload({
|
|
12562
12653
|
spaceId: createSpaceId(space.id),
|
|
12563
12654
|
files: payload.files,
|
|
12564
|
-
originSkill:
|
|
12655
|
+
originSkill: command34.originSkill
|
|
12565
12656
|
});
|
|
12566
12657
|
return {
|
|
12567
12658
|
skillId: uploadSkillResponse.skill.id,
|
|
@@ -13088,6 +13179,8 @@ function parseStandardMd(content, filePath) {
|
|
|
13088
13179
|
var AGENT_PARSERS = {
|
|
13089
13180
|
packmind: parsePackmindStandard,
|
|
13090
13181
|
claude: parseClaudeStandard,
|
|
13182
|
+
claude_plugin: () => null,
|
|
13183
|
+
// plugin mode does not render standards (Rule 3)
|
|
13091
13184
|
cursor: parseCursorStandard,
|
|
13092
13185
|
continue: parseContinueStandard,
|
|
13093
13186
|
copilot: parseCopilotStandard,
|
|
@@ -13500,9 +13593,9 @@ var DiffArtefactsUseCase = class {
|
|
|
13500
13593
|
new StandardDiffStrategy()
|
|
13501
13594
|
];
|
|
13502
13595
|
}
|
|
13503
|
-
async execute(
|
|
13504
|
-
const baseDirectory =
|
|
13505
|
-
const response = await this.fetchContent(
|
|
13596
|
+
async execute(command34) {
|
|
13597
|
+
const baseDirectory = command34.baseDirectory || process.cwd();
|
|
13598
|
+
const response = await this.fetchContent(command34, baseDirectory);
|
|
13506
13599
|
const filteredFiles = response.fileUpdates.createOrUpdate.filter(
|
|
13507
13600
|
(file) => file.path !== "packmind.json"
|
|
13508
13601
|
);
|
|
@@ -13515,7 +13608,7 @@ var DiffArtefactsUseCase = class {
|
|
|
13515
13608
|
);
|
|
13516
13609
|
const prefixedSkillFolders = this.prefixSkillFolders(
|
|
13517
13610
|
response.skillFolders,
|
|
13518
|
-
|
|
13611
|
+
command34.relativePath
|
|
13519
13612
|
);
|
|
13520
13613
|
const diffs = [];
|
|
13521
13614
|
for (const file of diffableFiles) {
|
|
@@ -13542,7 +13635,7 @@ var DiffArtefactsUseCase = class {
|
|
|
13542
13635
|
targetId: response.targetId ? createTargetId(response.targetId) : void 0
|
|
13543
13636
|
}));
|
|
13544
13637
|
}
|
|
13545
|
-
async fetchContent(
|
|
13638
|
+
async fetchContent(command34, baseDirectory) {
|
|
13546
13639
|
const lockFile = await this.lockFileRepository.read(baseDirectory);
|
|
13547
13640
|
if (lockFile) {
|
|
13548
13641
|
try {
|
|
@@ -13562,11 +13655,11 @@ var DiffArtefactsUseCase = class {
|
|
|
13562
13655
|
}
|
|
13563
13656
|
}
|
|
13564
13657
|
return this.packmindGateway.deployment.getDeployed({
|
|
13565
|
-
packagesSlugs:
|
|
13566
|
-
gitRemoteUrl:
|
|
13567
|
-
gitBranch:
|
|
13568
|
-
relativePath:
|
|
13569
|
-
agents:
|
|
13658
|
+
packagesSlugs: command34.packagesSlugs,
|
|
13659
|
+
gitRemoteUrl: command34.gitRemoteUrl,
|
|
13660
|
+
gitBranch: command34.gitBranch,
|
|
13661
|
+
relativePath: command34.relativePath,
|
|
13662
|
+
agents: command34.agents
|
|
13570
13663
|
});
|
|
13571
13664
|
}
|
|
13572
13665
|
prefixSkillFolders(skillFolders, relativePath) {
|
|
@@ -13590,8 +13683,8 @@ var SubmitDiffsUseCase = class {
|
|
|
13590
13683
|
constructor(packmindGateway) {
|
|
13591
13684
|
this.packmindGateway = packmindGateway;
|
|
13592
13685
|
}
|
|
13593
|
-
async execute(
|
|
13594
|
-
const { groupedDiffs, message } =
|
|
13686
|
+
async execute(command34) {
|
|
13687
|
+
const { groupedDiffs, message } = command34;
|
|
13595
13688
|
const skipped = [];
|
|
13596
13689
|
const validDiffs = [];
|
|
13597
13690
|
for (const group of groupedDiffs) {
|
|
@@ -13666,8 +13759,8 @@ var CheckDiffsUseCase = class {
|
|
|
13666
13759
|
constructor(packmindGateway) {
|
|
13667
13760
|
this.packmindGateway = packmindGateway;
|
|
13668
13761
|
}
|
|
13669
|
-
async execute(
|
|
13670
|
-
const { groupedDiffs } =
|
|
13762
|
+
async execute(command34) {
|
|
13763
|
+
const { groupedDiffs } = command34;
|
|
13671
13764
|
const results = [];
|
|
13672
13765
|
const validDiffs = [];
|
|
13673
13766
|
const invalidDiffs = [];
|
|
@@ -13765,8 +13858,8 @@ var CliFormatter = class {
|
|
|
13765
13858
|
static error(message) {
|
|
13766
13859
|
return `${source_default.bgRed.bold(CLI_PREFIX2)} ${source_default.red(message)}`;
|
|
13767
13860
|
}
|
|
13768
|
-
static command(
|
|
13769
|
-
return source_default.yellow(
|
|
13861
|
+
static command(command34) {
|
|
13862
|
+
return source_default.yellow(command34);
|
|
13770
13863
|
}
|
|
13771
13864
|
static loader(text) {
|
|
13772
13865
|
return source_default.dim.italic(text);
|
|
@@ -13979,14 +14072,24 @@ var PackmindCliHexaFactory = class {
|
|
|
13979
14072
|
var origin8 = "PackmindCliHexa";
|
|
13980
14073
|
var PackmindCliHexa = class {
|
|
13981
14074
|
constructor(logger2 = new PackmindLogger(origin8)) {
|
|
13982
|
-
this.notifyDistribution = async (
|
|
14075
|
+
this.notifyDistribution = async (command34) => {
|
|
13983
14076
|
return this.hexa.repositories.packmindGateway.deployment.notifyDistribution(
|
|
13984
|
-
|
|
14077
|
+
command34
|
|
13985
14078
|
);
|
|
13986
14079
|
};
|
|
13987
|
-
this.notifyArtefactsDistribution = async (
|
|
14080
|
+
this.notifyArtefactsDistribution = async (command34) => {
|
|
13988
14081
|
return this.hexa.repositories.packmindGateway.deployment.notifyArtefactsDistribution(
|
|
13989
|
-
|
|
14082
|
+
command34
|
|
14083
|
+
);
|
|
14084
|
+
};
|
|
14085
|
+
this.renderPlugin = async (command34) => {
|
|
14086
|
+
return this.hexa.repositories.packmindGateway.deployment.renderPlugin(
|
|
14087
|
+
command34
|
|
14088
|
+
);
|
|
14089
|
+
};
|
|
14090
|
+
this.trackPluginDeleted = async (command34) => {
|
|
14091
|
+
return this.hexa.repositories.packmindGateway.deployment.trackPluginDeleted(
|
|
14092
|
+
command34
|
|
13990
14093
|
);
|
|
13991
14094
|
};
|
|
13992
14095
|
this.logger = logger2;
|
|
@@ -14009,29 +14112,29 @@ var PackmindCliHexa = class {
|
|
|
14009
14112
|
get output() {
|
|
14010
14113
|
return this.hexa.repositories.output;
|
|
14011
14114
|
}
|
|
14012
|
-
async getGitRemoteUrl(
|
|
14013
|
-
return this.hexa.useCases.getGitRemoteUrl.execute(
|
|
14115
|
+
async getGitRemoteUrl(command34) {
|
|
14116
|
+
return this.hexa.useCases.getGitRemoteUrl.execute(command34);
|
|
14014
14117
|
}
|
|
14015
|
-
async listFilesInDirectory(
|
|
14016
|
-
return this.hexa.useCases.listFilesInDirectoryUseCase.execute(
|
|
14118
|
+
async listFilesInDirectory(command34) {
|
|
14119
|
+
return this.hexa.useCases.listFilesInDirectoryUseCase.execute(command34);
|
|
14017
14120
|
}
|
|
14018
|
-
async lintFilesAgainstRule(
|
|
14019
|
-
return this.hexa.useCases.lintFilesAgainstRule.execute(
|
|
14121
|
+
async lintFilesAgainstRule(command34) {
|
|
14122
|
+
return this.hexa.useCases.lintFilesAgainstRule.execute(command34);
|
|
14020
14123
|
}
|
|
14021
|
-
async lintFilesFromConfig(
|
|
14022
|
-
return this.hexa.useCases.lintFilesFromConfig.execute(
|
|
14124
|
+
async lintFilesFromConfig(command34) {
|
|
14125
|
+
return this.hexa.useCases.lintFilesFromConfig.execute(command34);
|
|
14023
14126
|
}
|
|
14024
|
-
async installPackages(
|
|
14025
|
-
return this.hexa.useCases.installPackages.execute(
|
|
14127
|
+
async installPackages(command34) {
|
|
14128
|
+
return this.hexa.useCases.installPackages.execute(command34);
|
|
14026
14129
|
}
|
|
14027
|
-
async install(
|
|
14028
|
-
return this.hexa.useCases.install.execute(
|
|
14130
|
+
async install(command34) {
|
|
14131
|
+
return this.hexa.useCases.install.execute(command34);
|
|
14029
14132
|
}
|
|
14030
|
-
async uninstall(
|
|
14031
|
-
return this.hexa.useCases.uninstall.execute(
|
|
14133
|
+
async uninstall(command34) {
|
|
14134
|
+
return this.hexa.useCases.uninstall.execute(command34);
|
|
14032
14135
|
}
|
|
14033
|
-
async diffArtefacts(
|
|
14034
|
-
return this.hexa.useCases.diffArtefacts.execute(
|
|
14136
|
+
async diffArtefacts(command34) {
|
|
14137
|
+
return this.hexa.useCases.diffArtefacts.execute(command34);
|
|
14035
14138
|
}
|
|
14036
14139
|
async submitDiffs(groupedDiffs, message) {
|
|
14037
14140
|
return this.hexa.useCases.submitDiffs.execute({ groupedDiffs, message });
|
|
@@ -14039,20 +14142,20 @@ var PackmindCliHexa = class {
|
|
|
14039
14142
|
async checkDiffs(groupedDiffs) {
|
|
14040
14143
|
return this.hexa.useCases.checkDiffs.execute({ groupedDiffs });
|
|
14041
14144
|
}
|
|
14042
|
-
async listPackages(
|
|
14043
|
-
return this.hexa.useCases.listPackages.execute(
|
|
14145
|
+
async listPackages(command34) {
|
|
14146
|
+
return this.hexa.useCases.listPackages.execute(command34);
|
|
14044
14147
|
}
|
|
14045
|
-
async getPackageBySlug(
|
|
14046
|
-
return this.hexa.useCases.getPackageBySlug.execute(
|
|
14148
|
+
async getPackageBySlug(command34) {
|
|
14149
|
+
return this.hexa.useCases.getPackageBySlug.execute(command34);
|
|
14047
14150
|
}
|
|
14048
|
-
async listStandards(
|
|
14049
|
-
return this.hexa.useCases.listStandards.execute(
|
|
14151
|
+
async listStandards(command34) {
|
|
14152
|
+
return this.hexa.useCases.listStandards.execute(command34);
|
|
14050
14153
|
}
|
|
14051
|
-
async listCommands(
|
|
14052
|
-
return this.hexa.useCases.listCommands.execute(
|
|
14154
|
+
async listCommands(command34) {
|
|
14155
|
+
return this.hexa.useCases.listCommands.execute(command34);
|
|
14053
14156
|
}
|
|
14054
|
-
async listSkills(
|
|
14055
|
-
return this.hexa.useCases.listSkills.execute(
|
|
14157
|
+
async listSkills(command34) {
|
|
14158
|
+
return this.hexa.useCases.listSkills.execute(command34);
|
|
14056
14159
|
}
|
|
14057
14160
|
async configExists(baseDirectory) {
|
|
14058
14161
|
return await this.hexa.repositories.configFileRepository.configExists(
|
|
@@ -14139,17 +14242,17 @@ var PackmindCliHexa = class {
|
|
|
14139
14242
|
directory
|
|
14140
14243
|
);
|
|
14141
14244
|
}
|
|
14142
|
-
async login(
|
|
14143
|
-
return this.hexa.useCases.login.execute(
|
|
14245
|
+
async login(command34) {
|
|
14246
|
+
return this.hexa.useCases.login.execute(command34);
|
|
14144
14247
|
}
|
|
14145
|
-
async logout(
|
|
14146
|
-
return this.hexa.useCases.logout.execute(
|
|
14248
|
+
async logout(command34) {
|
|
14249
|
+
return this.hexa.useCases.logout.execute(command34);
|
|
14147
14250
|
}
|
|
14148
|
-
async whoami(
|
|
14149
|
-
return this.hexa.useCases.whoami.execute(
|
|
14251
|
+
async whoami(command34) {
|
|
14252
|
+
return this.hexa.useCases.whoami.execute(command34);
|
|
14150
14253
|
}
|
|
14151
|
-
async checkCliVersion(
|
|
14152
|
-
return this.hexa.useCases.checkCliVersion.execute(
|
|
14254
|
+
async checkCliVersion(command34) {
|
|
14255
|
+
return this.hexa.useCases.checkCliVersion.execute(command34);
|
|
14153
14256
|
}
|
|
14154
14257
|
getCurrentBranch(repoPath) {
|
|
14155
14258
|
return this.hexa.services.gitRemoteUrlService.getCurrentBranch(repoPath).branch;
|
|
@@ -14157,19 +14260,19 @@ var PackmindCliHexa = class {
|
|
|
14157
14260
|
getGitRemoteUrlFromPath(repoPath) {
|
|
14158
14261
|
return this.hexa.services.gitRemoteUrlService.getGitRemoteUrl(repoPath).gitRemoteUrl;
|
|
14159
14262
|
}
|
|
14160
|
-
async uploadSkill(
|
|
14161
|
-
return this.hexa.useCases.uploadSkill.execute(
|
|
14263
|
+
async uploadSkill(command34) {
|
|
14264
|
+
return this.hexa.useCases.uploadSkill.execute(command34);
|
|
14162
14265
|
}
|
|
14163
|
-
async installDefaultSkills(
|
|
14164
|
-
return this.hexa.useCases.installDefaultSkills.execute(
|
|
14266
|
+
async installDefaultSkills(command34) {
|
|
14267
|
+
return this.hexa.useCases.installDefaultSkills.execute(command34);
|
|
14165
14268
|
}
|
|
14166
|
-
async bootstrapSkillsInitDirectory(
|
|
14269
|
+
async bootstrapSkillsInitDirectory(command34) {
|
|
14167
14270
|
return this.hexa.useCases.installDefaultSkills.bootstrapEmptyDirectory(
|
|
14168
|
-
|
|
14271
|
+
command34.baseDirectory
|
|
14169
14272
|
);
|
|
14170
14273
|
}
|
|
14171
|
-
async ensureCliVersion(
|
|
14172
|
-
return this.hexa.useCases.ensureCliVersion.execute(
|
|
14274
|
+
async ensureCliVersion(command34) {
|
|
14275
|
+
return this.hexa.useCases.ensureCliVersion.execute(command34);
|
|
14173
14276
|
}
|
|
14174
14277
|
getPackmindGateway() {
|
|
14175
14278
|
return this.hexa.repositories.packmindGateway;
|
|
@@ -15008,6 +15111,7 @@ var SELECTABLE_AGENTS = [
|
|
|
15008
15111
|
var AGENT_DISPLAY_NAMES = {
|
|
15009
15112
|
packmind: "Packmind",
|
|
15010
15113
|
claude: "Claude Code",
|
|
15114
|
+
claude_plugin: "Claude Plugin",
|
|
15011
15115
|
cursor: "Cursor",
|
|
15012
15116
|
copilot: "GitHub Copilot",
|
|
15013
15117
|
continue: "Continue.dev",
|
|
@@ -15499,6 +15603,11 @@ async function confirmWithReadline(question) {
|
|
|
15499
15603
|
});
|
|
15500
15604
|
}
|
|
15501
15605
|
|
|
15606
|
+
// apps/cli/src/infra/commands/customParameters/PackageSlugArgType.ts
|
|
15607
|
+
var PackageSlugArgType = {
|
|
15608
|
+
from: async (input) => parsePackageSlug(input)
|
|
15609
|
+
};
|
|
15610
|
+
|
|
15502
15611
|
// apps/cli/src/infra/commands/InstallCommand.ts
|
|
15503
15612
|
var { version: CLI_VERSION } = require_package();
|
|
15504
15613
|
function findSubDirectoriesWithPackmindJson(dirPath, recursive) {
|
|
@@ -15618,21 +15727,25 @@ async function notifyArtefactsDistributionIfInGitRepo(params) {
|
|
|
15618
15727
|
}
|
|
15619
15728
|
}
|
|
15620
15729
|
async function installDefaultSkillsIfAtGitRoot(params) {
|
|
15621
|
-
const { packmindCliHexa, cwd, configRepository } = params;
|
|
15730
|
+
const { packmindCliHexa, cwd, configRepository, resolvedAgents } = params;
|
|
15622
15731
|
const gitRoot = await packmindCliHexa.tryGetGitRepositoryRoot(cwd);
|
|
15623
15732
|
if (!gitRoot || cwd !== gitRoot) {
|
|
15624
15733
|
return;
|
|
15625
15734
|
}
|
|
15626
|
-
|
|
15627
|
-
|
|
15628
|
-
|
|
15629
|
-
|
|
15735
|
+
let agents = resolvedAgents;
|
|
15736
|
+
if (agents.length === 0) {
|
|
15737
|
+
const config = await configRepository.readConfig(cwd);
|
|
15738
|
+
agents = config?.agents ?? [];
|
|
15739
|
+
}
|
|
15740
|
+
if (!configuredAgentsSupportSkills(agents)) {
|
|
15741
|
+
logWarningConsole(buildSkillsSkippedWarning(agents));
|
|
15630
15742
|
return;
|
|
15631
15743
|
}
|
|
15632
15744
|
try {
|
|
15633
15745
|
const skillsResult = await packmindCliHexa.installDefaultSkills({
|
|
15634
15746
|
cliVersion: CLI_VERSION,
|
|
15635
|
-
baseDirectory: cwd
|
|
15747
|
+
baseDirectory: cwd,
|
|
15748
|
+
agents
|
|
15636
15749
|
});
|
|
15637
15750
|
if (skillsResult.incompatibleInstalledSkills.length > 0) {
|
|
15638
15751
|
await handleIncompatibleInstalledSkillsSilently(
|
|
@@ -15681,7 +15794,7 @@ async function installHandler({
|
|
|
15681
15794
|
process.exit(1);
|
|
15682
15795
|
}
|
|
15683
15796
|
if (show) {
|
|
15684
|
-
const showCommand = `packmind-cli packages show ${show}`;
|
|
15797
|
+
const showCommand = `packmind-cli packages show ${displayableParsedPackageSlug(show)}`;
|
|
15685
15798
|
logErrorConsole('Command "packmind-cli install --show" has been removed.');
|
|
15686
15799
|
logConsole(`Use ${formatCommand(showCommand)} instead.`);
|
|
15687
15800
|
process.exit(1);
|
|
@@ -15715,7 +15828,7 @@ async function installHandler({
|
|
|
15715
15828
|
agentDetectionService: new AgentArtifactDetectionService(),
|
|
15716
15829
|
packmindGateway: packmindCliHexa.getPackmindGateway(),
|
|
15717
15830
|
baseDirectory: cwd,
|
|
15718
|
-
packages,
|
|
15831
|
+
packages: packages.map(displayableParsedPackageSlug),
|
|
15719
15832
|
isTTY: process.stdin.isTTY ?? false,
|
|
15720
15833
|
installDefaultSkills: packmindCliHexa.installDefaultSkills.bind(packmindCliHexa),
|
|
15721
15834
|
cliVersion: CLI_VERSION,
|
|
@@ -15802,7 +15915,8 @@ async function installHandler({
|
|
|
15802
15915
|
await installDefaultSkillsIfAtGitRoot({
|
|
15803
15916
|
packmindCliHexa,
|
|
15804
15917
|
cwd,
|
|
15805
|
-
configRepository
|
|
15918
|
+
configRepository,
|
|
15919
|
+
resolvedAgents: combined.resolvedAgents
|
|
15806
15920
|
});
|
|
15807
15921
|
}
|
|
15808
15922
|
}
|
|
@@ -15828,7 +15942,7 @@ var installCommand = (0, import_cmd_ts2.command)({
|
|
|
15828
15942
|
description: "Run install in the specified directory instead of the current directory"
|
|
15829
15943
|
}),
|
|
15830
15944
|
packages: (0, import_cmd_ts2.restPositionals)({
|
|
15831
|
-
type:
|
|
15945
|
+
type: PackageSlugArgType,
|
|
15832
15946
|
displayName: "packages",
|
|
15833
15947
|
description: "Package slugs to install (e.g. @my-space/my-package)"
|
|
15834
15948
|
}),
|
|
@@ -15841,10 +15955,9 @@ var installCommand = (0, import_cmd_ts2.command)({
|
|
|
15841
15955
|
description: "[Deprecated] List available packages"
|
|
15842
15956
|
}),
|
|
15843
15957
|
show: (0, import_cmd_ts2.option)({
|
|
15844
|
-
type: import_cmd_ts2.
|
|
15958
|
+
type: (0, import_cmd_ts2.optional)(PackageSlugArgType),
|
|
15845
15959
|
long: "show",
|
|
15846
|
-
description: "[Deprecated] Show details of a specific package"
|
|
15847
|
-
defaultValue: () => ""
|
|
15960
|
+
description: "[Deprecated] Show details of a specific package"
|
|
15848
15961
|
}),
|
|
15849
15962
|
skipInstalledAt: (0, import_cmd_ts2.flag)({
|
|
15850
15963
|
long: "skip-installed-at",
|
|
@@ -17196,15 +17309,15 @@ var CreatePackageUseCase = class {
|
|
|
17196
17309
|
this.gateway = gateway;
|
|
17197
17310
|
this.spaceService = spaceService;
|
|
17198
17311
|
}
|
|
17199
|
-
async execute(
|
|
17200
|
-
const space = await this.getSpace(
|
|
17312
|
+
async execute(command34) {
|
|
17313
|
+
const space = await this.getSpace(command34);
|
|
17201
17314
|
const result = await this.gateway.packages.create({
|
|
17202
17315
|
spaceId: space.id,
|
|
17203
|
-
name:
|
|
17204
|
-
description:
|
|
17316
|
+
name: command34.name,
|
|
17317
|
+
description: command34.description ?? "",
|
|
17205
17318
|
recipeIds: [],
|
|
17206
17319
|
standardIds: [],
|
|
17207
|
-
originSkill:
|
|
17320
|
+
originSkill: command34.originSkill
|
|
17208
17321
|
});
|
|
17209
17322
|
return {
|
|
17210
17323
|
packageId: result.package.id,
|
|
@@ -17213,12 +17326,12 @@ var CreatePackageUseCase = class {
|
|
|
17213
17326
|
spaceSlug: space.slug
|
|
17214
17327
|
};
|
|
17215
17328
|
}
|
|
17216
|
-
async getSpace(
|
|
17329
|
+
async getSpace(command34) {
|
|
17217
17330
|
const spaces = await this.spaceService.getSpaces();
|
|
17218
|
-
if (
|
|
17219
|
-
const found = spaces.find((s) => s.slug ===
|
|
17331
|
+
if (command34.spaceSlug) {
|
|
17332
|
+
const found = spaces.find((s) => s.slug === command34.spaceSlug);
|
|
17220
17333
|
if (!found) {
|
|
17221
|
-
throw new Error(`Space '${
|
|
17334
|
+
throw new Error(`Space '${command34.spaceSlug}' not found.`);
|
|
17222
17335
|
}
|
|
17223
17336
|
return found;
|
|
17224
17337
|
}
|
|
@@ -17328,8 +17441,8 @@ var AddToPackageUseCase = class {
|
|
|
17328
17441
|
this.gateway = gateway;
|
|
17329
17442
|
this.spaceService = spaceService;
|
|
17330
17443
|
}
|
|
17331
|
-
async execute(
|
|
17332
|
-
const { packageSlug, spaceSlug, itemType, itemSlugs } =
|
|
17444
|
+
async execute(command34) {
|
|
17445
|
+
const { packageSlug, spaceSlug, itemType, itemSlugs } = command34;
|
|
17333
17446
|
const space = spaceSlug ? await this.resolveSpaceBySlug(spaceSlug) : await this.spaceService.getDefaultSpace();
|
|
17334
17447
|
const packages = await this.gateway.packages.list({
|
|
17335
17448
|
spaceId: space.id
|
|
@@ -17350,7 +17463,7 @@ var AddToPackageUseCase = class {
|
|
|
17350
17463
|
standardIds: [],
|
|
17351
17464
|
recipeIds: [],
|
|
17352
17465
|
skillIds: [],
|
|
17353
|
-
originSkill:
|
|
17466
|
+
originSkill: command34.originSkill
|
|
17354
17467
|
};
|
|
17355
17468
|
if (itemType === "standard") {
|
|
17356
17469
|
addCommand.standardIds = ids.map(createStandardId);
|
|
@@ -17402,7 +17515,7 @@ var AddToPackageUseCase = class {
|
|
|
17402
17515
|
}
|
|
17403
17516
|
async findCommandBySlug(slug6, spaceId) {
|
|
17404
17517
|
const commands = await this.gateway.commands.list({ spaceId });
|
|
17405
|
-
return commands.recipes.find((
|
|
17518
|
+
return commands.recipes.find((command34) => command34.slug === slug6) ?? null;
|
|
17406
17519
|
}
|
|
17407
17520
|
async findSkillBySlug(slug6, spaceId) {
|
|
17408
17521
|
const skills = await this.gateway.skills.list({ spaceId });
|
|
@@ -17410,14 +17523,6 @@ var AddToPackageUseCase = class {
|
|
|
17410
17523
|
}
|
|
17411
17524
|
};
|
|
17412
17525
|
|
|
17413
|
-
// apps/cli/src/infra/utils/packageSlugUtils.ts
|
|
17414
|
-
function parsePackageSlug(slug6) {
|
|
17415
|
-
if (!slug6.startsWith("@")) return null;
|
|
17416
|
-
const slash = slug6.indexOf("/", 1);
|
|
17417
|
-
if (slash === -1) return null;
|
|
17418
|
-
return { spaceSlug: slug6.slice(1, slash), pkgSlug: slug6.slice(slash + 1) };
|
|
17419
|
-
}
|
|
17420
|
-
|
|
17421
17526
|
// apps/cli/src/infra/commands/packages/addToPackageHandler.ts
|
|
17422
17527
|
function pluralize2(singular, count) {
|
|
17423
17528
|
return count === 1 ? singular : `${singular}s`;
|
|
@@ -17429,17 +17534,15 @@ function formatItemList(items) {
|
|
|
17429
17534
|
return items.map((item) => `"${item}"`).join(", ");
|
|
17430
17535
|
}
|
|
17431
17536
|
function resolvePackageRef(to, allSpaces, exit) {
|
|
17432
|
-
|
|
17433
|
-
|
|
17434
|
-
const spaceExists = allSpaces.find((s) => s.slug === parsed.spaceSlug);
|
|
17537
|
+
if (isFullParsedPackageSlug(to)) {
|
|
17538
|
+
const spaceExists = allSpaces.find((s) => s.slug === to.spaceSlug);
|
|
17435
17539
|
if (!spaceExists) {
|
|
17436
|
-
logErrorConsole(`Space '${
|
|
17437
|
-
|
|
17438
|
-
|
|
17439
|
-
);
|
|
17540
|
+
logErrorConsole(`Space '${to.spaceSlug}' not found.`);
|
|
17541
|
+
const availableSpaceSlugs = allSpaces.map((s) => `@${s.slug}`).join(", ");
|
|
17542
|
+
logInfoConsole(`Available spaces: ${availableSpaceSlugs}`);
|
|
17440
17543
|
exit(1);
|
|
17441
17544
|
}
|
|
17442
|
-
return
|
|
17545
|
+
return to;
|
|
17443
17546
|
}
|
|
17444
17547
|
if (allSpaces.length > 1) {
|
|
17445
17548
|
logErrorConsole(
|
|
@@ -17447,14 +17550,14 @@ function resolvePackageRef(to, allSpaces, exit) {
|
|
|
17447
17550
|
);
|
|
17448
17551
|
logInfoConsole(`For example:`);
|
|
17449
17552
|
allSpaces.forEach((s) => {
|
|
17450
|
-
logInfoConsole(` --to @${s.slug}/${to}`);
|
|
17553
|
+
logInfoConsole(` --to @${s.slug}/${to.packageSlug}`);
|
|
17451
17554
|
});
|
|
17452
17555
|
logInfoConsole(
|
|
17453
17556
|
`Run \`packmind-cli packages list\` to see available packages per space.`
|
|
17454
17557
|
);
|
|
17455
17558
|
exit(1);
|
|
17456
17559
|
}
|
|
17457
|
-
return {
|
|
17560
|
+
return { ...to, spaceSlug: allSpaces[0].slug };
|
|
17458
17561
|
}
|
|
17459
17562
|
async function executeAddToPackage(pkgSlug, spaceSlug, itemType, itemSlugs, useCase, originSkill) {
|
|
17460
17563
|
if (itemSlugs.length === 0) {
|
|
@@ -17488,11 +17591,11 @@ async function executeAddToPackage(pkgSlug, spaceSlug, itemType, itemSlugs, useC
|
|
|
17488
17591
|
logErrorConsole(message);
|
|
17489
17592
|
if (error instanceof ItemNotFoundError) {
|
|
17490
17593
|
const spaceFlag = error.spaceSlug ? ` --space ${error.spaceSlug}` : "";
|
|
17491
|
-
const
|
|
17594
|
+
const command34 = formatCommand(
|
|
17492
17595
|
`packmind-cli ${error.itemType}s list${spaceFlag}`
|
|
17493
17596
|
);
|
|
17494
17597
|
logInfoConsole(
|
|
17495
|
-
`Run \`${
|
|
17598
|
+
`Run \`${command34}\` to display available ${error.itemType}s`
|
|
17496
17599
|
);
|
|
17497
17600
|
}
|
|
17498
17601
|
return { success: false, error: message };
|
|
@@ -17501,11 +17604,15 @@ async function executeAddToPackage(pkgSlug, spaceSlug, itemType, itemSlugs, useC
|
|
|
17501
17604
|
async function addToPackageHandler(args2, deps) {
|
|
17502
17605
|
const { hexa, exit } = deps;
|
|
17503
17606
|
const allSpaces = await hexa.getSpaces();
|
|
17504
|
-
const {
|
|
17607
|
+
const { packageSlug, spaceSlug } = resolvePackageRef(
|
|
17608
|
+
args2.to,
|
|
17609
|
+
allSpaces,
|
|
17610
|
+
exit
|
|
17611
|
+
);
|
|
17505
17612
|
const gateway = hexa.getPackmindGateway();
|
|
17506
17613
|
const useCase = new AddToPackageUseCase(gateway, hexa.getSpaceService());
|
|
17507
17614
|
const result = await executeAddToPackage(
|
|
17508
|
-
|
|
17615
|
+
packageSlug,
|
|
17509
17616
|
spaceSlug,
|
|
17510
17617
|
args2.itemType,
|
|
17511
17618
|
args2.itemSlugs,
|
|
@@ -17525,7 +17632,7 @@ var addToPackageCommand = (0, import_cmd_ts20.command)({
|
|
|
17525
17632
|
to: (0, import_cmd_ts20.option)({
|
|
17526
17633
|
long: "to",
|
|
17527
17634
|
description: "Target package slug (use @space/package format when multiple spaces exist)",
|
|
17528
|
-
type:
|
|
17635
|
+
type: PackageSlugArgType
|
|
17529
17636
|
}),
|
|
17530
17637
|
standards: (0, import_cmd_ts20.multioption)({
|
|
17531
17638
|
long: "standard",
|
|
@@ -17673,9 +17780,8 @@ function isNotFoundError(err) {
|
|
|
17673
17780
|
}
|
|
17674
17781
|
async function resolvePackage(slug6, packmindCliHexa) {
|
|
17675
17782
|
const allSpaces = await packmindCliHexa.getSpaces();
|
|
17676
|
-
|
|
17677
|
-
|
|
17678
|
-
const { spaceSlug, pkgSlug } = parsed;
|
|
17783
|
+
if (isFullParsedPackageSlug(slug6)) {
|
|
17784
|
+
const { spaceSlug, packageSlug } = slug6;
|
|
17679
17785
|
const matchedSpace = allSpaces.find((s) => s.slug === spaceSlug);
|
|
17680
17786
|
if (!matchedSpace) {
|
|
17681
17787
|
throw new Error(`Space '@${spaceSlug}' not found.`);
|
|
@@ -17683,23 +17789,23 @@ async function resolvePackage(slug6, packmindCliHexa) {
|
|
|
17683
17789
|
let pkg;
|
|
17684
17790
|
try {
|
|
17685
17791
|
pkg = await packmindCliHexa.getPackageBySlug({
|
|
17686
|
-
slug:
|
|
17792
|
+
slug: packageSlug,
|
|
17687
17793
|
spaceId: matchedSpace.id
|
|
17688
17794
|
});
|
|
17689
17795
|
} catch (err) {
|
|
17690
17796
|
if (isNotFoundError(err)) {
|
|
17691
17797
|
throw new Error(
|
|
17692
|
-
`Package '${
|
|
17798
|
+
`Package '${packageSlug}' not found in space '@${spaceSlug}'.`
|
|
17693
17799
|
);
|
|
17694
17800
|
}
|
|
17695
17801
|
throw err;
|
|
17696
17802
|
}
|
|
17697
|
-
return { pkg, fullSlug: `@${spaceSlug}/${
|
|
17803
|
+
return { pkg, fullSlug: `@${spaceSlug}/${packageSlug}` };
|
|
17698
17804
|
}
|
|
17699
17805
|
const results = await Promise.allSettled(
|
|
17700
17806
|
allSpaces.map(async (space) => ({
|
|
17701
17807
|
pkg: await packmindCliHexa.getPackageBySlug({
|
|
17702
|
-
slug: slug6,
|
|
17808
|
+
slug: slug6.packageSlug,
|
|
17703
17809
|
spaceId: space.id
|
|
17704
17810
|
}),
|
|
17705
17811
|
spaceSlug: space.slug
|
|
@@ -17713,23 +17819,25 @@ async function resolvePackage(slug6, packmindCliHexa) {
|
|
|
17713
17819
|
if (realError) {
|
|
17714
17820
|
throw realError.reason;
|
|
17715
17821
|
}
|
|
17716
|
-
throw new Error(`Package '${slug6}' not found in any space.`);
|
|
17822
|
+
throw new Error(`Package '${slug6.packageSlug}' not found in any space.`);
|
|
17717
17823
|
}
|
|
17718
17824
|
if (matches.length > 1) {
|
|
17719
|
-
const example = `@${matches[0].spaceSlug}/${slug6}`;
|
|
17825
|
+
const example = `@${matches[0].spaceSlug}/${slug6.packageSlug}`;
|
|
17720
17826
|
throw new Error(
|
|
17721
|
-
`Package '${slug6}' exists in multiple spaces (${matches.map((m) => `@${m.spaceSlug}`).join(", ")}). Please specify the space using the @space/package format (e.g. ${example}).`
|
|
17827
|
+
`Package '${slug6.packageSlug}' exists in multiple spaces (${matches.map((m) => `@${m.spaceSlug}`).join(", ")}). Please specify the space using the @space/package format (e.g. ${example}).`
|
|
17722
17828
|
);
|
|
17723
17829
|
}
|
|
17724
17830
|
return {
|
|
17725
17831
|
pkg: matches[0].pkg,
|
|
17726
|
-
fullSlug: `@${matches[0].spaceSlug}/${slug6}`
|
|
17832
|
+
fullSlug: `@${matches[0].spaceSlug}/${slug6.packageSlug}`
|
|
17727
17833
|
};
|
|
17728
17834
|
}
|
|
17729
17835
|
async function showPackageHandler(args2, deps) {
|
|
17730
17836
|
const { packmindCliHexa, exit } = deps;
|
|
17731
17837
|
try {
|
|
17732
|
-
logInfoConsole(
|
|
17838
|
+
logInfoConsole(
|
|
17839
|
+
`Fetching package details for '${displayableParsedPackageSlug(args2.slug)}'...`
|
|
17840
|
+
);
|
|
17733
17841
|
const { pkg, fullSlug } = await resolvePackage(args2.slug, packmindCliHexa);
|
|
17734
17842
|
logConsole(`
|
|
17735
17843
|
${pkg.name} (${fullSlug}):
|
|
@@ -17789,7 +17897,7 @@ var showPackageCommand = (0, import_cmd_ts22.command)({
|
|
|
17789
17897
|
description: "Show details of a specific package",
|
|
17790
17898
|
args: {
|
|
17791
17899
|
slug: (0, import_cmd_ts22.positional)({
|
|
17792
|
-
type:
|
|
17900
|
+
type: PackageSlugArgType,
|
|
17793
17901
|
displayName: "package",
|
|
17794
17902
|
description: "Package slug (e.g. backend or @my-space/backend)"
|
|
17795
17903
|
})
|
|
@@ -17813,12 +17921,385 @@ var packagesCommand = (0, import_cmd_ts23.subcommands)({
|
|
|
17813
17921
|
}
|
|
17814
17922
|
});
|
|
17815
17923
|
|
|
17924
|
+
// apps/cli/src/infra/commands/PluginsCommand.ts
|
|
17925
|
+
var import_cmd_ts26 = __toESM(require_cjs());
|
|
17926
|
+
|
|
17927
|
+
// apps/cli/src/infra/commands/plugins/RenderPluginCommand.ts
|
|
17928
|
+
var import_cmd_ts24 = __toESM(require_cjs());
|
|
17929
|
+
|
|
17930
|
+
// apps/cli/src/infra/commands/plugins/renderPluginHandler.ts
|
|
17931
|
+
var import_fs22 = require("fs");
|
|
17932
|
+
var import_path6 = require("path");
|
|
17933
|
+
|
|
17934
|
+
// apps/cli/src/infra/commands/plugins/pluginsContext.ts
|
|
17935
|
+
var import_fs21 = require("fs");
|
|
17936
|
+
var import_path5 = require("path");
|
|
17937
|
+
function detectPluginMode(cwd) {
|
|
17938
|
+
const marketplace = (0, import_path5.join)(cwd, ".claude-plugin/marketplace.json");
|
|
17939
|
+
const standalone = (0, import_path5.join)(cwd, ".claude-plugin/plugin.json");
|
|
17940
|
+
if ((0, import_fs21.existsSync)(marketplace)) {
|
|
17941
|
+
return { mode: "marketplace", manifestPath: marketplace };
|
|
17942
|
+
}
|
|
17943
|
+
if ((0, import_fs21.existsSync)(standalone)) {
|
|
17944
|
+
return { mode: "standalone", manifestPath: standalone };
|
|
17945
|
+
}
|
|
17946
|
+
return { mode: "none" };
|
|
17947
|
+
}
|
|
17948
|
+
function readMarketplace(path37) {
|
|
17949
|
+
const raw = (0, import_fs21.readFileSync)(path37, "utf8");
|
|
17950
|
+
const parsed = JSON.parse(raw);
|
|
17951
|
+
return { ...parsed, plugins: parsed.plugins ?? [] };
|
|
17952
|
+
}
|
|
17953
|
+
function writeMarketplace(path37, content) {
|
|
17954
|
+
(0, import_fs21.writeFileSync)(path37, `${JSON.stringify(content, null, 2)}
|
|
17955
|
+
`);
|
|
17956
|
+
}
|
|
17957
|
+
function classifySource(source) {
|
|
17958
|
+
if (typeof source === "string" && (source.startsWith("./") || source.startsWith("/"))) {
|
|
17959
|
+
return "local";
|
|
17960
|
+
}
|
|
17961
|
+
return "remote";
|
|
17962
|
+
}
|
|
17963
|
+
function findPluginEntry(marketplace, name) {
|
|
17964
|
+
return marketplace.plugins.find((plugin) => plugin.name === name);
|
|
17965
|
+
}
|
|
17966
|
+
function upsertPluginEntry(marketplace, entry) {
|
|
17967
|
+
const exists = marketplace.plugins.some(
|
|
17968
|
+
(plugin) => plugin.name === entry.name
|
|
17969
|
+
);
|
|
17970
|
+
const plugins = exists ? marketplace.plugins.map(
|
|
17971
|
+
(plugin) => plugin.name === entry.name ? entry : plugin
|
|
17972
|
+
) : [...marketplace.plugins, entry];
|
|
17973
|
+
return { ...marketplace, plugins };
|
|
17974
|
+
}
|
|
17975
|
+
function removePluginEntry(marketplace, name) {
|
|
17976
|
+
return {
|
|
17977
|
+
...marketplace,
|
|
17978
|
+
plugins: marketplace.plugins.filter((plugin) => plugin.name !== name)
|
|
17979
|
+
};
|
|
17980
|
+
}
|
|
17981
|
+
|
|
17982
|
+
// apps/cli/src/infra/commands/plugins/resolveGitContext.ts
|
|
17983
|
+
async function resolveGitContext(packmindCliHexa, cwd) {
|
|
17984
|
+
const root = await packmindCliHexa.tryGetGitRepositoryRoot(cwd);
|
|
17985
|
+
if (!root) {
|
|
17986
|
+
return { gitRemoteUrl: "", gitBranch: "" };
|
|
17987
|
+
}
|
|
17988
|
+
try {
|
|
17989
|
+
return {
|
|
17990
|
+
gitRemoteUrl: packmindCliHexa.getGitRemoteUrlFromPath(root),
|
|
17991
|
+
gitBranch: packmindCliHexa.getCurrentBranch(root)
|
|
17992
|
+
};
|
|
17993
|
+
} catch {
|
|
17994
|
+
return { gitRemoteUrl: "", gitBranch: "" };
|
|
17995
|
+
}
|
|
17996
|
+
}
|
|
17997
|
+
|
|
17998
|
+
// apps/cli/src/infra/commands/plugins/renderPluginHandler.ts
|
|
17999
|
+
async function renderPluginHandler(args2, deps) {
|
|
18000
|
+
const cwd = deps.getCwd();
|
|
18001
|
+
const ctx = detectPluginMode(cwd);
|
|
18002
|
+
if (ctx.mode === "none") {
|
|
18003
|
+
deps.error(
|
|
18004
|
+
"No .claude-plugin/marketplace.json or .claude-plugin/plugin.json found in this directory."
|
|
18005
|
+
);
|
|
18006
|
+
deps.exit(1);
|
|
18007
|
+
return;
|
|
18008
|
+
}
|
|
18009
|
+
const pluginName = args2.packageSlug.packageSlug;
|
|
18010
|
+
const packageSlug = displayableParsedPackageSlug(args2.packageSlug);
|
|
18011
|
+
const { gitRemoteUrl, gitBranch } = await resolveGitContext(
|
|
18012
|
+
deps.packmindCliHexa,
|
|
18013
|
+
cwd
|
|
18014
|
+
);
|
|
18015
|
+
if (ctx.mode === "marketplace") {
|
|
18016
|
+
const manifestPath = ctx.manifestPath;
|
|
18017
|
+
const marketplace = readMarketplace(manifestPath);
|
|
18018
|
+
const existing = findPluginEntry(marketplace, pluginName);
|
|
18019
|
+
if (existing) {
|
|
18020
|
+
if (classifySource(existing.source) === "remote") {
|
|
18021
|
+
deps.error(
|
|
18022
|
+
`Plugin "${pluginName}" has a remote source. Run this command in the workspace of the remote plugin.`
|
|
18023
|
+
);
|
|
18024
|
+
deps.exit(1);
|
|
18025
|
+
return;
|
|
18026
|
+
}
|
|
18027
|
+
const existingLocalSource = existing.source;
|
|
18028
|
+
const confirmed = await deps.confirmOverwrite(
|
|
18029
|
+
`Plugin "${pluginName}" already exists at "${existingLocalSource}". Overwrite? [y/N] `
|
|
18030
|
+
);
|
|
18031
|
+
if (!confirmed) {
|
|
18032
|
+
deps.log("No changes made.");
|
|
18033
|
+
deps.exit(0);
|
|
18034
|
+
return;
|
|
18035
|
+
}
|
|
18036
|
+
const existingPluginRoot = existingLocalSource.replace(/^\.\//, "").replace(/\/?$/, "/");
|
|
18037
|
+
const response2 = await deps.packmindCliHexa.renderPlugin({
|
|
18038
|
+
packageSlug,
|
|
18039
|
+
mode: "marketplace",
|
|
18040
|
+
pluginRoot: existingPluginRoot,
|
|
18041
|
+
pluginName,
|
|
18042
|
+
gitRemoteUrl,
|
|
18043
|
+
gitBranch
|
|
18044
|
+
});
|
|
18045
|
+
writeFiles(cwd, response2.files);
|
|
18046
|
+
const nextEntry = {
|
|
18047
|
+
name: existing.name,
|
|
18048
|
+
source: existing.source,
|
|
18049
|
+
...response2.pluginDescription ? { description: response2.pluginDescription } : {}
|
|
18050
|
+
};
|
|
18051
|
+
writeMarketplace(manifestPath, upsertPluginEntry(marketplace, nextEntry));
|
|
18052
|
+
deps.log(
|
|
18053
|
+
`Re-rendered ${response2.files.length} files into ${existingLocalSource}`
|
|
18054
|
+
);
|
|
18055
|
+
reportSkippedStandards(deps, response2.skippedStandardsCount);
|
|
18056
|
+
deps.exit(0);
|
|
18057
|
+
return;
|
|
18058
|
+
}
|
|
18059
|
+
const pluginRoot = `plugins/${pluginName}/`;
|
|
18060
|
+
const response = await deps.packmindCliHexa.renderPlugin({
|
|
18061
|
+
packageSlug,
|
|
18062
|
+
mode: "marketplace",
|
|
18063
|
+
pluginRoot,
|
|
18064
|
+
pluginName,
|
|
18065
|
+
gitRemoteUrl,
|
|
18066
|
+
gitBranch
|
|
18067
|
+
});
|
|
18068
|
+
writeFiles(cwd, response.files);
|
|
18069
|
+
const updated = upsertPluginEntry(marketplace, {
|
|
18070
|
+
name: pluginName,
|
|
18071
|
+
source: `./${pluginRoot.replace(/\/$/, "")}`,
|
|
18072
|
+
description: response.pluginDescription
|
|
18073
|
+
});
|
|
18074
|
+
writeMarketplace(manifestPath, updated);
|
|
18075
|
+
deps.log(`Rendered ${response.files.length} files into ./${pluginRoot}`);
|
|
18076
|
+
reportSkippedStandards(deps, response.skippedStandardsCount);
|
|
18077
|
+
deps.log("Updated .claude-plugin/marketplace.json");
|
|
18078
|
+
deps.exit(0);
|
|
18079
|
+
return;
|
|
18080
|
+
}
|
|
18081
|
+
if (ctx.mode === "standalone") {
|
|
18082
|
+
const manifestPath = ctx.manifestPath;
|
|
18083
|
+
const manifest = JSON.parse((0, import_fs22.readFileSync)(manifestPath, "utf8"));
|
|
18084
|
+
if (manifest.name !== pluginName) {
|
|
18085
|
+
deps.error(`The plugin '${pluginName}' is not handled in this repo.`);
|
|
18086
|
+
deps.exit(1);
|
|
18087
|
+
return;
|
|
18088
|
+
}
|
|
18089
|
+
const confirmed = await deps.confirmOverwrite(
|
|
18090
|
+
`Plugin "${pluginName}" already exists in this workspace. Overwrite? [y/N] `
|
|
18091
|
+
);
|
|
18092
|
+
if (!confirmed) {
|
|
18093
|
+
deps.log("No changes made.");
|
|
18094
|
+
deps.exit(0);
|
|
18095
|
+
return;
|
|
18096
|
+
}
|
|
18097
|
+
const response = await deps.packmindCliHexa.renderPlugin({
|
|
18098
|
+
packageSlug,
|
|
18099
|
+
mode: "standalone",
|
|
18100
|
+
pluginRoot: "/",
|
|
18101
|
+
pluginName,
|
|
18102
|
+
gitRemoteUrl,
|
|
18103
|
+
gitBranch
|
|
18104
|
+
});
|
|
18105
|
+
writeFiles(cwd, response.files);
|
|
18106
|
+
deps.log(`Re-rendered ${response.files.length} files into ./`);
|
|
18107
|
+
reportSkippedStandards(deps, response.skippedStandardsCount);
|
|
18108
|
+
deps.exit(0);
|
|
18109
|
+
return;
|
|
18110
|
+
}
|
|
18111
|
+
}
|
|
18112
|
+
function reportSkippedStandards(deps, skippedStandardsCount) {
|
|
18113
|
+
if (skippedStandardsCount > 0) {
|
|
18114
|
+
deps.log(
|
|
18115
|
+
`Skipped ${skippedStandardsCount} standards (not supported in Claude plugins).`
|
|
18116
|
+
);
|
|
18117
|
+
}
|
|
18118
|
+
}
|
|
18119
|
+
function writeFiles(cwd, files) {
|
|
18120
|
+
for (const file of files) {
|
|
18121
|
+
const absolutePath = (0, import_path6.join)(cwd, file.path);
|
|
18122
|
+
(0, import_fs22.mkdirSync)((0, import_path6.dirname)(absolutePath), { recursive: true });
|
|
18123
|
+
(0, import_fs22.writeFileSync)(absolutePath, file.content);
|
|
18124
|
+
}
|
|
18125
|
+
}
|
|
18126
|
+
|
|
18127
|
+
// apps/cli/src/infra/commands/plugins/confirmOverwrite.ts
|
|
18128
|
+
var readline4 = __toESM(require("readline"));
|
|
18129
|
+
async function confirmOverwrite(message) {
|
|
18130
|
+
const rl = readline4.createInterface({
|
|
18131
|
+
input: process.stdin,
|
|
18132
|
+
output: process.stdout
|
|
18133
|
+
});
|
|
18134
|
+
return new Promise((resolve16) => {
|
|
18135
|
+
rl.question(message, (answer) => {
|
|
18136
|
+
rl.close();
|
|
18137
|
+
const normalized = answer.trim().toLowerCase();
|
|
18138
|
+
resolve16(normalized === "y" || normalized === "yes");
|
|
18139
|
+
});
|
|
18140
|
+
});
|
|
18141
|
+
}
|
|
18142
|
+
|
|
18143
|
+
// apps/cli/src/infra/commands/plugins/RenderPluginCommand.ts
|
|
18144
|
+
var renderPluginCommand = (0, import_cmd_ts24.command)({
|
|
18145
|
+
name: "render",
|
|
18146
|
+
description: "Render a Packmind package as a Claude plugin",
|
|
18147
|
+
args: {
|
|
18148
|
+
packageSlug: (0, import_cmd_ts24.positional)({
|
|
18149
|
+
type: PackageSlugArgType,
|
|
18150
|
+
displayName: "package-slug",
|
|
18151
|
+
description: "Package slug (e.g. security or @my-space/security)"
|
|
18152
|
+
})
|
|
18153
|
+
},
|
|
18154
|
+
handler: async ({ packageSlug }) => {
|
|
18155
|
+
const packmindLogger = new PackmindLogger("PackmindCLI", "info" /* INFO */);
|
|
18156
|
+
const packmindCliHexa = new PackmindCliHexa(packmindLogger);
|
|
18157
|
+
await renderPluginHandler(
|
|
18158
|
+
{ packageSlug },
|
|
18159
|
+
{
|
|
18160
|
+
packmindCliHexa,
|
|
18161
|
+
exit: process.exit,
|
|
18162
|
+
getCwd: () => process.cwd(),
|
|
18163
|
+
log: console.log,
|
|
18164
|
+
error: console.error,
|
|
18165
|
+
confirmOverwrite
|
|
18166
|
+
}
|
|
18167
|
+
);
|
|
18168
|
+
}
|
|
18169
|
+
});
|
|
18170
|
+
|
|
18171
|
+
// apps/cli/src/infra/commands/plugins/DeletePluginCommand.ts
|
|
18172
|
+
var import_cmd_ts25 = __toESM(require_cjs());
|
|
18173
|
+
|
|
18174
|
+
// apps/cli/src/infra/commands/plugins/deletePluginHandler.ts
|
|
18175
|
+
var import_fs23 = require("fs");
|
|
18176
|
+
var import_path7 = require("path");
|
|
18177
|
+
async function deletePluginHandler(args2, deps) {
|
|
18178
|
+
const cwd = deps.getCwd();
|
|
18179
|
+
const ctx = detectPluginMode(cwd);
|
|
18180
|
+
if (ctx.mode === "none") {
|
|
18181
|
+
deps.error(
|
|
18182
|
+
"No .claude-plugin/marketplace.json or .claude-plugin/plugin.json found in this directory."
|
|
18183
|
+
);
|
|
18184
|
+
deps.exit(1);
|
|
18185
|
+
return;
|
|
18186
|
+
}
|
|
18187
|
+
const pluginName = args2.packageSlug.packageSlug;
|
|
18188
|
+
const packageSlug = displayableParsedPackageSlug(args2.packageSlug);
|
|
18189
|
+
const { gitRemoteUrl } = await resolveGitContext(deps.packmindCliHexa, cwd);
|
|
18190
|
+
if (ctx.mode === "marketplace") {
|
|
18191
|
+
const manifestPath = ctx.manifestPath;
|
|
18192
|
+
const marketplace = readMarketplace(manifestPath);
|
|
18193
|
+
const entry = findPluginEntry(marketplace, pluginName);
|
|
18194
|
+
if (!entry) {
|
|
18195
|
+
deps.log(
|
|
18196
|
+
`Plugin "${pluginName}" is not declared in marketplace.json. Nothing to delete.`
|
|
18197
|
+
);
|
|
18198
|
+
deps.exit(0);
|
|
18199
|
+
return;
|
|
18200
|
+
}
|
|
18201
|
+
if (classifySource(entry.source) === "remote") {
|
|
18202
|
+
deps.error(
|
|
18203
|
+
`Plugin "${pluginName}" has a remote source. Run this command in the workspace of the remote plugin.`
|
|
18204
|
+
);
|
|
18205
|
+
deps.exit(1);
|
|
18206
|
+
return;
|
|
18207
|
+
}
|
|
18208
|
+
const localSource = entry.source;
|
|
18209
|
+
const confirmed = await deps.confirmOverwrite(
|
|
18210
|
+
`Remove ${localSource} and update marketplace.json for plugin "${pluginName}"? [y/N] `
|
|
18211
|
+
);
|
|
18212
|
+
if (!confirmed) {
|
|
18213
|
+
deps.log("No changes made.");
|
|
18214
|
+
deps.exit(0);
|
|
18215
|
+
return;
|
|
18216
|
+
}
|
|
18217
|
+
(0, import_fs23.rmSync)((0, import_path7.join)(cwd, localSource), { recursive: true, force: true });
|
|
18218
|
+
writeMarketplace(manifestPath, removePluginEntry(marketplace, pluginName));
|
|
18219
|
+
deps.log(`Removed ${localSource} and updated marketplace.json`);
|
|
18220
|
+
await trackDeletion(deps, packageSlug, gitRemoteUrl);
|
|
18221
|
+
deps.exit(0);
|
|
18222
|
+
return;
|
|
18223
|
+
}
|
|
18224
|
+
if (ctx.mode === "standalone") {
|
|
18225
|
+
const manifestPath = ctx.manifestPath;
|
|
18226
|
+
const manifest = JSON.parse((0, import_fs23.readFileSync)(manifestPath, "utf8"));
|
|
18227
|
+
if (manifest.name !== pluginName) {
|
|
18228
|
+
deps.error(`The plugin '${pluginName}' is not handled in this repo.`);
|
|
18229
|
+
deps.exit(1);
|
|
18230
|
+
return;
|
|
18231
|
+
}
|
|
18232
|
+
const confirmed = await deps.confirmOverwrite(
|
|
18233
|
+
`Remove rendered files for plugin "${pluginName}" from this workspace? [y/N] `
|
|
18234
|
+
);
|
|
18235
|
+
if (!confirmed) {
|
|
18236
|
+
deps.log("No changes made.");
|
|
18237
|
+
deps.exit(0);
|
|
18238
|
+
return;
|
|
18239
|
+
}
|
|
18240
|
+
(0, import_fs23.rmSync)((0, import_path7.join)(cwd, "commands"), { recursive: true, force: true });
|
|
18241
|
+
(0, import_fs23.rmSync)((0, import_path7.join)(cwd, "skills"), { recursive: true, force: true });
|
|
18242
|
+
deps.log(`Removed rendered files for "${pluginName}"`);
|
|
18243
|
+
await trackDeletion(deps, packageSlug, gitRemoteUrl);
|
|
18244
|
+
deps.exit(0);
|
|
18245
|
+
return;
|
|
18246
|
+
}
|
|
18247
|
+
}
|
|
18248
|
+
async function trackDeletion(deps, packageSlug, gitRemoteUrl) {
|
|
18249
|
+
try {
|
|
18250
|
+
await deps.packmindCliHexa.trackPluginDeleted({
|
|
18251
|
+
packageSlug,
|
|
18252
|
+
gitRemoteUrl
|
|
18253
|
+
});
|
|
18254
|
+
} catch {
|
|
18255
|
+
logWarningConsole("Failed to notify Packmind of plugin deletion");
|
|
18256
|
+
}
|
|
18257
|
+
}
|
|
18258
|
+
|
|
18259
|
+
// apps/cli/src/infra/commands/plugins/DeletePluginCommand.ts
|
|
18260
|
+
var deletePluginCommand = (0, import_cmd_ts25.command)({
|
|
18261
|
+
name: "delete",
|
|
18262
|
+
description: "Delete a rendered Packmind plugin from this workspace",
|
|
18263
|
+
args: {
|
|
18264
|
+
packageSlug: (0, import_cmd_ts25.positional)({
|
|
18265
|
+
type: PackageSlugArgType,
|
|
18266
|
+
displayName: "package-slug",
|
|
18267
|
+
description: "Package slug (e.g. security or @my-space/security)"
|
|
18268
|
+
})
|
|
18269
|
+
},
|
|
18270
|
+
handler: async ({ packageSlug }) => {
|
|
18271
|
+
const packmindLogger = new PackmindLogger("PackmindCLI", "info" /* INFO */);
|
|
18272
|
+
const packmindCliHexa = new PackmindCliHexa(packmindLogger);
|
|
18273
|
+
await deletePluginHandler(
|
|
18274
|
+
{ packageSlug },
|
|
18275
|
+
{
|
|
18276
|
+
packmindCliHexa,
|
|
18277
|
+
exit: process.exit,
|
|
18278
|
+
getCwd: () => process.cwd(),
|
|
18279
|
+
log: console.log,
|
|
18280
|
+
error: console.error,
|
|
18281
|
+
confirmOverwrite
|
|
18282
|
+
}
|
|
18283
|
+
);
|
|
18284
|
+
}
|
|
18285
|
+
});
|
|
18286
|
+
|
|
18287
|
+
// apps/cli/src/infra/commands/PluginsCommand.ts
|
|
18288
|
+
var pluginsCommand = (0, import_cmd_ts26.subcommands)({
|
|
18289
|
+
name: "plugins",
|
|
18290
|
+
description: "Render Packmind packages as Claude plugins",
|
|
18291
|
+
cmds: {
|
|
18292
|
+
render: renderPluginCommand,
|
|
18293
|
+
delete: deletePluginCommand
|
|
18294
|
+
}
|
|
18295
|
+
});
|
|
18296
|
+
|
|
17816
18297
|
// apps/cli/src/infra/commands/PlaybookCommand.ts
|
|
17817
|
-
var
|
|
18298
|
+
var import_cmd_ts33 = __toESM(require_cjs());
|
|
17818
18299
|
|
|
17819
18300
|
// apps/cli/src/infra/commands/playbook/AddCommand.ts
|
|
17820
|
-
var
|
|
17821
|
-
var
|
|
18301
|
+
var import_fs24 = require("fs");
|
|
18302
|
+
var import_cmd_ts27 = __toESM(require_cjs());
|
|
17822
18303
|
|
|
17823
18304
|
// apps/cli/src/infra/repositories/PlaybookLocalRepository.ts
|
|
17824
18305
|
var crypto = __toESM(require("crypto"));
|
|
@@ -18910,17 +19391,17 @@ function formatSpaceList(spaces) {
|
|
|
18910
19391
|
}
|
|
18911
19392
|
|
|
18912
19393
|
// apps/cli/src/infra/commands/playbook/AddCommand.ts
|
|
18913
|
-
var addPlaybookCommand = (0,
|
|
19394
|
+
var addPlaybookCommand = (0, import_cmd_ts27.command)({
|
|
18914
19395
|
name: "add",
|
|
18915
19396
|
description: "Stage a local artifact change",
|
|
18916
19397
|
args: {
|
|
18917
|
-
filePath: (0,
|
|
18918
|
-
type:
|
|
19398
|
+
filePath: (0, import_cmd_ts27.positional)({
|
|
19399
|
+
type: import_cmd_ts27.string,
|
|
18919
19400
|
displayName: "path",
|
|
18920
19401
|
description: "Path to the artifact file or directory to stage"
|
|
18921
19402
|
}),
|
|
18922
|
-
space: (0,
|
|
18923
|
-
type: (0,
|
|
19403
|
+
space: (0, import_cmd_ts27.option)({
|
|
19404
|
+
type: (0, import_cmd_ts27.optional)(SpaceSlug),
|
|
18924
19405
|
long: "space",
|
|
18925
19406
|
description: "Target space slug"
|
|
18926
19407
|
})
|
|
@@ -18940,7 +19421,7 @@ var addPlaybookCommand = (0, import_cmd_ts24.command)({
|
|
|
18940
19421
|
spaceSlug: space,
|
|
18941
19422
|
exit: process.exit,
|
|
18942
19423
|
cwd: process.cwd(),
|
|
18943
|
-
readFile: (p) => (0,
|
|
19424
|
+
readFile: (p) => (0, import_fs24.readFileSync)(p, "utf-8"),
|
|
18944
19425
|
readSkillDirectory,
|
|
18945
19426
|
playbookLocalRepository,
|
|
18946
19427
|
lockFileRepository
|
|
@@ -18949,7 +19430,7 @@ var addPlaybookCommand = (0, import_cmd_ts24.command)({
|
|
|
18949
19430
|
});
|
|
18950
19431
|
|
|
18951
19432
|
// apps/cli/src/infra/commands/playbook/RmCommand.ts
|
|
18952
|
-
var
|
|
19433
|
+
var import_cmd_ts28 = __toESM(require_cjs());
|
|
18953
19434
|
|
|
18954
19435
|
// apps/cli/src/infra/commands/playbook/rmHandler.ts
|
|
18955
19436
|
var fs27 = __toESM(require("fs"));
|
|
@@ -19080,13 +19561,13 @@ async function playbookRmHandler(deps) {
|
|
|
19080
19561
|
}
|
|
19081
19562
|
|
|
19082
19563
|
// apps/cli/src/infra/commands/playbook/RmCommand.ts
|
|
19083
|
-
var rmPlaybookCommand = (0,
|
|
19564
|
+
var rmPlaybookCommand = (0, import_cmd_ts28.command)({
|
|
19084
19565
|
name: "rm",
|
|
19085
19566
|
description: "Stage an artifact for removal",
|
|
19086
19567
|
aliases: ["remove"],
|
|
19087
19568
|
args: {
|
|
19088
|
-
filePath: (0,
|
|
19089
|
-
type:
|
|
19569
|
+
filePath: (0, import_cmd_ts28.positional)({
|
|
19570
|
+
type: import_cmd_ts28.string,
|
|
19090
19571
|
displayName: "path",
|
|
19091
19572
|
description: "Path to the artifact file or directory to remove"
|
|
19092
19573
|
})
|
|
@@ -19112,7 +19593,7 @@ var rmPlaybookCommand = (0, import_cmd_ts25.command)({
|
|
|
19112
19593
|
});
|
|
19113
19594
|
|
|
19114
19595
|
// apps/cli/src/infra/commands/playbook/UnstageCommand.ts
|
|
19115
|
-
var
|
|
19596
|
+
var import_cmd_ts29 = __toESM(require_cjs());
|
|
19116
19597
|
|
|
19117
19598
|
// apps/cli/src/infra/commands/playbook/unstageHandler.ts
|
|
19118
19599
|
var path31 = __toESM(require("path"));
|
|
@@ -19196,17 +19677,17 @@ ${spaceList}`
|
|
|
19196
19677
|
}
|
|
19197
19678
|
|
|
19198
19679
|
// apps/cli/src/infra/commands/playbook/UnstageCommand.ts
|
|
19199
|
-
var unstagePlaybookCommand = (0,
|
|
19680
|
+
var unstagePlaybookCommand = (0, import_cmd_ts29.command)({
|
|
19200
19681
|
name: "unstage",
|
|
19201
19682
|
description: "Remove a staged change",
|
|
19202
19683
|
args: {
|
|
19203
|
-
filePath: (0,
|
|
19204
|
-
type:
|
|
19684
|
+
filePath: (0, import_cmd_ts29.positional)({
|
|
19685
|
+
type: import_cmd_ts29.string,
|
|
19205
19686
|
displayName: "path",
|
|
19206
19687
|
description: "Path to the artifact file or directory to unstage"
|
|
19207
19688
|
}),
|
|
19208
|
-
space: (0,
|
|
19209
|
-
type: (0,
|
|
19689
|
+
space: (0, import_cmd_ts29.option)({
|
|
19690
|
+
type: (0, import_cmd_ts29.optional)(SpaceSlug),
|
|
19210
19691
|
long: "space",
|
|
19211
19692
|
description: "Target space slug (required when artifact is staged for multiple spaces)"
|
|
19212
19693
|
})
|
|
@@ -19231,15 +19712,15 @@ var unstagePlaybookCommand = (0, import_cmd_ts26.command)({
|
|
|
19231
19712
|
});
|
|
19232
19713
|
|
|
19233
19714
|
// apps/cli/src/infra/commands/playbook/StatusCommand.ts
|
|
19234
|
-
var
|
|
19235
|
-
var
|
|
19715
|
+
var import_fs26 = require("fs");
|
|
19716
|
+
var import_cmd_ts30 = __toESM(require_cjs());
|
|
19236
19717
|
|
|
19237
19718
|
// apps/cli/src/infra/utils/listDirectoryFiles.ts
|
|
19238
|
-
var
|
|
19719
|
+
var import_fs25 = require("fs");
|
|
19239
19720
|
var path32 = __toESM(require("path"));
|
|
19240
19721
|
function listDirectoryFiles(dirPath) {
|
|
19241
19722
|
const results = [];
|
|
19242
|
-
const entries = (0,
|
|
19723
|
+
const entries = (0, import_fs25.readdirSync)(dirPath, { withFileTypes: true });
|
|
19243
19724
|
for (const entry of entries) {
|
|
19244
19725
|
const fullPath = path32.join(dirPath, entry.name);
|
|
19245
19726
|
if (entry.isDirectory()) {
|
|
@@ -19515,7 +19996,7 @@ async function playbookStatusHandler(deps) {
|
|
|
19515
19996
|
}
|
|
19516
19997
|
|
|
19517
19998
|
// apps/cli/src/infra/commands/playbook/StatusCommand.ts
|
|
19518
|
-
var statusPlaybookCommand = (0,
|
|
19999
|
+
var statusPlaybookCommand = (0, import_cmd_ts30.command)({
|
|
19519
20000
|
name: "status",
|
|
19520
20001
|
description: "Show staged and untracked changes",
|
|
19521
20002
|
args: {},
|
|
@@ -19534,11 +20015,11 @@ var statusPlaybookCommand = (0, import_cmd_ts27.command)({
|
|
|
19534
20015
|
lockFileRepository,
|
|
19535
20016
|
cwd: process.cwd(),
|
|
19536
20017
|
exit: process.exit,
|
|
19537
|
-
readFile: (p) => (0,
|
|
20018
|
+
readFile: (p) => (0, import_fs26.readFileSync)(p, "utf-8"),
|
|
19538
20019
|
listDirectoryFiles,
|
|
19539
20020
|
getFileMode: (p) => {
|
|
19540
20021
|
try {
|
|
19541
|
-
return (0,
|
|
20022
|
+
return (0, import_fs26.statSync)(p).mode;
|
|
19542
20023
|
} catch {
|
|
19543
20024
|
return null;
|
|
19544
20025
|
}
|
|
@@ -19548,8 +20029,8 @@ var statusPlaybookCommand = (0, import_cmd_ts27.command)({
|
|
|
19548
20029
|
});
|
|
19549
20030
|
|
|
19550
20031
|
// apps/cli/src/infra/commands/playbook/SubmitCommand.ts
|
|
19551
|
-
var
|
|
19552
|
-
var
|
|
20032
|
+
var import_fs28 = require("fs");
|
|
20033
|
+
var import_cmd_ts31 = __toESM(require_cjs());
|
|
19553
20034
|
|
|
19554
20035
|
// apps/cli/src/infra/commands/playbook/submitHandler.ts
|
|
19555
20036
|
var path35 = __toESM(require("path"));
|
|
@@ -20685,9 +21166,9 @@ Only one agent version can be submitted at a time. Use "playbook unstage" to rem
|
|
|
20685
21166
|
|
|
20686
21167
|
// apps/cli/src/infra/utils/editorMessage.ts
|
|
20687
21168
|
var import_child_process3 = require("child_process");
|
|
20688
|
-
var
|
|
21169
|
+
var import_fs27 = require("fs");
|
|
20689
21170
|
var import_os2 = require("os");
|
|
20690
|
-
var
|
|
21171
|
+
var import_path8 = require("path");
|
|
20691
21172
|
|
|
20692
21173
|
// apps/cli/src/infra/utils/resolveEditor.ts
|
|
20693
21174
|
var which = __toESM(require("which"));
|
|
@@ -20726,20 +21207,20 @@ var EDITOR_TEMPLATE = `
|
|
|
20726
21207
|
`;
|
|
20727
21208
|
function openEditorForMessage(prefill) {
|
|
20728
21209
|
const editor = resolveEditor();
|
|
20729
|
-
const tmpFile = (0,
|
|
21210
|
+
const tmpFile = (0, import_path8.join)((0, import_os2.tmpdir)(), `packmind-msg-${Date.now()}.txt`);
|
|
20730
21211
|
try {
|
|
20731
|
-
(0,
|
|
21212
|
+
(0, import_fs27.writeFileSync)(tmpFile, prefill ?? EDITOR_TEMPLATE, "utf-8");
|
|
20732
21213
|
const result = (0, import_child_process3.spawnSync)(editor, [tmpFile], {
|
|
20733
21214
|
stdio: "inherit"
|
|
20734
21215
|
});
|
|
20735
21216
|
if (result.status !== 0) {
|
|
20736
21217
|
throw new Error(`Editor exited with status ${result.status}`);
|
|
20737
21218
|
}
|
|
20738
|
-
const content = (0,
|
|
21219
|
+
const content = (0, import_fs27.readFileSync)(tmpFile, "utf-8");
|
|
20739
21220
|
return content.split("\n").filter((line) => !line.startsWith("#")).join("\n").trim();
|
|
20740
21221
|
} finally {
|
|
20741
21222
|
try {
|
|
20742
|
-
(0,
|
|
21223
|
+
(0, import_fs27.unlinkSync)(tmpFile);
|
|
20743
21224
|
} catch {
|
|
20744
21225
|
}
|
|
20745
21226
|
}
|
|
@@ -20758,17 +21239,17 @@ function safeOpenEditor(prefill) {
|
|
|
20758
21239
|
}
|
|
20759
21240
|
|
|
20760
21241
|
// apps/cli/src/infra/commands/playbook/SubmitCommand.ts
|
|
20761
|
-
var submitPlaybookCommand = (0,
|
|
21242
|
+
var submitPlaybookCommand = (0, import_cmd_ts31.command)({
|
|
20762
21243
|
name: "submit",
|
|
20763
21244
|
description: "Submit staged changes as proposals",
|
|
20764
21245
|
args: {
|
|
20765
|
-
message: (0,
|
|
20766
|
-
type: (0,
|
|
21246
|
+
message: (0, import_cmd_ts31.option)({
|
|
21247
|
+
type: (0, import_cmd_ts31.optional)(import_cmd_ts31.string),
|
|
20767
21248
|
long: "message",
|
|
20768
21249
|
short: "m",
|
|
20769
21250
|
description: "Message describing the intent behind the proposed changes"
|
|
20770
21251
|
}),
|
|
20771
|
-
noReview: (0,
|
|
21252
|
+
noReview: (0, import_cmd_ts31.flag)({
|
|
20772
21253
|
long: "no-review",
|
|
20773
21254
|
description: "Apply changes directly without creating proposals for review"
|
|
20774
21255
|
})
|
|
@@ -20791,27 +21272,27 @@ var submitPlaybookCommand = (0, import_cmd_ts28.command)({
|
|
|
20791
21272
|
message,
|
|
20792
21273
|
noReview,
|
|
20793
21274
|
openEditor: safeOpenEditor,
|
|
20794
|
-
unlinkSync: (p) => (0,
|
|
20795
|
-
rmSync: (p, opts) => (0,
|
|
21275
|
+
unlinkSync: (p) => (0, import_fs28.unlinkSync)(p),
|
|
21276
|
+
rmSync: (p, opts) => (0, import_fs28.rmSync)(p, opts)
|
|
20796
21277
|
});
|
|
20797
21278
|
}
|
|
20798
21279
|
});
|
|
20799
21280
|
|
|
20800
21281
|
// apps/cli/src/infra/commands/playbook/DiffCommand.ts
|
|
20801
|
-
var
|
|
20802
|
-
var diffCommand2 = (0,
|
|
21282
|
+
var import_cmd_ts32 = __toESM(require_cjs());
|
|
21283
|
+
var diffCommand2 = (0, import_cmd_ts32.command)({
|
|
20803
21284
|
name: "diff",
|
|
20804
21285
|
description: "Show differences between local command files and server content",
|
|
20805
21286
|
args: {
|
|
20806
|
-
includeSubmitted: (0,
|
|
21287
|
+
includeSubmitted: (0, import_cmd_ts32.flag)({
|
|
20807
21288
|
long: "include-submitted",
|
|
20808
21289
|
description: "Include already submitted changes in the output"
|
|
20809
21290
|
}),
|
|
20810
|
-
path: (0,
|
|
21291
|
+
path: (0, import_cmd_ts32.option)({
|
|
20811
21292
|
long: "path",
|
|
20812
21293
|
short: "p",
|
|
20813
21294
|
description: "Path to analyze (relative to current directory)",
|
|
20814
|
-
type: (0,
|
|
21295
|
+
type: (0, import_cmd_ts32.optional)(import_cmd_ts32.string)
|
|
20815
21296
|
})
|
|
20816
21297
|
},
|
|
20817
21298
|
handler: async ({ includeSubmitted, path: path37 }) => {
|
|
@@ -20829,7 +21310,7 @@ var diffCommand2 = (0, import_cmd_ts29.command)({
|
|
|
20829
21310
|
});
|
|
20830
21311
|
|
|
20831
21312
|
// apps/cli/src/infra/commands/PlaybookCommand.ts
|
|
20832
|
-
var playbookCommand = (0,
|
|
21313
|
+
var playbookCommand = (0, import_cmd_ts33.subcommands)({
|
|
20833
21314
|
name: "playbook",
|
|
20834
21315
|
description: "Manage local playbook files and propose changes to your team",
|
|
20835
21316
|
cmds: {
|
|
@@ -20843,10 +21324,10 @@ var playbookCommand = (0, import_cmd_ts30.subcommands)({
|
|
|
20843
21324
|
});
|
|
20844
21325
|
|
|
20845
21326
|
// apps/cli/src/infra/commands/SpacesCommand.ts
|
|
20846
|
-
var
|
|
21327
|
+
var import_cmd_ts35 = __toESM(require_cjs());
|
|
20847
21328
|
|
|
20848
21329
|
// apps/cli/src/infra/commands/ListSpacesCommand.ts
|
|
20849
|
-
var
|
|
21330
|
+
var import_cmd_ts34 = __toESM(require_cjs());
|
|
20850
21331
|
|
|
20851
21332
|
// apps/cli/src/infra/commands/spaces/listSpacesHandler.ts
|
|
20852
21333
|
function displaySpace(space) {
|
|
@@ -20882,7 +21363,7 @@ async function listSpacesHandler(deps) {
|
|
|
20882
21363
|
}
|
|
20883
21364
|
|
|
20884
21365
|
// apps/cli/src/infra/commands/ListSpacesCommand.ts
|
|
20885
|
-
var listSpacesCommand = (0,
|
|
21366
|
+
var listSpacesCommand = (0, import_cmd_ts34.command)({
|
|
20886
21367
|
name: "list",
|
|
20887
21368
|
description: "List available spaces in the organization",
|
|
20888
21369
|
args: {},
|
|
@@ -20897,7 +21378,7 @@ var listSpacesCommand = (0, import_cmd_ts31.command)({
|
|
|
20897
21378
|
});
|
|
20898
21379
|
|
|
20899
21380
|
// apps/cli/src/infra/commands/SpacesCommand.ts
|
|
20900
|
-
var spacesCommand = (0,
|
|
21381
|
+
var spacesCommand = (0, import_cmd_ts35.subcommands)({
|
|
20901
21382
|
name: "spaces",
|
|
20902
21383
|
description: "Manage spaces in your Packmind organization",
|
|
20903
21384
|
cmds: {
|
|
@@ -20906,17 +21387,17 @@ var spacesCommand = (0, import_cmd_ts32.subcommands)({
|
|
|
20906
21387
|
});
|
|
20907
21388
|
|
|
20908
21389
|
// apps/cli/src/infra/commands/config/ConfigCommand.ts
|
|
20909
|
-
var
|
|
21390
|
+
var import_cmd_ts41 = __toESM(require_cjs());
|
|
20910
21391
|
|
|
20911
21392
|
// apps/cli/src/infra/commands/config/ConfigAgentsCommand.ts
|
|
20912
|
-
var
|
|
21393
|
+
var import_cmd_ts40 = __toESM(require_cjs());
|
|
20913
21394
|
|
|
20914
21395
|
// apps/cli/src/infra/commands/config/ConfigAgentsAddCommand.ts
|
|
20915
|
-
var
|
|
20916
|
-
var
|
|
21396
|
+
var readline5 = __toESM(require("readline"));
|
|
21397
|
+
var import_cmd_ts37 = __toESM(require_cjs());
|
|
20917
21398
|
|
|
20918
21399
|
// apps/cli/src/infra/commands/customParameters/AgentNamesPositional.ts
|
|
20919
|
-
var
|
|
21400
|
+
var import_cmd_ts36 = __toESM(require_cjs());
|
|
20920
21401
|
|
|
20921
21402
|
// apps/cli/src/infra/commands/customParameters/AgentArgType.ts
|
|
20922
21403
|
var VALID_AGENTS = Object.keys(CodingAgents).filter(
|
|
@@ -20935,7 +21416,7 @@ var AgentArgType = {
|
|
|
20935
21416
|
};
|
|
20936
21417
|
|
|
20937
21418
|
// apps/cli/src/infra/commands/customParameters/AgentNamesPositional.ts
|
|
20938
|
-
var agentNamesPositional = (0,
|
|
21419
|
+
var agentNamesPositional = (0, import_cmd_ts36.restPositionals)({
|
|
20939
21420
|
type: AgentArgType,
|
|
20940
21421
|
displayName: "agents",
|
|
20941
21422
|
description: "Agent identifiers (e.g. claude cursor)"
|
|
@@ -21031,7 +21512,7 @@ To restore organization settings later, remove all local agents with: packmind-c
|
|
|
21031
21512
|
// apps/cli/src/infra/commands/config/ConfigAgentsAddCommand.ts
|
|
21032
21513
|
function createPromptConfirm() {
|
|
21033
21514
|
return (message) => new Promise((resolve16) => {
|
|
21034
|
-
const rl =
|
|
21515
|
+
const rl = readline5.createInterface({
|
|
21035
21516
|
input: process.stdin,
|
|
21036
21517
|
output: process.stdout
|
|
21037
21518
|
});
|
|
@@ -21041,12 +21522,12 @@ function createPromptConfirm() {
|
|
|
21041
21522
|
});
|
|
21042
21523
|
});
|
|
21043
21524
|
}
|
|
21044
|
-
var addAgentsCommand = (0,
|
|
21525
|
+
var addAgentsCommand = (0, import_cmd_ts37.command)({
|
|
21045
21526
|
name: "add",
|
|
21046
21527
|
description: "Add coding agents to packmind.json files",
|
|
21047
21528
|
args: {
|
|
21048
|
-
path: (0,
|
|
21049
|
-
type:
|
|
21529
|
+
path: (0, import_cmd_ts37.option)({
|
|
21530
|
+
type: import_cmd_ts37.string,
|
|
21050
21531
|
short: "p",
|
|
21051
21532
|
long: "path",
|
|
21052
21533
|
defaultValue: () => "",
|
|
@@ -21072,7 +21553,7 @@ var addAgentsCommand = (0, import_cmd_ts34.command)({
|
|
|
21072
21553
|
});
|
|
21073
21554
|
|
|
21074
21555
|
// apps/cli/src/infra/commands/config/ConfigAgentsListCommand.ts
|
|
21075
|
-
var
|
|
21556
|
+
var import_cmd_ts38 = __toESM(require_cjs());
|
|
21076
21557
|
|
|
21077
21558
|
// apps/cli/src/infra/commands/config/agents/listAgentsHandler.ts
|
|
21078
21559
|
var SOURCE_LABELS = {
|
|
@@ -21152,12 +21633,12 @@ async function listAgentsHandler(args2, deps) {
|
|
|
21152
21633
|
}
|
|
21153
21634
|
|
|
21154
21635
|
// apps/cli/src/infra/commands/config/ConfigAgentsListCommand.ts
|
|
21155
|
-
var listAgentsCommand = (0,
|
|
21636
|
+
var listAgentsCommand = (0, import_cmd_ts38.command)({
|
|
21156
21637
|
name: "list",
|
|
21157
21638
|
description: "List coding agents configured across packmind.json files",
|
|
21158
21639
|
args: {
|
|
21159
|
-
path: (0,
|
|
21160
|
-
type:
|
|
21640
|
+
path: (0, import_cmd_ts38.option)({
|
|
21641
|
+
type: import_cmd_ts38.string,
|
|
21161
21642
|
short: "p",
|
|
21162
21643
|
long: "path",
|
|
21163
21644
|
defaultValue: () => "",
|
|
@@ -21181,7 +21662,7 @@ var listAgentsCommand = (0, import_cmd_ts35.command)({
|
|
|
21181
21662
|
});
|
|
21182
21663
|
|
|
21183
21664
|
// apps/cli/src/infra/commands/config/ConfigAgentsRemoveCommand.ts
|
|
21184
|
-
var
|
|
21665
|
+
var import_cmd_ts39 = __toESM(require_cjs());
|
|
21185
21666
|
|
|
21186
21667
|
// apps/cli/src/infra/commands/config/agents/removeAgentsHandler.ts
|
|
21187
21668
|
async function removeAgentsHandler(args2, deps) {
|
|
@@ -21264,13 +21745,13 @@ function logConfiguredAgentsHint(configuredAgents) {
|
|
|
21264
21745
|
}
|
|
21265
21746
|
|
|
21266
21747
|
// apps/cli/src/infra/commands/config/ConfigAgentsRemoveCommand.ts
|
|
21267
|
-
var removeAgentsCommand = (0,
|
|
21748
|
+
var removeAgentsCommand = (0, import_cmd_ts39.command)({
|
|
21268
21749
|
name: "rm",
|
|
21269
21750
|
aliases: ["remove"],
|
|
21270
21751
|
description: "Remove coding agents from packmind.json files",
|
|
21271
21752
|
args: {
|
|
21272
|
-
path: (0,
|
|
21273
|
-
type:
|
|
21753
|
+
path: (0, import_cmd_ts39.option)({
|
|
21754
|
+
type: import_cmd_ts39.string,
|
|
21274
21755
|
short: "p",
|
|
21275
21756
|
long: "path",
|
|
21276
21757
|
defaultValue: () => "",
|
|
@@ -21292,7 +21773,7 @@ var removeAgentsCommand = (0, import_cmd_ts36.command)({
|
|
|
21292
21773
|
});
|
|
21293
21774
|
|
|
21294
21775
|
// apps/cli/src/infra/commands/config/ConfigAgentsCommand.ts
|
|
21295
|
-
var configAgentsSetupCommand = (0,
|
|
21776
|
+
var configAgentsSetupCommand = (0, import_cmd_ts40.command)({
|
|
21296
21777
|
name: "setup",
|
|
21297
21778
|
description: "Configure which coding agents to generate artifacts for",
|
|
21298
21779
|
args: {},
|
|
@@ -21310,7 +21791,7 @@ var configAgentsSetupCommand = (0, import_cmd_ts37.command)({
|
|
|
21310
21791
|
});
|
|
21311
21792
|
}
|
|
21312
21793
|
});
|
|
21313
|
-
var configAgentsCommand = (0,
|
|
21794
|
+
var configAgentsCommand = (0, import_cmd_ts40.subcommands)({
|
|
21314
21795
|
name: "agents",
|
|
21315
21796
|
description: "Manage coding agents configuration",
|
|
21316
21797
|
cmds: {
|
|
@@ -21322,7 +21803,7 @@ var configAgentsCommand = (0, import_cmd_ts37.subcommands)({
|
|
|
21322
21803
|
});
|
|
21323
21804
|
|
|
21324
21805
|
// apps/cli/src/infra/commands/config/ConfigCommand.ts
|
|
21325
|
-
var configCommand = (0,
|
|
21806
|
+
var configCommand = (0, import_cmd_ts41.subcommands)({
|
|
21326
21807
|
name: "config",
|
|
21327
21808
|
description: "Manage Packmind configuration",
|
|
21328
21809
|
cmds: {
|
|
@@ -21331,9 +21812,9 @@ var configCommand = (0, import_cmd_ts38.subcommands)({
|
|
|
21331
21812
|
});
|
|
21332
21813
|
|
|
21333
21814
|
// apps/cli/src/infra/commands/InitCommand.ts
|
|
21334
|
-
var
|
|
21815
|
+
var import_cmd_ts42 = __toESM(require_cjs());
|
|
21335
21816
|
var { version: CLI_VERSION5 } = require_package();
|
|
21336
|
-
var initCommand = (0,
|
|
21817
|
+
var initCommand = (0, import_cmd_ts42.command)({
|
|
21337
21818
|
name: "init",
|
|
21338
21819
|
description: "Initialize Packmind in the current project",
|
|
21339
21820
|
args: {},
|
|
@@ -21362,13 +21843,13 @@ var initCommand = (0, import_cmd_ts39.command)({
|
|
|
21362
21843
|
});
|
|
21363
21844
|
|
|
21364
21845
|
// apps/cli/src/infra/commands/UpdateCommand.ts
|
|
21365
|
-
var
|
|
21846
|
+
var import_cmd_ts43 = __toESM(require_cjs());
|
|
21366
21847
|
var { version: CLI_VERSION6 } = require_package();
|
|
21367
|
-
var updateCommand = (0,
|
|
21848
|
+
var updateCommand = (0, import_cmd_ts43.command)({
|
|
21368
21849
|
name: "update",
|
|
21369
21850
|
description: "Update packmind-cli to the latest version",
|
|
21370
21851
|
args: {
|
|
21371
|
-
check: (0,
|
|
21852
|
+
check: (0, import_cmd_ts43.flag)({
|
|
21372
21853
|
long: "check",
|
|
21373
21854
|
description: "Only check if a newer version is available without performing the update"
|
|
21374
21855
|
})
|
|
@@ -21426,7 +21907,7 @@ if (args.includes("--version") || args.includes("-v")) {
|
|
|
21426
21907
|
logConsole(`packmind-cli version ${CLI_VERSION7}`);
|
|
21427
21908
|
process.exit(0);
|
|
21428
21909
|
}
|
|
21429
|
-
var app = (0,
|
|
21910
|
+
var app = (0, import_cmd_ts44.subcommands)({
|
|
21430
21911
|
name: "packmind-cli",
|
|
21431
21912
|
description: "Packmind CLI tool",
|
|
21432
21913
|
cmds: {
|
|
@@ -21439,6 +21920,7 @@ var app = (0, import_cmd_ts41.subcommands)({
|
|
|
21439
21920
|
login: loginCommand,
|
|
21440
21921
|
logout: logoutCommand,
|
|
21441
21922
|
packages: packagesCommand,
|
|
21923
|
+
plugins: pluginsCommand,
|
|
21442
21924
|
playbook: playbookCommand,
|
|
21443
21925
|
skills: skillsCommand,
|
|
21444
21926
|
spaces: spacesCommand,
|
|
@@ -21448,7 +21930,7 @@ var app = (0, import_cmd_ts41.subcommands)({
|
|
|
21448
21930
|
whoami: whoamiCommand
|
|
21449
21931
|
}
|
|
21450
21932
|
});
|
|
21451
|
-
(0,
|
|
21933
|
+
(0, import_cmd_ts44.run)(app, args).catch((error) => {
|
|
21452
21934
|
logErrorConsole(error.message);
|
|
21453
21935
|
process.exit(1);
|
|
21454
21936
|
});
|