()
| 85 | |
| 86 | describe('projectOpencodeWorkspace', () => { |
| 87 | function buildScenario() { |
| 88 | const secrets = createSecrets({ MCP_TOKEN: 'super-secret' }) |
| 89 | const skills: Array<WorkspaceSkill> = [ |
| 90 | mcpSkill('issues', { |
| 91 | url: 'https://mcp.example.com/mcp', |
| 92 | headers: { Authorization: secrets.MCP_TOKEN }, |
| 93 | }), |
| 94 | agentSkill('public-skill'), |
| 95 | gitSkill({ repo: 'me/my-skill' }), |
| 96 | ] |
| 97 | const projection: WorkspaceProjection = { |
| 98 | skills, |
| 99 | plugins: ['@acme/plugin'], |
| 100 | resolveSecret: (ref) => { |
| 101 | if (ref.__secretName === 'MCP_TOKEN') return 'super-secret' |
| 102 | throw new Error(`unknown secret "${ref.__secretName}"`) |
| 103 | }, |
| 104 | markerPath: MARKER, |
| 105 | root: ROOT, |
| 106 | } |
| 107 | return { |
| 108 | projection, |
| 109 | gitDir: resolveGitSkillDir(ROOT, { kind: 'git', repo: 'me/my-skill' }), |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | it('writes opencode.json with the MCP secret resolved, warns for gitSkill/agentSkill/plugin, writes the marker', async () => { |
| 114 | const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) |
no test coverage detected