import { AgentRein } from 'agentrein';
import { Octokit } from '@octokit/rest';
import { WebClient } from '@slack/web-api';
import Stripe from 'stripe';
const agentrein = new AgentRein({ apiKey: process.env.AGENTREIN_API_KEY });
// Your own clients — initialized with your own credentials
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
const slack = new WebClient(process.env.SLACK_TOKEN);
const stripe = new Stripe(process.env.STRIPE_KEY);
const session = await agentrein.newSession({ agentId: 'my-agent', intent: '...' });
// Wrap once — use exactly as before
const agentOctokit = agentrein.wrap(octokit, session, { connector: 'github' });
const agentSlack = agentrein.wrap(slack, session, { connector: 'slack' });
const agentStripe = agentrein.wrap(stripe, session, { connector: 'stripe' });
await agentOctokit.issues.create({ owner: 'my-org', repo: 'my-repo', title: 'Task' });
await agentSlack.chat.postMessage({ channel: '#ops', text: 'Issue created' });
await agentStripe.invoices.create({ customer: 'cus_123' });