agents-inc 0.154.0 → 0.155.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 (213) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/chunk-2H7UWE2G.js +246 -0
  3. package/dist/chunk-2H7UWE2G.js.map +1 -0
  4. package/dist/{chunk-LA3JPESW.js → chunk-4A4L3YIW.js} +5 -5
  5. package/dist/chunk-4G2YHZIM.js +132 -0
  6. package/dist/chunk-4G2YHZIM.js.map +1 -0
  7. package/dist/{chunk-BZ4CZBOM.js → chunk-5F2YR5XV.js} +3 -3
  8. package/dist/{chunk-CHNA5RVS.js → chunk-5OKLCVM4.js} +3 -3
  9. package/dist/{chunk-ZU6DAR4S.js → chunk-5QZAK6J7.js} +7 -7
  10. package/dist/{chunk-ZU6DAR4S.js.map → chunk-5QZAK6J7.js.map} +1 -1
  11. package/dist/{chunk-NFH6SA62.js → chunk-6RLV45HN.js} +10 -10
  12. package/dist/{chunk-NFH6SA62.js.map → chunk-6RLV45HN.js.map} +1 -1
  13. package/dist/{chunk-GUDGCFSF.js → chunk-CLFHC2DK.js} +15 -106
  14. package/dist/chunk-CLFHC2DK.js.map +1 -0
  15. package/dist/chunk-D2CAV7MG.js +61 -0
  16. package/dist/chunk-D2CAV7MG.js.map +1 -0
  17. package/dist/{chunk-UW44KSYL.js → chunk-F2AMBBIA.js} +6 -6
  18. package/dist/{chunk-UW44KSYL.js.map → chunk-F2AMBBIA.js.map} +1 -1
  19. package/dist/{chunk-QQTYMW7N.js → chunk-F5T6TV4Z.js} +206 -73
  20. package/dist/chunk-F5T6TV4Z.js.map +1 -0
  21. package/dist/{chunk-K3O3YQYG.js → chunk-G47TDUK3.js} +2 -2
  22. package/dist/{chunk-AURY6RT6.js → chunk-GS2NZ3GD.js} +8 -8
  23. package/dist/chunk-GS2NZ3GD.js.map +1 -0
  24. package/dist/{chunk-5MFJ24VM.js → chunk-H6UTKTLK.js} +104 -250
  25. package/dist/chunk-H6UTKTLK.js.map +1 -0
  26. package/dist/{chunk-MJFIO5SX.js → chunk-HG4JPXJT.js} +11 -11
  27. package/dist/chunk-HG4JPXJT.js.map +1 -0
  28. package/dist/{chunk-IXEDSKMH.js → chunk-HTYH7CKN.js} +3 -3
  29. package/dist/{chunk-JC7DBPRD.js → chunk-HXKOIWLU.js} +2 -2
  30. package/dist/chunk-HXKOIWLU.js.map +1 -0
  31. package/dist/{chunk-NSJ2S7R5.js → chunk-ILUVL7WM.js} +2 -2
  32. package/dist/{chunk-R54KIGN2.js → chunk-IO5YBKHV.js} +13 -2
  33. package/dist/chunk-IO5YBKHV.js.map +1 -0
  34. package/dist/chunk-IXRZAHZF.js +53 -0
  35. package/dist/chunk-IXRZAHZF.js.map +1 -0
  36. package/dist/chunk-JCPANDNR.js +35 -0
  37. package/dist/chunk-JCPANDNR.js.map +1 -0
  38. package/dist/{chunk-NKCY2ULI.js → chunk-LJCNUP6M.js} +2 -2
  39. package/dist/{chunk-PRJD5MMQ.js → chunk-MHRC3KRX.js} +5 -5
  40. package/dist/chunk-MHRC3KRX.js.map +1 -0
  41. package/dist/chunk-MO5FGLVS.js +142 -0
  42. package/dist/chunk-MO5FGLVS.js.map +1 -0
  43. package/dist/{chunk-Q5FLW4JG.js → chunk-OKH64JZE.js} +2 -2
  44. package/dist/{chunk-WRRP47PY.js → chunk-PCC4LBKB.js} +2 -2
  45. package/dist/chunk-PMUABBPG.js +258 -0
  46. package/dist/chunk-PMUABBPG.js.map +1 -0
  47. package/dist/{chunk-2IMYK4WN.js → chunk-PNMM5HNX.js} +5 -5
  48. package/dist/{chunk-AKQ5QISO.js → chunk-QWVXOCXO.js} +6 -6
  49. package/dist/{chunk-IPJOMAWC.js → chunk-RWOYPOMR.js} +12 -2
  50. package/dist/{chunk-IPJOMAWC.js.map → chunk-RWOYPOMR.js.map} +1 -1
  51. package/dist/{chunk-ONWEOS77.js → chunk-SY4X2LND.js} +4 -4
  52. package/dist/{chunk-XGMOXMS4.js → chunk-TBOVYLQJ.js} +2 -2
  53. package/dist/{chunk-R7JV22QK.js → chunk-TNGMF4UX.js} +20 -20
  54. package/dist/{chunk-R7JV22QK.js.map → chunk-TNGMF4UX.js.map} +1 -1
  55. package/dist/{chunk-7VZV4O6B.js → chunk-UMH2YZKG.js} +14 -5
  56. package/dist/chunk-UMH2YZKG.js.map +1 -0
  57. package/dist/{chunk-6CNRMCFM.js → chunk-VPASBA7P.js} +2 -2
  58. package/dist/{chunk-CBF4ZYV3.js → chunk-WCAUUBHO.js} +1376 -741
  59. package/dist/chunk-WCAUUBHO.js.map +1 -0
  60. package/dist/{chunk-V3ENMW7G.js → chunk-WFRTHH3A.js} +3 -3
  61. package/dist/{chunk-DRKSYJZ2.js → chunk-WTJ3AY33.js} +1 -1
  62. package/dist/{chunk-DRKSYJZ2.js.map → chunk-WTJ3AY33.js.map} +1 -1
  63. package/dist/{chunk-XMEIVWAS.js → chunk-WUQ3MTPF.js} +11 -5
  64. package/dist/{chunk-XMEIVWAS.js.map → chunk-WUQ3MTPF.js.map} +1 -1
  65. package/dist/{chunk-4VCWL2IG.js → chunk-XAXJWXI4.js} +92 -59
  66. package/dist/chunk-XAXJWXI4.js.map +1 -0
  67. package/dist/{chunk-B66SC72V.js → chunk-Y5Y7XHVU.js} +4 -4
  68. package/dist/{chunk-FMYHWKGG.js → chunk-YO2LTXB4.js} +66 -16
  69. package/dist/chunk-YO2LTXB4.js.map +1 -0
  70. package/dist/{chunk-TUQF577Z.js → chunk-ZUAZHDKP.js} +40 -41
  71. package/dist/chunk-ZUAZHDKP.js.map +1 -0
  72. package/dist/commands/build/marketplace.js +98 -121
  73. package/dist/commands/build/marketplace.js.map +1 -1
  74. package/dist/commands/build/plugins.js +8 -8
  75. package/dist/commands/compile.js +19 -24
  76. package/dist/commands/compile.js.map +1 -1
  77. package/dist/commands/doctor.js +220 -79
  78. package/dist/commands/doctor.js.map +1 -1
  79. package/dist/commands/edit.js +549 -75
  80. package/dist/commands/edit.js.map +1 -1
  81. package/dist/commands/eject.js +26 -21
  82. package/dist/commands/eject.js.map +1 -1
  83. package/dist/commands/init.js +41 -39
  84. package/dist/commands/list.js +11 -11
  85. package/dist/commands/list.js.map +1 -1
  86. package/dist/commands/new/marketplace.js +243 -0
  87. package/dist/commands/new/marketplace.js.map +1 -0
  88. package/dist/commands/search.js +16 -14
  89. package/dist/commands/search.js.map +1 -1
  90. package/dist/commands/share.js +67 -0
  91. package/dist/commands/share.js.map +1 -0
  92. package/dist/commands/uninstall.js +61 -74
  93. package/dist/commands/uninstall.js.map +1 -1
  94. package/dist/commands/update.js +9 -9
  95. package/dist/commands/update.js.map +1 -1
  96. package/dist/components/common/prompt-confirm.js +1 -1
  97. package/dist/components/common/removal-plan-confirm.js +10 -0
  98. package/dist/components/common/select-list.js +2 -2
  99. package/dist/components/wizard/category-grid.js +5 -5
  100. package/dist/components/wizard/checkbox-grid.js +5 -5
  101. package/dist/components/wizard/domain-selection.js +11 -11
  102. package/dist/components/wizard/run-wizard-session.js +29 -28
  103. package/dist/components/wizard/scroll-affordance.js +2 -2
  104. package/dist/components/wizard/skill-agent-summary.js +6 -6
  105. package/dist/components/wizard/source-grid.js +6 -6
  106. package/dist/components/wizard/stack-selection.js +8 -8
  107. package/dist/components/wizard/step-agents.js +10 -11
  108. package/dist/components/wizard/step-build.js +9 -9
  109. package/dist/components/wizard/step-confirm.js +10 -10
  110. package/dist/components/wizard/step-sources.js +10 -10
  111. package/dist/components/wizard/step-stack.js +9 -9
  112. package/dist/components/wizard/summary-panel.js +9 -9
  113. package/dist/components/wizard/toast.js +2 -2
  114. package/dist/components/wizard/wizard-layout.js +14 -14
  115. package/dist/components/wizard/wizard-tabs.js +2 -2
  116. package/dist/components/wizard/wizard.js +27 -27
  117. package/dist/copy-local-skills-NSUTBVLJ.js +14 -0
  118. package/dist/hooks/init.js +42 -62
  119. package/dist/hooks/init.js.map +1 -1
  120. package/dist/load-agent-defs-X4E57I2U.js +15 -0
  121. package/dist/{loader-JIZDTR4G.js → loader-G6BFG2VA.js} +3 -3
  122. package/dist/recompile-project-agents-JE4MM72I.js +20 -0
  123. package/dist/{source-loader-OE6EJFPU.js → source-loader-3DL3NYUX.js} +7 -5
  124. package/dist/source-loader-3DL3NYUX.js.map +1 -0
  125. package/dist/src/agents/developer/ai-developer/critical-reminders.md +1 -1
  126. package/dist/src/agents/developer/ai-developer/critical-requirements.md +1 -1
  127. package/dist/src/agents/developer/ai-developer/identity.md +1 -1
  128. package/dist/src/agents/developer/ai-developer/playbook.md +1 -1
  129. package/dist/src/agents/developer/api-developer/identity.md +1 -1
  130. package/dist/src/agents/developer/cli-developer/identity.md +1 -1
  131. package/dist/src/agents/developer/web-developer/identity.md +1 -1
  132. package/dist/src/agents/meta/codex-keeper/identity.md +1 -1
  133. package/dist/src/agents/meta/convention-keeper/identity.md +1 -1
  134. package/dist/src/agents/meta/skill-summoner/identity.md +1 -1
  135. package/dist/src/agents/researcher/ai-researcher/identity.md +1 -1
  136. package/dist/src/agents/researcher/api-researcher/identity.md +1 -1
  137. package/dist/src/agents/researcher/cli-researcher/identity.md +1 -1
  138. package/dist/src/agents/researcher/web-researcher/identity.md +1 -1
  139. package/dist/src/agents/reviewer/reviewer/playbook.md +1 -1
  140. package/dist/src/agents/tester/ai-tester/identity.md +1 -1
  141. package/dist/src/agents/tester/api-tester/critical-reminders.md +1 -1
  142. package/dist/src/agents/tester/api-tester/critical-requirements.md +1 -1
  143. package/dist/src/agents/tester/api-tester/identity.md +2 -2
  144. package/dist/src/agents/tester/cli-tester/identity.md +1 -1
  145. package/dist/src/agents/tester/web-tester/identity.md +3 -3
  146. package/dist/stores/wizard-store.js +7 -5
  147. package/package.json +10 -7
  148. package/src/agents/developer/ai-developer/critical-reminders.md +1 -1
  149. package/src/agents/developer/ai-developer/critical-requirements.md +1 -1
  150. package/src/agents/developer/ai-developer/identity.md +1 -1
  151. package/src/agents/developer/ai-developer/playbook.md +1 -1
  152. package/src/agents/developer/api-developer/identity.md +1 -1
  153. package/src/agents/developer/cli-developer/identity.md +1 -1
  154. package/src/agents/developer/web-developer/identity.md +1 -1
  155. package/src/agents/meta/codex-keeper/identity.md +1 -1
  156. package/src/agents/meta/convention-keeper/identity.md +1 -1
  157. package/src/agents/meta/skill-summoner/identity.md +1 -1
  158. package/src/agents/researcher/ai-researcher/identity.md +1 -1
  159. package/src/agents/researcher/api-researcher/identity.md +1 -1
  160. package/src/agents/researcher/cli-researcher/identity.md +1 -1
  161. package/src/agents/researcher/web-researcher/identity.md +1 -1
  162. package/src/agents/reviewer/reviewer/playbook.md +1 -1
  163. package/src/agents/tester/ai-tester/identity.md +1 -1
  164. package/src/agents/tester/api-tester/critical-reminders.md +1 -1
  165. package/src/agents/tester/api-tester/critical-requirements.md +1 -1
  166. package/src/agents/tester/api-tester/identity.md +2 -2
  167. package/src/agents/tester/cli-tester/identity.md +1 -1
  168. package/src/agents/tester/web-tester/identity.md +3 -3
  169. package/src/schemas/custom-metadata.schema.json +3 -0
  170. package/src/schemas/metadata.schema.json +3 -0
  171. package/src/schemas/project-config.schema.json +4 -8
  172. package/src/schemas/project-source-config.schema.json +2 -2
  173. package/dist/chunk-4VCWL2IG.js.map +0 -1
  174. package/dist/chunk-5MFJ24VM.js.map +0 -1
  175. package/dist/chunk-7VZV4O6B.js.map +0 -1
  176. package/dist/chunk-AURY6RT6.js.map +0 -1
  177. package/dist/chunk-CBF4ZYV3.js.map +0 -1
  178. package/dist/chunk-FMYHWKGG.js.map +0 -1
  179. package/dist/chunk-GUDGCFSF.js.map +0 -1
  180. package/dist/chunk-JC7DBPRD.js.map +0 -1
  181. package/dist/chunk-MJFIO5SX.js.map +0 -1
  182. package/dist/chunk-OJJLYHM3.js +0 -34
  183. package/dist/chunk-OJJLYHM3.js.map +0 -1
  184. package/dist/chunk-PRJD5MMQ.js.map +0 -1
  185. package/dist/chunk-QQTYMW7N.js.map +0 -1
  186. package/dist/chunk-QUDQTO3O.js +0 -41
  187. package/dist/chunk-QUDQTO3O.js.map +0 -1
  188. package/dist/chunk-R54KIGN2.js.map +0 -1
  189. package/dist/chunk-TUQF577Z.js.map +0 -1
  190. package/dist/copy-local-skills-WVHJFRPK.js +0 -14
  191. package/dist/load-agent-defs-5OT54J5M.js +0 -15
  192. package/dist/recompile-project-agents-VREEPBDV.js +0 -20
  193. /package/dist/{chunk-LA3JPESW.js.map → chunk-4A4L3YIW.js.map} +0 -0
  194. /package/dist/{chunk-BZ4CZBOM.js.map → chunk-5F2YR5XV.js.map} +0 -0
  195. /package/dist/{chunk-CHNA5RVS.js.map → chunk-5OKLCVM4.js.map} +0 -0
  196. /package/dist/{chunk-K3O3YQYG.js.map → chunk-G47TDUK3.js.map} +0 -0
  197. /package/dist/{chunk-IXEDSKMH.js.map → chunk-HTYH7CKN.js.map} +0 -0
  198. /package/dist/{chunk-NSJ2S7R5.js.map → chunk-ILUVL7WM.js.map} +0 -0
  199. /package/dist/{chunk-NKCY2ULI.js.map → chunk-LJCNUP6M.js.map} +0 -0
  200. /package/dist/{chunk-Q5FLW4JG.js.map → chunk-OKH64JZE.js.map} +0 -0
  201. /package/dist/{chunk-WRRP47PY.js.map → chunk-PCC4LBKB.js.map} +0 -0
  202. /package/dist/{chunk-2IMYK4WN.js.map → chunk-PNMM5HNX.js.map} +0 -0
  203. /package/dist/{chunk-AKQ5QISO.js.map → chunk-QWVXOCXO.js.map} +0 -0
  204. /package/dist/{chunk-ONWEOS77.js.map → chunk-SY4X2LND.js.map} +0 -0
  205. /package/dist/{chunk-XGMOXMS4.js.map → chunk-TBOVYLQJ.js.map} +0 -0
  206. /package/dist/{chunk-6CNRMCFM.js.map → chunk-VPASBA7P.js.map} +0 -0
  207. /package/dist/{chunk-V3ENMW7G.js.map → chunk-WFRTHH3A.js.map} +0 -0
  208. /package/dist/{chunk-B66SC72V.js.map → chunk-Y5Y7XHVU.js.map} +0 -0
  209. /package/dist/{copy-local-skills-WVHJFRPK.js.map → components/common/removal-plan-confirm.js.map} +0 -0
  210. /package/dist/{load-agent-defs-5OT54J5M.js.map → copy-local-skills-NSUTBVLJ.js.map} +0 -0
  211. /package/dist/{loader-JIZDTR4G.js.map → load-agent-defs-X4E57I2U.js.map} +0 -0
  212. /package/dist/{recompile-project-agents-VREEPBDV.js.map → loader-G6BFG2VA.js.map} +0 -0
  213. /package/dist/{source-loader-OE6EJFPU.js.map → recompile-project-agents-JE4MM72I.js.map} +0 -0
@@ -1,26 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  loadSource
4
- } from "../chunk-XMEIVWAS.js";
5
- import "../chunk-ZU6DAR4S.js";
6
- import "../chunk-UW44KSYL.js";
7
- import "../chunk-PRJD5MMQ.js";
8
- import "../chunk-TUQF577Z.js";
4
+ } from "../chunk-WUQ3MTPF.js";
5
+ import "../chunk-5QZAK6J7.js";
6
+ import "../chunk-MHRC3KRX.js";
7
+ import "../chunk-F2AMBBIA.js";
8
+ import "../chunk-ZUAZHDKP.js";
9
9
  import {
10
10
  BaseCommand
11
- } from "../chunk-FMYHWKGG.js";
12
- import "../chunk-7VZV4O6B.js";
13
- import "../chunk-K3O3YQYG.js";
11
+ } from "../chunk-YO2LTXB4.js";
12
+ import "../chunk-UMH2YZKG.js";
13
+ import "../chunk-G47TDUK3.js";
14
14
  import {
15
15
  STATUS_MESSAGES,
16
16
  truncateText
17
- } from "../chunk-CBF4ZYV3.js";
18
- import "../chunk-4VCWL2IG.js";
19
- import "../chunk-IPJOMAWC.js";
17
+ } from "../chunk-WCAUUBHO.js";
18
+ import "../chunk-XAXJWXI4.js";
19
+ import "../chunk-RWOYPOMR.js";
20
20
  import {
21
21
  typedValues
22
22
  } from "../chunk-VASLW636.js";
23
- import "../chunk-R54KIGN2.js";
23
+ import "../chunk-IO5YBKHV.js";
24
24
  import "../chunk-VZRO7RYT.js";
25
25
 
26
26
  // src/cli/commands/search.ts
@@ -74,7 +74,7 @@ var Search = class _Search extends BaseCommand {
74
74
  columns: [
75
75
  { key: "id", name: "ID" },
76
76
  { key: "name", name: "Name" },
77
- { key: "source", name: "Source" },
77
+ { key: "source", name: "Origin" },
78
78
  { key: "category", name: "Category" },
79
79
  { key: "description", name: "Description" }
80
80
  ],
@@ -102,7 +102,9 @@ function toResultRow(skill) {
102
102
  function activeSourceName(skill) {
103
103
  const { activeSource } = skill;
104
104
  if (!activeSource) {
105
- throw new Error(`Skill "${skill.id}" was loaded without a source, so its origin is unknown`);
105
+ throw new Error(
106
+ `Skill "${skill.id}" was loaded with no origin, so where it comes from is unknown`
107
+ );
106
108
  }
107
109
  return activeSource.name;
108
110
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/commands/search.ts"],"sourcesContent":["import { Args } from \"@oclif/core\";\nimport { printTable } from \"@oclif/table\";\nimport { sortBy } from \"remeda\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { loadSource } from \"../lib/operations/index.js\";\nimport type { ResolvedSkill } from \"../types/index.js\";\nimport { STATUS_MESSAGES } from \"../utils/messages.js\";\nimport { truncateText } from \"../utils/string.js\";\nimport { typedValues } from \"../utils/typed-object.js\";\n\nconst MAX_DESCRIPTION_WIDTH = 50;\n\n/**\n * One row of the results table. `id` and `category` are the skill's own values; `name`, `source`\n * and `description` are rendered for the cell, so they are plain strings.\n */\ntype ResultRow = Pick<ResolvedSkill, \"id\" | \"category\"> & {\n name: string;\n source: string;\n description: string;\n};\n\nexport default class Search extends BaseCommand {\n static summary = \"Search the catalog of available skills\";\n static description =\n \"Read-only catalog browse. Searches the marketplace this installation reads from, \" +\n \"plus the local skills already on disk, by id, displayName, slug, description, or \" +\n \"category. Use `edit` to install what it finds.\";\n\n static examples = [\n {\n description: \"Search for React skills\",\n command: \"<%= config.bin %> search react\",\n },\n {\n description: \"Search by any keyword (matches id, name, description, category)\",\n command: \"<%= config.bin %> search state\",\n },\n ];\n\n static args = {\n query: Args.string({\n description: \"Search query (matches id, displayName, slug, description, category)\",\n required: true,\n }),\n };\n\n static flags = {};\n\n async run(): Promise<void> {\n const { args } = await this.parse(Search);\n await this.runSearch(args.query);\n }\n\n private async runSearch(query: string): Promise<void> {\n try {\n this.log(STATUS_MESSAGES.LOADING_SKILLS);\n\n const allSkills = await loadSearchableSkills();\n\n const results = sortBy(\n allSkills.filter((skill) => matchesQuery(skill, query)),\n (r) => r.displayName.toLowerCase(),\n );\n\n this.log(\"\");\n if (results.length === 0) {\n this.warn(`No skills found matching \"${query}\"`);\n return;\n }\n\n this.logInfo(\n `Found ${results.length} skill${results.length === 1 ? \"\" : \"s\"} matching \"${query}\"`,\n );\n this.log(\"\");\n\n printTable({\n data: results.map(toResultRow),\n columns: [\n { key: \"id\", name: \"ID\" },\n { key: \"name\", name: \"Name\" },\n { key: \"source\", name: \"Source\" },\n { key: \"category\", name: \"Category\" },\n { key: \"description\", name: \"Description\" },\n ],\n headerOptions: { bold: true },\n });\n this.log(\"\");\n } catch (error) {\n this.handleError(error);\n }\n }\n}\n\n/**\n * Every skill the catalog can offer: the marketplace matrix, which `loadSource` has already\n * merged the on-disk local skills into. There is no second source to reach for — the\n * registered-extras array this used to fan out over was withdrawn with the marketplace axis\n * (CLI-450), so the read is one load and no network beyond it.\n */\nasync function loadSearchableSkills(): Promise<ResolvedSkill[]> {\n const { sourceResult } = await loadSource({ projectDir: process.cwd() });\n\n return typedValues(sourceResult.matrix.skills);\n}\n\n/**\n * The machine id and the display name are different answers and get a column each — `edit`\n * takes the id, a human reads the name.\n */\nfunction toResultRow(skill: ResolvedSkill): ResultRow {\n return {\n id: skill.id,\n name: skill.displayName,\n source: activeSourceName(skill),\n category: skill.category,\n description: truncateText(skill.description, MAX_DESCRIPTION_WIDTH),\n };\n}\n\n/**\n * Where this installation reads the skill from: the local copy when one is on disk, otherwise\n * the marketplace the load resolved. Both names are written by the tagging pass\n * (`loadSkillsFromAllSources`), which `loadSource` always runs — a skill that reached the table\n * untagged would have no origin to report, so say so rather than name one it might not have.\n */\nfunction activeSourceName(skill: ResolvedSkill): string {\n const { activeSource } = skill;\n if (!activeSource) {\n throw new Error(`Skill \"${skill.id}\" was loaded without a source, so its origin is unknown`);\n }\n return activeSource.name;\n}\n\nfunction matchesQuery(skill: ResolvedSkill, query: string): boolean {\n const lowerQuery = query.toLowerCase();\n return [skill.id, skill.displayName, skill.slug, skill.description, skill.category].some(\n (field) => field.toLowerCase().includes(lowerQuery),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AASvB,IAAM,wBAAwB;AAY9B,IAAqB,SAArB,MAAqB,gBAAe,YAAY;AAAA,EAC9C,OAAO,UAAU;AAAA,EACjB,OAAO,cACL;AAAA,EAIF,OAAO,WAAW;AAAA,IAChB;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,OAAO,OAAO;AAAA,IACZ,OAAO,KAAK,OAAO;AAAA,MACjB,aAAa;AAAA,MACb,UAAU;AAAA,IACZ,CAAC;AAAA,EACH;AAAA,EAEA,OAAO,QAAQ,CAAC;AAAA,EAEhB,MAAM,MAAqB;AACzB,UAAM,EAAE,KAAK,IAAI,MAAM,KAAK,MAAM,OAAM;AACxC,UAAM,KAAK,UAAU,KAAK,KAAK;AAAA,EACjC;AAAA,EAEA,MAAc,UAAU,OAA8B;AACpD,QAAI;AACF,WAAK,IAAI,gBAAgB,cAAc;AAEvC,YAAM,YAAY,MAAM,qBAAqB;AAE7C,YAAM,UAAU;AAAA,QACd,UAAU,OAAO,CAAC,UAAU,aAAa,OAAO,KAAK,CAAC;AAAA,QACtD,CAAC,MAAM,EAAE,YAAY,YAAY;AAAA,MACnC;AAEA,WAAK,IAAI,EAAE;AACX,UAAI,QAAQ,WAAW,GAAG;AACxB,aAAK,KAAK,6BAA6B,KAAK,GAAG;AAC/C;AAAA,MACF;AAEA,WAAK;AAAA,QACH,SAAS,QAAQ,MAAM,SAAS,QAAQ,WAAW,IAAI,KAAK,GAAG,cAAc,KAAK;AAAA,MACpF;AACA,WAAK,IAAI,EAAE;AAEX,iBAAW;AAAA,QACT,MAAM,QAAQ,IAAI,WAAW;AAAA,QAC7B,SAAS;AAAA,UACP,EAAE,KAAK,MAAM,MAAM,KAAK;AAAA,UACxB,EAAE,KAAK,QAAQ,MAAM,OAAO;AAAA,UAC5B,EAAE,KAAK,UAAU,MAAM,SAAS;AAAA,UAChC,EAAE,KAAK,YAAY,MAAM,WAAW;AAAA,UACpC,EAAE,KAAK,eAAe,MAAM,cAAc;AAAA,QAC5C;AAAA,QACA,eAAe,EAAE,MAAM,KAAK;AAAA,MAC9B,CAAC;AACD,WAAK,IAAI,EAAE;AAAA,IACb,SAAS,OAAO;AACd,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF;AACF;AAQA,eAAe,uBAAiD;AAC9D,QAAM,EAAE,aAAa,IAAI,MAAM,WAAW,EAAE,YAAY,QAAQ,IAAI,EAAE,CAAC;AAEvE,SAAO,YAAY,aAAa,OAAO,MAAM;AAC/C;AAMA,SAAS,YAAY,OAAiC;AACpD,SAAO;AAAA,IACL,IAAI,MAAM;AAAA,IACV,MAAM,MAAM;AAAA,IACZ,QAAQ,iBAAiB,KAAK;AAAA,IAC9B,UAAU,MAAM;AAAA,IAChB,aAAa,aAAa,MAAM,aAAa,qBAAqB;AAAA,EACpE;AACF;AAQA,SAAS,iBAAiB,OAA8B;AACtD,QAAM,EAAE,aAAa,IAAI;AACzB,MAAI,CAAC,cAAc;AACjB,UAAM,IAAI,MAAM,UAAU,MAAM,EAAE,yDAAyD;AAAA,EAC7F;AACA,SAAO,aAAa;AACtB;AAEA,SAAS,aAAa,OAAsB,OAAwB;AAClE,QAAM,aAAa,MAAM,YAAY;AACrC,SAAO,CAAC,MAAM,IAAI,MAAM,aAAa,MAAM,MAAM,MAAM,aAAa,MAAM,QAAQ,EAAE;AAAA,IAClF,CAAC,UAAU,MAAM,YAAY,EAAE,SAAS,UAAU;AAAA,EACpD;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/cli/commands/search.ts"],"sourcesContent":["import { Args } from \"@oclif/core\";\nimport { printTable } from \"@oclif/table\";\nimport { sortBy } from \"remeda\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { loadSource } from \"../lib/operations/index.js\";\nimport type { ResolvedSkill } from \"../types/index.js\";\nimport { STATUS_MESSAGES } from \"../utils/messages.js\";\nimport { truncateText } from \"../utils/string.js\";\nimport { typedValues } from \"../utils/typed-object.js\";\n\nconst MAX_DESCRIPTION_WIDTH = 50;\n\n/**\n * One row of the results table. `id` and `category` are the skill's own values; `name`, `source`\n * and `description` are rendered for the cell, so they are plain strings.\n */\ntype ResultRow = Pick<ResolvedSkill, \"id\" | \"category\"> & {\n name: string;\n source: string;\n description: string;\n};\n\nexport default class Search extends BaseCommand {\n static summary = \"Search the catalog of available skills\";\n static description =\n \"Read-only catalog browse. Searches the marketplace this installation reads from, \" +\n \"plus the local skills already on disk, by id, displayName, slug, description, or \" +\n \"category. Use `edit` to install what it finds.\";\n\n static examples = [\n {\n description: \"Search for React skills\",\n command: \"<%= config.bin %> search react\",\n },\n {\n description: \"Search by any keyword (matches id, name, description, category)\",\n command: \"<%= config.bin %> search state\",\n },\n ];\n\n static args = {\n query: Args.string({\n description: \"Search query (matches id, displayName, slug, description, category)\",\n required: true,\n }),\n };\n\n static flags = {};\n\n async run(): Promise<void> {\n const { args } = await this.parse(Search);\n await this.runSearch(args.query);\n }\n\n private async runSearch(query: string): Promise<void> {\n try {\n this.log(STATUS_MESSAGES.LOADING_SKILLS);\n\n const allSkills = await loadSearchableSkills();\n\n const results = sortBy(\n allSkills.filter((skill) => matchesQuery(skill, query)),\n (r) => r.displayName.toLowerCase(),\n );\n\n this.log(\"\");\n if (results.length === 0) {\n this.warn(`No skills found matching \"${query}\"`);\n return;\n }\n\n this.logInfo(\n `Found ${results.length} skill${results.length === 1 ? \"\" : \"s\"} matching \"${query}\"`,\n );\n this.log(\"\");\n\n printTable({\n data: results.map(toResultRow),\n columns: [\n { key: \"id\", name: \"ID\" },\n { key: \"name\", name: \"Name\" },\n { key: \"source\", name: \"Origin\" },\n { key: \"category\", name: \"Category\" },\n { key: \"description\", name: \"Description\" },\n ],\n headerOptions: { bold: true },\n });\n this.log(\"\");\n } catch (error) {\n this.handleError(error);\n }\n }\n}\n\n/**\n * Every skill the catalog can offer: the marketplace matrix, which `loadSource` has already\n * merged the on-disk local skills into. There is no second source to reach for — the\n * registered-extras array this used to fan out over was withdrawn with the marketplace axis\n * (CLI-450), so the read is one load and no network beyond it.\n */\nasync function loadSearchableSkills(): Promise<ResolvedSkill[]> {\n const { sourceResult } = await loadSource({ projectDir: process.cwd() });\n\n return typedValues(sourceResult.matrix.skills);\n}\n\n/**\n * The machine id and the display name are different answers and get a column each — `edit`\n * takes the id, a human reads the name.\n */\nfunction toResultRow(skill: ResolvedSkill): ResultRow {\n return {\n id: skill.id,\n name: skill.displayName,\n source: activeSourceName(skill),\n category: skill.category,\n description: truncateText(skill.description, MAX_DESCRIPTION_WIDTH),\n };\n}\n\n/**\n * Where this installation reads the skill from: the local copy when one is on disk, otherwise\n * the marketplace the load resolved. Both names are written by the tagging pass\n * (`loadSkillsFromAllSources`), which `loadSource` always runs — a skill that reached the table\n * untagged would have no origin to report, so say so rather than name one it might not have.\n */\nfunction activeSourceName(skill: ResolvedSkill): string {\n const { activeSource } = skill;\n if (!activeSource) {\n throw new Error(\n `Skill \"${skill.id}\" was loaded with no origin, so where it comes from is unknown`,\n );\n }\n return activeSource.name;\n}\n\nfunction matchesQuery(skill: ResolvedSkill, query: string): boolean {\n const lowerQuery = query.toLowerCase();\n return [skill.id, skill.displayName, skill.slug, skill.description, skill.category].some(\n (field) => field.toLowerCase().includes(lowerQuery),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AASvB,IAAM,wBAAwB;AAY9B,IAAqB,SAArB,MAAqB,gBAAe,YAAY;AAAA,EAC9C,OAAO,UAAU;AAAA,EACjB,OAAO,cACL;AAAA,EAIF,OAAO,WAAW;AAAA,IAChB;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,OAAO,OAAO;AAAA,IACZ,OAAO,KAAK,OAAO;AAAA,MACjB,aAAa;AAAA,MACb,UAAU;AAAA,IACZ,CAAC;AAAA,EACH;AAAA,EAEA,OAAO,QAAQ,CAAC;AAAA,EAEhB,MAAM,MAAqB;AACzB,UAAM,EAAE,KAAK,IAAI,MAAM,KAAK,MAAM,OAAM;AACxC,UAAM,KAAK,UAAU,KAAK,KAAK;AAAA,EACjC;AAAA,EAEA,MAAc,UAAU,OAA8B;AACpD,QAAI;AACF,WAAK,IAAI,gBAAgB,cAAc;AAEvC,YAAM,YAAY,MAAM,qBAAqB;AAE7C,YAAM,UAAU;AAAA,QACd,UAAU,OAAO,CAAC,UAAU,aAAa,OAAO,KAAK,CAAC;AAAA,QACtD,CAAC,MAAM,EAAE,YAAY,YAAY;AAAA,MACnC;AAEA,WAAK,IAAI,EAAE;AACX,UAAI,QAAQ,WAAW,GAAG;AACxB,aAAK,KAAK,6BAA6B,KAAK,GAAG;AAC/C;AAAA,MACF;AAEA,WAAK;AAAA,QACH,SAAS,QAAQ,MAAM,SAAS,QAAQ,WAAW,IAAI,KAAK,GAAG,cAAc,KAAK;AAAA,MACpF;AACA,WAAK,IAAI,EAAE;AAEX,iBAAW;AAAA,QACT,MAAM,QAAQ,IAAI,WAAW;AAAA,QAC7B,SAAS;AAAA,UACP,EAAE,KAAK,MAAM,MAAM,KAAK;AAAA,UACxB,EAAE,KAAK,QAAQ,MAAM,OAAO;AAAA,UAC5B,EAAE,KAAK,UAAU,MAAM,SAAS;AAAA,UAChC,EAAE,KAAK,YAAY,MAAM,WAAW;AAAA,UACpC,EAAE,KAAK,eAAe,MAAM,cAAc;AAAA,QAC5C;AAAA,QACA,eAAe,EAAE,MAAM,KAAK;AAAA,MAC9B,CAAC;AACD,WAAK,IAAI,EAAE;AAAA,IACb,SAAS,OAAO;AACd,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF;AACF;AAQA,eAAe,uBAAiD;AAC9D,QAAM,EAAE,aAAa,IAAI,MAAM,WAAW,EAAE,YAAY,QAAQ,IAAI,EAAE,CAAC;AAEvE,SAAO,YAAY,aAAa,OAAO,MAAM;AAC/C;AAMA,SAAS,YAAY,OAAiC;AACpD,SAAO;AAAA,IACL,IAAI,MAAM;AAAA,IACV,MAAM,MAAM;AAAA,IACZ,QAAQ,iBAAiB,KAAK;AAAA,IAC9B,UAAU,MAAM;AAAA,IAChB,aAAa,aAAa,MAAM,aAAa,qBAAqB;AAAA,EACpE;AACF;AAQA,SAAS,iBAAiB,OAA8B;AACtD,QAAM,EAAE,aAAa,IAAI;AACzB,MAAI,CAAC,cAAc;AACjB,UAAM,IAAI;AAAA,MACR,UAAU,MAAM,EAAE;AAAA,IACpB;AAAA,EACF;AACA,SAAO,aAAa;AACtB;AAEA,SAAS,aAAa,OAAsB,OAAwB;AAClE,QAAM,aAAa,MAAM,YAAY;AACrC,SAAO,CAAC,MAAM,IAAI,MAAM,aAAa,MAAM,MAAM,MAAM,aAAa,MAAM,QAAQ,EAAE;AAAA,IAClF,CAAC,UAAU,MAAM,YAAY,EAAE,SAAS,UAAU;AAAA,EACpD;AACF;","names":[]}
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ publishSeedConfig,
4
+ seedPayloadForInstallation
5
+ } from "../chunk-2H7UWE2G.js";
6
+ import "../chunk-PMUABBPG.js";
7
+ import {
8
+ BaseCommand,
9
+ EXIT_CODES
10
+ } from "../chunk-YO2LTXB4.js";
11
+ import "../chunk-UMH2YZKG.js";
12
+ import "../chunk-G47TDUK3.js";
13
+ import {
14
+ sharedConfigDestinations
15
+ } from "../chunk-WCAUUBHO.js";
16
+ import "../chunk-XAXJWXI4.js";
17
+ import "../chunk-RWOYPOMR.js";
18
+ import "../chunk-VASLW636.js";
19
+ import "../chunk-IO5YBKHV.js";
20
+ import "../chunk-VZRO7RYT.js";
21
+
22
+ // src/cli/commands/share.ts
23
+ var Share = class _Share extends BaseCommand {
24
+ static summary = "Share this installation as an id anyone can install";
25
+ static description = "Turns the skills, sub-agents and per-agent curation installed here into a configuration the agentsinc.sh store holds, and prints the id it was given. Install it elsewhere with 'init --from <id>', or open it in the editor. The id is the configuration's own hash, so sharing an unchanged installation returns the id it already had.";
26
+ static flags = {};
27
+ static examples = ["<%= config.bin %> <%= command.id %>"];
28
+ /**
29
+ * Read, map, refuse, publish.
30
+ *
31
+ * Everything that can fail locally fails before the POST. The store's free tier allows a
32
+ * thousand writes a day and reads a hundred times that, so a write is the scarce half — and one
33
+ * spent on a configuration that cannot be installed buys a dead link.
34
+ *
35
+ * The first three steps are `seedPayloadForInstallation`, shared with `edit --ui`: the two
36
+ * commands mint the same id from the same directory and differ only in what they do with it.
37
+ */
38
+ async run() {
39
+ await this.parse(_Share);
40
+ const prepared = await seedPayloadForInstallation(process.cwd());
41
+ if (!prepared.ok) {
42
+ this.error(prepared.error, { exit: EXIT_CODES.ERROR });
43
+ }
44
+ this.log(`Sharing ${prepared.skills} skill(s) across ${prepared.agents} sub-agent(s)...`);
45
+ const published = await publishSeedConfig(prepared.payload);
46
+ if (!published.ok) {
47
+ this.error(published.error, { exit: EXIT_CODES.ERROR });
48
+ }
49
+ this.reportShared(published.id);
50
+ }
51
+ /**
52
+ * Both destinations, because an id nobody can act on is not a share and there are exactly two
53
+ * things that read one: this CLI, and the editor the configuration can be reopened in. The
54
+ * lines themselves are `sharedConfigDestinations`, shared with `edit --ui` for the same reason
55
+ * the mint above is.
56
+ */
57
+ reportShared(id) {
58
+ this.logSuccess(`Shared as ${id}`);
59
+ for (const destination of sharedConfigDestinations(id)) {
60
+ this.log(destination);
61
+ }
62
+ }
63
+ };
64
+ export {
65
+ Share as default
66
+ };
67
+ //# sourceMappingURL=share.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/commands/share.ts"],"sourcesContent":["import { BaseCommand } from \"../base-command.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { seedPayloadForInstallation } from \"../lib/seed/installation-payload.js\";\nimport { publishSeedConfig } from \"../lib/seed/publish-seed.js\";\nimport { sharedConfigDestinations } from \"../utils/messages.js\";\n\nexport default class Share extends BaseCommand {\n static summary = \"Share this installation as an id anyone can install\";\n\n static description =\n \"Turns the skills, sub-agents and per-agent curation installed here into a configuration the agentsinc.sh store holds, and prints the id it was given. Install it elsewhere with 'init --from <id>', or open it in the editor. The id is the configuration's own hash, so sharing an unchanged installation returns the id it already had.\";\n\n static flags = {};\n\n static examples = [\"<%= config.bin %> <%= command.id %>\"];\n\n /**\n * Read, map, refuse, publish.\n *\n * Everything that can fail locally fails before the POST. The store's free tier allows a\n * thousand writes a day and reads a hundred times that, so a write is the scarce half — and one\n * spent on a configuration that cannot be installed buys a dead link.\n *\n * The first three steps are `seedPayloadForInstallation`, shared with `edit --ui`: the two\n * commands mint the same id from the same directory and differ only in what they do with it.\n */\n async run(): Promise<void> {\n await this.parse(Share);\n\n const prepared = await seedPayloadForInstallation(process.cwd());\n if (!prepared.ok) {\n this.error(prepared.error, { exit: EXIT_CODES.ERROR });\n }\n\n this.log(`Sharing ${prepared.skills} skill(s) across ${prepared.agents} sub-agent(s)...`);\n\n const published = await publishSeedConfig(prepared.payload);\n if (!published.ok) {\n this.error(published.error, { exit: EXIT_CODES.ERROR });\n }\n\n this.reportShared(published.id);\n }\n\n /**\n * Both destinations, because an id nobody can act on is not a share and there are exactly two\n * things that read one: this CLI, and the editor the configuration can be reopened in. The\n * lines themselves are `sharedConfigDestinations`, shared with `edit --ui` for the same reason\n * the mint above is.\n */\n private reportShared(id: string): void {\n this.logSuccess(`Shared as ${id}`);\n for (const destination of sharedConfigDestinations(id)) {\n this.log(destination);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAMA,IAAqB,QAArB,MAAqB,eAAc,YAAY;AAAA,EAC7C,OAAO,UAAU;AAAA,EAEjB,OAAO,cACL;AAAA,EAEF,OAAO,QAAQ,CAAC;AAAA,EAEhB,OAAO,WAAW,CAAC,qCAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYxD,MAAM,MAAqB;AACzB,UAAM,KAAK,MAAM,MAAK;AAEtB,UAAM,WAAW,MAAM,2BAA2B,QAAQ,IAAI,CAAC;AAC/D,QAAI,CAAC,SAAS,IAAI;AAChB,WAAK,MAAM,SAAS,OAAO,EAAE,MAAM,WAAW,MAAM,CAAC;AAAA,IACvD;AAEA,SAAK,IAAI,WAAW,SAAS,MAAM,oBAAoB,SAAS,MAAM,kBAAkB;AAExF,UAAM,YAAY,MAAM,kBAAkB,SAAS,OAAO;AAC1D,QAAI,CAAC,UAAU,IAAI;AACjB,WAAK,MAAM,UAAU,OAAO,EAAE,MAAM,WAAW,MAAM,CAAC;AAAA,IACxD;AAEA,SAAK,aAAa,UAAU,EAAE;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQQ,aAAa,IAAkB;AACrC,SAAK,WAAW,aAAa,EAAE,EAAE;AACjC,eAAW,eAAe,yBAAyB,EAAE,GAAG;AACtD,WAAK,IAAI,WAAW;AAAA,IACtB;AAAA,EACF;AACF;","names":[]}
@@ -1,26 +1,28 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- Confirm
4
- } from "../chunk-OZXAJNLA.js";
3
+ RemovalPlanConfirm
4
+ } from "../chunk-D2CAV7MG.js";
5
+ import "../chunk-OZXAJNLA.js";
5
6
  import {
6
7
  promptConfirm
7
- } from "../chunk-OJJLYHM3.js";
8
- import "../chunk-XMEIVWAS.js";
9
- import "../chunk-ZU6DAR4S.js";
10
- import "../chunk-UW44KSYL.js";
8
+ } from "../chunk-JCPANDNR.js";
9
+ import "../chunk-WUQ3MTPF.js";
10
+ import "../chunk-5QZAK6J7.js";
11
11
  import {
12
12
  loadAgentDefs
13
- } from "../chunk-PRJD5MMQ.js";
13
+ } from "../chunk-MHRC3KRX.js";
14
+ import "../chunk-F2AMBBIA.js";
14
15
  import {
15
- listAgentMdFiles
16
- } from "../chunk-TUQF577Z.js";
16
+ listAgentMdFiles,
17
+ splitAgentsByProvenance
18
+ } from "../chunk-ZUAZHDKP.js";
17
19
  import "../chunk-JFLVEFFP.js";
18
20
  import {
19
21
  BaseCommand,
20
22
  EXIT_CODES
21
- } from "../chunk-FMYHWKGG.js";
22
- import "../chunk-7VZV4O6B.js";
23
- import "../chunk-K3O3YQYG.js";
23
+ } from "../chunk-YO2LTXB4.js";
24
+ import "../chunk-UMH2YZKG.js";
25
+ import "../chunk-G47TDUK3.js";
24
26
  import {
25
27
  ConfigLoadError,
26
28
  INFO_MESSAGES,
@@ -28,7 +30,6 @@ import {
28
30
  UNINSTALL_PLAN,
29
31
  buildMarketplacePluginRef,
30
32
  claudePluginUninstallBestEffort,
31
- compiledAgentsKept,
32
33
  compiledAgentsRemoval,
33
34
  getProjectPluginsDir,
34
35
  isClaudeCLIAvailable,
@@ -46,8 +47,9 @@ import {
46
47
  registeredProjectsUpdateFailed,
47
48
  registeredProjectsUpdated,
48
49
  resolveInstallPaths,
49
- toClaudePluginScope
50
- } from "../chunk-CBF4ZYV3.js";
50
+ toClaudePluginScope,
51
+ unmarkedAgentsKept
52
+ } from "../chunk-WCAUUBHO.js";
51
53
  import {
52
54
  directoryExists,
53
55
  fileExists,
@@ -55,17 +57,16 @@ import {
55
57
  listDirectories,
56
58
  remove,
57
59
  removeDirIfEmpty
58
- } from "../chunk-4VCWL2IG.js";
59
- import "../chunk-IPJOMAWC.js";
60
+ } from "../chunk-XAXJWXI4.js";
61
+ import "../chunk-RWOYPOMR.js";
60
62
  import "../chunk-VASLW636.js";
61
63
  import {
62
64
  CLAUDE_DIR,
63
65
  CLAUDE_SRC_DIR,
64
- CLI_COLORS,
65
66
  DEFAULT_BRANDING,
66
67
  EJECT_SOURCE,
67
68
  STANDARD_FILES
68
- } from "../chunk-R54KIGN2.js";
69
+ } from "../chunk-IO5YBKHV.js";
69
70
  import "../chunk-VZRO7RYT.js";
70
71
 
71
72
  // src/cli/commands/uninstall.tsx
@@ -73,8 +74,7 @@ import "react";
73
74
  import { partition } from "remeda";
74
75
  import path from "path";
75
76
  import { Flags } from "@oclif/core";
76
- import { Box, Text, useApp } from "ink";
77
- import { jsx, jsxs } from "react/jsx-runtime";
77
+ import { jsx } from "react/jsx-runtime";
78
78
  function buildRemovalPlan(target) {
79
79
  const agents = compiledAgentsEntry(target);
80
80
  return {
@@ -100,8 +100,13 @@ function localSkillsEntry(target) {
100
100
  }
101
101
  function compiledAgentsEntry(target) {
102
102
  if (!target.hasLocalAgents) return [];
103
- if (target.configuredAgents.length === 0) return [];
104
- return [{ kind: "agents", agentsDir: target.agentsDir, agentNames: target.configuredAgents }];
103
+ const agentNames = identifiableAgents(target);
104
+ if (agentNames.length === 0) return [];
105
+ return [{ kind: "agents", agentsDir: target.agentsDir, agentNames }];
106
+ }
107
+ function identifiableAgents(target) {
108
+ if (target.configuredAgents.length > 0) return target.configuredAgents;
109
+ return target.markedAgents;
105
110
  }
106
111
  function configManifestEntry(target) {
107
112
  const fileNames = [
@@ -112,9 +117,10 @@ function configManifestEntry(target) {
112
117
  return [{ kind: "config", claudeSrcDir: target.claudeSrcDir, fileNames }];
113
118
  }
114
119
  function keptStatements(target, agentRemovals) {
115
- if (!target.hasLocalAgents) return [];
116
- if (agentRemovals.length > 0) return [];
117
- return [compiledAgentsKept(target.agentsDir)];
120
+ const removing = new Set(agentRemovals.flatMap((entry) => entry.agentNames));
121
+ const kept = target.unmarkedAgents.filter((name) => !removing.has(name));
122
+ if (kept.length === 0) return [];
123
+ return [unmarkedAgentsKept(target.agentsDir, kept.length)];
118
124
  }
119
125
  function planEntry(plan, kind) {
120
126
  return plan.entries.find(
@@ -164,46 +170,10 @@ function sectionWithItems(label, items) {
164
170
  if (items.length === 0) return [];
165
171
  return [{ label, items }];
166
172
  }
167
- var UninstallConfirm = ({ plan, onConfirm, onCancel }) => {
168
- const { exit } = useApp();
169
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
170
- /* @__PURE__ */ jsx(Text, { bold: true, children: UNINSTALL_PLAN.PREVIEW_HEADING }),
171
- /* @__PURE__ */ jsx(Text, { children: " " }),
172
- planSections(plan.entries).map((section) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
173
- /* @__PURE__ */ jsxs(Text, { color: CLI_COLORS.ERROR, children: [
174
- " ",
175
- section.label
176
- ] }),
177
- section.items.map((item) => /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
178
- " ",
179
- item
180
- ] }, item))
181
- ] }, section.label)),
182
- plan.kept.map((statement) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
183
- /* @__PURE__ */ jsx(Text, { children: " " }),
184
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: statement })
185
- ] }, statement)),
186
- /* @__PURE__ */ jsx(Text, { children: " " }),
187
- /* @__PURE__ */ jsx(
188
- Confirm,
189
- {
190
- message: "Are you sure you want to uninstall?",
191
- onConfirm: () => {
192
- onConfirm();
193
- exit();
194
- },
195
- onCancel: () => {
196
- onCancel();
197
- exit();
198
- },
199
- defaultValue: false
200
- }
201
- )
202
- ] });
203
- };
173
+ var UNINSTALL_CONFIRM_MESSAGE = "Are you sure you want to uninstall?";
204
174
  var Uninstall = class _Uninstall extends BaseCommand {
205
175
  static summary = `Remove ${DEFAULT_BRANDING.NAME} from this project`;
206
- static description = `Uninstall ${DEFAULT_BRANDING.NAME} from this project. Removes CLI-managed skills (matched by source), compiled agents, plugins, and the .claude-src/ config manifest (config.ts + config-types.ts). User-created content is preserved.`;
176
+ static description = `Uninstall ${DEFAULT_BRANDING.NAME} from this project. Removes CLI-managed skills (matched by marketplace), compiled agents, plugins, and the .claude-src/ config manifest (config.ts + config-types.ts). User-created content is preserved.`;
207
177
  static examples = [
208
178
  "<%= config.bin %> <%= command.id %>",
209
179
  "<%= config.bin %> <%= command.id %> --yes"
@@ -268,7 +238,17 @@ var Uninstall = class _Uninstall extends BaseCommand {
268
238
  return true;
269
239
  }
270
240
  async confirmRemoval(plan) {
271
- const outcome = await promptConfirm(({ onConfirm, onCancel }) => /* @__PURE__ */ jsx(UninstallConfirm, { plan, onConfirm, onCancel }));
241
+ const outcome = await promptConfirm(({ onConfirm, onCancel }) => /* @__PURE__ */ jsx(
242
+ RemovalPlanConfirm,
243
+ {
244
+ heading: UNINSTALL_PLAN.PREVIEW_HEADING,
245
+ sections: planSections(plan.entries),
246
+ statements: plan.kept,
247
+ message: UNINSTALL_CONFIRM_MESSAGE,
248
+ onConfirm,
249
+ onCancel
250
+ }
251
+ ));
272
252
  return outcome === "confirmed";
273
253
  }
274
254
  async executeUninstall(plan, target, projectDir) {
@@ -322,7 +302,7 @@ var Uninstall = class _Uninstall extends BaseCommand {
322
302
  skipExtraSources: true,
323
303
  matrixOnly: true
324
304
  }),
325
- loadAgentDefs({ projectDir })
305
+ loadAgentDefs()
326
306
  ]);
327
307
  return { globalConfig, matrix: sourceResult.matrix, agents: agentDefs.agents };
328
308
  } catch (error) {
@@ -368,6 +348,9 @@ var Uninstall = class _Uninstall extends BaseCommand {
368
348
  async removeLocalFiles(plan, target) {
369
349
  await this.removePlannedSkills(planEntry(plan, "skills"));
370
350
  await this.removePlannedAgents(planEntry(plan, "agents"));
351
+ for (const statement of plan.kept) {
352
+ this.log(statement);
353
+ }
371
354
  const cleanup = await cleanupEmptyDirs(target, planEntry(plan, "config"));
372
355
  if (cleanup.claudeSrcDirRemoved) {
373
356
  this.logSuccess(`Removed ${CLAUDE_SRC_DIR}/`);
@@ -430,14 +413,14 @@ function collectConfiguredAgents(config) {
430
413
  }
431
414
  function getCliInstalledPluginKeys(config) {
432
415
  if (!config?.skills) return /* @__PURE__ */ new Set();
433
- const { marketplace } = config;
416
+ const { marketplaceName } = config;
434
417
  return new Set(
435
418
  config.skills.flatMap((skill) => [
436
- // Primary key: skill.id@skill.source
437
- buildMarketplacePluginRef(skill.id, skill.source),
419
+ // Primary key: skill.id@skill.origin
420
+ buildMarketplacePluginRef(skill.id, skill.origin),
438
421
  // Marketplace variant for plugins installed via marketplace where
439
- // skill.source may differ (e.g., "eject" vs the marketplace name)
440
- ...marketplace && skill.source !== marketplace && skill.source !== EJECT_SOURCE ? [buildMarketplacePluginRef(skill.id, marketplace)] : []
422
+ // skill.origin may differ (e.g., "eject" vs the marketplace name)
423
+ ...marketplaceName && skill.origin !== marketplaceName && skill.origin !== EJECT_SOURCE ? [buildMarketplacePluginRef(skill.id, marketplaceName)] : []
441
424
  ])
442
425
  );
443
426
  }
@@ -464,14 +447,16 @@ async function detectUninstallTarget(projectDir, onConfigLoadFailed) {
464
447
  hasClaudeDir,
465
448
  hasClaudeSrcConfig,
466
449
  hasClaudeSrcConfigTypes,
467
- config
450
+ config,
451
+ agentProvenance
468
452
  ] = await Promise.all([
469
453
  directoryExists(skillsDir),
470
454
  directoryExists(agentsDir),
471
455
  directoryExists(claudeDir),
472
456
  fileExists(claudeSrcConfigPath),
473
457
  fileExists(claudeSrcConfigTypesPath),
474
- loadUninstallConfig(projectDir, onConfigLoadFailed)
458
+ loadUninstallConfig(projectDir, onConfigLoadFailed),
459
+ splitAgentsByProvenance(agentsDir)
475
460
  ]);
476
461
  let pluginNames = [];
477
462
  try {
@@ -501,7 +486,9 @@ async function detectUninstallTarget(projectDir, onConfigLoadFailed) {
501
486
  claudeDir,
502
487
  claudeSrcDir,
503
488
  config,
504
- configuredAgents
489
+ configuredAgents,
490
+ markedAgents: agentProvenance.marked,
491
+ unmarkedAgents: agentProvenance.unmarked
505
492
  };
506
493
  }
507
494
  function shouldRemoveSkill(forkedFrom) {