@claude-collective/cli 0.2.0 → 0.6.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 (166) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/README.md +1 -1
  3. package/dist/chunk-367K3JB3.js +84 -0
  4. package/dist/chunk-367K3JB3.js.map +1 -0
  5. package/dist/chunk-6ESUJMM7.js +54 -0
  6. package/dist/chunk-6ESUJMM7.js.map +1 -0
  7. package/dist/chunk-6OY6ZYQF.js +93 -0
  8. package/dist/chunk-6OY6ZYQF.js.map +1 -0
  9. package/dist/chunk-6WEQADPL.js +307 -0
  10. package/dist/chunk-6WEQADPL.js.map +1 -0
  11. package/dist/chunk-AU7XVCLO.js +91 -0
  12. package/dist/chunk-AU7XVCLO.js.map +1 -0
  13. package/dist/chunk-AZP2AA5M.js +425 -0
  14. package/dist/chunk-AZP2AA5M.js.map +1 -0
  15. package/dist/chunk-D4IQAT27.js +114 -0
  16. package/dist/chunk-D4IQAT27.js.map +1 -0
  17. package/dist/chunk-DHET7RCE.js +50 -0
  18. package/dist/chunk-DHET7RCE.js.map +1 -0
  19. package/dist/chunk-DHFFRMF6.js +31 -0
  20. package/dist/chunk-DHFFRMF6.js.map +1 -0
  21. package/dist/chunk-FKU7VSUD.js +453 -0
  22. package/dist/chunk-FKU7VSUD.js.map +1 -0
  23. package/dist/chunk-J2Y4A3LP.js +478 -0
  24. package/dist/chunk-J2Y4A3LP.js.map +1 -0
  25. package/dist/chunk-JMQGWQZU.js +607 -0
  26. package/dist/chunk-JMQGWQZU.js.map +1 -0
  27. package/dist/chunk-JY4RO76L.js +73 -0
  28. package/dist/chunk-JY4RO76L.js.map +1 -0
  29. package/dist/chunk-M7YCPFIX.js +108 -0
  30. package/dist/chunk-M7YCPFIX.js.map +1 -0
  31. package/dist/chunk-MJSFR562.js +57 -0
  32. package/dist/chunk-MJSFR562.js.map +1 -0
  33. package/dist/chunk-MMDXNZPF.js +69 -0
  34. package/dist/chunk-MMDXNZPF.js.map +1 -0
  35. package/dist/chunk-MYAVQ23U.js +356 -0
  36. package/dist/chunk-MYAVQ23U.js.map +1 -0
  37. package/dist/chunk-OSQDDJXX.js +146 -0
  38. package/dist/chunk-OSQDDJXX.js.map +1 -0
  39. package/dist/chunk-QESUUPOE.js +241 -0
  40. package/dist/chunk-QESUUPOE.js.map +1 -0
  41. package/dist/chunk-SJYG4EJZ.js +57 -0
  42. package/dist/chunk-SJYG4EJZ.js.map +1 -0
  43. package/dist/chunk-SYQ7R2JO.js +95 -0
  44. package/dist/chunk-SYQ7R2JO.js.map +1 -0
  45. package/dist/chunk-TD643KB3.js +245 -0
  46. package/dist/chunk-TD643KB3.js.map +1 -0
  47. package/dist/chunk-TFV6Z7F7.js +129 -0
  48. package/dist/chunk-TFV6Z7F7.js.map +1 -0
  49. package/dist/chunk-TGOHJCQ4.js +83 -0
  50. package/dist/chunk-TGOHJCQ4.js.map +1 -0
  51. package/dist/chunk-TOPAIL5W.js +22 -0
  52. package/dist/chunk-TOPAIL5W.js.map +1 -0
  53. package/dist/chunk-U4VYHKPM.js +110 -0
  54. package/dist/chunk-U4VYHKPM.js.map +1 -0
  55. package/dist/chunk-UFWNMW3G.js +392 -0
  56. package/dist/chunk-UFWNMW3G.js.map +1 -0
  57. package/dist/chunk-UNHCZRO4.js +64 -0
  58. package/dist/chunk-UNHCZRO4.js.map +1 -0
  59. package/dist/chunk-URDV4OCP.js +308 -0
  60. package/dist/chunk-URDV4OCP.js.map +1 -0
  61. package/dist/chunk-YI6JVSFO.js +43 -0
  62. package/dist/chunk-YI6JVSFO.js.map +1 -0
  63. package/dist/chunk-YNSNRR5D.js +184 -0
  64. package/dist/chunk-YNSNRR5D.js.map +1 -0
  65. package/dist/chunk-Z6DLWTBY.js +46 -0
  66. package/dist/chunk-Z6DLWTBY.js.map +1 -0
  67. package/dist/chunk-ZDQIUHAM.js +89 -0
  68. package/dist/chunk-ZDQIUHAM.js.map +1 -0
  69. package/dist/chunk-ZSKHDU5P.js +124 -0
  70. package/dist/chunk-ZSKHDU5P.js.map +1 -0
  71. package/dist/cli-v2/defaults/agent-mappings.yaml +185 -0
  72. package/dist/commands/build/marketplace.js +295 -0
  73. package/dist/commands/build/marketplace.js.map +1 -0
  74. package/dist/commands/build/plugins.js +362 -0
  75. package/dist/commands/build/plugins.js.map +1 -0
  76. package/dist/commands/build/stack.js +169 -0
  77. package/dist/commands/build/stack.js.map +1 -0
  78. package/dist/commands/compile.js +461 -0
  79. package/dist/commands/compile.js.map +1 -0
  80. package/dist/commands/config/get.js +60 -0
  81. package/dist/commands/config/get.js.map +1 -0
  82. package/dist/commands/config/index.js +22 -0
  83. package/dist/commands/config/index.js.map +1 -0
  84. package/dist/commands/config/path.js +35 -0
  85. package/dist/commands/config/path.js.map +1 -0
  86. package/dist/commands/config/set-project.js +61 -0
  87. package/dist/commands/config/set-project.js.map +1 -0
  88. package/dist/commands/config/set.js +60 -0
  89. package/dist/commands/config/set.js.map +1 -0
  90. package/dist/commands/config/show.js +13 -0
  91. package/dist/commands/config/show.js.map +1 -0
  92. package/dist/commands/config/unset-project.js +57 -0
  93. package/dist/commands/config/unset-project.js.map +1 -0
  94. package/dist/commands/config/unset.js +56 -0
  95. package/dist/commands/config/unset.js.map +1 -0
  96. package/dist/commands/diff.js +755 -0
  97. package/dist/commands/diff.js.map +1 -0
  98. package/dist/commands/doctor.js +413 -0
  99. package/dist/commands/doctor.js.map +1 -0
  100. package/dist/commands/edit.js +253 -0
  101. package/dist/commands/edit.js.map +1 -0
  102. package/dist/commands/eject.js +208 -0
  103. package/dist/commands/eject.js.map +1 -0
  104. package/dist/commands/info.js +205 -0
  105. package/dist/commands/info.js.map +1 -0
  106. package/dist/commands/init.js +914 -0
  107. package/dist/commands/init.js.map +1 -0
  108. package/dist/commands/list.js +44 -0
  109. package/dist/commands/list.js.map +1 -0
  110. package/dist/commands/new/agent.js +230 -0
  111. package/dist/commands/new/agent.js.map +1 -0
  112. package/dist/commands/new/skill.js +204 -0
  113. package/dist/commands/new/skill.js.map +1 -0
  114. package/dist/commands/outdated.js +242 -0
  115. package/dist/commands/outdated.js.map +1 -0
  116. package/dist/commands/search.js +115 -0
  117. package/dist/commands/search.js.map +1 -0
  118. package/dist/commands/test-imports.js +92 -0
  119. package/dist/commands/test-imports.js.map +1 -0
  120. package/dist/commands/uninstall.js +302 -0
  121. package/dist/commands/uninstall.js.map +1 -0
  122. package/dist/commands/update.js +428 -0
  123. package/dist/commands/update.js.map +1 -0
  124. package/dist/commands/validate.js +375 -0
  125. package/dist/commands/validate.js.map +1 -0
  126. package/dist/commands/version/bump.js +95 -0
  127. package/dist/commands/version/bump.js.map +1 -0
  128. package/dist/commands/version/index.js +70 -0
  129. package/dist/commands/version/index.js.map +1 -0
  130. package/dist/commands/version/set.js +101 -0
  131. package/dist/commands/version/set.js.map +1 -0
  132. package/dist/commands/version/show.js +70 -0
  133. package/dist/commands/version/show.js.map +1 -0
  134. package/dist/components/common/confirm.js +9 -0
  135. package/dist/components/common/confirm.js.map +1 -0
  136. package/dist/components/common/message.js +24 -0
  137. package/dist/components/common/message.js.map +1 -0
  138. package/dist/components/common/spinner.js +14 -0
  139. package/dist/components/common/spinner.js.map +1 -0
  140. package/dist/components/wizard/selection-header.js +11 -0
  141. package/dist/components/wizard/selection-header.js.map +1 -0
  142. package/dist/components/wizard/step-approach.js +11 -0
  143. package/dist/components/wizard/step-approach.js.map +1 -0
  144. package/dist/components/wizard/step-category.js +12 -0
  145. package/dist/components/wizard/step-category.js.map +1 -0
  146. package/dist/components/wizard/step-confirm.js +12 -0
  147. package/dist/components/wizard/step-confirm.js.map +1 -0
  148. package/dist/components/wizard/step-stack.js +11 -0
  149. package/dist/components/wizard/step-stack.js.map +1 -0
  150. package/dist/components/wizard/step-subcategory.js +13 -0
  151. package/dist/components/wizard/step-subcategory.js.map +1 -0
  152. package/dist/components/wizard/wizard.js +19 -0
  153. package/dist/components/wizard/wizard.js.map +1 -0
  154. package/dist/hooks/init.js +41 -0
  155. package/dist/hooks/init.js.map +1 -0
  156. package/dist/index.js +10 -0
  157. package/dist/index.js.map +1 -0
  158. package/dist/magic-string.es-RGXYGAW3.js +1316 -0
  159. package/dist/magic-string.es-RGXYGAW3.js.map +1 -0
  160. package/dist/stores/wizard-store.js +10 -0
  161. package/dist/stores/wizard-store.js.map +1 -0
  162. package/dist/stores/wizard-store.test.js +15991 -0
  163. package/dist/stores/wizard-store.test.js.map +1 -0
  164. package/package.json +44 -25
  165. package/dist/cli/index.js +0 -6314
  166. package/dist/cli/index.js.map +0 -1
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ useWizardStore
4
+ } from "./chunk-6OY6ZYQF.js";
5
+ import {
6
+ init_esm_shims
7
+ } from "./chunk-DHET7RCE.js";
8
+
9
+ // src/cli-v2/components/wizard/step-approach.tsx
10
+ init_esm_shims();
11
+ import { Box, Text } from "ink";
12
+ import { Select } from "@inkjs/ui";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ var EXPERT_MODE_VALUE = "__expert_mode__";
15
+ var INSTALL_MODE_VALUE = "__install_mode__";
16
+ var StepApproach = () => {
17
+ const {
18
+ expertMode,
19
+ installMode,
20
+ toggleExpertMode,
21
+ toggleInstallMode,
22
+ setStep,
23
+ setLastSelectedApproach,
24
+ lastSelectedApproach
25
+ } = useWizardStore();
26
+ const options = [
27
+ {
28
+ value: "stack",
29
+ label: "Use a pre-built template"
30
+ },
31
+ {
32
+ value: "scratch",
33
+ label: "Start from scratch"
34
+ },
35
+ {
36
+ value: EXPERT_MODE_VALUE,
37
+ label: expertMode ? "Expert Mode: ON" : "Expert Mode: OFF"
38
+ },
39
+ {
40
+ value: INSTALL_MODE_VALUE,
41
+ label: installMode === "local" ? "Install Mode: Local" : "Install Mode: Plugin"
42
+ }
43
+ ];
44
+ const handleSelect = (value) => {
45
+ if (value === EXPERT_MODE_VALUE) {
46
+ setLastSelectedApproach(EXPERT_MODE_VALUE);
47
+ toggleExpertMode();
48
+ return;
49
+ }
50
+ if (value === INSTALL_MODE_VALUE) {
51
+ setLastSelectedApproach(INSTALL_MODE_VALUE);
52
+ toggleInstallMode();
53
+ return;
54
+ }
55
+ setLastSelectedApproach(null);
56
+ if (value === "stack") {
57
+ setStep("stack");
58
+ } else if (value === "scratch") {
59
+ setStep("category");
60
+ }
61
+ };
62
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
63
+ /* @__PURE__ */ jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [
64
+ expertMode && /* @__PURE__ */ jsxs(Text, { color: "yellow", children: [
65
+ "Expert Mode is ON ",
66
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: "- conflict checking disabled" })
67
+ ] }),
68
+ /* @__PURE__ */ jsxs(Text, { color: "cyan", children: [
69
+ "Install Mode: ",
70
+ installMode === "plugin" ? "Plugin" : "Local",
71
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: installMode === "plugin" ? " - native Claude plugins" : " - copy to .claude/skills/" })
72
+ ] })
73
+ ] }),
74
+ /* @__PURE__ */ jsx(Text, { children: "How would you like to set up your stack?" }),
75
+ /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(
76
+ Select,
77
+ {
78
+ options,
79
+ defaultValue: lastSelectedApproach || void 0,
80
+ onChange: handleSelect
81
+ }
82
+ ) })
83
+ ] });
84
+ };
85
+
86
+ export {
87
+ StepApproach
88
+ };
89
+ //# sourceMappingURL=chunk-ZDQIUHAM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli-v2/components/wizard/step-approach.tsx"],"sourcesContent":["import React from \"react\";\nimport { Box, Text } from \"ink\";\nimport { Select } from \"@inkjs/ui\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\n\nconst EXPERT_MODE_VALUE = \"__expert_mode__\";\nconst INSTALL_MODE_VALUE = \"__install_mode__\";\n\nexport const StepApproach: React.FC = () => {\n const {\n expertMode,\n installMode,\n toggleExpertMode,\n toggleInstallMode,\n setStep,\n setLastSelectedApproach,\n lastSelectedApproach,\n } = useWizardStore();\n\n // Build options matching the original wizard\n const options = [\n {\n value: \"stack\",\n label: \"Use a pre-built template\",\n },\n {\n value: \"scratch\",\n label: \"Start from scratch\",\n },\n {\n value: EXPERT_MODE_VALUE,\n label: expertMode ? \"Expert Mode: ON\" : \"Expert Mode: OFF\",\n },\n {\n value: INSTALL_MODE_VALUE,\n label:\n installMode === \"local\"\n ? \"Install Mode: Local\"\n : \"Install Mode: Plugin\",\n },\n ];\n\n const handleSelect = (value: string) => {\n // Handle mode toggles - stay on this step\n if (value === EXPERT_MODE_VALUE) {\n setLastSelectedApproach(EXPERT_MODE_VALUE);\n toggleExpertMode();\n return;\n }\n\n if (value === INSTALL_MODE_VALUE) {\n setLastSelectedApproach(INSTALL_MODE_VALUE);\n toggleInstallMode();\n return;\n }\n\n // Clear lastSelectedApproach when moving to a new step\n setLastSelectedApproach(null);\n\n // Navigate to next step\n if (value === \"stack\") {\n setStep(\"stack\");\n } else if (value === \"scratch\") {\n setStep(\"category\");\n }\n };\n\n return (\n <Box flexDirection=\"column\">\n {/* Mode status display */}\n <Box marginBottom={1} flexDirection=\"column\">\n {expertMode && (\n <Text color=\"yellow\">\n Expert Mode is ON <Text dimColor>- conflict checking disabled</Text>\n </Text>\n )}\n <Text color=\"cyan\">\n Install Mode: {installMode === \"plugin\" ? \"Plugin\" : \"Local\"}\n <Text dimColor>\n {installMode === \"plugin\"\n ? \" - native Claude plugins\"\n : \" - copy to .claude/skills/\"}\n </Text>\n </Text>\n </Box>\n\n <Text>How would you like to set up your stack?</Text>\n <Box marginTop={1}>\n <Select\n options={options}\n defaultValue={lastSelectedApproach || undefined}\n onChange={handleSelect}\n />\n </Box>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;AAAA;AACA,SAAS,KAAK,YAAY;AAC1B,SAAS,cAAc;AAsEb,SACoB,KADpB;AAnEV,IAAM,oBAAoB;AAC1B,IA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wBAAwB;AAAA,QACtC,UAAU;AAAA;AAAA,IACZ,GACF;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ isLocalSource
4
+ } from "./chunk-QESUUPOE.js";
5
+ import {
6
+ CACHE_DIR
7
+ } from "./chunk-SJYG4EJZ.js";
8
+ import {
9
+ verbose
10
+ } from "./chunk-TOPAIL5W.js";
11
+ import {
12
+ directoryExists,
13
+ ensureDir
14
+ } from "./chunk-MMDXNZPF.js";
15
+ import {
16
+ init_esm_shims
17
+ } from "./chunk-DHET7RCE.js";
18
+
19
+ // src/cli-v2/lib/source-fetcher.ts
20
+ init_esm_shims();
21
+ import path from "path";
22
+ import { downloadTemplate } from "giget";
23
+ function sanitizeSourceForCache(source) {
24
+ return source.replace(/:/g, "-").replace(/[\/]/g, "-").replace(/--+/g, "-").replace(/^-|-$/g, "");
25
+ }
26
+ function getCacheDir(source) {
27
+ const sanitized = sanitizeSourceForCache(source);
28
+ return path.join(CACHE_DIR, "sources", sanitized);
29
+ }
30
+ async function fetchFromSource(source, options = {}) {
31
+ const { forceRefresh = false, subdir } = options;
32
+ if (isLocalSource(source)) {
33
+ return fetchFromLocalSource(source, subdir);
34
+ }
35
+ return fetchFromRemoteSource(source, { forceRefresh, subdir });
36
+ }
37
+ async function fetchFromLocalSource(source, subdir) {
38
+ const fullPath = subdir ? path.join(source, subdir) : source;
39
+ const absolutePath = path.isAbsolute(fullPath) ? fullPath : path.resolve(process.cwd(), fullPath);
40
+ if (!await directoryExists(absolutePath)) {
41
+ throw new Error(`Local source not found: ${absolutePath}`);
42
+ }
43
+ verbose(`Using local source: ${absolutePath}`);
44
+ return {
45
+ path: absolutePath,
46
+ fromCache: false,
47
+ source
48
+ };
49
+ }
50
+ async function fetchFromRemoteSource(source, options) {
51
+ const { forceRefresh = false, subdir } = options;
52
+ const cacheDir = getCacheDir(source);
53
+ const fullSource = subdir ? `${source}/${subdir}` : source;
54
+ verbose(`Fetching from remote: ${fullSource}`);
55
+ verbose(`Cache directory: ${cacheDir}`);
56
+ await ensureDir(path.dirname(cacheDir));
57
+ try {
58
+ const result = await downloadTemplate(fullSource, {
59
+ dir: cacheDir,
60
+ force: forceRefresh,
61
+ offline: false,
62
+ preferOffline: !forceRefresh
63
+ });
64
+ verbose(`Downloaded to: ${result.dir}`);
65
+ return {
66
+ path: result.dir,
67
+ fromCache: false,
68
+ source: fullSource
69
+ };
70
+ } catch (error) {
71
+ throw wrapGigetError(error, source);
72
+ }
73
+ }
74
+ function wrapGigetError(error, source) {
75
+ const message = error instanceof Error ? error.message : String(error);
76
+ if (message.includes("404") || message.includes("Not Found")) {
77
+ return new Error(
78
+ `Repository not found: ${source}
79
+
80
+ This could mean:
81
+ - The repository doesn't exist
82
+ - The repository is private and you need to set authentication
83
+ - There's a typo in the URL
84
+
85
+ For private repositories, set the GIGET_AUTH environment variable:
86
+ export GIGET_AUTH=ghp_your_github_token`
87
+ );
88
+ }
89
+ if (message.includes("401") || message.includes("Unauthorized")) {
90
+ return new Error(
91
+ `Authentication required for: ${source}
92
+
93
+ Set the GIGET_AUTH environment variable with a GitHub token:
94
+ export GIGET_AUTH=ghp_your_github_token
95
+
96
+ Create a token at: https://github.com/settings/tokens
97
+ Required scope: repo (for private repos) or public_repo (for public)`
98
+ );
99
+ }
100
+ if (message.includes("403") || message.includes("Forbidden")) {
101
+ return new Error(
102
+ `Access denied to: ${source}
103
+
104
+ Your token may not have sufficient permissions.
105
+ Ensure your GIGET_AUTH token has the 'repo' scope for private repositories.`
106
+ );
107
+ }
108
+ if (message.includes("ENOTFOUND") || message.includes("ETIMEDOUT") || message.includes("network")) {
109
+ return new Error(
110
+ `Network error fetching: ${source}
111
+
112
+ Please check your internet connection.
113
+ If you're behind a corporate proxy, you may need to set:
114
+ export HTTPS_PROXY=http://your-proxy:port
115
+ export FORCE_NODE_FETCH=true # Required for Node 20+`
116
+ );
117
+ }
118
+ return new Error(`Failed to fetch ${source}: ${message}`);
119
+ }
120
+
121
+ export {
122
+ fetchFromSource
123
+ };
124
+ //# sourceMappingURL=chunk-ZSKHDU5P.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli-v2/lib/source-fetcher.ts"],"sourcesContent":["import path from \"path\";\nimport { downloadTemplate } from \"giget\";\nimport { verbose } from \"../utils/logger\";\nimport { CACHE_DIR } from \"../consts\";\nimport { ensureDir, directoryExists, readFile } from \"../utils/fs\";\nimport { isLocalSource } from \"./config\";\nimport type { Marketplace, MarketplaceFetchResult } from \"../../types\";\n\nexport interface FetchOptions {\n forceRefresh?: boolean;\n subdir?: string;\n}\n\nexport interface FetchResult {\n path: string;\n fromCache: boolean;\n source: string;\n}\n\nexport function sanitizeSourceForCache(source: string): string {\n return source\n .replace(/:/g, \"-\")\n .replace(/[\\/]/g, \"-\")\n .replace(/--+/g, \"-\")\n .replace(/^-|-$/g, \"\");\n}\n\nfunction getCacheDir(source: string): string {\n const sanitized = sanitizeSourceForCache(source);\n return path.join(CACHE_DIR, \"sources\", sanitized);\n}\n\nexport async function fetchFromSource(\n source: string,\n options: FetchOptions = {},\n): Promise<FetchResult> {\n const { forceRefresh = false, subdir } = options;\n\n if (isLocalSource(source)) {\n return fetchFromLocalSource(source, subdir);\n }\n\n return fetchFromRemoteSource(source, { forceRefresh, subdir });\n}\n\nasync function fetchFromLocalSource(\n source: string,\n subdir?: string,\n): Promise<FetchResult> {\n const fullPath = subdir ? path.join(source, subdir) : source;\n const absolutePath = path.isAbsolute(fullPath)\n ? fullPath\n : path.resolve(process.cwd(), fullPath);\n\n if (!(await directoryExists(absolutePath))) {\n throw new Error(`Local source not found: ${absolutePath}`);\n }\n\n verbose(`Using local source: ${absolutePath}`);\n\n return {\n path: absolutePath,\n fromCache: false,\n source,\n };\n}\n\nasync function fetchFromRemoteSource(\n source: string,\n options: FetchOptions,\n): Promise<FetchResult> {\n const { forceRefresh = false, subdir } = options;\n const cacheDir = getCacheDir(source);\n\n const fullSource = subdir ? `${source}/${subdir}` : source;\n\n verbose(`Fetching from remote: ${fullSource}`);\n verbose(`Cache directory: ${cacheDir}`);\n\n await ensureDir(path.dirname(cacheDir));\n\n try {\n const result = await downloadTemplate(fullSource, {\n dir: cacheDir,\n force: forceRefresh,\n offline: false,\n preferOffline: !forceRefresh,\n });\n\n verbose(`Downloaded to: ${result.dir}`);\n\n return {\n path: result.dir,\n fromCache: false,\n source: fullSource,\n };\n } catch (error) {\n throw wrapGigetError(error, source);\n }\n}\n\nfunction wrapGigetError(error: unknown, source: string): Error {\n const message = error instanceof Error ? error.message : String(error);\n\n if (message.includes(\"404\") || message.includes(\"Not Found\")) {\n return new Error(\n `Repository not found: ${source}\\n\\n` +\n `This could mean:\\n` +\n ` - The repository doesn't exist\\n` +\n ` - The repository is private and you need to set authentication\\n` +\n ` - There's a typo in the URL\\n\\n` +\n `For private repositories, set the GIGET_AUTH environment variable:\\n` +\n ` export GIGET_AUTH=ghp_your_github_token`,\n );\n }\n\n if (message.includes(\"401\") || message.includes(\"Unauthorized\")) {\n return new Error(\n `Authentication required for: ${source}\\n\\n` +\n `Set the GIGET_AUTH environment variable with a GitHub token:\\n` +\n ` export GIGET_AUTH=ghp_your_github_token\\n\\n` +\n `Create a token at: https://github.com/settings/tokens\\n` +\n `Required scope: repo (for private repos) or public_repo (for public)`,\n );\n }\n\n if (message.includes(\"403\") || message.includes(\"Forbidden\")) {\n return new Error(\n `Access denied to: ${source}\\n\\n` +\n `Your token may not have sufficient permissions.\\n` +\n `Ensure your GIGET_AUTH token has the 'repo' scope for private repositories.`,\n );\n }\n\n if (\n message.includes(\"ENOTFOUND\") ||\n message.includes(\"ETIMEDOUT\") ||\n message.includes(\"network\")\n ) {\n return new Error(\n `Network error fetching: ${source}\\n\\n` +\n `Please check your internet connection.\\n` +\n `If you're behind a corporate proxy, you may need to set:\\n` +\n ` export HTTPS_PROXY=http://your-proxy:port\\n` +\n ` export FORCE_NODE_FETCH=true # Required for Node 20+`,\n );\n }\n\n return new Error(`Failed to fetch ${source}: ${message}`);\n}\n\nexport async function fetchMarketplace(\n source: string,\n options: FetchOptions = {},\n): Promise<MarketplaceFetchResult> {\n const result = await fetchFromSource(source, {\n forceRefresh: options.forceRefresh,\n subdir: \"\", // Root of repo\n });\n\n const marketplacePath = path.join(\n result.path,\n \".claude-plugin\",\n \"marketplace.json\",\n );\n\n if (!(await directoryExists(path.dirname(marketplacePath)))) {\n throw new Error(\n `Marketplace not found at: ${marketplacePath}\\n\\n` +\n `Expected .claude-plugin/marketplace.json in the source repository.`,\n );\n }\n\n const content = await readFile(marketplacePath);\n const marketplace = JSON.parse(content) as Marketplace;\n\n verbose(`Loaded marketplace: ${marketplace.name} v${marketplace.version}`);\n\n return {\n marketplace,\n sourcePath: result.path,\n fromCache: result.fromCache ?? false,\n cacheKey: sanitizeSourceForCache(source),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,UAAU;AACjB,SAAS,wBAAwB;AAkB1B,SAAS,uBAAuB,QAAwB;AAC7D,SAAO,OACJ,QAAQ,MAAM,GAAG,EACjB,QAAQ,SAAS,GAAG,EACpB,QAAQ,QAAQ,GAAG,EACnB,QAAQ,UAAU,EAAE;AACzB;AAEA,SAAS,YAAY,QAAwB;AAC3C,QAAM,YAAY,uBAAuB,MAAM;AAC/C,SAAO,KAAK,KAAK,WAAW,WAAW,SAAS;AAClD;AAEA,eAAsB,gBACpB,QACA,UAAwB,CAAC,GACH;AACtB,QAAM,EAAE,eAAe,OAAO,OAAO,IAAI;AAEzC,MAAI,cAAc,MAAM,GAAG;AACzB,WAAO,qBAAqB,QAAQ,MAAM;AAAA,EAC5C;AAEA,SAAO,sBAAsB,QAAQ,EAAE,cAAc,OAAO,CAAC;AAC/D;AAEA,eAAe,qBACb,QACA,QACsB;AACtB,QAAM,WAAW,SAAS,KAAK,KAAK,QAAQ,MAAM,IAAI;AACtD,QAAM,eAAe,KAAK,WAAW,QAAQ,IACzC,WACA,KAAK,QAAQ,QA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AA;AAAA;AAAA;AAAA;AAAA,IAKxC;AAAA,EACF;AAEA,MAAI,QAAQ,SAAS,KAAK,KAAK,QAAQ,SAAS,WAAW,GAAG;AAC5D,WAAO,IAAI;AAAA,MACT,qBAAqB,MAAM;AAAA;AAAA;AAAA;AAAA,IAG7B;AAAA,EACF;AAEA,MACE,QAAQ,SAAS,WAAW,KAC5B,QAAQ,SAAS,WAAW,KAC5B,QAAQ,SAAS,SAAS,GAC1B;AACA,WAAO,IAAI;AAAA,MACT,2BAA2B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKnC;AAAA,EACF;AAEA,SAAO,IAAI,MAAM,mBAAmB,MAAM,KAAK,OAAO,EAAE;AAC1D;","names":[]}
@@ -0,0 +1,185 @@
1
+ # Default agent-skill mappings for Claude Collective CLI
2
+ # Users can override these in .claude/config.yaml via agent_skills
3
+ #
4
+ # This file is bundled with the CLI and provides sensible defaults
5
+ # for which agents should receive which skills based on skill category.
6
+
7
+ # Mapping from skill path patterns to agent lists
8
+ # Pattern "frontend/*" matches skills like frontend/framework/react, frontend/styling/tailwind, etc.
9
+ skill_to_agents:
10
+ "frontend/*":
11
+ - web-developer
12
+ - web-reviewer
13
+ - web-researcher
14
+ - web-pm
15
+ - web-pattern-scout
16
+ - web-pattern-critique
17
+ - agent-summoner
18
+ - skill-summoner
19
+ - documentor
20
+
21
+ "backend/*":
22
+ - api-developer
23
+ - api-reviewer
24
+ - api-researcher
25
+ - web-architecture
26
+ - web-pm
27
+ - web-pattern-scout
28
+ - web-pattern-critique
29
+ - agent-summoner
30
+ - skill-summoner
31
+ - documentor
32
+
33
+ "mobile/*":
34
+ - web-developer
35
+ - web-reviewer
36
+ - web-researcher
37
+ - web-pm
38
+ - agent-summoner
39
+ - skill-summoner
40
+ - documentor
41
+
42
+ "setup/*":
43
+ - web-architecture
44
+ - web-developer
45
+ - api-developer
46
+ - agent-summoner
47
+ - skill-summoner
48
+ - documentor
49
+
50
+ "security/*":
51
+ - web-developer
52
+ - api-developer
53
+ - web-reviewer
54
+ - api-reviewer
55
+ - web-architecture
56
+ - web-pm
57
+ - agent-summoner
58
+ - skill-summoner
59
+ - documentor
60
+
61
+ "reviewing/*":
62
+ - web-reviewer
63
+ - api-reviewer
64
+ - cli-reviewer
65
+ - web-pattern-critique
66
+ - agent-summoner
67
+ - skill-summoner
68
+ - documentor
69
+
70
+ "cli/*":
71
+ - cli-developer
72
+ - cli-reviewer
73
+ - api-developer
74
+ - api-reviewer
75
+ - api-researcher
76
+ - web-architecture
77
+ - web-pm
78
+ - agent-summoner
79
+ - skill-summoner
80
+ - documentor
81
+
82
+ "research/*":
83
+ - web-researcher
84
+ - api-researcher
85
+ - web-pm
86
+ - web-pattern-scout
87
+ - web-pattern-critique
88
+ - documentor
89
+ - agent-summoner
90
+ - skill-summoner
91
+
92
+ "methodology/*":
93
+ - web-developer
94
+ - api-developer
95
+ - web-reviewer
96
+ - api-reviewer
97
+ - web-researcher
98
+ - api-researcher
99
+ - web-tester
100
+ - web-pm
101
+ - web-architecture
102
+ - web-pattern-scout
103
+ - web-pattern-critique
104
+ - agent-summoner
105
+ - skill-summoner
106
+ - documentor
107
+
108
+ # Specific patterns (more specific than wildcards)
109
+ "frontend/testing":
110
+ - web-tester
111
+ - web-developer
112
+ - web-reviewer
113
+
114
+ "backend/testing":
115
+ - web-tester
116
+ - api-developer
117
+ - api-reviewer
118
+
119
+ "frontend/mocks":
120
+ - web-tester
121
+ - web-developer
122
+ - web-reviewer
123
+
124
+ # Skills that should be preloaded (embedded) for each agent
125
+ # Maps agent name to categories/patterns that trigger preloading
126
+ preloaded_skills:
127
+ web-developer:
128
+ - framework
129
+ - styling
130
+ api-developer:
131
+ - api
132
+ - database
133
+ - cli
134
+ cli-developer:
135
+ - cli
136
+ web-reviewer:
137
+ - framework
138
+ - styling
139
+ - reviewing
140
+ api-reviewer:
141
+ - api
142
+ - database
143
+ - reviewing
144
+ cli-reviewer:
145
+ - cli
146
+ - reviewing
147
+ - cli-reviewing
148
+ web-researcher:
149
+ - framework
150
+ - research-methodology
151
+ api-researcher:
152
+ - api
153
+ - research-methodology
154
+ web-tester:
155
+ - testing
156
+ - mocks
157
+ web-architecture:
158
+ - monorepo
159
+ - turborepo
160
+ - cli
161
+ web-pm:
162
+ - research-methodology
163
+ web-pattern-scout:
164
+ - research-methodology
165
+ web-pattern-critique:
166
+ - research-methodology
167
+ - reviewing
168
+ documentor:
169
+ - research-methodology
170
+ agent-summoner: []
171
+ skill-summoner: []
172
+
173
+ # Aliases for subcategory resolution
174
+ # Maps short names to full paths for convenience
175
+ subcategory_aliases:
176
+ framework: frontend/framework
177
+ styling: frontend/styling
178
+ api: backend/api
179
+ database: backend/database
180
+ mocks: frontend/mocks
181
+ testing: testing
182
+ reviewing: reviewing
183
+ research-methodology: research/research-methodology
184
+ monorepo: setup/monorepo
185
+ cli: cli