agents-inc 0.164.0 → 0.166.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 (191) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +8 -9
  3. package/dist/{chunk-X4SSJZLY.js → chunk-25MPBIK3.js} +12 -261
  4. package/dist/chunk-25MPBIK3.js.map +1 -0
  5. package/dist/{chunk-LT5GXEB2.js → chunk-2VUYFTUB.js} +8 -7
  6. package/dist/chunk-2VUYFTUB.js.map +1 -0
  7. package/dist/chunk-4AAOOAIN.js +49 -0
  8. package/dist/chunk-4AAOOAIN.js.map +1 -0
  9. package/dist/{chunk-ARYNOWKF.js → chunk-4NDBUJHK.js} +8 -8
  10. package/dist/{chunk-S63LXWMC.js → chunk-6L75SQZU.js} +2 -2
  11. package/dist/{chunk-7REKOTKG.js → chunk-6LF4CQBY.js} +3 -3
  12. package/dist/{chunk-K5ITEA3I.js → chunk-7JNJ52CD.js} +34 -17
  13. package/dist/chunk-7JNJ52CD.js.map +1 -0
  14. package/dist/{chunk-XPDVAJDH.js → chunk-A4KDXNOT.js} +3519 -1568
  15. package/dist/chunk-A4KDXNOT.js.map +1 -0
  16. package/dist/{chunk-XHPWTL4I.js → chunk-DAIEQJIF.js} +3 -3
  17. package/dist/{chunk-UITEKY2R.js → chunk-ENGYJCTF.js} +28 -4
  18. package/dist/chunk-ENGYJCTF.js.map +1 -0
  19. package/dist/{chunk-G2JJ5BO5.js → chunk-G4JK7WVO.js} +336 -140
  20. package/dist/chunk-G4JK7WVO.js.map +1 -0
  21. package/dist/{chunk-X37UYIE3.js → chunk-G6UREQ4V.js} +436 -739
  22. package/dist/chunk-G6UREQ4V.js.map +1 -0
  23. package/dist/chunk-GE3WKJ6Q.js +375 -0
  24. package/dist/chunk-GE3WKJ6Q.js.map +1 -0
  25. package/dist/{chunk-RGYDFBCT.js → chunk-HHIYT3PI.js} +5 -5
  26. package/dist/{chunk-2CQNPLVF.js → chunk-HWEKHVLE.js} +63 -42
  27. package/dist/chunk-HWEKHVLE.js.map +1 -0
  28. package/dist/{chunk-XVAQG2CV.js → chunk-JOEA52NR.js} +10 -8
  29. package/dist/chunk-JOEA52NR.js.map +1 -0
  30. package/dist/{chunk-3WVH2CTK.js → chunk-JQRJQ4SS.js} +15 -8
  31. package/dist/chunk-JQRJQ4SS.js.map +1 -0
  32. package/dist/{chunk-DSL66I4N.js → chunk-LFWLEDUG.js} +6 -6
  33. package/dist/{chunk-B3Y3QMWI.js → chunk-MAWNVT2C.js} +4 -4
  34. package/dist/{chunk-Q4IRRVXK.js → chunk-MPTNC32T.js} +3 -3
  35. package/dist/chunk-NBXXFIIW.js +73 -0
  36. package/dist/chunk-NBXXFIIW.js.map +1 -0
  37. package/dist/{chunk-B6FSLXYN.js → chunk-PMJWD27C.js} +3 -3
  38. package/dist/{chunk-XATLUKXK.js → chunk-PNB3524H.js} +6 -6
  39. package/dist/chunk-PXWG7KFO.js +39 -0
  40. package/dist/chunk-PXWG7KFO.js.map +1 -0
  41. package/dist/{chunk-4VL3CEOS.js → chunk-QHDPLLK6.js} +3 -3
  42. package/dist/{chunk-AOTCIUGX.js → chunk-RAHSOJQ2.js} +2 -2
  43. package/dist/{chunk-PHCPUQVR.js → chunk-RZDXDMT6.js} +2 -2
  44. package/dist/{chunk-6MV4JOCL.js → chunk-SAYZWCH6.js} +2 -2
  45. package/dist/{chunk-URXIQE7I.js → chunk-SCOQ34YM.js} +2 -2
  46. package/dist/{chunk-NQXO4LR3.js → chunk-SXVHSOTH.js} +16 -11
  47. package/dist/chunk-SXVHSOTH.js.map +1 -0
  48. package/dist/{chunk-QZX7SYKU.js → chunk-T6UWJAB3.js} +2 -2
  49. package/dist/{chunk-ZVXGW2IC.js → chunk-TODCQFRB.js} +4 -6
  50. package/dist/chunk-TODCQFRB.js.map +1 -0
  51. package/dist/{chunk-YRS3QZP2.js → chunk-TTY6DPJN.js} +3 -3
  52. package/dist/{chunk-QGUP3QJF.js → chunk-TZ2YJJKK.js} +22 -18
  53. package/dist/{chunk-QGUP3QJF.js.map → chunk-TZ2YJJKK.js.map} +1 -1
  54. package/dist/chunk-V3I7VQ7N.js +356 -0
  55. package/dist/chunk-V3I7VQ7N.js.map +1 -0
  56. package/dist/{chunk-AVK2HEKB.js → chunk-V5WXIM2F.js} +2 -6
  57. package/dist/{chunk-AVK2HEKB.js.map → chunk-V5WXIM2F.js.map} +1 -1
  58. package/dist/{chunk-NKGYKOB7.js → chunk-VAPTVR3J.js} +7 -8
  59. package/dist/chunk-VAPTVR3J.js.map +1 -0
  60. package/dist/chunk-VRXX4D6K.js +31 -0
  61. package/dist/chunk-VRXX4D6K.js.map +1 -0
  62. package/dist/{chunk-ABAZMMG4.js → chunk-WVUDLKIO.js} +2 -2
  63. package/dist/{chunk-ECURHW3T.js → chunk-WWIFNPJG.js} +13 -12
  64. package/dist/chunk-WWIFNPJG.js.map +1 -0
  65. package/dist/{chunk-J27W6TXS.js → chunk-XQHZPINL.js} +8 -4
  66. package/dist/chunk-XQHZPINL.js.map +1 -0
  67. package/dist/{chunk-V5GLL2JB.js → chunk-XZEVWPX6.js} +7 -7
  68. package/dist/chunk-Y3VIRVVE.js +932 -0
  69. package/dist/chunk-Y3VIRVVE.js.map +1 -0
  70. package/dist/{chunk-NTF4UXGK.js → chunk-Y47EV74W.js} +73 -30
  71. package/dist/chunk-Y47EV74W.js.map +1 -0
  72. package/dist/chunk-ZR4YPKXQ.js +159 -0
  73. package/dist/chunk-ZR4YPKXQ.js.map +1 -0
  74. package/dist/chunk-ZXKBERQU.js +250 -0
  75. package/dist/chunk-ZXKBERQU.js.map +1 -0
  76. package/dist/commands/build/marketplace.js +17 -17
  77. package/dist/commands/build/marketplace.js.map +1 -1
  78. package/dist/commands/build/plugins.js +11 -9
  79. package/dist/commands/build/plugins.js.map +1 -1
  80. package/dist/commands/compile.js +105 -27
  81. package/dist/commands/compile.js.map +1 -1
  82. package/dist/commands/doctor.js +309 -171
  83. package/dist/commands/doctor.js.map +1 -1
  84. package/dist/commands/edit.js +503 -314
  85. package/dist/commands/edit.js.map +1 -1
  86. package/dist/commands/eject.js +40 -23
  87. package/dist/commands/eject.js.map +1 -1
  88. package/dist/commands/init.js +44 -40
  89. package/dist/commands/list.js +44 -10
  90. package/dist/commands/list.js.map +1 -1
  91. package/dist/commands/new/marketplace.js +13 -10
  92. package/dist/commands/new/marketplace.js.map +1 -1
  93. package/dist/commands/search.js +12 -10
  94. package/dist/commands/search.js.map +1 -1
  95. package/dist/commands/share.js +102 -15
  96. package/dist/commands/share.js.map +1 -1
  97. package/dist/commands/uninstall.js +231 -103
  98. package/dist/commands/uninstall.js.map +1 -1
  99. package/dist/commands/update.js +49 -20
  100. package/dist/commands/update.js.map +1 -1
  101. package/dist/components/common/prompt-confirm.js +1 -1
  102. package/dist/components/common/removal-plan-confirm.js +2 -2
  103. package/dist/components/common/select-list.js +3 -3
  104. package/dist/components/common/spinner.js +6 -3
  105. package/dist/components/wizard/category-grid.js +5 -5
  106. package/dist/components/wizard/checkbox-grid.js +4 -4
  107. package/dist/components/wizard/domain-selection.js +9 -9
  108. package/dist/components/wizard/run-wizard-session.js +29 -29
  109. package/dist/components/wizard/scroll-affordance.js +2 -2
  110. package/dist/components/wizard/skill-agent-summary.js +5 -5
  111. package/dist/components/wizard/source-grid.js +6 -6
  112. package/dist/components/wizard/stack-selection.js +8 -8
  113. package/dist/components/wizard/step-agents.js +8 -8
  114. package/dist/components/wizard/step-build.js +8 -8
  115. package/dist/components/wizard/step-confirm.js +9 -9
  116. package/dist/components/wizard/step-sources.js +9 -9
  117. package/dist/components/wizard/step-stack.js +9 -9
  118. package/dist/components/wizard/summary-panel.js +8 -8
  119. package/dist/components/wizard/toast.js +2 -2
  120. package/dist/components/wizard/wizard-layout.js +12 -12
  121. package/dist/components/wizard/wizard-tabs.js +2 -2
  122. package/dist/components/wizard/wizard.js +27 -27
  123. package/dist/hooks/init.js +69 -43
  124. package/dist/hooks/init.js.map +1 -1
  125. package/dist/load-agent-defs-3C27ENC7.js +14 -0
  126. package/dist/recompile-project-agents-DGNBCU3N.js +18 -0
  127. package/dist/{source-loader-GRBVNRAW.js → source-loader-7KZ3MD5O.js} +6 -4
  128. package/dist/src/agents/_templates/agent-body.liquid +55 -0
  129. package/dist/src/agents/_templates/agent.liquid +1 -55
  130. package/dist/src/agents/meta/agent-summoner/output.md +1 -1
  131. package/dist/src/agents/meta/agent-summoner/playbook.md +15 -7
  132. package/dist/stores/wizard-store.js +4 -4
  133. package/package.json +10 -9
  134. package/src/agents/_templates/agent-body.liquid +55 -0
  135. package/src/agents/_templates/agent.liquid +1 -55
  136. package/src/agents/meta/agent-summoner/output.md +1 -1
  137. package/src/agents/meta/agent-summoner/playbook.md +15 -7
  138. package/src/schemas/project-config.schema.json +1 -1
  139. package/src/schemas/project-source-config.schema.json +1 -1
  140. package/dist/chunk-2CQNPLVF.js.map +0 -1
  141. package/dist/chunk-3WVH2CTK.js.map +0 -1
  142. package/dist/chunk-7ANJQLPJ.js +0 -35
  143. package/dist/chunk-7ANJQLPJ.js.map +0 -1
  144. package/dist/chunk-ECURHW3T.js.map +0 -1
  145. package/dist/chunk-FLW25ORT.js +0 -130
  146. package/dist/chunk-FLW25ORT.js.map +0 -1
  147. package/dist/chunk-G2JJ5BO5.js.map +0 -1
  148. package/dist/chunk-J27W6TXS.js.map +0 -1
  149. package/dist/chunk-JCPANDNR.js +0 -35
  150. package/dist/chunk-JCPANDNR.js.map +0 -1
  151. package/dist/chunk-JIERYE6B.js +0 -480
  152. package/dist/chunk-JIERYE6B.js.map +0 -1
  153. package/dist/chunk-JU4ZGJ7A.js +0 -668
  154. package/dist/chunk-JU4ZGJ7A.js.map +0 -1
  155. package/dist/chunk-K5ITEA3I.js.map +0 -1
  156. package/dist/chunk-LT5GXEB2.js.map +0 -1
  157. package/dist/chunk-NKGYKOB7.js.map +0 -1
  158. package/dist/chunk-NQXO4LR3.js.map +0 -1
  159. package/dist/chunk-NTF4UXGK.js.map +0 -1
  160. package/dist/chunk-UITEKY2R.js.map +0 -1
  161. package/dist/chunk-X37UYIE3.js.map +0 -1
  162. package/dist/chunk-X4SSJZLY.js.map +0 -1
  163. package/dist/chunk-XPDVAJDH.js.map +0 -1
  164. package/dist/chunk-XVAQG2CV.js.map +0 -1
  165. package/dist/chunk-ZBPEFQ4G.js +0 -12
  166. package/dist/chunk-ZBPEFQ4G.js.map +0 -1
  167. package/dist/chunk-ZVXGW2IC.js.map +0 -1
  168. package/dist/load-agent-defs-7IM3GBEQ.js +0 -13
  169. package/dist/recompile-project-agents-VR4NLGOU.js +0 -17
  170. /package/dist/{chunk-ARYNOWKF.js.map → chunk-4NDBUJHK.js.map} +0 -0
  171. /package/dist/{chunk-S63LXWMC.js.map → chunk-6L75SQZU.js.map} +0 -0
  172. /package/dist/{chunk-7REKOTKG.js.map → chunk-6LF4CQBY.js.map} +0 -0
  173. /package/dist/{chunk-XHPWTL4I.js.map → chunk-DAIEQJIF.js.map} +0 -0
  174. /package/dist/{chunk-RGYDFBCT.js.map → chunk-HHIYT3PI.js.map} +0 -0
  175. /package/dist/{chunk-DSL66I4N.js.map → chunk-LFWLEDUG.js.map} +0 -0
  176. /package/dist/{chunk-B3Y3QMWI.js.map → chunk-MAWNVT2C.js.map} +0 -0
  177. /package/dist/{chunk-Q4IRRVXK.js.map → chunk-MPTNC32T.js.map} +0 -0
  178. /package/dist/{chunk-B6FSLXYN.js.map → chunk-PMJWD27C.js.map} +0 -0
  179. /package/dist/{chunk-XATLUKXK.js.map → chunk-PNB3524H.js.map} +0 -0
  180. /package/dist/{chunk-4VL3CEOS.js.map → chunk-QHDPLLK6.js.map} +0 -0
  181. /package/dist/{chunk-AOTCIUGX.js.map → chunk-RAHSOJQ2.js.map} +0 -0
  182. /package/dist/{chunk-PHCPUQVR.js.map → chunk-RZDXDMT6.js.map} +0 -0
  183. /package/dist/{chunk-6MV4JOCL.js.map → chunk-SAYZWCH6.js.map} +0 -0
  184. /package/dist/{chunk-URXIQE7I.js.map → chunk-SCOQ34YM.js.map} +0 -0
  185. /package/dist/{chunk-QZX7SYKU.js.map → chunk-T6UWJAB3.js.map} +0 -0
  186. /package/dist/{chunk-YRS3QZP2.js.map → chunk-TTY6DPJN.js.map} +0 -0
  187. /package/dist/{chunk-ABAZMMG4.js.map → chunk-WVUDLKIO.js.map} +0 -0
  188. /package/dist/{chunk-V5GLL2JB.js.map → chunk-XZEVWPX6.js.map} +0 -0
  189. /package/dist/{load-agent-defs-7IM3GBEQ.js.map → load-agent-defs-3C27ENC7.js.map} +0 -0
  190. /package/dist/{recompile-project-agents-VR4NLGOU.js.map → recompile-project-agents-DGNBCU3N.js.map} +0 -0
  191. /package/dist/{source-loader-GRBVNRAW.js.map → source-loader-7KZ3MD5O.js.map} +0 -0
@@ -0,0 +1,375 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ agentCodec,
4
+ buildAgentTemplateContext,
5
+ buildCompileAgents,
6
+ directoryExists,
7
+ discoverAllPluginSkills,
8
+ ensureDir,
9
+ fileExists,
10
+ getErrorMessage,
11
+ getPluginAgentsDir,
12
+ glob,
13
+ hostCompilesAgent,
14
+ isAgentName,
15
+ loadAllAgents,
16
+ loadProjectAgents,
17
+ loadProjectConfig,
18
+ pluginRefFor,
19
+ providerInUse,
20
+ readFile,
21
+ readFileOptional,
22
+ remove,
23
+ renderAgent,
24
+ renderAgentBody,
25
+ renderAgentRoleToml,
26
+ resolveAgents,
27
+ resolveInstallPaths,
28
+ sourceFolderInUse,
29
+ sourceFolderName,
30
+ verbose,
31
+ writeFile
32
+ } from "./chunk-A4KDXNOT.js";
33
+ import {
34
+ typedEntries,
35
+ typedFromEntries,
36
+ typedKeys
37
+ } from "./chunk-V5WXIM2F.js";
38
+ import {
39
+ CLAUDE_DIR,
40
+ DIRS,
41
+ PROJECT_ROOT,
42
+ STANDARD_DIRS,
43
+ STANDARD_FILES,
44
+ effectivelyExcludedSkillIds
45
+ } from "./chunk-ENGYJCTF.js";
46
+
47
+ // src/cli/lib/agents/list-compiled-agents.ts
48
+ import path from "path";
49
+ import { partition } from "remeda";
50
+ var CLAUDE_AGENTS = agentCodec("claude");
51
+ async function listAgentMdFiles(agentsDir) {
52
+ return listAgentFilesOf(agentsDir, CLAUDE_AGENTS);
53
+ }
54
+ async function listAgentFilesOf(agentsDir, codec) {
55
+ return glob(codec.listGlob, agentsDir);
56
+ }
57
+ async function splitAgentsByProvenance(agentsDir, codec = CLAUDE_AGENTS) {
58
+ const files = await listAgentFilesOf(agentsDir, codec);
59
+ const classified = await Promise.all(
60
+ files.map((file) => readAgentProvenance(agentsDir, file, codec))
61
+ );
62
+ const [marked, unmarked] = partition(classified, (agent) => agent.compiledHere);
63
+ return { marked: marked.map(agentName), unmarked: unmarked.map(agentName) };
64
+ }
65
+ async function readAgentProvenance(agentsDir, file, codec) {
66
+ const content = await readFileOptional(path.join(agentsDir, file));
67
+ return { name: path.basename(file, codec.extension), compiledHere: codec.hasMarker(content) };
68
+ }
69
+ function agentName(agent) {
70
+ return agent.name;
71
+ }
72
+ async function listCompiledAgentNames(agentsDir) {
73
+ const files = await listAgentMdFiles(agentsDir);
74
+ return files.map((f) => path.basename(f, ".md"));
75
+ }
76
+ async function pruneStaleCompiledAgents(agentsDir, keep, codec = CLAUDE_AGENTS) {
77
+ const isStaleCompiledAgent = (file) => {
78
+ const name = path.basename(file, codec.extension);
79
+ return isAgentName(name) && !keep.has(name);
80
+ };
81
+ const files = await listAgentFilesOf(agentsDir, codec);
82
+ await Promise.all(
83
+ files.filter(isStaleCompiledAgent).map((file) => remove(path.join(agentsDir, file)))
84
+ );
85
+ }
86
+
87
+ // src/cli/lib/agents/agent-recompiler.ts
88
+ import { partition as partition2 } from "remeda";
89
+
90
+ // src/cli/lib/agents/write-compiled-agents.ts
91
+ import os from "os";
92
+ import path4 from "path";
93
+
94
+ // src/cli/lib/compiler.ts
95
+ import { Liquid } from "liquidjs";
96
+ import path3 from "path";
97
+
98
+ // src/cli/lib/agents/agent-provenance.ts
99
+ import path2 from "path";
100
+ import { z } from "zod";
101
+ var ownPackageJsonSchema = z.object({ version: z.string().min(1) });
102
+ var ownVersion;
103
+ function cliVersion() {
104
+ ownVersion ??= readOwnVersion();
105
+ return ownVersion;
106
+ }
107
+ async function readOwnVersion() {
108
+ const manifestPath = path2.join(PROJECT_ROOT, STANDARD_FILES.PACKAGE_JSON);
109
+ const raw = JSON.parse(await readFile(manifestPath));
110
+ const parsed = ownPackageJsonSchema.safeParse(raw);
111
+ if (!parsed.success) {
112
+ throw new Error(`Could not read this CLI's own version from ${manifestPath}`);
113
+ }
114
+ return parsed.data.version;
115
+ }
116
+
117
+ // src/cli/lib/compiler.ts
118
+ async function readAgentFiles(name, agent, projectRoot) {
119
+ const agentSourceRoot = agent.sourceRoot || projectRoot;
120
+ const agentBaseDir = agent.agentBaseDir || DIRS.agents;
121
+ const agentPath = agent.path || name;
122
+ const agentDir = path3.join(agentSourceRoot, agentBaseDir, agentPath);
123
+ const identity = await readFile(path3.join(agentDir, STANDARD_FILES.IDENTITY_MD));
124
+ const playbook = await readFile(path3.join(agentDir, STANDARD_FILES.PLAYBOOK_MD));
125
+ const criticalRequirementsTop = await readFileOptional(
126
+ path3.join(agentDir, STANDARD_FILES.CRITICAL_REQUIREMENTS_MD),
127
+ ""
128
+ );
129
+ const criticalReminders = await readFileOptional(
130
+ path3.join(agentDir, STANDARD_FILES.CRITICAL_REMINDERS_MD),
131
+ ""
132
+ );
133
+ const category = agentPath.split("/")[0] || name;
134
+ const categoryDir = path3.join(agentSourceRoot, agentBaseDir, category);
135
+ const output = await readOutputPartial(agentDir, categoryDir);
136
+ return { identity, playbook, output, criticalRequirementsTop, criticalReminders };
137
+ }
138
+ async function readOutputPartial(agentDir, categoryDir) {
139
+ const own = await readFileOptional(path3.join(agentDir, STANDARD_FILES.OUTPUT_MD), "");
140
+ if (own) return own;
141
+ return readFileOptional(path3.join(categoryDir, STANDARD_FILES.OUTPUT_MD), "");
142
+ }
143
+ async function createLiquidEngine(projectDir) {
144
+ const roots = [];
145
+ const provider = providerInUse(projectDir);
146
+ if (projectDir) {
147
+ const srcTemplatesDir = path3.join(
148
+ sourceFolderInUse(projectDir, provider).dir,
149
+ STANDARD_DIRS.AGENTS,
150
+ path3.basename(DIRS.templates)
151
+ );
152
+ if (await directoryExists(srcTemplatesDir)) {
153
+ roots.push(srcTemplatesDir);
154
+ verbose(`Using local templates from: ${srcTemplatesDir}`);
155
+ }
156
+ const legacyTemplatesDir = path3.join(projectDir, CLAUDE_DIR, STANDARD_DIRS.TEMPLATES);
157
+ if (await directoryExists(legacyTemplatesDir)) {
158
+ roots.push(legacyTemplatesDir);
159
+ verbose(`Using legacy templates from: ${legacyTemplatesDir}`);
160
+ }
161
+ }
162
+ roots.push(path3.join(PROJECT_ROOT, DIRS.templates));
163
+ return new Liquid({
164
+ root: roots,
165
+ extname: ".liquid",
166
+ strictVariables: false,
167
+ strictFilters: true,
168
+ globals: { sourceFolder: sourceFolderName(projectDir, provider) }
169
+ });
170
+ }
171
+ async function compileAgentForHost(provider, name, agent, fallbackRoot, engine) {
172
+ verbose(`Compiling agent: ${name} (${provider})`);
173
+ const files = await readAgentFiles(name, agent, fallbackRoot);
174
+ const data = buildAgentTemplateContext(name, agent, files, (skill) => ({
175
+ ...skill,
176
+ ...pluginRefFor(skill)
177
+ }));
178
+ const version = await cliVersion();
179
+ switch (provider) {
180
+ case "claude":
181
+ return renderAgent(engine, data, version);
182
+ case "codex":
183
+ return renderAgentRoleToml(agent, await renderAgentBody(engine, data, version));
184
+ default: {
185
+ const _exhaustive = provider;
186
+ return _exhaustive;
187
+ }
188
+ }
189
+ }
190
+
191
+ // src/cli/lib/agents/write-compiled-agents.ts
192
+ async function holdsExactly(filePath, content) {
193
+ return await fileExists(filePath) && await readFile(filePath) === content;
194
+ }
195
+ var UNROUTED_AGENT_SCOPE = "project";
196
+ async function writeCompiledAgentsByScope(params) {
197
+ const hosts = {
198
+ // Each scope reads its OWN root, the way `resolveInstallPaths` reads one beside this: a
199
+ // project on Codex under a global on Claude is an arrangement this product allows, and one
200
+ // provider answered for both scopes is how a pass writes the wrong format into one of them.
201
+ global: {
202
+ provider: providerInUse(os.homedir()),
203
+ agentsDir: resolveInstallPaths(os.homedir(), "global").agentsDir
204
+ },
205
+ project: { provider: providerInUse(params.projectDir), agentsDir: params.projectAgentsDir }
206
+ };
207
+ const outcomes = [];
208
+ for (const [name, agent] of typedEntries(params.resolvedAgents)) {
209
+ const scope = params.agentScopeMap?.get(name) ?? UNROUTED_AGENT_SCOPE;
210
+ const host = hosts[scope];
211
+ if (!hostCompilesAgent(host.provider, name)) continue;
212
+ outcomes.push(await writeOneAgent({ ...params, name, agent, scope, host }));
213
+ }
214
+ return outcomes;
215
+ }
216
+ async function writeOneAgent(params) {
217
+ const { name, scope, host } = params;
218
+ try {
219
+ const output = await compileAgentForHost(
220
+ host.provider,
221
+ name,
222
+ params.agent,
223
+ params.sourcePath,
224
+ params.engine
225
+ );
226
+ const targetPath = path4.join(host.agentsDir, fileNameFor(name, host.provider));
227
+ const rewritten = !await holdsExactly(targetPath, output);
228
+ if (rewritten) await writeFile(targetPath, output);
229
+ return { name, ok: true, scope, targetDir: host.agentsDir, rewritten };
230
+ } catch (error) {
231
+ return { name, ok: false, error };
232
+ }
233
+ }
234
+ function fileNameFor(name, provider) {
235
+ return `${name}${agentCodec(provider).extension}`;
236
+ }
237
+
238
+ // src/cli/lib/agents/agent-recompiler.ts
239
+ import path5 from "path";
240
+ async function getExistingAgentNames(pluginDir) {
241
+ return listCompiledAgentNames(getPluginAgentsDir(pluginDir));
242
+ }
243
+ async function resolveAgentNames(params) {
244
+ const { specifiedAgents, projectConfig, allAgents, outputDir, pluginDir } = params;
245
+ if (specifiedAgents) {
246
+ return specifiedAgents;
247
+ }
248
+ if (projectConfig) {
249
+ const agentNames = projectConfig.agents.map((a) => a.name);
250
+ verbose(`Using agents from config: ${agentNames.join(", ")}`);
251
+ return agentNames;
252
+ }
253
+ if (outputDir) {
254
+ const names = typedKeys(allAgents);
255
+ verbose(`Using all available agents from source: ${names.join(", ")}`);
256
+ return names;
257
+ }
258
+ return getExistingAgentNames(pluginDir);
259
+ }
260
+ function buildRecompileResult(outcomes, priorWarnings) {
261
+ const [succeeded, failedOutcomes] = partition2(
262
+ outcomes,
263
+ (outcome) => outcome.ok
264
+ );
265
+ succeeded.forEach(
266
+ (outcome) => verbose(
267
+ ` ${outcome.rewritten ? "Rewrote" : "Unchanged"}: ${outcome.name} (${outcome.scope} -> ${outcome.targetDir})`
268
+ )
269
+ );
270
+ return {
271
+ compiled: succeeded.map((outcome) => outcome.name),
272
+ rewritten: succeeded.filter((outcome) => outcome.rewritten).map((outcome) => outcome.name),
273
+ failed: failedOutcomes.map((outcome) => outcome.name),
274
+ warnings: [
275
+ ...priorWarnings,
276
+ ...failedOutcomes.map(
277
+ (outcome) => `Failed to compile ${outcome.name}: ${getErrorMessage(outcome.error)}`
278
+ )
279
+ ]
280
+ };
281
+ }
282
+ function filterExcludedEntries(config) {
283
+ const excludedIds = effectivelyExcludedSkillIds(config.skills);
284
+ const activeSkills = config.skills.filter((s) => !s.excluded);
285
+ const activeAgents = config.agents.filter((a) => !a.excluded);
286
+ const filteredStack = config.stack === void 0 ? {} : { stack: withoutExcludedAssignments(config.stack, excludedIds) };
287
+ return { ...config, skills: activeSkills, agents: activeAgents, ...filteredStack };
288
+ }
289
+ function withoutExcludedAssignments(stack, excludedIds) {
290
+ return Object.fromEntries(
291
+ typedEntries(stack).map(([agentName2, agentStack]) => [
292
+ agentName2,
293
+ Object.fromEntries(
294
+ typedEntries(agentStack).map(([category, assignments]) => [
295
+ category,
296
+ assignments.filter((assignment) => !excludedIds.has(assignment.id))
297
+ ])
298
+ )
299
+ ])
300
+ );
301
+ }
302
+ async function recompileAgents(options) {
303
+ const { pluginDir, sourcePath, skills: providedSkills, projectDir, outputDir } = options;
304
+ const configDir = projectDir ?? pluginDir;
305
+ const loadedConfig = await loadProjectConfig(configDir);
306
+ const projectConfig = loadedConfig?.config ?? null;
307
+ const filteredConfig = projectConfig ? filterExcludedEntries(projectConfig) : null;
308
+ const builtinAgents = await loadAllAgents(sourcePath);
309
+ const projectAgents = projectDir ? await loadProjectAgents(projectDir) : {};
310
+ const allAgents = {
311
+ ...builtinAgents,
312
+ ...projectAgents
313
+ };
314
+ const agentNames = await resolveAgentNames({
315
+ ...options.agents !== void 0 && { specifiedAgents: options.agents },
316
+ projectConfig: filteredConfig,
317
+ allAgents,
318
+ ...outputDir !== void 0 && { outputDir },
319
+ pluginDir
320
+ });
321
+ if (agentNames.length === 0) {
322
+ return { compiled: [], rewritten: [], failed: [], warnings: [] };
323
+ }
324
+ verbose(`Recompiling ${agentNames.length} agents in ${outputDir ?? pluginDir}`);
325
+ const pluginSkills = providedSkills ?? await discoverAllPluginSkills(projectDir ?? pluginDir);
326
+ const { configAgents, missingWarnings } = compileEntriesFor(
327
+ agentNames,
328
+ filteredConfig,
329
+ allAgents
330
+ );
331
+ const compileConfig = {
332
+ name: filteredConfig?.name || path5.basename(pluginDir),
333
+ description: filteredConfig?.description || "Recompiled plugin",
334
+ agents: configAgents
335
+ };
336
+ const engine = await createLiquidEngine(projectDir);
337
+ const resolvedAgents = await resolveAgents(allAgents, pluginSkills, compileConfig, sourcePath);
338
+ const agentsDir = outputDir ?? getPluginAgentsDir(pluginDir);
339
+ await ensureDir(agentsDir);
340
+ const outcomes = await writeCompiledAgentsByScope({
341
+ resolvedAgents,
342
+ sourcePath,
343
+ engine,
344
+ projectAgentsDir: agentsDir,
345
+ // The same root this pass loaded its config from, so the provider that decides the FORMAT
346
+ // and the provider that decided the configuration are read off one installation.
347
+ projectDir: configDir,
348
+ ...options.agentScopeMap !== void 0 && { agentScopeMap: options.agentScopeMap }
349
+ });
350
+ return buildRecompileResult(outcomes, missingWarnings);
351
+ }
352
+ function compileEntriesFor(agentNames, config, allAgents) {
353
+ const allConfigAgents = config ? buildCompileAgents(config, allAgents) : {};
354
+ const [knownAgents, missingAgents] = partition2(
355
+ agentNames,
356
+ (name) => Boolean(allConfigAgents[name] || allAgents[name])
357
+ );
358
+ return {
359
+ configAgents: typedFromEntries(
360
+ knownAgents.map((name) => [name, allConfigAgents[name] ?? {}])
361
+ ),
362
+ missingWarnings: missingAgents.map((name) => `Agent "${name}" not found in source definitions`)
363
+ };
364
+ }
365
+
366
+ export {
367
+ listAgentMdFiles,
368
+ listAgentFilesOf,
369
+ splitAgentsByProvenance,
370
+ pruneStaleCompiledAgents,
371
+ filterExcludedEntries,
372
+ withoutExcludedAssignments,
373
+ recompileAgents
374
+ };
375
+ //# sourceMappingURL=chunk-GE3WKJ6Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/lib/agents/list-compiled-agents.ts","../src/cli/lib/agents/agent-recompiler.ts","../src/cli/lib/agents/write-compiled-agents.ts","../src/cli/lib/compiler.ts","../src/cli/lib/agents/agent-provenance.ts"],"sourcesContent":["import path from \"path\";\nimport { partition } from \"remeda\";\nimport { glob, readFileOptional, remove } from \"../../utils/fs\";\nimport { isAgentName } from \"../../utils/type-guards\";\nimport { type AgentCodec, agentCodec } from \"../installation/install-layout\";\nimport type { AgentName } from \"../../types\";\n\n/**\n * Claude's codec, the default every reader below falls back to. A caller holding an installation\n * of another host passes that host's — `agentCodec(providerInUse(dir))` — because a Codex role is a\n * `.toml` whose marker sits inside `developer_instructions`, and a reader that only knew `*.md`\n * found no compiled agent on Codex at all: `uninstall` left every role behind while saying it had\n * removed them (CLI-896, found on a real Codex run 2026-09-26).\n */\nconst CLAUDE_AGENTS = agentCodec(\"claude\");\n\n/** Compiled-agent basenames in a directory, split by whether this CLI compiled them. */\nexport type AgentProvenanceSplit = {\n /** Files carrying the provenance marker — provably written by this CLI. */\n marked: string[];\n /** Everything else in the directory, the user's own agents among them. */\n unmarked: string[];\n};\n\n/** Lists compiled-agent markdown filenames (e.g. \"web-developer.md\") in a directory. */\nexport async function listAgentMdFiles(agentsDir: string): Promise<string[]> {\n return listAgentFilesOf(agentsDir, CLAUDE_AGENTS);\n}\n\n/** Lists the compiled-agent files `codec`'s host keeps in a directory (`*.md`, `*.toml`). */\nexport async function listAgentFilesOf(agentsDir: string, codec: AgentCodec): Promise<string[]> {\n return glob(codec.listGlob, agentsDir);\n}\n\n/**\n * Splits the agent files in a directory by the provenance marker each compiled agent carries.\n *\n * This is the only thing that identifies this CLI's own output once the configuration naming\n * it is gone, so the split errs one way by construction: a file that cannot be read yields no\n * marker and lands in `unmarked`, because \"cannot prove it is ours\" and \"is not ours\" call for\n * the same answer — leave it alone.\n */\nexport async function splitAgentsByProvenance(\n agentsDir: string,\n codec: AgentCodec = CLAUDE_AGENTS,\n): Promise<AgentProvenanceSplit> {\n const files = await listAgentFilesOf(agentsDir, codec);\n const classified = await Promise.all(\n files.map((file) => readAgentProvenance(agentsDir, file, codec)),\n );\n const [marked, unmarked] = partition(classified, (agent) => agent.compiledHere);\n\n return { marked: marked.map(agentName), unmarked: unmarked.map(agentName) };\n}\n\ntype ClassifiedAgent = { name: string; compiledHere: boolean };\n\nasync function readAgentProvenance(\n agentsDir: string,\n file: string,\n codec: AgentCodec,\n): Promise<ClassifiedAgent> {\n const content = await readFileOptional(path.join(agentsDir, file));\n return { name: path.basename(file, codec.extension), compiledHere: codec.hasMarker(content) };\n}\n\nfunction agentName(agent: ClassifiedAgent): string {\n return agent.name;\n}\n\n/** Lists compiled-agent names (filenames without the `.md` extension) in a directory. */\nexport async function listCompiledAgentNames(agentsDir: string): Promise<AgentName[]> {\n const files = await listAgentMdFiles(agentsDir);\n // Boundary cast: compiled .md filenames are agent names by convention; custom\n // agents from marketplace stacks may not be members of the AgentName union.\n return files.map((f) => path.basename(f, \".md\") as AgentName);\n}\n\n/**\n * Removes stale CLI-compiled agent files from `agentsDir`: deletes any agent file (`codec`'s\n * extension) whose basename is a built-in CLI agent name (`isAgentName`) that is NOT in\n * `keep`. The built-in-name check protects hand-authored agents (whose basename\n * is not a built-in name) — it is never the removal criterion. Only call this\n * when `keep` is the COMPLETE set of agents that should live in `agentsDir`.\n */\nexport async function pruneStaleCompiledAgents(\n agentsDir: string,\n keep: ReadonlySet<AgentName>,\n codec: AgentCodec = CLAUDE_AGENTS,\n): Promise<void> {\n // A non-built-in basename is a hand-authored agent — always preserved.\n const isStaleCompiledAgent = (file: string): boolean => {\n const name = path.basename(file, codec.extension);\n return isAgentName(name) && !keep.has(name);\n };\n\n const files = await listAgentFilesOf(agentsDir, codec);\n await Promise.all(\n files.filter(isStaleCompiledAgent).map((file) => remove(path.join(agentsDir, file))),\n );\n}\n","import { partition } from \"remeda\";\nimport { writeCompiledAgentsByScope, type AgentWriteOutcome } from \"./write-compiled-agents\";\nimport { listCompiledAgentNames } from \"./list-compiled-agents\";\nimport path from \"path\";\n\nimport { getErrorMessage } from \"../../utils/errors\";\nimport type {\n AgentDefinition,\n AgentName,\n CompileAgentConfig,\n CompileConfig,\n ProjectConfig,\n SkillDefinitionMap,\n SkillId,\n SkillScope,\n} from \"../../types\";\n\nimport { buildCompileAgents } from \"../installation/local-installer\";\nimport { ensureDir } from \"../../utils/fs\";\nimport { verbose } from \"../../utils/logger\";\nimport { typedEntries, typedFromEntries, typedKeys } from \"../../utils/typed-object\";\nimport { createLiquidEngine } from \"../compiler\";\nimport { loadProjectConfig, effectivelyExcludedSkillIds } from \"../configuration\";\nimport { loadAllAgents, loadProjectAgents } from \"../loading\";\nimport { getPluginAgentsDir } from \"../plugins\";\nimport { discoverAllPluginSkills } from \"../plugins/plugin-discovery\";\nimport { resolveAgents } from \"../resolver\";\n\nexport type RecompileAgentsOptions = {\n pluginDir: string;\n sourcePath: string;\n agents?: AgentName[];\n skills?: SkillDefinitionMap;\n projectDir?: string;\n outputDir?: string;\n /** When provided, routes agents by scope: global agents to ~/.claude/agents/, project agents to outputDir */\n agentScopeMap?: Map<AgentName, SkillScope>;\n};\n\nexport type RecompileAgentsResult = {\n compiled: AgentName[];\n /**\n * The subset of `compiled` whose file this pass actually wrote. `compiled` is\n * every agent that came through the pass with a correct file at the end of it;\n * `rewritten` is the ones whose content moved, so `compiled minus rewritten` is\n * the count a summary reports as unchanged.\n */\n rewritten: AgentName[];\n failed: AgentName[];\n warnings: string[];\n};\n\nasync function getExistingAgentNames(pluginDir: string): Promise<AgentName[]> {\n return listCompiledAgentNames(getPluginAgentsDir(pluginDir));\n}\n\ntype ResolveAgentNamesParams = {\n specifiedAgents?: AgentName[];\n projectConfig: ProjectConfig | null;\n allAgents: Partial<Record<AgentName, AgentDefinition>>;\n outputDir?: string;\n pluginDir: string;\n};\n\nasync function resolveAgentNames(params: ResolveAgentNamesParams): Promise<AgentName[]> {\n const { specifiedAgents, projectConfig, allAgents, outputDir, pluginDir } = params;\n\n if (specifiedAgents) {\n return specifiedAgents;\n }\n\n // A present config is authoritative over its agent roster — even when empty.\n // `agents: []` means \"no agents\", so it must NOT fall through to the\n // all-agents branch below; that branch exists only for the config-LESS case.\n if (projectConfig) {\n const agentNames = projectConfig.agents.map((a) => a.name);\n verbose(`Using agents from config: ${agentNames.join(\", \")}`);\n return agentNames;\n }\n\n if (outputDir) {\n const names = typedKeys<AgentName>(allAgents);\n verbose(`Using all available agents from source: ${names.join(\", \")}`);\n return names;\n }\n\n return getExistingAgentNames(pluginDir);\n}\n\n/** Splits write outcomes into the recompile result; logs each success at verbose level. */\nfunction buildRecompileResult(\n outcomes: AgentWriteOutcome[],\n priorWarnings: string[],\n): RecompileAgentsResult {\n const [succeeded, failedOutcomes] = partition(\n outcomes,\n (outcome): outcome is Extract<AgentWriteOutcome, { ok: true }> => outcome.ok,\n );\n succeeded.forEach((outcome) =>\n verbose(\n ` ${outcome.rewritten ? \"Rewrote\" : \"Unchanged\"}: ${outcome.name} (${outcome.scope} -> ${outcome.targetDir})`,\n ),\n );\n return {\n compiled: succeeded.map((outcome) => outcome.name),\n rewritten: succeeded.filter((outcome) => outcome.rewritten).map((outcome) => outcome.name),\n failed: failedOutcomes.map((outcome) => outcome.name),\n warnings: [\n ...priorWarnings,\n ...failedOutcomes.map(\n (outcome) => `Failed to compile ${outcome.name}: ${getErrorMessage(outcome.error)}`,\n ),\n ],\n };\n}\n\nexport function filterExcludedEntries(config: ProjectConfig): ProjectConfig {\n const excludedIds = effectivelyExcludedSkillIds(config.skills);\n const activeSkills = config.skills.filter((s) => !s.excluded);\n const activeAgents = config.agents.filter((a) => !a.excluded);\n\n // A config with no stack keeps none — the key stays absent rather than becoming an\n // explicit `undefined`.\n const filteredStack =\n config.stack === undefined\n ? {}\n : { stack: withoutExcludedAssignments(config.stack, excludedIds) };\n\n return { ...config, skills: activeSkills, agents: activeAgents, ...filteredStack };\n}\n\n/**\n * The stack with every excluded skill's assignment taken out. Each agent and category keeps its\n * key, even where that leaves a category with no assignments.\n */\nexport function withoutExcludedAssignments(\n stack: NonNullable<ProjectConfig[\"stack\"]>,\n excludedIds: ReadonlySet<SkillId>,\n): NonNullable<ProjectConfig[\"stack\"]> {\n return Object.fromEntries(\n typedEntries(stack).map(([agentName, agentStack]) => [\n agentName,\n Object.fromEntries(\n typedEntries(agentStack).map(([category, assignments]) => [\n category,\n assignments.filter((assignment) => !excludedIds.has(assignment.id)),\n ]),\n ),\n ]),\n );\n}\n\nexport async function recompileAgents(\n options: RecompileAgentsOptions,\n): Promise<RecompileAgentsResult> {\n const { pluginDir, sourcePath, skills: providedSkills, projectDir, outputDir } = options;\n\n const configDir = projectDir ?? pluginDir;\n const loadedConfig = await loadProjectConfig(configDir);\n const projectConfig = loadedConfig?.config ?? null;\n\n // Filter excluded entries once at the entry point — callees receive clean data\n const filteredConfig = projectConfig ? filterExcludedEntries(projectConfig) : null;\n\n const builtinAgents = await loadAllAgents(sourcePath);\n const projectAgents = projectDir ? await loadProjectAgents(projectDir) : {};\n\n // Priority: project agents > built-in agents\n const allAgents: Partial<Record<AgentName, AgentDefinition>> = {\n ...builtinAgents,\n ...projectAgents,\n };\n\n const agentNames = await resolveAgentNames({\n ...(options.agents !== undefined && { specifiedAgents: options.agents }),\n projectConfig: filteredConfig,\n allAgents,\n ...(outputDir !== undefined && { outputDir }),\n pluginDir,\n });\n\n // An empty pass has nothing to say: every caller reports one off `compiled`, and a warning here\n // only ever surfaced merged into the OTHER scope's failure report, beside agents that compiled.\n if (agentNames.length === 0) {\n return { compiled: [], rewritten: [], failed: [], warnings: [] };\n }\n\n verbose(`Recompiling ${agentNames.length} agents in ${outputDir ?? pluginDir}`);\n\n // When skills are not provided, discover from all plugin directories.\n const pluginSkills: SkillDefinitionMap =\n providedSkills ?? (await discoverAllPluginSkills(projectDir ?? pluginDir));\n\n const { configAgents, missingWarnings } = compileEntriesFor(\n agentNames,\n filteredConfig,\n allAgents,\n );\n\n const compileConfig: CompileConfig = {\n name: filteredConfig?.name || path.basename(pluginDir),\n description: filteredConfig?.description || \"Recompiled plugin\",\n agents: configAgents,\n };\n\n const engine = await createLiquidEngine(projectDir);\n const resolvedAgents = await resolveAgents(allAgents, pluginSkills, compileConfig, sourcePath);\n\n const agentsDir = outputDir ?? getPluginAgentsDir(pluginDir);\n await ensureDir(agentsDir);\n\n const outcomes = await writeCompiledAgentsByScope({\n resolvedAgents,\n sourcePath,\n engine,\n projectAgentsDir: agentsDir,\n // The same root this pass loaded its config from, so the provider that decides the FORMAT\n // and the provider that decided the configuration are read off one installation.\n projectDir: configDir,\n ...(options.agentScopeMap !== undefined && { agentScopeMap: options.agentScopeMap }),\n });\n return buildRecompileResult(outcomes, missingWarnings);\n}\n\n/**\n * The compile entries for exactly the agents this pass compiles, and a warning for each named\n * agent that neither the config nor the source defines.\n *\n * `buildCompileAgents` returns entries for ALL agents in the config, but when scopeFilter is\n * active, we only want the agents matching that scope. Without this restriction, a project pass\n * would compile global agents without their stack (since the project config omits global agent\n * stack entries) and overwrite correctly compiled global agent files.\n */\nfunction compileEntriesFor(\n agentNames: AgentName[],\n config: ProjectConfig | null,\n allAgents: Partial<Record<AgentName, AgentDefinition>>,\n): { configAgents: Partial<Record<AgentName, CompileAgentConfig>>; missingWarnings: string[] } {\n const allConfigAgents = config ? buildCompileAgents(config, allAgents) : {};\n\n const [knownAgents, missingAgents] = partition(agentNames, (name) =>\n Boolean(allConfigAgents[name] || allAgents[name]),\n );\n\n return {\n configAgents: typedFromEntries<AgentName, CompileAgentConfig>(\n knownAgents.map((name) => [name, allConfigAgents[name] ?? {}]),\n ),\n missingWarnings: missingAgents.map((name) => `Agent \"${name}\" not found in source definitions`),\n };\n}\n","import os from \"os\";\nimport path from \"path\";\nimport type { Liquid } from \"liquidjs\";\nimport { compileAgentForHost } from \"../compiler.js\";\nimport { resolveInstallPaths } from \"../installation/install-base-dir.js\";\nimport { agentCodec, hostCompilesAgent, providerInUse } from \"../installation/install-layout.js\";\nimport { writeFile, fileExists, readFile } from \"../../utils/fs.js\";\nimport { typedEntries } from \"../../utils/typed-object.js\";\nimport type { Provider } from \"../../consts.js\";\nimport type { AgentConfig, AgentName, SkillScope } from \"../../types/index.js\";\n\nexport type AgentWriteOutcome =\n | {\n name: AgentName;\n ok: true;\n scope: SkillScope;\n targetDir: string;\n /**\n * Whether this pass actually wrote the file. False means the compiled output\n * matched what was already on disk, so nothing was written — which is what\n * lets a recompile summary tell a real one from a no-op instead of counting\n * the roster it walked.\n */\n rewritten: boolean;\n }\n | { name: AgentName; ok: false; error: unknown };\n\n/**\n * Whether the target already holds exactly this content, making a write a no-op.\n *\n * Skipping that write is what gives \"unchanged\" a meaning a caller can check: an\n * agent reported unchanged keeps its mtime, and an mtime is the only trace a\n * rewrite-with-identical-bytes leaves anywhere.\n */\nasync function holdsExactly(filePath: string, content: string): Promise<boolean> {\n return (await fileExists(filePath)) && (await readFile(filePath)) === content;\n}\n\n/**\n * Where an agent goes when `agentScopeMap` has nothing to say about it — either because the caller\n * passed no map at all or because this agent is not in the one it passed (a hand-authored agent\n * under `.claude/agents/` has no config row).\n *\n * This is a ROUTING answer, not a selection default: `\"project\"` here means \"the directory the\n * caller named in `projectAgentsDir`\", which for an unrouted write is the only defensible target.\n * It is deliberately NOT `DEFAULT_SELECTION_OPTIONS.scope` from `@workspace/matrix` — that constant\n * says what an untouched *pick* installs as, and adopting it here would relocate the agents of every\n * caller that never asked for global routing into the user's `~/.claude/agents`.\n */\nconst UNROUTED_AGENT_SCOPE: SkillScope = \"project\";\n\n/**\n * Compiles each resolved agent and writes it to its scope's agents directory:\n * global agents to `~/.claude/agents/`, project agents to `projectAgentsDir`.\n * Per-agent failures are collected as outcomes — callers own the policy\n * (recompile reports and continues; install hard-errors).\n *\n * Neither directory is created up front. `writeFile` makes a target's parent on\n * the way past, so a directory appears exactly when an agent routes into it —\n * which is what keeps a wholly project-scoped pass from leaving an empty\n * `~/.claude/agents/` behind in a home that has no global install.\n */\nexport async function writeCompiledAgentsByScope(params: {\n resolvedAgents: Partial<Record<AgentName, AgentConfig>>;\n sourcePath: string;\n engine: Liquid;\n projectAgentsDir: string;\n /** The root whose folder says which host the PROJECT scope's sub-agents are written for. */\n projectDir: string;\n agentScopeMap?: Map<AgentName, SkillScope>;\n}): Promise<AgentWriteOutcome[]> {\n const hosts: Record<SkillScope, AgentHost> = {\n // Each scope reads its OWN root, the way `resolveInstallPaths` reads one beside this: a\n // project on Codex under a global on Claude is an arrangement this product allows, and one\n // provider answered for both scopes is how a pass writes the wrong format into one of them.\n global: {\n provider: providerInUse(os.homedir()),\n agentsDir: resolveInstallPaths(os.homedir(), \"global\").agentsDir,\n },\n project: { provider: providerInUse(params.projectDir), agentsDir: params.projectAgentsDir },\n };\n\n const outcomes: AgentWriteOutcome[] = [];\n for (const [name, agent] of typedEntries<AgentName, AgentConfig>(params.resolvedAgents)) {\n const scope = params.agentScopeMap?.get(name) ?? UNROUTED_AGENT_SCOPE;\n const host = hosts[scope];\n\n // Before the render, and it produces NO outcome: a sub-agent this host does not carry was\n // not compiled and did not fail, so counting it either way would make a deliberate omission\n // read as a result. The one line the user is owed is the command's, once per run.\n if (!hostCompilesAgent(host.provider, name)) continue;\n\n outcomes.push(await writeOneAgent({ ...params, name, agent, scope, host }));\n }\n return outcomes;\n}\n\n/**\n * One sub-agent rendered for its host and written where that host reads it.\n *\n * The failure is RETURNED rather than thrown, because the policy belongs to the caller: recompile\n * reports and continues, install hard-errors. A pass that stopped at the first bad sub-agent would\n * make that decision for both of them.\n */\nasync function writeOneAgent(params: {\n name: AgentName;\n agent: AgentConfig;\n scope: SkillScope;\n host: AgentHost;\n sourcePath: string;\n engine: Liquid;\n}): Promise<AgentWriteOutcome> {\n const { name, scope, host } = params;\n\n try {\n const output = await compileAgentForHost(\n host.provider,\n name,\n params.agent,\n params.sourcePath,\n params.engine,\n );\n const targetPath = path.join(host.agentsDir, fileNameFor(name, host.provider));\n const rewritten = !(await holdsExactly(targetPath, output));\n if (rewritten) await writeFile(targetPath, output);\n\n return { name, ok: true, scope, targetDir: host.agentsDir, rewritten };\n } catch (error) {\n return { name, ok: false, error };\n }\n}\n\n/** Where one scope's compiled sub-agents go, and in whose format. */\ntype AgentHost = { provider: Provider; agentsDir: string };\n\n/**\n * The file one compiled sub-agent is written to, extension included.\n *\n * The extension comes from {@link agentCodec} rather than from a literal here, because the defect\n * this whole funnel exists against is `web-developer.md` written into `<project>/.codex/agents/`\n * by a pass that then reports success: Codex ignores such a file, nothing recognises it as ours\n * again, and the run exits 0.\n */\nfunction fileNameFor(name: AgentName, provider: Provider): string {\n return `${name}${agentCodec(provider).extension}`;\n}\n","import { Liquid } from \"liquidjs\";\nimport path from \"path\";\nimport {\n buildAgentTemplateContext,\n pluginRefFor,\n renderAgent,\n renderAgentBody,\n renderAgentRoleToml,\n type AgentFiles,\n} from \"@workspace/compile/agent-source\";\nimport { readFile, readFileOptional, directoryExists } from \"../utils/fs\";\nimport { verbose } from \"../utils/logger\";\nimport {\n CLAUDE_DIR,\n DIRS,\n PROJECT_ROOT,\n STANDARD_FILES,\n STANDARD_DIRS,\n type Provider,\n} from \"../consts\";\nimport { providerInUse, sourceFolderInUse, sourceFolderName } from \"./installation/install-layout\";\nimport { cliVersion } from \"./agents/agent-provenance\";\nimport \"./compile-seat.js\";\nimport type { AgentConfig, AgentName } from \"../types\";\n\n/**\n * What survives here is the half of a compile that reads the machine: the five `readFile`s that\n * fetch an agent's partials off disk, and the layered template roots a project can override. The\n * rendering itself — the template context, the injection sanitiser and the provenance stamp — is\n * `@workspace/compile/agent-source`, so the editor's output preview draws the bytes this writes\n * rather than a second implementation of them.\n */\nexport {\n buildAgentTemplateContext,\n sanitizeCompiledAgentData,\n sanitizeLiquidSyntax,\n} from \"@workspace/compile/agent-source\";\n\nasync function readAgentFiles(\n name: AgentName,\n agent: AgentConfig,\n projectRoot: string,\n): Promise<AgentFiles> {\n const agentSourceRoot = agent.sourceRoot || projectRoot;\n const agentBaseDir = agent.agentBaseDir || DIRS.agents;\n const agentPath = agent.path || name;\n const agentDir = path.join(agentSourceRoot, agentBaseDir, agentPath);\n\n const identity = await readFile(path.join(agentDir, STANDARD_FILES.IDENTITY_MD));\n const playbook = await readFile(path.join(agentDir, STANDARD_FILES.PLAYBOOK_MD));\n const criticalRequirementsTop = await readFileOptional(\n path.join(agentDir, STANDARD_FILES.CRITICAL_REQUIREMENTS_MD),\n \"\",\n );\n const criticalReminders = await readFileOptional(\n path.join(agentDir, STANDARD_FILES.CRITICAL_REMINDERS_MD),\n \"\",\n );\n\n const category = agentPath.split(\"/\")[0] || name;\n const categoryDir = path.join(agentSourceRoot, agentBaseDir, category);\n const output = await readOutputPartial(agentDir, categoryDir);\n\n return { identity, playbook, output, criticalRequirementsTop, criticalReminders };\n}\n\n/** The agent's own `output.md`, or its category's where the agent's is absent or empty. */\nasync function readOutputPartial(agentDir: string, categoryDir: string): Promise<string> {\n const own = await readFileOptional(path.join(agentDir, STANDARD_FILES.OUTPUT_MD), \"\");\n if (own) return own;\n return readFileOptional(path.join(categoryDir, STANDARD_FILES.OUTPUT_MD), \"\");\n}\n\n/**\n * Creates a Liquid template engine with a layered template root hierarchy.\n *\n * Template resolution order (first match wins):\n * 1. Project-local templates: `agents/_templates/` inside the project's source folder,\n * `.agents-inc/<provider>/`, resolved by `sourceFolderInUse`\n * 2. Legacy templates: `{projectDir}/.claude/templates/`\n * 3. Built-in templates: `{PROJECT_ROOT}/src/agents/_templates/`\n *\n * The browser-side twin is `createEngineFromTemplates` in `@workspace/compile/engine`, which\n * builds the same engine over the vendored corpus instead of over directories. Every option\n * below is duplicated there, because a render that resolved filters or variables differently\n * would produce a different file from the same data.\n *\n * `globals.sourceFolder` is what makes a compiled agent's own text install-specific. A partial is\n * never rendered through this engine — it is prose, inlined verbatim — so `renderAgent` asks the\n * engine for that global and substitutes the one opted-in token itself, which is how\n * `agent-summoner` names the folder THIS project keeps its source in rather than a literal that is\n * wrong on every install of the other layout.\n *\n * @param projectDir - Optional project directory for local template overrides\n * @returns Configured Liquid engine with `.liquid` extension and strict filters\n */\nexport async function createLiquidEngine(projectDir?: string): Promise<Liquid> {\n const roots: string[] = [];\n // One read for both answers below: the templates this install overrides with, and the folder\n // name a compiled `agent-summoner` is told to author into, have to name one installation.\n const provider = providerInUse(projectDir);\n\n if (projectDir) {\n const srcTemplatesDir = path.join(\n sourceFolderInUse(projectDir, provider).dir,\n STANDARD_DIRS.AGENTS,\n path.basename(DIRS.templates),\n );\n if (await directoryExists(srcTemplatesDir)) {\n roots.push(srcTemplatesDir);\n verbose(`Using local templates from: ${srcTemplatesDir}`);\n }\n\n const legacyTemplatesDir = path.join(projectDir, CLAUDE_DIR, STANDARD_DIRS.TEMPLATES);\n if (await directoryExists(legacyTemplatesDir)) {\n roots.push(legacyTemplatesDir);\n verbose(`Using legacy templates from: ${legacyTemplatesDir}`);\n }\n }\n\n roots.push(path.join(PROJECT_ROOT, DIRS.templates));\n\n return new Liquid({\n root: roots,\n extname: \".liquid\",\n strictVariables: false,\n strictFilters: true,\n globals: { sourceFolder: sourceFolderName(projectDir, provider) },\n });\n}\n\n/**\n * One resolved sub-agent as the file `provider`'s host actually reads.\n *\n * **The two hosts share every byte of the prose and disagree about everything around it.** Claude\n * reads markdown under a frontmatter block; Codex reads an agent ROLE DEFINITION — TOML, three\n * required keys, and a deserializer that drops the WHOLE file on one unlisted key. So the split is\n * at the RENDER and not at the data: both start from the same\n * {@link buildAgentTemplateContext} context, and `renderAgentBody` is by construction the tail of\n * `renderAgent`, which is what makes a Codex sub-agent's instructions its Claude twin's byte for\n * byte.\n *\n * Nothing here decides WHICH sub-agents a host gets — `hostCompilesAgent` answers that, before the\n * write pass reaches this — and nothing here decides where the file goes.\n */\nexport async function compileAgentForHost(\n provider: Provider,\n name: AgentName,\n agent: AgentConfig,\n fallbackRoot: string,\n engine: Liquid,\n): Promise<string> {\n verbose(`Compiling agent: ${name} (${provider})`);\n\n const files = await readAgentFiles(name, agent, fallbackRoot);\n\n // Per-skill pluginRef attachment. Each skill's own `source` decides\n // whether it renders as `${id}:${id}` (plugin-installed) or bare id (ejected).\n // This correctly handles mixed-mode agents where some skills are plugin and\n // others are ejected. Missing `source` (user-authored local skills with no\n // SkillConfig entry) falls through to bare id — the expected case, not a\n // silent fallback.\n const data = buildAgentTemplateContext(name, agent, files, (skill) => ({\n ...skill,\n ...pluginRefFor(skill),\n }));\n const version = await cliVersion();\n\n switch (provider) {\n case \"claude\":\n return renderAgent(engine, data, version);\n case \"codex\":\n return renderAgentRoleToml(agent, await renderAgentBody(engine, data, version));\n default: {\n const _exhaustive: never = provider;\n return _exhaustive;\n }\n }\n}\n","import path from \"path\";\nimport { z } from \"zod\";\n\nimport { PROJECT_ROOT, STANDARD_FILES } from \"../../consts\";\nimport { readFile } from \"../../utils/fs\";\n\n/** The one field the marker needs from this CLI's own manifest. */\nconst ownPackageJsonSchema = z.object({ version: z.string().min(1) });\n\n/**\n * The provenance marker every compiled agent carries lives in `@workspace/compile/agent-source`,\n * beside the renderer that stamps it — the editor's output preview draws the same first body line\n * and must not compute it a second way. What stays here is the half that reads this CLI's own\n * manifest, which a browser has no equivalent of.\n */\nexport {\n hasProvenanceMarker,\n provenanceMarker,\n stampProvenanceMarker,\n} from \"@workspace/compile/agent-source\";\n\nlet ownVersion: Promise<string> | undefined;\n\n/**\n * This CLI's own published version, read once per process from the package manifest beside\n * the code — the same `PROJECT_ROOT` the bundled agent partials and templates resolve from.\n *\n * It reaches a compiled agent as the `version` argument of `renderAgent`, which hands it to the\n * template as `generatorVersion`; `agent.liquid` renders it in the trailing `<system-reminder>`\n * block. Deliberately not the provenance marker above it — that line's bytes are constant across\n * releases, so a version bump no longer rewrites the first cacheable byte of every compiled agent.\n */\nexport function cliVersion(): Promise<string> {\n ownVersion ??= readOwnVersion();\n return ownVersion;\n}\n\nasync function readOwnVersion(): Promise<string> {\n const manifestPath = path.join(PROJECT_ROOT, STANDARD_FILES.PACKAGE_JSON);\n const raw: unknown = JSON.parse(await readFile(manifestPath));\n\n const parsed = ownPackageJsonSchema.safeParse(raw);\n if (!parsed.success) {\n throw new Error(`Could not read this CLI's own version from ${manifestPath}`);\n }\n return parsed.data.version;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,UAAU;AACjB,SAAS,iBAAiB;AAa1B,IAAM,gBAAgB,WAAW,QAAQ;AAWzC,eAAsB,iBAAiB,WAAsC;AAC3E,SAAO,iBAAiB,WAAW,aAAa;AAClD;AAGA,eAAsB,iBAAiB,WAAmB,OAAsC;AAC9F,SAAO,KAAK,MAAM,UAAU,SAAS;AACvC;AAUA,eAAsB,wBACpB,WACA,QAAoB,eACW;AAC/B,QAAM,QAAQ,MAAM,iBAAiB,WAAW,KAAK;AACrD,QAAM,aAAa,MAAM,QAAQ;AAAA,IAC/B,MAAM,IAAI,CAAC,SAAS,oBAAoB,WAAW,MAAM,KAAK,CAAC;AAAA,EACjE;AACA,QAAM,CAAC,QAAQ,QAAQ,IAAI,UAAU,YAAY,CAAC,UAAU,MAAM,YAAY;AAE9E,SAAO,EAAE,QAAQ,OAAO,IAAI,SAAS,GAAG,UAAU,SAAS,IAAI,SAAS,EAAE;AAC5E;AAIA,eAAe,oBACb,WACA,MACA,OAC0B;AAC1B,QAAM,UAAU,MAA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,CAAC;AAAA,IAC/D;AAAA,IACA,iBAAiB,cAAc,IAAI,CAAC,SAAS,UAAU,IAAI,mCAAmC;AAAA,EAChG;AACF;","names":["partition","path","path","path","path","path","path","path","partition","agentName","path"]}
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Wizard
4
- } from "./chunk-ECURHW3T.js";
4
+ } from "./chunk-WWIFNPJG.js";
5
5
  import {
6
6
  promptValue
7
- } from "./chunk-JCPANDNR.js";
7
+ } from "./chunk-4AAOOAIN.js";
8
8
  import {
9
9
  hydrateWizardStore
10
- } from "./chunk-K5ITEA3I.js";
10
+ } from "./chunk-7JNJ52CD.js";
11
11
  import {
12
12
  disableBuffering,
13
13
  drainBuffer,
14
14
  enableBuffering
15
- } from "./chunk-XPDVAJDH.js";
15
+ } from "./chunk-A4KDXNOT.js";
16
16
 
17
17
  // src/cli/components/wizard/run-wizard-session.tsx
18
18
  import "react";
@@ -50,4 +50,4 @@ async function runWizardSession(options) {
50
50
  export {
51
51
  runWizardSession
52
52
  };
53
- //# sourceMappingURL=chunk-RGYDFBCT.js.map
53
+ //# sourceMappingURL=chunk-HHIYT3PI.js.map