opencastle 1.1.0 → 1.2.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 (276) hide show
  1. package/README.md +23 -6
  2. package/bin/cli.mjs +6 -0
  3. package/dist/cli/adapters/codex.d.ts +19 -6
  4. package/dist/cli/adapters/codex.d.ts.map +1 -1
  5. package/dist/cli/adapters/codex.js +24 -7
  6. package/dist/cli/adapters/codex.js.map +1 -1
  7. package/dist/cli/adapters/single-file-base.d.ts +7 -0
  8. package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
  9. package/dist/cli/adapters/single-file-base.js +59 -22
  10. package/dist/cli/adapters/single-file-base.js.map +1 -1
  11. package/dist/cli/agent-plugin.d.ts +119 -0
  12. package/dist/cli/agent-plugin.d.ts.map +1 -0
  13. package/dist/cli/agent-plugin.js +449 -0
  14. package/dist/cli/agent-plugin.js.map +1 -0
  15. package/dist/cli/agent-plugin.test.d.ts +2 -0
  16. package/dist/cli/agent-plugin.test.d.ts.map +1 -0
  17. package/dist/cli/agent-plugin.test.js +227 -0
  18. package/dist/cli/agent-plugin.test.js.map +1 -0
  19. package/dist/cli/baseline.d.ts.map +1 -1
  20. package/dist/cli/baseline.js +99 -26
  21. package/dist/cli/baseline.js.map +1 -1
  22. package/dist/cli/codex-target.test.d.ts +2 -0
  23. package/dist/cli/codex-target.test.d.ts.map +1 -0
  24. package/dist/cli/codex-target.test.js +154 -0
  25. package/dist/cli/codex-target.test.js.map +1 -0
  26. package/dist/cli/convoy/gates.d.ts +2 -20
  27. package/dist/cli/convoy/gates.d.ts.map +1 -1
  28. package/dist/cli/convoy/gates.js +3 -111
  29. package/dist/cli/convoy/gates.js.map +1 -1
  30. package/dist/cli/copy.d.ts +0 -8
  31. package/dist/cli/copy.d.ts.map +1 -1
  32. package/dist/cli/copy.js +0 -21
  33. package/dist/cli/copy.js.map +1 -1
  34. package/dist/cli/dispatcher.test.js +2 -2
  35. package/dist/cli/dispatcher.test.js.map +1 -1
  36. package/dist/cli/docs-accuracy.test.js +2 -0
  37. package/dist/cli/docs-accuracy.test.js.map +1 -1
  38. package/dist/cli/doctor.d.ts.map +1 -1
  39. package/dist/cli/doctor.js +4 -1
  40. package/dist/cli/doctor.js.map +1 -1
  41. package/dist/cli/init.d.ts.map +1 -1
  42. package/dist/cli/init.js +5 -4
  43. package/dist/cli/init.js.map +1 -1
  44. package/dist/cli/init.test.js +58 -34
  45. package/dist/cli/init.test.js.map +1 -1
  46. package/dist/cli/layers.d.ts +8 -0
  47. package/dist/cli/layers.d.ts.map +1 -1
  48. package/dist/cli/layers.js +130 -13
  49. package/dist/cli/layers.js.map +1 -1
  50. package/dist/cli/layers.test.js +2 -2
  51. package/dist/cli/layers.test.js.map +1 -1
  52. package/dist/cli/legacy-install.test.js +8 -1
  53. package/dist/cli/legacy-install.test.js.map +1 -1
  54. package/dist/cli/lesson-command.test.d.ts +2 -0
  55. package/dist/cli/lesson-command.test.d.ts.map +1 -0
  56. package/dist/cli/lesson-command.test.js +100 -0
  57. package/dist/cli/lesson-command.test.js.map +1 -0
  58. package/dist/cli/lesson.d.ts +0 -9
  59. package/dist/cli/lesson.d.ts.map +1 -1
  60. package/dist/cli/lesson.js +212 -276
  61. package/dist/cli/lesson.js.map +1 -1
  62. package/dist/cli/lessons.d.ts +134 -0
  63. package/dist/cli/lessons.d.ts.map +1 -0
  64. package/dist/cli/lessons.js +493 -0
  65. package/dist/cli/lessons.js.map +1 -0
  66. package/dist/cli/lessons.test.d.ts +2 -0
  67. package/dist/cli/lessons.test.d.ts.map +1 -0
  68. package/dist/cli/lessons.test.js +214 -0
  69. package/dist/cli/lessons.test.js.map +1 -0
  70. package/dist/cli/managed-paths.d.ts.map +1 -1
  71. package/dist/cli/managed-paths.js +2 -0
  72. package/dist/cli/managed-paths.js.map +1 -1
  73. package/dist/cli/mcp-audit.d.ts.map +1 -1
  74. package/dist/cli/mcp-audit.js +7 -3
  75. package/dist/cli/mcp-audit.js.map +1 -1
  76. package/dist/cli/mcp-file.d.ts +37 -0
  77. package/dist/cli/mcp-file.d.ts.map +1 -0
  78. package/dist/cli/mcp-file.js +291 -0
  79. package/dist/cli/mcp-file.js.map +1 -0
  80. package/dist/cli/mcp-file.test.d.ts +2 -0
  81. package/dist/cli/mcp-file.test.d.ts.map +1 -0
  82. package/dist/cli/mcp-file.test.js +121 -0
  83. package/dist/cli/mcp-file.test.js.map +1 -0
  84. package/dist/cli/mcp.d.ts +15 -0
  85. package/dist/cli/mcp.d.ts.map +1 -1
  86. package/dist/cli/mcp.js +123 -56
  87. package/dist/cli/mcp.js.map +1 -1
  88. package/dist/cli/pack-plugins.d.ts +8 -0
  89. package/dist/cli/pack-plugins.d.ts.map +1 -0
  90. package/dist/cli/pack-plugins.js +70 -0
  91. package/dist/cli/pack-plugins.js.map +1 -0
  92. package/dist/cli/plugin-command.test.d.ts +2 -0
  93. package/dist/cli/plugin-command.test.d.ts.map +1 -0
  94. package/dist/cli/plugin-command.test.js +114 -0
  95. package/dist/cli/plugin-command.test.js.map +1 -0
  96. package/dist/cli/plugin.d.ts +30 -0
  97. package/dist/cli/plugin.d.ts.map +1 -0
  98. package/dist/cli/plugin.js +291 -0
  99. package/dist/cli/plugin.js.map +1 -0
  100. package/dist/cli/promote-command.test.d.ts +2 -0
  101. package/dist/cli/promote-command.test.d.ts.map +1 -0
  102. package/dist/cli/promote-command.test.js +151 -0
  103. package/dist/cli/promote-command.test.js.map +1 -0
  104. package/dist/cli/promote.d.ts +12 -0
  105. package/dist/cli/promote.d.ts.map +1 -0
  106. package/dist/cli/promote.js +364 -0
  107. package/dist/cli/promote.js.map +1 -0
  108. package/dist/cli/remove.d.ts.map +1 -1
  109. package/dist/cli/remove.js +23 -4
  110. package/dist/cli/remove.js.map +1 -1
  111. package/dist/cli/secret-scan.d.ts +21 -0
  112. package/dist/cli/secret-scan.d.ts.map +1 -0
  113. package/dist/cli/secret-scan.js +114 -0
  114. package/dist/cli/secret-scan.js.map +1 -0
  115. package/dist/cli/sync-check.d.ts.map +1 -1
  116. package/dist/cli/sync-check.js +13 -3
  117. package/dist/cli/sync-check.js.map +1 -1
  118. package/dist/cli/sync-check.test.js +2 -2
  119. package/dist/cli/sync-check.test.js.map +1 -1
  120. package/dist/cli/team-commands.test.js +2 -2
  121. package/dist/cli/team-commands.test.js.map +1 -1
  122. package/dist/cli/types.d.ts +5 -2
  123. package/dist/cli/types.d.ts.map +1 -1
  124. package/dist/cli/types.js +3 -0
  125. package/dist/cli/types.js.map +1 -1
  126. package/dist/cli/unreadable-report.d.ts +7 -0
  127. package/dist/cli/unreadable-report.d.ts.map +1 -1
  128. package/dist/cli/unreadable-report.js +14 -0
  129. package/dist/cli/unreadable-report.js.map +1 -1
  130. package/dist/cli/update.d.ts.map +1 -1
  131. package/dist/cli/update.js +73 -5
  132. package/dist/cli/update.js.map +1 -1
  133. package/dist/orchestrator/plugins/agent-plugins.test.d.ts +2 -0
  134. package/dist/orchestrator/plugins/agent-plugins.test.d.ts.map +1 -0
  135. package/dist/orchestrator/plugins/agent-plugins.test.js +32 -0
  136. package/dist/orchestrator/plugins/agent-plugins.test.js.map +1 -0
  137. package/package.json +3 -1
  138. package/src/cli/adapters/codex.ts +25 -7
  139. package/src/cli/adapters/single-file-base.ts +69 -26
  140. package/src/cli/agent-plugin.test.ts +267 -0
  141. package/src/cli/agent-plugin.ts +469 -0
  142. package/src/cli/baseline.ts +99 -26
  143. package/src/cli/codex-target.test.ts +178 -0
  144. package/src/cli/convoy/gates.ts +9 -142
  145. package/src/cli/copy.ts +0 -25
  146. package/src/cli/dispatcher.test.ts +2 -2
  147. package/src/cli/docs-accuracy.test.ts +2 -0
  148. package/src/cli/doctor.ts +5 -2
  149. package/src/cli/fixtures/lessons-template-1.0.md +70 -0
  150. package/src/cli/init.test.ts +59 -34
  151. package/src/cli/init.ts +5 -4
  152. package/src/cli/layers.test.ts +2 -2
  153. package/src/cli/layers.ts +144 -14
  154. package/src/cli/legacy-install.test.ts +11 -1
  155. package/src/cli/lesson-command.test.ts +117 -0
  156. package/src/cli/lesson.ts +215 -266
  157. package/src/cli/lessons.test.ts +254 -0
  158. package/src/cli/lessons.ts +540 -0
  159. package/src/cli/managed-paths.ts +2 -0
  160. package/src/cli/mcp-audit.ts +7 -3
  161. package/src/cli/mcp-file.test.ts +138 -0
  162. package/src/cli/mcp-file.ts +302 -0
  163. package/src/cli/mcp.ts +130 -60
  164. package/src/cli/pack-plugins.ts +70 -0
  165. package/src/cli/plugin-command.test.ts +125 -0
  166. package/src/cli/plugin.ts +309 -0
  167. package/src/cli/promote-command.test.ts +170 -0
  168. package/src/cli/promote.ts +371 -0
  169. package/src/cli/remove.ts +20 -4
  170. package/src/cli/secret-scan.ts +154 -0
  171. package/src/cli/sync-check.test.ts +2 -2
  172. package/src/cli/sync-check.ts +13 -3
  173. package/src/cli/team-commands.test.ts +2 -2
  174. package/src/cli/types.ts +5 -2
  175. package/src/cli/unreadable-report.ts +14 -0
  176. package/src/cli/update.ts +81 -5
  177. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  178. package/src/orchestrator/agents/researcher.agent.md +1 -1
  179. package/src/orchestrator/customizations/LESSONS-LEARNED.md +10 -66
  180. package/src/orchestrator/customizations/README.md +2 -1
  181. package/src/orchestrator/customizations/logs/README.md +1 -1
  182. package/src/orchestrator/plugins/agent-plugins.test.ts +34 -0
  183. package/src/orchestrator/plugins/astro/mcp.json +9 -0
  184. package/src/orchestrator/plugins/astro/plugin.json +21 -0
  185. package/src/orchestrator/plugins/chrome-devtools/mcp.json +13 -0
  186. package/src/orchestrator/plugins/chrome-devtools/plugin.json +21 -0
  187. package/src/orchestrator/plugins/cloudflare/mcp.json +9 -0
  188. package/src/orchestrator/plugins/cloudflare/plugin.json +21 -0
  189. package/src/orchestrator/plugins/contentful/mcp.json +13 -0
  190. package/src/orchestrator/plugins/contentful/plugin.json +21 -0
  191. package/src/orchestrator/plugins/convex/mcp.json +15 -0
  192. package/src/orchestrator/plugins/convex/plugin.json +21 -0
  193. package/src/orchestrator/plugins/coolify/mcp.json +13 -0
  194. package/src/orchestrator/plugins/coolify/plugin.json +25 -0
  195. package/src/orchestrator/plugins/cypress/plugin.json +21 -0
  196. package/src/orchestrator/plugins/drizzle/plugin.json +21 -0
  197. package/src/orchestrator/plugins/expo/mcp.json +9 -0
  198. package/src/orchestrator/plugins/expo/plugin.json +21 -0
  199. package/src/orchestrator/plugins/figma/mcp.json +9 -0
  200. package/src/orchestrator/plugins/figma/plugin.json +21 -0
  201. package/src/orchestrator/plugins/hetzner/plugin.json +24 -0
  202. package/src/orchestrator/plugins/jira/mcp.json +9 -0
  203. package/src/orchestrator/plugins/jira/plugin.json +21 -0
  204. package/src/orchestrator/plugins/linear/mcp.json +9 -0
  205. package/src/orchestrator/plugins/linear/plugin.json +21 -0
  206. package/src/orchestrator/plugins/netlify/mcp.json +13 -0
  207. package/src/orchestrator/plugins/netlify/plugin.json +21 -0
  208. package/src/orchestrator/plugins/nextjs/mcp.json +13 -0
  209. package/src/orchestrator/plugins/nextjs/plugin.json +21 -0
  210. package/src/orchestrator/plugins/notion/mcp.json +9 -0
  211. package/src/orchestrator/plugins/notion/plugin.json +21 -0
  212. package/src/orchestrator/plugins/nx/mcp.json +14 -0
  213. package/src/orchestrator/plugins/nx/plugin.json +21 -0
  214. package/src/orchestrator/plugins/playwright/mcp.json +13 -0
  215. package/src/orchestrator/plugins/playwright/plugin.json +21 -0
  216. package/src/orchestrator/plugins/prisma/mcp.json +14 -0
  217. package/src/orchestrator/plugins/prisma/plugin.json +21 -0
  218. package/src/orchestrator/plugins/resend/mcp.json +13 -0
  219. package/src/orchestrator/plugins/resend/plugin.json +24 -0
  220. package/src/orchestrator/plugins/sanity/mcp.json +9 -0
  221. package/src/orchestrator/plugins/sanity/plugin.json +21 -0
  222. package/src/orchestrator/plugins/sentry/mcp.json +12 -0
  223. package/src/orchestrator/plugins/sentry/plugin.json +24 -0
  224. package/src/orchestrator/plugins/slack/mcp.json +13 -0
  225. package/src/orchestrator/plugins/slack/plugin.json +24 -0
  226. package/src/orchestrator/plugins/strapi/mcp.json +13 -0
  227. package/src/orchestrator/plugins/strapi/plugin.json +21 -0
  228. package/src/orchestrator/plugins/stripe/mcp.json +9 -0
  229. package/src/orchestrator/plugins/stripe/plugin.json +21 -0
  230. package/src/orchestrator/plugins/supabase/mcp.json +9 -0
  231. package/src/orchestrator/plugins/supabase/plugin.json +21 -0
  232. package/src/orchestrator/plugins/teams/plugin.json +24 -0
  233. package/src/orchestrator/plugins/trello/mcp.json +13 -0
  234. package/src/orchestrator/plugins/trello/plugin.json +25 -0
  235. package/src/orchestrator/plugins/turborepo/plugin.json +21 -0
  236. package/src/orchestrator/plugins/vercel/mcp.json +9 -0
  237. package/src/orchestrator/plugins/vercel/plugin.json +21 -0
  238. package/src/orchestrator/plugins/vitest/plugin.json +21 -0
  239. package/src/orchestrator/skill-config-links.test.ts +2 -1
  240. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +1 -1
  241. package/src/orchestrator/skills/agent-hooks/SKILL.md +1 -1
  242. package/src/orchestrator/skills/decomposition/SKILL.md +1 -1
  243. package/src/orchestrator/skills/memory-merger/SKILL.md +17 -21
  244. package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +44 -23
  245. package/src/orchestrator/skills/self-improvement/SKILL.md +30 -15
  246. /package/src/orchestrator/plugins/astro/{SKILL.md → skills/astro-framework/SKILL.md} +0 -0
  247. /package/src/orchestrator/plugins/chrome-devtools/{SKILL.md → skills/browser-testing/SKILL.md} +0 -0
  248. /package/src/orchestrator/plugins/cloudflare/{SKILL.md → skills/cloudflare-platform/SKILL.md} +0 -0
  249. /package/src/orchestrator/plugins/contentful/{SKILL.md → skills/contentful-cms/SKILL.md} +0 -0
  250. /package/src/orchestrator/plugins/convex/{SKILL.md → skills/convex-database/SKILL.md} +0 -0
  251. /package/src/orchestrator/plugins/coolify/{SKILL.md → skills/coolify-deployment/SKILL.md} +0 -0
  252. /package/src/orchestrator/plugins/cypress/{SKILL.md → skills/cypress-testing/SKILL.md} +0 -0
  253. /package/src/orchestrator/plugins/drizzle/{SKILL.md → skills/drizzle-orm/SKILL.md} +0 -0
  254. /package/src/orchestrator/plugins/expo/{SKILL.md → skills/expo-development/SKILL.md} +0 -0
  255. /package/src/orchestrator/plugins/figma/{SKILL.md → skills/figma-design/SKILL.md} +0 -0
  256. /package/src/orchestrator/plugins/hetzner/{SKILL.md → skills/hetzner-cloud/SKILL.md} +0 -0
  257. /package/src/orchestrator/plugins/jira/{SKILL.md → skills/jira-management/SKILL.md} +0 -0
  258. /package/src/orchestrator/plugins/linear/{SKILL.md → skills/linear-task-management/SKILL.md} +0 -0
  259. /package/src/orchestrator/plugins/netlify/{SKILL.md → skills/netlify-deployment/SKILL.md} +0 -0
  260. /package/src/orchestrator/plugins/nextjs/{SKILL.md → skills/nextjs-framework/SKILL.md} +0 -0
  261. /package/src/orchestrator/plugins/notion/{SKILL.md → skills/notion-knowledge-management/SKILL.md} +0 -0
  262. /package/src/orchestrator/plugins/nx/{SKILL.md → skills/nx-workspace/SKILL.md} +0 -0
  263. /package/src/orchestrator/plugins/playwright/{SKILL.md → skills/playwright-testing/SKILL.md} +0 -0
  264. /package/src/orchestrator/plugins/prisma/{SKILL.md → skills/prisma-database/SKILL.md} +0 -0
  265. /package/src/orchestrator/plugins/resend/{SKILL.md → skills/resend-email/SKILL.md} +0 -0
  266. /package/src/orchestrator/plugins/sanity/{SKILL.md → skills/sanity-cms/SKILL.md} +0 -0
  267. /package/src/orchestrator/plugins/sentry/{SKILL.md → skills/sentry-monitoring/SKILL.md} +0 -0
  268. /package/src/orchestrator/plugins/slack/{SKILL.md → skills/slack-notifications/SKILL.md} +0 -0
  269. /package/src/orchestrator/plugins/strapi/{SKILL.md → skills/strapi-cms/SKILL.md} +0 -0
  270. /package/src/orchestrator/plugins/stripe/{SKILL.md → skills/stripe-payments/SKILL.md} +0 -0
  271. /package/src/orchestrator/plugins/supabase/{SKILL.md → skills/supabase-database/SKILL.md} +0 -0
  272. /package/src/orchestrator/plugins/teams/{SKILL.md → skills/teams-notifications/SKILL.md} +0 -0
  273. /package/src/orchestrator/plugins/trello/{SKILL.md → skills/trello-task-management/SKILL.md} +0 -0
  274. /package/src/orchestrator/plugins/turborepo/{SKILL.md → skills/turborepo-monorepo/SKILL.md} +0 -0
  275. /package/src/orchestrator/plugins/vercel/{SKILL.md → skills/vercel-deployment/SKILL.md} +0 -0
  276. /package/src/orchestrator/plugins/vitest/{SKILL.md → skills/vitest-testing/SKILL.md} +0 -0
@@ -0,0 +1,114 @@
1
+ /**
2
+ * `opencastle plugin` and an Agent Plugin baseline, through the built CLI.
3
+ */
4
+ import { execFileSync, spawnSync } from 'node:child_process';
5
+ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
6
+ import { tmpdir } from 'node:os';
7
+ import { dirname, join, resolve } from 'node:path';
8
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
9
+ import { mcpSchemaUrl, pluginSchemaUrl } from './agent-plugin.js';
10
+ const pkgRoot = resolve(import.meta.dirname, '..', '..');
11
+ const cli = join(pkgRoot, 'bin', 'cli.mjs');
12
+ const built = existsSync(join(pkgRoot, 'dist', 'cli', 'plugin.js'));
13
+ function write(root, files) {
14
+ for (const [rel, text] of Object.entries(files)) {
15
+ mkdirSync(dirname(join(root, rel)), { recursive: true });
16
+ writeFileSync(join(root, rel), text);
17
+ }
18
+ }
19
+ const readJson = (path) => JSON.parse(readFileSync(path, 'utf8'));
20
+ describe.skipIf(!built)('opencastle plugin', () => {
21
+ let dir;
22
+ const run = (cwd, ...args) => spawnSync('node', [cli, ...args], { cwd, encoding: 'utf8' });
23
+ beforeEach(() => {
24
+ dir = mkdtempSync(join(tmpdir(), 'oc-plugin-cmd-'));
25
+ });
26
+ afterEach(() => rmSync(dir, { recursive: true, force: true }));
27
+ it('a scaffolded baseline is a plugin every assistant loads, Claude Code included', () => {
28
+ expect(run(dir, 'baseline', 'init', 'base', '--name', '@acme/base').status).toBe(0);
29
+ const out = run(dir, 'plugin', 'check', 'base');
30
+ expect(out.status).toBe(0);
31
+ expect(out.stdout).toContain('Loads in GitHub Copilot, VS Code, Cursor, Codex and Kiro as it is, and in Claude Code.');
32
+ expect(readJson(join(dir, 'base', 'plugin.json'))).toMatchObject({ $schema: pluginSchemaUrl(), name: 'acme.base' });
33
+ expect(run(dir, 'baseline', 'check', 'base').status).toBe(0);
34
+ });
35
+ it('build keeps Claude Code’s files in step with the portable ones, and keeps what only Claude Code reads', () => {
36
+ run(dir, 'baseline', 'init', 'base', '--name', '@acme/base');
37
+ const base = join(dir, 'base');
38
+ write(base, {
39
+ 'mcp.json': JSON.stringify({ $schema: mcpSchemaUrl(), mcpServers: { docs: { type: 'streamable-http', url: 'https://docs.acme.example/mcp' } } }),
40
+ // The scaffold's example policy allows four servers; a team adding one allows it.
41
+ 'dev.opencastle/config.json': JSON.stringify({ policy: { mcp: { allow: ['docs'], remoteHosts: ['docs.acme.example'] } } }),
42
+ });
43
+ const claude = join(base, '.claude-plugin', 'plugin.json');
44
+ writeFileSync(claude, JSON.stringify({ ...readJson(claude), userConfig: { region: { type: 'string', title: 'Region', description: 'Where' } } }));
45
+ const stale = run(dir, 'plugin', 'check', 'base');
46
+ expect(stale.status).toBe(1);
47
+ expect(stale.stdout).toContain('.mcp.json does not match plugin.json and mcp.json');
48
+ expect(run(dir, 'plugin', 'build', 'base', '--check').status).toBe(1);
49
+ expect(run(dir, 'plugin', 'build', 'base').status).toBe(0);
50
+ expect(readJson(join(base, '.mcp.json'))).toEqual({ mcpServers: { docs: { type: 'http', url: 'https://docs.acme.example/mcp' } } });
51
+ expect(readJson(claude)).toMatchObject({ name: 'acme.base', version: '0.1.0', userConfig: { region: { title: 'Region' } } });
52
+ expect(run(dir, 'plugin', 'check', 'base').status).toBe(0);
53
+ expect(run(dir, 'baseline', 'check', 'base').status).toBe(0);
54
+ });
55
+ it('index lists every plugin for Claude Code and Copilot, Cursor and Codex', () => {
56
+ const plugin = (name) => ({
57
+ [`plugins/${name}/plugin.json`]: JSON.stringify({ $schema: pluginSchemaUrl(), name, description: `The ${name} plugin` }),
58
+ });
59
+ write(dir, { 'package.json': JSON.stringify({ name: '@acme/agent-plugins', author: 'Acme Platform <p@acme.example>' }), ...plugin('deploy'), ...plugin('review') });
60
+ const out = run(dir, 'plugin', 'index');
61
+ expect(out.status).toBe(0);
62
+ const shared = {
63
+ name: 'acme.agent-plugins',
64
+ owner: { name: 'Acme Platform' },
65
+ metadata: { description: 'Agent Plugins from acme.agent-plugins' },
66
+ plugins: [
67
+ { name: 'deploy', source: './plugins/deploy', description: 'The deploy plugin' },
68
+ { name: 'review', source: './plugins/review', description: 'The review plugin' },
69
+ ],
70
+ };
71
+ expect(readJson(join(dir, '.claude-plugin', 'marketplace.json'))).toEqual(shared);
72
+ expect(readJson(join(dir, '.cursor-plugin', 'marketplace.json'))).toEqual(shared);
73
+ expect(readJson(join(dir, '.agents', 'plugins', 'marketplace.json'))).toMatchObject({
74
+ name: 'acme.agent-plugins',
75
+ plugins: [{ name: 'deploy', source: { source: 'local', path: './plugins/deploy' }, policy: { installation: 'AVAILABLE' } }, { name: 'review' }],
76
+ });
77
+ expect(out.stdout).toContain('Claude Code needs .claude-plugin/plugin.json');
78
+ expect(run(dir, 'plugin', 'index', '--check').status).toBe(0);
79
+ write(dir, plugin('release'));
80
+ const behind = run(dir, 'plugin', 'index', '--check');
81
+ expect(behind.status).toBe(1);
82
+ expect(behind.stderr).toContain('.claude-plugin/marketplace.json does not list the plugins under plugins/');
83
+ });
84
+ it('index refuses two plugins with one name', () => {
85
+ write(dir, {
86
+ 'plugins/a/plugin.json': JSON.stringify({ $schema: pluginSchemaUrl(), name: 'same' }),
87
+ 'plugins/b/plugin.json': JSON.stringify({ $schema: pluginSchemaUrl(), name: 'same' }),
88
+ });
89
+ const out = run(dir, 'plugin', 'index');
90
+ expect(out.status).toBe(1);
91
+ expect(out.stderr).toContain('are both named "same"');
92
+ });
93
+ it('a project extending the plugin gets its skill and server in every assistant', () => {
94
+ run(dir, 'baseline', 'init', 'base', '--name', '@acme/base');
95
+ write(join(dir, 'base'), {
96
+ 'mcp.json': JSON.stringify({ $schema: mcpSchemaUrl(), mcpServers: { docs: { type: 'streamable-http', url: 'https://docs.acme.example/mcp' } } }),
97
+ // The scaffold's example policy allows four servers; a team adding one allows it.
98
+ 'dev.opencastle/config.json': JSON.stringify({ policy: { mcp: { allow: ['docs'], remoteHosts: ['docs.acme.example'] } } }),
99
+ });
100
+ const project = join(dir, 'app');
101
+ write(project, {
102
+ 'CLAUDE.md': '# App\n',
103
+ '.opencastle/config.json': JSON.stringify({ extends: ['../../base'] }),
104
+ });
105
+ execFileSync('git', ['init', '-q'], { cwd: project });
106
+ const init = run(project, 'init', '--yes');
107
+ expect(init.status, init.stdout + init.stderr).toBe(0);
108
+ expect(existsSync(join(project, '.claude', 'skills', 'code-review', 'SKILL.md'))).toBe(true);
109
+ expect(readFileSync(join(project, 'CLAUDE.md'), 'utf8')).toContain('Engineering standards');
110
+ expect(readJson(join(project, '.mcp.json'))).toMatchObject({ mcpServers: { docs: { type: 'http', url: 'https://docs.acme.example/mcp' } } });
111
+ expect(run(project, 'sync', '--check').status).toBe(0);
112
+ });
113
+ });
114
+ //# sourceMappingURL=plugin-command.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-command.test.js","sourceRoot":"","sources":["../../src/cli/plugin-command.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACjG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAA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I,CAAC,IAAI,CAAC,CAAA;QAC5F,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAA;QAC3F,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,+BAA+B,EAAE,EAAE,EAAE,CAAC,CAAA;QAC5I,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACxD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,30 @@
1
+ import { type PluginReport } from './agent-plugin.js';
2
+ import type { CliContext } from './types.js';
3
+ /**
4
+ * What Claude Code's two files should hold, as path → text, or `null` for a
5
+ * file that should not exist.
6
+ *
7
+ * `.claude-plugin/plugin.json` is co-owned: the portable fields are compiled
8
+ * in, and anything only Claude Code reads — `userConfig`, `hooks`, `agents`,
9
+ * inline `mcpServers` — is the author's and kept. `.mcp.json` is compiled
10
+ * whole from `mcp.json` when the plugin has portable servers; a server only
11
+ * Claude Code should start belongs inline in the manifest.
12
+ */
13
+ export declare function claudeFiles(root: string, report: PluginReport): Record<string, string | null>;
14
+ interface Listed {
15
+ dir: string;
16
+ name: string;
17
+ description?: string;
18
+ claude: boolean;
19
+ }
20
+ /** The three marketplace files for the plugins under `plugins/`. */
21
+ export declare function marketplaceFiles(plugins: Listed[], identity: {
22
+ name: string;
23
+ owner: string;
24
+ description: string;
25
+ }): Record<string, string>;
26
+ /** Claude Code's files that exist and no longer match the portable ones. */
27
+ export declare function staleClaudeFiles(root: string, report: PluginReport): string[];
28
+ export default function plugin({ args }: CliContext): Promise<void>;
29
+ export {};
30
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/cli/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAQL,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAqD5C;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAY7F;AAsBD,UAAU,MAAM;IACd,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;CAChB;AAeD,oEAAoE;AACpE,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC7D,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA2BxB;AAqED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,EAAE,CAG7E;AAED,wBAA8B,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAwExE"}
@@ -0,0 +1,291 @@
1
+ import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
2
+ import { basename, dirname, join, relative, resolve } from 'node:path';
3
+ import { AGENT_PLUGINS_VERSION, EXTENSION_NAMESPACE, claudeManifestFor, claudeMcpFor, isAgentPlugin, pluginNameFrom, readAgentPlugin, } from './agent-plugin.js';
4
+ import { c } from './prompt.js';
5
+ /**
6
+ * `opencastle plugin`: check, complete and list Agent Plugins.
7
+ *
8
+ * The standard leaves two things to each client: Claude Code reads its own
9
+ * manifest (`.claude-plugin/plugin.json`) and its own MCP file (`.mcp.json`),
10
+ * and every client indexes a marketplace in its own file. Keeping those by hand
11
+ * is three copies of one fact, which is the drift this tool exists to stop —
12
+ * so they are compiled from the portable files and checked in CI like any
13
+ * other generated output.
14
+ */
15
+ const HELP = `
16
+ opencastle plugin <check|build|index> [dir] [options]
17
+
18
+ Agent Plugins 1.0 is the open package format for skills and MCP servers
19
+ (agent-plugins.org): plugin.json, skills/<name>/SKILL.md and mcp.json.
20
+ GitHub Copilot, VS Code, Cursor, Codex and Kiro install one as it is.
21
+
22
+ check [dir] Check a plugin the way a conformant client loads it: the
23
+ manifest, every skill against the Agent Skills spec, every
24
+ MCP server, and that Claude Code's files match the portable ones.
25
+ build [dir] Write Claude Code's .claude-plugin/plugin.json and .mcp.json
26
+ from plugin.json and mcp.json. Claude Code reads only those.
27
+ index [dir] Write the marketplace files for every plugin under plugins/:
28
+ .claude-plugin/marketplace.json (Claude Code, Copilot CLI),
29
+ .cursor-plugin/marketplace.json (Cursor) and
30
+ .agents/plugins/marketplace.json (Codex).
31
+
32
+ Options:
33
+ --check build and index: change nothing; exit 1 if a file is out of date
34
+ --name <name> index: the marketplace name (default: from package.json or the directory)
35
+ --owner <name> index: who maintains it (default: from package.json)
36
+ --json check: machine-readable output
37
+ --help, -h Show this help
38
+ `;
39
+ function json(value) {
40
+ return JSON.stringify(value, null, 2) + '\n';
41
+ }
42
+ function readJsonFile(path) {
43
+ try {
44
+ const v = JSON.parse(readFileSync(path, 'utf8'));
45
+ return v && typeof v === 'object' && !Array.isArray(v) ? v : null;
46
+ }
47
+ catch {
48
+ return null;
49
+ }
50
+ }
51
+ // ── build ─────────────────────────────────────────────────────
52
+ /**
53
+ * What Claude Code's two files should hold, as path → text, or `null` for a
54
+ * file that should not exist.
55
+ *
56
+ * `.claude-plugin/plugin.json` is co-owned: the portable fields are compiled
57
+ * in, and anything only Claude Code reads — `userConfig`, `hooks`, `agents`,
58
+ * inline `mcpServers` — is the author's and kept. `.mcp.json` is compiled
59
+ * whole from `mcp.json` when the plugin has portable servers; a server only
60
+ * Claude Code should start belongs inline in the manifest.
61
+ */
62
+ export function claudeFiles(root, report) {
63
+ if (!report.manifest)
64
+ return {};
65
+ const manifestPath = join(root, '.claude-plugin', 'plugin.json');
66
+ const existing = readJsonFile(manifestPath) ?? {};
67
+ const generated = claudeManifestFor(report.manifest);
68
+ const portable = ['name', 'version', 'description', 'author', 'homepage', 'repository', 'license', 'keywords'];
69
+ const kept = Object.fromEntries(Object.entries(existing).filter(([k]) => !portable.includes(k)));
70
+ const files = { '.claude-plugin/plugin.json': json({ ...generated, ...kept }) };
71
+ // With no portable servers there is nothing to compile, and a `.mcp.json`
72
+ // already there is one the author wrote for Claude Code alone.
73
+ if (Object.keys(report.servers).length > 0)
74
+ files['.mcp.json'] = json(claudeMcpFor(report.servers));
75
+ return files;
76
+ }
77
+ /** Write (or with `check`, compare) a set of generated files. Returns the ones that differ. */
78
+ function apply(root, files, check) {
79
+ const changed = [];
80
+ for (const [rel, text] of Object.entries(files)) {
81
+ const abs = join(root, rel);
82
+ const current = existsSync(abs) ? readFileSync(abs, 'utf8') : null;
83
+ if (current === text)
84
+ continue;
85
+ changed.push(rel);
86
+ if (check)
87
+ continue;
88
+ if (text === null)
89
+ rmSync(abs, { force: true });
90
+ else {
91
+ mkdirSync(dirname(abs), { recursive: true });
92
+ writeFileSync(abs, text);
93
+ }
94
+ }
95
+ return changed;
96
+ }
97
+ function marketplaceIdentity(root, nameFlag, ownerFlag) {
98
+ const pkg = readJsonFile(join(root, 'package.json')) ?? {};
99
+ const pkgName = typeof pkg.name === 'string' ? pkg.name : undefined;
100
+ const author = pkg.author;
101
+ const authorName = typeof author === 'string' ? author.replace(/\s*[<(].*$/, '') : author && typeof author === 'object' ? author.name : undefined;
102
+ const name = nameFlag ?? pluginNameFrom(pkgName ?? basename(resolve(root)));
103
+ return {
104
+ name,
105
+ owner: ownerFlag ?? authorName ?? name,
106
+ description: typeof pkg.description === 'string' ? pkg.description : `Agent Plugins from ${name}`,
107
+ };
108
+ }
109
+ /** The three marketplace files for the plugins under `plugins/`. */
110
+ export function marketplaceFiles(plugins, identity) {
111
+ const entries = plugins.map((p) => ({
112
+ name: p.name,
113
+ source: `./plugins/${p.dir}`,
114
+ ...(p.description && { description: p.description }),
115
+ }));
116
+ // One shape both read: Cursor's schema is a strict subset of Claude Code's.
117
+ const shared = json({
118
+ name: identity.name,
119
+ owner: { name: identity.owner },
120
+ metadata: { description: identity.description },
121
+ plugins: entries,
122
+ });
123
+ const codex = json({
124
+ name: identity.name,
125
+ interface: { displayName: identity.name },
126
+ plugins: plugins.map((p) => ({
127
+ name: p.name,
128
+ source: { source: 'local', path: `./plugins/${p.dir}` },
129
+ policy: { installation: 'AVAILABLE', authentication: 'ON_INSTALL' },
130
+ })),
131
+ });
132
+ return {
133
+ '.claude-plugin/marketplace.json': shared,
134
+ '.cursor-plugin/marketplace.json': shared,
135
+ '.agents/plugins/marketplace.json': codex,
136
+ };
137
+ }
138
+ function listPlugins(root) {
139
+ const dir = join(root, 'plugins');
140
+ const plugins = [];
141
+ const problems = [];
142
+ if (!existsSync(dir))
143
+ return { plugins, problems: [`${relative(process.cwd(), dir) || 'plugins'}/ does not exist — a marketplace lists plugins/<name>/`] };
144
+ for (const entry of readdirSync(dir).sort()) {
145
+ const at = join(dir, entry);
146
+ if (!existsSync(join(at, 'plugin.json')))
147
+ continue;
148
+ if (!isAgentPlugin(at)) {
149
+ problems.push(`plugins/${entry}: plugin.json does not declare an Agent Plugins version — run opencastle plugin check plugins/${entry}`);
150
+ continue;
151
+ }
152
+ const report = readAgentPlugin(at);
153
+ if (!report.manifest) {
154
+ problems.push(`plugins/${entry}: ${report.errors[0]}`);
155
+ continue;
156
+ }
157
+ plugins.push({
158
+ dir: entry,
159
+ name: report.manifest.name,
160
+ description: report.manifest.description,
161
+ claude: existsSync(join(at, '.claude-plugin', 'plugin.json')),
162
+ });
163
+ }
164
+ const names = new Map();
165
+ for (const p of plugins) {
166
+ const other = names.get(p.name);
167
+ if (other)
168
+ problems.push(`plugins/${p.dir} and plugins/${other} are both named "${p.name}"; a marketplace lists a name once`);
169
+ names.set(p.name, p.dir);
170
+ }
171
+ return { plugins, problems };
172
+ }
173
+ // ── command ───────────────────────────────────────────────────
174
+ function flagValue(args, flag) {
175
+ const at = args.indexOf(flag);
176
+ if (at === -1)
177
+ return undefined;
178
+ const v = args[at + 1];
179
+ if (!v || v.startsWith('--')) {
180
+ console.error(` ${c.red('✗')} ${flag} needs a value`);
181
+ process.exit(1);
182
+ }
183
+ return v;
184
+ }
185
+ function printReport(dir, report, claudeStale) {
186
+ const m = report.manifest;
187
+ console.log(`\n 🏰 ${c.bold('Agent Plugin')} ${m?.name ?? dir}${m?.version ? c.dim(` ${m.version}`) : ''}${report.version ? c.dim(` · Agent Plugins ${report.version}`) : ''}\n`);
188
+ if (m) {
189
+ console.log(` Skills: ${report.skills.length > 0 ? report.skills.join(', ') : c.dim('none')}`);
190
+ console.log(` MCP servers: ${Object.keys(report.servers).length > 0 ? Object.keys(report.servers).join(', ') : c.dim('none')}`);
191
+ if (existsSync(join(report.root, EXTENSION_NAMESPACE))) {
192
+ console.log(` ${EXTENSION_NAMESPACE}/: ${c.dim('OpenCastle content — check it with opencastle baseline check')}`);
193
+ }
194
+ }
195
+ for (const e of report.errors)
196
+ console.log(` ${c.red('✗')} ${e}`);
197
+ for (const s of claudeStale)
198
+ console.log(` ${c.red('✗')} ${s} does not match plugin.json and mcp.json ${c.dim('— run opencastle plugin build')}`);
199
+ for (const w of report.warnings)
200
+ console.log(` ${c.yellow('!')} ${c.dim(w)}`);
201
+ if (report.errors.length === 0 && claudeStale.length === 0) {
202
+ console.log(`\n ${c.green('✓')} Loads in GitHub Copilot, VS Code, Cursor, Codex and Kiro as it is` +
203
+ (existsSync(join(report.root, '.claude-plugin', 'plugin.json')) ? ', and in Claude Code.\n' : `.\n ${c.dim('Run opencastle plugin build to add the files Claude Code reads.')}\n`));
204
+ }
205
+ else {
206
+ console.log(`\n ${c.red(`${report.errors.length + claudeStale.length} problem(s) to fix.`)}\n`);
207
+ }
208
+ }
209
+ /** Claude Code's files that exist and no longer match the portable ones. */
210
+ export function staleClaudeFiles(root, report) {
211
+ if (!existsSync(join(root, '.claude-plugin', 'plugin.json')) && !existsSync(join(root, '.mcp.json')))
212
+ return [];
213
+ return apply(root, claudeFiles(root, report), true);
214
+ }
215
+ export default async function plugin({ args }) {
216
+ const [sub, ...rest] = args;
217
+ if (!sub || args.includes('--help') || args.includes('-h') || !['check', 'build', 'index'].includes(sub)) {
218
+ console.log(HELP);
219
+ if (sub && !['check', 'build', 'index', '--help', '-h'].includes(sub))
220
+ process.exit(1);
221
+ return;
222
+ }
223
+ const valued = new Set(['--name', '--owner']);
224
+ const positional = rest.filter((a, i) => !a.startsWith('--') && !valued.has(rest[i - 1]));
225
+ const dir = positional[0] ?? '.';
226
+ const root = resolve(dir);
227
+ const check = rest.includes('--check');
228
+ if (sub === 'check') {
229
+ const report = readAgentPlugin(root);
230
+ const stale = report.manifest ? staleClaudeFiles(root, report) : [];
231
+ if (rest.includes('--json')) {
232
+ console.log(json({ ...report, root: dir, claudeOutOfDate: stale, spec: AGENT_PLUGINS_VERSION }));
233
+ }
234
+ else {
235
+ printReport(dir, report, stale);
236
+ }
237
+ if (report.errors.length > 0 || stale.length > 0)
238
+ process.exit(1);
239
+ return;
240
+ }
241
+ if (sub === 'build') {
242
+ const report = readAgentPlugin(root);
243
+ if (!report.manifest) {
244
+ for (const e of report.errors)
245
+ console.error(` ${c.red('✗')} ${e}`);
246
+ process.exit(1);
247
+ }
248
+ const changed = apply(root, claudeFiles(root, report), check);
249
+ if (check) {
250
+ if (changed.length > 0) {
251
+ for (const f of changed)
252
+ console.error(` ${c.red('✗')} ${f} does not match plugin.json and mcp.json — run opencastle plugin build`);
253
+ process.exit(1);
254
+ }
255
+ console.log(` ${c.green('✓')} Claude Code's files match plugin.json and mcp.json`);
256
+ return;
257
+ }
258
+ console.log(changed.length > 0 ? ` ${c.green('✓')} Wrote ${changed.join(', ')}` : ` ${c.green('✓')} Claude Code's files were already up to date`);
259
+ return;
260
+ }
261
+ // index
262
+ const { plugins, problems } = listPlugins(root);
263
+ for (const p of problems)
264
+ console.error(` ${c.red('✗')} ${p}`);
265
+ if (problems.length > 0)
266
+ process.exit(1);
267
+ if (plugins.length === 0) {
268
+ console.error(` ${c.red('✗')} no Agent Plugin under ${dir}/plugins/ — each is a directory with a plugin.json`);
269
+ process.exit(1);
270
+ }
271
+ const identity = marketplaceIdentity(root, flagValue(rest, '--name'), flagValue(rest, '--owner'));
272
+ const changed = apply(root, marketplaceFiles(plugins, identity), check);
273
+ const noClaude = plugins.filter((p) => !p.claude);
274
+ if (check) {
275
+ if (changed.length > 0) {
276
+ for (const f of changed)
277
+ console.error(` ${c.red('✗')} ${f} does not list the plugins under plugins/ — run opencastle plugin index`);
278
+ process.exit(1);
279
+ }
280
+ console.log(` ${c.green('✓')} The marketplace files list all ${plugins.length} plugin(s)`);
281
+ return;
282
+ }
283
+ console.log(changed.length > 0
284
+ ? ` ${c.green('✓')} Listed ${plugins.length} plugin(s) in ${changed.join(', ')}`
285
+ : ` ${c.green('✓')} The marketplace files already list all ${plugins.length} plugin(s)`);
286
+ if (noClaude.length > 0) {
287
+ console.log(` ${c.yellow('!')} ${noClaude.map((p) => `plugins/${p.dir}`).join(', ')} ${c.dim('— Claude Code needs .claude-plugin/plugin.json; run opencastle plugin build in each')}`);
288
+ }
289
+ console.log(` ${c.dim(`Add it: claude plugin marketplace add <owner>/<repo>, copilot plugin marketplace add <owner>/<repo>, codex plugin marketplace add <owner>/<repo>; in Cursor, Dashboard → Plugins → Team Marketplaces → Import.`)}`);
290
+ }
291
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3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AE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,qFAAqF,CAAC,EAAE,CAAC,CAAA;IACzL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,gNAAgN,CAAC,EAAE,CAAC,CAAA;AAC7O,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=promote-command.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promote-command.test.d.ts","sourceRoot":"","sources":["../../src/cli/promote-command.test.ts"],"names":[],"mappings":""}