Deploying the Agent
The @swenyai/agent package is an agentic harness that orchestrates coding sessions. The model backend and messaging channel are pluggable — deploy it as a Slack bot (more channels planned) or run it locally as an interactive CLI.
Slack channel
Section titled “Slack channel”The first supported channel is Slack. More channels are planned.
Prerequisites
Section titled “Prerequisites”- A Slack app with Socket Mode enabled
- Bot token scopes:
chat:write,app_mentions:read,im:history,im:read,im:write - An app-level token with
connections:writescope
Configuration
Section titled “Configuration”Create a sweny.config.ts in your project root:
import { defineConfig } from "@swenyai/agent";import { noAuth } from "@swenyai/providers/auth";import { fsStorage } from "@swenyai/providers/storage";import { memoryPlugin, workspacePlugin } from "@swenyai/agent";
export default defineConfig({ name: "sweny", auth: noAuth(), storage: fsStorage({ baseDir: "./.sweny-data" }), plugins: [memoryPlugin(), workspacePlugin()], model: { maxTurns: 25, },});See Agent Configuration for the full config reference.
Environment variables
Section titled “Environment variables”SLACK_BOT_TOKEN=xoxb-...SLACK_APP_TOKEN=xapp-...CLAUDE_CODE_OAUTH_TOKEN=... # or ANTHROPIC_API_KEYnpm run devInteractive CLI
Section titled “Interactive CLI”Run the agent as a local REPL without Slack:
npm run cliThe CLI uses the same config, plugins, and model runner as the bot.
Plugins
Section titled “Plugins”The agent supports custom tool plugins. Each plugin can expose tools to the model and inject sections into the system prompt:
import { z } from "zod";import { agentTool } from "@swenyai/providers/agent-tool";import type { ToolPlugin } from "@swenyai/agent";
export function httpPlugin(): ToolPlugin { return { name: "http", description: "Make HTTP requests", createTools() { return [ agentTool( "http_get", "Fetch a URL and return its body", { url: z.string().url() }, async (args) => ({ content: [{ type: "text", text: await (await fetch(args.url as string)).text() }], }), ), ]; }, };}Add it to your config:
export default defineConfig({ // ... plugins: [memoryPlugin(), workspacePlugin(), httpPlugin()],});See Plugin System for the full API reference and Built-in Plugins for the tools included out of the box.
Storage backends
Section titled “Storage backends”The agent persists sessions, memory, and workspace files. Choose a backend:
// Local filesystem (development)import { fsStorage } from "@swenyai/providers/storage";const storage = fsStorage({ baseDir: "./.sweny-data" });
// Amazon S3 (production)import { s3Storage } from "@swenyai/providers/storage";const storage = s3Storage({ bucket: "my-sweny-bucket", prefix: "agent" });