@tellet/create 0.9.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -135
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +54 -0
- package/dist/commands/agent.d.ts +1 -0
- package/dist/commands/agent.js +156 -0
- package/dist/commands/build.d.ts +1 -0
- package/dist/commands/build.js +14 -0
- package/dist/commands/deploy.d.ts +1 -0
- package/dist/commands/deploy.js +117 -0
- package/dist/commands/dev.d.ts +1 -0
- package/dist/commands/dev.js +15 -0
- package/dist/commands/mcp.d.ts +1 -0
- package/dist/commands/mcp.js +4 -0
- package/dist/commands/shared.d.ts +69 -0
- package/dist/commands/shared.js +73 -0
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.js +53 -0
- package/dist/index.js +8 -336
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +25 -0
- package/dist/mcp/tools.d.ts +2 -0
- package/dist/mcp/tools.js +264 -0
- package/dist/scaffold/project.js +1 -1
- package/dist/scaffold-flow.d.ts +1 -0
- package/dist/scaffold-flow.js +402 -0
- package/dist/setup/deps.d.ts +4 -0
- package/dist/setup/deps.js +24 -0
- package/dist/setup/env.d.ts +12 -0
- package/dist/setup/env.js +26 -0
- package/dist/setup/supabase.d.ts +36 -0
- package/dist/setup/supabase.js +207 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,188 +1,204 @@
|
|
|
1
1
|
# Tell it. Let it.
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> AI agents that run your business — create, manage, and deploy. One CLI.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npx create
|
|
6
|
+
npx @tellet/create
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Or start instantly at [tellet.com](https://tellet.com) — no setup required.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
---
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- **Orchestrator** — Manage your entire company through conversation
|
|
15
|
-
- **Knowledge Base** — pgvector-powered, agents reference it for accurate answers
|
|
16
|
-
- **Dashboard** — Stats, agent chat, conversations, onboarding
|
|
17
|
-
- **Tool Marketplace** — Stripe, Email, GitHub, Slack, Notion via MCP
|
|
18
|
-
- **Embeddable Widget** — One script tag to add AI chat to any website
|
|
19
|
-
- **3-Tier Deployment** — Free (Vercel) / Cloud (Railway) / Enterprise (AWS)
|
|
13
|
+
tellet generates an AI agent team for your business. Agents don't just chat — they send emails, delegate tasks to each other, run scheduled automations, and serve customers through an embeddable widget.
|
|
20
14
|
|
|
21
|
-
##
|
|
15
|
+
## CLI commands
|
|
16
|
+
|
|
17
|
+
After creating a project, manage it with the `tellet` CLI:
|
|
22
18
|
|
|
19
|
+
```bash
|
|
20
|
+
# Install globally (optional — or use npx @tellet/create <command>)
|
|
21
|
+
npm i -g @tellet/create
|
|
22
|
+
|
|
23
|
+
# Inside your tellet project:
|
|
24
|
+
tellet dev # Start dev server
|
|
25
|
+
tellet build # Build for production
|
|
26
|
+
tellet status # Show project info
|
|
27
|
+
tellet agent list # List all agents
|
|
28
|
+
tellet agent add # Add a new agent interactively
|
|
29
|
+
tellet agent remove # Remove an agent
|
|
30
|
+
tellet deploy # Guided deployment (Vercel, Railway, Docker, AWS)
|
|
31
|
+
tellet mcp # Start MCP server (for Claude Code / Cursor)
|
|
32
|
+
tellet help # Show all commands
|
|
23
33
|
```
|
|
24
|
-
npx create-tellet
|
|
25
34
|
|
|
26
|
-
|
|
27
|
-
? Deployment? → Quick Start / Cloud / Enterprise
|
|
28
|
-
? AI Provider? → Anthropic / OpenAI
|
|
29
|
-
? Company name? → Sunny Coffee
|
|
30
|
-
? Describe your business → We sell specialty coffee...
|
|
35
|
+
## MCP Server (Claude Code / Cursor / Codex)
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
Use tellet from Claude Code, Cursor, or any MCP-compatible AI tool:
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"tellet": {
|
|
43
|
+
"command": "npx",
|
|
44
|
+
"args": ["@tellet/create", "mcp"],
|
|
45
|
+
"cwd": "/path/to/your-tellet-project"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
38
50
|
|
|
39
|
-
|
|
40
|
-
"Coffee worth waking up for"
|
|
51
|
+
Available MCP tools:
|
|
41
52
|
|
|
42
|
-
|
|
43
|
-
|
|
53
|
+
| Tool | Description |
|
|
54
|
+
|------|-------------|
|
|
55
|
+
| `project_status` | Company info, agents, channels, environment health |
|
|
56
|
+
| `agent_list` | List all agents with details |
|
|
57
|
+
| `agent_add` | Add a new agent (name, role, description) |
|
|
58
|
+
| `agent_remove` | Remove an agent by ID |
|
|
59
|
+
| `config_read` | Read full tellet.json |
|
|
60
|
+
| `dev_start` | Start Next.js dev server |
|
|
61
|
+
| `deploy_info` | Show deployment options |
|
|
44
62
|
|
|
45
|
-
|
|
63
|
+
Then just ask your AI: *"Add a marketing agent called Nova"* or *"Show me the project status"*.
|
|
46
64
|
|
|
47
|
-
|
|
48
|
-
# Quick Start (Vercel + Supabase, free)
|
|
49
|
-
npx create-tellet
|
|
50
|
-
cd your-company
|
|
51
|
-
npm install && npm run dev
|
|
65
|
+
## What agents can do
|
|
52
66
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
- **Email customers** — Send follow-ups, confirmations, and outreach via Resend
|
|
68
|
+
- **Delegate to each other** — Support agent routes billing questions to sales automatically
|
|
69
|
+
- **Run on schedule** — Daily reports, weekly summaries, automated follow-ups via cron
|
|
70
|
+
- **Search knowledge** — Reference your product info, policies, and FAQ for accurate answers
|
|
71
|
+
- **Serve customers anywhere** — Embeddable widget for any website, one script tag
|
|
58
72
|
|
|
59
|
-
|
|
60
|
-
npx create-tellet # choose "Enterprise"
|
|
61
|
-
cd your-company/infra
|
|
62
|
-
npm install && npx cdk deploy
|
|
63
|
-
```
|
|
73
|
+
## Two ways to start
|
|
64
74
|
|
|
65
|
-
|
|
75
|
+
### Hosted (tellet.com) — recommended
|
|
66
76
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
│ Agent Team (CS · Marketing · Sales · Ops) │
|
|
72
|
-
│ ↕ │
|
|
73
|
-
│ MCP Bridge Layer │
|
|
74
|
-
│ (KB, Stripe, DB, Email, Custom API...) │
|
|
75
|
-
└────────────────────────────────────────────┘
|
|
76
|
-
```
|
|
77
|
+
1. Sign up at [tellet.com](https://tellet.com)
|
|
78
|
+
2. Describe your business in one sentence
|
|
79
|
+
3. AI generates your agent team with email, delegation, and scheduling
|
|
80
|
+
4. Embed the widget on your site, agents go to work
|
|
77
81
|
|
|
78
|
-
|
|
82
|
+
### Self-hosted (CLI)
|
|
79
83
|
|
|
84
|
+
```bash
|
|
85
|
+
npx @tellet/create
|
|
86
|
+
cd your-company
|
|
87
|
+
npm install && npm run dev
|
|
80
88
|
```
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
│ ├── (site)/ # Public website with chat widget
|
|
85
|
-
│ ├── (dashboard)/ # Management dashboard + Orchestrator
|
|
86
|
-
│ └── api/
|
|
87
|
-
│ ├── chat/ # Streaming chat API (tool use)
|
|
88
|
-
│ ├── orchestrator/ # Orchestrator API (tool use loop)
|
|
89
|
-
│ └── cron/ # Scheduled agent tasks
|
|
90
|
-
├── components/
|
|
91
|
-
│ ├── chat/ # ChatWidget, Markdown
|
|
92
|
-
│ ├── dashboard/ # Sidebar, Stats, AgentChat, Orchestrator
|
|
93
|
-
│ └── sections/ # Landing page sections
|
|
94
|
-
├── lib/
|
|
95
|
-
│ ├── engine/ # Agent runtime with tool use agentic loop
|
|
96
|
-
│ ├── providers/ # LLM providers (Anthropic, OpenAI)
|
|
97
|
-
│ ├── mcp/ # MCP client, Knowledge Base, tool registry
|
|
98
|
-
│ ├── orchestrator/ # Orchestrator tools + executor
|
|
99
|
-
│ └── scheduler.ts # Cron/heartbeat agent scheduler
|
|
100
|
-
├── public/widget.js # Embeddable chat widget
|
|
101
|
-
├── tellet.json # Configuration (single source of truth)
|
|
102
|
-
├── Dockerfile # Docker deployment (Cloud/Enterprise)
|
|
103
|
-
├── docker-compose.yml # Local dev with PostgreSQL + pgvector
|
|
104
|
-
├── railway.toml # Railway auto-deploy
|
|
105
|
-
└── infra/ # AWS CDK (Enterprise only)
|
|
89
|
+
|
|
90
|
+
## How it works
|
|
91
|
+
|
|
106
92
|
```
|
|
93
|
+
You: "I run a coffee shop called Sunny Coffee"
|
|
107
94
|
|
|
108
|
-
|
|
95
|
+
Generating your AI team...
|
|
109
96
|
|
|
110
|
-
|
|
97
|
+
Your team:
|
|
98
|
+
Barista (customer_support) — emails, knowledge, delegation
|
|
99
|
+
Roaster (marketing) — emails, knowledge, delegation
|
|
100
|
+
Grinder (sales) — emails, knowledge, delegation
|
|
111
101
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
- "Add our refund policy to the Knowledge Base" — agents reference it
|
|
102
|
+
Orchestrator tools:
|
|
103
|
+
✓ schedule_task — cron-based agent automation
|
|
104
|
+
✓ list_scheduled_tasks — view all schedules
|
|
105
|
+
✓ cancel_scheduled_task
|
|
117
106
|
|
|
118
|
-
|
|
107
|
+
✓ Your AI company is live!
|
|
108
|
+
```
|
|
119
109
|
|
|
120
|
-
|
|
110
|
+
## Architecture
|
|
121
111
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
112
|
+
```
|
|
113
|
+
┌─ tellet Platform ──────────────────────────────────┐
|
|
114
|
+
│ │
|
|
115
|
+
│ Owner ↔ Orchestrator (schedule, manage, configure) │
|
|
116
|
+
│ ↕ │
|
|
117
|
+
│ Agent Team (CS · Marketing · Sales · Ops) │
|
|
118
|
+
│ ↕ delegate_to_agent ↕ │
|
|
119
|
+
│ Actions: email · search · schedule │
|
|
120
|
+
│ ↕ │
|
|
121
|
+
│ Channels: dashboard · widget · cron │
|
|
122
|
+
│ │
|
|
123
|
+
└─────────────────────────────────────────────────────┘
|
|
124
|
+
```
|
|
129
125
|
|
|
130
|
-
|
|
126
|
+
## Agent capabilities by role
|
|
131
127
|
|
|
132
|
-
|
|
128
|
+
| Role | search_knowledge | send_email | delegate_to_agent |
|
|
129
|
+
|------|:---:|:---:|:---:|
|
|
130
|
+
| customer_support | Y | Y | Y |
|
|
131
|
+
| sales | Y | Y | Y |
|
|
132
|
+
| marketing | Y | Y | Y |
|
|
133
|
+
| operations | Y | Y | Y |
|
|
134
|
+
| analytics | Y | - | Y |
|
|
133
135
|
|
|
134
|
-
|
|
135
|
-
|------|----------|------|----------|
|
|
136
|
-
| Quick Start | Vercel + Supabase | $0 | Prototyping, new business |
|
|
137
|
-
| Cloud | Railway / Render / Fly.io | $5-20/mo | Production, startups |
|
|
138
|
-
| Enterprise | AWS CDK (Lambda + RDS) | $5-15/mo | Scale, existing AWS |
|
|
136
|
+
## Orchestrator commands
|
|
139
137
|
|
|
140
|
-
|
|
138
|
+
The Orchestrator manages your AI company through conversation:
|
|
141
139
|
|
|
142
|
-
|
|
140
|
+
- "Schedule marketing to send a weekly summary every Monday 9am"
|
|
141
|
+
- "Show all scheduled tasks"
|
|
142
|
+
- "Add our refund policy to the Knowledge Base"
|
|
143
|
+
- "Update the support agent's system prompt"
|
|
144
|
+
- "Show my stats"
|
|
143
145
|
|
|
144
|
-
|
|
145
|
-
npx create-tellet # choose "Connect"
|
|
146
|
-
```
|
|
146
|
+
## Embeddable widget
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
- Embeddable widget for your existing site:
|
|
148
|
+
Add AI chat to any website:
|
|
150
149
|
|
|
151
150
|
```html
|
|
152
|
-
<script src="https://
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
<script src="https://tellet.com/widget.js"></script>
|
|
152
|
+
<script>
|
|
153
|
+
Tellet.init({ companyId: "your-company-id" });
|
|
154
|
+
</script>
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
Features: dark/light theme, streaming responses, session persistence, mobile responsive.
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
## Project structure (self-hosted)
|
|
160
160
|
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
161
|
+
```
|
|
162
|
+
your-company/
|
|
163
|
+
├─�� app/
|
|
164
|
+
│ ├── (site)/ # Public website with chat widget
|
|
165
|
+
│ ├── (dashboard)/ # Management dashboard + Orchestrator
|
|
166
|
+
│ └── api/
|
|
167
|
+
│ ├── chat/ # Agent chat (SSE, tool use loop)
|
|
168
|
+
│ ├── orchestrator/ # Orchestrator (scheduling, management)
|
|
169
|
+
│ ├── cron/ # Scheduled task execution
|
|
170
|
+
│ └── widget/ # Public widget API (CORS, no auth)
|
|
171
|
+
├── lib/
|
|
172
|
+
│ ├── engine/ # Agent runtime with agentic loop
|
|
173
|
+
│ ├── actions/ # Role-based tools (email, delegate, search)
|
|
174
|
+
│ ├── scheduling/ # Cron parser + task executor
|
|
175
|
+
│ ├── orchestrator/ # Orchestrator tools + executor
|
|
176
|
+
│ ├── providers/ # LLM providers (Anthropic, OpenAI)
|
|
177
|
+
│ └── mcp/ # Knowledge base, tool registry
|
|
178
|
+
├── public/widget.js # Embeddable chat widget
|
|
179
|
+
├── supabase/migrations/ # Database schema
|
|
180
|
+
└── vercel.json # Cron configuration
|
|
176
181
|
```
|
|
177
182
|
|
|
178
183
|
## Tech stack
|
|
179
184
|
|
|
180
185
|
- [Next.js 16](https://nextjs.org/) — App framework
|
|
181
|
-
- [
|
|
182
|
-
- [MCP](https://modelcontextprotocol.io/) — Tool integration protocol
|
|
186
|
+
- [Supabase](https://supabase.com/) — Auth, database, pgvector, RLS
|
|
183
187
|
- [Anthropic Claude](https://anthropic.com/) / [OpenAI](https://openai.com/) — AI models
|
|
188
|
+
- [Resend](https://resend.com/) — Email delivery
|
|
189
|
+
- [Vercel Cron](https://vercel.com/docs/cron-jobs) — Scheduled task execution
|
|
184
190
|
- [Tailwind CSS 4](https://tailwindcss.com/) — Styling
|
|
185
|
-
|
|
191
|
+
|
|
192
|
+
## Environment variables
|
|
193
|
+
|
|
194
|
+
| Variable | Required | Description |
|
|
195
|
+
|----------|:---:|-------------|
|
|
196
|
+
| `NEXT_PUBLIC_SUPABASE_URL` | Y | Supabase project URL |
|
|
197
|
+
| `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY` | Y | Supabase publishable key |
|
|
198
|
+
| `SUPABASE_SERVICE_ROLE_KEY` | Y | Supabase service role key |
|
|
199
|
+
| `ANTHROPIC_API_KEY` | Y | Claude API key |
|
|
200
|
+
| `RESEND_API_KEY` | - | Resend API key (for email) |
|
|
201
|
+
| `CRON_SECRET` | - | Secret for cron endpoint auth |
|
|
186
202
|
|
|
187
203
|
## License
|
|
188
204
|
|
|
@@ -190,6 +206,6 @@ MIT
|
|
|
190
206
|
|
|
191
207
|
## Links
|
|
192
208
|
|
|
193
|
-
- [tellet.com](https://tellet.com) —
|
|
209
|
+
- [tellet.com](https://tellet.com) — Hosted platform (free)
|
|
194
210
|
- [GitHub](https://github.com/agentic-company/tellet) — Source code
|
|
195
|
-
- [npm](https://www.npmjs.com/package/create
|
|
211
|
+
- [npm](https://www.npmjs.com/package/@tellet/create) — CLI package
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
const COMMANDS = {
|
|
4
|
+
dev: { description: "Start development server", module: "./commands/dev.js" },
|
|
5
|
+
build: { description: "Build for production", module: "./commands/build.js" },
|
|
6
|
+
status: { description: "Show project status", module: "./commands/status.js" },
|
|
7
|
+
agent: { description: "Manage agents (list, add, remove)", module: "./commands/agent.js" },
|
|
8
|
+
deploy: { description: "Deploy your project", module: "./commands/deploy.js" },
|
|
9
|
+
mcp: { description: "Start MCP server (for Claude Code / Cursor)", module: "./commands/mcp.js" },
|
|
10
|
+
};
|
|
11
|
+
function printBanner() {
|
|
12
|
+
console.log();
|
|
13
|
+
console.log(chalk.bold(` ${chalk.white("tel")}${chalk.yellow("let")} ${chalk.dim("CLI")}`));
|
|
14
|
+
console.log();
|
|
15
|
+
}
|
|
16
|
+
function printHelp() {
|
|
17
|
+
printBanner();
|
|
18
|
+
console.log(chalk.bold(" Usage:"));
|
|
19
|
+
console.log(` ${chalk.cyan("tellet")} ${chalk.dim("<command>")}`);
|
|
20
|
+
console.log(` ${chalk.cyan("npx @tellet/create")} ${chalk.dim("<command>")}`);
|
|
21
|
+
console.log();
|
|
22
|
+
console.log(chalk.bold(" Commands:"));
|
|
23
|
+
const padLen = Math.max(...Object.keys(COMMANDS).map((k) => k.length)) + 2;
|
|
24
|
+
for (const [name, cmd] of Object.entries(COMMANDS)) {
|
|
25
|
+
console.log(` ${chalk.cyan(name.padEnd(padLen))} ${chalk.dim(cmd.description)}`);
|
|
26
|
+
}
|
|
27
|
+
console.log();
|
|
28
|
+
console.log(` ${chalk.cyan("(no command)".padEnd(padLen))} ${chalk.dim("Create a new tellet project")}`);
|
|
29
|
+
console.log();
|
|
30
|
+
console.log(chalk.dim(" Run tellet <command> --help for command-specific help."));
|
|
31
|
+
console.log();
|
|
32
|
+
}
|
|
33
|
+
export async function run(args) {
|
|
34
|
+
const command = args[0];
|
|
35
|
+
// No command or help → check if we should scaffold or show help
|
|
36
|
+
if (!command || command === "help" || command === "--help" || command === "-h") {
|
|
37
|
+
// If no command and no tellet.json in CWD, run scaffold
|
|
38
|
+
if (!command) {
|
|
39
|
+
const { main: scaffold } = await import("./scaffold-flow.js");
|
|
40
|
+
return scaffold();
|
|
41
|
+
}
|
|
42
|
+
printHelp();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const cmd = COMMANDS[command];
|
|
46
|
+
if (!cmd) {
|
|
47
|
+
console.error(chalk.red(` Unknown command: ${command}`));
|
|
48
|
+
console.log(chalk.dim(` Run ${chalk.cyan("tellet help")} to see available commands.`));
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
const subArgs = args.slice(1);
|
|
52
|
+
const mod = await import(cmd.module);
|
|
53
|
+
await mod.default(subArgs);
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function agent(args: string[]): Promise<void>;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import * as p from "@clack/prompts";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { loadConfigOrExit, saveConfig, nameToId, generateAgentFile, updateAgentRegistry, } from "./shared.js";
|
|
6
|
+
const VALID_ROLES = [
|
|
7
|
+
"customer_support",
|
|
8
|
+
"sales",
|
|
9
|
+
"marketing",
|
|
10
|
+
"operations",
|
|
11
|
+
"analytics",
|
|
12
|
+
"development",
|
|
13
|
+
];
|
|
14
|
+
export default async function agent(args) {
|
|
15
|
+
const sub = args[0];
|
|
16
|
+
switch (sub) {
|
|
17
|
+
case "list":
|
|
18
|
+
case "ls":
|
|
19
|
+
return agentList();
|
|
20
|
+
case "add":
|
|
21
|
+
return agentAdd();
|
|
22
|
+
case "remove":
|
|
23
|
+
case "rm":
|
|
24
|
+
return agentRemove(args.slice(1));
|
|
25
|
+
default:
|
|
26
|
+
console.log();
|
|
27
|
+
console.log(chalk.bold(" Usage:"));
|
|
28
|
+
console.log(` tellet agent list ${chalk.dim("List all agents")}`);
|
|
29
|
+
console.log(` tellet agent add ${chalk.dim("Add a new agent")}`);
|
|
30
|
+
console.log(` tellet agent remove ${chalk.dim("Remove an agent")}`);
|
|
31
|
+
console.log();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function agentList() {
|
|
35
|
+
const config = await loadConfigOrExit();
|
|
36
|
+
console.log();
|
|
37
|
+
console.log(chalk.bold(` Agents (${config.agents.length})`));
|
|
38
|
+
console.log();
|
|
39
|
+
for (const agent of config.agents) {
|
|
40
|
+
const channels = agent.channels.join(", ");
|
|
41
|
+
const tools = agent.tools.length > 0 ? agent.tools.join(", ") : chalk.dim("none");
|
|
42
|
+
console.log(` ${chalk.hex("#8b5cf6").bold(agent.name)}`);
|
|
43
|
+
console.log(` ID: ${chalk.dim(agent.id)}`);
|
|
44
|
+
console.log(` Role: ${chalk.dim(agent.role)}`);
|
|
45
|
+
console.log(` Model: ${chalk.dim(agent.model)}`);
|
|
46
|
+
console.log(` Channels: ${chalk.dim(channels)}`);
|
|
47
|
+
console.log(` Tools: ${tools}`);
|
|
48
|
+
console.log();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async function agentAdd() {
|
|
52
|
+
const config = await loadConfigOrExit();
|
|
53
|
+
console.log();
|
|
54
|
+
p.intro(chalk.bgHex("#8b5cf6").white(" Add Agent "));
|
|
55
|
+
const info = await p.group({
|
|
56
|
+
name: () => p.text({
|
|
57
|
+
message: "Agent name:",
|
|
58
|
+
placeholder: "Luna",
|
|
59
|
+
validate: (v) => {
|
|
60
|
+
if (!v)
|
|
61
|
+
return "Name is required";
|
|
62
|
+
const id = nameToId(v);
|
|
63
|
+
if (!id)
|
|
64
|
+
return "Name must contain at least one letter or number";
|
|
65
|
+
return undefined;
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
role: () => p.select({
|
|
69
|
+
message: "Role:",
|
|
70
|
+
options: VALID_ROLES.map((r) => ({ value: r, label: r.replace(/_/g, " ") })),
|
|
71
|
+
}),
|
|
72
|
+
description: () => p.text({
|
|
73
|
+
message: "What does this agent do?",
|
|
74
|
+
placeholder: "Handles billing inquiries and payment processing",
|
|
75
|
+
validate: (v) => (!v ? "Description is required" : undefined),
|
|
76
|
+
}),
|
|
77
|
+
}, {
|
|
78
|
+
onCancel: () => {
|
|
79
|
+
p.cancel("Cancelled.");
|
|
80
|
+
process.exit(0);
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
const name = info.name;
|
|
84
|
+
const role = info.role;
|
|
85
|
+
const description = info.description;
|
|
86
|
+
const id = nameToId(name);
|
|
87
|
+
if (config.agents.some((a) => a.id === id)) {
|
|
88
|
+
p.log.error(`Agent with ID "${id}" already exists.`);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
const model = config.llm.defaultModel;
|
|
92
|
+
const systemPrompt = `You are ${name}, the ${role.replace(/_/g, " ")} agent for ${config.company.name}. ${description}`;
|
|
93
|
+
config.agents.push({
|
|
94
|
+
id,
|
|
95
|
+
name,
|
|
96
|
+
role,
|
|
97
|
+
model,
|
|
98
|
+
channels: ["web_chat"],
|
|
99
|
+
tools: role === "customer_support" ? ["search_knowledge"] : [],
|
|
100
|
+
});
|
|
101
|
+
await saveConfig(config);
|
|
102
|
+
const agentsDir = path.resolve(process.cwd(), "agents");
|
|
103
|
+
await fs.mkdirp(agentsDir);
|
|
104
|
+
await fs.writeFile(path.join(agentsDir, `${id}.ts`), generateAgentFile({ id, name, role, model, systemPrompt }));
|
|
105
|
+
await updateAgentRegistry(config);
|
|
106
|
+
p.log.success(`Added ${chalk.bold(name)} (${role})`);
|
|
107
|
+
p.outro(chalk.dim(`Agent file: agents/${id}.ts`));
|
|
108
|
+
}
|
|
109
|
+
async function agentRemove(args) {
|
|
110
|
+
const config = await loadConfigOrExit();
|
|
111
|
+
const force = args.includes("--yes") || args.includes("-y");
|
|
112
|
+
const idArg = args.find((a) => !a.startsWith("-"));
|
|
113
|
+
if (config.agents.length === 0) {
|
|
114
|
+
p.log.error("No agents to remove.");
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
let targetId = idArg;
|
|
118
|
+
if (!targetId) {
|
|
119
|
+
console.log();
|
|
120
|
+
const choice = await p.select({
|
|
121
|
+
message: "Which agent to remove?",
|
|
122
|
+
options: config.agents.map((a) => ({
|
|
123
|
+
value: a.id,
|
|
124
|
+
label: `${a.name} (${a.role})`,
|
|
125
|
+
})),
|
|
126
|
+
});
|
|
127
|
+
if (p.isCancel(choice)) {
|
|
128
|
+
p.cancel("Cancelled.");
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
targetId = choice;
|
|
132
|
+
}
|
|
133
|
+
const agent = config.agents.find((a) => a.id === targetId);
|
|
134
|
+
if (!agent) {
|
|
135
|
+
p.log.error(`Agent "${targetId}" not found.`);
|
|
136
|
+
process.exit(1);
|
|
137
|
+
}
|
|
138
|
+
if (!force) {
|
|
139
|
+
const confirm = await p.confirm({
|
|
140
|
+
message: `Remove ${agent.name} (${agent.role})?`,
|
|
141
|
+
initialValue: false,
|
|
142
|
+
});
|
|
143
|
+
if (p.isCancel(confirm) || !confirm) {
|
|
144
|
+
p.cancel("Cancelled.");
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
config.agents = config.agents.filter((a) => a.id !== targetId);
|
|
149
|
+
await saveConfig(config);
|
|
150
|
+
const agentPath = path.resolve(process.cwd(), "agents", `${targetId}.ts`);
|
|
151
|
+
if (await fs.pathExists(agentPath)) {
|
|
152
|
+
await fs.remove(agentPath);
|
|
153
|
+
}
|
|
154
|
+
await updateAgentRegistry(config);
|
|
155
|
+
p.log.success(`Removed ${chalk.bold(agent.name)}`);
|
|
156
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function build(_args: string[]): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { spawnSync } from "child_process";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { loadConfigOrExit } from "./shared.js";
|
|
4
|
+
export default async function build(_args) {
|
|
5
|
+
const config = await loadConfigOrExit();
|
|
6
|
+
console.log();
|
|
7
|
+
console.log(chalk.bold(` ${chalk.white("tel")}${chalk.yellow("let")} ${chalk.dim("build")} — ${config.company.name}`));
|
|
8
|
+
console.log();
|
|
9
|
+
const result = spawnSync("npx", ["next", "build"], {
|
|
10
|
+
cwd: process.cwd(),
|
|
11
|
+
stdio: "inherit",
|
|
12
|
+
});
|
|
13
|
+
process.exit(result.status ?? 1);
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function deploy(_args: string[]): Promise<void>;
|