@agents-inc/cli 0.82.2 → 0.83.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/{chunk-ZKQ4XQNO.js → chunk-253BRVMB.js} +20 -12
  3. package/dist/chunk-253BRVMB.js.map +1 -0
  4. package/dist/{chunk-3BM5F4IX.js → chunk-262MXFGL.js} +3 -3
  5. package/dist/{chunk-R5LEXRV3.js → chunk-4BVJJSKM.js} +2 -2
  6. package/dist/{chunk-4DXSCGVI.js → chunk-4Z5FJQEP.js} +4 -4
  7. package/dist/chunk-4Z5FJQEP.js.map +1 -0
  8. package/dist/{chunk-SXGCCUTH.js → chunk-7KYSCSYI.js} +10 -2
  9. package/dist/chunk-7KYSCSYI.js.map +1 -0
  10. package/dist/{chunk-YXOZJWP3.js → chunk-7Q3PDSOE.js} +2 -2
  11. package/dist/{chunk-L4JYOUGS.js → chunk-C2KXQHOI.js} +193 -76
  12. package/dist/chunk-C2KXQHOI.js.map +1 -0
  13. package/dist/{chunk-GMR4PQX3.js → chunk-DUKSSZ6M.js} +3 -3
  14. package/dist/{chunk-6EMIA36T.js → chunk-MHA6MWFP.js} +2 -2
  15. package/dist/{chunk-3BDCU5QB.js → chunk-OMTMSYUS.js} +2 -1
  16. package/dist/chunk-OMTMSYUS.js.map +1 -0
  17. package/dist/{chunk-HRMPQ4DV.js → chunk-RQYGAYPW.js} +2 -2
  18. package/dist/{chunk-ZAYTTG3M.js → chunk-SW4LP3LX.js} +2 -2
  19. package/dist/{chunk-57HHZMWR.js → chunk-TYFBHM5E.js} +3 -3
  20. package/dist/{chunk-RX6HPZ7A.js → chunk-TYOHFFYJ.js} +2 -2
  21. package/dist/{chunk-TY5BOAAA.js → chunk-VXQEKJTW.js} +5 -2
  22. package/dist/chunk-VXQEKJTW.js.map +1 -0
  23. package/dist/{chunk-VO6JKRLT.js → chunk-WVVJD4K2.js} +2 -2
  24. package/dist/{chunk-ABBXUIMQ.js → chunk-WWUSBGQE.js} +2 -2
  25. package/dist/commands/build/plugins.js +2 -2
  26. package/dist/commands/build/stack.js +2 -2
  27. package/dist/commands/compile.js +2 -2
  28. package/dist/commands/config/index.js +2 -2
  29. package/dist/commands/config/path.js +1 -1
  30. package/dist/commands/config/show.js +2 -2
  31. package/dist/commands/diff.js +1 -1
  32. package/dist/commands/doctor.js +1 -1
  33. package/dist/commands/edit.js +62 -14
  34. package/dist/commands/edit.js.map +1 -1
  35. package/dist/commands/eject.js +1 -1
  36. package/dist/commands/import/skill.js +1 -1
  37. package/dist/commands/info.js +1 -1
  38. package/dist/commands/init.js +13 -13
  39. package/dist/commands/list.js +1 -1
  40. package/dist/commands/new/agent.js +2 -2
  41. package/dist/commands/new/marketplace.js +2 -2
  42. package/dist/commands/new/skill.js +2 -2
  43. package/dist/commands/outdated.js +1 -1
  44. package/dist/commands/search.js +1 -1
  45. package/dist/commands/uninstall.js +1 -1
  46. package/dist/commands/update.js +2 -2
  47. package/dist/commands/validate.js +1 -1
  48. package/dist/components/wizard/category-grid.test.js +3 -3
  49. package/dist/components/wizard/domain-selection.js +3 -3
  50. package/dist/components/wizard/help-modal.js +8 -1
  51. package/dist/components/wizard/source-grid.test.js +3 -3
  52. package/dist/components/wizard/stack-selection.js +3 -3
  53. package/dist/components/wizard/step-agents.js +3 -3
  54. package/dist/components/wizard/step-agents.test.js +4 -4
  55. package/dist/components/wizard/step-build.js +3 -3
  56. package/dist/components/wizard/step-build.test.js +3 -3
  57. package/dist/components/wizard/step-confirm.test.js +2 -2
  58. package/dist/components/wizard/step-settings.js +2 -2
  59. package/dist/components/wizard/step-settings.test.js +5 -5
  60. package/dist/components/wizard/step-sources.js +3 -3
  61. package/dist/components/wizard/step-sources.test.js +4 -4
  62. package/dist/components/wizard/step-stack.js +4 -4
  63. package/dist/components/wizard/step-stack.test.js +4 -4
  64. package/dist/components/wizard/wizard-layout.js +4 -4
  65. package/dist/components/wizard/wizard.js +12 -12
  66. package/dist/hooks/init.js +13 -13
  67. package/dist/{source-loader-C2QCBXOB.js → source-loader-TV2TFYGI.js} +2 -2
  68. package/dist/{source-manager-DLEHJUZL.js → source-manager-3223PJVQ.js} +2 -2
  69. package/dist/stores/wizard-store.js +2 -2
  70. package/dist/stores/wizard-store.test.js +27 -3
  71. package/dist/stores/wizard-store.test.js.map +1 -1
  72. package/package.json +1 -1
  73. package/dist/chunk-3BDCU5QB.js.map +0 -1
  74. package/dist/chunk-4DXSCGVI.js.map +0 -1
  75. package/dist/chunk-L4JYOUGS.js.map +0 -1
  76. package/dist/chunk-SXGCCUTH.js.map +0 -1
  77. package/dist/chunk-TY5BOAAA.js.map +0 -1
  78. package/dist/chunk-ZKQ4XQNO.js.map +0 -1
  79. /package/dist/{chunk-3BM5F4IX.js.map → chunk-262MXFGL.js.map} +0 -0
  80. /package/dist/{chunk-R5LEXRV3.js.map → chunk-4BVJJSKM.js.map} +0 -0
  81. /package/dist/{chunk-YXOZJWP3.js.map → chunk-7Q3PDSOE.js.map} +0 -0
  82. /package/dist/{chunk-GMR4PQX3.js.map → chunk-DUKSSZ6M.js.map} +0 -0
  83. /package/dist/{chunk-6EMIA36T.js.map → chunk-MHA6MWFP.js.map} +0 -0
  84. /package/dist/{chunk-HRMPQ4DV.js.map → chunk-RQYGAYPW.js.map} +0 -0
  85. /package/dist/{chunk-ZAYTTG3M.js.map → chunk-SW4LP3LX.js.map} +0 -0
  86. /package/dist/{chunk-57HHZMWR.js.map → chunk-TYFBHM5E.js.map} +0 -0
  87. /package/dist/{chunk-RX6HPZ7A.js.map → chunk-TYOHFFYJ.js.map} +0 -0
  88. /package/dist/{chunk-VO6JKRLT.js.map → chunk-WVVJD4K2.js.map} +0 -0
  89. /package/dist/{chunk-ABBXUIMQ.js.map → chunk-WWUSBGQE.js.map} +0 -0
  90. /package/dist/{source-loader-C2QCBXOB.js.map → source-loader-TV2TFYGI.js.map} +0 -0
  91. /package/dist/{source-manager-DLEHJUZL.js.map → source-manager-3223PJVQ.js.map} +0 -0
@@ -7,7 +7,6 @@ import {
7
7
  } from "./chunk-XTVWVOLD.js";
8
8
  import {
9
9
  BUILT_IN_MATRIX,
10
- getCategoryDomain,
11
10
  getCustomSkillIds,
12
11
  getSkillById,
13
12
  initializeMatrix,
@@ -521,16 +520,17 @@ function generateProjectConfigFromSkills(name, selectedSkillIds, options) {
521
520
  `${skippedCount}/${selectedSkillIds.length} skills not found in matrix. Matrix keys sample: [${matrixSample}]`
522
521
  );
523
522
  }
524
- const stackProperty = agentList.length > 0 && validSkills.length > 0 ? Object.fromEntries(
523
+ const grouped = /* @__PURE__ */ new Map();
524
+ for (const { skillId, category } of validSkills) {
525
+ const arr = grouped.get(category) ?? [];
526
+ arr.push({ id: skillId, preloaded: false });
527
+ grouped.set(category, arr);
528
+ }
529
+ const stackProperty = agentList.length > 0 && grouped.size > 0 ? Object.fromEntries(
525
530
  agentList.map((agentId) => [
526
531
  agentId,
527
532
  // Structural cast: Object.fromEntries returns Record<string, V>, narrowing to typed keys
528
- Object.fromEntries(
529
- validSkills.map(({ skillId, category }) => [
530
- category,
531
- [{ id: skillId, preloaded: false }]
532
- ])
533
- )
533
+ Object.fromEntries(grouped)
534
534
  ])
535
535
  ) : void 0;
536
536
  const skills = options?.skillConfigs ?? selectedSkillIds.map((id) => ({ id, scope: "project", source: "local" }));
@@ -559,22 +559,6 @@ function buildStackProperty(stack) {
559
559
  }).filter(([, mappings]) => typedKeys(mappings).length > 0)
560
560
  );
561
561
  }
562
- function compactAssignment(assignment) {
563
- return assignment.preloaded ? { id: assignment.id, preloaded: true } : assignment.id;
564
- }
565
- function compactStackForYaml(stack) {
566
- return Object.fromEntries(
567
- typedEntries(stack).map(([agentId, agentConfig]) => {
568
- const compacted = Object.fromEntries(
569
- typedEntries(agentConfig).filter(([, assignments]) => assignments && assignments.length > 0).map(([category, assignments]) => [
570
- category,
571
- assignments.length === 1 ? compactAssignment(assignments[0]) : assignments.map(compactAssignment)
572
- ])
573
- );
574
- return [agentId, compacted];
575
- }).filter(([, compacted]) => Object.keys(compacted).length > 0)
576
- );
577
- }
578
562
  function splitConfigByScope(config) {
579
563
  const globalSkills = config.skills.filter((s) => s.scope === "global");
580
564
  const projectSkills = config.skills.filter((s) => s.scope === "project");
@@ -587,18 +571,26 @@ function splitConfigByScope(config) {
587
571
  for (const agent of globalAgents) {
588
572
  const agentStack = config.stack[agent.name];
589
573
  if (agentStack) {
590
- const filtered = {};
574
+ const globalFiltered = {};
575
+ const projectFiltered = {};
591
576
  for (const [category, assignments] of typedEntries(
592
577
  agentStack
593
578
  )) {
594
579
  if (!assignments) continue;
595
580
  const globalOnly = assignments.filter((a) => globalSkillIds.has(a.id));
581
+ const projectOnly = assignments.filter((a) => !globalSkillIds.has(a.id));
596
582
  if (globalOnly.length > 0) {
597
- filtered[category] = globalOnly;
583
+ globalFiltered[category] = globalOnly;
584
+ }
585
+ if (projectOnly.length > 0) {
586
+ projectFiltered[category] = projectOnly;
598
587
  }
599
588
  }
600
- if (typedKeys(filtered).length > 0) {
601
- globalStack[agent.name] = filtered;
589
+ if (typedKeys(globalFiltered).length > 0) {
590
+ globalStack[agent.name] = globalFiltered;
591
+ }
592
+ if (typedKeys(projectFiltered).length > 0) {
593
+ projectStack[agent.name] = projectFiltered;
602
594
  }
603
595
  }
604
596
  }
@@ -971,9 +963,11 @@ function formatSkillUnion(skills) {
971
963
  }
972
964
  function generateStackAgentConfig(skillsByCategory) {
973
965
  if (skillsByCategory.size === 0) {
974
- return "export type StackAgentConfig = Partial<Record<Category, SkillAssignment>>;";
966
+ return "export type StackAgentConfig = Partial<Record<Category, SkillAssignment[]>>;";
975
967
  }
976
- const properties = [...skillsByCategory.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([category, skills]) => ` "${category}"?: SkillAssignment<${formatSkillUnion(skills)}>;`);
968
+ const properties = [...skillsByCategory.entries()].sort(([a], [b]) => a.localeCompare(b)).map(
969
+ ([category, skills]) => ` "${category}"?: SkillAssignment<${formatSkillUnion(skills)}>[];`
970
+ );
977
971
  return ["export type StackAgentConfig = {", ...properties, "};"].join("\n");
978
972
  }
979
973
  function buildSkillsByCategory(skillIds, categories, matrix2) {
@@ -996,7 +990,7 @@ function loadConfigTypesDataInBackground(sourceFlag, projectDir) {
996
990
  if (!await directoryExists(claudeSrcDir)) {
997
991
  throw new Error(`${CLAUDE_SRC_DIR}/ not found \u2014 run '${CLI_BIN_NAME} init' first`);
998
992
  }
999
- const { loadSkillsMatrixFromSource: loadSkillsMatrixFromSource2 } = await import("./source-loader-C2QCBXOB.js");
993
+ const { loadSkillsMatrixFromSource: loadSkillsMatrixFromSource2 } = await import("./source-loader-TV2TFYGI.js");
1000
994
  const { loadAllAgents: loadAllAgents2 } = await import("./loader-4XPDVCZK.js");
1001
995
  const sourceResult = await loadSkillsMatrixFromSource2({
1002
996
  sourceFlag,
@@ -1206,7 +1200,7 @@ export type Domain = ${domainUnion};
1206
1200
  export type Category = ${categoryUnion};
1207
1201
 
1208
1202
  ${PROJECT_CONFIG_TYPES_BEFORE}
1209
- export type StackAgentConfig = Partial<Record<Category, SkillAssignment>>;
1203
+ export type StackAgentConfig = Partial<Record<Category, SkillAssignment[]>>;
1210
1204
 
1211
1205
  ${PROJECT_CONFIG_INTERFACE_AFTER}`;
1212
1206
  }
@@ -1227,8 +1221,31 @@ function formatExtendedUnion(globalTypeName, projectMembers) {
1227
1221
  // src/cli/lib/configuration/config-writer.ts
1228
1222
  var EXTRACTED_FIELDS = /* @__PURE__ */ new Set(["skills", "agents", "stack", "domains"]);
1229
1223
  function generateConfigSource(config, options) {
1230
- const serializable = config.stack ? { ...config, stack: compactStackForYaml(config.stack) } : { ...config };
1231
- const cleaned = JSON.parse(JSON.stringify(serializable));
1224
+ if (options?.isProjectConfig) {
1225
+ if (options.globalConfig) {
1226
+ const cleanedProject = JSON.parse(JSON.stringify(config));
1227
+ const cleanedGlobal = JSON.parse(
1228
+ JSON.stringify(options.globalConfig)
1229
+ );
1230
+ if (cleanedProject.stack) {
1231
+ cleanedProject.stack = compactStackAssignments(
1232
+ cleanedProject.stack
1233
+ );
1234
+ }
1235
+ if (cleanedGlobal.stack) {
1236
+ cleanedGlobal.stack = compactStackAssignments(
1237
+ cleanedGlobal.stack
1238
+ );
1239
+ }
1240
+ return generateProjectConfigWithInlinedGlobal(cleanedProject, cleanedGlobal);
1241
+ }
1242
+ }
1243
+ const cleaned = JSON.parse(JSON.stringify(config));
1244
+ if (cleaned.stack) {
1245
+ cleaned.stack = compactStackAssignments(
1246
+ cleaned.stack
1247
+ );
1248
+ }
1232
1249
  if (options?.isProjectConfig) {
1233
1250
  return generateProjectConfigWithGlobalImport(cleaned, getGlobalConfigImportPath());
1234
1251
  }
@@ -1377,6 +1394,141 @@ function generateProjectConfigWithGlobalImport(cleaned, globalImportPath) {
1377
1394
  lines.push(``);
1378
1395
  return lines.join("\n");
1379
1396
  }
1397
+ function generateProjectConfigWithInlinedGlobal(cleaned, cleanedGlobal) {
1398
+ const projectSkillsArr = cleaned.skills ?? [];
1399
+ const projectAgentsArr = cleaned.agents ?? [];
1400
+ const projectStackObj = cleaned.stack;
1401
+ const projectDomainsArr = cleaned.domains ?? [];
1402
+ const projectSelectedAgentsArr = cleaned.selectedAgents ?? [];
1403
+ const globalSkillsArr = cleanedGlobal.skills ?? [];
1404
+ const globalAgentsArr = cleanedGlobal.agents ?? [];
1405
+ const globalDomainsArr = cleanedGlobal.domains ?? [];
1406
+ const globalSelectedAgentsArr = cleanedGlobal.selectedAgents ?? [];
1407
+ const hasGlobalSkills = globalSkillsArr.length > 0;
1408
+ const hasProjectSkills = projectSkillsArr.length > 0;
1409
+ const hasSkills = hasGlobalSkills || hasProjectSkills;
1410
+ const hasGlobalAgents = globalAgentsArr.length > 0;
1411
+ const hasProjectAgents = projectAgentsArr.length > 0;
1412
+ const hasAgents = hasGlobalAgents || hasProjectAgents;
1413
+ const projectAgentNames = new Set(projectAgentsArr.map((a) => a.name));
1414
+ const filteredStack = projectStackObj ? Object.fromEntries(
1415
+ Object.entries(projectStackObj).filter(([agent]) => projectAgentNames.has(agent))
1416
+ ) : void 0;
1417
+ const hasStack = filteredStack != null && Object.keys(filteredStack).length > 0;
1418
+ const hasGlobalDomains = globalDomainsArr.length > 0;
1419
+ const hasProjectDomains = projectDomainsArr.length > 0;
1420
+ const hasDomains = hasGlobalDomains || hasProjectDomains;
1421
+ const typeImports = buildTypeImports({ hasSkills, hasAgents, hasStack, hasDomains });
1422
+ const lines = [`import type { ${typeImports} } from "./config-types";`];
1423
+ if (hasSkills) {
1424
+ lines.push(``);
1425
+ lines.push(`const skills: SkillConfig[] = [`);
1426
+ if (hasGlobalSkills) {
1427
+ lines.push(` // global`);
1428
+ for (const s of globalSkillsArr) {
1429
+ lines.push(` ${JSON.stringify(s)},`);
1430
+ }
1431
+ }
1432
+ if (hasProjectSkills) {
1433
+ lines.push(` // project`);
1434
+ for (const s of projectSkillsArr) {
1435
+ lines.push(` ${JSON.stringify(s)},`);
1436
+ }
1437
+ }
1438
+ lines.push(`];`);
1439
+ }
1440
+ if (hasAgents) {
1441
+ lines.push(``);
1442
+ lines.push(`const agents: AgentScopeConfig[] = [`);
1443
+ if (hasGlobalAgents) {
1444
+ lines.push(` // global`);
1445
+ for (const a of globalAgentsArr) {
1446
+ lines.push(` ${JSON.stringify(a)},`);
1447
+ }
1448
+ }
1449
+ if (hasProjectAgents) {
1450
+ lines.push(` // project`);
1451
+ for (const a of projectAgentsArr) {
1452
+ lines.push(` ${JSON.stringify(a)},`);
1453
+ }
1454
+ }
1455
+ lines.push(`];`);
1456
+ }
1457
+ if (hasStack) {
1458
+ lines.push(``);
1459
+ const stackBody = JSON.stringify(filteredStack, null, 2);
1460
+ lines.push(`const stack: Partial<Record<AgentName, StackAgentConfig>> = ${stackBody};`);
1461
+ }
1462
+ if (hasDomains) {
1463
+ lines.push(``);
1464
+ const allDomains = [.../* @__PURE__ */ new Set([...globalDomainsArr, ...projectDomainsArr])];
1465
+ const items = allDomains.map((d) => JSON.stringify(d)).join(", ");
1466
+ lines.push(`const domains: Domain[] = [${items}];`);
1467
+ }
1468
+ const projectName = cleaned.name && cleaned.name !== "global" ? cleaned.name : DEFAULT_PLUGIN_NAME;
1469
+ const exportFields = [];
1470
+ exportFields.push(` name: ${JSON.stringify(projectName)},`);
1471
+ const projectScalarFields = Object.entries(cleaned).filter(
1472
+ ([key]) => !EXTRACTED_FIELDS.has(key) && key !== "name" && key !== "selectedAgents"
1473
+ );
1474
+ const projectScalarKeys = new Set(projectScalarFields.map(([key]) => key));
1475
+ const globalScalarFields = Object.entries(cleanedGlobal).filter(
1476
+ ([key]) => !EXTRACTED_FIELDS.has(key) && key !== "name" && key !== "selectedAgents" && !projectScalarKeys.has(key)
1477
+ );
1478
+ for (const [key, value] of globalScalarFields) {
1479
+ exportFields.push(` ${JSON.stringify(key)}: ${JSON.stringify(value)},`);
1480
+ }
1481
+ for (const [key, value] of projectScalarFields) {
1482
+ exportFields.push(` ${JSON.stringify(key)}: ${JSON.stringify(value)},`);
1483
+ }
1484
+ if (hasSkills) {
1485
+ exportFields.push(` skills,`);
1486
+ } else {
1487
+ exportFields.push(` skills: [],`);
1488
+ }
1489
+ if (hasAgents) {
1490
+ exportFields.push(` agents,`);
1491
+ } else {
1492
+ exportFields.push(` agents: [],`);
1493
+ }
1494
+ if (hasStack) {
1495
+ exportFields.push(` stack,`);
1496
+ }
1497
+ if (hasDomains) {
1498
+ exportFields.push(` domains,`);
1499
+ }
1500
+ const allSelectedAgents = [.../* @__PURE__ */ new Set([...globalSelectedAgentsArr, ...projectSelectedAgentsArr])];
1501
+ if (allSelectedAgents.length > 0) {
1502
+ const items = allSelectedAgents.map((a) => JSON.stringify(a)).join(", ");
1503
+ exportFields.push(` "selectedAgents": [${items}],`);
1504
+ }
1505
+ lines.push(``);
1506
+ lines.push(`export default {`);
1507
+ lines.push(...exportFields);
1508
+ lines.push(`} satisfies ProjectConfig;`);
1509
+ lines.push(``);
1510
+ return lines.join("\n");
1511
+ }
1512
+ function compactStackAssignments(stack) {
1513
+ const result = {};
1514
+ for (const [agent, categories] of Object.entries(stack)) {
1515
+ const compactedCategories = {};
1516
+ for (const [category, assignments] of Object.entries(categories)) {
1517
+ if (!Array.isArray(assignments) || assignments.length === 0) continue;
1518
+ compactedCategories[category] = assignments.map((a) => {
1519
+ if (typeof a === "object" && a !== null && "id" in a && "preloaded" in a) {
1520
+ const assignment = a;
1521
+ return assignment.preloaded ? { id: assignment.id, preloaded: true } : assignment.id;
1522
+ }
1523
+ return a;
1524
+ });
1525
+ }
1526
+ if (Object.keys(compactedCategories).length > 0) {
1527
+ result[agent] = compactedCategories;
1528
+ }
1529
+ }
1530
+ return result;
1531
+ }
1380
1532
  function getGlobalConfigImportPath() {
1381
1533
  return path6.join(os4.homedir(), CLAUDE_SRC_DIR);
1382
1534
  }
@@ -1403,7 +1555,7 @@ export type Domain = never;
1403
1555
  export type Category = never;
1404
1556
 
1405
1557
  ${PROJECT_CONFIG_TYPES_BEFORE}
1406
- export type StackAgentConfig = Partial<Record<Category, SkillAssignment>>;
1558
+ export type StackAgentConfig = Partial<Record<Category, SkillAssignment[]>>;
1407
1559
 
1408
1560
  ${PROJECT_CONFIG_INTERFACE_AFTER}`;
1409
1561
  }
@@ -3842,44 +3994,6 @@ async function writeStandaloneConfigTypes(configPath, matrix2, agents, finalConf
3842
3994
  );
3843
3995
  await writeFile(typesPath, source);
3844
3996
  }
3845
- async function writeProjectConfigTypes(projectConfigPath, projectDir, projectConfig, matrix2) {
3846
- const typesPath = path20.join(path20.dirname(projectConfigPath), STANDARD_FILES.CONFIG_TYPES_TS);
3847
- const projectClaudeSrc = path20.join(projectDir, CLAUDE_SRC_DIR);
3848
- const globalClaudeSrc = path20.join(os8.homedir(), CLAUDE_SRC_DIR);
3849
- const relativePath = path20.relative(projectClaudeSrc, globalClaudeSrc);
3850
- const globalTypesImportPath = relativePath.split(path20.sep).join("/");
3851
- const projectSkillIds = projectConfig?.skills.map((s) => s.id) ?? [];
3852
- const projectAgentNames = projectConfig?.agents.map((a) => a.name) ?? [];
3853
- let projectCategories = [];
3854
- let projectDomains = [];
3855
- if (matrix2 && projectSkillIds.length > 0) {
3856
- const categorySet = /* @__PURE__ */ new Set();
3857
- for (const id of projectSkillIds) {
3858
- const skill = matrix2.skills[id];
3859
- if (skill?.category && skill.category !== "local") {
3860
- categorySet.add(skill.category);
3861
- }
3862
- }
3863
- projectCategories = [...categorySet].sort();
3864
- const domainSet = /* @__PURE__ */ new Set();
3865
- for (const cat of projectCategories) {
3866
- const domain = getCategoryDomain(cat);
3867
- if (domain) {
3868
- domainSet.add(domain);
3869
- }
3870
- }
3871
- projectDomains = [...domainSet].sort();
3872
- }
3873
- const source = generateProjectConfigTypesSource({
3874
- globalTypesImportPath,
3875
- projectSkillIds,
3876
- projectAgentNames,
3877
- projectDomains,
3878
- projectCategories
3879
- });
3880
- await writeFile(typesPath, source);
3881
- verbose("Using project config-types.ts that imports from global");
3882
- }
3883
3997
  async function writeScopedConfigs(finalConfig, matrix2, agents, projectDir, projectConfigPath, projectInstallationExists) {
3884
3998
  const homeDir = os8.homedir();
3885
3999
  const isProjectContext = fs.realpathSync(projectDir) !== fs.realpathSync(homeDir);
@@ -3898,9 +4012,12 @@ async function writeScopedConfigs(finalConfig, matrix2, agents, projectDir, proj
3898
4012
  const hasProjectItems = projectSplitConfig.skills.length > 0 || projectSplitConfig.agents.length > 0;
3899
4013
  if (projectInstallationExists || hasProjectItems) {
3900
4014
  await ensureDir(path20.dirname(projectConfigPath));
3901
- await writeConfigFile(projectSplitConfig, projectConfigPath, { isProjectConfig: true });
4015
+ await writeConfigFile(projectSplitConfig, projectConfigPath, {
4016
+ isProjectConfig: true,
4017
+ globalConfig
4018
+ });
3902
4019
  verbose(`Updated project config at ${projectConfigPath}`);
3903
- await writeProjectConfigTypes(projectConfigPath, projectDir, projectSplitConfig, matrix2);
4020
+ await writeStandaloneConfigTypes(projectConfigPath, matrix2, agents, finalConfig);
3904
4021
  } else {
3905
4022
  verbose(
3906
4023
  "Skipped project config \u2014 no existing project installation and no project-scoped items"
@@ -5611,4 +5728,4 @@ export {
5611
5728
  validateAllPlugins,
5612
5729
  printPluginValidationResult
5613
5730
  };
5614
- //# sourceMappingURL=chunk-L4JYOUGS.js.map
5731
+ //# sourceMappingURL=chunk-C2KXQHOI.js.map