opencastle 1.1.1 → 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.
- package/README.md +22 -5
- package/bin/cli.mjs +6 -0
- package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
- package/dist/cli/adapters/single-file-base.js +24 -2
- package/dist/cli/adapters/single-file-base.js.map +1 -1
- package/dist/cli/agent-plugin.d.ts +119 -0
- package/dist/cli/agent-plugin.d.ts.map +1 -0
- package/dist/cli/agent-plugin.js +449 -0
- package/dist/cli/agent-plugin.js.map +1 -0
- package/dist/cli/agent-plugin.test.d.ts +2 -0
- package/dist/cli/agent-plugin.test.d.ts.map +1 -0
- package/dist/cli/agent-plugin.test.js +227 -0
- package/dist/cli/agent-plugin.test.js.map +1 -0
- package/dist/cli/baseline.d.ts.map +1 -1
- package/dist/cli/baseline.js +99 -26
- package/dist/cli/baseline.js.map +1 -1
- package/dist/cli/convoy/gates.d.ts +2 -20
- package/dist/cli/convoy/gates.d.ts.map +1 -1
- package/dist/cli/convoy/gates.js +3 -111
- package/dist/cli/convoy/gates.js.map +1 -1
- package/dist/cli/copy.d.ts +0 -8
- package/dist/cli/copy.d.ts.map +1 -1
- package/dist/cli/copy.js +0 -21
- package/dist/cli/copy.js.map +1 -1
- package/dist/cli/dispatcher.test.js +2 -2
- package/dist/cli/dispatcher.test.js.map +1 -1
- package/dist/cli/docs-accuracy.test.js +2 -0
- package/dist/cli/docs-accuracy.test.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +2 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/init.test.js +36 -24
- package/dist/cli/init.test.js.map +1 -1
- package/dist/cli/layers.d.ts +8 -0
- package/dist/cli/layers.d.ts.map +1 -1
- package/dist/cli/layers.js +130 -13
- package/dist/cli/layers.js.map +1 -1
- package/dist/cli/layers.test.js +2 -2
- package/dist/cli/layers.test.js.map +1 -1
- package/dist/cli/legacy-install.test.js +8 -1
- package/dist/cli/legacy-install.test.js.map +1 -1
- package/dist/cli/lesson-command.test.d.ts +2 -0
- package/dist/cli/lesson-command.test.d.ts.map +1 -0
- package/dist/cli/lesson-command.test.js +100 -0
- package/dist/cli/lesson-command.test.js.map +1 -0
- package/dist/cli/lesson.d.ts +0 -9
- package/dist/cli/lesson.d.ts.map +1 -1
- package/dist/cli/lesson.js +212 -276
- package/dist/cli/lesson.js.map +1 -1
- package/dist/cli/lessons.d.ts +134 -0
- package/dist/cli/lessons.d.ts.map +1 -0
- package/dist/cli/lessons.js +493 -0
- package/dist/cli/lessons.js.map +1 -0
- package/dist/cli/lessons.test.d.ts +2 -0
- package/dist/cli/lessons.test.d.ts.map +1 -0
- package/dist/cli/lessons.test.js +214 -0
- package/dist/cli/lessons.test.js.map +1 -0
- package/dist/cli/pack-plugins.d.ts +8 -0
- package/dist/cli/pack-plugins.d.ts.map +1 -0
- package/dist/cli/pack-plugins.js +70 -0
- package/dist/cli/pack-plugins.js.map +1 -0
- package/dist/cli/plugin-command.test.d.ts +2 -0
- package/dist/cli/plugin-command.test.d.ts.map +1 -0
- package/dist/cli/plugin-command.test.js +114 -0
- package/dist/cli/plugin-command.test.js.map +1 -0
- package/dist/cli/plugin.d.ts +30 -0
- package/dist/cli/plugin.d.ts.map +1 -0
- package/dist/cli/plugin.js +291 -0
- package/dist/cli/plugin.js.map +1 -0
- package/dist/cli/promote-command.test.d.ts +2 -0
- package/dist/cli/promote-command.test.d.ts.map +1 -0
- package/dist/cli/promote-command.test.js +151 -0
- package/dist/cli/promote-command.test.js.map +1 -0
- package/dist/cli/promote.d.ts +12 -0
- package/dist/cli/promote.d.ts.map +1 -0
- package/dist/cli/promote.js +364 -0
- package/dist/cli/promote.js.map +1 -0
- package/dist/cli/secret-scan.d.ts +21 -0
- package/dist/cli/secret-scan.d.ts.map +1 -0
- package/dist/cli/secret-scan.js +114 -0
- package/dist/cli/secret-scan.js.map +1 -0
- package/dist/cli/sync-check.d.ts.map +1 -1
- package/dist/cli/sync-check.js +9 -0
- package/dist/cli/sync-check.js.map +1 -1
- package/dist/cli/team-commands.test.js +2 -2
- package/dist/cli/team-commands.test.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +18 -0
- package/dist/cli/update.js.map +1 -1
- package/dist/orchestrator/plugins/agent-plugins.test.d.ts +2 -0
- package/dist/orchestrator/plugins/agent-plugins.test.d.ts.map +1 -0
- package/dist/orchestrator/plugins/agent-plugins.test.js +32 -0
- package/dist/orchestrator/plugins/agent-plugins.test.js.map +1 -0
- package/package.json +2 -1
- package/src/cli/adapters/single-file-base.ts +23 -2
- package/src/cli/agent-plugin.test.ts +267 -0
- package/src/cli/agent-plugin.ts +469 -0
- package/src/cli/baseline.ts +99 -26
- package/src/cli/convoy/gates.ts +9 -142
- package/src/cli/copy.ts +0 -25
- package/src/cli/dispatcher.test.ts +2 -2
- package/src/cli/docs-accuracy.test.ts +2 -0
- package/src/cli/doctor.ts +2 -0
- package/src/cli/fixtures/lessons-template-1.0.md +70 -0
- package/src/cli/init.test.ts +37 -24
- package/src/cli/layers.test.ts +2 -2
- package/src/cli/layers.ts +144 -14
- package/src/cli/legacy-install.test.ts +11 -1
- package/src/cli/lesson-command.test.ts +117 -0
- package/src/cli/lesson.ts +215 -266
- package/src/cli/lessons.test.ts +254 -0
- package/src/cli/lessons.ts +540 -0
- package/src/cli/pack-plugins.ts +70 -0
- package/src/cli/plugin-command.test.ts +125 -0
- package/src/cli/plugin.ts +309 -0
- package/src/cli/promote-command.test.ts +170 -0
- package/src/cli/promote.ts +371 -0
- package/src/cli/secret-scan.ts +154 -0
- package/src/cli/sync-check.ts +9 -0
- package/src/cli/team-commands.test.ts +2 -2
- package/src/cli/update.ts +20 -0
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/orchestrator/agents/researcher.agent.md +1 -1
- package/src/orchestrator/customizations/LESSONS-LEARNED.md +10 -66
- package/src/orchestrator/customizations/README.md +2 -1
- package/src/orchestrator/customizations/logs/README.md +1 -1
- package/src/orchestrator/plugins/agent-plugins.test.ts +34 -0
- package/src/orchestrator/plugins/astro/mcp.json +9 -0
- package/src/orchestrator/plugins/astro/plugin.json +21 -0
- package/src/orchestrator/plugins/chrome-devtools/mcp.json +13 -0
- package/src/orchestrator/plugins/chrome-devtools/plugin.json +21 -0
- package/src/orchestrator/plugins/cloudflare/mcp.json +9 -0
- package/src/orchestrator/plugins/cloudflare/plugin.json +21 -0
- package/src/orchestrator/plugins/contentful/mcp.json +13 -0
- package/src/orchestrator/plugins/contentful/plugin.json +21 -0
- package/src/orchestrator/plugins/convex/mcp.json +15 -0
- package/src/orchestrator/plugins/convex/plugin.json +21 -0
- package/src/orchestrator/plugins/coolify/mcp.json +13 -0
- package/src/orchestrator/plugins/coolify/plugin.json +25 -0
- package/src/orchestrator/plugins/cypress/plugin.json +21 -0
- package/src/orchestrator/plugins/drizzle/plugin.json +21 -0
- package/src/orchestrator/plugins/expo/mcp.json +9 -0
- package/src/orchestrator/plugins/expo/plugin.json +21 -0
- package/src/orchestrator/plugins/figma/mcp.json +9 -0
- package/src/orchestrator/plugins/figma/plugin.json +21 -0
- package/src/orchestrator/plugins/hetzner/plugin.json +24 -0
- package/src/orchestrator/plugins/jira/mcp.json +9 -0
- package/src/orchestrator/plugins/jira/plugin.json +21 -0
- package/src/orchestrator/plugins/linear/mcp.json +9 -0
- package/src/orchestrator/plugins/linear/plugin.json +21 -0
- package/src/orchestrator/plugins/netlify/mcp.json +13 -0
- package/src/orchestrator/plugins/netlify/plugin.json +21 -0
- package/src/orchestrator/plugins/nextjs/mcp.json +13 -0
- package/src/orchestrator/plugins/nextjs/plugin.json +21 -0
- package/src/orchestrator/plugins/notion/mcp.json +9 -0
- package/src/orchestrator/plugins/notion/plugin.json +21 -0
- package/src/orchestrator/plugins/nx/mcp.json +14 -0
- package/src/orchestrator/plugins/nx/plugin.json +21 -0
- package/src/orchestrator/plugins/playwright/mcp.json +13 -0
- package/src/orchestrator/plugins/playwright/plugin.json +21 -0
- package/src/orchestrator/plugins/prisma/mcp.json +14 -0
- package/src/orchestrator/plugins/prisma/plugin.json +21 -0
- package/src/orchestrator/plugins/resend/mcp.json +13 -0
- package/src/orchestrator/plugins/resend/plugin.json +24 -0
- package/src/orchestrator/plugins/sanity/mcp.json +9 -0
- package/src/orchestrator/plugins/sanity/plugin.json +21 -0
- package/src/orchestrator/plugins/sentry/mcp.json +12 -0
- package/src/orchestrator/plugins/sentry/plugin.json +24 -0
- package/src/orchestrator/plugins/slack/mcp.json +13 -0
- package/src/orchestrator/plugins/slack/plugin.json +24 -0
- package/src/orchestrator/plugins/strapi/mcp.json +13 -0
- package/src/orchestrator/plugins/strapi/plugin.json +21 -0
- package/src/orchestrator/plugins/stripe/mcp.json +9 -0
- package/src/orchestrator/plugins/stripe/plugin.json +21 -0
- package/src/orchestrator/plugins/supabase/mcp.json +9 -0
- package/src/orchestrator/plugins/supabase/plugin.json +21 -0
- package/src/orchestrator/plugins/teams/plugin.json +24 -0
- package/src/orchestrator/plugins/trello/mcp.json +13 -0
- package/src/orchestrator/plugins/trello/plugin.json +25 -0
- package/src/orchestrator/plugins/turborepo/plugin.json +21 -0
- package/src/orchestrator/plugins/vercel/mcp.json +9 -0
- package/src/orchestrator/plugins/vercel/plugin.json +21 -0
- package/src/orchestrator/plugins/vitest/plugin.json +21 -0
- package/src/orchestrator/skill-config-links.test.ts +2 -1
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +1 -1
- package/src/orchestrator/skills/agent-hooks/SKILL.md +1 -1
- package/src/orchestrator/skills/decomposition/SKILL.md +1 -1
- package/src/orchestrator/skills/memory-merger/SKILL.md +17 -21
- package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +44 -23
- package/src/orchestrator/skills/self-improvement/SKILL.md +30 -15
- /package/src/orchestrator/plugins/astro/{SKILL.md → skills/astro-framework/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/chrome-devtools/{SKILL.md → skills/browser-testing/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/cloudflare/{SKILL.md → skills/cloudflare-platform/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/contentful/{SKILL.md → skills/contentful-cms/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/convex/{SKILL.md → skills/convex-database/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/coolify/{SKILL.md → skills/coolify-deployment/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/cypress/{SKILL.md → skills/cypress-testing/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/drizzle/{SKILL.md → skills/drizzle-orm/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/expo/{SKILL.md → skills/expo-development/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/figma/{SKILL.md → skills/figma-design/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/hetzner/{SKILL.md → skills/hetzner-cloud/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/jira/{SKILL.md → skills/jira-management/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/linear/{SKILL.md → skills/linear-task-management/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/netlify/{SKILL.md → skills/netlify-deployment/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/nextjs/{SKILL.md → skills/nextjs-framework/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/notion/{SKILL.md → skills/notion-knowledge-management/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/nx/{SKILL.md → skills/nx-workspace/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/playwright/{SKILL.md → skills/playwright-testing/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/prisma/{SKILL.md → skills/prisma-database/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/resend/{SKILL.md → skills/resend-email/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/sanity/{SKILL.md → skills/sanity-cms/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/sentry/{SKILL.md → skills/sentry-monitoring/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/slack/{SKILL.md → skills/slack-notifications/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/strapi/{SKILL.md → skills/strapi-cms/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/stripe/{SKILL.md → skills/stripe-payments/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/supabase/{SKILL.md → skills/supabase-database/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/teams/{SKILL.md → skills/teams-notifications/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/trello/{SKILL.md → skills/trello-task-management/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/turborepo/{SKILL.md → skills/turborepo-monorepo/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/vercel/{SKILL.md → skills/vercel-deployment/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/vitest/{SKILL.md → skills/vitest-testing/SKILL.md} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lessons.test.d.ts","sourceRoot":"","sources":["../../src/cli/lessons.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { tmpdir } from 'node:os';
|
|
3
|
+
import { join, resolve } from 'node:path';
|
|
4
|
+
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
5
|
+
import { INDEX_MARKER, checkLessons, citedPath, fingerprintsOf, lessonsIndexDrift, newLessonId, parseLegacyLessons, parseLesson, readLessons, renderIndex, renderLesson, slugOf, staleCitations, syncLessons, } from './lessons.js';
|
|
6
|
+
const pkgRoot = resolve(import.meta.dirname, '..', '..');
|
|
7
|
+
/** The shape agents actually left the old file in: entries after the index, odd categories, a stray fence. */
|
|
8
|
+
const LEGACY = `\`\`\`\`markdown
|
|
9
|
+
# Lessons Learned
|
|
10
|
+
|
|
11
|
+
Intro the team wrote.
|
|
12
|
+
|
|
13
|
+
### LES-001: Observability logging is mandatory
|
|
14
|
+
|
|
15
|
+
| Field | Value |
|
|
16
|
+
|-------|-------|
|
|
17
|
+
| **Category** | \`general\` |
|
|
18
|
+
| **Added** | 2026-03-01 |
|
|
19
|
+
| **Severity** | \`high\` (blocks work) |
|
|
20
|
+
|
|
21
|
+
**Problem:** Nothing was logged.
|
|
22
|
+
|
|
23
|
+
**Correct approach:** Log every session.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### LES-002: Writing files via terminal fails when content contains \`!\`
|
|
28
|
+
|
|
29
|
+
| Field | Value |
|
|
30
|
+
|-------|-------|
|
|
31
|
+
| **Category** | \`tooling\` |
|
|
32
|
+
| **Added** | 2026-03-16 |
|
|
33
|
+
| **Severity** | \`high\` (blocks file creation) |
|
|
34
|
+
|
|
35
|
+
**Problem:** zsh history expansion.
|
|
36
|
+
|
|
37
|
+
**Wrong approach:**
|
|
38
|
+
- heredocs
|
|
39
|
+
|
|
40
|
+
## Index by Category
|
|
41
|
+
|
|
42
|
+
| Category | Lessons |
|
|
43
|
+
|----------|---------|
|
|
44
|
+
| \`general\` | LES-001, LES-002 |
|
|
45
|
+
|
|
46
|
+
\`\`\`\`
|
|
47
|
+
|
|
48
|
+
### LES-007: Use N/A for tracker_issue when no tracker is configured
|
|
49
|
+
|
|
50
|
+
| Field | Value |
|
|
51
|
+
|-------|-------|
|
|
52
|
+
| **Category** | \`general\` |
|
|
53
|
+
| **Added** | 2026-03-05 |
|
|
54
|
+
| **Severity** | \`medium\` (wastes 5+ min) |
|
|
55
|
+
|
|
56
|
+
**Problem:** TAS-PENDING everywhere.
|
|
57
|
+
`;
|
|
58
|
+
function lesson(over = {}) {
|
|
59
|
+
return {
|
|
60
|
+
id: '2026-10-02-quote-shell-variables',
|
|
61
|
+
title: 'Always quote shell variables',
|
|
62
|
+
category: 'terminal',
|
|
63
|
+
severity: 'medium',
|
|
64
|
+
added: '2026-10-02',
|
|
65
|
+
citations: [],
|
|
66
|
+
status: 'active',
|
|
67
|
+
body: '**Problem:** Paths with spaces break.',
|
|
68
|
+
file: '2026-10-02-quote-shell-variables.md',
|
|
69
|
+
...over,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
describe('naming a lesson', () => {
|
|
73
|
+
it('slugs a title to lowercase words, under 50 characters', () => {
|
|
74
|
+
expect(slugOf('Always quote $SHELL variables — even in CI!')).toBe('always-quote-shell-variables-even-in-ci');
|
|
75
|
+
expect(slugOf('a'.repeat(80))).toBe('lesson');
|
|
76
|
+
expect(slugOf('Café au lait')).toBe('cafe-au-lait');
|
|
77
|
+
});
|
|
78
|
+
it('gives two lessons with the same title on the same day different ids', () => {
|
|
79
|
+
const taken = new Set(['2026-10-02-quote-shell-variables']);
|
|
80
|
+
expect(newLessonId('Quote shell variables', '2026-10-02', taken)).toBe('2026-10-02-quote-shell-variables-2');
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
describe('a lesson file', () => {
|
|
84
|
+
it('round-trips through its frontmatter, keeping dates as strings', () => {
|
|
85
|
+
const l = lesson({ citations: ['scripts/a.sh:12'], verified: '2026-10-02', fingerprints: { 'scripts/a.sh': '0123456789ab' } });
|
|
86
|
+
const parsed = parseLesson(renderLesson(l), l.file);
|
|
87
|
+
expect(parsed).toEqual(l);
|
|
88
|
+
});
|
|
89
|
+
it('names what is wrong with a file that is not a lesson', () => {
|
|
90
|
+
expect(parseLesson('just text', 'x.md')).toBe('has no frontmatter');
|
|
91
|
+
expect(parseLesson('---\nid: x\n---\nbody', 'x.md')).toBe('has no title');
|
|
92
|
+
});
|
|
93
|
+
it('cites a path, with or without a line', () => {
|
|
94
|
+
expect(citedPath('src/a.ts:12')).toBe('src/a.ts');
|
|
95
|
+
expect(citedPath('./src/a.ts#L3-L9')).toBe('src/a.ts');
|
|
96
|
+
expect(citedPath('src/a.ts')).toBe('src/a.ts');
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
describe('the old single-file log', () => {
|
|
100
|
+
it('reads every entry wherever it sits, with what it says', () => {
|
|
101
|
+
const found = parseLegacyLessons(LEGACY);
|
|
102
|
+
expect(found.map((l) => l.id)).toEqual(['LES-001', 'LES-002', 'LES-007']);
|
|
103
|
+
expect(found[1]).toMatchObject({ category: 'tooling', severity: 'high', added: '2026-03-16' });
|
|
104
|
+
expect(found[0].body).toBe('**Problem:** Nothing was logged.\n\n**Correct approach:** Log every session.');
|
|
105
|
+
expect(found[1].body).toContain('- heredocs');
|
|
106
|
+
expect(found[1].body).not.toContain('````');
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
describe('syncing lessons', () => {
|
|
110
|
+
let dir;
|
|
111
|
+
beforeEach(() => {
|
|
112
|
+
dir = mkdtempSync(join(tmpdir(), 'oc-lessons-'));
|
|
113
|
+
});
|
|
114
|
+
afterEach(() => rmSync(dir, { recursive: true, force: true }));
|
|
115
|
+
it('moves an old log into one file per lesson, keeps a backup, and indexes them', () => {
|
|
116
|
+
writeFileSync(join(dir, 'LESSONS-LEARNED.md'), LEGACY);
|
|
117
|
+
const out = syncLessons(dir);
|
|
118
|
+
expect(out.migrated).toBe(3);
|
|
119
|
+
expect(out.backup).toMatch(/LESSONS-LEARNED\.md\.opencastle-backup$/);
|
|
120
|
+
expect(readFileSync(join(dir, 'LESSONS-LEARNED.md.opencastle-backup'), 'utf8')).toBe(LEGACY);
|
|
121
|
+
expect(readdirSync(join(dir, 'lessons')).sort()).toEqual([
|
|
122
|
+
'LES-001-observability-logging-is-mandatory.md',
|
|
123
|
+
'LES-002-writing-files-via-terminal-fails-when-content.md',
|
|
124
|
+
'LES-007-use-n-a-for-tracker-issue-when-no-tracker-is.md',
|
|
125
|
+
]);
|
|
126
|
+
const index = readFileSync(join(dir, 'LESSONS-LEARNED.md'), 'utf8');
|
|
127
|
+
expect(index.startsWith(INDEX_MARKER)).toBe(true);
|
|
128
|
+
expect(index).toContain('## tooling');
|
|
129
|
+
expect(lessonsIndexDrift(dir)).toBeNull();
|
|
130
|
+
});
|
|
131
|
+
it('does it once: a second sync changes nothing', () => {
|
|
132
|
+
writeFileSync(join(dir, 'LESSONS-LEARNED.md'), LEGACY);
|
|
133
|
+
syncLessons(dir);
|
|
134
|
+
const before = readFileSync(join(dir, 'LESSONS-LEARNED.md'), 'utf8');
|
|
135
|
+
expect(syncLessons(dir)).toMatchObject({ migrated: 0, index: 'unchanged' });
|
|
136
|
+
expect(readFileSync(join(dir, 'LESSONS-LEARNED.md'), 'utf8')).toBe(before);
|
|
137
|
+
});
|
|
138
|
+
it('replaces an untouched template without a backup', () => {
|
|
139
|
+
// As 1.0.0 shipped it, kept as a fixture: CI's shallow clone has no history to read it from.
|
|
140
|
+
const template = readFileSync(join(import.meta.dirname, 'fixtures', 'lessons-template-1.0.md'), 'utf8');
|
|
141
|
+
writeFileSync(join(dir, 'LESSONS-LEARNED.md'), template);
|
|
142
|
+
const out = syncLessons(dir);
|
|
143
|
+
expect(out).toMatchObject({ migrated: 0, index: 'updated' });
|
|
144
|
+
expect(out.backup).toBeUndefined();
|
|
145
|
+
expect(existsSync(join(dir, 'LESSONS-LEARNED.md.opencastle-backup'))).toBe(false);
|
|
146
|
+
});
|
|
147
|
+
it('leaves a project that removed the index alone', () => {
|
|
148
|
+
expect(syncLessons(dir).index).toBe('absent');
|
|
149
|
+
expect(existsSync(join(dir, 'LESSONS-LEARNED.md'))).toBe(false);
|
|
150
|
+
});
|
|
151
|
+
it('reports an index a merge left behind, and sync rebuilds it', () => {
|
|
152
|
+
writeFileSync(join(dir, 'LESSONS-LEARNED.md'), renderIndex([]));
|
|
153
|
+
mkdirSync(join(dir, 'lessons'));
|
|
154
|
+
writeFileSync(join(dir, 'lessons', 'a.md'), renderLesson(lesson()));
|
|
155
|
+
expect(lessonsIndexDrift(dir)).toMatch(/does not list/);
|
|
156
|
+
syncLessons(dir);
|
|
157
|
+
expect(lessonsIndexDrift(dir)).toBeNull();
|
|
158
|
+
expect(readFileSync(join(dir, 'LESSONS-LEARNED.md'), 'utf8')).toContain('Always quote shell variables');
|
|
159
|
+
});
|
|
160
|
+
it('lists archived lessons apart, with where they went', () => {
|
|
161
|
+
const index = renderIndex([lesson(), lesson({ id: 'b', file: 'b.md', title: 'Old', status: 'archived', mergedInto: 'skills/x/SKILL.md' })]);
|
|
162
|
+
expect(index).toMatch(/## Archived[\s\S]*\*\*Old\*\* → `skills\/x\/SKILL\.md`/);
|
|
163
|
+
expect(index.split('## Archived')[0]).not.toContain('**Old**');
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
describe('the shipped template', () => {
|
|
167
|
+
it('is the index of no lessons, exactly as sync writes it', () => {
|
|
168
|
+
const shipped = readFileSync(join(pkgRoot, 'src', 'orchestrator', 'customizations', 'LESSONS-LEARNED.md'), 'utf8');
|
|
169
|
+
expect(shipped).toBe(renderIndex([]));
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
describe('citations against the code', () => {
|
|
173
|
+
let project;
|
|
174
|
+
beforeEach(() => {
|
|
175
|
+
project = mkdtempSync(join(tmpdir(), 'oc-cite-'));
|
|
176
|
+
mkdirSync(join(project, 'src'));
|
|
177
|
+
writeFileSync(join(project, 'src', 'a.ts'), 'export const a = 1\n');
|
|
178
|
+
writeFileSync(join(project, 'src', 'b.ts'), 'export const b = 1\n');
|
|
179
|
+
});
|
|
180
|
+
afterEach(() => rmSync(project, { recursive: true, force: true }));
|
|
181
|
+
const verifiedNow = (citations, over = {}) => lesson({ citations, verified: '2026-10-01', fingerprints: fingerprintsOf(project, citations), ...over });
|
|
182
|
+
it('says nothing while the cited code is as it was verified', () => {
|
|
183
|
+
expect(staleCitations(project, [verifiedNow(['src/a.ts:1'])])).toEqual([]);
|
|
184
|
+
});
|
|
185
|
+
it('names a cited file that changed since, and one that is gone', () => {
|
|
186
|
+
const l = verifiedNow(['src/a.ts:1', 'src/b.ts']);
|
|
187
|
+
writeFileSync(join(project, 'src', 'a.ts'), 'export const a = 2\n');
|
|
188
|
+
rmSync(join(project, 'src', 'b.ts'));
|
|
189
|
+
expect(staleCitations(project, [l]).map((s) => `${s.citation}:${s.why}`)).toEqual(['src/a.ts:1:changed', 'src/b.ts:missing']);
|
|
190
|
+
});
|
|
191
|
+
it('does not read a checkout with CRLF line endings as a change', () => {
|
|
192
|
+
const l = verifiedNow(['src/a.ts']);
|
|
193
|
+
writeFileSync(join(project, 'src', 'a.ts'), 'export const a = 1\r\n');
|
|
194
|
+
expect(staleCitations(project, [l])).toEqual([]);
|
|
195
|
+
});
|
|
196
|
+
it('checks a citation with no fingerprint for existence only', () => {
|
|
197
|
+
writeFileSync(join(project, 'src', 'a.ts'), 'anything\n');
|
|
198
|
+
expect(staleCitations(project, [lesson({ citations: ['src/a.ts'] })])).toEqual([]);
|
|
199
|
+
});
|
|
200
|
+
it('doctor warns with the lesson, the citation and the command that clears it', () => {
|
|
201
|
+
const dir = join(project, '.opencastle');
|
|
202
|
+
mkdirSync(join(dir, 'lessons'), { recursive: true });
|
|
203
|
+
writeFileSync(join(dir, 'lessons', 'a.md'), renderLesson(verifiedNow(['src/a.ts'], { id: 'a' })));
|
|
204
|
+
syncLessons(dir);
|
|
205
|
+
expect(checkLessons(project).warning).toBeUndefined();
|
|
206
|
+
writeFileSync(join(project, 'src', 'a.ts'), 'export const a = 3\n');
|
|
207
|
+
const result = checkLessons(project);
|
|
208
|
+
expect(result.warning).toBe(true);
|
|
209
|
+
expect(result.detail).toBe('a cites src/a.ts, which has changed since it was verified on 2026-10-01');
|
|
210
|
+
expect(result.fix).toContain('opencastle lesson verify a');
|
|
211
|
+
expect(readLessons(dir).lessons).toHaveLength(1);
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
//# sourceMappingURL=lessons.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lessons.test.js","sourceRoot":"","sources":["../../src/cli/lessons.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAA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,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAA;QAC1D,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;IAClD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PluginConfig } from '../orchestrator/plugins/types.js';
|
|
2
|
+
/** An integration's `mcp.json` value, or null when its server cannot be written portably. */
|
|
3
|
+
export declare function packMcp(p: PluginConfig): Record<string, unknown> | null;
|
|
4
|
+
/** An integration's `plugin.json` value. */
|
|
5
|
+
export declare function packManifest(p: PluginConfig): Record<string, unknown>;
|
|
6
|
+
/** Every file an integration's directory holds besides `config.ts` and its skill, as path → text. */
|
|
7
|
+
export declare function packFiles(p: PluginConfig): Record<string, string>;
|
|
8
|
+
//# sourceMappingURL=pack-plugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-plugins.d.ts","sourceRoot":"","sources":["../../src/cli/pack-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAiBpE,6FAA6F;AAC7F,wBAAgB,OAAO,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAiBvE;AAED,4CAA4C;AAC5C,wBAAgB,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuBrE;AAED,qGAAqG;AACrG,wBAAgB,SAAS,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKjE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { EXTENSION_NAMESPACE, mcpSchemaUrl, pluginSchemaUrl } from './agent-plugin.js';
|
|
2
|
+
/**
|
|
3
|
+
* Each integration as an Agent Plugin: `plugin.json` and `mcp.json` beside its
|
|
4
|
+
* `skills/<name>/SKILL.md`, compiled from the integration's `config.ts`.
|
|
5
|
+
*
|
|
6
|
+
* `config.ts` stays the source: it carries what only OpenCastle reads —
|
|
7
|
+
* detection, the agents whose tools a server extends, earlier defaults to
|
|
8
|
+
* migrate from. That goes under `extensions["dev.opencastle"]`, the namespace
|
|
9
|
+
* the standard gives a client for its own data, and the portable part is what
|
|
10
|
+
* any client loads. `npm run plugins:build` writes the files and a test holds
|
|
11
|
+
* them to `config.ts`, as the website's snippets are held to it.
|
|
12
|
+
*/
|
|
13
|
+
const REPOSITORY = 'https://github.com/monkilabs/opencastle';
|
|
14
|
+
/** An integration's `mcp.json` value, or null when its server cannot be written portably. */
|
|
15
|
+
export function packMcp(p) {
|
|
16
|
+
const cfg = p.mcpConfig;
|
|
17
|
+
if (!cfg || !p.mcpServerKey)
|
|
18
|
+
return null;
|
|
19
|
+
let server;
|
|
20
|
+
if (cfg.type === 'http') {
|
|
21
|
+
// A URL with a value only the user can supply — a tenant id — is not a
|
|
22
|
+
// portable server; the extension data says what it needs.
|
|
23
|
+
if (!cfg.url || cfg.url.includes('${'))
|
|
24
|
+
return null;
|
|
25
|
+
server = { type: 'streamable-http', url: cfg.url };
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
if (!cfg.command || [cfg.command, ...(cfg.args ?? [])].some((a) => a.includes('${')))
|
|
29
|
+
return null;
|
|
30
|
+
// No `env`: the standard has no way to name a secret yet, so a server that
|
|
31
|
+
// needs a token reads it from the environment the assistant runs in, and
|
|
32
|
+
// the extension data lists which.
|
|
33
|
+
server = { type: 'stdio', command: cfg.command, ...(cfg.args && cfg.args.length > 0 && { args: cfg.args }) };
|
|
34
|
+
}
|
|
35
|
+
return { $schema: mcpSchemaUrl(), mcpServers: { [p.mcpServerKey]: server } };
|
|
36
|
+
}
|
|
37
|
+
/** An integration's `plugin.json` value. */
|
|
38
|
+
export function packManifest(p) {
|
|
39
|
+
const mcp = packMcp(p);
|
|
40
|
+
const what = p.mcpServerKey ? (mcp ? 'skill and MCP server' : 'skill (its MCP server needs per-user setup)') : 'skill';
|
|
41
|
+
return {
|
|
42
|
+
$schema: pluginSchemaUrl(),
|
|
43
|
+
name: p.id,
|
|
44
|
+
description: `${p.name} ${what} for AI coding assistants: ${p.hint.replace(/\.$/, '')}.`,
|
|
45
|
+
homepage: p.docsUrl ?? 'https://www.opencastle.dev/docs/plugins',
|
|
46
|
+
repository: REPOSITORY,
|
|
47
|
+
license: 'MIT',
|
|
48
|
+
keywords: [p.category, p.subCategory],
|
|
49
|
+
extensions: {
|
|
50
|
+
[EXTENSION_NAMESPACE]: {
|
|
51
|
+
label: p.label,
|
|
52
|
+
category: p.category,
|
|
53
|
+
subCategory: p.subCategory,
|
|
54
|
+
authType: p.authType,
|
|
55
|
+
...(p.envVars.length > 0 && { env: p.envVars.map((e) => e.name) }),
|
|
56
|
+
...(p.mcpInputs && p.mcpInputs.length > 0 && { inputs: p.mcpInputs.map((i) => i.id) }),
|
|
57
|
+
...(p.officialDocs && { officialDocs: p.officialDocs }),
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** Every file an integration's directory holds besides `config.ts` and its skill, as path → text. */
|
|
63
|
+
export function packFiles(p) {
|
|
64
|
+
const files = { 'plugin.json': JSON.stringify(packManifest(p), null, 2) + '\n' };
|
|
65
|
+
const mcp = packMcp(p);
|
|
66
|
+
if (mcp)
|
|
67
|
+
files['mcp.json'] = JSON.stringify(mcp, null, 2) + '\n';
|
|
68
|
+
return files;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=pack-plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-plugins.js","sourceRoot":"","sources":["../../src/cli/pack-plugins.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM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,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;gBACtF,GAAG,CAAC,CAAC,CAAC,YAAY,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC;aACxD;SACF;KACF,CAAA;AACH,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,SAAS,CAAC,CAAe;IACvC,MAAM,KAAK,GAA2B,EAAE,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,CAAA;IACxG,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IACtB,IAAI,GAAG;QAAE,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAA;IAChE,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-command.test.d.ts","sourceRoot":"","sources":["../../src/cli/plugin-command.test.ts"],"names":[],"mappings":""}
|
|
@@ -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,WAAW,CAAA;AAClD,OAAO,EAAE,QAAQ,EA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AM,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"}
|