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

Function buildScenario

packages/ai-codex/tests/projection.test.ts:78–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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