import { Agent } from '@a3s-lab/code';
const agent = await Agent.create('agent.acl');
const session = agent.session('.');
// 1. Find candidate files by glob pattern (returns a list of paths).
const files = await session.glob('src/**/*.ts');
// 2. Search the workspace for the symbol we care about (returns ripgrep text).
const hits = await session.grep('createSession');
// 3. Build a context string and feed it into a focused prompt.
const context = [
`Files in scope:\n${files.join('\n')}`,
`Matches for "createSession":\n${hits}`,
].join('\n\n');
const answer = await session.run(
`Using only this context, explain how createSession is wired up:\n\n${context}`,
);
console.log(answer);