@packmind/cli 0.30.0 → 0.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/main.cjs +343 -198
  2. package/package.json +7 -4
package/main.cjs CHANGED
@@ -41,7 +41,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
41
41
  ));
42
42
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
43
43
 
44
- // node_modules/chalk/source/vendor/ansi-styles/index.js
44
+ // node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
45
45
  function assembleStyles() {
46
46
  const codes = /* @__PURE__ */ new Map();
47
47
  for (const [groupName, group] of Object.entries(styles)) {
@@ -158,7 +158,7 @@ function assembleStyles() {
158
158
  }
159
159
  var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
160
160
  var init_ansi_styles = __esm({
161
- "node_modules/chalk/source/vendor/ansi-styles/index.js"() {
161
+ "node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
162
162
  "use strict";
163
163
  ANSI_BACKGROUND_OFFSET = 10;
164
164
  wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
@@ -233,7 +233,7 @@ var init_ansi_styles = __esm({
233
233
  }
234
234
  });
235
235
 
236
- // node_modules/chalk/source/vendor/supports-color/index.js
236
+ // node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
237
237
  function hasFlag(flag8, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
238
238
  const prefix = flag8.startsWith("-") ? "" : flag8.length === 1 ? "-" : "--";
239
239
  const position = argv.indexOf(prefix + flag8);
@@ -351,7 +351,7 @@ function createSupportsColor(stream, options = {}) {
351
351
  }
352
352
  var import_node_process, import_node_os, import_node_tty, env, flagForceColor, supportsColor, supports_color_default;
353
353
  var init_supports_color = __esm({
354
- "node_modules/chalk/source/vendor/supports-color/index.js"() {
354
+ "node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js"() {
355
355
  "use strict";
356
356
  import_node_process = __toESM(require("node:process"), 1);
357
357
  import_node_os = __toESM(require("node:os"), 1);
@@ -370,7 +370,7 @@ var init_supports_color = __esm({
370
370
  }
371
371
  });
372
372
 
373
- // node_modules/chalk/source/utilities.js
373
+ // node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js
374
374
  function stringReplaceAll(string20, substring, replacer) {
375
375
  let index = string20.indexOf(substring);
376
376
  if (index === -1) {
@@ -400,12 +400,12 @@ function stringEncaseCRLFWithFirstIndex(string20, prefix, postfix, index) {
400
400
  return returnValue;
401
401
  }
402
402
  var init_utilities = __esm({
403
- "node_modules/chalk/source/utilities.js"() {
403
+ "node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js"() {
404
404
  "use strict";
405
405
  }
406
406
  });
407
407
 
408
- // node_modules/chalk/source/index.js
408
+ // node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
409
409
  var source_exports = {};
410
410
  __export(source_exports, {
411
411
  Chalk: () => Chalk,
@@ -427,7 +427,7 @@ function createChalk(options) {
427
427
  }
428
428
  var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, Chalk, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default;
429
429
  var init_source = __esm({
430
- "node_modules/chalk/source/index.js"() {
430
+ "node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js"() {
431
431
  "use strict";
432
432
  init_ansi_styles();
433
433
  init_supports_color();
@@ -583,9 +583,9 @@ var init_source = __esm({
583
583
  }
584
584
  });
585
585
 
586
- // node_modules/didyoumean/didYouMean-1.2.1.js
586
+ // node_modules/.pnpm/didyoumean@1.2.2/node_modules/didyoumean/didYouMean-1.2.1.js
587
587
  var require_didYouMean_1_2_1 = __commonJS({
588
- "node_modules/didyoumean/didYouMean-1.2.1.js"(exports2, module2) {
588
+ "node_modules/.pnpm/didyoumean@1.2.2/node_modules/didyoumean/didYouMean-1.2.1.js"(exports2, module2) {
589
589
  "use strict";
590
590
  (function() {
591
591
  "use strict";
@@ -683,9 +683,9 @@ var require_didYouMean_1_2_1 = __commonJS({
683
683
  }
684
684
  });
685
685
 
686
- // node_modules/cmd-ts/dist/cjs/Result.js
686
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/Result.js
687
687
  var require_Result = __commonJS({
688
- "node_modules/cmd-ts/dist/cjs/Result.js"(exports2) {
688
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/Result.js"(exports2) {
689
689
  "use strict";
690
690
  Object.defineProperty(exports2, "__esModule", { value: true });
691
691
  exports2.ok = ok;
@@ -716,9 +716,9 @@ var require_Result = __commonJS({
716
716
  }
717
717
  });
718
718
 
719
- // node_modules/cmd-ts/dist/cjs/effects.js
719
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/effects.js
720
720
  var require_effects = __commonJS({
721
- "node_modules/cmd-ts/dist/cjs/effects.js"(exports2) {
721
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/effects.js"(exports2) {
722
722
  "use strict";
723
723
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
724
724
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -753,9 +753,9 @@ ${coloredExit}`;
753
753
  }
754
754
  });
755
755
 
756
- // node_modules/cmd-ts/dist/cjs/newparser/findOption.js
756
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/newparser/findOption.js
757
757
  var require_findOption = __commonJS({
758
- "node_modules/cmd-ts/dist/cjs/newparser/findOption.js"(exports2) {
758
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/newparser/findOption.js"(exports2) {
759
759
  "use strict";
760
760
  Object.defineProperty(exports2, "__esModule", { value: true });
761
761
  exports2.findOption = findOption;
@@ -779,9 +779,9 @@ var require_findOption = __commonJS({
779
779
  }
780
780
  });
781
781
 
782
- // node_modules/cmd-ts/dist/cjs/from.js
782
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/from.js
783
783
  var require_from = __commonJS({
784
- "node_modules/cmd-ts/dist/cjs/from.js"(exports2) {
784
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/from.js"(exports2) {
785
785
  "use strict";
786
786
  Object.defineProperty(exports2, "__esModule", { value: true });
787
787
  exports2.identity = identity;
@@ -795,9 +795,9 @@ var require_from = __commonJS({
795
795
  }
796
796
  });
797
797
 
798
- // node_modules/cmd-ts/dist/cjs/type.js
798
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/type.js
799
799
  var require_type = __commonJS({
800
- "node_modules/cmd-ts/dist/cjs/type.js"(exports2) {
800
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/type.js"(exports2) {
801
801
  "use strict";
802
802
  Object.defineProperty(exports2, "__esModule", { value: true });
803
803
  exports2.identity = void 0;
@@ -836,9 +836,9 @@ var require_type = __commonJS({
836
836
  }
837
837
  });
838
838
 
839
- // node_modules/cmd-ts/dist/cjs/types.js
839
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/types.js
840
840
  var require_types = __commonJS({
841
- "node_modules/cmd-ts/dist/cjs/types.js"(exports2) {
841
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/types.js"(exports2) {
842
842
  "use strict";
843
843
  Object.defineProperty(exports2, "__esModule", { value: true });
844
844
  exports2.boolean = exports2.string = exports2.number = void 0;
@@ -888,9 +888,9 @@ var require_types = __commonJS({
888
888
  }
889
889
  });
890
890
 
891
- // node_modules/cmd-ts/dist/cjs/flag.js
891
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/flag.js
892
892
  var require_flag = __commonJS({
893
- "node_modules/cmd-ts/dist/cjs/flag.js"(exports2) {
893
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/flag.js"(exports2) {
894
894
  "use strict";
895
895
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
896
896
  if (k2 === void 0) k2 = k;
@@ -1093,9 +1093,9 @@ var require_flag = __commonJS({
1093
1093
  }
1094
1094
  });
1095
1095
 
1096
- // node_modules/cmd-ts/dist/cjs/circuitbreaker.js
1096
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/circuitbreaker.js
1097
1097
  var require_circuitbreaker = __commonJS({
1098
- "node_modules/cmd-ts/dist/cjs/circuitbreaker.js"(exports2) {
1098
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/circuitbreaker.js"(exports2) {
1099
1099
  "use strict";
1100
1100
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
1101
1101
  if (k2 === void 0) k2 = k;
@@ -1210,9 +1210,9 @@ var require_circuitbreaker = __commonJS({
1210
1210
  }
1211
1211
  });
1212
1212
 
1213
- // node_modules/cmd-ts/dist/cjs/positional.js
1213
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/positional.js
1214
1214
  var require_positional = __commonJS({
1215
- "node_modules/cmd-ts/dist/cjs/positional.js"(exports2) {
1215
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/positional.js"(exports2) {
1216
1216
  "use strict";
1217
1217
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
1218
1218
  if (k2 === void 0) k2 = k;
@@ -1334,9 +1334,9 @@ var require_positional = __commonJS({
1334
1334
  }
1335
1335
  });
1336
1336
 
1337
- // node_modules/cmd-ts/dist/cjs/subcommands.js
1337
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/subcommands.js
1338
1338
  var require_subcommands = __commonJS({
1339
- "node_modules/cmd-ts/dist/cjs/subcommands.js"(exports2) {
1339
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/subcommands.js"(exports2) {
1340
1340
  "use strict";
1341
1341
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
1342
1342
  if (k2 === void 0) k2 = k;
@@ -1536,9 +1536,9 @@ Did you mean ${chalk_1.default.italic(option22)}?`;
1536
1536
  }
1537
1537
  });
1538
1538
 
1539
- // node_modules/cmd-ts/dist/cjs/binary.js
1539
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/binary.js
1540
1540
  var require_binary = __commonJS({
1541
- "node_modules/cmd-ts/dist/cjs/binary.js"(exports2) {
1541
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/binary.js"(exports2) {
1542
1542
  "use strict";
1543
1543
  Object.defineProperty(exports2, "__esModule", { value: true });
1544
1544
  exports2.binary = binary;
@@ -1559,7 +1559,7 @@ var require_binary = __commonJS({
1559
1559
  }
1560
1560
  });
1561
1561
 
1562
- // node_modules/strip-ansi/node_modules/ansi-regex/index.js
1562
+ // node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
1563
1563
  function ansiRegex({ onlyFirst = false } = {}) {
1564
1564
  const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
1565
1565
  const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
@@ -1568,12 +1568,12 @@ function ansiRegex({ onlyFirst = false } = {}) {
1568
1568
  return new RegExp(pattern, onlyFirst ? void 0 : "g");
1569
1569
  }
1570
1570
  var init_ansi_regex = __esm({
1571
- "node_modules/strip-ansi/node_modules/ansi-regex/index.js"() {
1571
+ "node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js"() {
1572
1572
  "use strict";
1573
1573
  }
1574
1574
  });
1575
1575
 
1576
- // node_modules/strip-ansi/index.js
1576
+ // node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.js
1577
1577
  var strip_ansi_exports = {};
1578
1578
  __export(strip_ansi_exports, {
1579
1579
  default: () => stripAnsi
@@ -1589,16 +1589,16 @@ function stripAnsi(string20) {
1589
1589
  }
1590
1590
  var regex;
1591
1591
  var init_strip_ansi = __esm({
1592
- "node_modules/strip-ansi/index.js"() {
1592
+ "node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.js"() {
1593
1593
  "use strict";
1594
1594
  init_ansi_regex();
1595
1595
  regex = ansiRegex();
1596
1596
  }
1597
1597
  });
1598
1598
 
1599
- // node_modules/cmd-ts/dist/cjs/utils.js
1599
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/utils.js
1600
1600
  var require_utils = __commonJS({
1601
- "node_modules/cmd-ts/dist/cjs/utils.js"(exports2) {
1601
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/utils.js"(exports2) {
1602
1602
  "use strict";
1603
1603
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
1604
1604
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -1656,9 +1656,9 @@ var require_utils = __commonJS({
1656
1656
  }
1657
1657
  });
1658
1658
 
1659
- // node_modules/cmd-ts/dist/cjs/command.js
1659
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/command.js
1660
1660
  var require_command = __commonJS({
1661
- "node_modules/cmd-ts/dist/cjs/command.js"(exports2) {
1661
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/command.js"(exports2) {
1662
1662
  "use strict";
1663
1663
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
1664
1664
  if (k2 === void 0) k2 = k;
@@ -1822,9 +1822,9 @@ var require_command = __commonJS({
1822
1822
  }
1823
1823
  });
1824
1824
 
1825
- // node_modules/cmd-ts/dist/cjs/option.js
1825
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/option.js
1826
1826
  var require_option = __commonJS({
1827
- "node_modules/cmd-ts/dist/cjs/option.js"(exports2) {
1827
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/option.js"(exports2) {
1828
1828
  "use strict";
1829
1829
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
1830
1830
  if (k2 === void 0) k2 = k;
@@ -2013,9 +2013,9 @@ var require_option = __commonJS({
2013
2013
  }
2014
2014
  });
2015
2015
 
2016
- // node_modules/cmd-ts/dist/cjs/errorBox.js
2016
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/errorBox.js
2017
2017
  var require_errorBox = __commonJS({
2018
- "node_modules/cmd-ts/dist/cjs/errorBox.js"(exports2) {
2018
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/errorBox.js"(exports2) {
2019
2019
  "use strict";
2020
2020
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
2021
2021
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -2107,9 +2107,9 @@ var require_errorBox = __commonJS({
2107
2107
  }
2108
2108
  });
2109
2109
 
2110
- // node_modules/ms/index.js
2110
+ // node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
2111
2111
  var require_ms = __commonJS({
2112
- "node_modules/ms/index.js"(exports2, module2) {
2112
+ "node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) {
2113
2113
  "use strict";
2114
2114
  var s = 1e3;
2115
2115
  var m = s * 60;
@@ -2224,9 +2224,9 @@ var require_ms = __commonJS({
2224
2224
  }
2225
2225
  });
2226
2226
 
2227
- // node_modules/debug/src/common.js
2227
+ // node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/common.js
2228
2228
  var require_common = __commonJS({
2229
- "node_modules/debug/src/common.js"(exports2, module2) {
2229
+ "node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/common.js"(exports2, module2) {
2230
2230
  "use strict";
2231
2231
  function setup(env2) {
2232
2232
  createDebug.debug = createDebug;
@@ -2402,9 +2402,9 @@ var require_common = __commonJS({
2402
2402
  }
2403
2403
  });
2404
2404
 
2405
- // node_modules/debug/src/browser.js
2405
+ // node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/browser.js
2406
2406
  var require_browser = __commonJS({
2407
- "node_modules/debug/src/browser.js"(exports2, module2) {
2407
+ "node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/browser.js"(exports2, module2) {
2408
2408
  "use strict";
2409
2409
  exports2.formatArgs = formatArgs;
2410
2410
  exports2.save = save;
@@ -2573,41 +2573,35 @@ var require_browser = __commonJS({
2573
2573
  }
2574
2574
  });
2575
2575
 
2576
- // node_modules/has-flag/index.js
2576
+ // node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js
2577
2577
  var require_has_flag = __commonJS({
2578
- "node_modules/has-flag/index.js"(exports2, module2) {
2578
+ "node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js"(exports2, module2) {
2579
2579
  "use strict";
2580
- module2.exports = (flag8, argv = process.argv) => {
2580
+ module2.exports = (flag8, argv) => {
2581
+ argv = argv || process.argv;
2581
2582
  const prefix = flag8.startsWith("-") ? "" : flag8.length === 1 ? "-" : "--";
2582
- const position = argv.indexOf(prefix + flag8);
2583
- const terminatorPosition = argv.indexOf("--");
2584
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
2583
+ const pos = argv.indexOf(prefix + flag8);
2584
+ const terminatorPos = argv.indexOf("--");
2585
+ return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
2585
2586
  };
2586
2587
  }
2587
2588
  });
2588
2589
 
2589
- // node_modules/supports-color/index.js
2590
+ // node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js
2590
2591
  var require_supports_color = __commonJS({
2591
- "node_modules/supports-color/index.js"(exports2, module2) {
2592
+ "node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js"(exports2, module2) {
2592
2593
  "use strict";
2593
2594
  var os6 = require("os");
2594
- var tty2 = require("tty");
2595
2595
  var hasFlag2 = require_has_flag();
2596
- var { env: env2 } = process;
2596
+ var env2 = process.env;
2597
2597
  var forceColor;
2598
- if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
2599
- forceColor = 0;
2598
+ if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false")) {
2599
+ forceColor = false;
2600
2600
  } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
2601
- forceColor = 1;
2601
+ forceColor = true;
2602
2602
  }
2603
2603
  if ("FORCE_COLOR" in env2) {
2604
- if (env2.FORCE_COLOR === "true") {
2605
- forceColor = 1;
2606
- } else if (env2.FORCE_COLOR === "false") {
2607
- forceColor = 0;
2608
- } else {
2609
- forceColor = env2.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env2.FORCE_COLOR, 10), 3);
2610
- }
2604
+ forceColor = env2.FORCE_COLOR.length === 0 || parseInt(env2.FORCE_COLOR, 10) !== 0;
2611
2605
  }
2612
2606
  function translateLevel2(level) {
2613
2607
  if (level === 0) {
@@ -2620,8 +2614,8 @@ var require_supports_color = __commonJS({
2620
2614
  has16m: level >= 3
2621
2615
  };
2622
2616
  }
2623
- function supportsColor2(haveStream, streamIsTTY) {
2624
- if (forceColor === 0) {
2617
+ function supportsColor2(stream) {
2618
+ if (forceColor === false) {
2625
2619
  return 0;
2626
2620
  }
2627
2621
  if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
@@ -2630,22 +2624,19 @@ var require_supports_color = __commonJS({
2630
2624
  if (hasFlag2("color=256")) {
2631
2625
  return 2;
2632
2626
  }
2633
- if (haveStream && !streamIsTTY && forceColor === void 0) {
2627
+ if (stream && !stream.isTTY && forceColor !== true) {
2634
2628
  return 0;
2635
2629
  }
2636
- const min = forceColor || 0;
2637
- if (env2.TERM === "dumb") {
2638
- return min;
2639
- }
2630
+ const min = forceColor ? 1 : 0;
2640
2631
  if (process.platform === "win32") {
2641
2632
  const osRelease = os6.release().split(".");
2642
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
2633
+ if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
2643
2634
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
2644
2635
  }
2645
2636
  return 1;
2646
2637
  }
2647
2638
  if ("CI" in env2) {
2648
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
2639
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
2649
2640
  return 1;
2650
2641
  }
2651
2642
  return min;
@@ -2674,23 +2665,26 @@ var require_supports_color = __commonJS({
2674
2665
  if ("COLORTERM" in env2) {
2675
2666
  return 1;
2676
2667
  }
2668
+ if (env2.TERM === "dumb") {
2669
+ return min;
2670
+ }
2677
2671
  return min;
2678
2672
  }
2679
2673
  function getSupportLevel(stream) {
2680
- const level = supportsColor2(stream, stream && stream.isTTY);
2674
+ const level = supportsColor2(stream);
2681
2675
  return translateLevel2(level);
2682
2676
  }
2683
2677
  module2.exports = {
2684
2678
  supportsColor: getSupportLevel,
2685
- stdout: translateLevel2(supportsColor2(true, tty2.isatty(1))),
2686
- stderr: translateLevel2(supportsColor2(true, tty2.isatty(2)))
2679
+ stdout: getSupportLevel(process.stdout),
2680
+ stderr: getSupportLevel(process.stderr)
2687
2681
  };
2688
2682
  }
2689
2683
  });
2690
2684
 
2691
- // node_modules/debug/src/node.js
2685
+ // node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/node.js
2692
2686
  var require_node = __commonJS({
2693
- "node_modules/debug/src/node.js"(exports2, module2) {
2687
+ "node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/node.js"(exports2, module2) {
2694
2688
  "use strict";
2695
2689
  var tty2 = require("tty");
2696
2690
  var util = require("util");
@@ -2863,9 +2857,9 @@ var require_node = __commonJS({
2863
2857
  }
2864
2858
  });
2865
2859
 
2866
- // node_modules/debug/src/index.js
2860
+ // node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/index.js
2867
2861
  var require_src = __commonJS({
2868
- "node_modules/debug/src/index.js"(exports2, module2) {
2862
+ "node_modules/.pnpm/debug@4.4.3_supports-color@5.5.0/node_modules/debug/src/index.js"(exports2, module2) {
2869
2863
  "use strict";
2870
2864
  if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
2871
2865
  module2.exports = require_browser();
@@ -2875,9 +2869,9 @@ var require_src = __commonJS({
2875
2869
  }
2876
2870
  });
2877
2871
 
2878
- // node_modules/cmd-ts/dist/cjs/newparser/parser.js
2872
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/newparser/parser.js
2879
2873
  var require_parser = __commonJS({
2880
- "node_modules/cmd-ts/dist/cjs/newparser/parser.js"(exports2) {
2874
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/newparser/parser.js"(exports2) {
2881
2875
  "use strict";
2882
2876
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
2883
2877
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -3073,9 +3067,9 @@ var require_parser = __commonJS({
3073
3067
  }
3074
3068
  });
3075
3069
 
3076
- // node_modules/cmd-ts/dist/cjs/newparser/tokenizer.js
3070
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/newparser/tokenizer.js
3077
3071
  var require_tokenizer = __commonJS({
3078
- "node_modules/cmd-ts/dist/cjs/newparser/tokenizer.js"(exports2) {
3072
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/newparser/tokenizer.js"(exports2) {
3079
3073
  "use strict";
3080
3074
  Object.defineProperty(exports2, "__esModule", { value: true });
3081
3075
  exports2.tokenize = tokenize;
@@ -3108,9 +3102,9 @@ var require_tokenizer = __commonJS({
3108
3102
  }
3109
3103
  });
3110
3104
 
3111
- // node_modules/cmd-ts/dist/cjs/runner.js
3105
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/runner.js
3112
3106
  var require_runner = __commonJS({
3113
- "node_modules/cmd-ts/dist/cjs/runner.js"(exports2) {
3107
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/runner.js"(exports2) {
3114
3108
  "use strict";
3115
3109
  Object.defineProperty(exports2, "__esModule", { value: true });
3116
3110
  exports2.run = run2;
@@ -3179,9 +3173,9 @@ var require_runner = __commonJS({
3179
3173
  }
3180
3174
  });
3181
3175
 
3182
- // node_modules/cmd-ts/dist/cjs/restPositionals.js
3176
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/restPositionals.js
3183
3177
  var require_restPositionals = __commonJS({
3184
- "node_modules/cmd-ts/dist/cjs/restPositionals.js"(exports2) {
3178
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/restPositionals.js"(exports2) {
3185
3179
  "use strict";
3186
3180
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
3187
3181
  if (k2 === void 0) k2 = k;
@@ -3274,9 +3268,9 @@ var require_restPositionals = __commonJS({
3274
3268
  }
3275
3269
  });
3276
3270
 
3277
- // node_modules/cmd-ts/dist/cjs/multiflag.js
3271
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/multiflag.js
3278
3272
  var require_multiflag = __commonJS({
3279
- "node_modules/cmd-ts/dist/cjs/multiflag.js"(exports2) {
3273
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/multiflag.js"(exports2) {
3280
3274
  "use strict";
3281
3275
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
3282
3276
  if (k2 === void 0) k2 = k;
@@ -3385,9 +3379,9 @@ var require_multiflag = __commonJS({
3385
3379
  }
3386
3380
  });
3387
3381
 
3388
- // node_modules/cmd-ts/dist/cjs/multioption.js
3382
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/multioption.js
3389
3383
  var require_multioption = __commonJS({
3390
- "node_modules/cmd-ts/dist/cjs/multioption.js"(exports2) {
3384
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/multioption.js"(exports2) {
3391
3385
  "use strict";
3392
3386
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
3393
3387
  if (k2 === void 0) k2 = k;
@@ -3557,9 +3551,9 @@ var require_multioption = __commonJS({
3557
3551
  }
3558
3552
  });
3559
3553
 
3560
- // node_modules/cmd-ts/dist/cjs/union.js
3554
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/union.js
3561
3555
  var require_union = __commonJS({
3562
- "node_modules/cmd-ts/dist/cjs/union.js"(exports2) {
3556
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/union.js"(exports2) {
3563
3557
  "use strict";
3564
3558
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
3565
3559
  if (k2 === void 0) k2 = k;
@@ -3622,9 +3616,9 @@ var require_union = __commonJS({
3622
3616
  }
3623
3617
  });
3624
3618
 
3625
- // node_modules/cmd-ts/dist/cjs/oneOf.js
3619
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/oneOf.js
3626
3620
  var require_oneOf = __commonJS({
3627
- "node_modules/cmd-ts/dist/cjs/oneOf.js"(exports2) {
3621
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/oneOf.js"(exports2) {
3628
3622
  "use strict";
3629
3623
  Object.defineProperty(exports2, "__esModule", { value: true });
3630
3624
  exports2.oneOf = oneOf;
@@ -3645,9 +3639,9 @@ var require_oneOf = __commonJS({
3645
3639
  }
3646
3640
  });
3647
3641
 
3648
- // node_modules/cmd-ts/dist/cjs/rest.js
3642
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/rest.js
3649
3643
  var require_rest = __commonJS({
3650
- "node_modules/cmd-ts/dist/cjs/rest.js"(exports2) {
3644
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/rest.js"(exports2) {
3651
3645
  "use strict";
3652
3646
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
3653
3647
  if (k2 === void 0) k2 = k;
@@ -3759,9 +3753,9 @@ var require_rest = __commonJS({
3759
3753
  }
3760
3754
  });
3761
3755
 
3762
- // node_modules/cmd-ts/dist/cjs/index.js
3756
+ // node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/index.js
3763
3757
  var require_cjs = __commonJS({
3764
- "node_modules/cmd-ts/dist/cjs/index.js"(exports2) {
3758
+ "node_modules/.pnpm/cmd-ts@0.14.3/node_modules/cmd-ts/dist/cjs/index.js"(exports2) {
3765
3759
  "use strict";
3766
3760
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
3767
3761
  if (k2 === void 0) k2 = k;
@@ -3855,7 +3849,7 @@ var require_package = __commonJS({
3855
3849
  "apps/cli/package.json"(exports2, module2) {
3856
3850
  module2.exports = {
3857
3851
  name: "@packmind/cli",
3858
- version: "0.30.0",
3852
+ version: "0.30.1",
3859
3853
  description: "A command-line interface for Packmind linting and code quality checks",
3860
3854
  private: false,
3861
3855
  bin: {
@@ -3891,10 +3885,13 @@ var require_package = __commonJS({
3891
3885
  },
3892
3886
  dependencies: {
3893
3887
  "@types/inquirer": "^9.0.9",
3888
+ dotenv: "^16",
3894
3889
  inquirer: "^13.0.2",
3895
- zod: "^4.3.5",
3890
+ minimatch: "^10",
3896
3891
  semver: "^7.7.4",
3897
- which: "^4.0.0"
3892
+ undici: "^7",
3893
+ which: "^4.0.0",
3894
+ zod: "^4.3.5"
3898
3895
  },
3899
3896
  devDependencies: {
3900
3897
  "@types/which": "^3.0.4"
@@ -4465,6 +4462,13 @@ var DeploymentCompletedEvent = class extends UserEvent {
4465
4462
  }
4466
4463
  };
4467
4464
 
4465
+ // packages/types/src/deployments/events/PackagesDeletedEvent.ts
4466
+ var PackagesDeletedEvent = class extends UserEvent {
4467
+ static {
4468
+ this.eventName = "deployments.packages.deleted";
4469
+ }
4470
+ };
4471
+
4468
4472
  // packages/types/src/deployments/events/PluginDeletedEvent.ts
4469
4473
  var PluginDeletedEvent = class extends UserEvent {
4470
4474
  static {
@@ -4488,6 +4492,9 @@ var createGitCommitId = brandedIdFactory();
4488
4492
  // packages/types/src/git/GitProvider.ts
4489
4493
  var createGitProviderId = brandedIdFactory();
4490
4494
 
4495
+ // packages/types/src/git/OrganizationGitHubApp.ts
4496
+ var createOrganizationGitHubAppId = brandedIdFactory();
4497
+
4491
4498
  // packages/types/src/spaces/SpaceId.ts
4492
4499
  var createSpaceId = brandedIdFactory();
4493
4500
 
@@ -12453,6 +12460,7 @@ var ListSkillsUseCase = class {
12453
12460
  spaceId: command34.spaceId
12454
12461
  });
12455
12462
  return skills.map((s) => ({
12463
+ id: s.id,
12456
12464
  slug: s.slug,
12457
12465
  name: s.name,
12458
12466
  description: s.description,
@@ -12464,6 +12472,7 @@ var ListSkillsUseCase = class {
12464
12472
  spaces.map(
12465
12473
  (space) => this.packmindGateway.skills.list({ spaceId: createSpaceId(space.id) }).then(
12466
12474
  (skills) => skills.map((s) => ({
12475
+ id: s.id,
12467
12476
  slug: s.slug,
12468
12477
  name: s.name,
12469
12478
  description: s.description,
@@ -12689,6 +12698,55 @@ ${spaceList}`
12689
12698
  }
12690
12699
  };
12691
12700
 
12701
+ // apps/cli/src/infra/utils/deployedFilesUtils.ts
12702
+ function lockFileToArtifactVersionEntries(lockFile) {
12703
+ return Object.values(lockFile.artifacts).map((entry) => ({
12704
+ name: entry.name,
12705
+ type: entry.type,
12706
+ id: entry.id,
12707
+ version: entry.version,
12708
+ spaceId: entry.spaceId
12709
+ }));
12710
+ }
12711
+ function resolveDeployedRenderAgents(lockFile) {
12712
+ const agents = new Set(lockFile.agents ?? []);
12713
+ for (const entry of Object.values(lockFile.artifacts)) {
12714
+ for (const file of entry.files) {
12715
+ agents.add(file.agent);
12716
+ }
12717
+ }
12718
+ return [...agents];
12719
+ }
12720
+ async function fetchDeployedFiles(gateway, lockFile, options = {}) {
12721
+ try {
12722
+ const artifacts = lockFileToArtifactVersionEntries(lockFile);
12723
+ const response = await gateway.deployment.getContentByVersions({
12724
+ artifacts,
12725
+ agents: resolveDeployedRenderAgents(lockFile)
12726
+ });
12727
+ return remapDeployedFilesForHomeInstall(
12728
+ response.fileUpdates.createOrUpdate,
12729
+ options.projectDir
12730
+ );
12731
+ } catch {
12732
+ return [];
12733
+ }
12734
+ }
12735
+ function remapDeployedFilesForHomeInstall(files, projectDir) {
12736
+ if (!projectDir) return files;
12737
+ const homeAgent = isAgentHomeDirectory(projectDir);
12738
+ if (!homeAgent) return files;
12739
+ const prefix = getAgentHomeDirPrefix(homeAgent);
12740
+ if (!prefix) return files;
12741
+ return files.filter((file) => !file.path.startsWith(".packmind/")).map((file) => {
12742
+ const remapped = file.path.startsWith(prefix) ? { ...file, path: file.path.slice(prefix.length) } : { ...file };
12743
+ if (remapped.content !== void 0) {
12744
+ remapped.content = stripFullStandardLinkFooter(remapped.content);
12745
+ }
12746
+ return remapped;
12747
+ });
12748
+ }
12749
+
12692
12750
  // apps/cli/src/application/useCases/diffStrategies/CommandDiffStrategy.ts
12693
12751
  var import_diff2 = require("diff");
12694
12752
  var fs15 = __toESM(require("fs/promises"));
@@ -13641,7 +13699,7 @@ var DiffArtefactsUseCase = class {
13641
13699
  try {
13642
13700
  const response = await this.packmindGateway.deployment.getContentByVersions({
13643
13701
  artifacts: Object.values(lockFile.artifacts),
13644
- agents: lockFile.agents
13702
+ agents: resolveDeployedRenderAgents(lockFile)
13645
13703
  });
13646
13704
  return {
13647
13705
  ...response,
@@ -18387,7 +18445,6 @@ var PlaybookLocalRepository = class {
18387
18445
  var fs26 = __toESM(require("fs"));
18388
18446
  var path29 = __toESM(require("path"));
18389
18447
  var yaml2 = __toESM(require("yaml"));
18390
- var import_slug4 = __toESM(require("slug"));
18391
18448
 
18392
18449
  // apps/cli/src/application/utils/parseCommandFile.ts
18393
18450
  var path26 = __toESM(require("path"));
@@ -18755,16 +18812,16 @@ var SkillFileSchema = new import_typeorm4.EntitySchema({
18755
18812
  ]
18756
18813
  });
18757
18814
 
18758
- // packages/skills/src/application/useCases/createSkill/createSkill.usecase.ts
18815
+ // packages/skills/src/application/useCases/createSkill/CreateSkillUseCase.ts
18759
18816
  var import_slug = __toESM(require("slug"));
18760
18817
 
18761
- // packages/skills/src/application/useCases/saveSkillVersion/saveSkillVersion.usecase.ts
18818
+ // packages/skills/src/application/useCases/saveSkillVersion/SaveSkillVersionUseCase.ts
18762
18819
  var import_uuid = require("uuid");
18763
18820
 
18764
- // packages/skills/src/application/useCases/updateSkill/updateSkill.usecase.ts
18821
+ // packages/skills/src/application/useCases/updateSkill/UpdateSkillUseCase.ts
18765
18822
  var import_slug2 = __toESM(require("slug"));
18766
18823
 
18767
- // packages/skills/src/application/useCases/uploadSkill/uploadSkill.usecase.ts
18824
+ // packages/skills/src/application/useCases/uploadSkill/UploadSkillUseCase.ts
18768
18825
  var import_slug3 = __toESM(require("slug"));
18769
18826
  var import_uuid2 = require("uuid");
18770
18827
 
@@ -18929,44 +18986,72 @@ function findLockFileEntryAndFileForPath(normalizedFilePath, artifacts) {
18929
18986
  return void 0;
18930
18987
  }
18931
18988
 
18932
- // apps/cli/src/infra/utils/deployedFilesUtils.ts
18933
- function lockFileToArtifactVersionEntries(lockFile) {
18934
- return Object.values(lockFile.artifacts).map((entry) => ({
18935
- name: entry.name,
18936
- type: entry.type,
18937
- id: entry.id,
18938
- version: entry.version,
18939
- spaceId: entry.spaceId
18940
- }));
18989
+ // apps/cli/src/infra/commands/playbook/add/linkExistingArtifact.ts
18990
+ var import_slug4 = __toESM(require("slug"));
18991
+ async function resolveExistingArtifact(packmindCliHexa, artifactType, spaceId, artifactName) {
18992
+ const artifacts = await listArtifactsForSpace(
18993
+ packmindCliHexa,
18994
+ artifactType,
18995
+ spaceId
18996
+ );
18997
+ const match = artifacts.find((a) => (0, import_slug4.default)(a.name) === (0, import_slug4.default)(artifactName));
18998
+ return match ? { id: match.id, name: match.name } : null;
18941
18999
  }
18942
- async function fetchDeployedFiles(gateway, lockFile, options = {}) {
18943
- try {
18944
- const artifacts = lockFileToArtifactVersionEntries(lockFile);
18945
- const response = await gateway.deployment.getContentByVersions({
18946
- artifacts,
18947
- agents: lockFile.agents
18948
- });
18949
- return remapDeployedFilesForHomeInstall(
18950
- response.fileUpdates.createOrUpdate,
18951
- options.projectDir
18952
- );
18953
- } catch {
18954
- return [];
19000
+ async function listArtifactsForSpace(packmindCliHexa, artifactType, spaceId) {
19001
+ switch (artifactType) {
19002
+ case "skill": {
19003
+ const skills = await packmindCliHexa.listSkills({
19004
+ spaceId
19005
+ });
19006
+ return skills.map((s) => ({ id: s.id, name: s.name }));
19007
+ }
19008
+ case "command": {
19009
+ const commands = await packmindCliHexa.listCommands({
19010
+ spaceId
19011
+ });
19012
+ return commands.map((c) => ({ id: c.id, name: c.name }));
19013
+ }
19014
+ case "standard": {
19015
+ const standards = await packmindCliHexa.listStandards({
19016
+ spaceId
19017
+ });
19018
+ return standards.map((s) => ({ id: s.id, name: s.name }));
19019
+ }
18955
19020
  }
18956
19021
  }
18957
- function remapDeployedFilesForHomeInstall(files, projectDir) {
18958
- if (!projectDir) return files;
18959
- const homeAgent = isAgentHomeDirectory(projectDir);
18960
- if (!homeAgent) return files;
18961
- const prefix = getAgentHomeDirPrefix(homeAgent);
18962
- if (!prefix) return files;
18963
- return files.filter((file) => !file.path.startsWith(".packmind/")).map((file) => {
18964
- const remapped = file.path.startsWith(prefix) ? { ...file, path: file.path.slice(prefix.length) } : { ...file };
18965
- if (remapped.content !== void 0) {
18966
- remapped.content = stripFullStandardLinkFooter(remapped.content);
18967
- }
18968
- return remapped;
18969
- });
19022
+ function adoptArtifactIntoLockFile({
19023
+ lockFile,
19024
+ artifact,
19025
+ relativeFilePath,
19026
+ agent
19027
+ }) {
19028
+ const base = lockFile ?? {
19029
+ lockfileVersion: 2,
19030
+ packageSlugs: [],
19031
+ agents: [],
19032
+ artifacts: {}
19033
+ };
19034
+ const key = `user:${artifact.type}:${(0, import_slug4.default)(artifact.name)}`;
19035
+ const existing = base.artifacts[key];
19036
+ const normalized = normalizePath2(relativeFilePath);
19037
+ const files = existing ? [...existing.files] : [];
19038
+ if (!files.some((f) => normalizePath2(f.path) === normalized)) {
19039
+ files.push({ path: relativeFilePath, agent });
19040
+ }
19041
+ const entry = {
19042
+ name: artifact.name,
19043
+ type: artifact.type,
19044
+ id: artifact.id,
19045
+ version: artifact.version,
19046
+ spaceId: artifact.spaceId,
19047
+ packageIds: existing?.packageIds ?? [],
19048
+ source: "user",
19049
+ files
19050
+ };
19051
+ return {
19052
+ ...base,
19053
+ artifacts: { ...base.artifacts, [key]: entry }
19054
+ };
18970
19055
  }
18971
19056
 
18972
19057
  // apps/cli/src/infra/commands/playbook/addHandler.ts
@@ -19061,6 +19146,7 @@ async function playbookAddHandler(deps) {
19061
19146
  packmindCliHexa
19062
19147
  );
19063
19148
  const earlyLockFile = earlyTargetDir ? await lockFileRepository.read(earlyTargetDir) : null;
19149
+ let activeLockFile = earlyLockFile;
19064
19150
  if (earlyLockFile && earlyTargetDir) {
19065
19151
  const normalizedForLookup = normalizePath2(
19066
19152
  path29.relative(earlyTargetDir, absolutePath)
@@ -19260,6 +19346,14 @@ Example: packmind-cli playbook add --space ${allSpaces[0].slug} <path>`
19260
19346
  changeType = "updated";
19261
19347
  }
19262
19348
  }
19349
+ if (changeType === "created" && earlyLockFile && earlyLockFile.agents.length > 0 && !earlyLockFile.agents.includes(codingAgent)) {
19350
+ logErrorConsole(
19351
+ `Cannot add this ${artifactType}: it is rendered for the "${codingAgent}" agent, which is not in your configured agents (${earlyLockFile.agents.join(", ")}).
19352
+ This file is no longer managed by Packmind. Re-add "${codingAgent}" to your agents and run ${formatLabel("packmind-cli install")} to manage it again, or delete the file if it is no longer needed.`
19353
+ );
19354
+ exit(1);
19355
+ return;
19356
+ }
19263
19357
  if (changeType === "updated" && existingLockEntry) {
19264
19358
  try {
19265
19359
  const packmindGateway = packmindCliHexa.getPackmindGateway();
@@ -19284,22 +19378,14 @@ Run ${formatLabel("packmind-cli install")} to update before making changes.`
19284
19378
  }
19285
19379
  }
19286
19380
  if (changeType === "created") {
19381
+ let existingArtifact;
19287
19382
  try {
19288
- const existingNames = await listExistingArtifactNames(
19383
+ existingArtifact = await resolveExistingArtifact(
19289
19384
  packmindCliHexa,
19290
19385
  artifactType,
19291
- spaceId
19292
- );
19293
- const nameExists = existingNames.some(
19294
- (name) => (0, import_slug4.default)(name) === (0, import_slug4.default)(artifactName)
19386
+ spaceId,
19387
+ artifactName
19295
19388
  );
19296
- if (nameExists) {
19297
- logErrorConsole(
19298
- `A ${artifactType} named "${artifactName}" already exists in Packmind.`
19299
- );
19300
- exit(1);
19301
- return;
19302
- }
19303
19389
  } catch (err) {
19304
19390
  const errorMessage = err instanceof Error ? err.message : String(err);
19305
19391
  logErrorConsole(
@@ -19308,11 +19394,47 @@ Run ${formatLabel("packmind-cli install")} to update before making changes.`
19308
19394
  exit(1);
19309
19395
  return;
19310
19396
  }
19397
+ if (existingArtifact) {
19398
+ let remoteVersion;
19399
+ try {
19400
+ const packmindGateway = packmindCliHexa.getPackmindGateway();
19401
+ ({ version: remoteVersion } = await packmindGateway.deployment.getLatestVersion(
19402
+ artifactType,
19403
+ existingArtifact.id,
19404
+ spaceId
19405
+ ));
19406
+ } catch (err) {
19407
+ const errorMessage = err instanceof Error ? err.message : String(err);
19408
+ logErrorConsole(
19409
+ `Failed to link "${existingArtifact.name}" to the existing ${artifactType}: ${errorMessage}`
19410
+ );
19411
+ exit(1);
19412
+ return;
19413
+ }
19414
+ const adoptedFilePath = artifactType === "skill" ? `${normalizedFilePath}/SKILL.md` : normalizedFilePath;
19415
+ activeLockFile = adoptArtifactIntoLockFile({
19416
+ lockFile: activeLockFile,
19417
+ artifact: {
19418
+ id: existingArtifact.id,
19419
+ name: existingArtifact.name,
19420
+ type: artifactType,
19421
+ version: remoteVersion,
19422
+ spaceId
19423
+ },
19424
+ relativeFilePath: adoptedFilePath,
19425
+ agent: codingAgent
19426
+ });
19427
+ await lockFileRepository.write(targetDir, activeLockFile);
19428
+ changeType = "updated";
19429
+ logInfoConsole(
19430
+ `Linked "${existingArtifact.name}" to existing ${artifactType} (v${remoteVersion})${spaceName ? ` in space "${spaceName}"` : ""} \u2014 staged as update.`
19431
+ );
19432
+ }
19311
19433
  }
19312
- if (changeType === "updated" && earlyLockFile) {
19434
+ if (changeType === "updated" && activeLockFile) {
19313
19435
  const deployedFiles = await fetchDeployedFiles(
19314
19436
  packmindCliHexa.getPackmindGateway(),
19315
- earlyLockFile,
19437
+ activeLockFile,
19316
19438
  { projectDir: targetDir }
19317
19439
  );
19318
19440
  if (artifactType === "skill") {
@@ -19363,28 +19485,6 @@ Run ${formatLabel("packmind-cli install")} to update before making changes.`
19363
19485
  );
19364
19486
  exit(0);
19365
19487
  }
19366
- async function listExistingArtifactNames(packmindCliHexa, artifactType, spaceId) {
19367
- switch (artifactType) {
19368
- case "skill": {
19369
- const skills = await packmindCliHexa.listSkills({
19370
- spaceId
19371
- });
19372
- return skills.map((s) => s.name);
19373
- }
19374
- case "command": {
19375
- const commands = await packmindCliHexa.listCommands({
19376
- spaceId
19377
- });
19378
- return commands.map((c) => c.name);
19379
- }
19380
- case "standard": {
19381
- const standards = await packmindCliHexa.listStandards({
19382
- spaceId
19383
- });
19384
- return standards.map((s) => s.name);
19385
- }
19386
- }
19387
- }
19388
19488
  function formatSpaceList(spaces) {
19389
19489
  const maxSlugLength = Math.max(...spaces.map((s) => s.slug.length));
19390
19490
  return spaces.map((s) => ` ${s.slug.padEnd(maxSlugLength)} (${s.name})`).join("\n");
@@ -20463,7 +20563,7 @@ function buildUpdatedCommandProposals(entry, artifactId, deployedContent) {
20463
20563
  }));
20464
20564
  }
20465
20565
  function buildUpdatedSkillProposals(entry, artifactId, deployedFiles) {
20466
- if (!artifactId) return [];
20566
+ if (!artifactId) return { proposals: [], skippedReason: null };
20467
20567
  const proposals = [];
20468
20568
  const base = {
20469
20569
  artefactId: artifactId,
@@ -20477,7 +20577,10 @@ function buildUpdatedSkillProposals(entry, artifactId, deployedFiles) {
20477
20577
  logWarningConsole(
20478
20578
  `Skipping "${entry.artifactName}" \u2014 failed to parse local skill content.`
20479
20579
  );
20480
- return [];
20580
+ return {
20581
+ proposals: [],
20582
+ skippedReason: "failed to parse local skill content"
20583
+ };
20481
20584
  }
20482
20585
  const normalizedEntryPath = normalizePath2(entry.filePath);
20483
20586
  const skillMdFile = deployedFiles.find((f) => {
@@ -20506,7 +20609,10 @@ function buildUpdatedSkillProposals(entry, artifactId, deployedFiles) {
20506
20609
  logWarningConsole(
20507
20610
  `Skipping "${entry.artifactName}" \u2014 deployed SKILL.md content not found.`
20508
20611
  );
20509
- return [];
20612
+ return {
20613
+ proposals: [],
20614
+ skippedReason: "deployed SKILL.md content not found"
20615
+ };
20510
20616
  }
20511
20617
  const deployedHelperFiles = deployedFiles.filter((f) => {
20512
20618
  const normalized = normalizePath2(f.path);
@@ -20580,7 +20686,7 @@ function buildUpdatedSkillProposals(entry, artifactId, deployedFiles) {
20580
20686
  });
20581
20687
  }
20582
20688
  }
20583
- return proposals;
20689
+ return { proposals, skippedReason: null };
20584
20690
  }
20585
20691
  function buildRemovedProposals(entry, artifactId, lockFile) {
20586
20692
  const typeMap = {
@@ -20607,8 +20713,18 @@ function findDeployedContentForPath(filePath, deployedFiles) {
20607
20713
  const match = deployedFiles.find((f) => normalizePath2(f.path) === normalized);
20608
20714
  return match?.content ?? null;
20609
20715
  }
20716
+ function toSkippedEntry(entry, reason) {
20717
+ return {
20718
+ artifactName: entry.artifactName,
20719
+ artifactType: entry.artifactType,
20720
+ filePath: entry.filePath,
20721
+ spaceId: entry.spaceId,
20722
+ reason
20723
+ };
20724
+ }
20610
20725
  async function buildProposals(changes, getTargetContext) {
20611
20726
  const proposals = [];
20727
+ const skipped = [];
20612
20728
  const updateSources = /* @__PURE__ */ new Map();
20613
20729
  for (const entry of changes) {
20614
20730
  const ctx = await getTargetContext(entry);
@@ -20636,6 +20752,7 @@ async function buildProposals(changes, getTargetContext) {
20636
20752
  logWarningConsole(
20637
20753
  `Skipping "${entry.artifactName}" \u2014 artifact not found in lock file.`
20638
20754
  );
20755
+ skipped.push(toSkippedEntry(entry, "artifact not found in lock file"));
20639
20756
  continue;
20640
20757
  }
20641
20758
  proposals.push(...buildRemovedProposals(entry, artifactId, ctx.lockFile));
@@ -20648,6 +20765,7 @@ async function buildProposals(changes, getTargetContext) {
20648
20765
  logWarningConsole(
20649
20766
  `Skipping "${entry.artifactName}" \u2014 artifact not found in lock file. Try running a deploy first.`
20650
20767
  );
20768
+ skipped.push(toSkippedEntry(entry, "artifact not found in lock file"));
20651
20769
  continue;
20652
20770
  }
20653
20771
  const existing = updateSources.get(artifactId);
@@ -20673,6 +20791,7 @@ async function buildProposals(changes, getTargetContext) {
20673
20791
  logWarningConsole(
20674
20792
  `Skipping "${entry.artifactName}" \u2014 deployed content unavailable. Run \`packmind pull\` to sync before submitting updates.`
20675
20793
  );
20794
+ skipped.push(toSkippedEntry(entry, "deployed content unavailable"));
20676
20795
  continue;
20677
20796
  }
20678
20797
  switch (entry.artifactType) {
@@ -20690,11 +20809,18 @@ async function buildProposals(changes, getTargetContext) {
20690
20809
  ...buildUpdatedCommandProposals(entry, artifactId, deployedContent)
20691
20810
  );
20692
20811
  break;
20693
- case "skill":
20694
- proposals.push(
20695
- ...buildUpdatedSkillProposals(entry, artifactId, ctx.deployedFiles)
20812
+ case "skill": {
20813
+ const skillResult = buildUpdatedSkillProposals(
20814
+ entry,
20815
+ artifactId,
20816
+ ctx.deployedFiles
20696
20817
  );
20818
+ proposals.push(...skillResult.proposals);
20819
+ if (skillResult.skippedReason) {
20820
+ skipped.push(toSkippedEntry(entry, skillResult.skippedReason));
20821
+ }
20697
20822
  break;
20823
+ }
20698
20824
  }
20699
20825
  }
20700
20826
  }
@@ -20704,7 +20830,7 @@ async function buildProposals(changes, getTargetContext) {
20704
20830
  conflicts.push(source);
20705
20831
  }
20706
20832
  }
20707
- return { proposals, conflicts };
20833
+ return { proposals, conflicts, skipped };
20708
20834
  }
20709
20835
 
20710
20836
  // apps/cli/src/infra/commands/playbook/submit/skillDescriptionValidator.ts
@@ -20894,10 +21020,11 @@ async function playbookSubmitHandler(deps) {
20894
21020
  cwd,
20895
21021
  packmindCliHexa
20896
21022
  });
20897
- const { proposals: allProposals, conflicts } = await buildProposals(
20898
- changes,
20899
- resolver.getTargetContext
20900
- );
21023
+ const {
21024
+ proposals: allProposals,
21025
+ conflicts,
21026
+ skipped
21027
+ } = await buildProposals(changes, resolver.getTargetContext);
20901
21028
  const descriptionErrors = validateProposalSkillDescriptions(allProposals);
20902
21029
  if (descriptionErrors.length > 0) {
20903
21030
  for (const error of descriptionErrors) {
@@ -20919,6 +21046,24 @@ Only one agent version can be submitted at a time. Use "playbook unstage" to rem
20919
21046
  exit(1);
20920
21047
  return;
20921
21048
  }
21049
+ if (skipped.length > 0) {
21050
+ for (const entry of skipped) {
21051
+ logErrorConsole(
21052
+ `Could not prepare ${capitalize(entry.artifactType)} "${entry.artifactName}" (${entry.filePath}): ${entry.reason}.`
21053
+ );
21054
+ }
21055
+ const readyCount = allProposals.length;
21056
+ if (readyCount > 0) {
21057
+ logWarningConsole(
21058
+ `${readyCount} other change${readyCount !== 1 ? "s were" : " was"} ready but nothing was submitted \u2014 the whole batch is blocked.`
21059
+ );
21060
+ }
21061
+ logInfoConsole(
21062
+ "Your staged changes were kept. Fix the issue above (for stale deployed content, run `packmind pull` to sync), or drop the affected change with `packmind playbook unstage <path>`, then retry."
21063
+ );
21064
+ exit(1);
21065
+ return;
21066
+ }
20922
21067
  if (allProposals.length === 0) {
20923
21068
  logConsole(
20924
21069
  "Nothing to submit \u2014 no changes detected compared to deployed versions."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@packmind/cli",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "description": "A command-line interface for Packmind linting and code quality checks",
5
5
  "private": false,
6
6
  "bin": {
@@ -47,16 +47,18 @@
47
47
  "axios": "1.16.1",
48
48
  "bcrypt": "6.0.0",
49
49
  "bullmq": "5.77.6",
50
+ "class-transformer": "0.5.1",
51
+ "class-validator": "0.14.4",
50
52
  "diff": "8.0.4",
51
- "dotenv": "16.4.7",
53
+ "dotenv": "^16",
52
54
  "express": "5.2.1",
53
55
  "inquirer": "^13.0.2",
54
56
  "log-update": "8.0.0",
55
- "minimatch": "10.2.5",
57
+ "minimatch": "^10",
56
58
  "open": "11.0.0",
57
59
  "semver": "^7.7.4",
58
60
  "slug": "11.0.1",
59
- "undici": "7.24.7",
61
+ "undici": "^7",
60
62
  "uuid": "11.1.1",
61
63
  "validator": "13.15.35",
62
64
  "web-tree-sitter": "0.25.10",
@@ -65,5 +67,6 @@
65
67
  "yaml": "2.9.0",
66
68
  "zod": "^4.3.5"
67
69
  },
70
+ "packageManager": "pnpm@11.5.0",
68
71
  "type": "commonjs"
69
72
  }