@agents-inc/cli 0.82.4 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +34 -22
- package/dist/{chunk-5BRHJD7Q.js → chunk-23UI23AW.js} +2 -2
- package/dist/{chunk-3PB7KSF7.js → chunk-2AHXUWHO.js} +4 -4
- package/dist/{chunk-32HQMUEJ.js → chunk-2BF4WAYU.js} +2 -2
- package/dist/{chunk-RTXJLZ7A.js → chunk-2EPX6D74.js} +4 -4
- package/dist/{chunk-KEW246HB.js → chunk-2PXXNFTL.js} +4 -4
- package/dist/{chunk-WYHFSJ7O.js → chunk-2XLBC3W6.js} +2 -2
- package/dist/{chunk-WYHFSJ7O.js.map → chunk-2XLBC3W6.js.map} +1 -1
- package/dist/{chunk-FBLRTXEA.js → chunk-33AA7KWH.js} +6 -6
- package/dist/{chunk-63E7LOLB.js → chunk-3JTBSJDE.js} +2 -2
- package/dist/{chunk-M2CS5EOK.js → chunk-3PECYFYB.js} +5 -5
- package/dist/{chunk-C4I4Q33M.js → chunk-4IAGARTF.js} +2 -2
- package/dist/{chunk-AD2UT2TN.js → chunk-AZLM7OCV.js} +2 -2
- package/dist/{chunk-IMO6EQKT.js → chunk-DFFH7HQZ.js} +2 -2
- package/dist/{chunk-5AHKXBNC.js → chunk-DGZ7HWIG.js} +3 -3
- package/dist/{chunk-SOEIE4VA.js → chunk-DIIL3ELZ.js} +2 -2
- package/dist/{chunk-FIXWR56O.js → chunk-GWXZSQUS.js} +3 -3
- package/dist/{chunk-3MXMYHO3.js → chunk-HQNFKBZW.js} +17 -17
- package/dist/{chunk-3MXMYHO3.js.map → chunk-HQNFKBZW.js.map} +1 -1
- package/dist/{chunk-LOB3OU2D.js → chunk-IG5B34MJ.js} +4 -4
- package/dist/{chunk-GEU62YD2.js → chunk-J7VVUJ6I.js} +2 -2
- package/dist/{chunk-LQ3EJBUN.js → chunk-KJX5G75S.js} +4 -4
- package/dist/{chunk-K76AXQ7A.js → chunk-LI5NJ4VQ.js} +3 -3
- package/dist/{chunk-35ESNSF5.js → chunk-LVIMGRFS.js} +5 -5
- package/dist/chunk-LVIMGRFS.js.map +1 -0
- package/dist/{chunk-FS4YWW36.js → chunk-ND4ZJOT7.js} +3 -3
- package/dist/{chunk-IMP35ETG.js → chunk-NPMMU4GY.js} +17 -17
- package/dist/chunk-NPMMU4GY.js.map +1 -0
- package/dist/{chunk-KB6LCTCD.js → chunk-PTKJKDYH.js} +186 -77
- package/dist/chunk-PTKJKDYH.js.map +1 -0
- package/dist/{chunk-X2HE3W74.js → chunk-SD3HTFUK.js} +2 -2
- package/dist/{chunk-AAW3PYXA.js → chunk-TE4LD3WR.js} +2 -2
- package/dist/{chunk-XTVWVOLD.js → chunk-XAVVPPWP.js} +2 -2
- package/dist/{chunk-JQDOUNHF.js → chunk-XCRX5WVX.js} +13 -13
- package/dist/{chunk-KZLGBHDZ.js → chunk-XGFLPLNO.js} +5 -5
- package/dist/{chunk-3BDCU5QB.js → chunk-ZYTLL3MM.js} +4 -3
- package/dist/chunk-ZYTLL3MM.js.map +1 -0
- package/dist/commands/build/marketplace.js +4 -4
- package/dist/commands/build/plugins.js +8 -8
- package/dist/commands/build/stack.js +8 -8
- package/dist/commands/compile.js +8 -8
- package/dist/commands/config/index.js +8 -8
- package/dist/commands/config/path.js +7 -7
- package/dist/commands/config/show.js +8 -8
- package/dist/commands/diff.js +7 -7
- package/dist/commands/doctor.js +7 -7
- package/dist/commands/edit.js +23 -23
- package/dist/commands/eject.js +7 -7
- package/dist/commands/import/skill.js +7 -7
- package/dist/commands/info.js +7 -7
- package/dist/commands/init.js +23 -23
- package/dist/commands/list.js +7 -7
- package/dist/commands/new/agent.js +8 -8
- package/dist/commands/new/marketplace.js +9 -9
- package/dist/commands/new/skill.js +8 -8
- package/dist/commands/outdated.js +7 -7
- package/dist/commands/search.js +7 -7
- package/dist/commands/uninstall.js +7 -7
- package/dist/commands/update.js +8 -8
- package/dist/commands/validate.js +7 -7
- package/dist/components/wizard/category-grid.js +2 -2
- package/dist/components/wizard/category-grid.test.js +11 -11
- package/dist/components/wizard/domain-selection.js +9 -9
- package/dist/components/wizard/help-modal.js +8 -8
- package/dist/components/wizard/source-grid.js +2 -2
- package/dist/components/wizard/source-grid.test.js +11 -11
- package/dist/components/wizard/stack-selection.js +8 -8
- package/dist/components/wizard/step-agents.js +9 -9
- package/dist/components/wizard/step-agents.test.js +13 -13
- package/dist/components/wizard/step-agents.test.js.map +1 -1
- package/dist/components/wizard/step-build.js +9 -9
- package/dist/components/wizard/step-build.test.js +12 -12
- package/dist/components/wizard/step-confirm.js +4 -4
- package/dist/components/wizard/step-confirm.test.js +10 -10
- package/dist/components/wizard/step-settings.js +7 -7
- package/dist/components/wizard/step-settings.test.js +10 -10
- package/dist/components/wizard/step-sources.js +9 -9
- package/dist/components/wizard/step-sources.test.js +12 -12
- package/dist/components/wizard/step-stack.js +9 -9
- package/dist/components/wizard/step-stack.test.js +10 -10
- package/dist/components/wizard/wizard-layout.js +10 -10
- package/dist/components/wizard/wizard.js +21 -21
- package/dist/config-exports.js +1 -1
- package/dist/hooks/init.js +23 -23
- package/dist/{loader-4XPDVCZK.js → loader-LI4IFZB7.js} +4 -4
- package/dist/{source-loader-FMDHHYDQ.js → source-loader-GHDWSV2H.js} +7 -7
- package/dist/source-manager-7RTGIBQK.js +19 -0
- package/dist/src/agents/meta/agent-summoner/workflow.md +10 -10
- package/{src/agents/meta/scribe → dist/src/agents/meta/codex-keeper}/intro.md +2 -0
- package/dist/src/agents/meta/codex-keeper/metadata.yaml +12 -0
- package/dist/src/agents/meta/{scribe → codex-keeper}/output-format.md +2 -2
- package/dist/src/agents/meta/{scribe → codex-keeper}/workflow.md +54 -29
- package/dist/src/agents/meta/convention-keeper/critical-reminders.md +3 -3
- package/dist/src/agents/meta/convention-keeper/critical-requirements.md +3 -3
- package/dist/src/agents/meta/convention-keeper/examples.md +3 -3
- package/dist/src/agents/meta/convention-keeper/intro.md +3 -3
- package/dist/src/agents/meta/convention-keeper/output-format.md +9 -9
- package/dist/src/agents/meta/convention-keeper/workflow.md +15 -15
- package/dist/src/agents/planning/web-pm/workflow.md +1 -1
- package/dist/stores/wizard-store.js +7 -7
- package/dist/stores/wizard-store.test.js +13 -13
- package/dist/stores/wizard-store.test.js.map +1 -1
- package/package.json +1 -1
- package/src/agents/meta/agent-summoner/workflow.md +10 -10
- package/{dist/src/agents/meta/scribe → src/agents/meta/codex-keeper}/intro.md +2 -0
- package/src/agents/meta/codex-keeper/metadata.yaml +12 -0
- package/src/agents/meta/{scribe → codex-keeper}/output-format.md +2 -2
- package/src/agents/meta/{scribe → codex-keeper}/workflow.md +54 -29
- package/src/agents/meta/convention-keeper/critical-reminders.md +3 -3
- package/src/agents/meta/convention-keeper/critical-requirements.md +3 -3
- package/src/agents/meta/convention-keeper/examples.md +3 -3
- package/src/agents/meta/convention-keeper/intro.md +3 -3
- package/src/agents/meta/convention-keeper/output-format.md +9 -9
- package/src/agents/meta/convention-keeper/workflow.md +15 -15
- package/src/agents/planning/web-pm/workflow.md +1 -1
- package/dist/chunk-35ESNSF5.js.map +0 -1
- package/dist/chunk-3BDCU5QB.js.map +0 -1
- package/dist/chunk-IMP35ETG.js.map +0 -1
- package/dist/chunk-KB6LCTCD.js.map +0 -1
- package/dist/source-manager-YMJ4Z5UG.js +0 -19
- package/dist/src/agents/meta/scribe/metadata.yaml +0 -12
- package/src/agents/meta/scribe/metadata.yaml +0 -12
- /package/dist/{chunk-5BRHJD7Q.js.map → chunk-23UI23AW.js.map} +0 -0
- /package/dist/{chunk-3PB7KSF7.js.map → chunk-2AHXUWHO.js.map} +0 -0
- /package/dist/{chunk-32HQMUEJ.js.map → chunk-2BF4WAYU.js.map} +0 -0
- /package/dist/{chunk-RTXJLZ7A.js.map → chunk-2EPX6D74.js.map} +0 -0
- /package/dist/{chunk-KEW246HB.js.map → chunk-2PXXNFTL.js.map} +0 -0
- /package/dist/{chunk-FBLRTXEA.js.map → chunk-33AA7KWH.js.map} +0 -0
- /package/dist/{chunk-63E7LOLB.js.map → chunk-3JTBSJDE.js.map} +0 -0
- /package/dist/{chunk-M2CS5EOK.js.map → chunk-3PECYFYB.js.map} +0 -0
- /package/dist/{chunk-C4I4Q33M.js.map → chunk-4IAGARTF.js.map} +0 -0
- /package/dist/{chunk-AD2UT2TN.js.map → chunk-AZLM7OCV.js.map} +0 -0
- /package/dist/{chunk-IMO6EQKT.js.map → chunk-DFFH7HQZ.js.map} +0 -0
- /package/dist/{chunk-5AHKXBNC.js.map → chunk-DGZ7HWIG.js.map} +0 -0
- /package/dist/{chunk-SOEIE4VA.js.map → chunk-DIIL3ELZ.js.map} +0 -0
- /package/dist/{chunk-FIXWR56O.js.map → chunk-GWXZSQUS.js.map} +0 -0
- /package/dist/{chunk-LOB3OU2D.js.map → chunk-IG5B34MJ.js.map} +0 -0
- /package/dist/{chunk-GEU62YD2.js.map → chunk-J7VVUJ6I.js.map} +0 -0
- /package/dist/{chunk-LQ3EJBUN.js.map → chunk-KJX5G75S.js.map} +0 -0
- /package/dist/{chunk-K76AXQ7A.js.map → chunk-LI5NJ4VQ.js.map} +0 -0
- /package/dist/{chunk-FS4YWW36.js.map → chunk-ND4ZJOT7.js.map} +0 -0
- /package/dist/{chunk-X2HE3W74.js.map → chunk-SD3HTFUK.js.map} +0 -0
- /package/dist/{chunk-AAW3PYXA.js.map → chunk-TE4LD3WR.js.map} +0 -0
- /package/dist/{chunk-XTVWVOLD.js.map → chunk-XAVVPPWP.js.map} +0 -0
- /package/dist/{chunk-JQDOUNHF.js.map → chunk-XCRX5WVX.js.map} +0 -0
- /package/dist/{chunk-KZLGBHDZ.js.map → chunk-XGFLPLNO.js.map} +0 -0
- /package/dist/{loader-4XPDVCZK.js.map → loader-LI4IFZB7.js.map} +0 -0
- /package/dist/{source-loader-FMDHHYDQ.js.map → source-loader-GHDWSV2H.js.map} +0 -0
- /package/dist/{source-manager-YMJ4Z5UG.js.map → source-manager-7RTGIBQK.js.map} +0 -0
- /package/dist/src/agents/meta/{scribe → codex-keeper}/critical-reminders.md +0 -0
- /package/dist/src/agents/meta/{scribe → codex-keeper}/critical-requirements.md +0 -0
- /package/dist/src/agents/meta/{scribe → codex-keeper}/examples.md +0 -0
- /package/src/agents/meta/{scribe → codex-keeper}/critical-reminders.md +0 -0
- /package/src/agents/meta/{scribe → codex-keeper}/critical-requirements.md +0 -0
- /package/src/agents/meta/{scribe → codex-keeper}/examples.md +0 -0
|
@@ -4,17 +4,16 @@ import {
|
|
|
4
4
|
loadPluginSkills,
|
|
5
5
|
loadSkillsByIds,
|
|
6
6
|
parseFrontmatter
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XAVVPPWP.js";
|
|
8
8
|
import {
|
|
9
9
|
BUILT_IN_MATRIX,
|
|
10
|
-
getCategoryDomain,
|
|
11
10
|
getCustomSkillIds,
|
|
12
11
|
getSkillById,
|
|
13
12
|
initializeMatrix,
|
|
14
13
|
matrix,
|
|
15
14
|
typedEntries,
|
|
16
15
|
typedKeys
|
|
17
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HQNFKBZW.js";
|
|
18
17
|
import {
|
|
19
18
|
SKILL_ID_PATTERN,
|
|
20
19
|
agentFrontmatterValidationSchema,
|
|
@@ -53,7 +52,7 @@ import {
|
|
|
53
52
|
warn,
|
|
54
53
|
warnUnknownFields,
|
|
55
54
|
writeFile
|
|
56
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-2BF4WAYU.js";
|
|
57
56
|
import {
|
|
58
57
|
CACHE_DIR,
|
|
59
58
|
CACHE_HASH_LENGTH,
|
|
@@ -94,7 +93,7 @@ import {
|
|
|
94
93
|
defaultCategories,
|
|
95
94
|
defaultRules,
|
|
96
95
|
defaultStacks
|
|
97
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-NPMMU4GY.js";
|
|
98
97
|
import {
|
|
99
98
|
init_esm_shims
|
|
100
99
|
} from "./chunk-DHET7RCE.js";
|
|
@@ -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
|
|
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");
|
|
@@ -979,9 +963,11 @@ function formatSkillUnion(skills) {
|
|
|
979
963
|
}
|
|
980
964
|
function generateStackAgentConfig(skillsByCategory) {
|
|
981
965
|
if (skillsByCategory.size === 0) {
|
|
982
|
-
return "export type StackAgentConfig = Partial<Record<Category, SkillAssignment>>;";
|
|
966
|
+
return "export type StackAgentConfig = Partial<Record<Category, SkillAssignment[]>>;";
|
|
983
967
|
}
|
|
984
|
-
const properties = [...skillsByCategory.entries()].sort(([a], [b]) => a.localeCompare(b)).map(
|
|
968
|
+
const properties = [...skillsByCategory.entries()].sort(([a], [b]) => a.localeCompare(b)).map(
|
|
969
|
+
([category, skills]) => ` "${category}"?: SkillAssignment<${formatSkillUnion(skills)}>[];`
|
|
970
|
+
);
|
|
985
971
|
return ["export type StackAgentConfig = {", ...properties, "};"].join("\n");
|
|
986
972
|
}
|
|
987
973
|
function buildSkillsByCategory(skillIds, categories, matrix2) {
|
|
@@ -1004,8 +990,8 @@ function loadConfigTypesDataInBackground(sourceFlag, projectDir) {
|
|
|
1004
990
|
if (!await directoryExists(claudeSrcDir)) {
|
|
1005
991
|
throw new Error(`${CLAUDE_SRC_DIR}/ not found \u2014 run '${CLI_BIN_NAME} init' first`);
|
|
1006
992
|
}
|
|
1007
|
-
const { loadSkillsMatrixFromSource: loadSkillsMatrixFromSource2 } = await import("./source-loader-
|
|
1008
|
-
const { loadAllAgents: loadAllAgents2 } = await import("./loader-
|
|
993
|
+
const { loadSkillsMatrixFromSource: loadSkillsMatrixFromSource2 } = await import("./source-loader-GHDWSV2H.js");
|
|
994
|
+
const { loadAllAgents: loadAllAgents2 } = await import("./loader-LI4IFZB7.js");
|
|
1009
995
|
const sourceResult = await loadSkillsMatrixFromSource2({
|
|
1010
996
|
sourceFlag,
|
|
1011
997
|
projectDir,
|
|
@@ -1214,7 +1200,7 @@ export type Domain = ${domainUnion};
|
|
|
1214
1200
|
export type Category = ${categoryUnion};
|
|
1215
1201
|
|
|
1216
1202
|
${PROJECT_CONFIG_TYPES_BEFORE}
|
|
1217
|
-
export type StackAgentConfig = Partial<Record<Category, SkillAssignment>>;
|
|
1203
|
+
export type StackAgentConfig = Partial<Record<Category, SkillAssignment[]>>;
|
|
1218
1204
|
|
|
1219
1205
|
${PROJECT_CONFIG_INTERFACE_AFTER}`;
|
|
1220
1206
|
}
|
|
@@ -1235,8 +1221,31 @@ function formatExtendedUnion(globalTypeName, projectMembers) {
|
|
|
1235
1221
|
// src/cli/lib/configuration/config-writer.ts
|
|
1236
1222
|
var EXTRACTED_FIELDS = /* @__PURE__ */ new Set(["skills", "agents", "stack", "domains"]);
|
|
1237
1223
|
function generateConfigSource(config, options) {
|
|
1238
|
-
|
|
1239
|
-
|
|
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
|
+
}
|
|
1240
1249
|
if (options?.isProjectConfig) {
|
|
1241
1250
|
return generateProjectConfigWithGlobalImport(cleaned, getGlobalConfigImportPath());
|
|
1242
1251
|
}
|
|
@@ -1385,6 +1394,141 @@ function generateProjectConfigWithGlobalImport(cleaned, globalImportPath) {
|
|
|
1385
1394
|
lines.push(``);
|
|
1386
1395
|
return lines.join("\n");
|
|
1387
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
|
+
}
|
|
1388
1532
|
function getGlobalConfigImportPath() {
|
|
1389
1533
|
return path6.join(os4.homedir(), CLAUDE_SRC_DIR);
|
|
1390
1534
|
}
|
|
@@ -1411,7 +1555,7 @@ export type Domain = never;
|
|
|
1411
1555
|
export type Category = never;
|
|
1412
1556
|
|
|
1413
1557
|
${PROJECT_CONFIG_TYPES_BEFORE}
|
|
1414
|
-
export type StackAgentConfig = Partial<Record<Category, SkillAssignment>>;
|
|
1558
|
+
export type StackAgentConfig = Partial<Record<Category, SkillAssignment[]>>;
|
|
1415
1559
|
|
|
1416
1560
|
${PROJECT_CONFIG_INTERFACE_AFTER}`;
|
|
1417
1561
|
}
|
|
@@ -3850,44 +3994,6 @@ async function writeStandaloneConfigTypes(configPath, matrix2, agents, finalConf
|
|
|
3850
3994
|
);
|
|
3851
3995
|
await writeFile(typesPath, source);
|
|
3852
3996
|
}
|
|
3853
|
-
async function writeProjectConfigTypes(projectConfigPath, projectDir, projectConfig, matrix2) {
|
|
3854
|
-
const typesPath = path20.join(path20.dirname(projectConfigPath), STANDARD_FILES.CONFIG_TYPES_TS);
|
|
3855
|
-
const projectClaudeSrc = path20.join(projectDir, CLAUDE_SRC_DIR);
|
|
3856
|
-
const globalClaudeSrc = path20.join(os8.homedir(), CLAUDE_SRC_DIR);
|
|
3857
|
-
const relativePath = path20.relative(projectClaudeSrc, globalClaudeSrc);
|
|
3858
|
-
const globalTypesImportPath = relativePath.split(path20.sep).join("/");
|
|
3859
|
-
const projectSkillIds = projectConfig?.skills.map((s) => s.id) ?? [];
|
|
3860
|
-
const projectAgentNames = projectConfig?.agents.map((a) => a.name) ?? [];
|
|
3861
|
-
let projectCategories = [];
|
|
3862
|
-
let projectDomains = [];
|
|
3863
|
-
if (matrix2 && projectSkillIds.length > 0) {
|
|
3864
|
-
const categorySet = /* @__PURE__ */ new Set();
|
|
3865
|
-
for (const id of projectSkillIds) {
|
|
3866
|
-
const skill = matrix2.skills[id];
|
|
3867
|
-
if (skill?.category && skill.category !== "local") {
|
|
3868
|
-
categorySet.add(skill.category);
|
|
3869
|
-
}
|
|
3870
|
-
}
|
|
3871
|
-
projectCategories = [...categorySet].sort();
|
|
3872
|
-
const domainSet = /* @__PURE__ */ new Set();
|
|
3873
|
-
for (const cat of projectCategories) {
|
|
3874
|
-
const domain = getCategoryDomain(cat);
|
|
3875
|
-
if (domain) {
|
|
3876
|
-
domainSet.add(domain);
|
|
3877
|
-
}
|
|
3878
|
-
}
|
|
3879
|
-
projectDomains = [...domainSet].sort();
|
|
3880
|
-
}
|
|
3881
|
-
const source = generateProjectConfigTypesSource({
|
|
3882
|
-
globalTypesImportPath,
|
|
3883
|
-
projectSkillIds,
|
|
3884
|
-
projectAgentNames,
|
|
3885
|
-
projectDomains,
|
|
3886
|
-
projectCategories
|
|
3887
|
-
});
|
|
3888
|
-
await writeFile(typesPath, source);
|
|
3889
|
-
verbose("Using project config-types.ts that imports from global");
|
|
3890
|
-
}
|
|
3891
3997
|
async function writeScopedConfigs(finalConfig, matrix2, agents, projectDir, projectConfigPath, projectInstallationExists) {
|
|
3892
3998
|
const homeDir = os8.homedir();
|
|
3893
3999
|
const isProjectContext = fs.realpathSync(projectDir) !== fs.realpathSync(homeDir);
|
|
@@ -3906,9 +4012,12 @@ async function writeScopedConfigs(finalConfig, matrix2, agents, projectDir, proj
|
|
|
3906
4012
|
const hasProjectItems = projectSplitConfig.skills.length > 0 || projectSplitConfig.agents.length > 0;
|
|
3907
4013
|
if (projectInstallationExists || hasProjectItems) {
|
|
3908
4014
|
await ensureDir(path20.dirname(projectConfigPath));
|
|
3909
|
-
await writeConfigFile(projectSplitConfig, projectConfigPath, {
|
|
4015
|
+
await writeConfigFile(projectSplitConfig, projectConfigPath, {
|
|
4016
|
+
isProjectConfig: true,
|
|
4017
|
+
globalConfig
|
|
4018
|
+
});
|
|
3910
4019
|
verbose(`Updated project config at ${projectConfigPath}`);
|
|
3911
|
-
await
|
|
4020
|
+
await writeStandaloneConfigTypes(projectConfigPath, matrix2, agents, finalConfig);
|
|
3912
4021
|
} else {
|
|
3913
4022
|
verbose(
|
|
3914
4023
|
"Skipped project config \u2014 no existing project installation and no project-scoped items"
|
|
@@ -5619,4 +5728,4 @@ export {
|
|
|
5619
5728
|
validateAllPlugins,
|
|
5620
5729
|
printPluginValidationResult
|
|
5621
5730
|
};
|
|
5622
|
-
//# sourceMappingURL=chunk-
|
|
5731
|
+
//# sourceMappingURL=chunk-PTKJKDYH.js.map
|