MCPcopy Index your code
hub / github.com/TanStack/ai / buildScenario

Function buildScenario

packages/ai-opencode/tests/projection.test.ts:87–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85
86describe('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(() => {})

Callers 1

projection.test.tsFile · 0.70

Calls 5

createSecretsFunction · 0.90
mcpSkillFunction · 0.90
agentSkillFunction · 0.90
gitSkillFunction · 0.90
resolveGitSkillDirFunction · 0.90

Tested by

no test coverage detected