import { AgentRouter } from '@copass/agent-router';
import open from 'open';
const router = new AgentRouter({
auth: { type: 'api-key', key: process.env.COPASS_API_KEY! },
sandboxId: process.env.COPASS_SANDBOX_ID!,
});
// One-time: connect the sources the team is already using.
await router.integrations.connect('github', { onConnectUrl: open, scope: 'org' });
await router.integrations.connect('linear', { onConnectUrl: open, scope: 'org' });
await router.integrations.connect('slack_v2', { onConnectUrl: open, scope: 'workspace' });
await router.integrations.connect('google_calendar', { onConnectUrl: open, scope: 'org' });
await router.integrations.connect('notion', { onConnectUrl: open, scope: 'org' });
const team = ['alice', 'bob', 'carol', 'dave'];
for (const member of team) {
for await (const event of router.run({
provider: 'anthropic',
model: 'claude-sonnet-4-6',
system: `You are writing one person's async standup for the last 24 hours.
Source everything from the connected integrations:
• GitHub — commits merged, PRs opened or reviewed.
• Linear — issues moved, status changes, new sub-tasks.
• Slack — significant threads they drove or decisions they weighed in on.
• Google Calendar — non-trivial meetings attended (skip 1:1s and standups).
• Notion — pages created or meaningfully edited.
Output one short paragraph: what they shipped, what they're unblocking, what they're blocked on.
Post the result to #standup, tagging the person.`,
message: `Write today's standup for ${member}.`,
endUserId: member, // per-member memory
})) {
if (event.type === 'text') process.stdout.write(event.text);
}
}