@packmind/cli 0.16.0 → 0.16.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 +280 -176
  2. package/package.json +2 -2
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(string10, substring, replacer) {
375
- let index = string10.indexOf(substring);
374
+ function stringReplaceAll(string11, substring, replacer) {
375
+ let index = string11.indexOf(substring);
376
376
  if (index === -1) {
377
- return string10;
377
+ return string11;
378
378
  }
379
379
  const substringLength = substring.length;
380
380
  let endIndex = 0;
381
381
  let returnValue = "";
382
382
  do {
383
- returnValue += string10.slice(endIndex, index) + substring + replacer;
383
+ returnValue += string11.slice(endIndex, index) + substring + replacer;
384
384
  endIndex = index + substringLength;
385
- index = string10.indexOf(substring, endIndex);
385
+ index = string11.indexOf(substring, endIndex);
386
386
  } while (index !== -1);
387
- returnValue += string10.slice(endIndex);
387
+ returnValue += string11.slice(endIndex);
388
388
  return returnValue;
389
389
  }
390
- function stringEncaseCRLFWithFirstIndex(string10, prefix, postfix, index) {
390
+ function stringEncaseCRLFWithFirstIndex(string11, prefix, postfix, index) {
391
391
  let endIndex = 0;
392
392
  let returnValue = "";
393
393
  do {
394
- const gotCR = string10[index - 1] === "\r";
395
- returnValue += string10.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
394
+ const gotCR = string11[index - 1] === "\r";
395
+ returnValue += string11.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
396
396
  endIndex = index + 1;
397
- index = string10.indexOf("\n", endIndex);
397
+ index = string11.indexOf("\n", endIndex);
398
398
  } while (index !== -1);
399
- returnValue += string10.slice(endIndex);
399
+ returnValue += string11.slice(endIndex);
400
400
  return returnValue;
401
401
  }
402
402
  var init_utilities = __esm({
@@ -555,26 +555,26 @@ var init_source = __esm({
555
555
  builder[IS_EMPTY] = _isEmpty;
556
556
  return builder;
557
557
  };
558
- applyStyle = (self, string10) => {
559
- if (self.level <= 0 || !string10) {
560
- return self[IS_EMPTY] ? "" : string10;
558
+ applyStyle = (self, string11) => {
559
+ if (self.level <= 0 || !string11) {
560
+ return self[IS_EMPTY] ? "" : string11;
561
561
  }
562
562
  let styler = self[STYLER];
563
563
  if (styler === void 0) {
564
- return string10;
564
+ return string11;
565
565
  }
566
566
  const { openAll, closeAll } = styler;
567
- if (string10.includes("\x1B")) {
567
+ if (string11.includes("\x1B")) {
568
568
  while (styler !== void 0) {
569
- string10 = stringReplaceAll(string10, styler.close, styler.open);
569
+ string11 = stringReplaceAll(string11, styler.close, styler.open);
570
570
  styler = styler.parent;
571
571
  }
572
572
  }
573
- const lfIndex = string10.indexOf("\n");
573
+ const lfIndex = string11.indexOf("\n");
574
574
  if (lfIndex !== -1) {
575
- string10 = stringEncaseCRLFWithFirstIndex(string10, closeAll, openAll, lfIndex);
575
+ string11 = stringEncaseCRLFWithFirstIndex(string11, closeAll, openAll, lfIndex);
576
576
  }
577
- return openAll + string10 + closeAll;
577
+ return openAll + string11 + closeAll;
578
578
  };
579
579
  Object.defineProperties(createChalk.prototype, styles2);
580
580
  chalk = createChalk();
@@ -767,9 +767,9 @@ var require_findOption = __commonJS({
767
767
  continue;
768
768
  }
769
769
  if (node.type === "shortOptions" && opts.shortNames.length) {
770
- for (const option6 of node.options) {
771
- if (opts.shortNames.includes(option6.key)) {
772
- result.push(option6);
770
+ for (const option7 of node.options) {
771
+ if (opts.shortNames.includes(option7.key)) {
772
+ result.push(option7);
773
773
  }
774
774
  }
775
775
  }
@@ -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 = optional4;
845
+ exports2.optional = optional5;
846
846
  exports2.array = array3;
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 optional4(t) {
872
+ function optional5(t) {
873
873
  return {
874
874
  ...t,
875
875
  defaultValue() {
@@ -1403,9 +1403,9 @@ var require_subcommands = __commonJS({
1403
1403
  let errorMessage = "Not a valid subcommand name";
1404
1404
  const closeOptions = (0, didyoumean_1.default)(str, flatMap(commands, (x) => x.names));
1405
1405
  if (closeOptions) {
1406
- const option6 = Array.isArray(closeOptions) ? closeOptions[0] : closeOptions;
1406
+ const option7 = Array.isArray(closeOptions) ? closeOptions[0] : closeOptions;
1407
1407
  errorMessage += `
1408
- Did you mean ${chalk_1.default.italic(option6)}?`;
1408
+ Did you mean ${chalk_1.default.italic(option7)}?`;
1409
1409
  }
1410
1410
  throw new Error(errorMessage);
1411
1411
  }
@@ -1578,11 +1578,11 @@ var strip_ansi_exports = {};
1578
1578
  __export(strip_ansi_exports, {
1579
1579
  default: () => stripAnsi
1580
1580
  });
1581
- function stripAnsi(string10) {
1582
- if (typeof string10 !== "string") {
1583
- throw new TypeError(`Expected a \`string\`, got \`${typeof string10}\``);
1581
+ function stripAnsi(string11) {
1582
+ if (typeof string11 !== "string") {
1583
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string11}\``);
1584
1584
  }
1585
- return string10.replace(regex, "");
1585
+ return string11.replace(regex, "");
1586
1586
  }
1587
1587
  var regex;
1588
1588
  var init_strip_ansi = __esm({
@@ -1781,11 +1781,11 @@ var require_command = __commonJS({
1781
1781
  }
1782
1782
  if (node.type === "forcePositional") {
1783
1783
  } else if (node.type === "shortOptions") {
1784
- for (const option6 of node.options) {
1785
- if (context.visitedNodes.has(option6)) {
1784
+ for (const option7 of node.options) {
1785
+ if (context.visitedNodes.has(option7)) {
1786
1786
  continue;
1787
1787
  }
1788
- unknownArguments.push(option6);
1788
+ unknownArguments.push(option7);
1789
1789
  }
1790
1790
  } else {
1791
1791
  unknownArguments.push(node);
@@ -1864,7 +1864,7 @@ var require_option = __commonJS({
1864
1864
  return mod && mod.__esModule ? mod : { "default": mod };
1865
1865
  };
1866
1866
  Object.defineProperty(exports2, "__esModule", { value: true });
1867
- exports2.option = option6;
1867
+ exports2.option = option7;
1868
1868
  var chalk_1 = __importDefault((init_source(), __toCommonJS(source_exports)));
1869
1869
  var Result = __importStar(require_Result());
1870
1870
  var findOption_1 = require_findOption();
@@ -1940,11 +1940,11 @@ var require_option = __commonJS({
1940
1940
  const valueFromEnv = config.env ? process.env[config.env] : void 0;
1941
1941
  const defaultValueFn = config.defaultValue || config.type.defaultValue;
1942
1942
  const onMissingFn = config.onMissing || config.type.onMissing;
1943
- const option7 = options[0];
1943
+ const option8 = options[0];
1944
1944
  let rawValue;
1945
1945
  let envPrefix = "";
1946
- if (option7 === null || option7 === void 0 ? void 0 : option7.value) {
1947
- rawValue = option7.value.node.raw;
1946
+ if (option8 === null || option8 === void 0 ? void 0 : option8.value) {
1947
+ rawValue = option8.value.node.raw;
1948
1948
  } else if (valueFromEnv !== void 0) {
1949
1949
  rawValue = valueFromEnv;
1950
1950
  envPrefix = `env[${chalk_1.default.italic(config.env)}]: `;
@@ -1979,7 +1979,7 @@ var require_option = __commonJS({
1979
1979
  });
1980
1980
  }
1981
1981
  } else {
1982
- const raw = (option7 === null || option7 === void 0 ? void 0 : option7.type) === "shortOption" ? `-${option7 === null || option7 === void 0 ? void 0 : option7.key}` : `--${config.long}`;
1982
+ const raw = (option8 === null || option8 === void 0 ? void 0 : option8.type) === "shortOption" ? `-${option8 === null || option8 === void 0 ? void 0 : option8.key}` : `--${config.long}`;
1983
1983
  return Result.err({
1984
1984
  errors: [
1985
1985
  {
@@ -2001,7 +2001,7 @@ var require_option = __commonJS({
2001
2001
  }
2002
2002
  };
2003
2003
  }
2004
- function option6(config) {
2004
+ function option7(config) {
2005
2005
  return fullOption({
2006
2006
  type: types_1.string,
2007
2007
  ...config
@@ -2040,12 +2040,12 @@ var require_errorBox = __commonJS({
2040
2040
  if (node.type === "shortOptions") {
2041
2041
  let failed = false;
2042
2042
  let s = "";
2043
- for (const option6 of node.options) {
2044
- if (error.nodes.includes(option6)) {
2045
- s += chalk_1.default.red(option6.raw);
2043
+ for (const option7 of node.options) {
2044
+ if (error.nodes.includes(option7)) {
2045
+ s += chalk_1.default.red(option7.raw);
2046
2046
  failed = true;
2047
2047
  } else {
2048
- s += chalk_1.default.dim(option6.raw);
2048
+ s += chalk_1.default.dim(option7.raw);
2049
2049
  }
2050
2050
  }
2051
2051
  const prefix = failed ? chalk_1.default.red("-") : chalk_1.default.dim("-");
@@ -3084,8 +3084,8 @@ var require_tokenizer = __commonJS({
3084
3084
  tokens.push(token);
3085
3085
  overallIndex += token.raw.length;
3086
3086
  };
3087
- for (const [stringIndex, string10] of (0, utils_1.enumerate)(strings)) {
3088
- const chars = [...string10];
3087
+ for (const [stringIndex, string11] of (0, utils_1.enumerate)(strings)) {
3088
+ const chars = [...string11];
3089
3089
  for (let i = 0; i < chars.length; i++) {
3090
3090
  if (chars[i] === "-" && chars[i + 1] === "-") {
3091
3091
  push({ type: "longPrefix", raw: "--", index: overallIndex });
@@ -3346,15 +3346,15 @@ var require_multiflag = __commonJS({
3346
3346
  longNames: [config.long],
3347
3347
  shortNames: config.short ? [config.short] : []
3348
3348
  }).filter((x) => !visitedNodes.has(x));
3349
- for (const option6 of options) {
3350
- visitedNodes.add(option6);
3349
+ for (const option7 of options) {
3350
+ visitedNodes.add(option7);
3351
3351
  }
3352
3352
  const optionValues = [];
3353
3353
  const errors = [];
3354
- for (const option6 of options) {
3355
- const decoded = await Result.safeAsync(flag_1.boolean.from((_b = (_a = option6.value) === null || _a === void 0 ? void 0 : _a.node.raw) !== null && _b !== void 0 ? _b : "true"));
3354
+ for (const option7 of options) {
3355
+ const decoded = await Result.safeAsync(flag_1.boolean.from((_b = (_a = option7.value) === null || _a === void 0 ? void 0 : _a.node.raw) !== null && _b !== void 0 ? _b : "true"));
3356
3356
  if (Result.isErr(decoded)) {
3357
- errors.push({ nodes: [option6], message: decoded.error.message });
3357
+ errors.push({ nodes: [option7], message: decoded.error.message });
3358
3358
  } else {
3359
3359
  optionValues.push(decoded.value);
3360
3360
  }
@@ -3518,16 +3518,16 @@ var require_multioption = __commonJS({
3518
3518
  });
3519
3519
  }
3520
3520
  }
3521
- for (const option6 of options) {
3522
- visitedNodes.add(option6);
3521
+ for (const option7 of options) {
3522
+ visitedNodes.add(option7);
3523
3523
  }
3524
3524
  const optionValues = [];
3525
3525
  const errors = [];
3526
3526
  const flagNodes = [];
3527
- for (const option6 of options) {
3528
- const providedValue = (_a = option6.value) === null || _a === void 0 ? void 0 : _a.node.raw;
3527
+ for (const option7 of options) {
3528
+ const providedValue = (_a = option7.value) === null || _a === void 0 ? void 0 : _a.node.raw;
3529
3529
  if (providedValue === void 0) {
3530
- flagNodes.push(option6);
3530
+ flagNodes.push(option7);
3531
3531
  continue;
3532
3532
  }
3533
3533
  optionValues.push(providedValue);
@@ -3852,7 +3852,7 @@ var require_package = __commonJS({
3852
3852
  "apps/cli/package.json"(exports2, module2) {
3853
3853
  module2.exports = {
3854
3854
  name: "@packmind/cli",
3855
- version: "0.16.0",
3855
+ version: "0.16.1",
3856
3856
  description: "A command-line interface for Packmind linting and code quality checks",
3857
3857
  private: false,
3858
3858
  bin: {
@@ -3895,7 +3895,7 @@ var require_package = __commonJS({
3895
3895
  });
3896
3896
 
3897
3897
  // apps/cli/src/main.ts
3898
- var import_cmd_ts25 = __toESM(require_cjs());
3898
+ var import_cmd_ts26 = __toESM(require_cjs());
3899
3899
 
3900
3900
  // apps/cli/src/infra/commands/LinterCommand.ts
3901
3901
  var import_cmd_ts = __toESM(require_cjs());
@@ -4098,6 +4098,18 @@ function validateAgentsWithWarnings(agents) {
4098
4098
  return { validAgents, invalidAgents };
4099
4099
  }
4100
4100
 
4101
+ // packages/types/src/coding-agent/CodingAgent.ts
4102
+ var CodingAgents = {
4103
+ packmind: "packmind",
4104
+ junie: "junie",
4105
+ claude: "claude",
4106
+ cursor: "cursor",
4107
+ copilot: "copilot",
4108
+ agents_md: "agents_md",
4109
+ gitlab_duo: "gitlab_duo",
4110
+ continue: "continue"
4111
+ };
4112
+
4101
4113
  // packages/types/src/recipes/RecipeId.ts
4102
4114
  var createRecipeId = brandedIdFactory();
4103
4115
 
@@ -4184,6 +4196,25 @@ var DEFAULT_ACTIVE_RENDER_MODES = normalizeRenderModes([
4184
4196
  "AGENTS_MD" /* AGENTS_MD */
4185
4197
  ]);
4186
4198
 
4199
+ // packages/types/src/deployments/RenderModeCodingAgentMapping.ts
4200
+ var RENDER_MODE_TO_CODING_AGENT = {
4201
+ ["PACKMIND" /* PACKMIND */]: CodingAgents.packmind,
4202
+ ["AGENTS_MD" /* AGENTS_MD */]: CodingAgents.agents_md,
4203
+ ["JUNIE" /* JUNIE */]: CodingAgents.junie,
4204
+ ["GH_COPILOT" /* GH_COPILOT */]: CodingAgents.copilot,
4205
+ ["CLAUDE" /* CLAUDE */]: CodingAgents.claude,
4206
+ ["CURSOR" /* CURSOR */]: CodingAgents.cursor,
4207
+ ["GITLAB_DUO" /* GITLAB_DUO */]: CodingAgents.gitlab_duo,
4208
+ ["CONTINUE" /* CONTINUE */]: CodingAgents.continue
4209
+ };
4210
+ var CODING_AGENT_TO_RENDER_MODE = Object.entries(RENDER_MODE_TO_CODING_AGENT).reduce(
4211
+ (acc, [renderMode, codingAgent]) => {
4212
+ acc[codingAgent] = renderMode;
4213
+ return acc;
4214
+ },
4215
+ {}
4216
+ );
4217
+
4187
4218
  // packages/types/src/deployments/PackagesDeploymentId.ts
4188
4219
  var createPackagesDeploymentId = brandedIdFactory();
4189
4220
 
@@ -4935,6 +4966,9 @@ var LLM_PROVIDER_METADATA = {
4935
4966
  // packages/types/src/llm/AIProviderId.ts
4936
4967
  var createAIProviderId = brandedIdFactory();
4937
4968
 
4969
+ // packages/types/src/playbookChangeManagement/ChangeProposalId.ts
4970
+ var createChangeProposalId = brandedIdFactory();
4971
+
4938
4972
  // apps/cli/src/application/useCases/ExecuteSingleFileAstUseCase.ts
4939
4973
  var ExecuteSingleFileAstUseCase = class _ExecuteSingleFileAstUseCase {
4940
4974
  constructor(linterExecutionUseCase) {
@@ -6630,6 +6664,12 @@ var DeploymentGateway = class {
6630
6664
  }
6631
6665
  );
6632
6666
  };
6667
+ this.getRenderModeConfiguration = async () => {
6668
+ const { organizationId } = this.httpClient.getAuthContext();
6669
+ return this.httpClient.request(
6670
+ `/api/v0/organizations/${organizationId}/deployments/renderModeConfiguration`
6671
+ );
6672
+ };
6633
6673
  }
6634
6674
  };
6635
6675
 
@@ -10551,7 +10591,8 @@ var UploadSkillUseCase = class {
10551
10591
  };
10552
10592
  const uploadSkillResponse = await this.deps.gateway.skills.upload({
10553
10593
  spaceId: createSpaceId(space.id),
10554
- files: payload.files
10594
+ files: payload.files,
10595
+ originSkill: command20.originSkill
10555
10596
  });
10556
10597
  return {
10557
10598
  skillId: uploadSkillResponse.skill.id,
@@ -12452,27 +12493,39 @@ Credentials are loaded from (in order of priority):`);
12452
12493
  });
12453
12494
 
12454
12495
  // apps/cli/src/infra/commands/SkillsCommand.ts
12455
- var import_cmd_ts11 = __toESM(require_cjs());
12496
+ var import_cmd_ts12 = __toESM(require_cjs());
12456
12497
 
12457
12498
  // apps/cli/src/infra/commands/skills/AddSkillCommand.ts
12499
+ var import_cmd_ts9 = __toESM(require_cjs());
12500
+
12501
+ // apps/cli/src/infra/commands/sharedOptions.ts
12458
12502
  var import_cmd_ts8 = __toESM(require_cjs());
12459
- var addSkillCommand = (0, import_cmd_ts8.command)({
12503
+ var originSkillOption = (0, import_cmd_ts8.option)({
12504
+ long: "origin-skill",
12505
+ description: "Name of the skill that triggered this command",
12506
+ type: (0, import_cmd_ts8.optional)(import_cmd_ts8.string)
12507
+ });
12508
+
12509
+ // apps/cli/src/infra/commands/skills/AddSkillCommand.ts
12510
+ var addSkillCommand = (0, import_cmd_ts9.command)({
12460
12511
  name: "add",
12461
12512
  description: "Add a skill from a local directory to a Packmind organization",
12462
12513
  args: {
12463
- skillPath: (0, import_cmd_ts8.positional)({
12464
- type: import_cmd_ts8.string,
12514
+ skillPath: (0, import_cmd_ts9.positional)({
12515
+ type: import_cmd_ts9.string,
12465
12516
  displayName: "path",
12466
12517
  description: "Path to skill directory containing SKILL.md"
12467
- })
12518
+ }),
12519
+ originSkill: originSkillOption
12468
12520
  },
12469
- handler: async ({ skillPath }) => {
12521
+ handler: async ({ skillPath, originSkill }) => {
12470
12522
  const packmindLogger = new PackmindLogger("PackmindCLI", "info" /* INFO */);
12471
12523
  const packmindCliHexa = new PackmindCliHexa(packmindLogger);
12472
12524
  try {
12473
12525
  logInfoConsole(`Uploading skill from ${skillPath}...`);
12474
12526
  const result = await packmindCliHexa.uploadSkill({
12475
- skillPath
12527
+ skillPath,
12528
+ originSkill
12476
12529
  });
12477
12530
  if (result.isNewSkill) {
12478
12531
  logSuccessConsole("Skill created successfully!");
@@ -12501,13 +12554,13 @@ var addSkillCommand = (0, import_cmd_ts8.command)({
12501
12554
  });
12502
12555
 
12503
12556
  // apps/cli/src/infra/commands/skills/InstallDefaultSkillsCommand.ts
12504
- var import_cmd_ts9 = __toESM(require_cjs());
12557
+ var import_cmd_ts10 = __toESM(require_cjs());
12505
12558
  var { version: CLI_VERSION2 } = require_package();
12506
- var installDefaultSkillsCommand = (0, import_cmd_ts9.command)({
12559
+ var installDefaultSkillsCommand = (0, import_cmd_ts10.command)({
12507
12560
  name: "install-default",
12508
12561
  description: "Install default Packmind skills for configured coding agents",
12509
12562
  args: {
12510
- includeBeta: (0, import_cmd_ts9.flag)({
12563
+ includeBeta: (0, import_cmd_ts10.flag)({
12511
12564
  long: "include-beta",
12512
12565
  description: "Include unreleased/beta skills"
12513
12566
  })
@@ -12551,7 +12604,7 @@ var installDefaultSkillsCommand = (0, import_cmd_ts9.command)({
12551
12604
  });
12552
12605
 
12553
12606
  // apps/cli/src/infra/commands/ListSkillsCommand.ts
12554
- var import_cmd_ts10 = __toESM(require_cjs());
12607
+ var import_cmd_ts11 = __toESM(require_cjs());
12555
12608
 
12556
12609
  // apps/cli/src/infra/commands/listSkillsHandler.ts
12557
12610
  function buildSkillUrl(host, orgSlug, skillSlug) {
@@ -12613,7 +12666,7 @@ async function listSkillsHandler(deps) {
12613
12666
  }
12614
12667
 
12615
12668
  // apps/cli/src/infra/commands/ListSkillsCommand.ts
12616
- var listSkillsCommand = (0, import_cmd_ts10.command)({
12669
+ var listSkillsCommand = (0, import_cmd_ts11.command)({
12617
12670
  name: "list",
12618
12671
  description: "List available skills",
12619
12672
  args: {},
@@ -12630,7 +12683,7 @@ var listSkillsCommand = (0, import_cmd_ts10.command)({
12630
12683
  });
12631
12684
 
12632
12685
  // apps/cli/src/infra/commands/SkillsCommand.ts
12633
- var skillsCommand = (0, import_cmd_ts11.subcommands)({
12686
+ var skillsCommand = (0, import_cmd_ts12.subcommands)({
12634
12687
  name: "skills",
12635
12688
  description: "Manage skills in your Packmind organization",
12636
12689
  cmds: {
@@ -12641,10 +12694,10 @@ var skillsCommand = (0, import_cmd_ts11.subcommands)({
12641
12694
  });
12642
12695
 
12643
12696
  // apps/cli/src/infra/commands/StandardsCommand.ts
12644
- var import_cmd_ts14 = __toESM(require_cjs());
12697
+ var import_cmd_ts15 = __toESM(require_cjs());
12645
12698
 
12646
12699
  // apps/cli/src/infra/commands/CreateStandardCommand.ts
12647
- var import_cmd_ts12 = __toESM(require_cjs());
12700
+ var import_cmd_ts13 = __toESM(require_cjs());
12648
12701
 
12649
12702
  // apps/cli/src/infra/utils/readPlaybookFile.ts
12650
12703
  var fs13 = __toESM(require("fs/promises"));
@@ -12710,7 +12763,7 @@ async function readPlaybookFile(filePath) {
12710
12763
  }
12711
12764
 
12712
12765
  // apps/cli/src/infra/commands/createStandardHandler.ts
12713
- async function createStandardHandler(filePath, useCase) {
12766
+ async function createStandardHandler(filePath, useCase, originSkill) {
12714
12767
  const readResult = await readPlaybookFile(filePath);
12715
12768
  if (!readResult.isValid) {
12716
12769
  return {
@@ -12725,7 +12778,10 @@ async function createStandardHandler(filePath, useCase) {
12725
12778
  };
12726
12779
  }
12727
12780
  try {
12728
- const result = await useCase.execute(readResult.data);
12781
+ const result = await useCase.execute({
12782
+ ...readResult.data,
12783
+ originSkill
12784
+ });
12729
12785
  return {
12730
12786
  success: true,
12731
12787
  standardId: result.standardId,
@@ -12759,30 +12815,32 @@ var CreateStandardFromPlaybookUseCase = class {
12759
12815
  negative: r.examples.negative
12760
12816
  }
12761
12817
  ] : void 0
12762
- }))
12818
+ })),
12819
+ originSkill: playbook.originSkill
12763
12820
  });
12764
12821
  return { standardId: standard.id, name: standard.name };
12765
12822
  }
12766
12823
  };
12767
12824
 
12768
12825
  // apps/cli/src/infra/commands/CreateStandardCommand.ts
12769
- var createStandardCommand = (0, import_cmd_ts12.command)({
12826
+ var createStandardCommand = (0, import_cmd_ts13.command)({
12770
12827
  name: "create",
12771
12828
  description: "Create a coding standard from a playbook JSON file",
12772
12829
  args: {
12773
- file: (0, import_cmd_ts12.positional)({
12830
+ file: (0, import_cmd_ts13.positional)({
12774
12831
  displayName: "file",
12775
12832
  description: "Path to the playbook JSON file",
12776
- type: import_cmd_ts12.string
12777
- })
12833
+ type: import_cmd_ts13.string
12834
+ }),
12835
+ originSkill: originSkillOption
12778
12836
  },
12779
- handler: async ({ file }) => {
12837
+ handler: async ({ file, originSkill }) => {
12780
12838
  try {
12781
12839
  const packmindLogger = new PackmindLogger("PackmindCLI", "info" /* INFO */);
12782
12840
  const hexa = new PackmindCliHexa(packmindLogger);
12783
12841
  const gateway = hexa.getPackmindGateway();
12784
12842
  const useCase = new CreateStandardFromPlaybookUseCase(gateway);
12785
- const result = await createStandardHandler(file, useCase);
12843
+ const result = await createStandardHandler(file, useCase, originSkill);
12786
12844
  if (result.success) {
12787
12845
  logSuccessConsole(
12788
12846
  `Standard "${result.standardName}" created successfully (ID: ${result.standardId})`
@@ -12802,7 +12860,7 @@ var createStandardCommand = (0, import_cmd_ts12.command)({
12802
12860
  });
12803
12861
 
12804
12862
  // apps/cli/src/infra/commands/ListStandardsCommand.ts
12805
- var import_cmd_ts13 = __toESM(require_cjs());
12863
+ var import_cmd_ts14 = __toESM(require_cjs());
12806
12864
 
12807
12865
  // apps/cli/src/infra/commands/listStandardsHandler.ts
12808
12866
  function buildStandardUrl(host, orgSlug, standardId) {
@@ -12864,7 +12922,7 @@ async function listStandardsHandler(deps) {
12864
12922
  }
12865
12923
 
12866
12924
  // apps/cli/src/infra/commands/ListStandardsCommand.ts
12867
- var listStandardsCommand = (0, import_cmd_ts13.command)({
12925
+ var listStandardsCommand = (0, import_cmd_ts14.command)({
12868
12926
  name: "list",
12869
12927
  description: "List available coding standards",
12870
12928
  args: {},
@@ -12881,7 +12939,7 @@ var listStandardsCommand = (0, import_cmd_ts13.command)({
12881
12939
  });
12882
12940
 
12883
12941
  // apps/cli/src/infra/commands/StandardsCommand.ts
12884
- var standardsCommand = (0, import_cmd_ts14.subcommands)({
12942
+ var standardsCommand = (0, import_cmd_ts15.subcommands)({
12885
12943
  name: "standards",
12886
12944
  description: "Manage coding standards",
12887
12945
  cmds: {
@@ -12891,10 +12949,10 @@ var standardsCommand = (0, import_cmd_ts14.subcommands)({
12891
12949
  });
12892
12950
 
12893
12951
  // apps/cli/src/infra/commands/CommandsCommand.ts
12894
- var import_cmd_ts17 = __toESM(require_cjs());
12952
+ var import_cmd_ts18 = __toESM(require_cjs());
12895
12953
 
12896
12954
  // apps/cli/src/infra/commands/CreateCommandCommand.ts
12897
- var import_cmd_ts15 = __toESM(require_cjs());
12955
+ var import_cmd_ts16 = __toESM(require_cjs());
12898
12956
 
12899
12957
  // apps/cli/src/infra/utils/readCommandPlaybookFile.ts
12900
12958
  var fs14 = __toESM(require("fs/promises"));
@@ -12962,7 +13020,7 @@ async function readCommandPlaybookFile(filePath) {
12962
13020
  function buildWebappUrl(host, orgSlug, commandId) {
12963
13021
  return `${host}/org/${orgSlug}/space/global/commands/${commandId}`;
12964
13022
  }
12965
- async function createCommandHandler(filePath, useCase) {
13023
+ async function createCommandHandler(filePath, useCase, originSkill) {
12966
13024
  const readResult = await readCommandPlaybookFile(filePath);
12967
13025
  if (!readResult.isValid) {
12968
13026
  return {
@@ -12977,7 +13035,10 @@ async function createCommandHandler(filePath, useCase) {
12977
13035
  };
12978
13036
  }
12979
13037
  try {
12980
- const result = await useCase.execute(readResult.data);
13038
+ const result = await useCase.execute({
13039
+ ...readResult.data,
13040
+ originSkill
13041
+ });
12981
13042
  let webappUrl;
12982
13043
  const apiKey = loadApiKey();
12983
13044
  if (apiKey) {
@@ -13021,7 +13082,8 @@ var CreateCommandFromPlaybookUseCase = class {
13021
13082
  name: step.name,
13022
13083
  description: step.description,
13023
13084
  codeSnippet: step.codeSnippet
13024
- }))
13085
+ })),
13086
+ originSkill: playbook.originSkill
13025
13087
  });
13026
13088
  return {
13027
13089
  commandId: command20.id,
@@ -13032,23 +13094,24 @@ var CreateCommandFromPlaybookUseCase = class {
13032
13094
  };
13033
13095
 
13034
13096
  // apps/cli/src/infra/commands/CreateCommandCommand.ts
13035
- var createCommandCommand = (0, import_cmd_ts15.command)({
13097
+ var createCommandCommand = (0, import_cmd_ts16.command)({
13036
13098
  name: "create",
13037
13099
  description: "Create a command from a playbook JSON file",
13038
13100
  args: {
13039
- file: (0, import_cmd_ts15.positional)({
13101
+ file: (0, import_cmd_ts16.positional)({
13040
13102
  displayName: "file",
13041
13103
  description: "Path to the command playbook JSON file",
13042
- type: import_cmd_ts15.string
13043
- })
13104
+ type: import_cmd_ts16.string
13105
+ }),
13106
+ originSkill: originSkillOption
13044
13107
  },
13045
- handler: async ({ file }) => {
13108
+ handler: async ({ file, originSkill }) => {
13046
13109
  try {
13047
13110
  const packmindLogger = new PackmindLogger("PackmindCLI", "info" /* INFO */);
13048
13111
  const hexa = new PackmindCliHexa(packmindLogger);
13049
13112
  const gateway = hexa.getPackmindGateway();
13050
13113
  const useCase = new CreateCommandFromPlaybookUseCase(gateway);
13051
- const result = await createCommandHandler(file, useCase);
13114
+ const result = await createCommandHandler(file, useCase, originSkill);
13052
13115
  if (result.success) {
13053
13116
  logSuccessConsole(
13054
13117
  `Command "${result.commandName}" created successfully (ID: ${result.commandId})`
@@ -13072,7 +13135,7 @@ var createCommandCommand = (0, import_cmd_ts15.command)({
13072
13135
  });
13073
13136
 
13074
13137
  // apps/cli/src/infra/commands/ListCommandsCommand.ts
13075
- var import_cmd_ts16 = __toESM(require_cjs());
13138
+ var import_cmd_ts17 = __toESM(require_cjs());
13076
13139
 
13077
13140
  // apps/cli/src/infra/commands/listCommandsHandler.ts
13078
13141
  function buildCommandUrl(host, orgSlug, commandId) {
@@ -13126,7 +13189,7 @@ async function listCommandsHandler(deps) {
13126
13189
  }
13127
13190
 
13128
13191
  // apps/cli/src/infra/commands/ListCommandsCommand.ts
13129
- var listCommandsCommand = (0, import_cmd_ts16.command)({
13192
+ var listCommandsCommand = (0, import_cmd_ts17.command)({
13130
13193
  name: "list",
13131
13194
  description: "List available commands",
13132
13195
  args: {},
@@ -13143,7 +13206,7 @@ var listCommandsCommand = (0, import_cmd_ts16.command)({
13143
13206
  });
13144
13207
 
13145
13208
  // apps/cli/src/infra/commands/CommandsCommand.ts
13146
- var commandsCommand = (0, import_cmd_ts17.subcommands)({
13209
+ var commandsCommand = (0, import_cmd_ts18.subcommands)({
13147
13210
  name: "commands",
13148
13211
  description: "Manage commands",
13149
13212
  cmds: {
@@ -13153,16 +13216,16 @@ var commandsCommand = (0, import_cmd_ts17.subcommands)({
13153
13216
  });
13154
13217
 
13155
13218
  // apps/cli/src/infra/commands/PackagesCommand.ts
13156
- var import_cmd_ts21 = __toESM(require_cjs());
13219
+ var import_cmd_ts22 = __toESM(require_cjs());
13157
13220
 
13158
13221
  // apps/cli/src/infra/commands/CreatePackageCommand.ts
13159
- var import_cmd_ts18 = __toESM(require_cjs());
13222
+ var import_cmd_ts19 = __toESM(require_cjs());
13160
13223
 
13161
13224
  // apps/cli/src/infra/commands/createPackageHandler.ts
13162
13225
  function buildWebappUrl2(host, orgSlug, packageId) {
13163
13226
  return `${host}/org/${orgSlug}/space/global/packages/${packageId}`;
13164
13227
  }
13165
- async function createPackageHandler(name, description, useCase) {
13228
+ async function createPackageHandler(name, description, useCase, originSkill) {
13166
13229
  const trimmedName = name.trim();
13167
13230
  if (!trimmedName) {
13168
13231
  return { success: false, error: "Package name is required" };
@@ -13170,7 +13233,8 @@ async function createPackageHandler(name, description, useCase) {
13170
13233
  try {
13171
13234
  const result = await useCase.execute({
13172
13235
  name: trimmedName,
13173
- description
13236
+ description,
13237
+ originSkill
13174
13238
  });
13175
13239
  let webappUrl;
13176
13240
  const apiKey = loadApiKey();
@@ -13211,7 +13275,8 @@ var CreatePackageUseCase = class {
13211
13275
  name: command20.name,
13212
13276
  description: command20.description ?? "",
13213
13277
  recipeIds: [],
13214
- standardIds: []
13278
+ standardIds: [],
13279
+ originSkill: command20.originSkill
13215
13280
  });
13216
13281
  return {
13217
13282
  packageId: result.package.id,
@@ -13222,29 +13287,35 @@ var CreatePackageUseCase = class {
13222
13287
  };
13223
13288
 
13224
13289
  // apps/cli/src/infra/commands/CreatePackageCommand.ts
13225
- var createPackageCommand = (0, import_cmd_ts18.command)({
13290
+ var createPackageCommand = (0, import_cmd_ts19.command)({
13226
13291
  name: "create",
13227
13292
  description: "Create a new package",
13228
13293
  args: {
13229
- name: (0, import_cmd_ts18.positional)({
13294
+ name: (0, import_cmd_ts19.positional)({
13230
13295
  displayName: "name",
13231
13296
  description: "Name of the package to create",
13232
- type: import_cmd_ts18.string
13297
+ type: import_cmd_ts19.string
13233
13298
  }),
13234
- description: (0, import_cmd_ts18.option)({
13299
+ description: (0, import_cmd_ts19.option)({
13235
13300
  long: "description",
13236
13301
  short: "d",
13237
13302
  description: "Description of the package (optional)",
13238
- type: (0, import_cmd_ts18.optional)(import_cmd_ts18.string)
13239
- })
13303
+ type: (0, import_cmd_ts19.optional)(import_cmd_ts19.string)
13304
+ }),
13305
+ originSkill: originSkillOption
13240
13306
  },
13241
- handler: async ({ name, description }) => {
13307
+ handler: async ({ name, description, originSkill }) => {
13242
13308
  try {
13243
13309
  const packmindLogger = new PackmindLogger("PackmindCLI", "info" /* INFO */);
13244
13310
  const hexa = new PackmindCliHexa(packmindLogger);
13245
13311
  const gateway = hexa.getPackmindGateway();
13246
13312
  const useCase = new CreatePackageUseCase(gateway);
13247
- const result = await createPackageHandler(name, description, useCase);
13313
+ const result = await createPackageHandler(
13314
+ name,
13315
+ description,
13316
+ useCase,
13317
+ originSkill
13318
+ );
13248
13319
  if (result.success) {
13249
13320
  logConsole("");
13250
13321
  logConsole(formatHeader(`\u2705 Package created successfully
@@ -13278,7 +13349,7 @@ var createPackageCommand = (0, import_cmd_ts18.command)({
13278
13349
  });
13279
13350
 
13280
13351
  // apps/cli/src/infra/commands/AddToPackageCommand.ts
13281
- var import_cmd_ts19 = __toESM(require_cjs());
13352
+ var import_cmd_ts20 = __toESM(require_cjs());
13282
13353
 
13283
13354
  // apps/cli/src/domain/errors/ItemNotFoundError.ts
13284
13355
  var ItemNotFoundError = class extends Error {
@@ -13312,7 +13383,8 @@ var AddToPackageUseCase = class {
13312
13383
  spaceId: space.id,
13313
13384
  standardIds: [],
13314
13385
  recipeIds: [],
13315
- skillIds: []
13386
+ skillIds: [],
13387
+ originSkill: command20.originSkill
13316
13388
  };
13317
13389
  if (itemType === "standard") {
13318
13390
  addCommand.standardIds = ids.map(createStandardId);
@@ -13375,12 +13447,17 @@ function formatItemType(itemType, count) {
13375
13447
  function formatItemList(items) {
13376
13448
  return items.map((item) => `"${item}"`).join(", ");
13377
13449
  }
13378
- async function addToPackageHandler(packageSlug, itemType, itemSlugs, useCase) {
13450
+ async function addToPackageHandler(packageSlug, itemType, itemSlugs, useCase, originSkill) {
13379
13451
  if (itemSlugs.length === 0) {
13380
13452
  return { success: false, error: "No items provided to add" };
13381
13453
  }
13382
13454
  try {
13383
- const result = await useCase.execute({ packageSlug, itemType, itemSlugs });
13455
+ const result = await useCase.execute({
13456
+ packageSlug,
13457
+ itemType,
13458
+ itemSlugs,
13459
+ originSkill
13460
+ });
13384
13461
  if (result.added.length) {
13385
13462
  logSuccessConsole(
13386
13463
  `${formatItemType(itemType, result.added.length)} ${formatItemList(result.added)} added to "${packageSlug}"`
@@ -13408,32 +13485,33 @@ async function addToPackageHandler(packageSlug, itemType, itemSlugs, useCase) {
13408
13485
  }
13409
13486
 
13410
13487
  // apps/cli/src/infra/commands/AddToPackageCommand.ts
13411
- var addToPackageCommand = (0, import_cmd_ts19.command)({
13488
+ var addToPackageCommand = (0, import_cmd_ts20.command)({
13412
13489
  name: "add",
13413
13490
  description: "Add standards, commands, or skills to a package",
13414
13491
  args: {
13415
- to: (0, import_cmd_ts19.option)({
13492
+ to: (0, import_cmd_ts20.option)({
13416
13493
  long: "to",
13417
13494
  description: "Target package slug",
13418
- type: import_cmd_ts19.string
13495
+ type: import_cmd_ts20.string
13419
13496
  }),
13420
- standards: (0, import_cmd_ts19.multioption)({
13497
+ standards: (0, import_cmd_ts20.multioption)({
13421
13498
  long: "standard",
13422
13499
  description: "Standard slug(s) to add",
13423
- type: (0, import_cmd_ts19.array)(import_cmd_ts19.string)
13500
+ type: (0, import_cmd_ts20.array)(import_cmd_ts20.string)
13424
13501
  }),
13425
- commands: (0, import_cmd_ts19.multioption)({
13502
+ commands: (0, import_cmd_ts20.multioption)({
13426
13503
  long: "command",
13427
13504
  description: "Command slug(s) to add",
13428
- type: (0, import_cmd_ts19.array)(import_cmd_ts19.string)
13505
+ type: (0, import_cmd_ts20.array)(import_cmd_ts20.string)
13429
13506
  }),
13430
- skills: (0, import_cmd_ts19.multioption)({
13507
+ skills: (0, import_cmd_ts20.multioption)({
13431
13508
  long: "skill",
13432
13509
  description: "Skill slug(s) to add",
13433
- type: (0, import_cmd_ts19.array)(import_cmd_ts19.string)
13434
- })
13510
+ type: (0, import_cmd_ts20.array)(import_cmd_ts20.string)
13511
+ }),
13512
+ originSkill: originSkillOption
13435
13513
  },
13436
- handler: async ({ to, standards, commands, skills }) => {
13514
+ handler: async ({ to, standards, commands, skills, originSkill }) => {
13437
13515
  const standardSlugs = standards ?? [];
13438
13516
  const commandSlugs = commands ?? [];
13439
13517
  const skillSlugs = skills ?? [];
@@ -13459,7 +13537,13 @@ var addToPackageCommand = (0, import_cmd_ts19.command)({
13459
13537
  const hexa = new PackmindCliHexa(packmindLogger);
13460
13538
  const gateway = hexa.getPackmindGateway();
13461
13539
  const useCase = new AddToPackageUseCase(gateway);
13462
- const result = await addToPackageHandler(to, itemType, itemSlugs, useCase);
13540
+ const result = await addToPackageHandler(
13541
+ to,
13542
+ itemType,
13543
+ itemSlugs,
13544
+ useCase,
13545
+ originSkill
13546
+ );
13463
13547
  if (!result.success) {
13464
13548
  process.exit(1);
13465
13549
  }
@@ -13467,8 +13551,8 @@ var addToPackageCommand = (0, import_cmd_ts19.command)({
13467
13551
  });
13468
13552
 
13469
13553
  // apps/cli/src/infra/commands/listPackagesCommand.ts
13470
- var import_cmd_ts20 = __toESM(require_cjs());
13471
- var listPackagesCommand = (0, import_cmd_ts20.command)({
13554
+ var import_cmd_ts21 = __toESM(require_cjs());
13555
+ var listPackagesCommand = (0, import_cmd_ts21.command)({
13472
13556
  name: "list",
13473
13557
  description: "List available packages",
13474
13558
  args: {},
@@ -13487,7 +13571,7 @@ var listPackagesCommand = (0, import_cmd_ts20.command)({
13487
13571
  });
13488
13572
 
13489
13573
  // apps/cli/src/infra/commands/PackagesCommand.ts
13490
- var packagesCommand = (0, import_cmd_ts21.subcommands)({
13574
+ var packagesCommand = (0, import_cmd_ts22.subcommands)({
13491
13575
  name: "packages",
13492
13576
  description: "Manage packages",
13493
13577
  cmds: {
@@ -13498,10 +13582,10 @@ var packagesCommand = (0, import_cmd_ts21.subcommands)({
13498
13582
  });
13499
13583
 
13500
13584
  // apps/cli/src/infra/commands/config/ConfigCommand.ts
13501
- var import_cmd_ts23 = __toESM(require_cjs());
13585
+ var import_cmd_ts24 = __toESM(require_cjs());
13502
13586
 
13503
13587
  // apps/cli/src/infra/commands/config/ConfigAgentsCommand.ts
13504
- var import_cmd_ts22 = __toESM(require_cjs());
13588
+ var import_cmd_ts23 = __toESM(require_cjs());
13505
13589
 
13506
13590
  // apps/cli/src/application/services/AgentArtifactDetectionService.ts
13507
13591
  var fs15 = __toESM(require("fs/promises"));
@@ -13568,6 +13652,42 @@ var AGENT_DISPLAY_NAMES = {
13568
13652
  agents_md: "AGENTS.md",
13569
13653
  gitlab_duo: "GitLab Duo"
13570
13654
  };
13655
+ async function configAgentsHandler(deps) {
13656
+ const { configRepository, baseDirectory } = deps;
13657
+ const isTTY = deps.isTTY ?? process.stdin.isTTY;
13658
+ const useSimplePrompt = process.env.PACKMIND_SIMPLE_PROMPT === "1" || !isTTY;
13659
+ const preselectedAgents = await getPreselectedAgents(deps);
13660
+ const choices = SELECTABLE_AGENTS.map((agent) => ({
13661
+ name: AGENT_DISPLAY_NAMES[agent],
13662
+ value: agent,
13663
+ checked: preselectedAgents.has(agent)
13664
+ }));
13665
+ let selectedAgents;
13666
+ if (useSimplePrompt) {
13667
+ selectedAgents = await promptAgentsWithReadline2(choices);
13668
+ } else {
13669
+ const result = await inquirer2.default.prompt([
13670
+ {
13671
+ type: "checkbox",
13672
+ name: "selectedAgents",
13673
+ message: "Select coding agents to generate artifacts for:",
13674
+ choices
13675
+ }
13676
+ ]);
13677
+ selectedAgents = result.selectedAgents;
13678
+ }
13679
+ await configRepository.updateAgentsConfig(baseDirectory, selectedAgents);
13680
+ const agentNames = selectedAgents.map((a) => AGENT_DISPLAY_NAMES[a]);
13681
+ if (selectedAgents.length === 0) {
13682
+ logInfoConsole(
13683
+ "No agents selected. Only packmind artifacts will be generated."
13684
+ );
13685
+ } else {
13686
+ logSuccessConsole(
13687
+ `Configuration saved. Artifacts will be generated for: ${agentNames.join(", ")}`
13688
+ );
13689
+ }
13690
+ }
13571
13691
  async function promptAgentsWithReadline2(choices) {
13572
13692
  const input = process.stdin;
13573
13693
  const output = process.stdout;
@@ -13598,73 +13718,54 @@ async function promptAgentsWithReadline2(choices) {
13598
13718
  );
13599
13719
  });
13600
13720
  }
13601
- async function configAgentsHandler(deps) {
13721
+ async function getPreselectedAgents(deps) {
13602
13722
  const { configRepository, agentDetectionService, baseDirectory } = deps;
13603
- const isTTY = deps.isTTY ?? process.stdin.isTTY;
13604
- const useSimplePrompt = process.env.PACKMIND_SIMPLE_PROMPT === "1" || !isTTY;
13605
13723
  const existingConfig = await configRepository.readConfig(baseDirectory);
13606
- let preselectedAgents;
13607
13724
  if (existingConfig?.agents && existingConfig.agents.length > 0) {
13608
- preselectedAgents = new Set(
13725
+ return new Set(
13609
13726
  existingConfig.agents.filter(
13610
13727
  (agent) => SELECTABLE_AGENTS.includes(agent)
13611
13728
  )
13612
13729
  );
13613
- } else {
13614
- const detectedArtifacts = await agentDetectionService.detectAgentArtifacts(baseDirectory);
13615
- preselectedAgents = new Set(detectedArtifacts.map((a) => a.agent));
13616
13730
  }
13617
- const choices = SELECTABLE_AGENTS.map((agent) => ({
13618
- name: AGENT_DISPLAY_NAMES[agent],
13619
- value: agent,
13620
- checked: preselectedAgents.has(agent)
13621
- }));
13622
- let selectedAgents;
13623
- if (useSimplePrompt) {
13624
- selectedAgents = await promptAgentsWithReadline2(choices);
13625
- } else {
13626
- const result = await inquirer2.default.prompt([
13627
- {
13628
- type: "checkbox",
13629
- name: "selectedAgents",
13630
- message: "Select coding agents to generate artifacts for:",
13631
- choices
13632
- }
13633
- ]);
13634
- selectedAgents = result.selectedAgents;
13731
+ const detectedArtifacts = await agentDetectionService.detectAgentArtifacts(baseDirectory);
13732
+ if (detectedArtifacts.length > 0) {
13733
+ return new Set(detectedArtifacts.map((a) => a.agent));
13635
13734
  }
13636
- await configRepository.updateAgentsConfig(baseDirectory, selectedAgents);
13637
- const agentNames = selectedAgents.map((a) => AGENT_DISPLAY_NAMES[a]);
13638
- if (selectedAgents.length === 0) {
13639
- logInfoConsole(
13640
- "No agents selected. Only packmind artifacts will be generated."
13641
- );
13642
- } else {
13643
- logSuccessConsole(
13644
- `Configuration saved. Artifacts will be generated for: ${agentNames.join(", ")}`
13645
- );
13735
+ try {
13736
+ const result = await deps.packmindGateway.deployment.getRenderModeConfiguration({});
13737
+ if (result.configuration) {
13738
+ return new Set(
13739
+ result.configuration.activeRenderModes.map((mode) => RENDER_MODE_TO_CODING_AGENT[mode]).filter((agent) => agent !== void 0)
13740
+ );
13741
+ }
13742
+ } catch {
13646
13743
  }
13744
+ return /* @__PURE__ */ new Set();
13647
13745
  }
13648
13746
 
13649
13747
  // apps/cli/src/infra/commands/config/ConfigAgentsCommand.ts
13650
- var configAgentsCommand = (0, import_cmd_ts22.command)({
13748
+ var configAgentsCommand = (0, import_cmd_ts23.command)({
13651
13749
  name: "agents",
13652
13750
  description: "Configure which coding agents to generate artifacts for",
13653
13751
  args: {},
13654
13752
  handler: async () => {
13753
+ const packmindLogger = new PackmindLogger("PackmindCLI", "info" /* INFO */);
13754
+ const packmindCliHexa = new PackmindCliHexa(packmindLogger);
13655
13755
  const configRepository = new ConfigFileRepository();
13656
13756
  const agentDetectionService = new AgentArtifactDetectionService();
13657
13757
  const baseDirectory = process.cwd();
13658
13758
  await configAgentsHandler({
13659
13759
  configRepository,
13660
13760
  agentDetectionService,
13761
+ packmindGateway: packmindCliHexa.getPackmindGateway(),
13661
13762
  baseDirectory
13662
13763
  });
13663
13764
  }
13664
13765
  });
13665
13766
 
13666
13767
  // apps/cli/src/infra/commands/config/ConfigCommand.ts
13667
- var configCommand = (0, import_cmd_ts23.subcommands)({
13768
+ var configCommand = (0, import_cmd_ts24.subcommands)({
13668
13769
  name: "config",
13669
13770
  description: "Manage Packmind configuration",
13670
13771
  cmds: {
@@ -13673,13 +13774,14 @@ var configCommand = (0, import_cmd_ts23.subcommands)({
13673
13774
  });
13674
13775
 
13675
13776
  // apps/cli/src/infra/commands/InitCommand.ts
13676
- var import_cmd_ts24 = __toESM(require_cjs());
13777
+ var import_cmd_ts25 = __toESM(require_cjs());
13677
13778
 
13678
13779
  // apps/cli/src/infra/commands/initHandler.ts
13679
13780
  async function initHandler(deps) {
13680
13781
  const {
13681
13782
  configRepository,
13682
13783
  agentDetectionService,
13784
+ packmindGateway,
13683
13785
  baseDirectory,
13684
13786
  installDefaultSkills,
13685
13787
  cliVersion,
@@ -13688,6 +13790,7 @@ async function initHandler(deps) {
13688
13790
  const configAgentsDeps = {
13689
13791
  configRepository,
13690
13792
  agentDetectionService,
13793
+ packmindGateway,
13691
13794
  baseDirectory,
13692
13795
  isTTY
13693
13796
  };
@@ -13728,7 +13831,7 @@ async function initHandler(deps) {
13728
13831
 
13729
13832
  // apps/cli/src/infra/commands/InitCommand.ts
13730
13833
  var { version: CLI_VERSION3 } = require_package();
13731
- var initCommand = (0, import_cmd_ts24.command)({
13834
+ var initCommand = (0, import_cmd_ts25.command)({
13732
13835
  name: "init",
13733
13836
  description: "Initialize Packmind in the current project",
13734
13837
  args: {},
@@ -13741,6 +13844,7 @@ var initCommand = (0, import_cmd_ts24.command)({
13741
13844
  const result = await initHandler({
13742
13845
  configRepository,
13743
13846
  agentDetectionService,
13847
+ packmindGateway: packmindCliHexa.getPackmindGateway(),
13744
13848
  baseDirectory,
13745
13849
  installDefaultSkills: packmindCliHexa.installDefaultSkills.bind(packmindCliHexa),
13746
13850
  cliVersion: CLI_VERSION3
@@ -13793,7 +13897,7 @@ if (args.includes("--version") || args.includes("-v")) {
13793
13897
  logConsole(`packmind-cli version ${CLI_VERSION4}`);
13794
13898
  process.exit(0);
13795
13899
  }
13796
- var app = (0, import_cmd_ts25.subcommands)({
13900
+ var app = (0, import_cmd_ts26.subcommands)({
13797
13901
  name: "packmind-cli",
13798
13902
  description: "Packmind CLI tool",
13799
13903
  cmds: {
@@ -13814,7 +13918,7 @@ var app = (0, import_cmd_ts25.subcommands)({
13814
13918
  whoami: whoamiCommand
13815
13919
  }
13816
13920
  });
13817
- (0, import_cmd_ts25.run)(app, args).catch((error) => {
13921
+ (0, import_cmd_ts26.run)(app, args).catch((error) => {
13818
13922
  logErrorConsole(error.message);
13819
13923
  process.exit(1);
13820
13924
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@packmind/cli",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "A command-line interface for Packmind linting and code quality checks",
5
5
  "private": false,
6
6
  "bin": {
@@ -44,7 +44,7 @@
44
44
  "@types/winston": "2.4.4",
45
45
  "adm-zip": "0.5.16",
46
46
  "archiver": "7.0.1",
47
- "axios": "1.13.2",
47
+ "axios": "1.13.5",
48
48
  "bcrypt": "6.0.0",
49
49
  "bullmq": "5.63.0",
50
50
  "dotenv": "16.4.7",