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

Function buildScenario

packages/ai-claude-code/tests/projection.test.ts:76–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74
75describe('projectClaudeWorkspace', () => {
76 function buildScenario() {
77 const secrets = createSecrets({ MCP_TOKEN: 'super-secret' })
78 const skills: Array<WorkspaceSkill> = [
79 mcpSkill('issues', {
80 url: 'https://mcp.example.com/mcp',
81 headers: { Authorization: secrets.MCP_TOKEN },
82 }),
83 agentSkill('public-skill'),
84 gitSkill({ repo: 'me/my-skill' }),
85 ]
86 const projection: WorkspaceProjection = {
87 skills,
88 plugins: ['@acme/plugin'],
89 resolveSecret: (ref) => {
90 if (ref.__secretName === 'MCP_TOKEN') return 'super-secret'
91 throw new Error(`unknown secret "${ref.__secretName}"`)
92 },
93 markerPath: MARKER,
94 root: ROOT,
95 }
96 return {
97 projection,
98 gitDir: resolveGitSkillDir(ROOT, { kind: 'git', repo: 'me/my-skill' }),
99 }
100 }
101
102 it('writes .mcp.json with the secret resolved, links the gitSkill, installs the plugin, writes the marker', async () => {
103 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