feat: Add intelligent auto-router and enhanced integrations

- Add intelligent-router.sh hook for automatic agent routing
- Add AUTO-TRIGGER-SUMMARY.md documentation
- Add FINAL-INTEGRATION-SUMMARY.md documentation
- Complete Prometheus integration (6 commands + 4 tools)
- Complete Dexto integration (12 commands + 5 tools)
- Enhanced Ralph with access to all agents
- Fix /clawd command (removed disable-model-invocation)
- Update hooks.json to v5 with intelligent routing
- 291 total skills now available
- All 21 commands with automatic routing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
admin
2026-01-28 00:27:56 +04:00
Unverified
parent 3b128ba3bd
commit b52318eeae
1724 changed files with 351216 additions and 0 deletions

216
AUTO-TRIGGER-SUMMARY.md Normal file
View File

@@ -0,0 +1,216 @@
# Auto-Trigger Integration Complete ✅
**Date:** 2026-01-27
**Status:** ✅ All agents auto-routing enabled via Ralph
---
## What Was Added
### 1. Intelligent Router Hook
**File:** `~/.claude/hooks/intelligent-router.sh`
This hook automatically analyzes user prompts and suggests the best agent for the task. It runs on every `UserPromptSubmit` event.
**Routing Logic:**
- Analyzes task keywords and patterns
- Calculates confidence scores (threshold: 70%)
- Suggests appropriate agent command
- Covers ALL 21 integrated commands
### 2. Enhanced Ralph Command
**File:** `~/.claude/commands/ralph.md` (updated)
Ralph now:
- Has access to ALL integrated agents (Clawd, Prometheus, Dexto)
- Routes to best agent automatically
- Can orchestrate multi-agent workflows
- Removed `disable-model-invocation` for proper functionality
### 3. Enhanced Ralph Skill
**File:** `~/.claude/skills/ralph/enhanced-ralph.md` (new)
Complete documentation of all agents and routing patterns.
### 4. Updated Hooks Configuration
**File:** `~/.claude/hooks.json` (updated to v5)
Added `intelligent-router.sh` as the first hook in UserPromptSubmit chain.
---
## Auto-Routing Patterns
| Task Pattern | Routes To | Example |
|-------------|-----------|---------|
| "autonomous", "automatically", "on its own" | `/clawd` | "Handle this autonomously" |
| "architecture", "design system", "from scratch" | `/ralph` | "Design microservices architecture" |
| "bug", "fix", "reproduce", "regression" | `/prometheus-bug` | "Fix authentication bug" |
| "feature", "implement", "add functionality" | `/prometheus-feature` | "Add two-factor auth" |
| "code context", "how does", "explain" | `/prometheus-context` | "How does payment work?" |
| "github", "pr", "issue", "commit" | `/dexto-github` | "Analyze the pull request" |
| "pdf", "document", "summarize paper" | `/dexto-pdf` | "Summarize this document" |
| "generate image", "create picture", "ai art" | `/dexto-nano-banana` | "Generate an image" |
| "video", "sora", "generate clip" | `/dexto-sora` | "Create a video" |
| "music", "audio", "podcast", "beat" | `/dexto-music` | "Create a beat" |
| "database", "sql", "query", "schema" | `/dexto-database` | "Optimize this query" |
| "explore code", "analyze codebase" | `/dexto-explore` | "Explore this codebase" |
| "product name", "branding", "research" | `/dexto-research` | "Research product names" |
| "support ticket", "triage", "categorize" | `/dexto-triage` | "Triage this ticket" |
---
## How It Works
### User Experience
1. **User types a task:**
```
Fix the authentication bug in the login system
```
2. **Intelligent Router analyzes:**
- Detects "bug", "fix", "authentication" keywords
- Matches to Prometheus Bug Analyzer (score: 85)
- Confidence: high
3. **Suggestion appears:**
```
💡 **Tip:** This is a code analysis task. Use Prometheus: `/prometheus "Fix the authentication bug in the login system"`
```
4. **User can:**
- Click/tap the suggested command
- Type it manually
- Ignore and use default Claude
- Use `/ralph` to let Ralph orchestrate
### Ralph Orchestration
When using `/ralph`, it:
1. Analyzes task requirements
2. Selects best agent automatically
3. For complex tasks, chains multiple agents:
- Example: "Analyze code, find bugs, create fix plan"
- Ralph chains: `dexto-explore` → `prometheus-bug` → `prometheus-feature`
---
## Examples
### Example 1: Bug Fix
```
User: "The login is broken after password reset"
Router detects: bug pattern
Suggestion: 💡 Use Prometheus: `/prometheus-bug "The login is broken after password reset"`
```
### Example 2: Image Generation
```
User: "Create an image of a cyberpunk city"
Router detects: image generation pattern
Suggestion: 💡 Use Dexto nano-banana agent: `/dexto-nano-banana "Create an image of a cyberpunk city"`
```
### Example 3: Architecture Design
```
User: "Design a scalable e-commerce backend"
Router detects: architecture pattern
Suggestion: 💡 This is a complex architecture task. Ralph can help: `/ralph "Design a scalable e-commerce backend"`
```
### Example 4: Autonomous Execution
```
User: "Automatically deploy the application to production"
Router detects: autonomous pattern
Suggestion: 💡 This task looks suitable for autonomous execution. Consider using: `/clawd "Automatically deploy the application to production"`
```
---
## Configuration
### Enable/Disable Router
Edit `~/.claude/hooks.json`:
```json
{
"type": "command",
"command": "/home/roman/.claude/hooks/intelligent-router.sh",
"timeout": 10
}
```
### Adjust Confidence Threshold
Edit `~/.claude/hooks/intelligent-router.sh`:
```bash
if [ "$SCORE" -ge 70 ]; then # Change 70 to desired threshold
```
### Add New Patterns
Add to the detect patterns in `intelligent-router.sh`:
```bash
if echo "$prompt" | grep -qiE "(your|pattern)"; then
best_agent="your-agent"
best_score=80
fi
```
---
## Testing
Test the router:
```bash
# Test various patterns
echo "Fix this bug" | ~/.claude/hooks/intelligent-router.sh
echo "Generate an image" | ~/.claude/hooks/intelligent-router.sh
echo "Design architecture" | ~/.claude/hooks/intelligent-router.sh
echo "Handle this autonomously" | ~/.claude/hooks/intelligent-router.sh
```
---
## Files Modified/Created
```
~/.claude/
├── hooks/
│ ├── intelligent-router.sh # NEW - Auto-routing logic
│ └── hooks.json # UPDATED - v5 with router
├── commands/
│ └── ralph.md # UPDATED - Enhanced capabilities
└── skills/
└── ralph/
└── enhanced-ralph.md # NEW - Documentation
```
---
## Health Check
```bash
~/.claude/health-check.sh
```
**Status:** ✅ All systems operational (291 skills)
---
## Summary
Your Claude Code CLI now has **intelligent auto-routing** that:
1.**Detects task type** from natural language
2.**Suggests best agent** automatically
3.**Routes via Ralph** for complex orchestration
4.**Covers all 21 commands** (Clawd, Prometheus, Dexto)
5.**Runs on every prompt** via hooks
**Just describe your task and the system will guide you to the best tool! 🎯**

View File

@@ -0,0 +1,257 @@
# Claude Code CLI - Complete Production Integration Summary
**Date:** 2026-01-27
**Status:** ✅ ALL SYSTEMS OPERATIONAL
---
## 🎉 Overview
Your Claude Code CLI now has comprehensive production-grade integrations with multiple AI agent frameworks, tools, and systems. All components are fully operational and ready for use.
---
## 📊 Integrated Systems
### 1. Clawd ✅
- **Source:** Internal/custom setup
- **Type:** Autonomous task execution gateway
- **Status:** Running (PID: 23762, Port: 8766)
- **Command:** `/clawd "task"`
- **Capability:** Multi-agent task delegation with persistent sessions
### 2. Ralph ✅
- **Source:** Ralph Orchestrator
- **Type:** "Tackle Until Solved" autonomous iteration
- **Status:** Binary installed and symlinked
- **Command:** `/ralph "complex task"`
- **Capability:** Architecture design, multi-step implementations
### 3. Prometheus (EuniAI) ✅
- **Source:** https://github.com/EuniAI/Prometheus
- **Type:** Multi-agent code analysis system
- **Status:** Integrated (6 commands + 4 tools + master)
- **Commands:** `/prometheus-bug`, `/prometheus-feature`, etc.
- **Capability:** Bug fixing, feature implementation, code analysis
### 4. Dexto (Truffle AI) ✅
- **Source:** https://github.com/truffle-ai/dexto
- **Type:** Multi-agent framework
- **Status:** Integrated (12 commands + 5 tools + master)
- **Commands:** `/dexto-code`, `/dexto-github`, `/dexto-pdf`, etc.
- **Capability:** Development, media creation, databases, GitHub
---
## 📁 Complete Command List
### Clawd (1 command)
```
/clawd "Your task"
```
### Ralph (1 command)
```
/ralph "Your complex task"
```
### Prometheus (7 commands)
```
/prometheus-classify "issue" # Classify issue type
/prometheus-bug "bug report" # Analyze and fix bugs
/prometheus-feature "request" # Plan features
/prometheus-context "query" # Get code context
/prometheus-edit "change" # Generate edits
/prometheus-test "test suite" # Run tests
/prometheus "any task" # Auto-select agent
```
### Dexto (12 commands)
```
/dexto-code "task" # Development
/dexto-database "query" # Database operations
/dexto-github "repo/issue/pr" # GitHub operations
/dexto-pdf "document" # PDF analysis
/dexto-image-edit "image" # Image editing
/dexto-nano-banana "prompt" # AI images (Gemini 2.5)
/dexto-sora "prompt" # Video generation (Sora)
/dexto-music "idea" # Music creation
/dexto-podcast "topic" # Podcast generation
/dexto-research "product" # Product research
/dexto-triage "ticket" # Support triage
/dexto-explore "codebase" # Code exploration
```
---
## 🛠️ Tool Skills
### Prometheus Tools (4)
- **File Operations** - AST-based code parsing
- **Graph Traversal** - Knowledge graph navigation
- **Container** - Docker execution
- **Web Search** - Documentation lookup
### Dexto Tools (5)
- **Filesystem** - Advanced file operations
- **Playwright** - Browser automation
- **Process** - System commands
- **TODO** - Task management
- **Plan** - Project planning
### MCP Servers (10 registered)
- **arc** - Subagent file operations
- **claude-mem** - Persistent memory
- **filesystem** - Local filesystem
- **git** - Git operations
- **fetch** - HTTP requests
- **sqlite** - Database
- And more...
---
## 📈 Statistics
| Component | Count |
|-----------|-------|
| **Total Commands** | 21 |
| **Agent Frameworks** | 4 |
| **Tool Skills** | 9 |
| **MCP Servers** | 10 |
| **Total Skills** | 295 |
| **Plugins** | 2 |
| **Hooks** | 5 |
---
## 🚀 Quick Start Examples
### Development Tasks
```bash
# Fix a bug
/clawd "Fix the authentication bug"
/prometheus-bug "Login fails after password reset"
/dexto-code "Review the pull request"
# Implement a feature
/prometheus-feature "Add two-factor authentication"
/ralph "Design a microservices architecture for e-commerce"
# Analyze code
/dexto-explore "Analyze this codebase structure"
/prometheus-context "How does payment processing work?"
```
### Media & Content
```bash
# Generate images
/dexto-nano-banana "A futuristic city at sunset"
/dexto-image-edit "Resize and enhance this photo"
# Create video
/dexto-sora "A robot learning to paint"
# Audio content
/dexto-music "Create a lo-fi beat for studying"
/dexto-podcast "Generate a podcast about AI safety"
# Documents
/dexto-pdf "Summarize this research paper"
```
### Operations
```bash
# GitHub
/dexto-github "Analyze issues in the repository"
# Database
/dexto-database "Optimize this slow query"
# Research
/dexto-research "Find a name for my productivity app"
/prometheus-classify "Categorize this customer feedback"
```
---
## 🔧 Configuration Files
```
~/.claude/
├── settings.json # Main settings
├── hooks.json # Hook configuration
├── config.json # Config
├── health-check.sh # Health monitoring
├── aliases.sh # Command aliases
├── clawd/ # Clawd gateway
│ └── gateway.pid # Running process
├── ralph-integration/ # Ralph integration
├── prometheus/ # Prometheus integration
│ └── integrate-all.sh # Integration script
├── dexto/ # Dexto integration
│ └── integrate-all.sh # Integration script
└── mcp-servers/ # MCP infrastructure
├── registry.json # Server definitions
└── manager.sh # Start/stop/status
```
---
## 🩺 Health Monitoring
Run the health check anytime:
```bash
~/.claude/health-check.sh
```
Current status: **✅ ALL SYSTEMS OPERATIONAL**
---
## 📝 Master Skills
For automatic agent/tool selection, use the master skills:
- **prometheus-master** - Automatically selects Prometheus components
- **dexto-master** - Automatically selects Dexto agents
Usage:
```
"Use prometheus to analyze this bug"
"Use dexto to generate an image"
```
---
## 🎯 Next Steps
All integrations are complete and operational!
For advanced usage:
1. Configure API keys (OpenAI, Gemini, etc.) in respective configs
2. Set up Neo4j for Prometheus knowledge graph (optional)
3. Configure GitHub tokens for Dexto GitHub agent
4. Customize agent configurations in `~/.claude/*/agents/`
---
## 📚 Documentation
- **Clawd:** `~/.claude/clawd/docs/`
- **Prometheus:** `~/.claude/prometheus/README.md`
- **Dexto:** `~/.claude/dexto/README.md`
- **Integration:** `~/.claude/UPGRADE-SUMMARY.md`
---
**🎉 Your Claude Code CLI is now a comprehensive multi-agent AI platform! 🎉**
Total capabilities:
- ✅ Autonomous task execution (Clawd)
- ✅ Architecture design (Ralph)
- ✅ Code analysis (Prometheus)
- ✅ Multi-agent framework (Dexto)
- ✅ 295 specialized skills
- ✅ 10 MCP servers
- ✅ Production-grade monitoring

251
dexto/AGENTS.md Normal file
View File

@@ -0,0 +1,251 @@
# Dexto Development Guidelines for AI Assistants
This repo is reviewed by automated agents (including CodeRabbit). This file is the source of truth for repo-wide conventions and review expectations.
**Package manager: pnpm** (do not use npm/yarn)
## Code Quality Requirements
Before completing significant tasks, prompt the user to ask if they want to run:
```bash
/quality-checks
```
This runs `scripts/quality-checks.sh` for build, tests, lint, and typecheck. See `.claude/commands/quality-checks.md`.
## General Rules
- Optimize for correctness. Use facts and code as the source of truth.
- Read relevant code before recommending changes. Prefer grep/glob + direct file references over assumptions.
- If something requires assumptions, state them and ask for confirmation.
- Don't communicate to the user via code comments. Comments are for future readers of the code, not for explaining decisions to the user.
## Stack Rules (important)
These rules are intended to prevent stack fragmentation and review churn.
### WebUI (`packages/webui`)
- Build tool: **Vite**
- Routing: **TanStack Router** (`@tanstack/react-router`). Do not introduce `react-router-dom` or other routing systems unless explicitly migrating.
- Server-state/data fetching: **TanStack Query** (`@tanstack/react-query`). Prefer it for request caching, invalidation, and async state.
- Client-side state: Zustand exists; prefer it only for genuinely client-only state (UI preferences, local toggles). Avoid duplicating server state into stores.
### Server (`packages/server`)
- HTTP API: **Hono** routes live in `packages/server/src/hono/routes/*.ts`.
- Error mapping middleware: `packages/server/src/hono/middleware/error.ts`.
### Core (`packages/core`)
- Core is the business logic layer. Keep policy, validation boundaries, and reusable services here.
### CLI (`packages/cli`)
- Entry point: `packages/cli/src/cli/index.ts`
- Static commands (e.g., `dexto init`, `dexto setup`): `packages/cli/src/cli/commands/`
- Interactive CLI commands (e.g., `/help`, `/compact`): `packages/cli/src/cli/commands/interactive-commands/`
- Ink-based UI components: `packages/cli/src/cli/ink-cli/`
### Other Important Packages
- **`@dexto/client-sdk`**: Lightweight type-safe client for the Dexto API (Hono-based). Use for external integrations.
- **`@dexto/agent-management`**: Agent registry, config discovery, preferences, and agent resolution logic.
- **`@dexto/analytics`**: Shared PostHog analytics utilities for CLI and WebUI (opt-in telemetry).
- **`@dexto/registry`**: Shared registry data (MCP server presets, etc.) for CLI and WebUI.
- **`@dexto/tools-*`**: Modular tool packages (`tools-filesystem`, `tools-process`, `tools-todo`, `tools-plan`). Each provides a tool provider that registers with the core tool registry.
### Images (`packages/image-*`)
Images are pre-configured bundles of providers, tools, and defaults for specific deployment targets. They use `defineImage()` from core.
- **`@dexto/image-local`**: Local development image with filesystem/process tools, SQLite storage.
- **`@dexto/image-bundler`**: Build tool for bundling images (`dexto-bundle` CLI).
Image definition files use the convention `dexto.image.ts` and register providers (blob stores, custom tools) as side-effects when imported.
### Adding New Packages
All `@dexto/*` packages use **fixed versioning** (shared version number).
When creating a new package:
1. Add the package name to the `fixed` array in `.changeset/config.json`
2. Set its `version` in `package.json` to match other packages (check `packages/core/package.json`)
## Avoiding Duplication (repo-wide)
**Before adding any new helper/utility/service:**
1. Search the codebase first (glob/grep for similar patterns).
2. Prefer extending existing code over creating new.
3. If new code is necessary, justify why existing code doesn't work.
This applies everywhere (core, server, cli, webui). Violations will be flagged in review.
## Architecture & Design Patterns
### API / Server Layer
- Routes should be thin wrappers around core capabilities (primarily `DextoAgent` + core services).
- Keep business logic out of routes; keep route code focused on:
- request parsing/validation
- calling core
- mapping errors + returning responses
- `DextoAgent` class should also not have too much business logic; should call helper methods within services it owns.
### Service Initialization
- **Config file is source of truth**: Agent YAML files in `agents/` directory (e.g., `agents/coding-agent/coding-agent.yml`).
- **Override pattern for advanced use**: use `InitializeServicesOptions` only for top-level services (avoid wiring every internal dependency).
- **CLI Config Enrichment**: CLI adds per-agent paths (logs, database, blobs) via `enrichAgentConfig()` before agent initialization.
- Source: `packages/agent-management/src/config/config-enrichment.ts`
### Execution Context Detection
Dexto infers its execution environment to enable context-aware defaults and path resolution. Use these utilities when behavior should differ based on how dexto is running.
**Context types:**
- `dexto-source`: Running within the dexto monorepo itself (development)
- `dexto-project`: Running in a project that has dexto as a dependency
- `global-cli`: Running as globally installed CLI or in a non-dexto project
**Key files:**
- `packages/core/src/utils/execution-context.ts` - Context detection
- `packages/core/src/utils/path.ts` - Context-aware path resolution
- `packages/cli/src/cli/utils/api-key-setup.ts` - Context-aware setup UX
## Zod / Schema Design
- Always use `.strict()` for configuration objects (reject typos/unknown fields).
- Prefer `discriminatedUnion` over `union` for clearer errors.
- Describe fields with `.describe()` where it improves usability.
- Prefer sensible defaults via `.default()`.
- Use `superRefine` for cross-field validation.
Type extraction conventions (repo rule):
- Use `z.input<typeof Schema>` for raw/unvalidated input types.
- Use `z.output<typeof Schema>` for validated/output types.
- Do not use `z.infer` (lint-restricted).
## Result Pattern & Validation Boundary
### Core Principles
- **`DextoAgent` is the validation boundary**: public-facing methods validate inputs; internal layers can assume validated inputs.
- Internal validation helpers should return Result-style objects; public methods throw typed errors.
### Result Helpers
Use standardized helpers from: `packages/core/src/utils/result.ts`
- `ok(data, issues?)`
- `fail(issues)`
- `hasErrors(issues)`
- `splitIssues(issues)`
- `zodToIssues(zodError)`
## Error Handling
### Core Error Classes
- `DextoRuntimeError`: single runtime failure (I/O, network, invariant violation)
- `DextoValidationError`: multiple validation issues
### Rules
- Avoid `throw new Error()` in `packages/core`. Prefer typed errors.
- Non-core packages may use plain `Error` when a typed error is not available.
- Use module-specific **error factory** pattern for new modules.
- Reference examples:
- `packages/core/src/config/errors.ts`
- `packages/core/src/logger/v2/errors.ts`
- `packages/core/src/storage/errors.ts`
- `packages/core/src/telemetry/errors.ts`
- **Exemption**: Build-time CLI tools and development tooling (bundlers, compilers, build scripts) are exempt from the strict `DextoRuntimeError`/`DextoValidationError` requirement. Plain `Error` is acceptable for build tool failures to align with standard build tool practices (tsc, esbuild, vite).
### Server/API error mapping
- Source of truth: `mapErrorTypeToStatus()` in `packages/server/src/hono/middleware/error.ts`
## Imports / ESM
- In `packages/core`, local relative imports must include `.js` in the TypeScript source for Node ESM output compatibility.
- Do not add `.js` to package imports (e.g. `zod`, `hono`, `@dexto/*`).
## OpenAPI Documentation
- Never directly edit `docs/static/openapi/openapi.json` (generated file).
- OpenAPI is generated from Hono route definitions in `packages/server/src/hono/routes/*.ts`.
Update process:
1. Modify route definitions / Zod schemas in `packages/server/src/hono/routes/*.ts`
2. Run `pnpm run sync-openapi-docs`
3. Verify the generated output includes your changes
## Logging
The repo contains logger v1 and logger v2 APIs (core). Prefer patterns compatible with structured logging.
- Prefer: `logger.info('Message', { contextKey: value })` (structured context as the second parameter where supported)
- Avoid: `logger.error('Failed:', err)` style extra-arg logging; it's ambiguous across logger versions/transports.
- Template literals are fine when interpolating values:
- `logger.info(\`Server running at \${url}\`)`
Colors:
- Color formatting exists (chalk-based), but treat color choice as optional and primarily CLI-facing (don't encode “must use exact color X” rules in new code unless the existing subsystem already does).
Browser safety:
- `packages/core/src/logger/logger.ts` is Node-oriented (fs/path/winston). Be careful not to import Node-only runtime modules into `packages/webui` bundles. Prefer `import type` when consuming core types from the WebUI.
## TypeScript Guidelines
- Strict null safety: handle `null` / `undefined` explicitly.
- Avoid `any` across the repo.
- Prefer `unknown` + type guards.
- If `any` is unavoidable (third-party typing gaps / boundary code), keep the usage local and justify it.
- In tests, prefer `@ts-expect-error` over `as any` when intentionally testing invalid inputs.
- Avoid introducing optional parameters unless necessary; prefer explicit overloads or separate functions if it improves call-site clarity.
## Module Organization
- Selective barrel strategy: only add `index.ts` at real public module boundaries.
- Prefer direct imports internally; avoid deep re-export chains.
- Avoid wildcard exports; prefer explicit named exports.
- Watch for mega barrels (>20 symbols or >10 files) and split if needed.
## Git / PR Standards
- Never use `git add .` or `git add -A`. Stage explicit files/paths only.
- Always inspect staged files before committing.
- Never amend commits (`git commit --amend`). Create new commits instead.
- Don't include AI-generated footers in commits/PRs.
- Keep commit messages technical and descriptive.
## Documentation Changes
- Always request user review before committing documentation changes.
- Never auto-commit documentation updates.
- Keep documentation user-focused; avoid exposing unnecessary internal complexity.
## Testing
Test types:
- Unit: `*.test.ts`
- Integration: `*.integration.test.ts`
Test location: Co-locate tests with source files (e.g., `foo.ts``foo.test.ts` in same directory).
Common commands:
- `pnpm test`
- `pnpm run test:unit`
- `pnpm run test:integ`
When fixing bugs, add regression coverage where feasible.
## Maintaining This File
Keep `AGENTS.md` updated when:
- Adding a new package: add a brief description under the appropriate Stack Rules section
- Architecture boundaries change (server/webui/cli)
- Repo-wide conventions change (lint/type patterns, errors, OpenAPI generation)
- File paths referenced here move

1
dexto/CLAUDE.md Symbolic link
View File

@@ -0,0 +1 @@
AGENTS.md

128
dexto/CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
founders@trytruffle.ai .
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

525
dexto/CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,525 @@
# Contributing to Dexto
We welcome contributions! This guide will help you get started with contributing to the Dexto project.
## Table of Contents
- [Getting Started](#getting-started)
- [Contributing MCPs and Example Agents](#contributing-mcps-and-example-agents)
- [Development Setup](#development-setup)
- [Making Changes](#making-changes)
- [Submitting a Pull Request](#submitting-a-pull-request)
- [Code Standards](#code-standards)
- [Commit Guidelines](#commit-guidelines)
- [Changesets](#changesets)
## Getting Started
Before contributing, please:
1. Read our [Code of Conduct](./CODE_OF_CONDUCT.md)
2. Check existing [issues](https://github.com/truffle-ai/dexto/issues) and [pull requests](https://github.com/truffle-ai/dexto/pulls)
3. Open an issue for discussion on larger changes or enhancements
## Contributing MCPs and Example Agents
We especially encourage contributions that expand Dexto's ecosystem! Here are three ways you can contribute:
### 1. Adding New MCPs to the WebUI Registry
Help other users discover and use new MCP servers by adding them to our built-in registry.
**How to add an MCP to the registry:**
1. Edit `src/app/webui/lib/server-registry-data.json`
2. Add a new entry following this structure:
```json
{
"id": "unique-server-id",
"name": "Display Name",
"description": "Brief description of what this server does",
"category": "productivity|research|creative|development|data|communication",
"icon": "📁",
"config": {
"type": "stdio|http|sse",
"command": "npx|uvx|python",
"args": ["-y", "package-name"],
"env": {
"API_KEY": ""
},
"timeout": 30000
},
"tags": ["tag1", "tag2"],
"isOfficial": false,
"isInstalled": false,
"requirements": {
"platform": "all|windows|mac|linux",
"node": ">=20.0.0",
"python": ">=3.10"
},
"author": "Your Name",
"homepage": "https://github.com/your-repo",
"matchIds": ["server-id"]
}
```
**Categories:**
- `productivity` - File operations, task management, workflow tools
- `research` - Search, data analysis, information gathering
- `creative` - Image editing, music creation, content generation
- `development` - Code analysis, debugging, development tools
- `data` - Data processing, analytics, databases
- `communication` - Email, messaging, collaboration tools
**Configuration Types:**
- **Stdio (Node.js)**: `{"type": "stdio", "command": "npx", "args": ["-y", "package-name"]}`
- **Stdio (Python)**: `{"type": "stdio", "command": "uvx", "args": ["package-name"]}`
- **HTTP**: `{"type": "http", "baseUrl": "https://api.example.com/mcp"}`
- **SSE**: `{"type": "sse", "url": "https://api.example.com/mcp-sse"}`
### 2. Creating Example Agents
Showcase how to use MCPs by creating example agents in the `agents/` directory.
**How to create an example agent:**
1. Create a new directory: `agents/your-agent-name/`
2. Add a `your-agent-name.yml` configuration file
3. Include a `README.md` with setup instructions and usage examples
4. Follow the existing agent structure (see `agents/examples/` for reference)
**Example agent structure:**
```
agents/your-agent-name/
├── your-agent-name.yml # Main configuration
├── README.md # Setup and usage guide
└── data/ # Optional: sample data
└── example.json
```
**Configuration template:**
```yaml
# Your Agent Name
# Brief description of what this agent does
systemPrompt: |
You are a [Agent Name] specialized in [purpose]. You have access to [MCP servers] that allow you to:
## Your Capabilities
- [List key capabilities]
- [More capabilities]
## How You Should Behave
- [Behavior guidelines]
- [Usage examples]
mcpServers:
your-mcp:
type: stdio
command: npx
args:
- -y
- "package-name"
env:
API_KEY: $YOUR_API_KEY
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
storage:
cache:
type: in-memory
database:
type: sqlite
path: .dexto/database/your-agent.db
```
**README template:**
```markdown
# Your Agent Name
Brief description of what this agent does and why it's useful.
## Features
- Feature 1
- Feature 2
## Setup
1. Install dependencies: `npm install`
2. Set environment variables: `export YOUR_API_KEY=your-key`
3. Run the agent: `dexto --agent your-agent-name.yml`
## Usage Examples
- "Example command 1"
- "Example command 2"
## Requirements
- Node.js >= 20.0.0
- Your API key
```
### 3. Adding Agents to the Official Registry
Once you've created a comprehensive example agent, you can add it to the official agent registry so users can discover and install it with `dexto install`.
**How to add an agent to the registry:**
1. Create your agent in `agents/your-agent-name/` (following step 2 above)
2. Edit `agents/agent-registry.json` and add your agent entry
3. Edit `packages/cli/scripts/copy-agents.ts` and add your agent to the `AGENTS_TO_COPY` array
4. Test the build to ensure your agent is properly copied
5. Open a pull request with:
- Link to your agent directory
- Description of the agent's purpose and value
- Screenshots or demos if applicable
- Evidence of testing and documentation
**Registry Entry Structure (`agents/agent-registry.json`):**
```json
{
"your-agent-id": {
"id": "your-agent-id",
"name": "Your Agent Name",
"description": "Brief description of what this agent does and its key capabilities",
"author": "Your Name or Organization",
"tags": ["category", "use-case", "technology"],
"source": "your-agent-name/",
"main": "your-agent-name.yml"
}
}
```
**Field Guidelines:**
- **id**: Lowercase, hyphenated identifier (e.g., `database-agent`, `podcast-agent`)
- **name**: Human-readable display name (e.g., `Database Agent`, `Podcast Agent`)
- **description**: Clear, concise description of purpose and capabilities (1-2 sentences)
- **author**: Your name, organization, or `Truffle AI` for official agents
- **tags**: 3-6 relevant tags for categorization and search:
- **Category tags**: `database`, `images`, `video`, `audio`, `coding`, `documents`, etc.
- **Technology tags**: `gemini`, `openai`, `anthropic`, `mcp`, etc.
- **Use case tags**: `creation`, `analysis`, `editing`, `generation`, `support`, etc.
- **source**: Directory path relative to `agents/` folder (ends with `/` for directories)
- **main**: Main configuration file name (e.g., `agent.yml`, `your-agent-name.yml`)
**Tag Examples:**
```json
// Content creation agent
"tags": ["images", "generation", "editing", "ai", "gemini"]
// Development agent
"tags": ["coding", "development", "software", "programming"]
// Data analysis agent
"tags": ["database", "sql", "data", "queries", "analysis"]
// Multi-modal agent
"tags": ["audio", "tts", "speech", "multi-speaker", "gemini"]
```
**Complete Example:**
```json
{
"music-agent": {
"id": "music-agent",
"name": "Music Agent",
"description": "AI agent for music creation and audio processing",
"author": "Truffle AI",
"tags": ["music", "audio", "creation", "sound"],
"source": "music-agent/",
"main": "music-agent.yml"
}
}
```
**Single-File vs Directory Agents:**
- **Directory agent** (with multiple files):
```json
{
"source": "your-agent-name/",
"main": "agent.yml"
}
```
- **Single-file agent** (all in one YAML):
```json
{
"source": "your-agent.yml"
}
```
Note: `main` field is omitted for single-file agents.
**Build Script Configuration (`packages/cli/scripts/copy-agents.ts`):**
Add your agent to the `AGENTS_TO_COPY` array:
```typescript
const AGENTS_TO_COPY = [
// Core files
'agent-registry.json',
'agent-template.yml',
// Agent directories
'coding-agent/',
'database-agent/',
'your-agent-name/', // Add your agent here
// ... other agents
];
```
**Important Notes:**
- Directory agents should end with `/` (e.g., `'your-agent-name/'`)
- Single-file agents should NOT have a trailing slash (e.g., `'your-agent.yml'`)
- The script copies agents to `packages/cli/dist/agents/` during build
- Run `pnpm run build` to test that your agent is properly copied
**Criteria for registry acceptance:**
- Solves a common, well-defined problem
- Has clear documentation and examples
- Works reliably across different environments
- Provides significant value to the Dexto community
- Follows all coding standards and best practices
- Demonstrates unique capabilities or fills a gap
### Documentation
- Update relevant documentation in `/docs` folder
- Include clear examples in your contributions
- Follow the existing documentation structure
*Tip:* Check out existing examples in `agents/examples/` and `agents/database-agent/` for inspiration!
## Development Setup
### Prerequisites
- Node.js >= 20.0.0
- Git
### Fork and Clone
1. Fork the repository to your GitHub account
2. Clone your fork:
```bash
git clone https://github.com/your-username/dexto.git
cd dexto
```
3. Add upstream remote:
```bash
git remote add upstream https://github.com/truffle-ai/dexto.git
```
### Install Dependencies
```bash
# Enable Corepack (built into Node.js 16+)
corepack enable
# Install dependencies (uses correct pnpm version automatically)
pnpm install
# Build all packages
pnpm run build
```
**Note**: Corepack ensures everyone uses the same pnpm version (10.12.4) as specified in package.json.
### Development Workflow
For detailed development workflows, see [DEVELOPMENT.md](./DEVELOPMENT.md). Quick start:
```bash
# Run development server with hot reload
pnpm run dev
# Or create a global symlink for CLI development
pnpm run link-cli
```
## Making Changes
### Create a Feature Branch
```bash
# Update your fork
git checkout main
git pull upstream main
# Create a new branch
git checkout -b feature/your-branch-name
```
### Monorepo Structure
Dexto is a monorepo with three main packages:
- `packages/core` - Core business logic (@dexto/core)
- `packages/cli` - CLI application (dexto)
- `packages/webui` - Web interface (@dexto/webui)
Make changes in the appropriate package(s).
### Code Quality Checks
Before committing, ensure your code passes all checks:
```bash
# Type checking
pnpm run typecheck
# Run tests
pnpm run test
# Fix linting issues
pnpm run lint:fix
# Format code
pnpm run format
# Full validation (recommended before commits)
pnpm run build:check
```
## Submitting a Pull Request
### 1. Create a Changeset
For any changes that affect functionality:
```bash
pnpm changeset
```
Follow the prompts to:
- Select affected packages
- Choose version bump type (patch/minor/major)
- Describe your changes
This creates a file in `.changeset/` that must be committed with your PR.
### 2. Commit Your Changes
```bash
# Stage your changes
git add .
# Commit with a descriptive message
git commit -m "feat(core): add new validation helper"
```
## Commit Guidelines
#### Commit Message Format
We follow [Conventional Commits](https://www.conventionalcommits.org/):
```
type(scope): subject
body (optional)
footer (optional)
```
Types:
- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation changes
- `style`: Code style changes (formatting, semicolons, etc.)
- `refactor`: Code refactoring
- `perf`: Performance improvements
- `test`: Test additions or fixes
- `chore`: Build process or auxiliary tool changes
Examples:
```bash
feat(cli): add new agent command
fix(core): resolve memory leak in storage manager
docs: update installation instructions
```
### 3. Push and Create PR
```bash
# Push your branch
git push origin feature/your-branch-name
```
Then create a Pull Request on GitHub with:
- Clear title following commit message format
- Description of changes and motivation
- Link to related issue (if applicable)
- Screenshots (for UI changes)
### PR Requirements
Your PR must:
- ✅ Include a changeset (for functional changes)
- ✅ Pass all CI checks
- ✅ Have no merge conflicts
- ✅ Follow code standards
- ✅ Include tests for new functionality
## Code Standards
### TypeScript
- Use strict TypeScript settings
- Avoid `any` types
- Handle null/undefined cases explicitly
- Add JSDoc comments for public APIs
### Error Handling
- Use typed error classes from `packages/core/src/errors/`
- Never use plain `Error` or `throw new Error()`
- Include error context and helpful messages
### Testing
- Unit tests: `*.test.ts`
- Integration tests: `*.integration.test.ts`
- Aim for high coverage of business logic
- Test error cases and edge conditions
### Documentation
- Update relevant documentation with your changes
- Add inline comments for complex logic
- Update README if adding new features
## Changesets
We use [Changesets](https://github.com/changesets/changesets) to manage versions and changelogs.
### When to Add a Changeset
Add a changeset when you:
- Add a new feature
- Fix a bug
- Make breaking changes
- Change public APIs
### When NOT to Add a Changeset
Don't add a changeset for:
- Documentation updates (unless API docs)
- Internal refactoring with no external impact
- Test additions
- Development tooling changes
### Version Bumps
- **Patch** (0.0.X): Bug fixes, minor improvements
- **Minor** (0.X.0): New features, backward compatible
- **Major** (X.0.0): Breaking changes
## Questions?
- Check [DEVELOPMENT.md](./DEVELOPMENT.md) for development workflows
- Open an issue for bugs or feature requests
- Join our Discord community for discussions
- Review existing PRs for examples
Thank you for contributing to Dexto! 🚀
*Tip:* Open an issue first for discussion on larger enhancements or proposals.

337
dexto/DEVELOPMENT.md Normal file
View File

@@ -0,0 +1,337 @@
# Development Guide
This guide covers development workflows for working on the Dexto codebase.
## Table of Contents
- [Project Structure](#project-structure)
- [Development Setup](#development-setup)
- [Development Workflows](#development-workflows)
- [Build Commands](#build-commands)
- [Testing](#testing)
- [Code Quality](#code-quality)
- [Publishing](#publishing)
## Project Structure
Dexto is a monorepo using pnpm workspaces with the following structure:
```
dexto/
├── packages/
│ ├── core/ # @dexto/core - Core business logic
│ ├── cli/ # dexto - CLI application
│ └── webui/ # @dexto/webui - Next.js web interface
├── scripts/ # Build and development scripts
├── agents/ # Agent configurations
└── docs/ # Documentation
```
### Package Dependencies
- `dexto` (CLI) depends on `@dexto/core`
- `@dexto/webui` is embedded into CLI at build time
- All packages version together (fixed versioning)
## Development Setup
### Prerequisites
- Node.js >= 20.0.0
- pnpm (automatically managed via Corepack)
### Initial Setup
```bash
# Clone the repository
git clone https://github.com/truffle-ai/dexto.git
cd dexto
# Enable Corepack (if not already enabled) - this picks pnpm version
corepack enable
# Install dependencies (Corepack will use the correct pnpm version)
pnpm install
# Build all packages
pnpm run build
```
## Development Workflows
### 1. Hot Reload Development (Recommended)
Best for frontend development with automatic reload:
```bash
pnpm run dev
```
This command:
- Builds core and CLI packages
- Runs API server on port 3001 (from built dist)
- Runs WebUI dev server on port 3000 (with hot reload)
- Prefixes output with `[API]` and `[UI]` for clarity
- **Automatically sets `DEXTO_DEV_MODE=true`** to use repository agent configs
Access:
- API: http://localhost:3001
- WebUI: http://localhost:3000
### 2. Symlink Development
Best for CLI development with instant changes:
```bash
# Create global symlink (full build with WebUI)
pnpm run link-cli
# Create global symlink (fast, no WebUI)
pnpm run link-cli-fast
# Remove symlink
pnpm run unlink-cli
```
Now `dexto` command uses your local development code directly.
### 3. Production-like Testing
Test the actual installation experience:
```bash
# Install globally from local build (full)
pnpm run install-cli
# Install globally from local build (fast, no WebUI)
pnpm run install-cli-fast
```
This creates tarballs and installs them globally, simulating `npm install -g dexto`.
### Switching Between Workflows
The `link-cli` and `install-cli` commands are mutually exclusive:
- Running `link-cli` removes any npm installation
- Running `install-cli` removes any pnpm symlink
- Use `unlink-cli` to remove everything
## Build Commands
### Complete Builds
```bash
# Full build with cleaning
pnpm run build
# Build all packages without cleaning
pnpm run build:all
# Build with type checking
pnpm run build:check
```
### Package-Specific Builds
```bash
# Build individual packages
pnpm run build:core
pnpm run build:cli
pnpm run build:webui
# Build CLI and its dependencies only (no WebUI)
pnpm run build:cli-only
```
### WebUI Embedding
The WebUI is embedded into the CLI's dist folder during build:
```bash
# Embed WebUI into CLI dist (run after building WebUI)
pnpm run embed-webui
```
## Testing
### Automated Tests
```bash
# Run all tests
pnpm test
# Run unit tests only
pnpm run test:unit
# Run integration tests only
pnpm run test:integ
# Run tests with coverage
pnpm run test:ci
```
### Manual testing
1. Common commands
```bash
cd ~
dexto --help
dexto "what is the current time"
dexto "list files in current directory"
# Test other model override in CLI
dexto -m gpt-5-mini "what is the current date"
# Test web mode
dexto
# Test discord bot mode (requires additional setup)
dexto --mode discord
# Test telegram bot mode (requires additional setup)
dexto --mode telegram
```
2. Execution contexts
Dexto CLI operates differently based on the directory you are running in.
- source context -> when Dexto CLI is run in the source repository
- global context -> when Dexto CLI is run outside the source repository
- project context -> when Dexto CLI is run in a project that consumes @dexto dependencies
Based on execution context, Dexto CLI will use defaults for log path, default agent/agent registry.
Run the CLI in different places and see the console logs to understand this.
Test above commands in different execution contexts for manual testing coverage.
**Developer Mode Environment Variable:**
When running `dexto` from within this repository, it normally uses your `dexto setup` preferences and global `~/.dexto` directory. To force isolated testing with repository files:
```bash
export DEXTO_DEV_MODE=true # Use repo configs and local .dexto directory
```
**DEXTO_DEV_MODE Behavior:**
- **Agent Config**: Uses `agents/coding-agent/coding-agent.yml` from repo (instead of `~/.dexto/agents/`)
- **Logs/Database**: Uses `repo/.dexto/` (instead of `~/.dexto/`)
- **Preferences**: Skips global setup validation
- **Use Case**: Isolated testing and development on Dexto itself
**Note**: `pnpm run dev` automatically sets `DEXTO_DEV_MODE=true`, so the development server always uses repository configs and local storage.
## Code Quality
### Type Checking
```bash
# Type check all packages
pnpm run typecheck
# Type check with file watching
pnpm run typecheck:watch
# Type check specific package
pnpm run typecheck:core
```
### Linting
```bash
# Run linter
pnpm run lint
# Fix linting issues
pnpm run lint:fix
```
### Pre-commit Checks
Before committing, always run:
```bash
pnpm run build:check # Typecheck + build
pnpm test # Run tests
pnpm run lint # Check linting
```
## Publishing
### Changeset Workflow
We use [Changesets](https://github.com/changesets/changesets) for version management:
1. **Create a changeset** for your changes:
```bash
pnpm changeset
```
2. **Select packages** affected by your change
3. **Choose version bump** (patch/minor/major)
4. **Write summary** of your changes
### Version Strategy
- **Fixed versioning**: All packages version together
- `@dexto/core` and `dexto` always have the same version
- `@dexto/webui` is private and not published
### Publishing Process
Publishing is automated via GitHub Actions:
1. Merge PR with changeset
2. Bot creates "Version Packages" PR
3. Merge version PR to trigger npm publish
## Common Tasks
### Clean Everything
```bash
# Clean all build artifacts and caches
pnpm run clean
# Clean storage only
pnpm run clean:storage
```
### Start Production Server
```bash
# Start the CLI (requires build first)
pnpm start
```
### Working with Turbo
Turbo commands run tasks across all packages:
```bash
pnpm run repo:build # Build all packages with Turbo
pnpm run repo:test # Test all packages with Turbo
pnpm run repo:lint # Lint all packages with Turbo
pnpm run repo:typecheck # Typecheck all packages with Turbo
```
## Troubleshooting
### Native Dependencies
If you see errors about missing bindings (e.g., better-sqlite3):
```bash
# Reinstall dependencies
pnpm install
# If that doesn't work, clean and reinstall
pnpm run clean
pnpm install
```
### Port Conflicts
Default ports:
- API/Server: 3001
- WebUI Dev: 3000
Set environment variables to use different ports:
```bash
PORT=4000 API_PORT=4001 pnpm run dev
```
### Global Command Not Found
If `dexto` command is not found after linking:
```bash
# Check global installations
pnpm list -g
npm list -g dexto --depth=0
# Verify PATH includes pnpm/npm global bin
echo $PATH
```
## Questions?
- Check [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution guidelines
- Open an issue for bugs or feature requests
- Join our Discord for development discussions

86
dexto/Dockerfile Normal file
View File

@@ -0,0 +1,86 @@
################################################################################
# Build stage - includes dev dependencies
ARG NODE_VERSION=20.18.1
################################################################################
# Build stage - pnpm workspace build and prune
FROM node:${NODE_VERSION}-alpine AS builder
# Install build dependencies for native modules
RUN apk add --no-cache \
python3 \
make \
g++ \
&& rm -rf /var/cache/apk/*
WORKDIR /app
# Install a pinned pnpm globally (avoid Corepack signature issues in containers)
ARG PNPM_VERSION=10.12.4
RUN npm i -g pnpm@${PNPM_VERSION}
# Copy workspace manifests for better layer caching
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages/cli/package.json packages/cli/package.json
COPY packages/core/package.json packages/core/package.json
COPY packages/webui/package.json packages/webui/package.json
# Install workspace dependencies (with lockfile)
RUN pnpm install --frozen-lockfile
# Copy sources and build all packages (embeds WebUI into CLI dist)
COPY . .
RUN pnpm -w build
# Prune to production dependencies
# Prune to production dependencies at the workspace root
# (keeps per-package node_modules; smaller image without dev deps)
RUN pnpm prune --prod
################################################################################
# Production stage - minimal Alpine with Chromium
FROM node:${NODE_VERSION}-alpine AS production
# Install Chromium runtime
RUN apk add --no-cache \
chromium \
&& rm -rf /var/cache/apk/* /tmp/*
WORKDIR /app
# Create non-root user and data dir
RUN addgroup -g 1001 -S dexto && adduser -S dexto -u 1001 \
&& mkdir -p /app/.dexto/database && chown -R dexto:dexto /app/.dexto
# Copy only what we need for runtime
COPY --from=builder --chown=dexto:dexto /app/node_modules ./node_modules
COPY --from=builder --chown=dexto:dexto /app/packages/cli/node_modules ./packages/cli/node_modules
COPY --from=builder --chown=dexto:dexto /app/packages/cli/dist ./packages/cli/dist
COPY --from=builder --chown=dexto:dexto /app/packages/cli/package.json ./packages/cli/package.json
# Copy core workspace package since pnpm links it via node_modules
COPY --from=builder --chown=dexto:dexto /app/packages/core/package.json ./packages/core/package.json
COPY --from=builder --chown=dexto:dexto /app/packages/core/dist ./packages/core/dist
COPY --from=builder --chown=dexto:dexto /app/packages/core/node_modules ./packages/core/node_modules
COPY --from=builder --chown=dexto:dexto /app/agents ./agents
COPY --from=builder --chown=dexto:dexto /app/package.json ./
# Environment
ENV NODE_ENV=production \
PORT=3001 \
API_PORT=3001 \
CONFIG_FILE=/app/agents/coding-agent/coding-agent.yml \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
# Run as non-root
USER dexto
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node -e "const http=require('http');const port=process.env.API_PORT||process.env.PORT||3001;const req=http.request({host:'localhost',port,path:'/health'},res=>process.exit(res.statusCode===200?0:1));req.on('error',()=>process.exit(1));req.end();"
# Fixed port for metadata (runtime can override via -e API_PORT)
EXPOSE 3001
# Server mode: REST APIs + SSE streaming on single port (no Web UI)
CMD ["sh", "-c", "node packages/cli/dist/index.js --mode server --agent $CONFIG_FILE"]

1
dexto/GEMINI.md Symbolic link
View File

@@ -0,0 +1 @@
AGENTS.md

44
dexto/LICENSE Normal file
View File

@@ -0,0 +1,44 @@
Elastic License 2.0 (ELv2)
**Acceptance**
By using the software, you agree to all of the terms and conditions below.
**Copyright License**
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
**Limitations**
You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensors trademarks is subject to applicable law.
**Patents**
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
**Notices**
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
**No Other Rights**
These terms do not imply any licenses other than those expressly granted in these terms.
**Termination**
If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
**No Liability**
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
**Definitions**
The _licensor_ is the entity offering these terms, and the _software_ is the software the licensor makes available under these terms, including any portion of it.
_you_ refers to the individual or entity agreeing to these terms.
_your company_ is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. _control_ means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
_your licenses_ are all the licenses granted to you for the software under these terms.
_use_ means anything you do with the software requiring one of your licenses.
_trademark_ means trademarks, service marks, and similar rights.

104
dexto/README.Docker.md Normal file
View File

@@ -0,0 +1,104 @@
# Running Dexto with Docker
This image runs the Dexto CLI in server mode (API + SSE streaming). It uses pnpm workspaces and builds from the current repo (no published packages required).
## Build the image
```bash
docker build -t dexto:local .
```
## Provide configuration and API keys
Create a `.env` file with your keys (see `README.md`):
```ini
OPENAI_API_KEY=...
# add other provider keys as needed
```
The coding agent config is baked into the image at `/app/agents/coding-agent/coding-agent.yml`. You can mount your own agents folder if desired.
## Run: API server only (default)
```bash
docker run --rm \
--env-file .env \
-e API_PORT=3001 \
-p 3001:3001 \
dexto:local
```
What it does:
- Starts REST + SSE streaming server on `API_PORT` (default 3001)
- Uses Chromium inside the image for Puppeteer tools
- Stores runtime data under `/app/.dexto` (incontainer)
Endpoints:
- API base: `http://localhost:3001/api/`
- Health: `http://localhost:3001/health`
- MCP servers: `http://localhost:3001/api/mcp/servers`
Persist data between runs (recommended):
```bash
docker run --rm \
--env-file .env \
-e API_PORT=3001 \
-p 3001:3001 \
-v dexto_data:/app/.dexto \
dexto:local
```
Use a custom agent config:
```bash
docker run --rm \
--env-file .env \
-e API_PORT=3001 \
-e CONFIG_FILE=/app/agents/my-agent.yml \
-v $(pwd)/agents:/app/agents:ro \
-p 3001:3001 \
dexto:local
```
## Run with WebUI (optional)
The image embeds the built WebUI. To run the WebUI alongside the API, start the CLI in `web` mode. This requires two ports (frontend and API):
```bash
docker run --rm \
--env-file .env \
-e FRONTEND_PORT=3000 \
-e API_PORT=3001 \
-p 3000:3000 -p 3001:3001 \
dexto:local \
sh -c "node packages/cli/dist/index.js --mode web --agent $CONFIG_FILE"
```
Open the WebUI: `http://localhost:3000` (the UI calls the API on `http://localhost:3001`).
## Docker Compose (example)
```yaml
services:
dexto:
image: dexto:local
build: .
environment:
API_PORT: 3001
ports:
- "3001:3001"
volumes:
- dexto_data:/app/.dexto
- ./agents:/app/agents:ro
env_file: .env
volumes:
dexto_data: {}
```
## Notes
- Healthcheck uses `API_PORT` (falls back to `PORT` or 3001).
- The container runs as a nonroot user (`dexto`).
- The image builds from your repo code; no published `@dexto/core` is required.

672
dexto/README.md Normal file
View File

@@ -0,0 +1,672 @@
<a href="https://dexto.ai">
<div align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset=".github/assets/dexto_logo_light.svg">
<source media="(prefers-color-scheme: dark)" srcset=".github/assets/dexto_logo_dark.svg">
<img alt="Dexto" src=".github/assets/dexto_logo_dark.svg" width="55%" style="max-width: 1000px; padding: 48px 8px;">
</picture>
</div>
</a>
<p align="center">
<img src="https://img.shields.io/badge/Status-Beta-yellow">
<img src="https://img.shields.io/badge/License-Elastic%202.0-blue.svg">
<a href="https://discord.gg/GFzWFAAZcm"><img src="https://img.shields.io/badge/Discord-Join%20Chat-7289da?logo=discord&logoColor=white"></a>
<a href="https://deepwiki.com/truffle-ai/dexto"><img src="https://deepwiki.com/badge.svg"></a>
</p>
<!-- Keep these links. Translations will automatically update with the README. -->
<p align="center">
<a href="https://zdoc.app/de/truffle-ai/dexto">Deutsch</a> |
<a href="https://zdoc.app/en/truffle-ai/dexto">English</a> |
<a href="https://zdoc.app/es/truffle-ai/dexto">Español</a> |
<a href="https://zdoc.app/fr/truffle-ai/dexto">français</a> |
<a href="https://zdoc.app/ja/truffle-ai/dexto">日本語</a> |
<a href="https://zdoc.app/ko/truffle-ai/dexto">한국어</a> |
<a href="https://zdoc.app/pt/truffle-ai/dexto">Português</a> |
<a href="https://zdoc.app/ru/truffle-ai/dexto">Русский</a> |
<a href="https://zdoc.app/zh/truffle-ai/dexto">中文</a>
</p>
<p align="center"><b>An open agent harness for AI applications—ships with a powerful coding agent.</b></p>
<div align="center">
<img src=".github/assets/dexto_title.gif" alt="Dexto Demo" width="600" />
</div>
---
## What is Dexto?
Dexto is an **agent harness**—the orchestration layer that turns LLMs into reliable, stateful agents that can take actions, remember context, and recover from errors.
Think of it like an operating system for AI agents:
| Component | Analogy | Role |
|-----------|---------|------|
| **LLM** | CPU | Raw processing power |
| **Context Window** | RAM | Working memory |
| **Dexto** | Operating System | Orchestration, state, tools, recovery |
| **Your Agent** | Application | Domain-specific logic and clients |
### Why Dexto?
- **Configuration-driven**: Define agents in YAML. Swap models and tools without touching code.
- **Batteries included**: Session management, tool orchestration, memory, multimodal support, and observability—out of the box.
- **Run anywhere**: Local, cloud, or hybrid. CLI, Web UI, REST API, Discord, Telegram, or embedded in your app.
### What You Can Build
- **Coding Agents** Build, debug, and refactor code autonomously
- **Autonomous Agents** Plan, execute, and adapt to user goals
- **Digital Companions** Assistants that remember context and anticipate needs
- **MCP Clients & Servers** Connect tools, files, APIs via Model Context Protocol
- **Multi-Agent Systems** Agents that collaborate, delegate, and solve complex tasks together
---
## Coding Agent
Dexto ships with a **production-ready coding agent** you can use immediately via the CLI or Web UI.
```bash
# Launch the coding agent (default)
dexto
# Or explicitly
dexto --agent coding-agent
```
**What it can do:**
- Build new apps from scratch
- Read, write, and refactor code across your entire codebase
- Execute shell commands and run tests
- Spawn specialized sub-agents for exploration and planning
- Remember context across sessions with persistent memory
- Work with any of 50+ LLMs (swap models mid-conversation)
**Ready-to-use interfaces:**
- **Web UI** Chat interface with file uploads, syntax highlighting, and MCP tool browser
- **CLI** Terminal-native with `/commands`, streaming output, and session management
The coding agent is just one example of what you can build. Create your own agents by defining a YAML config—same architecture, your domain.
---
## Quick Start
### Install
```bash
# Install globally via npm
npm install -g dexto
# Or build from source
git clone https://github.com/truffle-ai/dexto.git
cd dexto && pnpm install && pnpm install-cli
```
### Run
```bash
# Start Dexto (launches setup wizard on first run)
dexto
```
**More options:**
```bash
dexto --mode cli # Terminal mode
dexto -p "create a landing page for a coffee shop" # One-shot task
dexto --auto-approve "refactor this codebase" # Skip confirmations
dexto -m claude-sonnet-4-5-20250929 # Switch models
dexto --help # Explore all options
```
**Inside the interactive CLI**, type `/` to explore commands—switch models, manage sessions, configure tools, and more.
### Manage Settings
```bash
# Configure defaults like LLM provider/model, API keys, or download local models
dexto setup
```
Logs are stored in `~/.dexto/logs/`. Use `DEXTO_LOG_LEVEL=debug` for verbose output.
---
## Core Features
### 50+ LLMs, Instant Switching
Switch models mid-conversation—no code changes, no restarts.
| Provider | Models |
|----------|--------|
| **OpenAI** | gpt-5.2, gpt-5.2-pro, gpt-5.2-codex, o4-mini |
| **Anthropic** | Claude Sonnet, Opus, Haiku (with extended thinking) |
| **Google** | Gemini 3 Pro, 2.5 Pro/Flash |
| **Groq** | Llama 4, Qwen, DeepSeek |
| **xAI** | Grok 4, Grok 3 |
| **Local** | Ollama, GGUF via node-llama-cpp (Llama, Qwen, Mistral, etc.) |
| **+ Gateways** | OpenRouter, AWS Bedrock, Vertex AI, LiteLLM |
**Run locally for privacy**: Local models keep data on your machine with automatic GPU detection (Metal, CUDA, Vulkan).
### MCP Integration (30+ Tools)
Connect to Model Context Protocol servers—Puppeteer, Linear, ElevenLabs, Firecrawl, Sora, and more.
```yaml
# agents/my-agent.yml
mcpServers:
filesystem:
type: stdio
command: npx
args: ['-y', '@modelcontextprotocol/server-filesystem', '.']
browser:
type: stdio
command: npx
args: ['-y', '@anthropics/mcp-server-puppeteer']
```
Browse and add servers from the MCP Store in the Web UI or via `/mcp` commands in the CLI.
### Human-in-the-Loop Controls
Fine-grained control over what your agent can do:
```yaml
toolConfirmation:
mode: manual # Require approval for each tool
# mode: auto-approve # Trust mode for local development
toolPolicies:
alwaysAllow:
- mcp--filesystem--read_file
- mcp--filesystem--list_directory
alwaysDeny:
- mcp--filesystem--delete_file
```
Agents remember which tools you've approved per session.
### Persistent Sessions & Memory
Conversations persist across restarts. Create memories that shape agent behavior.
```bash
# Continue last conversation
dexto -c
# Resume specific session
dexto -r session-abc123
# Search across all conversations
dexto search "database schema"
```
### Multi-Agent Systems
Agents can spawn specialized sub-agents to handle complex subtasks. The coding agent uses this to delegate exploration:
```yaml
# In your agent config
customTools:
- type: agent-spawner
allowedAgents: ["explore-agent"]
maxConcurrentAgents: 5
defaultTimeout: 300000 # 5 minutes
```
**Built-in sub-agents:**
- **explore-agent** Fast, read-only codebase exploration
Any agent in the [Agent Registry](#agent-registry) can be spawned as a sub-agent—including custom agents you create and register.
Sub-agents run ephemerally, auto-cleanup after completion, and forward tool approvals to the parent—so users see one unified approval flow.
---
## Run Modes
| Mode | Command | Use Case |
|------|---------|----------|
| **Web UI** | `dexto` | Chat interface with file uploads (default) |
| **CLI** | `dexto --mode cli` | Terminal interaction |
| **Web Server** | `dexto --mode server` | REST & SSE APIs |
| **MCP Server** | `dexto --mode mcp` | Expose agent as an MCP server over stdio |
Platform integrations: [Discord](examples/discord-bot/), [Telegram](examples/telegram-bot/)
<details>
<summary><strong>Dexto as an MCP Server</strong></summary>
**Transport: `stdio`**
Connect your Dexto agent as an MCP server in Claude Code or Cursor:
```bash
dexto --mode mcp --auto-approve --no-elicitation # Default agent
dexto --mode mcp --agent coding-agent --auto-approve --no-elicitation
npx dexto --mode mcp --agent coding-agent --auto-approve --no-elicitation
```
Example MCP config for Claude Code or Cursor:
```json
{
"command": "npx",
"args": ["-y", "dexto", "--mode", "mcp", "--agent", "coding-agent", "--auto-approve", "--no-elicitation"]
}
```
`--auto-approve` and `--no-elicitation` are required for MCP mode since it runs non-interactively.
**Transport: `http/sse`**
`dexto --mode server` exposes your agent as an MCP server at `/mcp` for remote clients:
```bash
dexto --mode server --port 3001
ngrok http 3001 # Optional: expose publicly
```
</details>
---
## Dexto Agents SDK
Build AI agents programmatically. Everything the CLI does, your code can too.
```bash
npm install @dexto/core
```
```typescript
import { DextoAgent } from '@dexto/core';
const agent = new DextoAgent({
llm: { provider: 'openai', model: 'gpt-5.2', apiKey: process.env.OPENAI_API_KEY }
});
await agent.start();
const session = await agent.createSession();
const response = await agent.generate('What is TypeScript?', session.id);
console.log(response.content);
// Streaming
for await (const event of await agent.stream('Write a story', session.id)) {
if (event.name === 'llm:chunk') process.stdout.write(event.content);
}
// Multimodal
await agent.generate([
{ type: 'text', text: 'Describe this image' },
{ type: 'image', image: base64Data, mimeType: 'image/png' }
], session.id);
// Switch models mid-conversation
await agent.switchLLM({ model: 'claude-sonnet-4-5-20250929' });
```
**Start a server programmatically:**
Start a Dexto server programmatically to expose REST and SSE streaming APIs to interact and manage your agent backend.
```typescript
import { DextoAgent } from '@dexto/core';
import { loadAgentConfig, startHonoApiServer } from 'dexto';
const config = await loadAgentConfig('./agents/my-agent.yml');
const agent = new DextoAgent(config);
const { server } = await startHonoApiServer(agent, 3001);
// POST /api/message, GET /api/sessions, etc.
```
This starts an HTTP server with full REST and SSE APIs, enabling integration with web frontends, webhooks, and other services. See the [REST API Documentation](https://docs.dexto.ai/api/rest/) for available endpoints.
<details>
<summary><strong>Advanced SDK Usage</strong></summary>
### Session Management
Create and manage multiple conversation sessions with persistent storage.
```typescript
const agent = new DextoAgent(config);
await agent.start();
// Create and manage sessions
const session = await agent.createSession('user-123');
await agent.generate('Hello, how can you help me?', session.id);
// List and manage sessions
const sessions = await agent.listSessions();
const history = await agent.getSessionHistory('user-123');
await agent.deleteSession('user-123');
// Search across conversations
const results = await agent.searchMessages('bug fix', { limit: 10 });
```
### LLM Management
Switch between models and providers dynamically.
```typescript
// Get current configuration
const currentLLM = agent.getCurrentLLMConfig();
// Switch models (provider inferred automatically)
await agent.switchLLM({ model: 'gpt-5.2' });
await agent.switchLLM({ model: 'claude-sonnet-4-5-20250929' });
// Switch model for a specific session
await agent.switchLLM({ model: 'gpt-5.2' }, 'session-123');
// Get supported providers and models
const providers = agent.getSupportedProviders();
const models = agent.getSupportedModels();
```
### MCP Manager
For advanced MCP server management, use the MCPManager directly.
```typescript
import { MCPManager } from '@dexto/core';
const manager = new MCPManager();
// Connect to MCP servers
await manager.connectServer('filesystem', {
type: 'stdio',
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-filesystem', '.']
});
// Access tools, prompts, and resources
const tools = await manager.getAllTools();
const prompts = await manager.getAllPrompts();
const resources = await manager.getAllResources();
// Execute tools
const result = await manager.executeTool('readFile', { path: './README.md' });
await manager.disconnectAll();
```
### Storage & Persistence
Configure storage backends for production.
```yaml
# agents/production-agent.yml
storage:
cache:
type: redis
url: $REDIS_URL
database:
type: postgres
connectionString: $POSTGRES_CONNECTION_STRING
sessions:
maxSessions: 1000
sessionTTL: 86400000 # 24 hours
```
**Supported Backends:**
- **Cache**: Redis, In-Memory
- **Database**: PostgreSQL, SQLite, In-Memory
See the [Storage Configuration guide](https://docs.dexto.ai/docs/guides/configuring-dexto/storage) for details.
</details>
---
## Agent Registry
Pre-built agents for common use cases:
```bash
# List available agents
dexto list-agents
# Install and run
dexto install coding-agent podcast-agent
dexto --agent coding-agent
```
**Available:** Coding, Podcast, Image Editor, Video (Sora), Database, GitHub, Triage (multi-agent), and more.
See the full [Agent Registry](https://docs.dexto.ai/docs/guides/agent-registry).
---
## Agent Configuration
Dexto treats each configuration as a unique agent allowing you to define and save combinations of LLMs, servers, storage options, etc. based on your needs for easy portability. Define agents in version-controlled YAML. Change the file, reload, and chat—state, memory, and tools update automatically.
```yaml
# agents/production-agent.yml
llm:
provider: anthropic
model: claude-sonnet-4-5-20250929
apiKey: $ANTHROPIC_API_KEY
mcpServers:
filesystem:
type: stdio
command: npx
args: ['-y', '@modelcontextprotocol/server-filesystem', '.']
systemPrompt: |
You are a helpful assistant with filesystem access.
storage:
cache:
type: redis
url: $REDIS_URL
database:
type: postgres
connectionString: $POSTGRES_CONNECTION_STRING
toolConfirmation:
mode: manual
```
### LLM Providers
Switch between providers instantly—no code changes required.
#### Built-in Providers
| Provider | Models | Setup |
|----------|--------|-------|
| **OpenAI** | `gpt-5.2`, `gpt-5.2-pro`, `gpt-5.2-codex`, `o4-mini` | API key |
| **Anthropic** | `claude-sonnet-4-5-20250929`, `claude-opus-4-5-20250929`, extended thinking | API key |
| **Google** | `gemini-3-pro`, `gemini-2.5-pro`, `gemini-2.5-flash` | API key |
| **Groq** | `llama-4-scout`, `qwen-qwq`, `deepseek-r1-distill` | API key |
| **xAI** | `grok-4`, `grok-3`, `grok-3-fast` | API key |
| **Cohere** | `command-r-plus`, `command-r` | API key |
#### Local Models (Privacy-First)
| Provider | Models | Setup |
|----------|--------|-------|
| **Ollama** | Llama, Qwen, Mistral, DeepSeek, etc. | Local install |
| **node-llama-cpp** | Any GGUF model | Bundled (auto GPU detection: Metal, CUDA, Vulkan) |
#### Cloud Platforms
| Provider | Models | Setup |
|----------|--------|-------|
| **AWS Bedrock** | Claude, Llama, Mistral | AWS credentials |
| **Google Vertex AI** | Gemini, Claude | GCP credentials |
#### Gateway Providers
| Provider | Access | Setup |
|----------|--------|-------|
| **OpenRouter** | 100+ models from multiple providers | API key |
| **LiteLLM** | Unified API for any provider | Self-hosted or API key |
| **Glama** | Multi-provider gateway | API key |
```bash
# Switch models via CLI
dexto -m claude-sonnet-4-5-20250929
dexto -m gemini-2.5-pro
dexto -m llama-4-scout
```
Switch within interactive CLI (`/model`) or Web UI without config changes.
See the [Configuration Guide](https://docs.dexto.ai/docs/category/agent-configuration-guide).
---
## Demos & Examples
| Image Editor | MCP Store | Portable Agents |
|:---:|:---:|:---:|
| <img src=".github/assets/image_editor_demo.gif" alt="Image Editor" width="280"/> | <img src=".github/assets/mcp_store_demo.gif" alt="MCP Store" width="280"/> | <img src=".github/assets/portable_agent_demo.gif" alt="Portable Agents" width="280"/> |
| Face detection & annotation using OpenCV | Browse and add MCPs | Use agents in Cursor, Claude Code via MCP|
<details>
<summary><strong>More Examples</strong></summary>
### Coding Agent
Build applications from natural language:
```bash
dexto --agent coding-agent
# "Create a snake game and open it in the browser"
```
<img src=".github/assets/coding_agent_demo.gif" alt="Coding Agent Demo" width="600"/>
### Podcast Agent
Generate multi-speaker audio content:
```bash
dexto --agent podcast-agent
```
<img src="https://github.com/user-attachments/assets/cfd59751-3daa-4ccd-97b2-1b2862c96af1" alt="Podcast Agent Demo" width="600"/>
### Multi-Agent Triage
Coordinate specialized agents:
```bash
dexto --agent triage-agent
```
<img src=".github/assets/triage_agent_demo.gif" alt="Triage Agent Demo" width="600">
### Memory System
Persistent context that shapes behavior:
<img src=".github/assets/memory_demo.gif" alt="Memory Demo" width="600">
### Dynamic Forms
Agents generate forms for structured input:
<img src=".github/assets/user_form_demo.gif" alt="User Form Demo" width="600">
### Browser Automation
<a href="https://youtu.be/C-Z0aVbl4Ik">
<img src="https://github.com/user-attachments/assets/3f5be5e2-7a55-4093-a071-8c52f1a83ba3" alt="Amazon Shopping Demo" width="600"/>
</a>
### MCP Playground
Test tools before deploying:
<img src=".github/assets/playground_demo.gif" alt="Playground Demo" width="600">
</details>
---
<details>
<summary><strong>CLI Reference</strong></summary>
```text
Usage: dexto [options] [command] [prompt...]
Basic Usage:
dexto Start web UI (default)
dexto "query" Run one-shot query
dexto --mode cli Interactive CLI
Session Management:
dexto -c Continue last conversation
dexto -r <id> Resume specific session
Options:
-a, --agent <path> Agent config file or ID
-m, --model <model> LLM model to use
--auto-approve Skip tool confirmations
--no-elicitation Disable elicitation prompts
--mode <mode> web | cli | server | mcp
--port <port> Server port
Commands:
setup Configure global preferences
install <agents...> Install agents from registry
list-agents List available agents
session list|history Manage sessions
search <query> Search conversation history
```
Full reference: `dexto --help`
</details>
---
## Documentation
- **[Quick Start](https://docs.dexto.ai/docs/getting-started/intro/)** Get running in minutes
- **[Configuration Guide](https://docs.dexto.ai/docs/category/guides/)** Agents, LLMs, tools
- **[SDK Reference](https://docs.dexto.ai/api/sdk/dexto-agent)** Programmatic usage
- **[REST API](https://docs.dexto.ai/api/rest/)** HTTP endpoints
---
## Telemetry
We collect anonymous usage data (no personal/sensitive info) to help improve Dexto. This includes:
- Commands used
- Command execution time
- Error occurrences
- System information (OS, Node version)
- LLM Models used
To opt-out:
Set env variable `DEXTO_ANALYTICS_DISABLED=1`
---
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md).
---
## Community
Built by [Truffle AI](https://www.trytruffle.ai). Join [Discord](https://discord.gg/GFzWFAAZcm) for support.
If you find Dexto useful, please give us a ⭐ on GitHub—it helps a lot!
[![Twitter Follow](https://img.shields.io/twitter/follow/Dexto?style=social)](https://x.com/intent/user?screen_name=dexto_ai)
[![Twitter Follow](https://img.shields.io/twitter/follow/Rahul?style=social)](https://x.com/intent/user?screen_name=Road_Kill11)
[![Twitter Follow](https://img.shields.io/twitter/follow/Shaunak?style=social)](https://x.com/intent/user?screen_name=shaun5k_)
---
## Contributors
[![Contributors](https://contrib.rocks/image?repo=truffle-ai/dexto)](https://github.com/truffle-ai/dexto/graphs/contributors)
---
## License
Elastic License 2.0. See [LICENSE](LICENSE).

219
dexto/VERSIONING.md Normal file
View File

@@ -0,0 +1,219 @@
# Versioning and Release Process
This document describes the versioning strategy and release process for the Dexto monorepo.
## Overview
Dexto uses a monorepo structure with multiple packages:
- `dexto` (CLI) - Main package published to npm
- `@dexto/core` - Core library published to npm
- `@dexto/webui` - Web UI (private, not published)
We use [Changesets](https://github.com/changesets/changesets) for version management and coordinated releases.
## Versioning Strategy
### Fixed Versioning
The `dexto` and `@dexto/core` packages use **fixed versioning** - they always maintain the same version number. This ensures API compatibility between the CLI and core library.
## Automated Release Process (Recommended)
### 1. Create a Changeset
When you make changes that should trigger a release:
```bash
# Create a changeset describing your changes
pnpm changeset
# Follow the interactive prompts to:
# 1. Select which packages changed
# 2. Choose the version bump type (major/minor/patch)
# 3. Write a summary of changes
```
This creates a markdown file in `.changeset/` describing the changes.
> **Why Manual Changesets?** We require manual changeset creation to ensure developers think carefully about semantic versioning and write meaningful changelog entries for users.
### 2. Commit and Push to PR
```bash
# Add the changeset file
git add .changeset/*.md
git commit -m "chore: add changeset for [your feature]"
git push origin your-branch
```
### 3. Automatic Version and Release
When your PR with changesets is merged to `main`:
1. **Version PR Creation** (`changesets-publish.yml` triggers automatically)
- Collects all pending changesets
- Creates a "Version Packages" PR with:
- Version bumps in package.json files
- Updated CHANGELOG.md files
- Consolidated changesets
2. **Review the Version PR**
- Team reviews the version bumps
- Can be merged immediately or held for batching multiple changes
3. **Automatic Publishing** (when Version PR is merged)
- `changesets-publish.yml` triggers
- Builds all packages
- Publishes to npm registry
- Creates git tags
- Removes processed changeset files
### GitHub Workflows
#### Active Release Workflows:
- **[`require-changeset.yml`](.github/workflows/require-changeset.yml)** - Ensures PRs include changesets when needed
- **[`changesets-publish.yml`](.github/workflows/changesets-publish.yml)** - Opens a version bump PR, and publishes it when we merge the version bump PR (triggers on push to main)
#### Quality Check Workflows:
- **[`build_and_test.yml`](.github/workflows/build_and_test.yml)** - Runs tests on PRs
- **[`code-quality.yml`](.github/workflows/code-quality.yml)** - Runs linting and type checking
#### Documentation Workflows:
- **[`build-docs.yml`](.github/workflows/build-docs.yml)** - Builds documentation
- **[`deploy-docs.yml`](.github/workflows/deploy-docs.yml)** - Deploys documentation site
## Manual Release Process (Emergency Only)
If automated release fails or for emergency patches:
### Prerequisites
```bash
# Ensure you're on main and up to date
git checkout main
git pull origin main
# Install dependencies
pnpm install --frozen-lockfile
# Run all quality checks
pnpm run build
pnpm run lint
pnpm run typecheck
pnpm test
```
### Option 1: Manual Changeset Release
```bash
# 1. Create changeset manually
pnpm changeset
# 2. Version packages
pnpm changeset version
# 3. Commit version changes
git add -A
git commit -m "chore: version packages"
# 4. Build all packages
pnpm run build
# 5. Publish to npm
pnpm changeset publish
# 6. Push changes and tags
git push --follow-tags
```
### Option 2: Direct Version Bump (Not Recommended)
```bash
# 1. Update versions manually in package.json files
# IMPORTANT: Keep dexto and @dexto/core versions in sync!
# Edit packages/cli/package.json
# Edit packages/core/package.json
# 2. Install to update lockfile
pnpm install
# 3. Build packages
pnpm run build
# 4. Create git tag
git add -A
git commit -m "chore: release v1.2.0"
git tag v1.2.0
# 5. Publish packages
cd packages/core && pnpm publish --access public
cd ../cli && pnpm publish --access public
# 6. Push commits and tags
git push origin main --follow-tags
```
## Testing Releases (Without Publishing)
### Dry Run Commands
```bash
# See what would be published
pnpm publish -r --dry-run --no-git-checks
# Check changeset status
pnpm changeset status
# Preview version changes
pnpm changeset version --dry-run
# Test package contents
cd packages/cli && npm pack --dry-run
cd packages/core && npm pack --dry-run
```
### Local Testing
```bash
# Link packages locally for testing
pnpm run link-cli
# Test the linked CLI
dexto --version
```
## Release Checklist
Before any release:
- [ ] All tests passing (`pnpm test`)
- [ ] No lint errors (`pnpm run lint`)
- [ ] TypeScript compiles (`pnpm run typecheck`)
- [ ] Build succeeds (`pnpm run build`)
- [ ] Changeset created (if using automated flow)
- [ ] Version numbers synchronized (dexto and @dexto/core)
## Common Issues
### Issue: Versions out of sync
**Solution**: Ensure `dexto` and `@dexto/core` have the same version in their package.json files.
### Issue: Publish fails with "Package not found"
**Solution**: Run `pnpm run build` before publishing to ensure dist folders exist.
### Issue: Git working directory not clean
**Solution**: Commit or stash all changes before publishing. Use `--no-git-checks` flag for testing only.
### Issue: Authentication error when publishing
**Solution**: CI uses `NPM_TOKEN` secret (granular access token). Ensure the token is valid and has publish permissions for `@dexto` scope. For local publishing, use `npm login`.
## Version History
See package CHANGELOGs for detailed version history:
- packages/cli/CHANGELOG.md
- packages/core/CHANGELOG.md
## Questions?
For questions about the release process, please open an issue or consult the team.

306
dexto/agents/README.md Normal file
View File

@@ -0,0 +1,306 @@
# Configuration Guide
Dexto uses a YAML configuration file to define tool servers and AI settings. This guide provides detailed information on all available configuration options.
## Configuration File Location
By default, Dexto looks for a configuration file at `agents/coding-agent/coding-agent.yml` in the project directory. You can specify a different location using the `--agent` command-line option:
```bash
npm start -- --agent path/to/your/agent.yml
```
## Configuration Structure
The configuration file has two main sections:
1. `mcpServers`: Defines the tool servers to connect to
2. `llm`: Configures the AI provider settings
### Basic Example
```yaml
mcpServers:
github:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-github"
env:
GITHUB_PERSONAL_ACCESS_TOKEN: your-github-token
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
llm:
provider: openai
model: gpt-5
apiKey: $OPENAI_API_KEY
```
## Tool Server Configuration
Each entry under `mcpServers` defines a tool server to connect to. The key (e.g., "github", "filesystem") is used as a friendly name for the server.
Tool servers can either be local servers (stdio) or remote servers (sse)
### Stdio Server Options
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| `type` | string | Yes | The type of the server, needs to be 'stdio' |
| `command` | string | Yes | The executable to run |
| `args` | string[] | No | Array of command-line arguments |
| `env` | object | No | Environment variables for the server process |
### SSE Server Options
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| `type` | string | Yes | The type of the server, needs to be 'sse' |
| `url` | string | Yes | The url of the server |
| `headers` | map | No | Optional headers for the url |
## LLM Configuration
The `llm` section configures the AI provider settings.
### LLM Options
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| `provider` | string | Yes | AI provider (e.g., "openai", "anthropic", "google") |
| `model` | string | Yes | The model to use |
| `apiKey` | string | Yes | API key or environment variable reference |
| `temperature` | number | No | Controls randomness (0-1, default varies by provider) |
| `maxInputTokens` | number | No | Maximum input tokens for context compression |
| `maxOutputTokens` | number | No | Maximum output tokens for response length |
| `baseURL` | string | No | Custom API endpoint for OpenAI-compatible providers |
### API Key Configuration
#### Setting API Keys
API keys can be configured in two ways:
1. **Environment Variables (Recommended)**:
- Add keys to your `.env` file (use `.env.example` as a template) or export environment variables
- Reference them in config with the `$` prefix
2. **Direct Configuration** (Not recommended for security):
- Directly in the YAML file (less secure, avoid in production)
```yaml
# Recommended: Reference environment variables
apiKey: $OPENAI_API_KEY
# Not recommended: Direct API key in config
apiKey: sk-actual-api-key
```
#### Security Best Practices
- Never commit API keys to version control
- Use environment variables in production environments
- Create a `.gitignore` entry for your `.env` file
#### API Keys for Different Providers
Each provider requires its own API key:
- OpenAI: Set `OPENAI_API_KEY` in `.env`
- Anthropic: Set `ANTHROPIC_API_KEY` in `.env`
- Google Gemini: Set `GOOGLE_GENERATIVE_AI_API_KEY` in `.env`
#### Openai example
```yaml
llm:
provider: openai
model: gpt-5
apiKey: $OPENAI_API_KEY
```
#### Anthropic example
```yaml
llm:
provider: anthropic
model: claude-sonnet-4-5-20250929
apiKey: $ANTHROPIC_API_KEY
```
#### Google example
```yaml
llm:
provider: google
model: gemini-2.0-flash
apiKey: $GOOGLE_GENERATIVE_AI_API_KEY
```
## Optional Greeting
Add a simple `greeting` at the root of your config to provide a default welcome text that UI layers can display when a chat starts:
```yaml
greeting: "Hi! Im Dexto — how can I help today?"
```
### Windows Support
On Windows systems, some commands like `npx` may have different paths. The system attempts to automatically detect and uses the correct paths for these commands on Windows. If you run into any issues during server initialization, you may need to adjust the path to your `npx` command.
## Supported Tool Servers
Here are some commonly used MCP-compatible tool servers:
### GitHub
```yaml
github:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-github"
env:
GITHUB_PERSONAL_ACCESS_TOKEN: your-github-token
```
### Filesystem
```yaml
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
```
### Terminal
```yaml
terminal:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-terminal"
```
### Desktop Commander
```yaml
desktop:
type: stdio
command: npx
args:
- -y
- "@wonderwhy-er/desktop-commander"
```
### Custom Server
```yaml
custom:
type: stdio
command: node
args:
- --loader
- ts-node/esm
- src/servers/customServer.ts
env:
API_KEY: your-api-key
```
### Remote Server
This example uses a remote github server provided by composio.
The URL is just a placeholder which won't work out of the box since the URL is customized per user.
Go to mcp.composio.dev to get your own MCP server URL.
```yaml
github-remote:
type: sse
url: https://mcp.composio.dev/github/repulsive-itchy-alarm-ABCDE
```
## Command-Line Options
Dexto supports several command-line options:
| Option | Description |
|--------|-------------|
| `--agent` | Specify a custom agent configuration file |
| `--strict` | Require all connections to succeed |
| `--verbose` | Enable verbose logging |
| `--help` | Show help |
## Available Agent Examples
### Database Agent
An AI agent that provides natural language access to database operations and analytics. This approach simplifies database interaction - instead of building forms, queries, and reporting dashboards, users can simply ask for what they need in plain language.
**Quick Start:**
```bash
cd database-agent
./setup-database.sh
npm start -- --agent database-agent.yml
```
**Example Interactions:**
- "Show me all users"
- "Create a new user named John Doe with email john@example.com"
- "Find products under $100"
- "Generate a sales report by category"
This agent demonstrates intelligent database interaction through conversation.
## Complete Example
Here's a comprehensive configuration example using multiple tool servers:
```yaml
mcpServers:
github:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-github"
env:
GITHUB_PERSONAL_ACCESS_TOKEN: your-github-token
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
terminal:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-terminal"
desktop:
type: stdio
command: npx
args:
- -y
- "@wonderwhy-er/desktop-commander"
custom:
type: stdio
command: node
args:
- --loader
- ts-node/esm
- src/servers/customServer.ts
env:
API_KEY: your-api-key
llm:
provider: openai
model: gpt-5
apiKey: $OPENAI_API_KEY
```

View File

@@ -0,0 +1,148 @@
{
"version": "1.0.0",
"agents": {
"database-agent": {
"id": "database-agent",
"name": "Database Agent",
"description": "AI agent for database operations and SQL queries",
"author": "Truffle AI",
"tags": ["database", "sql", "data", "queries"],
"source": "database-agent/",
"main": "database-agent.yml"
},
"github-agent": {
"id": "github-agent",
"name": "GitHub Agent",
"description": "GitHub operations agent for analyzing pull requests, issues, repos and more",
"author": "Truffle AI",
"tags": ["github", "repositories", "collaboration", "devops", "mcp"],
"source": "github-agent/",
"main": "github-agent.yml"
},
"talk2pdf-agent": {
"id": "talk2pdf-agent",
"name": "Talk2PDF Agent",
"description": "PDF document analysis and conversation",
"author": "Truffle AI",
"tags": ["pdf", "documents", "analysis", "conversation"],
"source": "talk2pdf-agent/",
"main": "talk2pdf-agent.yml"
},
"image-editor-agent": {
"id": "image-editor-agent",
"name": "Image Editor Agent",
"description": "AI agent for image editing and manipulation",
"author": "Truffle AI",
"tags": ["images", "editing", "graphics", "visual"],
"source": "image-editor-agent/",
"main": "image-editor-agent.yml"
},
"music-agent": {
"id": "music-agent",
"name": "Music Agent",
"description": "AI agent for music creation and audio processing",
"author": "Truffle AI",
"tags": ["music", "audio", "creation", "sound"],
"source": "music-agent/",
"main": "music-agent.yml"
},
"product-researcher": {
"id": "product-researcher",
"name": "Product Researcher",
"description": "AI agent for product name research and branding",
"author": "Truffle AI",
"tags": ["product", "research", "branding", "naming"],
"source": "product-name-researcher/",
"main": "product-name-researcher.yml"
},
"triage-agent": {
"id": "triage-agent",
"name": "Triage Agent",
"description": "Customer support triage system",
"author": "Truffle AI",
"tags": ["support", "triage", "routing", "multi-agent"],
"source": "triage-demo/",
"main": "triage-agent.yml"
},
"nano-banana-agent": {
"id": "nano-banana-agent",
"name": "Nano Banana Agent",
"description": "AI agent for advanced image generation and editing using Google's Nano Banana (Gemini 2.5 Flash Image)",
"author": "Truffle AI",
"tags": ["images", "generation", "editing", "ai", "nano-banana", "gemini"],
"source": "nano-banana-agent/",
"main": "nano-banana-agent.yml"
},
"podcast-agent": {
"id": "podcast-agent",
"name": "Podcast Agent",
"description": "Advanced podcast generation agent using Google Gemini TTS for multi-speaker audio content",
"author": "Truffle AI",
"tags": ["podcast", "audio", "tts", "speech", "multi-speaker", "gemini"],
"source": "podcast-agent/",
"main": "podcast-agent.yml"
},
"sora-video-agent": {
"id": "sora-video-agent",
"name": "Sora Video Agent",
"description": "AI agent for video generation using OpenAI's Sora technology with comprehensive video creation and management capabilities",
"author": "Truffle AI",
"tags": ["video", "generation", "sora", "openai", "ai", "media", "creation"],
"source": "sora-video-agent/",
"main": "sora-video-agent.yml"
},
"default-agent": {
"id": "default-agent",
"name": "Default",
"description": "Default Dexto agent with filesystem and playwright tools",
"author": "Truffle AI",
"tags": ["default", "filesystem", "playwright"],
"source": "default-agent.yml"
},
"coding-agent": {
"id": "coding-agent",
"name": "Coding Agent",
"description": "Expert software development assistant with all internal coding tools for building, debugging, and maintaining codebases",
"author": "Truffle AI",
"tags": ["coding", "development", "software", "internal-tools", "programming"],
"source": "coding-agent/",
"main": "coding-agent.yml"
},
"workflow-builder-agent": {
"id": "workflow-builder-agent",
"name": "Workflow Builder Agent",
"description": "AI agent for building and managing n8n automation workflows with comprehensive workflow, execution, and credential management",
"author": "Truffle AI",
"tags": ["n8n", "automation", "workflows", "integration", "mcp"],
"source": "workflow-builder-agent/",
"main": "workflow-builder-agent.yml"
},
"product-analysis-agent": {
"id": "product-analysis-agent",
"name": "Product Analysis Agent",
"description": "AI agent for product analytics using PostHog with insights, feature flags, error tracking, and user behavior analysis",
"author": "Truffle AI",
"tags": ["posthog", "analytics", "product", "insights", "feature-flags", "mcp"],
"source": "product-analysis-agent/",
"main": "product-analysis-agent.yml"
},
"gaming-agent": {
"id": "gaming-agent",
"name": "Gaming Agent",
"description": "AI agent that plays GameBoy games like Pokemon through an emulator with screen capture and button controls",
"author": "Truffle AI",
"tags": ["gaming", "gameboy", "pokemon", "emulator", "mcp"],
"source": "gaming-agent/",
"main": "gaming-agent.yml"
},
"explore-agent": {
"id": "explore-agent",
"name": "Explore Agent",
"description": "Fast, read-only agent for codebase exploration. Use for: 'explore the codebase', 'what's in this folder', 'how does X work', 'find where Y is handled', 'understand the architecture'. Optimized for speed with Haiku.",
"author": "Truffle AI",
"tags": ["explore", "search", "understand", "find", "research"],
"source": "explore-agent/",
"main": "explore-agent.yml"
}
}
}

View File

@@ -0,0 +1,81 @@
# Template for dexto create-app
# describes the mcp servers to use
mcpServers:
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
playwright:
type: stdio
command: npx
args:
- -y
- "@playwright/mcp@latest"
# System prompt configuration - defines the agent's behavior and instructions
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are a helpful AI assistant with access to tools.
Use these tools when appropriate to answer user queries.
You can use multiple tools in sequence to solve complex problems.
After each tool result, determine if you need more information or can provide a final answer.
- id: date
type: dynamic
priority: 10
source: date
enabled: true
# LLM configuration - describes the language model to use
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
# Alternative LLM providers (replace the above llm section with one of these):
# Google Gemini:
# llm:
# provider: google
# model: gemini-2.5-pro
# apiKey: $GOOGLE_GENERATIVE_AI_API_KEY
#
# Anthropic Claude:
# llm:
# provider: anthropic
# model: claude-sonnet-4-5-20250929
# apiKey: $ANTHROPIC_API_KEY
#
# Logger configuration - multi-transport logging system
# The CLI automatically adds a file transport for agent-specific logs
# logger:
# level: info # error | warn | info | debug | silly
# transports:
# - type: console
# colorize: true
# - type: file
# path: ./logs/agent.log
# maxSize: 10485760 # 10MB
# maxFiles: 5
# Storage configuration - uses a two-tier architecture: cache (fast, ephemeral) and database (persistent, reliable)
# Memory cache with file-based database (good for development with persistence)
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: in-memory
# Tool confirmation configuration - auto-approve for better development experience
toolConfirmation:
mode: auto-approve
# timeout: omitted = infinite wait
allowedToolsStorage: memory

View File

@@ -0,0 +1,188 @@
# Coding Agent
An expert software development assistant optimized for building, debugging, and maintaining codebases. This agent comes equipped with all internal coding tools and is configured to handle complex software engineering tasks efficiently.
## What You Get
- **All Internal Coding Tools**: Read, write, edit files, execute commands, search codebases
- **Intelligent Tool Policies**: Read operations never require approval, write operations are safely guarded
- **Comprehensive File Support**: 30+ file extensions including JS/TS, Python, Go, Rust, Java, C/C++, configs, and more
- **Enhanced Codebase Access**: Index up to 500 files with depth-10 traversal, including hidden files
- **Expert System Prompt**: Specialized instructions for software development best practices
- **Persistent Tool Approvals**: Allowed tools are saved across sessions for smoother workflows
- **Coding-Focused Starter Prompts**: Quick access to common development tasks
## Key Capabilities
### File Operations
- **read_file**: Read any file with pagination support
- **write_file**: Create new files (requires approval)
- **edit_file**: Modify existing files precisely (requires approval)
- **glob_files**: Find files using patterns like `**/*.ts` (no approval needed)
- **grep_content**: Search within files using regex (no approval needed)
### Command Execution
- **bash_exec**: Run shell commands for testing, building, running code (requires approval)
- **bash_output**: Monitor output from background processes
- **kill_process**: Terminate running processes
### Analysis & Search
- Deep codebase traversal (up to 10 levels)
- Search across 500+ files
- Pattern matching with glob and regex
- Hidden file access (.env, .gitignore, etc.)
## Requirements
- Node.js 18+ (if using npm/pnpm commands)
- OpenAI API key (or another configured LLM key)
- File system access to your project directory
## Run the Agent
```bash
# From Dexto source
npm start -- --agent agents/coding-agent/coding-agent.yml
# Or using the Dexto CLI
dexto --agent coding-agent
```
## Usage Examples
### Analyze a Codebase
```
"Analyze this codebase. Show me the project structure, main technologies used, and provide a high-level overview."
```
### Debug an Error
```
"I'm getting this error: [paste error]. Help me find and fix the issue."
```
### Implement a Feature
```
"I need to add user authentication. Help me design and implement it following best practices."
```
### Refactor Code
```
"This function is too complex. Help me refactor it for better readability and maintainability."
```
### Write Tests
```
"Generate unit tests for the UserService class with edge case coverage."
```
### Code Review
```
"Review my recent changes in src/auth/ and suggest improvements."
```
## Configuration
### LLM Options
The coding agent defaults to `gpt-4o` for powerful coding capabilities. You can switch to other models:
**Claude Sonnet (Excellent for Coding)**
```yaml
llm:
provider: anthropic
model: claude-sonnet-4-20250514
apiKey: $ANTHROPIC_API_KEY
```
**Google Gemini**
```yaml
llm:
provider: google
model: gemini-2.5-pro
apiKey: $GOOGLE_GENERATIVE_AI_API_KEY
```
**OpenAI o1 (For Complex Reasoning)**
```yaml
llm:
provider: openai
model: o1
apiKey: $OPENAI_API_KEY
```
### Tool Policies
The agent is pre-configured with sensible defaults:
**Always Allowed (No Approval Needed)**
- Reading files (`internal--read_file`)
- Searching files (`internal--glob_files`, `internal--grep_content`)
- Checking process output (`internal--bash_output`)
- Killing processes (`internal--kill_process`)
- Asking questions (`internal--ask_user`)
**Requires Approval**
- Writing files (`internal--write_file`)
- Editing files (`internal--edit_file`)
- Executing commands (`internal--bash_exec`)
You can customize these policies in the `toolConfirmation.toolPolicies` section of `coding-agent.yml`.
### File Extensions
The agent indexes these file types by default:
**Web Development**: .js, .jsx, .ts, .tsx, .html, .css, .scss, .sass, .less, .vue, .svelte
**Backend Languages**: .py, .java, .go, .rs, .rb, .php, .c, .cpp, .h, .hpp, .cs, .swift, .kt
**Configuration**: .json, .yaml, .yml, .toml, .xml, .ini, .env
**Documentation**: .md, .mdx, .txt, .rst
**Build Files**: .gradle, .maven, Makefile, Dockerfile, .dockerignore, .gitignore
Add more extensions in the `internalResources.resources[0].includeExtensions` section.
## Starter Prompts
The agent includes 8 built-in starter prompts:
1. **🔍 Analyze Codebase** - Get a project overview
2. **🐛 Debug Error** - Identify and fix bugs
3. **♻️ Refactor Code** - Improve code quality
4. **🧪 Write Tests** - Generate comprehensive tests
5. **✨ Implement Feature** - Build new functionality
6. **⚡ Optimize Performance** - Find bottlenecks
7. **🚀 Setup Project** - Initialize new projects
8. **👀 Code Review** - Review for issues and improvements
## Best Practices
1. **Read Before Writing**: The agent automatically searches and reads relevant code before making changes
2. **Use Glob & Grep**: Leverage pattern matching to explore unfamiliar codebases efficiently
3. **Test Changes**: Execute tests after modifications to verify correctness
4. **Follow Conventions**: The agent adapts to your project's existing code style
5. **Ask Questions**: The agent will ask for clarification when requirements are ambiguous
## Troubleshooting
### Agent Can't Find Files
- Ensure you're running from your project root
- Check that file extensions are included in the config
- Verify `maxDepth` is sufficient for your project structure
### Commands Require Too Many Approvals
- Use `allowedToolsStorage: storage` to persist approvals
- Add frequently-used commands to the `alwaysAllow` list
### Performance Issues with Large Codebases
- Increase `maxFiles` limit (default: 500)
- Reduce `maxDepth` to limit traversal
- Exclude large directories in `.gitignore`
## Learn More
- [Dexto Documentation](https://github.com/truffle-ai/dexto)
- [Internal Tools Reference](../../docs/internal-tools.md)
- [Agent Configuration Guide](../../docs/agent-configuration.md)

View File

@@ -0,0 +1,298 @@
# Coding Agent Configuration
# Optimized for software development with internal coding tools
# Image: Specifies the provider bundle for this agent
# This agent requires local development tools (filesystem, process)
image: '@dexto/image-local'
# System prompt configuration - defines the agent's behavior as a coding assistant
systemPrompt:
contributors:
- id: date
type: dynamic
priority: 10
source: date
- id: env
type: dynamic
priority: 15
source: env
- id: primary
type: static
priority: 0
content: |
You are an expert software development assistant with deep knowledge of multiple programming languages,
frameworks, and development best practices.
Your primary goal is to help users write, debug, refactor, and understand code efficiently.
Key capabilities:
- Read and analyze codebases using glob and grep patterns
- Write and edit files with precise, well-structured code
- Execute shell commands for testing, building, and running code
- Debug issues by examining error messages and code structure
- Refactor code following best practices and design patterns
- Explain complex code concepts clearly
- Delegate exploration tasks to specialized sub-agents
## Task Delegation
You have access to spawn_agent for delegating tasks to specialized sub-agents.
**When to delegate to explore-agent:**
- Open-ended exploration: "explore the codebase", "what's in this folder", "how does X work"
- Understanding architecture: "explain the project structure", "how are components organized"
- Finding patterns: "where is authentication handled", "find all API endpoints"
- Research tasks: "what testing framework is used", "how is state managed"
**When to use your own tools directly:**
- Specific file operations: "read src/index.ts", "edit the config file"
- Targeted searches: "find the User class", "grep for 'TODO'"
- Writing/editing code: any task that requires modifications
- Running commands: build, test, install dependencies
**Rule of thumb:** If the task requires understanding or exploring before you know what to do, delegate to explore-agent first. If you know exactly what file/function to target, use your tools directly.
## Task Tracking with Todos
Use the todo_write tool to track progress on multi-step tasks:
- **DO use todos for:** Feature implementations, multi-file refactors, bug fixes requiring investigation + fix + tests, any task with 3+ distinct steps
- **DON'T use todos for:** Reading files, answering questions, single-file edits, quick explanations
When using todos:
1. Create the todo list when you identify a multi-step task
2. Mark a task as in_progress when you start working on it
3. Mark it as completed when done, and move to the next task
4. Keep only ONE task in_progress at a time
## Bash Tool Guidelines
When using bash_exec:
- Your environment is already configured with the correct working directory.
- NEVER prefix commands to run in current working directory with cd <working_directory> && <remaining_command>.
- Only use cd <directory> as command prefix if the command needs to run outside the working directory.
## Guidelines
- Always read relevant code before making changes to understand context
- Use glob_files to find files and grep_content to search within files
- Test changes when possible using bash_exec
- Follow the project's existing code style and conventions
- Provide clear explanations for your code decisions
- Ask for clarification when requirements are ambiguous
# Memory configuration - controls how memories are included in system prompt
memories:
enabled: true
priority: 40
includeTimestamps: false
includeTags: true
limit: 10
pinnedOnly: false
# Greeting optimized for coding tasks
greeting: "👨‍💻 Ready to code! What are we building today?"
# LLM configuration - using a powerful model for coding tasks
llm:
provider: anthropic
model: claude-sonnet-4-5-20250929
apiKey: $ANTHROPIC_API_KEY
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local # CLI provides storePath automatically
maxBlobSize: 52428800 # 50MB per blob
maxTotalSize: 1073741824 # 1GB total storage
cleanupAfterDays: 30
toolConfirmation:
mode: manual
# timeout: omitted = infinite wait (no timeout for CLI)
allowedToolsStorage: storage # Persist allowed tools across sessions
# Tool policies optimized for coding workflows
toolPolicies:
# Tools that never require approval (safe, read-only operations)
# Use qualified names: custom--{tool_id} for custom tools, internal--{tool_id} for internal tools
alwaysAllow:
- internal--ask_user
- custom--read_file # Read files without approval
- custom--glob_files # Search for files without approval
- custom--grep_content # Search within files without approval
- custom--bash_output # Check background process output
- custom--kill_process # Kill processes without approval (only processes started by agent)
- custom--todo_write # Todo updates don't need approval
- custom--plan_read # Read plan without approval
# Tools that are always denied (dangerous operations)
# Uncomment to restrict certain operations
# alwaysDeny:
# - custom--process-tools--bash_exec--rm -rf* # Prevent recursive deletion
# Compaction configuration - automatically summarizes conversation when context is full
compaction:
type: reactive-overflow
enabled: true
# Uncomment to override model's context window (useful for testing or capping usage):
# maxContextTokens: 50000 # Cap at 50K tokens regardless of model's max
# thresholdPercent: 0.9 # Trigger at 90% of context window (leaves safety buffer)
# Elicitation configuration - required for ask_user tool
elicitation:
enabled: true
# timeout: omitted = infinite wait (no timeout for CLI)
# Internal tools - core tools that are always available
internalTools:
- ask_user # Ask questions and collect input
- invoke_skill # Invoke skills/prompts during execution
# Custom tools - filesystem and process tools from image-local
customTools:
- type: filesystem-tools
allowedPaths: ["."]
blockedPaths: [".git", "node_modules/.bin", ".env"]
blockedExtensions: [".exe", ".dll", ".so"]
enableBackups: false
- type: process-tools
securityLevel: moderate
- type: todo-tools
- type: plan-tools
basePath: "${{dexto.project_dir}}/plans"
- type: agent-spawner
maxConcurrentAgents: 5
defaultTimeout: 300000
allowSpawning: true
# List of agent IDs from the registry that can be spawned.
# Agent metadata (name, description) is pulled from the registry at runtime.
allowedAgents:
- explore-agent
# Agents with read-only tools that should have auto-approved tool calls
autoApproveAgents:
- explore-agent
# Internal resources configuration - expanded for coding projects
internalResources:
enabled: true
resources:
# Filesystem resource - comprehensive file access for coding
- type: filesystem
paths: ["."]
maxFiles: 500 # Increased for larger codebases
maxDepth: 10 # Deeper traversal for nested projects
includeHidden: true # Include hidden files (.env, .gitignore, etc.)
includeExtensions:
# Web development
- .js
- .jsx
- .ts
- .tsx
- .html
- .css
- .scss
- .sass
- .less
- .vue
- .svelte
# Backend languages
- .py
- .java
- .go
- .rs
- .rb
- .php
- .c
- .cpp
- .h
- .hpp
- .cs
- .swift
- .kt
# Shell and config
- .sh
- .bash
- .zsh
- .fish
# Config and data
- .json
- .yaml
- .yml
- .toml
- .xml
- .ini
- .env
# Documentation
- .md
- .mdx
- .txt
- .rst
# Build and package files
- .gradle
- .maven
- .dockerignore
- .gitignore
# Blob resource - for handling build artifacts, images, etc.
- type: blob
# Prompts - coding-focused examples shown as clickable buttons in WebUI
prompts:
# Skills - can be invoked by the LLM via invoke_skill tool
- type: file
file: "${{dexto.agent_dir}}/skills/code-review.md"
# user-invocable: true (default) - appears as /code-review slash command
# disable-model-invocation: false (default) - LLM can invoke via invoke_skill
- type: inline
id: analyze-codebase
title: "🔍 Analyze Codebase"
description: "Get an overview of the project structure"
prompt: "Analyze this codebase. Show me the project structure, main technologies used, and provide a high-level overview."
category: analysis
priority: 10
showInStarters: true
- type: inline
id: implement-feature
title: "✨ Implement Feature"
description: "Build a new feature from scratch"
prompt: "Help me implement a new feature. I'll describe what I need, and you can design and implement it following best practices."
category: development
priority: 9
showInStarters: true
- type: inline
id: write-tests
title: "🧪 Write Tests"
description: "Generate unit tests for code"
prompt: "Help me write comprehensive unit tests. Identify the testing framework and create tests that cover edge cases."
category: testing
priority: 8
showInStarters: true
- type: inline
id: refactor-code
title: "♻️ Refactor Code"
description: "Improve code quality and structure"
prompt: "Help me refactor some code to improve its structure, readability, and maintainability while preserving functionality."
category: refactoring
priority: 7
showInStarters: true
## Alternative LLM configurations for coding
## Claude Sonnet (excellent for coding)
# llm:
# provider: anthropic
# model: claude-sonnet-4-20250514
# apiKey: $ANTHROPIC_API_KEY
## Google Gemini (strong coding capabilities)
# llm:
# provider: google
# model: gemini-2.5-pro
# apiKey: $GOOGLE_GENERATIVE_AI_API_KEY
## OpenAI o1 (for complex reasoning tasks)
# llm:
# provider: openai
# model: o1
# apiKey: $OPENAI_API_KEY

View File

@@ -0,0 +1,46 @@
---
title: Code Review
description: Perform a thorough code review on the specified files or changes
arguments:
- name: focus
description: Optional focus area (security, performance, style, all)
required: false
---
# Code Review Skill
You are now performing a code review. Follow these guidelines:
## Review Checklist
1. **Correctness**: Does the code do what it's supposed to do?
2. **Security**: Are there any security vulnerabilities (injection, XSS, etc.)?
3. **Performance**: Are there any obvious performance issues?
4. **Readability**: Is the code easy to understand?
5. **Maintainability**: Will this code be easy to maintain?
6. **Error Handling**: Are errors handled appropriately?
7. **Tests**: Are there adequate tests for the changes?
## Output Format
Structure your review as:
### Summary
Brief overview of what the code does and overall assessment.
### Issues Found
List any problems, categorized by severity:
- **Critical**: Must fix before merge
- **Major**: Should fix, but not blocking
- **Minor**: Nice to have improvements
- **Nitpick**: Style/preference suggestions
### Positive Highlights
Note any particularly good patterns or practices.
### Recommendations
Actionable suggestions for improvement.
---
Begin the code review now. If no specific files were mentioned, ask the user what they'd like reviewed.

View File

@@ -0,0 +1,35 @@
# Database Agent
An AI agent that provides natural language access to database operations and analytics. This approach changes how we interact with data - instead of learning SQL syntax, building query interfaces, or designing complex dashboards, users can simply ask for what they need in natural language.
## Setup
```bash
cd database-agent
./setup-database.sh
npm start -- --agent database-agent.yml
```
## Example Interactions
- "Show me all users"
- "Create a new user named John Doe with email john@example.com"
- "Find products under $100"
- "Generate a sales report by category"
## Capabilities
- **Data Queries**: Natural language database queries and reporting
- **Data Management**: Create, update, and delete records
- **Analytics**: Generate insights and business intelligence
- **Schema Operations**: Table creation and database structure management
## How It Works
The agent connects to a SQLite database via MCP server and:
- Interprets natural language requests into SQL queries
- Validates data before operations
- Provides formatted results and insights
- Handles errors gracefully with helpful suggestions
This agent demonstrates intelligent database interaction through conversation.

Binary file not shown.

View File

@@ -0,0 +1,98 @@
-- Sample database schema and data for the Database Interaction Agent
-- This demonstrates the types of operations the agent can perform
-- Create users table
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
email TEXT UNIQUE NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
last_login DATETIME,
is_active BOOLEAN DEFAULT 1
);
-- Create products table
CREATE TABLE IF NOT EXISTS products (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
description TEXT,
price DECIMAL(10,2) NOT NULL,
category TEXT NOT NULL,
stock_quantity INTEGER DEFAULT 0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
-- Create orders table
CREATE TABLE IF NOT EXISTS orders (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
total_amount DECIMAL(10,2) NOT NULL,
status TEXT DEFAULT 'pending',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id)
);
-- Create order_items table
CREATE TABLE IF NOT EXISTS order_items (
id INTEGER PRIMARY KEY AUTOINCREMENT,
order_id INTEGER NOT NULL,
product_id INTEGER NOT NULL,
quantity INTEGER NOT NULL,
unit_price DECIMAL(10,2) NOT NULL,
FOREIGN KEY (order_id) REFERENCES orders(id),
FOREIGN KEY (product_id) REFERENCES products(id)
);
-- Insert sample users
INSERT INTO users (name, email) VALUES
('John Doe', 'john@example.com'),
('Jane Smith', 'jane@example.com'),
('Bob Johnson', 'bob@example.com'),
('Alice Brown', 'alice@example.com'),
('Charlie Wilson', 'charlie@example.com');
-- Insert sample products
INSERT INTO products (name, description, price, category, stock_quantity) VALUES
('Laptop', 'High-performance laptop for professionals', 899.99, 'Electronics', 15),
('Smartphone', 'Latest smartphone with advanced features', 699.99, 'Electronics', 25),
('Coffee Maker', 'Automatic coffee maker for home use', 89.99, 'Home & Kitchen', 30),
('Running Shoes', 'Comfortable running shoes for athletes', 129.99, 'Sports', 20),
('Backpack', 'Durable backpack for daily use', 49.99, 'Fashion', 40),
('Bluetooth Speaker', 'Portable wireless speaker', 79.99, 'Electronics', 18),
('Yoga Mat', 'Non-slip yoga mat for fitness', 29.99, 'Sports', 35),
('Desk Lamp', 'LED desk lamp with adjustable brightness', 39.99, 'Home & Kitchen', 22);
-- Insert sample orders
INSERT INTO orders (user_id, total_amount, status) VALUES
(1, 899.99, 'completed'),
(2, 209.98, 'completed'),
(3, 159.98, 'pending'),
(4, 699.99, 'completed'),
(5, 89.99, 'shipped');
-- Insert sample order items
INSERT INTO order_items (order_id, product_id, quantity, unit_price) VALUES
(1, 1, 1, 899.99), -- John bought a laptop
(2, 3, 1, 89.99), -- Jane bought a coffee maker
(2, 7, 1, 29.99), -- Jane also bought a yoga mat
(2, 8, 1, 39.99), -- Jane also bought a desk lamp
(3, 5, 1, 49.99), -- Bob bought a backpack
(3, 6, 1, 79.99), -- Bob also bought a bluetooth speaker
(3, 8, 1, 39.99), -- Bob also bought a desk lamp
(4, 2, 1, 699.99), -- Alice bought a smartphone
(5, 3, 1, 89.99); -- Charlie bought a coffee maker
-- Update some user last_login times
UPDATE users SET last_login = datetime('now', '-1 day') WHERE id = 1;
UPDATE users SET last_login = datetime('now', '-3 days') WHERE id = 2;
UPDATE users SET last_login = datetime('now', '-7 days') WHERE id = 3;
UPDATE users SET last_login = datetime('now', '-2 days') WHERE id = 4;
UPDATE users SET last_login = datetime('now', '-5 days') WHERE id = 5;
-- Create indexes for better performance
CREATE INDEX IF NOT EXISTS idx_users_email ON users(email);
CREATE INDEX IF NOT EXISTS idx_products_category ON products(category);
CREATE INDEX IF NOT EXISTS idx_orders_user_id ON orders(user_id);
CREATE INDEX IF NOT EXISTS idx_orders_status ON orders(status);
CREATE INDEX IF NOT EXISTS idx_order_items_order_id ON order_items(order_id);
CREATE INDEX IF NOT EXISTS idx_order_items_product_id ON order_items(product_id);

View File

@@ -0,0 +1,166 @@
# Database Interaction Agent
# This agent demonstrates an alternative approach to building database interfaces
# Instead of traditional web UIs with forms and buttons, this agent provides
# natural language interaction with database operations through MCP tools
mcpServers:
# SQLite database server for direct database interaction
sqlite:
type: stdio
command: npx
args:
- -y
- "@executeautomation/database-server"
- "${{dexto.agent_dir}}/data/example.db"
timeout: 30000
connectionMode: strict
# Filesystem access for database file management and schema inspection
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
timeout: 30000
connectionMode: lenient
# Optional greeting shown at chat start (UI can consume this)
greeting: "🗄️ Hi! I'm your Database Agent. What would you like to explore?"
# System prompt that defines the agent's database interaction capabilities
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are a Database Interaction Agent that provides natural language access to database operations
and analytics. You orchestrate database operations through intelligent conversation and tool usage.
## Your Core Capabilities
**Database Operations:**
- Execute SQL queries and return formatted results
- Create, modify, and drop database tables
- Insert, update, and delete records
- Analyze database schema and structure
- Generate reports and data insights
- Perform data validation and integrity checks
**Intelligent Orchestration:**
- Understand user intent from natural language
- Break down complex requests into sequential operations
- Validate data before operations
- Provide clear explanations of what you're doing
- Handle errors gracefully with helpful suggestions
**Intelligent Data Operations:**
- Natural conversation for data access
- Intelligent data handling and validation
- Context-aware operations and insights
- Flexible querying and reporting
## Interaction Patterns
**For Data Queries:**
1. Understand what the user wants to know
2. Formulate appropriate SQL queries
3. Execute and format results clearly
4. Provide insights or suggest follow-up questions
**For Data Modifications:**
1. Confirm the user's intent
2. Validate data integrity
3. Execute the operation safely
4. Confirm success and show results
**For Schema Operations:**
1. Analyze current structure
2. Plan the changes needed
3. Execute modifications
4. Verify the new structure
## Best Practices
- Always explain what you're doing before doing it
- Show sample data when creating tables
- Validate user input before database operations
- Provide helpful error messages and suggestions
- Use transactions for multi-step operations
- Keep responses concise but informative
## Example Interactions
User: "Create a users table with name, email, and created_at fields"
You: "I'll create a users table with the specified fields. Let me set this up for you..."
User: "Show me all users who signed up this month"
You: "I'll query the users table for recent signups. Let me get that information..."
User: "Add a new user named John Doe with email john@example.com"
You: "I'll insert a new user record for John Doe. Let me add that to the database..."
Remember: You're demonstrating intelligent database interaction through
natural conversation and data analysis.
- id: date
type: dynamic
priority: 10
source: date
enabled: true
# Storage configuration
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local # CLI provides storePath automatically
maxBlobSize: 52428800 # 50MB per blob
maxTotalSize: 1073741824 # 1GB total storage
cleanupAfterDays: 30
# LLM configuration for intelligent database interactions
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
temperature: 0.1 # Lower temperature for more consistent database operations
# Prompts - database interaction examples shown as clickable buttons in WebUI
prompts:
- type: inline
id: explore-database
title: "🔍 Explore Database"
description: "See what's in the database"
prompt: "Show me what tables exist in the database and their structure."
category: exploration
priority: 10
showInStarters: true
- type: inline
id: create-table
title: "🗂️ Create Table"
description: "Design and create a new database table"
prompt: "Create a products table with columns for name, description, price, and stock quantity."
category: schema
priority: 9
showInStarters: true
- type: inline
id: insert-data
title: " Insert Data"
description: "Add new records to a table"
prompt: "Insert a new product into the products table with name 'Laptop', price 999.99, and stock 15."
category: data-management
priority: 8
showInStarters: true
- type: inline
id: query-data
title: "📊 Query Data"
description: "Search and filter database records"
prompt: "Show me all products from the products table sorted by price."
category: queries
priority: 7
showInStarters: true

View File

@@ -0,0 +1,64 @@
#!/bin/bash
# Exit immediately on errors, unset variables, or pipeline failures
set -euo pipefail
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Setup script for Database Interaction Agent
# This script creates the data directory and initializes the database with sample data
echo "🚀 Setting up Database Interaction Agent..."
# Create data directory if it doesn't exist
echo "📁 Creating data directory..."
mkdir -p "${SCRIPT_DIR}/data"
# Check if SQLite is available
if ! command -v sqlite3 &> /dev/null; then
echo "❌ SQLite3 is not installed. Please install SQLite3 first:"
echo " macOS: brew install sqlite3"
echo " Ubuntu/Debian: sudo apt-get install sqlite3"
echo " Windows: Download from https://www.sqlite.org/download.html"
exit 1
fi
# Initialize database with sample data
echo "🗄️ Initializing database with sample data..."
# Remove existing database if it exists to avoid constraint violations
if [ -f "${SCRIPT_DIR}/data/example.db" ]; then
echo "🗑️ Removing existing database..."
rm "${SCRIPT_DIR}/data/example.db"
fi
sqlite3 "${SCRIPT_DIR}/data/example.db" < "${SCRIPT_DIR}/database-agent-example.sql"
# Verify the database was created successfully
if [ -f "${SCRIPT_DIR}/data/example.db" ]; then
echo "✅ Database created successfully!"
# Show some basic stats
echo "📊 Database statistics:"
echo " Tables: $(sqlite3 "${SCRIPT_DIR}/data/example.db" "SELECT COUNT(*) FROM sqlite_master WHERE type='table';")"
echo " Users: $(sqlite3 "${SCRIPT_DIR}/data/example.db" "SELECT COUNT(*) FROM users;")"
echo " Products: $(sqlite3 "${SCRIPT_DIR}/data/example.db" "SELECT COUNT(*) FROM products;")"
echo " Orders: $(sqlite3 "${SCRIPT_DIR}/data/example.db" "SELECT COUNT(*) FROM orders;")"
echo ""
echo "🎉 Database setup complete!"
echo ""
echo "You can now run the Database Interaction Agent with:"
echo " dexto --agent agents/database-agent.yml"
echo ""
echo "Example interactions you can try:"
echo " - 'Show me all users'"
echo " - 'List products under \$100'"
echo " - 'Create a new user named Test User with email test@example.com'"
echo " - 'Show me total sales by category'"
echo " - 'Find users who haven't logged in for more than 5 days'"
else
echo "❌ Failed to create database. Please check the SQL file and try again."
exit 1
fi

View File

@@ -0,0 +1,217 @@
# describes the mcp servers to use
mcpServers:
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
playwright:
type: stdio
command: npx
args:
- -y
- "@playwright/mcp@latest"
# System prompt configuration - defines the agent's behavior and instructions
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are a helpful AI assistant with access to tools.
Use these tools when appropriate to answer user queries.
You can use multiple tools in sequence to solve complex problems.
After each tool result, determine if you need more information or can provide a final answer.
- id: date
type: dynamic
priority: 10
source: date
enabled: true
# Memory configuration - controls how memories are included in system prompt
memories:
enabled: true
priority: 40
includeTimestamps: false
includeTags: true
limit: 10
pinnedOnly: false
# Optional greeting shown at chat start (UI can consume this)
greeting: "Hi! I'm Dexto — how can I help today?"
# LLM configuration - describes the language model to use
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
# Optional: Control which media types are expanded for LLM consumption
# If omitted, uses model capabilities from registry (recommended default)
# Supports MIME patterns with wildcards (e.g., "image/*", "video/mp4")
# allowedMediaTypes:
# - "image/*" # All images (png, jpg, gif, etc.)
# - "application/pdf" # PDF documents
# - "audio/*" # All audio formats
# Note: Unsupported types become descriptive placeholders like: [Video: demo.mp4 (5.2 MB)]
# Logger configuration - multi-transport logging system
# The CLI automatically adds a file transport for agent-specific logs
# logger:
# level: info # error | warn | info | debug | silly
# transports:
# - type: console
# colorize: true
# - type: file
# path: ./logs/agent.log
# maxSize: 10485760 # 10MB
# maxFiles: 5
storage:
cache:
type: in-memory
database:
type: sqlite
# path: ./data/dexto.db # Optional: customize database location
blob:
type: local # CLI provides storePath automatically
# storePath: ./data/blobs # Optional: customize blob storage location (defaults to agent-specific path)
maxBlobSize: 52428800 # 50MB per blob
maxTotalSize: 1073741824 # 1GB total storage
cleanupAfterDays: 30
toolConfirmation:
mode: manual
# timeout: <optional> # Time to wait for approval (ms). Omit for no timeout (wait indefinitely)
allowedToolsStorage: memory # 'memory' or 'storage' for persisting allowed tools
# Optional: Static tool policies for fine-grained allow/deny control
toolPolicies:
# Tools that never require approval (low-risk, common operations)
alwaysAllow:
- internal--ask_user
- mcp--read_file
- mcp--list_directory
- mcp--list_allowed_directories
# Tools that are always denied (high-risk, destructive operations)
# Deny list takes precedence over allow list
# alwaysDeny:
# - mcp--filesystem--delete_file
# - mcp--playwright--execute_script
# Elicitation configuration - separate from tool confirmation
# Allows auto-approve for tools while still supporting user input requests
elicitation:
enabled: true # Enable ask_user tool and MCP server elicitations
# timeout: <optional> # Time to wait for user input (ms). Omit for no timeout (wait indefinitely)
# Internal tools - built-in Dexto capabilities
internalTools:
- ask_user # Allows the agent to ask you questions and collect structured input
- delegate_to_url
- list_resources
- get_resource
# Internal resources configuration - manages file system access and blob storage
# NOTE: Blob storage capacity and backend settings are in the 'storage.blob' section above
internalResources:
enabled: true
resources:
# Filesystem resource - provides read access to local files for the agent
- type: filesystem
paths: ["."] # Directories to expose
maxFiles: 50 # Maximum number of files to index
maxDepth: 3 # Maximum directory depth to traverse
includeHidden: false # Include hidden files/directories
includeExtensions: [".txt", ".md", ".json", ".yaml", ".yml", ".js", ".ts", ".py", ".html", ".css"]
# Blob resource - enables large file upload/storage (settings in storage.blob section above)
- type: blob
# Plugin system - built-in plugins for content policy and response sanitization
# plugins:
# # ContentPolicy - validates and sanitizes input before sending to LLM
# contentPolicy:
# priority: 10 # Lower priority = runs first
# blocking: true # Blocks execution if validation fails
# maxInputChars: 50000 # Maximum input length (characters)
# redactEmails: true # Redact email addresses from input
# redactApiKeys: true # Redact potential API keys from input
# enabled: true # Enable this plugin
# # ResponseSanitizer - sanitizes LLM responses before returning to user
# responseSanitizer:
# priority: 900 # Higher priority = runs near the end
# blocking: false # Non-blocking (logs warnings but doesn't stop)
# redactEmails: true # Redact email addresses from responses
# redactApiKeys: true # Redact potential API keys from responses
# maxResponseLength: 100000 # Maximum response length (characters)
# enabled: true # Enable this plugin
# # Custom plugins can be added here (see documentation)
# # custom:
# # - name: tenant-auth
# # module: "${{dexto.agent_dir}}/plugins/tenant-auth.ts"
# # enabled: true
# # blocking: true
# # priority: 100
# # config:
# # enforceQuota: true
# Prompts - inline prompts shown as clickable buttons in WebUI (showInStarters: true)
prompts:
- type: inline
id: quick-start
title: "📚 Quick Start Guide"
description: "Learn the basics and see what you can do"
prompt: "I'd like to get started quickly. Can you show me a few examples of what you can do and help me understand how to work with you?"
category: learning
priority: 9
showInStarters: true
- type: inline
id: tool-demo
title: "⚡ Tool Demonstration"
description: "See the tools in action with practical examples"
prompt: "I'd like to see your tools in action. Can you pick one of your most interesting tools and demonstrate it with a practical example? Show me what it can do and how it works."
category: tools
priority: 5
showInStarters: true
- type: inline
id: snake-game
title: "🐍 Create Snake Game"
description: "Build a fun interactive game with HTML, CSS, and JavaScript"
prompt: "Create a snake game in a new directory with HTML, CSS, and JavaScript, then open it in the browser for me to play."
category: coding
priority: 4
showInStarters: true
- type: inline
id: connect-tools
title: "🔧 Connect New Tools"
description: "Browse and add MCP servers to extend capabilities"
prompt: "I want to connect new tools to expand my capabilities. Can you help me understand what MCP servers are available and how to add them?"
category: tools
priority: 3
showInStarters: true
# Telemetry configuration (optional) - OpenTelemetry for distributed tracing
# telemetry:
# serviceName: dexto-default-agent
# enabled: true
# tracerName: dexto-tracer
# export:
# type: otlp # 'otlp' for production, 'console' for development
# protocol: http # 'http' or 'grpc'
# endpoint: http://127.0.0.1:4318/v1/traces # OTLP collector endpoint
# headers: # Optional headers for authentication
# Authorization: Bearer <token>
## To use Google Gemini, replace the LLM section with Google Gemini configuration below
## Similar for anthropic/groq/etc.
# llm:
# provider: google
# model: gemini-2.5-pro
# apiKey: $GOOGLE_GENERATIVE_AI_API_KEY

View File

@@ -0,0 +1,22 @@
# Configuration Examples
This folder contains examples for agents with different configurations. These examples demonstrate how to configure and set up various agents to handle different use cases.
You can directly plug in these configuration files and try them out on your local system to see the power of different AI Agents!
## Available Examples
### `linear-task-manager.yml`
A task management agent that integrates with Linear's official MCP server to help you manage issues, projects, and team collaboration through natural language commands. Features include:
- Create, update, and search Linear issues
- Manage project status and tracking
- Add comments and collaborate with team members
- Handle task assignments and priority management
**Setup**: Requires Linear workspace authentication when first connecting.
### Other Examples
- `email_slack.yml` - Email and Slack integration
- `notion.yml` - Notion workspace management
- `ollama.yml` - Local LLM integration
- `website_designer.yml` - Web design assistance

View File

@@ -0,0 +1,26 @@
# Email to Slack Automation Configuration
# This agent monitors emails and posts summaries to Slack
mcpServers:
gmail:
type: sse
url: "composio-url"
slack:
type: stdio
command: "npx"
args:
- -y
- "@modelcontextprotocol/server-slack"
env:
SLACK_BOT_TOKEN: "slack-bot-token"
SLACK_TEAM_ID: "slack-team-id"
# System prompt - defines the agent's behavior for email processing
systemPrompt: |
Prompt the user to provide the information needed to answer their question or identify them on Slack.
Also let them know that they can directly update the systemPrompt in the yml if they prefer.
# LLM Configuration
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY

View File

@@ -0,0 +1,58 @@
# Linear Task Management Agent
# This agent integrates with Linear's MCP server to manage tasks, issues, and projects
# through natural language commands.
systemPrompt: |
You are a Linear Task Management Agent specialized in helping users manage their Linear workspace efficiently. You have access to Linear's official MCP server that allows you to:
## Your Capabilities
- **Issue Management**: Find, create, update, and manage Linear issues
- **Project Tracking**: Access and manage Linear projects and their status
- **Team Collaboration**: View team activity, assign tasks, and track progress
- **Comment Management**: Add comments to issues and participate in discussions
- **Status Updates**: Update issue status, priority, and labels
- **Search & Filter**: Find specific issues, projects, or team members
## How You Should Behave
- Always confirm destructive actions (deleting, major status changes) before proceeding
- Provide clear summaries when listing multiple issues or projects
- Use natural language to explain Linear concepts when needed
- Be proactive in suggesting task organization and workflow improvements
- When creating issues, ask for essential details if not provided (title, description, priority)
- Offer to set up logical task relationships (dependencies, sub-tasks) when appropriate
## Usage Examples
- "Create a new issue for fixing the login bug with high priority"
- "Show me all open issues assigned to me"
- "Update the API documentation task to in progress"
- "Find all issues related to the mobile app project"
- "Add a comment to issue #123 about the testing results"
- "What's the status of our current sprint?"
mcpServers:
linear:
type: stdio
command: npx
args:
- -y
- mcp-remote
- https://mcp.linear.app/sse
connectionMode: strict
# Note: Linear MCP requires authentication through your Linear workspace
# You'll need to authenticate when first connecting
toolConfirmation:
mode: auto-approve
allowedToolsStorage: memory
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
storage:
cache:
type: in-memory
database:
type: sqlite
path: .dexto/database/linear-task-manager.db

View File

@@ -0,0 +1,31 @@
# Refer https://github.com/makenotion/notion-mcp-server for information on how to use notion mcp server
# mcpServers:
# notion:
# type: stdio
# url: "get-url-from-composio-or-any-other-provider"
# System prompt configuration - defines the agent's behavior and instructions
systemPrompt: |
You are a helpful Notion AI assistant. Your primary goals are to:
1. Help users organize and manage their Notion workspace effectively
2. Assist with creating, editing, and organizing pages and databases
3. Provide guidance on Notion features and best practices
4. Help users find and retrieve information from their Notion workspace
When interacting with users:
- Ask clarifying questions to understand their specific needs
- Provide step-by-step instructions when explaining complex tasks
- Suggest relevant Notion templates or structures when appropriate
- Explain the reasoning behind your recommendations
If you need additional information to help the user:
- Ask for specific details about their Notion workspace
- Request clarification about their goals or requirements
- Inquire about their current Notion setup and experience level
Remember to be concise, clear, and focus on practical solutions.
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY

View File

@@ -0,0 +1,67 @@
# describes the mcp servers to use
mcpServers:
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
playwright:
type: stdio
command: npx
args:
- -y
- "@playwright/mcp@latest"
# hf:
# type: stdio
# command: npx
# args:
# - -y
# - "@llmindset/mcp-hfspace"
# System prompt configuration - defines the agent's behavior and instructions
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are a helpful AI assistant with access to tools.
Use these tools when appropriate to answer user queries.
You can use multiple tools in sequence to solve complex problems.
After each tool result, determine if you need more information or can provide a final answer.
- id: date
type: dynamic
priority: 10
source: date
enabled: true
# first start the ollama server
# ollama run gemma3n:e2b
# then run the following command to start the agent:
# dexto --agent <path_to_ollama.yml>
# dexto --agent <path_to_ollama.yml> for web ui
llm:
provider: openai-compatible
model: gemma3n:e2b
baseURL: http://localhost:11434/v1
apiKey: $OPENAI_API_KEY
maxInputTokens: 32768
# Storage configuration - uses a two-tier architecture: cache (fast, ephemeral) and database (persistent, reliable)
# Memory cache with file-based database (good for development with persistence)
# storage:
# cache:
# type: in-memory
# database:
# type: sqlite
# path: ./data/dexto.db
## To use Google Gemini, replace the LLM section with Google Gemini configuration below
## Similar for anthropic/groq/etc.
# llm:
# provider: google
# model: gemini-2.0-flash
# apiKey: $GOOGLE_GENERATIVE_AI_API_KEY

View File

@@ -0,0 +1,34 @@
# describes the mcp servers to use
mcpServers:
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
playwright:
type: stdio
command: npx
args:
- -y
- "@playwright/mcp@latest"
# System prompt configuration - defines the agent's behavior and instructions
systemPrompt: |
You are a professional website developer. You design beautiful, aesthetic websites.
Use these tools when appropriate to answer user queries.
You can use multiple tools in sequence to solve complex problems.
After each tool result, determine if you need more information or can provide a final answer.
When building a website, do this in a separate folder to keep it separate from the rest of the code.
The website should look clean, professional, modern and elegant.
It should be visually appealing. Carefully consider the color scheme, font choices, and layout. I like non-white backgrounds.
It should be responsive and mobile-friendly, and seem like a professional website.
After you are done building it, open it up in the browser
# # describes the llm configuration
llm:
provider: openai
model: gpt-5
# you can update the system prompt to change the behavior of the llm
apiKey: $OPENAI_API_KEY

View File

@@ -0,0 +1,126 @@
# Explore Agent Configuration
# Lightweight, read-only agent optimized for codebase exploration
# Designed to be spawned by other agents for research tasks
# No image bundle - uses only explicitly defined tools below
# System prompt optimized for exploration tasks
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are a fast, focused exploration agent specialized in understanding codebases and finding information.
## Your Mission
Quickly and thoroughly explore codebases to answer questions, find patterns, locate files, and understand architecture. You are optimized for speed and accuracy.
## Available Tools
You have access to read-only tools:
- `glob_files` - Find files matching patterns (e.g., "src/**/*.ts", "*.config.js")
- `grep_content` - Search for text/patterns within files
- `read_file` - Read file contents
## Exploration Strategy
### For "quick" searches:
- Single glob or grep to find the target
- Read 1-2 most relevant files
- Return focused answer
### For "medium" exploration:
- Multiple search patterns to find related files
- Read key files to understand connections
- Summarize findings with file references
### For "very thorough" analysis:
- Comprehensive search across multiple naming conventions
- Trace imports, exports, and dependencies
- Map relationships between components
- Provide detailed analysis with evidence
## Guidelines
- Start with broad searches, then narrow down
- Use glob for file discovery, grep for content search
- Try multiple naming conventions (camelCase, snake_case, kebab-case, PascalCase)
- Check common locations: src/, lib/, packages/, tests/, config/
- Report what you found AND what you didn't find
- Include file paths and line numbers in your response
- Be concise but complete
## Response Format
Structure your response as:
1. **Summary** - Brief answer to the question
2. **Key Files** - List of relevant files found
3. **Details** - Specific findings with code references
4. **Notes** - Any caveats or areas that need further exploration
# LLM configuration - Haiku for speed and cost efficiency
# When spawned as a sub-agent, this config may be overridden by parent's LLM
# if the API key is not available (with a warning to use 'dexto login')
llm:
provider: anthropic
model: claude-haiku-4-5-20251001
apiKey: $ANTHROPIC_API_KEY
# Minimal storage - in-memory only for ephemeral use
storage:
cache:
type: in-memory
database:
type: in-memory
blob:
type: in-memory
# Auto-approve all tools since they're read-only
toolConfirmation:
mode: auto-approve
allowedToolsStorage: memory
# No internal tools needed for exploration
internalTools: []
# Read-only filesystem tools only - explicitly enable only read operations
customTools:
- type: filesystem-tools
enabledTools: ["read_file", "glob_files", "grep_content"] # Read-only tools only
allowedPaths: ["."]
blockedPaths:
# Version control
- ".git"
# Binaries
- "node_modules/.bin"
# Environment files with secrets
- ".env"
- ".env.local"
- ".env.production"
- ".env.development"
- ".env.test"
- ".env.staging"
# Package manager credentials
- ".npmrc"
- ".yarnrc"
- ".pypirc"
# Git credentials
- ".git-credentials"
- ".gitconfig"
# SSH keys
- ".ssh"
# Cloud provider credentials
- ".aws"
- ".gcp"
- ".azure"
# Kubernetes config
- ".kube"
# Docker credentials
- ".docker"
blockedExtensions: [".exe", ".dll", ".so", ".dylib"]
maxFileSize: 10485760 # 10MB
enableBackups: false
# Note: This agent intentionally excludes:
# - write_file, edit_file (write operations) - not in enabledTools
# - process-tools (bash execution) - provider not included
# - agent-spawner (no sub-agent spawning) - provider not included
# This ensures it remains a safe, read-only exploration tool

View File

@@ -0,0 +1,109 @@
# Gaming Agent - Plays GameBoy games with save state support
mcpServers:
gameboy:
type: stdio
command: npx
args:
- -y
- "@truffle-ai/gameboy-server@0.1.0"
timeout: 60000
connectionMode: strict
greeting: "Hey! I'm your Gaming Agent. Want to continue a saved game or start something new?"
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are a Gaming Agent that plays GameBoy games. You see the screen and press buttons.
## On Startup
**ALWAYS check first:** Call `list_games` to see installed games, then `list_states` for any game with saves. Ask user if they want to continue from a save or start fresh.
## Tools
**Games:** `list_games`, `load_rom` (game name or path), `install_rom`
**Saves:** `save_state`, `load_state`, `list_states`, `delete_state`
**Controls:** `press_up/down/left/right/a/b/start/select` (duration_frames default: 25)
**Speed:** `set_speed(multiplier)` - 1=normal, 2-4x for walking/grinding, 1x for battles
**View:** `start_live_view` (use after loading), `stop_live_view`, `get_screen`, `wait_frames`
## Save States
- **Save often** - before battles, important choices, risky moves
- Save states capture exact emulator state - restore anytime
- Games stored in `~/.gameboy-mcp/games/`, saves persist across sessions
- Loading a ROM from a path auto-installs it
## Workflow
1. Check for existing games/saves → offer to continue
2. `load_rom` (by name or path) → `start_live_view`
3. Play with button presses, save frequently
4. Before anything risky: `save_state`
## Pokemon Tips
- Title: START → Menus: D-pad + A/B → Text: spam A
- Use 3-4x speed for walking/exploring, 1x for battles and menus
- Save before gym battles, catching legendaries, tough trainers
- id: date
type: dynamic
priority: 10
source: date
enabled: true
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local
maxBlobSize: 52428800
maxTotalSize: 1073741824
cleanupAfterDays: 30
llm:
provider: anthropic
model: claude-haiku-4-5-20251001
apiKey: $ANTHROPIC_API_KEY
toolConfirmation:
mode: auto-approve
allowedToolsStorage: memory
prompts:
- type: inline
id: continue-save
title: "Continue from Save"
description: "Resume from a previous save state"
prompt: "Check my installed games and save states. Show me what I can continue from."
category: gaming
priority: 10
showInStarters: true
- type: inline
id: new-game
title: "Start New Game"
description: "Load a ROM and start fresh"
prompt: "I want to start a new game. Show me my installed games or I'll give you a ROM path."
category: gaming
priority: 9
showInStarters: true
- type: inline
id: play-pokemon
title: "Play Pokemon"
description: "Play Pokemon (checks for existing saves)"
prompt: "Let's play Pokemon! Check if I have any Pokemon saves to continue, or start a new game."
category: gaming
priority: 8
showInStarters: true
- type: inline
id: save-progress
title: "Save Progress"
description: "Create a save state"
prompt: "Save my current progress with a descriptive name."
category: gaming
priority: 7
showInStarters: true

View File

@@ -0,0 +1,58 @@
# GitHub Integration Agent
Bring GitHub context into any workspace. This agent starts the `@truffle-ai/github-mcp-server` in `stdio` mode so the assistant can explore repositories, manage pull requests, and automate GitHub project workflows directly from chat.
## What You Get
- Full coverage of GitHub toolsets (repos, pull requests, issues, actions, discussions, notifications, security, projects, and more)
- Automatic OAuth device-flow login with cached tokens, no personal access token required for most users
- Safe-guarded write operations (issues, PRs, workflow runs, comments, etc.) that the agent confirms before executing
- Optional read-only or scoped toolsets to limit the surface area for sensitive environments
## Requirements
- Node.js 18+ with access to `npx`
- A GitHub account with access to the repositories you plan to manage
- Browser access to complete the one-time device-code OAuth prompt (opened automatically)
- `OPENAI_API_KEY` (or another configured LLM key) exported in your shell for the agent
## Run the Agent
```bash
npm start -- --agent agents/github-agent/github-agent.yml
```
The CLI launches `npx -y @truffle-ai/github-mcp-server stdio`. On first run you will see a device code and a browser window prompting you to authorize the "GitHub MCP Server" application. Approving the flow stores an access token at:
```
~/.config/truffle/github-mcp/<host>-token.json
```
Subsequent sessions reuse the cached token unless it expires or you delete the file. Once the server reports it is ready, start chatting with Dexto about repositories, issues, CI failures, releases, or team activity.
## Optional Configuration
You can tailor the underlying MCP server by exporting environment variables before starting Dexto:
- `GITHUB_PERSONAL_ACCESS_TOKEN`: Provide a PAT (with `repo` and `read:user` at minimum) if you need to bypass OAuth or run in headless environments.
- `GITHUB_OAUTH_SCOPES="repo read:user"`: Override the scopes requested during the OAuth device flow (space or comma separated). Use this to request additional permissions (e.g., `gist`) or limit scopes in tightly controlled environments.
- `GITHUB_TOOLSETS="repos,issues,pull_requests,actions"`: Restrict which groups of tools the agent loads. Available groups include `repos`, `issues`, `pull_requests`, `actions`, `notifications`, `discussions`, `projects`, `code_security`, `dependabot`, `secret_protection`, `security_advisories`, `users`, `orgs`, `gists`, `context`, and `experiments`.
- `GITHUB_READ_ONLY=1`: Offer only read-only tools; write operations will be hidden.
- `GITHUB_DYNAMIC_TOOLSETS=1`: Enable on-demand toolset discovery so the model only activates tools as needed.
- `GITHUB_HOST=https://github.mycompany.com`: Point the agent at GitHub Enterprise Server or ghe.com tenants.
- `GITHUB_LOG_FILE=~/github-mcp.log` and `GITHUB_ENABLE_COMMAND_LOGGING=1`: Persist detailed MCP command logs for auditing.
- `GITHUB_CONTENT_WINDOW_SIZE=7500`: Increase the amount of content retrieved for large diffs or logs.
Refer to the upstream [`github-mcp-server`](https://github.com/github/github-mcp-server) documentation for the full flag list (every CLI flag is mirrored as an environment variable using the `GITHUB_` prefix).
## Switching to the Remote GitHub MCP Server (optional)
If you prefer to connect to the GitHub-hosted remote MCP server instead of running the bundled binary, replace the `mcpServers.github` block in `github-agent.yml` with:
```yaml
mcpServers:
github:
type: http
url: https://api.githubcopilot.com/mcp/
connectionMode: strict
```
You can optionally add `headers` for PAT authentication if your host does not support OAuth. Restart Dexto after saving the change.
## Resetting Authorization
To force a new OAuth login, delete the cached token file (`rm ~/.config/truffle/github-mcp/*-token.json`) and relaunch the agent. The next startup will trigger a fresh device flow.

View File

@@ -0,0 +1,107 @@
# GitHub Integration Agent configuration
# Connects Dexto to GitHub via the bundled GitHub MCP server binary
mcpServers:
github:
# type: http
# url: https://api.githubcopilot.com/mcp/
# # timeout: 45000
# connectionMode: strict
type: stdio
command: npx
args:
- -y
- '@truffle-ai/github-mcp-server'
- stdio
# Optional: uncomment to override the default OAuth scopes requested during the device flow
# env:
# GITHUB_OAUTH_SCOPES: 'repo read:user'
# Optional greeting shown at chat start (UI can consume this)
greeting: "🐙 Hello! I'm your GitHub Agent. How can I help with your repositories?"
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are the GitHub Integration Agent for Dexto. Collaborate with users on GitHub repositories by leveraging the GitHub tools available in this runtime. Inspect repositories, manage pull requests and issues, coordinate releases, and share actionable guidance while honoring GitHub permissions and organizational policies.
## Core Responsibilities
- Surface repository structure, history, and code insights that help users understand the current state of their projects
- Draft, triage, and refine issues, pull requests, project boards, and release notes on request
- Perform focused code reviews, flag risky changes, and suggest remediation steps or next actions
- Present step-by-step plans before executing write operations or multi-step procedures
## Interaction Guidelines
- For queries related to starring repos, do not ask for confirmation, just star the repo
- Confirm the repository, branch, or resource when a request is ambiguous or spans multiple contexts
- For read-only requests, respond concisely and include relevant references, links, or identifiers.
- Before taking any action that modifies GitHub state, summarize the intended change and obtain confirmation
- If you are blocked (missing scopes, inaccessible repository, conflicting state), say so clearly and offer next steps or alternatives
## Tool Usage
- Prefer live GitHub data from the provided tools instead of relying on local filesystem copies or stale context
- Break complex objectives into sequential tool calls, narrating progress so the user can follow along
- After each tool interaction, decide whether additional context is needed or if you can deliver a confident answer
Stay practical, keep responses focused on the users goal, and highlight any assumptions or risks you notice.
- id: date
type: dynamic
priority: 10
source: date
enabled: true
# Storage configuration
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local # CLI provides storePath automatically
maxBlobSize: 52428800 # 50MB per blob
maxTotalSize: 1073741824 # 1GB total storage
cleanupAfterDays: 30
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
# Prompts - GitHub operations examples shown as clickable buttons in WebUI
prompts:
- type: inline
id: repo-info
title: "📊 Repository Info"
description: "Get details about the Dexto repository"
prompt: "Show me information about the truffle-ai/dexto repository including stars, forks, and recent activity."
category: info
priority: 10
showInStarters: true
- type: inline
id: list-issues
title: "📋 List Issues"
description: "View open issues in Dexto"
prompt: "List all open issues in the truffle-ai/dexto repository."
category: issues
priority: 9
showInStarters: true
- type: inline
id: star-dexto
title: "⭐ Star Dexto"
description: "Star the Dexto repository"
prompt: "Star the truffle-ai/dexto repository on GitHub."
category: engagement
priority: 8
showInStarters: true
- type: inline
id: recent-commits
title: "📝 Recent Commits"
description: "View latest commits to Dexto"
prompt: "Show me the recent commits to the truffle-ai/dexto repository."
category: activity
priority: 7
showInStarters: true

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -0,0 +1,435 @@
# Image Editor Agent
A comprehensive AI agent for image editing and processing using the [Image Editor MCP Server](https://github.com/truffle-ai/mcp-servers/tree/main/src/image-editor).
This agent provides a complete suite of image manipulation tools through a Python-based MCP server built with OpenCV and Pillow.
## Features
### 🖼️ **Viewing & Preview**
- **Image Preview**: Get base64 previews for display in chat interfaces
- **System Viewer**: Open images in the system's default image viewer
- **Image Details**: Show detailed information in a user-friendly format
- **Thumbnail Generation**: Create quick thumbnail versions
- **Image Comparison**: Compare two images and highlight differences
- **Detailed Analysis**: Comprehensive image statistics and color analysis
### ✂️ **Basic Operations**
- **Resize**: Resize images with aspect ratio preservation
- **Crop**: Crop images to specified dimensions
- **Format Conversion**: Convert between JPG, PNG, WebP, BMP, TIFF
### 🎨 **Filters & Effects**
- **Basic**: Blur, sharpen, grayscale, invert
- **Artistic**: Sepia, vintage, cartoon, sketch
- **Detection**: Edge detection, emboss
### ⚙️ **Adjustments**
- **Brightness & Contrast**: Fine-tune image appearance
- **Color Analysis**: Detailed color statistics and histograms
### 📝 **Drawing & Annotations**
- **Basic Shapes**: Draw rectangles, circles, lines, and arrows
- **Text Overlay**: Add text with customizable font, size, color, and position
- **Annotations**: Add text with background for better visibility
- **Shape Properties**: Control thickness, fill, and positioning
### 🔍 **Computer Vision**
- **Object Detection**: Detect faces, edges, contours, circles, lines
- **Image Analysis**: Detailed statistics, color analysis, histogram data
### 🎯 **Advanced Features**
- **Collage Creation**: Create collages with multiple layout types and templates
- **Batch Processing**: Process multiple images with the same operation
- **Filter Discovery**: List all available filters and effects
- **Template System**: Predefined layouts for professional collages
## Quick Start
### Prerequisites
- **Node.js 20+**: For the Dexto framework
- **Python 3.10+**: Automatically managed by the MCP server
### Installation
1. **Run the Agent**:
```bash
# From the dexto project root
dexto --agent agents/image-editor-agent/image-editor-agent.yml
```
That's it! The MCP server will be automatically downloaded and installed via `uvx` on first run.
## Configuration
The agent is configured to use the published MCP server:
```yaml
mcpServers:
image_editor:
type: stdio
command: uvx
args:
- truffle-ai-image-editor-mcp
connectionMode: strict
```
## MCP Server
This agent uses the **Image Editor MCP Server**, which is maintained separately at:
**🔗 [https://github.com/truffle-ai/mcp-servers/tree/main/src/image-editor](https://github.com/truffle-ai/mcp-servers/tree/main/src/image-editor)**
The MCP server repository provides:
- Complete technical documentation
- Development and contribution guidelines
- Server implementation details
- Advanced configuration options
## Available Tools
### Viewing & Preview Tools
#### `preview_image`
Get a base64 preview of an image for display in chat interfaces.
**Parameters:**
- `filePath` (string): Path to the image file
- `maxSize` (integer, optional): Maximum size for preview (default: 800)
#### `open_image_viewer`
Open an image in the system's default image viewer.
**Parameters:**
- `filePath` (string): Path to the image file
#### `show_image_details`
Display detailed information about an image in a user-friendly format.
**Parameters:**
- `filePath` (string): Path to the image file
#### `create_thumbnail`
Create a thumbnail version of an image for quick preview.
**Parameters:**
- `filePath` (string): Path to the image file
- `size` (integer, optional): Thumbnail size (default: 150)
- `outputPath` (string, optional): Path for the output thumbnail
#### `compare_images`
Compare two images and show differences.
**Parameters:**
- `image1Path` (string): Path to the first image
- `image2Path` (string): Path to the second image
### Basic Image Operations
#### `get_image_info`
Get detailed information about an image file.
**Parameters:**
- `filePath` (string): Path to the image file to analyze
#### `resize_image`
Resize an image to specified dimensions.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `outputPath` (string, optional): Path for the output image
- `width` (integer, optional): Target width in pixels
- `height` (integer, optional): Target height in pixels
- `maintainAspectRatio` (boolean, optional): Whether to maintain aspect ratio (default: true)
- `quality` (integer, optional): Output quality 1-100 (default: 90)
#### `crop_image`
Crop an image to specified dimensions.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `outputPath` (string, optional): Path for the output image
- `x` (integer): Starting X coordinate for cropping
- `y` (integer): Starting Y coordinate for cropping
- `width` (integer): Width of the crop area
- `height` (integer): Height of the crop area
#### `convert_format`
Convert an image to a different format.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `outputPath` (string, optional): Path for the output image
- `format` (string): Target format (jpg, jpeg, png, webp, bmp, tiff)
- `quality` (integer, optional): Output quality 1-100 for lossy formats (default: 90)
### Filters & Effects
#### `apply_filter`
Apply various filters and effects to an image.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `outputPath` (string, optional): Path for the output image
- `filter` (string): Type of filter (blur, sharpen, grayscale, sepia, invert, edge_detection, emboss, vintage, cartoon, sketch)
- `intensity` (number, optional): Filter intensity 0.1-5.0 (default: 1.0)
#### `list_available_filters`
List all available image filters and effects.
**Parameters:** None
### Adjustments
#### `adjust_brightness_contrast`
Adjust brightness and contrast of an image.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `outputPath` (string, optional): Path for the output image
- `brightness` (number, optional): Brightness adjustment -100 to 100 (default: 0)
- `contrast` (number, optional): Contrast multiplier 0.1 to 3.0 (default: 1.0)
### Drawing & Annotations
#### `draw_rectangle`
Draw a rectangle on an image.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `outputPath` (string, optional): Path for the output image
- `x` (integer): X coordinate of top-left corner
- `y` (integer): Y coordinate of top-left corner
- `width` (integer): Width of the rectangle
- `height` (integer): Height of the rectangle
- `color` (string, optional): Color in hex format (default: "#FF0000")
- `thickness` (integer, optional): Line thickness (default: 3)
- `filled` (boolean, optional): Whether to fill the rectangle (default: false)
#### `draw_circle`
Draw a circle on an image.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `outputPath` (string, optional): Path for the output image
- `centerX` (integer): X coordinate of circle center
- `centerY` (integer): Y coordinate of circle center
- `radius` (integer): Radius of the circle
- `color` (string, optional): Color in hex format (default: "#00FF00")
- `thickness` (integer, optional): Line thickness (default: 3)
- `filled` (boolean, optional): Whether to fill the circle (default: false)
#### `draw_line`
Draw a line on an image.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `outputPath` (string, optional): Path for the output image
- `startX` (integer): X coordinate of line start
- `startY` (integer): Y coordinate of line start
- `endX` (integer): X coordinate of line end
- `endY` (integer): Y coordinate of line end
- `color` (string, optional): Color in hex format (default: "#0000FF")
- `thickness` (integer, optional): Line thickness (default: 2)
#### `draw_arrow`
Draw an arrow on an image.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `outputPath` (string, optional): Path for the output image
- `startX` (integer): X coordinate of arrow start
- `startY` (integer): Y coordinate of arrow start
- `endX` (integer): X coordinate of arrow end
- `endY` (integer): Y coordinate of arrow end
- `color` (string, optional): Color in hex format (default: "#FF00FF")
- `thickness` (integer, optional): Line thickness (default: 2)
- `tipLength` (number, optional): Arrow tip length as fraction of line (default: 0.3)
#### `add_text_to_image`
Add text overlay to an image.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `outputPath` (string, optional): Path for the output image
- `text` (string): Text to add to the image
- `x` (integer): X coordinate for text placement
- `y` (integer): Y coordinate for text placement
- `fontSize` (integer, optional): Font size in pixels (default: 30)
- `color` (string, optional): Text color in hex format (default: "#FFFFFF")
#### `add_annotation`
Add an annotation with background to an image.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `outputPath` (string, optional): Path for the output image
- `text` (string): Text to add to the image
- `x` (integer): X coordinate for text placement
- `y` (integer): Y coordinate for text placement
- `fontSize` (integer, optional): Font size in pixels (default: 20)
- `textColor` (string, optional): Text color in hex format (default: "#FFFFFF")
- `backgroundColor` (string, optional): Background color in hex format (default: "#000000")
- `padding` (integer, optional): Padding around text (default: 5)
### Computer Vision
#### `detect_objects`
Detect objects in an image using OpenCV.
**Parameters:**
- `inputPath` (string): Path to the input image file
- `detectionType` (string): Type of detection (faces, edges, contours, circles, lines)
#### `analyze_image`
Analyze image statistics and properties.
**Parameters:**
- `inputPath` (string): Path to the input image file
### Advanced Features
#### `create_collage`
Create a collage from multiple images with various layout options.
**Parameters:**
- `imagePaths` (array): List of image file paths
- `layout` (string, optional): Layout type (grid, horizontal, vertical, mosaic, random, custom) (default: grid)
- `outputPath` (string, optional): Path for the output collage
- `maxWidth` (integer, optional): Maximum width for individual images (default: 1200)
- `spacing` (integer, optional): Spacing between images (default: 10)
- `canvasWidth` (integer, optional): Custom canvas width for mosaic/random/custom layouts
- `canvasHeight` (integer, optional): Custom canvas height for mosaic/random/custom layouts
- `backgroundColor` (string, optional): Background color in hex format (default: "#FFFFFF")
- `customPositions` (array, optional): List of {x, y} coordinates for custom layout
- `randomSeed` (integer, optional): Seed for reproducible random layouts
#### `create_collage_template`
Create a collage using predefined templates.
**Parameters:**
- `imagePaths` (array): List of image file paths
- `template` (string, optional): Template type (photo_wall, storyboard, featured, instagram_grid, polaroid) (default: photo_wall)
- `outputPath` (string, optional): Path for the output collage
- `maxWidth` (integer, optional): Maximum canvas width (default: 1200)
- `backgroundColor` (string, optional): Background color in hex format (default: "#FFFFFF")
#### `list_collage_templates`
List all available collage templates and layouts.
**Parameters:** None
#### `batch_process`
Process multiple images with the same operation.
**Parameters:**
- `inputPaths` (array): List of input image paths
- `operation` (string): Operation type (resize, filter, brightness_contrast, convert)
- `outputDirectory` (string, optional): Output directory for processed images
- Additional parameters depend on the operation type
## Supported Image Formats
- **JPEG/JPG**: Lossy compression, good for photos
- **PNG**: Lossless compression, good for graphics with transparency
- **WebP**: Modern format with good compression
- **BMP**: Uncompressed bitmap format
- **TIFF**: High-quality format for professional use
## Dependencies
- **OpenCV**: Computer vision operations and image processing
- **Pillow**: Image manipulation and text rendering
- **NumPy**: Numerical operations
- **MCP**: Model Context Protocol server implementation
## Example Usage
### Basic Image Operations
```
"Resize the image at /path/to/image.jpg to 800x600 pixels"
"Crop the image to show only the top-left quarter"
"Convert the image to PNG format"
```
### Interactive Viewing
```
"Show me a preview of the image"
"Open this image in the system viewer"
"Display detailed information about the image"
```
### Filters and Effects
```
"Apply a vintage filter to the image"
"Create a cartoon effect on the image"
"Apply edge detection to find contours"
```
### Analysis and Detection
```
"Analyze the color statistics of the image"
"Detect faces in the image"
"Compare two images and show differences"
```
### Drawing and Annotations
```
"Draw a red rectangle around the face in the image"
"Add a circle to highlight the center point"
"Draw an arrow pointing to the important feature"
"Add an annotation saying 'Face detected' with a black background"
"Draw a line connecting two points in the image"
```
### Advanced Features
```
"Create a mosaic collage from these images"
"Create a featured layout collage with one large image"
"Create an Instagram grid from 9 photos"
"Create a custom collage with specific positions"
"List all available collage templates"
"Batch process all images in the folder to apply a blur filter"
"Show me a preview of the image"
```
## Troubleshooting
### Common Issues
1. **OpenCV Installation**: If you encounter issues with OpenCV, ensure you have the required system dependencies:
```bash
# macOS
brew install opencv
# Ubuntu/Debian
sudo apt-get install libopencv-dev
```
2. **Font Issues**: If text rendering fails, the server will fall back to the default font.
3. **Memory Issues**: For large images, consider resizing before processing to avoid memory constraints.
4. **Path Issues**: Ensure all file paths are absolute or correctly relative to the working directory.
## Troubleshooting
### Common Issues
1. **Server Installation**: The MCP server will be automatically installed via `uvx` on first run. No manual setup required.
2. **OpenCV Installation**: The server includes OpenCV installation - this may take a moment on first run due to the large download (35MB+).
3. **Memory Issues**: For large images, consider resizing before processing to avoid memory constraints.
4. **Path Issues**: Ensure all file paths are absolute or correctly relative to the working directory.
## Getting Help
- **MCP Server Issues**: Report at the [mcp-servers repository](https://github.com/truffle-ai/mcp-servers/issues)
- **Agent Configuration**: Report at the main Dexto repository
- **Feature Requests**: Use the mcp-servers repository for tool-related requests
## License
This project is part of the Dexto AI agent framework.

View File

@@ -0,0 +1,52 @@
# Dexto Agent Configuration for Python Image Editor MCP Server
# Generated on 2025-07-18T19:30:00.000Z
# Optional greeting shown at chat start (UI can consume this)
greeting: "🎨 Hello! I'm your Image Editor. What image shall we create or edit today?"
systemPrompt: |
You are an AI assistant specialized in image editing and processing. You have access to a comprehensive set of tools for manipulating images including:
- **Basic Operations**: Resize, crop, convert formats
- **Filters & Effects**: Blur, sharpen, grayscale, sepia, invert, edge detection, emboss, vintage
- **Adjustments**: Brightness, contrast, color adjustments
- **Text & Overlays**: Add text to images with customizable fonts and colors
- **Computer Vision**: Face detection, edge detection, contour analysis, circle detection, line detection
- **Analysis**: Detailed image statistics, color analysis, histogram data
When working with images:
1. Always validate that the input image exists and is in a supported format
2. Provide clear feedback about what operations you're performing
3. Save processed images with descriptive names
4. Include image information (dimensions, file size, format) in your responses
5. Suggest additional enhancements when appropriate
Supported image formats: JPG, JPEG, PNG, BMP, TIFF, WebP
mcpServers:
image_editor:
type: stdio
command: uvx
args:
- truffle-ai-image-editor-mcp
connectionMode: strict
toolConfirmation:
mode: "auto-approve"
allowedToolsStorage: "memory"
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local # CLI provides storePath automatically
maxBlobSize: 52428800 # 50MB per blob
maxTotalSize: 1073741824 # 1GB total storage
cleanupAfterDays: 30

View File

@@ -0,0 +1,70 @@
# Dexto Agent Configuration for OpenAI Image Generation MCP Server
# Uses GPT Image API (gpt-image-1) for high-quality image generation
greeting: "Hello! I'm your AI Image Generator powered by OpenAI's GPT Image API. What would you like me to create?"
systemPrompt: |
You are an expert image generation assistant powered by OpenAI's GPT Image API (gpt-image-1).
**YOUR CAPABILITIES:**
- Generate images from detailed text descriptions
- Edit existing images with masks for precise modifications
- Create transparent backgrounds for icons, sprites, and overlays
- Produce images in various formats (PNG, JPEG, WebP)
- Multiple quality levels: low (~$0.02), medium (~$0.07), high (~$0.19)
**WHEN GENERATING IMAGES:**
1. Craft detailed prompts - include style, composition, lighting, colors, and mood
2. Ask clarifying questions if the request is vague
3. Suggest appropriate settings based on use case:
- Icons/sprites: background="transparent", size="1024x1024"
- Hero images: quality="high", size="1536x1024" (landscape)
- Portrait images: size="1024x1536"
- Quick drafts: quality="low"
- Photos: output_format="jpeg"
- Graphics with transparency: output_format="png"
**WHEN EDITING IMAGES:**
1. Explain how masks work (transparent areas = regions to edit)
2. Provide clear descriptions of desired changes
3. Suggest generating multiple variations (n=2-3) for comparison
**BEST PRACTICES:**
- Default to quality="medium" for good balance of cost and quality
- Use quality="high" only for final production assets
- Confirm user's intent before generating expensive high-quality images
- Always provide the output file path after generation
- For transparent backgrounds, remind users to use PNG or WebP format
Be creative, helpful, and guide users to get the best possible results.
mcpServers:
openai_image:
type: stdio
command: npx
args:
- -y
- '@truffle-ai/openai-image-server'
env:
OPENAI_API_KEY: $OPENAI_API_KEY
connectionMode: strict
toolConfirmation:
mode: "auto-approve"
allowedToolsStorage: "memory"
llm:
provider: openai
model: gpt-5.2
apiKey: $OPENAI_API_KEY
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local
maxBlobSize: 52428800 # 50MB per blob
maxTotalSize: 1073741824 # 1GB total storage
cleanupAfterDays: 30

View File

@@ -0,0 +1,157 @@
# Request Logger Agent Configuration
# Demonstrates custom plugin integration with complete lifecycle testing
# Logs all user requests, tool calls, and assistant responses to ~/.dexto/logs/request-logger.log
# MCP Servers - basic filesystem and browser tools
mcpServers:
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
playwright:
type: stdio
command: npx
args:
- -y
- "@playwright/mcp@latest"
# System prompt configuration
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are a helpful AI assistant with comprehensive logging enabled.
All your interactions (requests, tool calls, and responses) are being logged to help understand your behavior.
Use tools when appropriate to answer user queries. You can use multiple tools in sequence to solve complex problems.
After each tool result, determine if you need more information or can provide a final answer.
- id: date
type: dynamic
priority: 10
source: date
enabled: true
# Memory configuration - controls how memories are included in system prompt
memories:
enabled: true
priority: 40
includeTimestamps: false
includeTags: true
limit: 10
pinnedOnly: false
# Optional greeting shown at chat start
greeting: "Hi! I'm the Logger Agent — all interactions are being logged for analysis. How can I help?"
# LLM configuration
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
# Storage configuration
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local # CLI provides storePath automatically
maxBlobSize: 52428800
maxTotalSize: 1073741824
cleanupAfterDays: 30
# Tool confirmation settings
toolConfirmation:
mode: manual
# timeout: omitted = infinite wait
allowedToolsStorage: memory
# Elicitation configuration - required for ask_user tool
elicitation:
enabled: true
# timeout: omitted = infinite wait
# Internal tools
internalTools:
- ask_user
# Internal resources configuration
internalResources:
enabled: true
resources:
- type: filesystem
paths: ["."]
maxFiles: 50
maxDepth: 3
includeHidden: false
includeExtensions: [".txt", ".md", ".json", ".yaml", ".yml", ".js", ".ts", ".py", ".html", ".css"]
- type: blob
# Plugin system configuration
plugins:
# Built-in plugins
contentPolicy:
priority: 10
blocking: true
maxInputChars: 50000
redactEmails: true
redactApiKeys: true
enabled: true
responseSanitizer:
priority: 900
blocking: false
redactEmails: true
redactApiKeys: true
maxResponseLength: 100000
enabled: true
# Custom Request Logger Plugin
custom:
- name: request-logger
module: "${{dexto.agent_dir}}/plugins/request-logger.ts"
enabled: true
blocking: false # Non-blocking - we just want to observe, not interfere
priority: 5 # Run early to capture original data before other plugins modify it
config: {} # Empty config uses defaults: ~/.dexto/logs/request-logger.log
# Prompts - shown as clickable buttons in WebUI
prompts:
- type: inline
id: simple-question
title: "🤔 Ask a Simple Question"
description: "Test basic request/response logging"
prompt: "What is the capital of France?"
category: learning
priority: 9
showInStarters: true
- type: inline
id: tool-usage
title: "🔧 Use a Tool"
description: "Test tool call and result logging"
prompt: "List the files in the current directory"
category: tools
priority: 8
showInStarters: true
- type: inline
id: multi-step
title: "🎯 Multi-Step Task"
description: "Test logging across multiple tool calls"
prompt: "Create a new file called test.txt with the content 'Hello from Logger Agent' and then read it back to me"
category: tools
priority: 7
showInStarters: true
- type: inline
id: check-logs
title: "📋 Check the Logs"
description: "View the request logger output"
prompt: "Can you read the file at ~/.dexto/logs/request-logger.log and show me the last 50 lines?"
category: tools
priority: 6
showInStarters: true

View File

@@ -0,0 +1,186 @@
import type {
DextoPlugin,
BeforeLLMRequestPayload,
BeforeResponsePayload,
BeforeToolCallPayload,
AfterToolResultPayload,
PluginResult,
PluginExecutionContext,
} from '@core/plugins/types.js';
import { promises as fs } from 'fs';
import { homedir } from 'os';
import { join } from 'path';
/**
* Request Logger Plugin
*
* Logs all user requests and assistant responses to a file for debugging and analysis.
* Demonstrates the complete plugin lifecycle including resource management.
*
* Features:
* - Logs user input (text, images, files)
* - Logs tool calls and results
* - Logs assistant responses with token usage
* - Proper resource cleanup on shutdown
*/
export class RequestLoggerPlugin implements DextoPlugin {
private logFilePath: string = '';
private logFileHandle: fs.FileHandle | null = null;
private requestCount: number = 0;
/**
* Initialize plugin - create log directory and open log file
*/
async initialize(config: Record<string, any>): Promise<void> {
// Default log path: ~/.dexto/logs/request-logger.log
const logDir = config.logDir || join(homedir(), '.dexto', 'logs');
const logFileName = config.logFileName || 'request-logger.log';
this.logFilePath = join(logDir, logFileName);
// Ensure log directory exists
await fs.mkdir(logDir, { recursive: true });
// Open log file in append mode
this.logFileHandle = await fs.open(this.logFilePath, 'a');
// Write initialization header
await this.writeLog('='.repeat(80));
await this.writeLog(`Request Logger initialized at ${new Date().toISOString()}`);
await this.writeLog(`Log file: ${this.logFilePath}`);
await this.writeLog('='.repeat(80));
}
/**
* Log user input before it's sent to the LLM
*/
async beforeLLMRequest(
payload: BeforeLLMRequestPayload,
context: PluginExecutionContext
): Promise<PluginResult> {
this.requestCount++;
await this.writeLog('');
await this.writeLog(`[${this.requestCount}] USER REQUEST at ${new Date().toISOString()}`);
await this.writeLog(`Session: ${payload.sessionId || 'unknown'}`);
await this.writeLog(`User: ${context.userId || 'anonymous'}`);
await this.writeLog(`Model: ${context.llmConfig.provider}/${context.llmConfig.model}`);
await this.writeLog('-'.repeat(40));
await this.writeLog(`Text: ${payload.text}`);
if (payload.imageData) {
await this.writeLog(
`Image: ${payload.imageData.mimeType} (${payload.imageData.image.length} chars)`
);
}
if (payload.fileData) {
await this.writeLog(
`File: ${payload.fileData.filename || 'unknown'} (${payload.fileData.mimeType})`
);
}
await this.writeLog('-'.repeat(40));
return { ok: true };
}
/**
* Log tool calls before execution
*/
async beforeToolCall(
payload: BeforeToolCallPayload,
context: PluginExecutionContext
): Promise<PluginResult> {
await this.writeLog('');
await this.writeLog(`[${this.requestCount}] TOOL CALL at ${new Date().toISOString()}`);
await this.writeLog(`Tool: ${payload.toolName}`);
await this.writeLog(`Call ID: ${payload.callId || 'unknown'}`);
await this.writeLog(`Arguments: ${JSON.stringify(payload.args, null, 2)}`);
return { ok: true };
}
/**
* Log tool results after execution
*/
async afterToolResult(
payload: AfterToolResultPayload,
context: PluginExecutionContext
): Promise<PluginResult> {
await this.writeLog('');
await this.writeLog(`[${this.requestCount}] TOOL RESULT at ${new Date().toISOString()}`);
await this.writeLog(`Tool: ${payload.toolName}`);
await this.writeLog(`Call ID: ${payload.callId || 'unknown'}`);
await this.writeLog(`Success: ${payload.success}`);
const resultStr =
typeof payload.result === 'string'
? payload.result.substring(0, 500) + (payload.result.length > 500 ? '...' : '')
: JSON.stringify(payload.result, null, 2).substring(0, 500);
await this.writeLog(`Result: ${resultStr}`);
return { ok: true };
}
/**
* Log assistant response before it's sent to the user
*/
async beforeResponse(
payload: BeforeResponsePayload,
context: PluginExecutionContext
): Promise<PluginResult> {
await this.writeLog('');
await this.writeLog(
`[${this.requestCount}] ASSISTANT RESPONSE at ${new Date().toISOString()}`
);
await this.writeLog(`Session: ${payload.sessionId || 'unknown'}`);
await this.writeLog(`Model: ${payload.provider}/${payload.model || 'unknown'}`);
if (payload.tokenUsage) {
await this.writeLog(
`Tokens: ${payload.tokenUsage.input} input, ${payload.tokenUsage.output} output`
);
}
await this.writeLog('-'.repeat(40));
await this.writeLog(`Content: ${payload.content}`);
if (payload.reasoning) {
await this.writeLog('-'.repeat(40));
await this.writeLog(`Reasoning: ${payload.reasoning}`);
}
await this.writeLog('-'.repeat(40));
return { ok: true };
}
/**
* Cleanup - close log file handle
*/
async cleanup(): Promise<void> {
await this.writeLog('');
await this.writeLog('='.repeat(80));
await this.writeLog(`Request Logger shutting down at ${new Date().toISOString()}`);
await this.writeLog(`Total requests logged: ${this.requestCount}`);
await this.writeLog('='.repeat(80));
if (this.logFileHandle) {
await this.logFileHandle.close();
this.logFileHandle = null;
}
}
/**
* Helper method to write to log file
*/
private async writeLog(message: string): Promise<void> {
if (this.logFileHandle) {
await this.logFileHandle.write(message + '\n');
}
}
}
// Export the plugin class directly for the plugin manager to instantiate
export default RequestLoggerPlugin;

View File

@@ -0,0 +1,294 @@
# Music Creator Agent
A comprehensive AI agent for music creation, editing, and audio processing using the [Music Creator MCP Server](https://github.com/truffle-ai/mcp-servers/tree/main/src/music).
> **⚠️ Experimental Status**: This agent is currently in experimental development. The tools have not been extensively tested in production environments and may have limitations or bugs. We're actively seeking feedback and improvements from users.
## 🧪 Experimental Features
- **Limited Testing**: Tools have been tested in controlled environments but may behave differently with various audio formats, file sizes, or system configurations
- **Active Development**: Features are being refined based on user feedback and real-world usage
- **Feedback Welcome**: We encourage users to report issues, suggest improvements, and share use cases
- **Breaking Changes**: API and tool behavior may change as we improve the implementation
## Overview
This agent provides access to professional-grade music production tools through a clean conversational interface. Built with industry-standard libraries like librosa, pydub, and music21, it offers comprehensive audio processing capabilities using the published `truffle-ai-music-creator-mcp` package.
## Features
### 🎵 Audio Analysis
- **Tempo Detection**: Automatically detect BPM and beat positions
- **Key Detection**: Identify musical key and mode
- **Spectral Analysis**: Analyze frequency spectrum, MFCC features, and audio characteristics
- **Comprehensive Analysis**: Get detailed audio information including duration, sample rate, and format
### 🎼 Music Generation
- **Melody Creation**: Generate melodies in any key and scale
- **Chord Progressions**: Create chord progressions using Roman numeral notation
- **Drum Patterns**: Generate drum patterns for rock, jazz, and funk styles
- **MIDI Export**: All generated music exports to MIDI format for further editing
### 🔊 Audio Processing
- **Format Conversion**: Convert between MP3, WAV, FLAC, OGG, M4A, AIFF, WMA
- **Volume Control**: Adjust audio levels with precise dB control
- **Audio Normalization**: Normalize audio to target levels
- **Audio Trimming**: Cut audio to specific time ranges
- **Audio Effects**: Apply reverb, echo, distortion, and filters
### 🎚️ Mixing & Arrangement
- **Audio Merging**: Combine multiple audio files with crossfade support
- **Multi-track Mixing**: Mix multiple audio tracks with individual volume control
- **Batch Processing**: Process multiple files with the same operation
## Quick Start
### Prerequisites
- **Node.js 18+**: For the Dexto framework
- **Python 3.10+**: Automatically managed by the MCP server
- **FFmpeg**: For audio processing (optional, but recommended)
### Installation
1. **Install FFmpeg** (recommended):
```bash
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg
```
2. **Run the Agent**:
```bash
# From the project root
dexto --agent agents/music-agent/music-agent.yml
```
That's it! The MCP server will be automatically downloaded and installed via `uvx` on first run.
## Usage Examples
### Audio Analysis
```
"Analyze the tempo and key of my song.mp3"
"What's the BPM of this track?"
"What key is this song in?"
```
### Music Generation
```
"Create a melody in G major at 140 BPM for 15 seconds"
"Create a I-IV-V-I chord progression in D major"
"Create a basic rock drum pattern"
```
### Audio Processing
```
"Convert my song.wav to MP3 format"
"Convert my MIDI melody to WAV format"
"Increase the volume of my vocals by 3dB"
"Normalize my guitar track to -18dB"
"Trim my song from 30 seconds to 2 minutes"
```
### Audio Effects
```
"Add reverb to my guitar with 200ms reverb time"
"Add echo to my vocals with 500ms delay and 0.7 decay"
"Add some distortion to my bass track"
```
### Mixing & Playback
```
"Mix my vocals, guitar, and drums together with the vocals at +3dB"
"Mix a MIDI melody with an MP3 drum loop"
"Create a melody in G major and play it for 5 seconds"
"Play my song.mp3 starting from 30 seconds for 10 seconds"
```
## Available Tools
### Music Generation
- `create_melody` - Generate melodies in any key and scale
- `create_chord_progression` - Create chord progressions using Roman numerals
- `create_drum_pattern` - Generate drum patterns for different styles
### Audio Analysis
- `analyze_audio` - Comprehensive audio analysis
- `detect_tempo` - Detect BPM and beat positions
- `detect_key` - Identify musical key and mode
- `get_audio_info` - Get detailed audio file information
- `get_midi_info` - Get detailed MIDI file information
### Audio Processing
- `convert_audio_format` - Convert between audio formats
- `convert_midi_to_audio` - Convert MIDI files to high-quality audio format (WAV, 44.1kHz, 16-bit)
- `adjust_volume` - Adjust audio levels in dB
- `normalize_audio` - Normalize audio to target levels
- `trim_audio` - Cut audio to specific time ranges
- `apply_audio_effect` - Apply reverb, echo, distortion, filters
### Mixing & Arrangement
- `merge_audio_files` - Combine multiple audio files
- `mix_audio_files` - Mix tracks with individual volume control (supports both audio and MIDI files)
### Playback
- `play_audio` - Play audio files with optional start time and duration
- `play_midi` - Play MIDI files with optional start time and duration
### Utility
- `list_available_effects` - List all audio effects
- `list_drum_patterns` - List available drum patterns
## Supported Formats
### Audio Formats
- **MP3**: Most common compressed format
- **WAV**: Uncompressed high-quality audio
- **FLAC**: Lossless compressed audio
- **OGG**: Open-source compressed format
- **M4A**: Apple's compressed format
- **AIFF**: Apple's uncompressed format
- **WMA**: Windows Media Audio
### MIDI Formats
- **MID**: Standard MIDI files
- **MIDI**: Alternative MIDI extension
## Configuration
### Agent Configuration
The agent is configured to use the published MCP server:
```yaml
systemPrompt: |
You are an AI assistant specialized in music creation, editing, and production...
mcpServers:
music_creator:
type: stdio
command: uvx
args:
- truffle-ai-music-creator-mcp
connectionMode: strict
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
```
### Environment Variables
Set your OpenAI API key:
```bash
export OPENAI_API_KEY="your-api-key-here"
```
Or create a `.env` file in the project root:
```bash
OPENAI_API_KEY=your-api-key-here
```
## Use Cases
### Music Production
- Create backing tracks and accompaniments
- Generate drum patterns for different genres
- Compose melodies and chord progressions
- Mix and master audio tracks
### Audio Editing
- Clean up audio recordings
- Normalize volume levels
- Apply professional effects
- Convert between formats
### Music Analysis
- Analyze existing music for tempo and key
- Extract musical features for machine learning
- Study musical patterns and structures
- Compare different audio files
### Educational
- Learn about musical theory through generation
- Study different musical styles and patterns
- Experiment with composition techniques
- Understand audio processing concepts
## MCP Server
This agent uses the **Music Creator MCP Server**, which is maintained separately at:
**🔗 [https://github.com/truffle-ai/mcp-servers/tree/main/src/music](https://github.com/truffle-ai/mcp-servers/tree/main/src/music)**
The MCP server repository provides:
- Complete technical documentation
- Development and contribution guidelines
- Server implementation details
- Advanced configuration options
## Troubleshooting
### Common Issues
#### 1. Server Installation
The MCP server will be automatically installed via `uvx` on first run. No manual setup required.
#### 2. "FFmpeg not found" warnings
These warnings can be safely ignored. The agent includes fallback methods using librosa and soundfile for audio processing when FFmpeg is not available.
```bash
# Optional: Install FFmpeg for optimal performance
brew install ffmpeg # macOS
sudo apt install ffmpeg # Ubuntu/Debian
```
#### 3. Large Audio Files
Consider trimming or converting to smaller formats for faster processing.
#### 4. Memory Usage
Monitor system memory during heavy audio operations.
### Performance Tips
1. **Large Audio Files**: Consider trimming or converting to smaller formats for faster processing
2. **Memory Usage**: Monitor system memory during heavy audio operations
3. **Batch Processing**: Use batch operations for multiple files to improve efficiency
4. **FFmpeg**: Install FFmpeg for optimal audio processing performance (optional - fallback methods available)
## Technical Details
### Dependencies
The MCP server uses industry-standard libraries:
- **librosa**: Audio analysis and music information retrieval
- **pydub**: Audio file manipulation and processing
- **music21**: Music notation and analysis
- **pretty_midi**: MIDI file handling
- **numpy**: Numerical computing
- **scipy**: Scientific computing
- **matplotlib**: Plotting and visualization
### Architecture
The agent uses a Python-based MCP server that provides:
- Fast audio processing with optimized libraries
- Memory-efficient handling of large audio files
- Thread-safe operations for concurrent processing
- Comprehensive error handling and validation
### Performance
- Supports audio files up to several hours in length
- Efficient processing of multiple file formats
- Optimized algorithms for real-time analysis
- Minimal memory footprint for batch operations
## Getting Help
- **MCP Server Issues**: Report at the [mcp-servers repository](https://github.com/truffle-ai/mcp-servers/issues)
- **Agent Configuration**: Report at the main Dexto repository
- **Feature Requests**: Use the mcp-servers repository for tool-related requests
## License
This agent configuration is part of the Dexto AI Agent framework. The MCP server is distributed under the MIT license.

View File

@@ -0,0 +1,85 @@
# Dexto Agent Configuration for Music Creation and Editing MCP Server
# Optional greeting shown at chat start (UI can consume this)
greeting: "🎵 Hi! I'm your Music Agent. Let's make some beautiful sounds together!"
systemPrompt: |
You are an AI assistant specialized in music creation, editing, and production. You have access to a comprehensive set of tools for working with audio and music including:
- **Audio Analysis**: Analyze audio files for tempo, key, BPM, frequency spectrum, and audio characteristics
- **Audio Processing**: Convert formats, adjust volume, normalize, apply effects (reverb, echo, distortion, etc.)
- **Music Generation**: Create melodies, chord progressions, drum patterns, and complete compositions
- **Audio Manipulation**: Trim, cut, splice, loop, and arrange audio segments
- **Effects & Filters**: Apply various audio effects and filters for creative sound design
- **Mixing & Mastering**: Balance levels, apply compression, EQ, and mastering effects
- **File Management**: Organize, convert, and manage audio files in various formats
When working with music and audio:
1. Always validate that input audio files exist and are in supported formats
2. Provide clear feedback about what operations you're performing
3. Save processed audio with descriptive names and appropriate formats
4. Include audio information (duration, sample rate, bit depth, format) in your responses
5. Suggest additional enhancements and creative possibilities when appropriate
6. Consider musical theory and composition principles in your suggestions
Supported audio formats: MP3, WAV, FLAC, OGG, M4A, AIFF, WMA
Supported MIDI formats: MID, MIDI
mcpServers:
music_creator:
type: stdio
command: uvx
args:
- truffle-ai-music-creator-mcp
connectionMode: strict
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local # CLI provides storePath automatically
maxBlobSize: 52428800 # 50MB per blob
maxTotalSize: 1073741824 # 1GB total storage
cleanupAfterDays: 30
# Prompts - music creation examples shown as clickable buttons in WebUI
prompts:
- type: inline
id: create-melody
title: "🎼 Create Melody"
description: "Generate a musical melody"
prompt: "Create a cheerful melody in G major at 140 BPM that lasts 15 seconds."
category: generation
priority: 10
showInStarters: true
- type: inline
id: create-chords
title: "🎹 Create Chord Progression"
description: "Generate chord progressions"
prompt: "Create a I-IV-V-I chord progression in D major."
category: generation
priority: 9
showInStarters: true
- type: inline
id: create-drums
title: "🥁 Create Drum Pattern"
description: "Generate drum patterns"
prompt: "Create a basic rock drum pattern at 120 BPM."
category: generation
priority: 8
showInStarters: true
- type: inline
id: list-effects
title: "🎚️ List Available Effects"
description: "See what audio effects are available"
prompt: "Show me all available audio effects and how to use them."
category: discovery
priority: 7
showInStarters: true

View File

@@ -0,0 +1,200 @@
# Nano Banana Agent
A Dexto agent that provides access to Google's **Gemini 2.5 Flash Image** model for image generation and editing through a lean, powerful MCP server.
## 🎯 What is Gemini 2.5 Flash Image?
Gemini 2.5 Flash Image is Google's cutting-edge AI model that enables:
- **Near-instantaneous** image generation and editing
- **Object removal** with perfect background preservation
- **Background alteration** while maintaining subject integrity
- **Image fusion** for creative compositions
- **Style modification** with character consistency
- **Visible and invisible watermarks** (SynthID) for digital safety
## 🚀 Key Features
### Core Capabilities
- **Image Generation**: Create images from text prompts with various styles and aspect ratios
- **Image Editing**: Modify existing images based on natural language descriptions
- **Object Removal**: Remove unwanted objects while preserving the background
- **Background Changes**: Replace backgrounds while keeping subjects intact
- **Image Fusion**: Combine multiple images into creative compositions
- **Style Transfer**: Apply artistic styles to images
### Advanced Features
- **Character Consistency**: Maintain facial features and identities across edits
- **Scene Preservation**: Seamless blending with original lighting and composition
- **Multi-Image Processing**: Handle batch operations and complex compositions
- **Safety Features**: Built-in safety filters and provenance signals
## 🛠️ Setup
### Prerequisites
- Dexto framework installed
- Google AI API key (Gemini API access)
- Node.js 20.0.0 or higher
### Installation
1. **Set up environment variables**:
```bash
export GOOGLE_GENERATIVE_AI_API_KEY="your-google-ai-api-key"
# or
export GEMINI_API_KEY="your-google-ai-api-key"
```
2. **Run the agent** (the MCP server will be automatically downloaded via npx):
```bash
# From the dexto repository root
npx dexto -a agents/nano-banana-agent/nano-banana-agent.yml
```
The agent configuration uses `npx @truffle-ai/nano-banana-server` to automatically download and run the latest version of the MCP server.
## 📋 Available Tools
The agent provides access to 3 essential tools:
### 1. `generate_image`
Generate new images from text prompts.
**Example:**
```
Generate a majestic mountain landscape at sunset in realistic style with 16:9 aspect ratio
```
### 2. `process_image`
Process existing images based on detailed instructions. This tool can handle any image editing task including object removal, background changes, style transfer, adding elements, and more.
**Example:**
```
Remove the red car in the background from /path/to/photo.jpg
```
**Example:**
```
Change the background of /path/to/portrait.jpg to a beach sunset with palm trees
```
**Example:**
```
Apply Van Gogh painting style with thick brushstrokes to /path/to/photo.jpg
```
### 3. `process_multiple_images`
Process multiple images together based on detailed instructions. This tool can combine images, create collages, blend compositions, or perform any multi-image operation.
**Example:**
```
Place the person from /path/to/person.jpg into the landscape from /path/to/landscape.jpg as if they were standing there
```
## 📤 Response Format
Successful operations return both image data and metadata:
```json
{
"content": [
{
"type": "image",
"data": "base64-encoded-image-data",
"mimeType": "image/png"
},
{
"type": "text",
"text": "{\n \"output_path\": \"/absolute/path/to/saved/image.png\",\n \"size_bytes\": 12345,\n \"format\": \"image/png\"\n}"
}
]
}
```
## 🎨 Popular Use Cases
### 1. **Selfie Enhancement**
- Remove blemishes and unwanted objects
- Change backgrounds for professional photos
- Apply artistic filters and styles
- Create figurine effects (Nano Banana's signature feature)
### 2. **Product Photography**
- Remove backgrounds for clean product shots
- Add or remove objects from scenes
- Apply consistent styling across product images
### 3. **Creative Compositions**
- Fuse multiple images into unique scenes
- Apply artistic styles to photos
- Create imaginative scenarios from real photos
### 4. **Content Creation**
- Generate images for social media
- Create variations of existing content
- Apply brand-consistent styling
## 🔧 Configuration
### Environment Variables
- `GOOGLE_GENERATIVE_AI_API_KEY` or `GEMINI_API_KEY`: Your Google AI API key (required)
### Agent Settings
- **LLM Provider**: Google Gemini 2.5 Flash
- **Storage**: In-memory cache with SQLite database
- **Tool Confirmation**: Auto-approve mode for better development experience
## 📁 Supported Formats
**Input/Output Formats:**
- JPEG (.jpg, .jpeg)
- PNG (.png)
- WebP (.webp)
- GIF (.gif)
**File Size Limits:**
- Maximum: 20MB per image
- Recommended: Under 10MB for optimal performance
## 🎯 Example Interactions
### Generate a Creative Image
```
User: "Generate a futuristic cityscape at night with flying cars and neon lights"
Agent: I'll create a futuristic cityscape image for you using Nano Banana's image generation capabilities.
```
### Remove Unwanted Objects
```
User: "Remove the power lines from this photo: /path/to/landscape.jpg"
Agent: I'll remove the power lines from your landscape photo while preserving the natural background.
```
### Create Figurine Effect
```
User: "Transform this selfie into a mini figurine on a desk: /path/to/selfie.jpg"
Agent: I'll create Nano Banana's signature figurine effect, transforming your selfie into a mini figurine displayed on a desk.
```
### Change Background
```
User: "Change the background of this portrait to a professional office setting: /path/to/portrait.jpg"
Agent: I'll replace the background with a professional office setting while keeping you as the main subject.
```
## 🔒 Safety & Ethics
Nano Banana includes built-in safety features:
- **SynthID Watermarks**: Invisible provenance signals
- **Safety Filters**: Content moderation and filtering
- **Character Consistency**: Maintains identity integrity
- **Responsible AI**: Designed to prevent misuse
## 🤝 Contributing
We welcome contributions! Please see our [Contributing Guidelines](../../CONTRIBUTING.md) for details.
## 📄 License
This project is licensed under the MIT License - see the [LICENSE](../../LICENSE) file for details.
---
**Note**: This agent provides access to Google's Gemini 2.5 Flash Image model through the MCP protocol. The implementation returns both image content (base64-encoded) and text metadata according to MCP specifications, allowing for direct image display in compatible clients. A valid Google AI API key is required and usage is subject to Google's terms of service and usage limits.

View File

@@ -0,0 +1,110 @@
# Dexto Agent Configuration for Nano Banana (Gemini 2.5 Flash Image) MCP Server
# Generated on 2025-01-27T00:00:00.000Z
# Optional greeting shown at chat start (UI can consume this)
greeting: "🍌 Hi! I'm your Nano Banana Agent. Let's create something amazing together!"
systemPrompt: |
You are an AI assistant specialized in advanced image generation and editing using Google's Nano Banana (Gemini 2.5 Flash Image) model. You have access to cutting-edge AI tools for:
- **Image Generation**: Create stunning images from text prompts with various styles and aspect ratios
- **Image Editing**: Modify existing images using natural language descriptions
- **Object Removal**: Remove unwanted objects while perfectly preserving the background
- **Background Changes**: Replace backgrounds seamlessly while keeping subjects intact
- **Image Fusion**: Combine multiple images into creative compositions
- **Style Transfer**: Apply artistic styles to images with character consistency
- **Advanced Features**: Character consistency, scene preservation, and multi-image processing
When working with images:
1. Always validate that input images exist and are in supported formats (JPG, PNG, WebP, GIF)
2. Provide clear feedback about what operations you're performing
3. Save processed images with descriptive names
4. Include image information (dimensions, file size, format) in your responses
5. Suggest additional enhancements and creative possibilities when appropriate
6. Leverage Nano Banana's signature features like the figurine effect and character consistency
Key Nano Banana Capabilities:
- **Near-instantaneous** processing with high visual coherence
- **Character consistency** across multiple edits
- **Scene preservation** with seamless background blending
- **Safety features** including SynthID watermarks
- **Multi-image processing** for complex compositions
Popular use cases:
- Selfie enhancement and creative variations
- Product photography with clean backgrounds
- Artistic style applications
- Object removal from photos
- Background replacement for portraits
- Creating figurine effects (Nano Banana's signature feature)
- Image fusion for creative compositions
Supported image formats: JPG, JPEG, PNG, WebP, GIF
Maximum file size: 20MB per image
mcpServers:
nano_banana:
type: stdio
command: npx
args:
- -y
- "@truffle-ai/nano-banana-server"
connectionMode: strict
env:
GEMINI_API_KEY: $GOOGLE_GENERATIVE_AI_API_KEY
timeout: 60000
toolConfirmation:
mode: "auto-approve"
allowedToolsStorage: "memory"
llm:
provider: google
model: gemini-2.5-flash
apiKey: $GOOGLE_GENERATIVE_AI_API_KEY
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local # CLI provides storePath automatically
maxBlobSize: 52428800 # 50MB per blob
maxTotalSize: 1073741824 # 1GB total storage
cleanupAfterDays: 30
# Prompts - image generation and editing examples shown as clickable buttons in WebUI
prompts:
- type: inline
id: generate-landscape
title: "🎨 Generate Landscape"
description: "Create a scenic image from text"
prompt: "Generate a stunning image of a majestic mountain landscape at sunset with vibrant colors and dramatic clouds."
category: generation
priority: 10
showInStarters: true
- type: inline
id: generate-portrait
title: "👤 Generate Portrait"
description: "Create portrait images"
prompt: "Generate a professional portrait of a person in business attire with a clean studio background."
category: generation
priority: 9
showInStarters: true
- type: inline
id: generate-abstract
title: "🌀 Generate Abstract Art"
description: "Create abstract artistic images"
prompt: "Generate an abstract art piece with swirling colors and geometric patterns inspired by Kandinsky."
category: generation
priority: 8
showInStarters: true
- type: inline
id: generate-product
title: "📦 Generate Product Image"
description: "Create product photography"
prompt: "Generate a professional product photo of a sleek modern smartphone on a minimalist white background."
category: generation
priority: 7
showInStarters: true

View File

@@ -0,0 +1,168 @@
# Advanced Podcast Generation Agent
An AI agent for creating multi-speaker audio content using the Gemini TTS MCP server.
## Overview
This agent uses the refactored Gemini TTS MCP server to generate high-quality speech with advanced multi-speaker capabilities. It supports 30 prebuilt voices, natural language tone control, and can generate entire conversations with multiple speakers in a single request. The server now returns audio content that can be played directly in web interfaces.
## Key Features
### 🎤 **Native Multi-Speaker Support**
- Generate conversations with multiple speakers in one request
- No need for separate audio files or post-processing
- Natural conversation flow with different voices per speaker
### 🎵 **30 Prebuilt Voices**
- **Zephyr** - Bright and energetic
- **Puck** - Upbeat and cheerful
- **Charon** - Informative and clear
- **Kore** - Firm and authoritative
- **Fenrir** - Excitable and dynamic
- **Leda** - Youthful and fresh
- **Orus** - Firm and confident
- **Aoede** - Breezy and light
- **Callirrhoe** - Easy-going and relaxed
- **Autonoe** - Bright and optimistic
- **Enceladus** - Breathy and intimate
- **Iapetus** - Clear and articulate
- **Umbriel** - Easy-going and friendly
- **Algieba** - Smooth and polished
- **Despina** - Smooth and elegant
- **Erinome** - Clear and precise
- **Algenib** - Gravelly and distinctive
- **Rasalgethi** - Informative and knowledgeable
- **Laomedeia** - Upbeat and lively
- **Achernar** - Soft and gentle
- **Alnilam** - Firm and steady
- **Schedar** - Even and balanced
- **Gacrux** - Mature and experienced
- **Pulcherrima** - Forward and engaging
- **Achird** - Friendly and warm
- **Zubenelgenubi** - Casual and approachable
- **Vindemiatrix** - Gentle and soothing
- **Sadachbia** - Lively and animated
- **Sadaltager** - Knowledgeable and wise
- **Sulafat** - Warm and inviting
### 🌐 **WebUI Compatible**
- Returns audio content that can be played directly in web interfaces
- Base64-encoded WAV audio data
- Structured content with both text summaries and audio data
### 🎭 **Natural Language Tone Control**
- "Say cheerfully: Welcome to our show!"
- "Speak in a formal tone: Welcome to our meeting"
- "Use an excited voice: This is amazing news!"
- "Speak slowly and clearly: This is important information"
## Setup
1. **Get API Keys**:
```bash
export GEMINI_API_KEY="your-gemini-api-key"
export OPENAI_API_KEY="your-openai-api-key"
```
2. **Run the Agent**:
```bash
dexto -a agents/podcast-agent/podcast-agent.yml
```
The agent will automatically install the Gemini TTS MCP server from npm when needed.
## Usage Examples
### Single Speaker
```
"Generate speech: 'Welcome to our podcast' with voice 'Kore'"
"Create audio: 'Say cheerfully: Have a wonderful day!' with voice 'Puck'"
"Make a formal announcement: 'Speak in a formal tone: Important news today' with voice 'Zephyr'"
```
### Multi-Speaker Conversations
```
"Generate a conversation between Dr. Anya (voice: Kore) and Liam (voice: Puck) about AI"
"Create an interview with host (voice: Zephyr) and guest (voice: Orus) discussing climate change"
"Make a story with narrator (voice: Schedar) and character (voice: Laomedeia)"
"Generate a podcast with three speakers: host (Zephyr), expert (Kore), and interviewer (Puck)"
```
### Podcast Types
```
"Create an educational podcast about AI with clear, professional voices"
"Generate a storytelling podcast with expressive character voices"
"Make a news podcast with authoritative, formal delivery"
"Create an interview with host and guest using different voices"
```
## Available Tools
### **Gemini TTS Tools**
- `generate_speech` - Single-speaker audio generation
- `generate_conversation` - Multi-speaker conversations
- `list_voices` - Browse available voices with characteristics
### **File Management**
- `list_files` - Browse audio files
- `read_file` - Access file information
- `write_file` - Save generated content
- `delete_file` - Clean up files
## Voice Selection Guide
### **Professional Voices**
- **Kore** - Firm, authoritative (great for hosts, experts)
- **Orus** - Firm, professional (business content)
- **Zephyr** - Bright, engaging (news, announcements)
- **Schedar** - Even, balanced (narrators, guides)
### **Expressive Voices**
- **Puck** - Upbeat, enthusiastic (entertainment, stories)
- **Laomedeia** - Upbeat, energetic (dynamic content)
- **Fenrir** - Excitable, passionate (exciting topics)
- **Achird** - Friendly, warm (casual conversations)
### **Character Voices**
- **Umbriel** - Easy-going, relaxed (casual hosts)
- **Erinome** - Clear, articulate (educational content)
- **Autonoe** - Bright, optimistic (positive content)
- **Leda** - Youthful, fresh (younger audiences)
## Multi-Speaker Configuration
### **Example Speaker Setup**
```json
{
"speakers": [
{
"name": "Dr. Anya",
"voice": "Kore",
"characteristics": "Firm, professional"
},
{
"name": "Liam",
"voice": "Puck",
"characteristics": "Upbeat, enthusiastic"
}
]
}
```
### **Conversation Format**
```
Dr. Anya: Welcome to our science podcast!
Liam: Thanks for having me, Dr. Anya!
Dr. Anya: Today we're discussing artificial intelligence.
Liam: It's such an exciting field!
```
## Advanced Features
- **Rate Limit Handling**: Graceful fallbacks with dummy audio when API limits are hit
- **Controllable Style**: Accent, pace, and tone control
- **High-Quality Audio**: Studio-grade WAV output
- **Efficient Processing**: Single request for complex conversations
- **Structured Responses**: Both text summaries and audio data in responses
Simple, powerful, and focused on creating engaging multi-speaker audio content!

View File

@@ -0,0 +1,209 @@
# Advanced Podcast Generation Agent
# Uses Gemini TTS for multi-speaker audio generation
mcpServers:
gemini_tts:
type: stdio
command: npx
args:
- -y
- "@truffle-ai/gemini-tts-server"
env:
GEMINI_API_KEY: $GOOGLE_GENERATIVE_AI_API_KEY
timeout: 60000
connectionMode: strict
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
# Optional greeting shown at chat start (UI can consume this)
greeting: "🎙️ Hello! I'm your Podcast Agent. Let's create some amazing audio together!"
systemPrompt: |
You are an advanced podcast generation agent that creates multi-speaker audio content using Google Gemini TTS.
## Your Capabilities
- Generate high-quality speech from text using Gemini TTS
- Create multi-speaker conversations in a single generation
- Use 30 different prebuilt voices with unique characteristics
- Apply natural language tone control (e.g., "Say cheerfully:")
- Save audio files with descriptive names
## Gemini TTS MCP Usage
### Single Speaker Generation
- Use `generate_speech` to generate single-speaker audio
- Choose from 30 prebuilt voices (Zephyr, Puck, Kore, etc.)
- Apply natural language tone instructions
### Multi-Speaker Generation
- Use `generate_conversation` for multi-speaker conversations
- Configure different voices for each speaker
- Generate entire conversations in one request
### Voice Discovery
- Use `list_voices` to get a complete list of all available voices with their characteristics
- This tool helps you choose the right voice for different content types
### Voice Selection
Available voices with characteristics:
- **Zephyr** - Bright and energetic
- **Puck** - Upbeat and cheerful
- **Charon** - Informative and clear
- **Kore** - Firm and authoritative
- **Fenrir** - Excitable and dynamic
- **Leda** - Youthful and fresh
- **Orus** - Firm and confident
- **Aoede** - Breezy and light
- **Callirrhoe** - Easy-going and relaxed
- **Autonoe** - Bright and optimistic
- **Enceladus** - Breathy and intimate
- **Iapetus** - Clear and articulate
- **Umbriel** - Easy-going and friendly
- **Algieba** - Smooth and polished
- **Despina** - Smooth and elegant
- **Erinome** - Clear and precise
- **Algenib** - Gravelly and distinctive
- **Rasalgethi** - Informative and knowledgeable
- **Laomedeia** - Upbeat and lively
- **Achernar** - Soft and gentle
- **Alnilam** - Firm and steady
- **Schedar** - Even and balanced
- **Gacrux** - Mature and experienced
- **Pulcherrima** - Forward and engaging
- **Achird** - Friendly and warm
- **Zubenelgenubi** - Casual and approachable
- **Vindemiatrix** - Gentle and soothing
- **Sadachbia** - Lively and animated
- **Sadaltager** - Knowledgeable and wise
- **Sulafat** - Warm and inviting
### Natural Language Tone Control
You can use natural language to control tone:
- "Say cheerfully: Welcome to our show!"
- "Speak in a formal tone: Welcome to our meeting"
- "Use an excited voice: This is amazing news!"
- "Speak slowly and clearly: This is important information"
## Podcast Creation Guidelines
### Voice Selection
- Choose appropriate voices for different speakers
- Use consistent voices for recurring characters
- Consider the content type when selecting voices
### Content Types
- **Educational**: Clear, professional voices (Kore, Orus, Charon, Rasalgethi)
- **Storytelling**: Expressive voices (Puck, Laomedeia, Fenrir, Sadachbia)
- **News/Current Events**: Authoritative voices (Zephyr, Schedar, Alnilam)
- **Interview**: Different voices for host and guest (Achird, Autonoe, Umbriel)
- **Fiction**: Character voices with distinct personalities (Gacrux, Leda, Algenib)
### Multi-Speaker Conversations - IMPORTANT
When users ask for multi-speaker content (like podcast intros, conversations, interviews):
1. **Always use `generate_conversation` for conversations with multiple people**
2. **Format the text with speaker labels**: "Speaker1: [text] Speaker2: [text]"
3. **Create ONE audio file with ALL speakers**, not separate files per speaker
4. **REQUIRED: Always define all speakers in the speakers array** - This parameter is mandatory and cannot be omitted
5. **Never call generate_conversation without the speakers parameter** - it will fail
**Example for podcast intro:**
```
Text: "Alex: Hello everyone, and welcome to our podcast! I'm Alex, your friendly host. Jamie: And I'm Jamie! I'm thrilled to be here with you all today."
Speakers: [
{"name": "Alex", "voice": "Achird"},
{"name": "Jamie", "voice": "Autonoe"}
]
```
**TOOL USAGE RULE**: When using `generate_conversation`, you MUST include both:
- `text`: The conversation with speaker labels
- `speakers`: Array of all speakers with their voice assignments
**DO NOT** call the tool without the speakers parameter - it will result in an error.
### Multi-Speaker Examples
```
"Generate a conversation between Dr. Anya (voice: Kore) and Liam (voice: Puck) about AI"
"Create an interview with host (voice: Zephyr) and guest (voice: Orus) discussing climate change"
"Make a story with narrator (voice: Schedar) and character (voice: Laomedeia)"
"Create a podcast intro with Alex (voice: Achird) and Jamie (voice: Autonoe)"
```
### Single Speaker Examples
```
"Generate speech: 'Welcome to our podcast' with voice 'Kore'"
"Create audio: 'Say cheerfully: Have a wonderful day!' with voice 'Puck'"
"Make a formal announcement: 'Speak in a formal tone: Important news today' with voice 'Zephyr'"
```
### File Management
- Save audio files with descriptive names
- Organize files by episode or content type
- Use appropriate file formats (WAV)
Always provide clear feedback about what you're creating and explain your voice choices.
**CRITICAL**: For multi-speaker requests, always generate ONE cohesive audio file with ALL speakers, never split into separate files.
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local # CLI provides storePath automatically
maxBlobSize: 52428800 # 50MB per blob
maxTotalSize: 1073741824 # 1GB total storage
cleanupAfterDays: 30
toolConfirmation:
mode: auto-approve
# timeout: omitted = infinite wait
allowedToolsStorage: memory
# Prompts - podcast and audio generation examples shown as clickable buttons in WebUI
prompts:
- type: inline
id: create-intro
title: "🎙️ Create Podcast Intro"
description: "Generate a multi-speaker podcast introduction"
prompt: "Create a podcast intro with two hosts, Alex (voice: Achird) and Jamie (voice: Autonoe), welcoming listeners to a tech podcast."
category: podcasting
priority: 10
showInStarters: true
- type: inline
id: generate-conversation
title: "💬 Generate Conversation"
description: "Create multi-speaker dialogue"
prompt: "Generate a 2-minute conversation between Dr. Anya (voice: Kore) and Liam (voice: Puck) discussing the future of artificial intelligence."
category: conversation
priority: 9
showInStarters: true
- type: inline
id: list-voices
title: "🔊 Explore Voices"
description: "Browse available voice options"
prompt: "Show me all available voices with their characteristics to help me choose the right ones for my podcast."
category: discovery
priority: 8
showInStarters: true
- type: inline
id: single-speaker
title: "🗣️ Generate Speech"
description: "Create single-speaker audio"
prompt: "Generate a cheerful welcome announcement using voice Puck saying 'Welcome to our amazing podcast! We're thrilled to have you here today.'"
category: speech
priority: 7
showInStarters: true

View File

@@ -0,0 +1,152 @@
# Product Analysis Agent
# AI agent for product analytics and insights using PostHog
# Uses the official PostHog MCP server to interact with your analytics data
mcpServers:
posthog:
type: stdio
command: npx
args:
- -y
- mcp-remote@0.1.31
- https://mcp.posthog.com/sse
- --header
- "Authorization:Bearer $POSTHOG_API_KEY"
timeout: 60000
connectionMode: strict
greeting: "Hi! I'm your Product Analysis Agent. I can help you understand your users, track feature adoption, analyze errors, and uncover insights from your PostHog data. What would you like to explore?"
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are a Product Analysis Agent specialized in helping teams understand their product usage, user behavior, and application health through PostHog analytics. You have direct access to PostHog data, enabling data-driven product decisions.
## Your Capabilities
**Project Management:**
- List and view all PostHog projects in your organization
- Access project metadata and configurations
- Navigate between different project contexts
**Analytics & Insights:**
- Query and analyze user behavior patterns
- Track key metrics like user signups, retention, and engagement
- Analyze funnels and conversion rates
- Identify trends and anomalies in product usage
- Generate insights about user segments
**Feature Flags:**
- List all active feature flags in a project
- Query feature flag configurations and rollout percentages
- Analyze feature flag impact on user behavior
- Generate code snippets for feature flag implementation
**Error Tracking:**
- Retrieve recent application errors and exceptions
- Analyze error patterns and frequency
- Access stack traces for debugging
- Identify error trends and affected user segments
**Annotations:**
- Create timestamped annotations for significant events
- Mark product launches, marketing campaigns, or incidents
- Track how events correlate with metric changes
## Analysis Guidelines
When analyzing product data, follow these best practices:
1. **Context First**: Understand what the user is trying to learn before diving into data
2. **Ask Clarifying Questions**: Confirm time ranges, user segments, and specific metrics
3. **Provide Actionable Insights**: Don't just report numbers - explain what they mean
4. **Compare & Contrast**: Show trends over time and compare to benchmarks
5. **Identify Patterns**: Look for correlations and potential causations
6. **Highlight Anomalies**: Point out unusual patterns that may need attention
## Common Analysis Scenarios
- **User Growth**: Track signup trends, activation rates, and cohort retention
- **Feature Adoption**: Measure how users engage with new features
- **Funnel Analysis**: Identify where users drop off in key flows
- **Error Impact**: Understand how errors affect user experience
- **Experiment Results**: Analyze A/B test outcomes and feature flag impact
- **User Segmentation**: Compare behavior across different user groups
## Interaction Guidelines
- Present data in clear, digestible formats (summaries, comparisons, trends)
- Explain technical metrics in business terms when appropriate
- Proactively suggest related analyses that might be valuable
- Recommend actions based on the insights discovered
- Be transparent about data limitations or gaps
## Privacy & Security
- Never expose personally identifiable information (PII)
- Aggregate user data appropriately
- Respect data access permissions
- Be mindful of sensitive business metrics in shared contexts
- id: date
type: dynamic
priority: 10
source: date
enabled: true
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local
maxBlobSize: 52428800
maxTotalSize: 1073741824
cleanupAfterDays: 30
llm:
provider: anthropic
model: claude-sonnet-4-5-20250929
apiKey: $ANTHROPIC_API_KEY
toolConfirmation:
mode: manual
allowedToolsStorage: memory
prompts:
- type: inline
id: user-growth
title: "User Growth"
description: "Analyze user signup and growth trends"
prompt: "Show me user growth trends over the past 30 days. Include signups, activations, and any notable patterns."
category: analytics
priority: 10
showInStarters: true
- type: inline
id: recent-errors
title: "Recent Errors"
description: "View recent application errors"
prompt: "What are the top recent errors in my application? Show me the most common ones with their frequency."
category: errors
priority: 9
showInStarters: true
- type: inline
id: feature-flags
title: "Feature Flags"
description: "List and analyze feature flags"
prompt: "List all active feature flags and their current rollout status."
category: features
priority: 8
showInStarters: true
- type: inline
id: user-behavior
title: "User Behavior"
description: "Analyze how users interact with your product"
prompt: "Help me understand how users are engaging with my product. What are the key behavior patterns?"
category: analytics
priority: 7
showInStarters: true

View File

@@ -0,0 +1,98 @@
# Product Name Research Agent
An AI agent specialized in comprehensive product name research and brand validation. Combines domain availability checking, search engine analysis, developer platform collision detection, and competitive intelligence to provide thorough name validation.
## 📖 Tutorial
For a complete walkthrough of building and using this agent, see the [Product Name Scout Agent Tutorial](../../docs/docs/tutorials/product-name-scout-agent.md).
## Features
- **Domain Availability**: Check multiple TLD extensions (.com, .io, .app, .dev, etc.)
- **SERP Competition Analysis**: Analyze search engine results for brand competition
- **Autocomplete Intelligence**: Assess name recognition and spelling patterns
- **Developer Platform Collision Detection**: Check GitHub, npm, and PyPI for conflicts
- **Competitive Research**: DuckDuckGo-powered market intelligence
- **Comprehensive Scoring**: Weighted algorithms for brand viability assessment
- **Batch Comparison**: Compare multiple names with detailed scoring breakdown
## Prerequisites
Ensure you have the domain checker MCP server available:
```bash
# Install the domain checker MCP server
uvx truffle-ai-domain-checker-mcp
```
## Usage
### Start the Agent
```bash
# From the dexto root directory
dexto -a agents/product-name-researcher/product-name-researcher.yml
```
### Example Interactions
**Single Product Name Research:**
```
User: I want to research the name "CloudSync" for my new file sync product
Agent: [Performs comprehensive research including domain availability, trademark search, social media handles, and competitive analysis]
```
**Compare Multiple Names:**
```
User: Help me choose between "DataFlow", "InfoStream", and "SyncHub" for my data management tool
Agent: [Compares all three names across multiple criteria and provides recommendations]
```
**Domain-Focused Research:**
```
User: Check domain availability for "myawesomeapp" across all major TLDs
Agent: [Uses domain checker to verify availability across .com, .net, .org, .io, .app, etc.]
```
## Configuration
The agent uses:
- **Domain Checker MCP Server**: For domain availability checking
- **DuckDuckGo MCP Server**: For web search and competitive research
- **Product Name Scout MCP Server**: For SERP analysis, autocomplete, and developer collision detection
## Research Report
The agent generates comprehensive reports including:
1. **Domain Availability Summary**
- Available domains with recommendations
- Pricing information where available
- Alternative TLD suggestions
2. **Trademark Analysis**
- Similar trademarks found
- Risk assessment
- Recommendations for trademark clearance
3. **Developer Platform Analysis**
- GitHub repository conflicts
- NPM package collisions
- PyPI package conflicts
4. **Competitive Landscape**
- Existing products with similar names
- Market positioning analysis
- Differentiation opportunities
5. **Overall Recommendation**
- Scoring across all criteria
- Risk assessment
- Next steps recommendations
## Tips for Best Results
- **Be specific about your product**: Include the product category and target market
- **Provide alternatives**: Give multiple name options for comparison
- **Consider your priorities**: Mention if domain availability, trademark clearance, or developer platform conflicts are most important
- **Think internationally**: Consider how the name works in different languages and markets

View File

@@ -0,0 +1,207 @@
# Product Name Research Agent Configuration
# Specializes in comprehensive product name validation including domain availability,
# trademark searching, social media handle checking, and competitive analysis
mcpServers:
# Domain availability checking
domain-checker:
type: stdio
command: uvx
args:
- truffle-ai-domain-checker-mcp
# Web search for competitive research and trademark checking
duckduckgo:
type: stdio
command: uvx
args:
- duckduckgo-mcp-server
# Advanced product name research tools (SERP analysis, autocomplete, dev collisions, scoring)
product-name-scout:
type: stdio
command: npx
args:
- "@truffle-ai/product-name-scout-mcp"
# Optional greeting shown at chat start (UI can consume this)
greeting: "🔍 Hi! I'm your Product Name Researcher. What name shall we explore today?"
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are a specialized Product Name Research Agent focused on helping entrepreneurs, product managers, and marketing teams validate potential product names through comprehensive research. Your expertise combines domain availability checking with competitive landscape analysis and market research.
## Your Core Capabilities
### 1. Domain Availability Research
- Use the domain-checker tools to verify domain availability across multiple TLDs
- Prioritize .com, .ai, .dev, .org, .io, .app and .tech extensions, in that order.
- Provide recommendations on domain alternatives and pricing considerations
- Check domain variations (with/without hyphens, plurals, abbreviations)
- Compare multiple domain options for product names
### 2. Competitive Research & Market Analysis
- Use DuckDuckGo search to research existing products/companies with similar names
- Search for trademark conflicts and existing brand usage
- Analyze competitive landscape and market positioning
- Research industry-specific naming conventions and trends
- Identify potential brand confusion or conflicts
### 3. Comprehensive Brand Validation
- Combine domain availability with competitive research
- Assess market saturation for similar product names
- Evaluate naming conflicts across different industries
- Research social media presence and brand mentions
- Provide risk assessments for trademark and competitive conflicts
## Research Methodology
### For Single Name Research:
1. **Domain Availability Check**: Use domain-checker to verify availability across key TLDs
2. **Competitive Analysis**: Search DuckDuckGo for existing companies/products with similar names
3. **Trademark Research**: Search for trademark conflicts and existing brand usage
4. **Market Context**: Research industry usage and naming patterns
5. **Risk Assessment**: Evaluate potential conflicts and brand confusion risks
6. **Strategic Recommendations**: Provide actionable recommendations based on all findings
### For Multiple Name Comparison:
1. **Batch Domain Analysis**: Check all names across key TLD extensions
2. **Competitive Research**: Search each name for existing market presence
3. **Comparison Matrix**: Create comprehensive comparison including domains and competitive landscape
4. **Scoring & Ranking**: Rank names based on availability, competitive conflicts, and strategic value
5. **Final Recommendation**: Provide clear recommendation with detailed reasoning
## Key Guidelines
### Domain Research Best Practices:
- Always start with .com availability as the highest priority
- Check .ai, .dev, .io, .app, .tech for tech/startup products
- Consider .org for non-profits or community-focused products
- Test common misspellings and character variations
- Look for patterns in domain availability that might indicate trademark issues
### Competitive Research Best Practices:
- Search for exact name matches and close variations
- Research across different industries and markets
- Look for existing trademarks and brand registrations
- Check for social media presence and brand mentions
- Identify potential customer confusion risks
- Consider international markets and global brand presence
### Search Strategy Guidelines:
- Use specific search queries: "[name] company", "[name] trademark", "[name] brand"
- Search for industry-specific usage: "[name] [industry]", "[name] product"
- Look for legal conflicts: "[name] lawsuit", "[name] trademark dispute"
- Check domain parking and cybersquatting patterns
- Research naming trends in the target industry
### Interaction Guidelines:
- **Ask targeted questions**: Product category, target market, budget considerations
- **Provide context**: Explain why domain choices matter for business success
- **Be practical**: Focus on actionable domain strategies within user's budget
- **Offer alternatives**: When preferred domains are taken, suggest creative variations
- **Think holistically**: Consider how domain choice impacts overall brand strategy
## Available Tools
### Domain Checking Tools:
1. **check_domain(domain)**: Check a single domain's availability
2. **check_multiple_domains(domains)**: Check multiple domains at once
3. **check_domain_variations(base_name, extensions)**: Check a name across multiple TLD extensions
### Advanced Name Analysis Tools:
1. **check_brand_serp(name, engine, limit)**: Analyze search engine results for brand competition and searchability
2. **get_autocomplete(name)**: Get search engine autocomplete suggestions to assess name recognition
3. **check_dev_collisions(name, platforms)**: Check for existing projects on GitHub, npm, PyPI
4. **score_name(name, weights, rawSignals)**: Get comprehensive scoring across multiple factors
### Research Tools:
1. **search(query, max_results)**: Search DuckDuckGo for competitive research and market analysis
2. **get_content(url)**: Extract and analyze content from specific web pages
## Tool Usage Strategy:
**For Comprehensive Research:**
1. Start with domain availability using domain-checker tools
2. Analyze search competition: `check_brand_serp(name)` to assess existing brand presence
3. Check autocomplete patterns: `get_autocomplete(name)` to understand search behavior
4. Identify developer conflicts: `check_dev_collisions(name)` for tech product names
5. Search for existing companies/products: `search("[name] company")`
6. Check for trademarks: `search("[name] trademark")`
7. Research industry usage: `search("[name] [industry] product")`
8. Look for legal issues: `search("[name] lawsuit trademark dispute")`
9. Get comprehensive scoring: `score_name(name)` for overall assessment
10. Get detailed content from relevant pages using `get_content(url)`
Use these tools strategically to provide comprehensive product name validation that combines technical availability with market intelligence.
- id: date
type: dynamic
priority: 10
source: date
enabled: true
# LLM configuration
llm:
provider: anthropic
model: claude-sonnet-4-5-20250929
apiKey: $ANTHROPIC_API_KEY
# Storage configuration
storage:
cache:
type: in-memory
database:
type: sqlite
# Tool confirmation - auto-approve for seamless domain checking
toolConfirmation:
mode: auto-approve
allowedToolsStorage: memory
# Prompts - product name research examples shown as clickable buttons in WebUI
prompts:
- type: inline
id: research-name
title: "🔍 Research Product Name"
description: "Comprehensive name validation"
prompt: "I want to research the name 'CloudSync' for my new file sync product. Check domain availability, trademark conflicts, and competitive landscape."
category: research
priority: 10
showInStarters: true
- type: inline
id: compare-names
title: "⚖️ Compare Multiple Names"
description: "Compare and score name options"
prompt: "Help me choose between 'DataFlow', 'InfoStream', and 'SyncHub' for my data management tool. Compare them across all criteria."
category: comparison
priority: 9
showInStarters: true
- type: inline
id: check-domains
title: "🌐 Check Domain Availability"
description: "Verify domain availability across TLDs"
prompt: "Check if 'myawesomeapp' is available across .com, .io, .app, and .dev domains."
category: domains
priority: 8
showInStarters: true
- type: inline
id: trademark-search
title: "™️ Search Trademarks"
description: "Find potential trademark conflicts"
prompt: "Search for existing trademarks similar to 'TechFlow' in the software industry."
category: legal
priority: 7
showInStarters: true
- type: inline
id: dev-collisions
title: "💻 Check Developer Platforms"
description: "Find conflicts on GitHub, npm, PyPI"
prompt: "Check if 'awesome-toolkit' is available on GitHub, npm, and PyPI."
category: development
priority: 6
showInStarters: true

View File

@@ -0,0 +1,122 @@
# Sora Video Agent
A Dexto agent specialized in AI video generation using OpenAI's Sora technology. This agent provides a comprehensive interface for creating, managing, and manipulating AI-generated videos.
## Features
- **🎬 Video Generation**: Create videos from text prompts with custom settings
- **📊 Progress Monitoring**: Real-time status updates during video generation
- **🎭 Video Remixing**: Create variations and extensions of existing videos
- **📁 File Management**: Automatic download and organization of generated videos
- **🖼️ Reference Support**: Use images or videos as reference for consistent style
- **🗂️ Video Library**: List and manage all your generated videos
## Capabilities
### Video Creation
- Generate videos from detailed text prompts
- Customize duration (4s, 8s, 16s, 32s)
- Choose resolution for different platforms:
- **Vertical (9:16)**: 720x1280, 1024x1808 - Perfect for social media
- **Horizontal (16:9)**: 1280x720, 1808x1024 - Great for YouTube
- **Square (1:1)**: 1024x1024 - Ideal for Instagram posts
### Reference-Based Generation
- Use existing images or videos as style references
- Maintain character consistency across multiple videos
- Apply specific visual styles or aesthetics
### Video Management
- Monitor generation progress with real-time updates
- List all your videos with status information
- Download completed videos automatically
- Delete unwanted videos to manage storage
### Creative Workflows
- Create video series with consistent characters
- Generate multiple variations of the same concept
- Extend existing videos with new scenes
- Build comprehensive video libraries
## Usage Examples
### Basic Video Generation
```text
Create a video of a cat playing piano in a cozy living room
```
### Custom Settings
```text
Generate an 8-second video in 16:9 format showing a sunset over mountains
```
### Reference-Based Creation
```text
Create a video using this image as reference, showing the character walking through a forest
```
### Video Remixing
```text
Create a remix of video_123 showing the same character but in a different setting
```
## Best Practices
1. **Detailed Prompts**: Be specific about characters, settings, actions, and mood
2. **Platform Optimization**: Choose the right aspect ratio for your target platform
3. **Progressive Creation**: Start with shorter videos for testing, then create longer versions
4. **Style Consistency**: Use reference images/videos for character or style continuity
5. **Library Management**: Regularly organize and clean up your video collection
## Technical Requirements
- OpenAI API key with Sora access
- Node.js 18+ for running npx
- Sufficient storage space for video downloads
## Setup
### Default Setup (Recommended)
By default, this agent uses the published `@truffle-ai/sora-video-server` NPM package via `npx`. No additional installation is required - the package will be automatically fetched and run when the agent starts.
```yaml
mcpServers:
sora_video:
type: stdio
command: npx
args:
- -y
- "@truffle-ai/sora-video-server"
connectionMode: strict
env:
OPENAI_API_KEY: $OPENAI_API_KEY
```
### Local Development Setup (Optional)
If you're developing or modifying the Sora agent locally, you can override the default behavior:
1. Clone and build the MCP Sora server locally
2. Set the environment variable to point to your local installation:
```bash
export MCP_SORA_VIDEO_PATH="/path/to/mcp-servers/src/sora-video/dist/index.js"
```
3. Update the agent YAML to use the local path instead of npx:
Add the environment variable to your shell profile (`.bashrc`, `.zshrc`, etc.) to persist across sessions.
## Workflow
1. **Plan**: Define your video concept and requirements
2. **Generate**: Create the initial video with your prompt
3. **Monitor**: Check progress and wait for completion
4. **Download**: Save the completed video to your device
5. **Iterate**: Create variations or remixes as needed
6. **Organize**: Manage your video library efficiently
This agent makes AI video generation accessible and efficient, providing all the tools you need to create professional-quality videos with OpenAI's Sora technology.

View File

@@ -0,0 +1,106 @@
# Dexto Agent Configuration for Sora Video Generation MCP Server
# Optional greeting shown at chat start (UI can consume this)
greeting: "🎬 Hello! I'm your Sora Video Agent. Let's create some amazing videos together!"
systemPrompt: |
You are an AI assistant specialized in video generation using OpenAI's Sora technology. You have access to a comprehensive set of tools for creating, managing, and manipulating AI-generated videos including:
- **Video Generation**: Create videos from text prompts with custom duration, resolution, and style
- **Reference-Based Creation**: Use images or videos as reference for more precise generation
- **Video Management**: Monitor generation progress, list all videos, and organize your creations
- **Video Remixing**: Create variations and extensions of existing videos with new prompts
- **File Management**: Automatically download and organize generated videos
- **Quality Control**: Delete unwanted videos and manage storage efficiently
When working with video generation:
1. Always provide clear, detailed prompts for the best results
2. Consider the target audience and use case when choosing duration and resolution
3. Monitor video generation progress and provide status updates
4. Suggest creative variations and remixes when appropriate
5. Help users organize and manage their video library
6. Provide guidance on optimal video settings for different use cases
**Supported Video Specifications:**
- **Durations**: 4s, 8s, 16s, 32s
- **Resolutions**: 720x1280 (9:16), 1280x720 (16:9), 1024x1024 (1:1), 1024x1808 (9:16 HD), 1808x1024 (16:9 HD)
- **Reference Formats**: JPG, PNG, WebP, MP4, MOV, AVI, WebM
**Best Practices:**
- Use descriptive, specific prompts for better results
- Consider the aspect ratio for your intended platform (vertical for social media, horizontal for YouTube)
- Start with shorter durations for testing, then create longer versions
- Use reference images/videos for consistent style or character continuity
- Monitor generation progress as it typically takes 1-3 minutes
- Save completed videos promptly to avoid losing access
mcpServers:
sora_video:
type: stdio
command: npx
args:
- -y
- "@truffle-ai/sora-video-server"
connectionMode: strict
env:
OPENAI_API_KEY: $OPENAI_API_KEY
toolConfirmation:
mode: "auto-approve"
allowedToolsStorage: "memory"
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
internalResources:
enabled: true
resources:
- type: blob
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local # CLI provides storePath automatically
maxBlobSize: 209715200 # 200MB per blob (for HD videos up to 32 seconds)
maxTotalSize: 2147483648 # 2GB total storage
cleanupAfterDays: 30
# Prompts - video generation examples shown as clickable buttons in WebUI
prompts:
- type: inline
id: create-video
title: "🎬 Create Video"
description: "Generate video from text prompt"
prompt: "Create an 8-second video of a cat playing piano in a cozy living room with warm lighting."
category: generation
priority: 10
showInStarters: true
- type: inline
id: nature-video
title: "🌄 Nature Video"
description: "Generate scenic landscape video"
prompt: "Generate an 8-second video in 16:9 format showing a breathtaking sunset over mountains with clouds moving across the sky."
category: nature
priority: 9
showInStarters: true
- type: inline
id: social-video
title: "📱 Social Media Video"
description: "Create vertical video for social platforms"
prompt: "Create a 4-second vertical video (9:16) showing a product reveal with dramatic lighting."
category: social-media
priority: 8
showInStarters: true
- type: inline
id: futuristic-video
title: "🚀 Futuristic Scene"
description: "Generate sci-fi themed video"
prompt: "Create a 16-second video showing a futuristic cityscape with flying cars and neon lights at night."
category: sci-fi
priority: 7
showInStarters: true

View File

@@ -0,0 +1,166 @@
# Talk2PDF Agent
A comprehensive AI agent for parsing and analyzing PDF documents using the [Talk2PDF MCP Server](https://github.com/truffle-ai/mcp-servers/tree/main/src/talk2pdf).
This agent provides intelligent PDF document processing through a TypeScript-based MCP server that can extract text, metadata, and search for specific content within PDF files.
## Features
### 📄 **PDF Parsing & Text Extraction**
- **Full Document Parsing**: Extract complete text content from PDF files
- **Metadata Extraction**: Get document information (title, author, page count, creation date)
- **Format Support**: Handle various PDF versions and structures
- **Error Handling**: Graceful handling of corrupted or protected PDFs
### 🔍 **Content Search & Analysis**
- **Section Extraction**: Search for and extract specific content sections
- **Intelligent Filtering**: Find content containing specific terms or patterns
- **Context Preservation**: Maintain document structure and formatting
- **Multi-page Support**: Process documents of any length
### 🧠 **AI-Powered Analysis**
- **Document Summarization**: Generate intelligent summaries of PDF content
- **Key Information Extraction**: Identify and extract important details
- **Question Answering**: Answer questions about document content
- **Content Classification**: Analyze document type and structure
## Quick Start
### Prerequisites
- **Node.js 20+**: For the Dexto framework
- **TypeScript**: Automatically managed by the MCP server
### Installation
1. **Run the Agent**:
```bash
# From the dexto project root
dexto --agent agents/talk2pdf-agent/talk2pdf-agent.yml
```
That's it! The MCP server will be automatically downloaded and installed via `npx` on first run.
## Configuration
The agent is configured to use the published MCP server:
```yaml
mcpServers:
talk2pdf:
type: stdio
command: npx
args:
- "@truffle-ai/talk2pdf-mcp"
timeout: 30000
connectionMode: strict
```
## MCP Server
This agent uses the **Talk2PDF MCP Server**, which is maintained separately at:
**🔗 [https://github.com/truffle-ai/mcp-servers/tree/main/src/talk2pdf](https://github.com/truffle-ai/mcp-servers/tree/main/src/talk2pdf)**
The MCP server repository provides:
- Complete technical documentation
- Development and contribution guidelines
- Server implementation details
- Advanced configuration options
## Available Tools
### PDF Processing Tools
#### `parse_pdf`
Extract complete text content and metadata from a PDF file.
**Parameters:**
- `filePath` (string): Path to the PDF file to parse
**Returns:**
- Full text content of the document
- Document metadata (title, author, page count, creation date, etc.)
- File information (size, format)
#### `extract_section`
Search for and extract specific content sections from a PDF.
**Parameters:**
- `filePath` (string): Path to the PDF file
- `searchTerms` (string): Terms or patterns to search for
- `maxResults` (number, optional): Maximum number of results to return
**Returns:**
- Matching content sections with context
- Page numbers and locations
- Relevance scoring
## Supported PDF Features
- **Standard PDF formats**: PDF 1.4 through 2.0
- **Text-based PDFs**: Documents with extractable text content
- **Multi-page documents**: No page limit restrictions
- **Metadata support**: Title, author, creation date, modification date
- **Various encodings**: UTF-8, Latin-1, and other standard encodings
## Example Usage
### Basic PDF Parsing
```
"Parse the PDF at /path/to/document.pdf and show me the full content"
"Extract all text and metadata from my research paper"
"What's in this PDF file?"
```
### Content Search
```
"Find all sections about 'machine learning' in the PDF"
"Extract the introduction and conclusion from this document"
"Search for mentions of 'budget' in the financial report"
```
### Document Analysis
```
"Summarize the main points from this PDF"
"What is this document about?"
"Extract the key findings from the research paper"
"List all the recommendations mentioned in the report"
```
### Intelligent Q&A
```
"What are the main conclusions of this study?"
"Who are the authors of this document?"
"When was this document created?"
"How many pages does this PDF have?"
```
## Troubleshooting
### Common Issues
1. **Server Installation**: The MCP server will be automatically installed via `npx` on first run. No manual setup required.
2. **PDF Access Issues**: Ensure the PDF file path is correct and the file is readable. Protected or encrypted PDFs may require special handling.
3. **Memory Issues**: For very large PDFs (100+ pages), processing may take longer. Consider breaking large documents into sections.
4. **Text Extraction**: If text appears garbled, the PDF may use non-standard encoding or be scanned image-based (OCR not supported).
### Error Handling
The agent provides clear error messages for common issues:
- File not found or inaccessible
- Invalid PDF format
- Corrupted PDF files
- Permission-protected documents
## Getting Help
- **MCP Server Issues**: Report at the [mcp-servers repository](https://github.com/truffle-ai/mcp-servers/issues)
- **Agent Configuration**: Report at the main Dexto repository
- **Feature Requests**: Use the mcp-servers repository for tool-related requests
## License
This project is part of the Dexto AI agent framework.

View File

@@ -0,0 +1,57 @@
# Talk2PDF Agent
# This agent provides natural language access to PDF parsing tools via a custom MCP server
mcpServers:
talk2pdf:
type: stdio
command: npx
args:
- "@truffle-ai/talk2pdf-mcp"
timeout: 30000
connectionMode: strict
# Optional greeting shown at chat start (UI can consume this)
greeting: "📄 Hi! I'm your PDF Agent. Share a document and let's explore it together!"
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are a Talk2PDF Agent. You can parse PDF files, extract their text, metadata, and provide summaries or extract specific sections for LLM consumption.
## Your Capabilities
- Parse PDF files and extract all text content and metadata
- Extract specific sections or search for terms within a PDF
- Provide intelligent analysis, summarization, and insights based on the extracted content
- Handle errors gracefully and provide clear feedback
## Usage Examples
- "Parse the PDF at /path/to/file.pdf and show me the text."
- "Analyze and summarize the document at /path/to/file.pdf."
- "Extract all content containing 'invoice' from /path/to/file.pdf and explain what you found."
Always ask for the file path if not provided. If a file is not a PDF or does not exist, inform the user.
- id: date
type: dynamic
priority: 10
source: date
enabled: true
# Storage configuration
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local # CLI provides storePath automatically
maxBlobSize: 52428800 # 50MB per blob
maxTotalSize: 1073741824 # 1GB total storage
cleanupAfterDays: 30
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY

View File

@@ -0,0 +1,337 @@
# TeamFlow Customer Support Triage Agent System
This demonstration showcases an intelligent **Customer Support Triage System** built with Dexto agents for **TeamFlow**, a cloud-based project management and team collaboration platform. The system automatically analyzes customer inquiries, routes them to specialized support agents, and provides complete customer support responses.
## 🏢 About TeamFlow (Demo Business Context)
TeamFlow is a fictional cloud-based project management platform used for this demonstration. It offers three service tiers:
- **Basic Plan ($9/user/month)**: Up to 10 team members, 5GB storage, basic features
- **Pro Plan ($19/user/month)**: Up to 100 team members, 100GB storage, advanced integrations (Slack, GitHub, Salesforce)
- **Enterprise Plan ($39/user/month)**: Unlimited users, 1TB storage, SSO, dedicated support
Key features include project management, team collaboration, time tracking, mobile apps, and a comprehensive API. The platform integrates with popular tools like Slack, GitHub, Salesforce, and Google Workspace.
This realistic business context allows the agents to provide specific, accurate responses about pricing, features, technical specifications, and policies using the FileContributor system to access comprehensive documentation.
## 🏗️ Architecture Overview
```
Customer Request
Triage Agent (Main Coordinator)
[Analyzes, Routes & Executes via MCP]
┌─────────────────────────────────────────┐
│ Technical Support │ Billing Agent │
│ Agent │ │
├─────────────────────┼──────────────────┤
│ Product Info │ Escalation │
│ Agent │ Agent │
└─────────────────────────────────────────┘
Complete Customer Response
```
The triage agent doesn't just route requests - it **executes the specialized agents as MCP servers** and provides complete, integrated customer support responses that combine routing intelligence with expert answers.
## 🤖 Agent Roles
### 1. **Triage Agent** (`triage-agent.yml`)
- **Primary Role**: Intelligent routing coordinator AND customer response provider
- **Capabilities**:
- Analyzes requests and categorizes issues
- Routes to specialists via `chat_with_agent` tool calls
- **Executes specialist agents directly through MCP connections**
- **Provides complete customer responses** combining routing + specialist answers
- **Tools**: Filesystem, web research, **chat_with_agent** (connects to all specialists)
- **Tool Confirmation**: Auto-approve mode for seamless delegation
### 2. **Technical Support Agent** (`technical-support-agent.yml`)
- **Specialization**: Bug fixes, troubleshooting, system issues
- **Tools**: Filesystem, terminal, browser automation
- **Model**: GPT-5 (higher capability for complex technical issues)
- **Connection**: Available as MCP server via stdio
### 3. **Billing Agent** (`billing-agent.yml`)
- **Specialization**: Payments, subscriptions, financial inquiries
- **Tools**: Browser automation, filesystem for policy docs
- **Model**: GPT-5 Mini (efficient for structured billing processes)
- **Connection**: Available as MCP server via stdio
### 4. **Product Info Agent** (`product-info-agent.yml`)
- **Specialization**: Features, comparisons, documentation
- **Tools**: Web research (Tavily), filesystem, browser automation
- **Model**: GPT-5 Mini (efficient for information retrieval)
- **Connection**: Available as MCP server via stdio
### 5. **Escalation Agent** (`escalation-agent.yml`)
- **Specialization**: Complex issues, Enterprise customers, management approval
- **Tools**: Filesystem, web research for compliance/legal info
- **Model**: GPT-5 (higher capability for sensitive issues)
- **Connection**: Available as MCP server via stdio
## 📚 Business Context Documentation
Each agent has access to relevant TeamFlow documentation via the FileContributor system:
### Documentation Files (`docs/` folder)
- **`company-overview.md`**: General company information, plans, SLAs, contact info
- **`technical-documentation.md`**: API docs, system requirements, troubleshooting guides
- **`billing-policies.md`**: Pricing, refund policies, billing procedures, payment methods
- **`product-features.md`**: Feature descriptions, plan comparisons, integrations
- **`escalation-policies.md`**: Escalation procedures, contact information, incident templates
### Agent-Specific Context
- **Technical Support**: Company overview + technical documentation
- **Billing Agent**: Company overview + billing policies
- **Product Info**: Company overview + product features
- **Escalation**: Company overview + escalation policies
- **Triage Agent**: Company overview for routing context
## 🚀 Getting Started
### Quick Start - Integrated Triage System
The **recommended way** to run the triage system is using the main triage agent, which automatically connects to all specialists:
```bash
# Run the complete triage system (connects to all specialist agents automatically)
npx dexto --agent agents/triage-demo/triage-agent.yml
# Test with a customer inquiry
npx dexto --agent agents/triage-demo/triage-agent.yml "I want to upgrade from Basic to Pro but confused about pricing"
```
This will:
1. **Auto-connect** to all 4 specialist agents as MCP servers
2. **Analyze** your request and route to the appropriate specialist
3. **Execute** the specialist agent to get the expert answer
4. **Respond** with a complete customer support response
### Running Individual Agents (Advanced)
For testing individual specialist agents:
```bash
# Run specialized agents individually
npx dexto --agent agents/triage-demo/technical-support-agent.yml
npx dexto --agent agents/triage-demo/billing-agent.yml
npx dexto --agent agents/triage-demo/product-info-agent.yml
npx dexto --agent agents/triage-demo/escalation-agent.yml
```
### Environment Setup
Ensure you have the required API keys in your `.env` file:
```env
OPENAI_API_KEY=your_openai_api_key
TAVILY_API_KEY=your_tavily_api_key # For web research
```
## 📋 Example Scenarios
### Scenario 1: Technical Issue
**Customer Input**: *"My app keeps crashing when I try to upload files. Getting error code 500."*
**Triage Agent Response**:
- **Analysis**: Technical Issue → Route to Technical Support Agent
- **Execution**: Calls `chat_with_agent` → Technical Support provides debugging steps
- **Customer Response**: *"I've routed your issue to our Technical Support team. Here's how to resolve the 500 error when uploading files: [detailed technical troubleshooting steps from specialist]"*
### Scenario 2: Billing Question
**Customer Input**: *"I want to upgrade from Basic to Pro but confused about pricing. Will I be charged the full amount?"*
**Triage Agent Response**:
- **Analysis**: Billing Question → Route to Billing Agent
- **Execution**: Calls `chat_with_agent` → Billing Agent explains prorated pricing
- **Customer Response**: *"I've routed your inquiry to our Billing team. When upgrading from Basic to Pro, you'll only be charged a prorated amount for the remaining billing period - just the difference between plans for the time left in your cycle. The upgrade takes effect immediately."*
### Scenario 3: Product Information
**Customer Input**: *"What's the difference between your Pro and Enterprise plans? I need API access."*
**Triage Agent Response**:
- **Analysis**: Product Inquiry → Route to Product Info Agent
- **Execution**: Calls `chat_with_agent` → Product Info Agent provides detailed comparison
- **Customer Response**: *"I've connected you with our Product team. Both Pro and Enterprise plans include full API access. The main differences are: Pro supports up to 100 users with 100GB storage, while Enterprise offers unlimited users, 1TB storage, SSO, and dedicated support. [detailed feature comparison]"*
### Scenario 4: Escalation Required
**Customer Input**: *"This is my third time contacting support about data privacy concerns. I'm considering legal action."*
**Triage Agent Response**:
- **Analysis**: Legal/Compliance Issue → Route to Escalation Agent
- **Execution**: Calls `chat_with_agent` → Escalation Agent provides management contact
- **Customer Response**: *"I've escalated your data privacy concerns to our senior support team. Given the legal implications, I'm connecting you directly with our compliance manager Sarah Johnson (sarah.johnson@teamflow.com). She'll address your concerns within 2 hours."*
## 🔧 Advanced Configuration
### Current MCP Server Configuration (Automatic)
The triage agent automatically connects to specialists via stdio MCP servers:
```yaml
# Current configuration in triage-agent.yml
mcpServers:
technical_support:
type: stdio
command: npx
args: [dexto, --mode, mcp, --agent, agents/triage-demo/technical-support-agent.yml]
billing_support:
type: stdio
command: npx
args: [dexto, --mode, mcp, --agent, agents/triage-demo/billing-agent.yml]
# Similar configuration for product_info and escalation agents...
```
### Production Configuration (Distributed Servers)
For production deployment, you would run each specialist as a separate server:
```yaml
# triage-agent.yml - Production Configuration
mcpServers:
technical_support:
type: sse
url: "http://localhost:3001/mcp"
headers:
Authorization: "Bearer your-auth-token"
billing_support:
type: sse
url: "http://localhost:3002/mcp"
headers:
Authorization: "Bearer your-auth-token"
product_info:
type: sse
url: "http://localhost:3003/mcp"
headers:
Authorization: "Bearer your-auth-token"
escalation:
type: sse
url: "http://localhost:3004/mcp"
headers:
Authorization: "Bearer your-auth-token"
```
### Running Distributed Servers
```bash
# Terminal 1: Technical Support Server
npx dexto --agent agents/triage-demo/technical-support-agent.yml --mode server --port 3001
# Terminal 2: Billing Support Server
npx dexto --agent agents/triage-demo/billing-agent.yml --mode server --port 3002
# Terminal 3: Product Info Server
npx dexto --agent agents/triage-demo/product-info-agent.yml --mode server --port 3003
# Terminal 4: Escalation Server
npx dexto --agent agents/triage-demo/escalation-agent.yml --mode server --port 3004
# Terminal 5: Main Triage Coordinator
npx dexto --agent agents/triage-demo/triage-agent.yml --mode server --port 3000
```
## 🎯 Key Features Demonstrated
### 1. **Intelligent Routing with Execution**
- Natural language analysis to determine issue category
- **Automatic execution** of specialist agents via MCP
- **Complete customer responses** combining routing + expert answers
- Seamless tool confirmation with auto-approve mode
### 2. **Specialized Expertise Integration**
- Each agent has domain-specific knowledge and tools
- **Real-time coordination** between triage and specialists
- **Unified customer experience** despite multi-agent backend
### 3. **Scalable MCP Architecture**
- **Stdio connections** for local development and testing
- **SSE connections** for distributed production deployment
- **Tool-based delegation** using `chat_with_agent`
### 4. **Comprehensive Tool Access**
- Filesystem access for documentation and logging
- Web research capabilities for up-to-date information
- Browser automation for testing and demonstrations
- **Agent-to-agent communication** via MCP tools
## 🔍 Testing the System
### Interactive Testing
1. **Start the complete triage system**:
```bash
npx dexto --agent agents/triage-demo/triage-agent.yml
```
2. **Test with various customer scenarios** and observe:
- **Routing analysis** (which specialist is chosen)
- **Tool execution** (`chat_with_agent` calls)
- **Complete responses** (routing confirmation + specialist answer)
### Sample Test Cases
```
Test 1: "API returns 401 unauthorized error"
Expected: Technical Support Agent → Complete troubleshooting response
Test 2: "Cancel my subscription immediately"
Expected: Billing Agent → Complete cancellation process and policy info
Test 3: "Do you have a mobile app?"
Expected: Product Info Agent → Complete feature details and download links
Test 4: "Your service caused my business to lose $10,000"
Expected: Escalation Agent → Complete escalation with management contact
```
### One-Shot Testing
```bash
# Test billing scenario
npx dexto --agent agents/triage-demo/triage-agent.yml "I was charged twice this month"
# Test technical scenario
npx dexto --agent agents/triage-demo/triage-agent.yml "Getting 500 errors on file upload"
# Test product scenario
npx dexto --agent agents/triage-demo/triage-agent.yml "What integrations do you support?"
```
## 🚦 Production Considerations
### Security
- Implement proper authentication between agents
- Secure API key management
- Customer data privacy controls
- **Tool confirmation policies** for sensitive operations
### Monitoring
- Log all routing decisions and tool executions
- Track resolution times by agent type
- Monitor escalation patterns
- **Tool usage analytics** for optimization
### Scaling
- Load balance multiple instances of specialist agents
- Implement request queuing for high volume
- **Distributed MCP server deployment**
- Add more specialized agents as needed (e.g., Sales, Onboarding)
## 🤝 Contributing
To extend this triage system:
1. **Add new specialist agents** by creating new YAML configs
2. **Update triage routing logic** in the main agent's system prompt
3. **Configure new agents as MCP servers** in the triage agent's mcpServers section
4. **Test end-to-end flow** including tool execution and complete responses
This demonstration showcases the power of **multi-agent coordination with tool execution** using Dexto's MCP integration capabilities!

View File

@@ -0,0 +1,76 @@
# Billing Agent Configuration
# Specializes in billing, payments, subscriptions, and financial inquiries
systemPrompt:
contributors:
- id: base-prompt
type: static
priority: 0
content: |
You are a specialized Billing Agent for TeamFlow, responsible for handling payment issues, subscription management, and financial inquiries.
Your primary responsibilities:
- Process billing inquiries, payment issues, and subscription changes
- Explain charges, fees, and billing cycles clearly
- Help with payment method updates, refunds, and disputes
- Manage subscription upgrades, downgrades, and cancellations
- Resolve invoice discrepancies and billing errors
Your approach:
- Always verify customer identity before discussing sensitive billing information
- Be transparent about charges, fees, and policies
- Provide clear explanations of billing cycles and payment schedules
- Handle financial disputes with empathy and professionalism
- Escalate complex billing disputes or refund requests beyond your authority
Key information to gather:
- Customer account details and billing address
- Specific billing period or invoice number in question
- Payment method and transaction details when relevant
- Desired outcome or resolution
You have access to comprehensive billing policies, pricing information, and refund procedures for TeamFlow's Basic ($9/user/month), Pro ($19/user/month), and Enterprise ($39/user/month) plans.
Tools available to you:
- Web browsing for checking payment processor status and policies
- Filesystem access for accessing billing documentation and policies
Remember: Handle all financial information with strict confidentiality and always follow TeamFlow's billing policies.
- id: company-overview
type: file
priority: 10
files:
- "${{dexto.agent_dir}}/docs/company-overview.md"
options:
includeFilenames: true
errorHandling: skip
- id: billing-policies
type: file
priority: 20
files:
- "${{dexto.agent_dir}}/docs/billing-policies.md"
options:
includeFilenames: true
errorHandling: skip
mcpServers:
playwright:
type: stdio
command: npx
args:
- -y
- "@playwright/mcp@latest"
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY

View File

@@ -0,0 +1,246 @@
# TeamFlow Billing Policies & Procedures
## Pricing Plans & Features
### Basic Plan - $9/user/month
**Billed monthly or annually ($90/user/year, save 17%)**
**Features Included**:
- Up to 10 team members
- 5GB storage per team
- Core project management (tasks, boards, basic reporting)
- Email support (24-hour response)
- Mobile apps (iOS/Android)
- API access (1,000 requests/hour)
- Basic integrations (Google Calendar, basic file imports)
**Usage Limits**:
- Maximum 1,000 tasks per workspace
- 50MB maximum file upload size
- Email support only
### Pro Plan - $19/user/month
**Billed monthly or annually ($190/user/year, save 17%)**
**Features Included**:
- Up to 100 team members
- 100GB storage per team
- Advanced project management (Gantt charts, custom fields, advanced reporting)
- Priority support (8-hour response, chat support)
- Advanced integrations (Slack, GitHub, Jira, Salesforce)
- API access (10,000 requests/hour)
- Custom workflows and automation
- Time tracking and invoicing
- Advanced security (2FA, audit logs)
**Usage Limits**:
- Maximum 10,000 tasks per workspace
- 100MB maximum file upload size
- Priority support queue
### Enterprise Plan - $39/user/month
**Billed annually only ($468/user/year), minimum 25 users**
**Features Included**:
- Unlimited team members
- 1TB storage per team
- Enterprise security (SSO, SAML, advanced compliance)
- Dedicated customer success manager
- Phone support (4-hour response SLA)
- Unlimited API access
- Custom integrations and white-labeling
- Advanced admin controls
- On-premises deployment option (additional cost)
- 99.95% uptime SLA
**Usage Limits**:
- Unlimited tasks and projects
- 500MB maximum file upload size
- Dedicated support team
## Billing Cycles & Payment Processing
### Billing Dates
- **Monthly Plans**: Charged on the same day each month as initial subscription
- **Annual Plans**: Charged once per year on subscription anniversary
- **Billing Time**: All charges processed at 12:00 AM UTC
- **Failed Payment Retries**: Automatic retries on days 3, 7, and 14
### Accepted Payment Methods
- **Credit Cards**: Visa, MasterCard, American Express, Discover
- **Debit Cards**: Visa and MasterCard debit cards
- **Enterprise Options**: Wire transfer, ACH (US only), annual invoicing
- **International**: PayPal for international customers
- **Cryptocurrency**: Not currently accepted
### Prorated Billing
- **Plan Upgrades**: Immediate access, prorated charge for remaining billing period
- **Plan Downgrades**: Takes effect at next billing cycle, no immediate refund
- **Adding Users**: Prorated charge for new users based on remaining billing period
- **Removing Users**: Credit applied to next invoice
## Refund Policy
### Refund Eligibility
#### Full Refunds (100%)
- **New Subscriptions**: Within 30 days of first payment
- **Service Outages**: If SLA uptime guarantees are not met
- **Billing Errors**: Duplicate charges, incorrect amounts
- **Technical Issues**: If service is unusable and cannot be resolved within 48 hours
#### Partial Refunds
- **Plan Downgrades**: Credit for unused portion (Enterprise to Pro/Basic)
- **Early Cancellation**: Pro-rated refund for annual plans (minimum 90 days required)
- **User Reduction**: Credit applied to next billing cycle
#### No Refunds
- **Basic Plan**: No refunds for monthly Basic plans after 30 days
- **Temporary Outages**: Outages under 4 hours (within SLA)
- **User Error**: Data deletion, misconfiguration, or user training issues
- **Third-party Integration Issues**: Problems with Slack, GitHub, etc.
### Refund Processing Time
- **Credit Cards**: 5-10 business days
- **PayPal**: 24-48 hours
- **Wire Transfer/ACH**: 10-15 business days
## Common Billing Scenarios
### 1. Plan Upgrades
#### Basic to Pro Upgrade
- **Timing**: Immediate access to Pro features
- **Billing**: Prorated charge for Pro plan, credit for unused Basic time
- **Example**: 15 days into Basic monthly cycle → charged $14.50 for remaining Pro time
#### Pro to Enterprise Upgrade
- **Requirements**: Minimum 25 users, annual billing only
- **Process**: Requires sales team approval for custom Enterprise features
- **Migration**: Dedicated success manager assists with transition
### 2. Plan Downgrades
#### Pro to Basic Downgrade
- **Timing**: Takes effect at next billing cycle
- **Data Retention**: 90-day grace period for Pro-only data (advanced reports, etc.)
- **User Limits**: Must reduce team size to 10 users or less before downgrade
#### Enterprise to Pro Downgrade
- **Notice Period**: 60-day notice required
- **Custom Features**: Loss of SSO, dedicated support, custom integrations
- **Partial Refund**: Available for remaining months of annual contract
### 3. User Management
#### Adding Users
- **Process**: Admin adds users in account settings
- **Billing**: Prorated charge for remaining billing period
- **Automatic**: Charges appear on next invoice with detailed breakdown
#### Removing Users
- **Deactivation**: Admin can deactivate users immediately
- **Billing Impact**: Credit applied to next billing cycle
- **Data Retention**: User data retained for 30 days in case of reactivation
### 4. Payment Failures
#### First Failed Payment
- **Action**: Automatic retry in 3 days
- **User Impact**: No service interruption
- **Notification**: Email sent to account admin
#### Second Failed Payment (Day 7)
- **Action**: Second automatic retry
- **User Impact**: Warning banner in app
- **Notification**: Email and in-app notification
#### Third Failed Payment (Day 14)
- **Action**: Final automatic retry
- **User Impact**: Account enters "Past Due" status
- **Features**: Read-only access, limited functionality
#### Account Suspension (Day 21)
- **Action**: Account suspended if payment still fails
- **User Impact**: Complete loss of access
- **Data Retention**: 30-day grace period before data deletion
### 5. Currency & International Billing
#### Supported Currencies
- **Primary**: USD (US Dollar)
- **Additional**: EUR (Euro), GBP (British Pound), CAD (Canadian Dollar)
- **Exchange Rates**: Updated daily, charged in customer's local currency when available
#### International Considerations
- **VAT/Taxes**: Applied automatically based on billing address
- **Payment Methods**: PayPal preferred for international customers
- **Currency Conversion**: Customer's bank may apply additional conversion fees
## Enterprise Billing
### Custom Pricing
- **Volume Discounts**: Available for 100+ users
- **Multi-year Agreements**: Additional discounts for 2-3 year contracts
- **Custom Features**: Additional costs for white-labeling, on-premises deployment
### Invoice Process
- **Net Terms**: 30-day payment terms standard
- **PO Numbers**: Purchase order numbers accepted and included on invoices
- **Multiple Billing Contacts**: Support for separate billing and technical contacts
- **Custom Payment Terms**: Negotiable for large enterprise accounts
## Billing Support Procedures
### Customer Identity Verification
Before discussing billing information, verify:
1. **Account Email**: Customer must provide account email address
2. **Last Payment Amount**: Ask for recent payment amount/date
3. **Billing Address**: Verify last 4 digits of ZIP/postal code
4. **Security Question**: Account-specific security question if configured
### Common Resolution Steps
#### Duplicate Charges
1. Verify both charges in billing system
2. Check if customer has multiple accounts
3. Process immediate refund for duplicate charge
4. Update payment method if card was charged twice due to processing error
#### Failed Payment Recovery
1. Verify current payment method on file
2. Check for expired cards or insufficient funds
3. Update payment method if needed
4. Process manual payment if urgently needed
5. Restore account access immediately upon successful payment
#### Subscription Cancellation
1. Confirm customer intent to cancel
2. Offer plan downgrade as alternative
3. Process cancellation for end of current billing period
4. Provide data export instructions
5. Send confirmation email with final billing details
### Escalation Triggers
Escalate to Finance Team when:
- Refund requests over $500
- Enterprise contract modifications
- Custom pricing negotiations
- Legal or compliance billing questions
- Suspected fraudulent activity
- International tax questions
### Billing System Access
#### Internal Tools
- **Billing Dashboard**: Real-time subscription and payment status
- **Payment Processor**: Stripe dashboard for transaction details
- **Invoice System**: Generate and send custom invoices
- **Refund Portal**: Process refunds up to $500 limit
#### Customer Tools
- **Account Billing Page**: Self-service billing management
- **Invoice Download**: PDF invoices for all past payments
- **Payment Method Update**: Credit card and PayPal management
- **Usage Reports**: Storage and API usage tracking

View File

@@ -0,0 +1,94 @@
# TeamFlow - Company Overview
## About TeamFlow
TeamFlow is a leading cloud-based project management and team collaboration platform that helps organizations streamline their workflows, improve team productivity, and deliver projects on time. Founded in 2019, we serve over 50,000 companies worldwide, from small startups to Fortune 500 enterprises.
## Our Mission
To empower teams to work more efficiently and collaboratively through intuitive project management tools and seamless integrations with the tools they already use.
## Key Products & Services
### TeamFlow Platform
- **Project Management**: Kanban boards, Gantt charts, task management
- **Team Collaboration**: Real-time chat, file sharing, video conferencing integration
- **Time Tracking**: Automated time tracking with detailed reporting
- **Resource Management**: Team capacity planning and workload balancing
- **Analytics & Reporting**: Custom dashboards and project insights
### TeamFlow API
- RESTful API with comprehensive documentation
- Webhook support for real-time notifications
- Rate limits: 1,000 requests/hour (Basic), 10,000/hour (Pro), unlimited (Enterprise)
- SDKs available for JavaScript, Python, PHP, and Ruby
### TeamFlow Mobile Apps
- Native iOS and Android applications
- Offline synchronization capabilities
- Push notifications for project updates
## Service Plans
### Basic Plan - $9/user/month
- Up to 10 team members
- 5GB storage per team
- Core project management features
- Email support
- API access (1,000 requests/hour)
### Pro Plan - $19/user/month
- Up to 100 team members
- 100GB storage per team
- Advanced reporting and analytics
- Priority email and chat support
- Advanced integrations (Slack, GitHub, Jira)
- API access (10,000 requests/hour)
- Custom fields and workflows
### Enterprise Plan - $39/user/month
- Unlimited team members
- 1TB storage per team
- Advanced security (SSO, 2FA)
- Dedicated customer success manager
- Phone support with 4-hour response SLA
- Unlimited API access
- Custom integrations and white-labeling
- Advanced admin controls and audit logs
## Key Integrations
- **Communication**: Slack, Microsoft Teams, Discord
- **Development**: GitHub, GitLab, Bitbucket, Jira
- **File Storage**: Google Drive, Dropbox, OneDrive
- **Calendar**: Google Calendar, Outlook, Apple Calendar
- **Time Tracking**: Toggl, Harvest, RescueTime
- **CRM**: Salesforce, HubSpot, Pipedrive
## Service Level Agreements (SLA)
### Uptime Commitments
- Basic Plan: 99.5% uptime
- Pro Plan: 99.9% uptime
- Enterprise Plan: 99.95% uptime with dedicated infrastructure
### Support Response Times
- Basic: Email support within 24 hours
- Pro: Email/chat support within 8 hours
- Enterprise: Phone/email/chat support within 4 hours
## Security & Compliance
- SOC 2 Type II certified
- GDPR compliant
- ISO 27001 certified
- Enterprise-grade encryption (AES-256)
- Regular security audits and penetration testing
## Contact Information
- **Headquarters**: San Francisco, CA
- **Support Email**: support@teamflow.com
- **Sales Email**: sales@teamflow.com
- **Emergency Escalation**: escalations@teamflow.com
- **Phone**: 1-800-TEAMFLOW (1-800-832-6356)

View File

@@ -0,0 +1,301 @@
# TeamFlow Escalation Policies & Procedures
## Escalation Overview
The escalation process ensures that complex, sensitive, or high-priority customer issues receive appropriate attention from senior staff and management. This document outlines when to escalate, escalation paths, and procedures for different types of issues.
## Escalation Criteria
### Immediate Escalation (Within 15 minutes)
#### Security & Data Incidents
- Suspected data breach or unauthorized access
- Customer reports potential security vulnerability
- Malicious activity detected on customer accounts
- Data loss or corruption affecting customer data
- Compliance violations (GDPR, HIPAA, SOC 2)
#### Service Outages
- Platform-wide service disruption
- API downtime affecting multiple customers
- Critical infrastructure failures
- Database connectivity issues
- CDN or hosting provider problems
#### Legal & Compliance Issues
- Legal threats or litigation mentions
- Regulatory compliance inquiries
- Subpoenas or legal document requests
- Data deletion requests under GDPR "Right to be Forgotten"
- Intellectual property disputes
### Priority Escalation (Within 1 hour)
#### Enterprise Customer Issues
- Any issue affecting Enterprise customers
- SLA violations for Enterprise accounts
- Dedicated success manager requests
- Custom integration problems
- White-label deployment issues
#### Financial Impact
- Billing system errors affecting multiple customers
- Payment processor failures
- Refund requests over $1,000
- Revenue recognition issues
- Contract modification requests
#### High-Value Accounts
- Customers with >$50k annual contract value
- Fortune 500 company issues
- Potential churn indicators for major accounts
- Competitive pressures from large customers
- Expansion opportunity discussions
### Standard Escalation (Within 4 hours)
#### Technical Issues
- Unresolved technical problems after 24 hours
- Multiple failed resolution attempts
- Customer-reported bugs affecting core functionality
- Integration partner API issues
- Performance degradation reports
#### Customer Satisfaction
- Formal complaints about service quality
- Requests to speak with management
- Negative feedback about support experience
- Social media mentions requiring response
- Product feature requests from Pro customers
## Escalation Paths
### Level 1: First-Line Support
- **Technical Support Agent**: Technical issues, bugs, troubleshooting
- **Billing Agent**: Payment, subscription, pricing questions
- **Product Info Agent**: Features, plans, general information
- **Response Time**: 24 hours (Basic), 8 hours (Pro), 4 hours (Enterprise)
### Level 2: Senior Support
- **Senior Technical Specialist**: Complex technical issues, integration problems
- **Billing Manager**: Billing disputes, refund approvals, contract changes
- **Product Manager**: Feature requests, product feedback, roadmap questions
- **Response Time**: 4 hours (all plans)
### Level 3: Management
- **Support Manager**: Service quality issues, team performance, process improvements
- **Engineering Manager**: System outages, security incidents, technical escalations
- **Finance Director**: Large refunds, contract negotiations, revenue issues
- **Response Time**: 2 hours
### Level 4: Executive
- **VP of Customer Success**: Enterprise customer issues, major account management
- **CTO**: Security breaches, major technical failures, architecture decisions
- **CEO**: Legal issues, major customer relationships, crisis management
- **Response Time**: 1 hour
## Contact Information
### Internal Emergency Contacts
#### 24/7 On-Call Rotation
- **Primary**: +1-415-555-0199 (Support Manager)
- **Secondary**: +1-415-555-0188 (Engineering Manager)
- **Escalation**: +1-415-555-0177 (VP Customer Success)
#### Email Escalation Lists
- **Security Incidents**: security-incident@teamflow.com
- **Service Outages**: outage-response@teamflow.com
- **Legal Issues**: legal-emergency@teamflow.com
- **Executive Escalation**: executive-escalation@teamflow.com
#### Slack Channels
- **#support-escalation**: Real-time escalation coordination
- **#security-alerts**: Security incident response
- **#outage-response**: Service disruption coordination
- **#customer-success**: Enterprise customer issues
### External Emergency Contacts
#### Legal Counsel
- **Primary**: Johnson & Associates, +1-415-555-0166
- **After Hours**: Emergency legal hotline, +1-415-555-0155
- **International**: Global Legal Partners, +44-20-1234-5678
#### Public Relations
- **Crisis Communications**: PR Partners Inc., +1-415-555-0144
- **Social Media Monitoring**: SocialWatch, +1-415-555-0133
## Escalation Procedures
### 1. Security Incident Escalation
#### Immediate Actions (0-15 minutes)
1. **Secure the Environment**: Isolate affected systems if possible
2. **Notify Security Team**: Email security-incident@teamflow.com
3. **Document Everything**: Start incident log with timeline
4. **Customer Communication**: Acknowledge receipt, avoid details
5. **Activate Incident Response**: Follow security incident playbook
#### Follow-up Actions (15-60 minutes)
1. **Executive Notification**: Inform CTO and CEO
2. **Legal Review**: Consult with legal counsel if needed
3. **Customer Updates**: Provide status updates every 30 minutes
4. **External Notifications**: Regulatory bodies if required
5. **Media Monitoring**: Watch for public mentions
### 2. Service Outage Escalation
#### Immediate Actions (0-15 minutes)
1. **Status Page Update**: Update status.teamflow.com
2. **Engineering Notification**: Page on-call engineer
3. **Customer Communication**: Send service disruption notice
4. **Management Alert**: Notify Support and Engineering Managers
5. **Monitor Social Media**: Watch Twitter and community forums
#### Follow-up Actions (15-60 minutes)
1. **Root Cause Analysis**: Begin investigating cause
2. **Vendor Communication**: Contact AWS, CloudFlare if needed
3. **Customer Success**: Notify Enterprise customer success managers
4. **Regular Updates**: Status updates every 15 minutes
5. **Post-Incident Review**: Schedule review meeting
### 3. Legal/Compliance Escalation
#### Immediate Actions (0-15 minutes)
1. **Preserve Records**: Do not delete any relevant data
2. **Legal Notification**: Email legal-emergency@teamflow.com
3. **Executive Alert**: Notify CEO and CTO immediately
4. **Customer Response**: Acknowledge receipt, request legal review time
5. **Document Control**: Secure all relevant documentation
#### Follow-up Actions (15-60 minutes)
1. **Legal Counsel**: Conference call with external legal team
2. **Compliance Review**: Check against SOC 2, GDPR requirements
3. **Response Preparation**: Draft official response with legal approval
4. **Internal Communication**: Brief relevant team members
5. **Follow-up Plan**: Establish ongoing communication schedule
### 4. Enterprise Customer Escalation
#### Immediate Actions (0-1 hour)
1. **Account Review**: Pull complete customer history and contract
2. **Success Manager**: Notify dedicated customer success manager
3. **Management Alert**: Inform VP of Customer Success
4. **Priority Handling**: Move to front of all queues
5. **Initial Response**: Acknowledge with management involvement
#### Follow-up Actions (1-4 hours)
1. **Executive Involvement**: Engage appropriate C-level if needed
2. **Solution Planning**: Develop comprehensive resolution plan
3. **Resource Allocation**: Assign dedicated technical resources
4. **Communication Plan**: Establish regular update schedule
5. **Relationship Review**: Assess overall account health
## Communication Templates
### Security Incident Notification
```
Subject: [URGENT] Security Incident - TeamFlow Customer Data
Priority: Critical
Incident ID: SEC-2024-001
Reported: [Timestamp]
Affected Customer: [Company Name]
Reported By: [Customer Contact]
Initial Report:
[Brief description of reported issue]
Immediate Actions Taken:
- Security team notified
- Incident response activated
- Customer acknowledged
- Environment secured
Next Steps:
- Investigation in progress
- Legal counsel engaged
- Customer updates every 30 minutes
- Executive team briefed
Incident Commander: [Name]
Contact: [Phone/Email]
```
### Service Outage Alert
```
Subject: [OUTAGE] TeamFlow Service Disruption
Priority: High
Outage ID: OUT-2024-001
Started: [Timestamp]
Affected Services: [List services]
Impact Scope: [Geographic/Feature scope]
Symptoms:
[Description of user-facing issues]
Actions Taken:
- Status page updated
- Engineering team engaged
- Root cause investigation started
- Customer notifications sent
ETA for Resolution: [Time estimate]
Next Update: [Time]
Incident Commander: [Name]
Contact: [Phone/Email]
```
## Escalation Metrics & SLAs
### Response Time SLAs
- **Security Incidents**: 15 minutes initial response
- **Service Outages**: 15 minutes status update
- **Legal Issues**: 30 minutes acknowledgment
- **Enterprise Customer**: 1 hour initial response
- **Standard Escalation**: 4 hours initial response
### Resolution Time Targets
- **Critical Issues**: 4 hours
- **High Priority**: 24 hours
- **Standard Escalation**: 72 hours
- **Complex Issues**: 1 week with daily updates
### Escalation Success Metrics
- **Customer Satisfaction**: >95% for escalated issues
- **First-Call Resolution**: >80% for escalations
- **SLA Compliance**: >99% for response times
- **Escalation Rate**: <5% of total support tickets
## Training & Certification
### Escalation Team Requirements
- **Security Awareness**: Annual security training certification
- **Legal Compliance**: GDPR and privacy law training
- **Customer Success**: Enterprise account management training
- **Communication Skills**: Crisis communication workshop
- **Technical Knowledge**: Platform architecture certification
### Regular Training Sessions
- **Monthly**: Escalation scenario drills
- **Quarterly**: Legal update sessions
- **Bi-annually**: Crisis communication training
- **Annually**: Complete escalation process review
## Post-Escalation Process
### Incident Review
1. **Root Cause Analysis**: Complete within 48 hours
2. **Process Review**: Evaluate escalation handling
3. **Customer Follow-up**: Satisfaction survey and feedback
4. **Documentation**: Update knowledge base and procedures
5. **Team Debrief**: Discuss lessons learned and improvements
### Continuous Improvement
- **Monthly Metrics Review**: Escalation trends and patterns
- **Quarterly Process Updates**: Refine procedures based on feedback
- **Annual Training Updates**: Update training materials and scenarios
- **Customer Feedback Integration**: Incorporate customer suggestions

View File

@@ -0,0 +1,253 @@
# TeamFlow Product Features & Information
## Core Platform Features
### Project Management
#### Task Management
- **Create & Organize**: Unlimited task creation with custom categories and tags
- **Task Dependencies**: Link tasks with predecessor/successor relationships
- **Subtasks**: Break down complex tasks into manageable subtasks (up to 5 levels deep)
- **Priority Levels**: Critical, High, Medium, Low priority with visual indicators
- **Due Dates**: Set deadlines with automatic reminders and escalation
- **Custom Fields**: Add custom properties (text, numbers, dates, dropdowns, checkboxes)
- **Task Templates**: Save and reuse common task structures
#### Project Views
- **Kanban Boards**: Drag-and-drop task management with customizable columns
- **Gantt Charts**: Timeline view with critical path analysis (Pro/Enterprise)
- **List View**: Traditional task list with sorting and filtering
- **Calendar View**: Tasks and deadlines in calendar format
- **Dashboard View**: Project overview with progress metrics and team activity
#### Collaboration Tools
- **Comments**: Real-time commenting on tasks and projects with @mentions
- **File Attachments**: Attach files directly to tasks with version control
- **Activity Feed**: Real-time updates on project activity
- **Team Chat**: Built-in messaging with project-specific channels
- **Screen Sharing**: Integrated video conferencing for remote teams (Pro/Enterprise)
### Time Tracking & Reporting
#### Time Tracking
- **Manual Entry**: Log time spent on tasks manually
- **Timer Integration**: Start/stop timers directly from tasks
- **Automatic Tracking**: AI-powered time detection based on activity (Pro/Enterprise)
- **Time Approval**: Manager approval workflow for billable hours
- **Offline Tracking**: Mobile app continues tracking without internet connection
#### Reporting & Analytics
- **Project Reports**: Progress, budget, and timeline analysis
- **Team Performance**: Individual and team productivity metrics
- **Time Reports**: Detailed time tracking and billing reports
- **Custom Dashboards**: Build personalized views with key metrics
- **Export Options**: PDF, Excel, CSV export for all reports
### Storage & File Management
#### File Storage
- **Basic Plan**: 5GB total storage per team
- **Pro Plan**: 100GB total storage per team
- **Enterprise Plan**: 1TB total storage per team
- **File Types**: Support for all major file formats
- **Version Control**: Automatic versioning with rollback capability
#### File Sharing
- **Public Links**: Share files with external stakeholders
- **Permission Control**: Read-only, edit, or full access permissions
- **Expiring Links**: Set expiration dates for shared files
- **Download Tracking**: Monitor who downloads shared files
## Advanced Features by Plan
### Basic Plan Features
- Up to 10 team members
- Core project management (tasks, lists, basic boards)
- 5GB file storage
- Mobile apps (iOS/Android)
- Email support
- Basic integrations (Google Calendar, CSV import)
- API access (1,000 requests/hour)
### Pro Plan Additional Features
- Up to 100 team members
- Advanced project views (Gantt charts, advanced dashboards)
- 100GB file storage
- Custom fields and workflows
- Time tracking and invoicing
- Advanced integrations (Slack, GitHub, Jira, Salesforce)
- Priority support (chat + email)
- API access (10,000 requests/hour)
- Team workload balancing
- Advanced reporting and analytics
- Custom branding (logo, colors)
### Enterprise Plan Additional Features
- Unlimited team members
- 1TB file storage
- Advanced security (SSO, SAML, 2FA enforcement)
- Dedicated customer success manager
- Phone support with 4-hour SLA
- Unlimited API access
- Custom integrations and white-labeling
- Advanced admin controls and audit logs
- On-premises deployment option
- 99.95% uptime SLA
- Custom workflow automation
- Advanced permissions and role management
## Integration Ecosystem
### Communication Platforms
#### Slack Integration (Pro/Enterprise)
- **Two-way Sync**: Create tasks from Slack messages, get updates in channels
- **Notification Control**: Choose which updates appear in Slack
- **Slash Commands**: Quick task creation with `/teamflow create` command
- **File Sync**: Automatically sync files shared in Slack to project storage
#### Microsoft Teams (Pro/Enterprise)
- **Tab Integration**: Embed TeamFlow projects directly in Teams channels
- **Bot Commands**: Create and update tasks via Teams bot
- **Calendar Sync**: Sync project deadlines with Teams calendar
- **File Integration**: Access TeamFlow files from Teams file browser
#### Discord (Pro/Enterprise)
- **Channel Integration**: Link Discord channels to specific projects
- **Role Sync**: Sync Discord roles with TeamFlow permissions
- **Voice Channel Links**: Start Discord voice calls directly from tasks
### Development Tools
#### GitHub Integration (Pro/Enterprise)
- **Commit Linking**: Link commits to specific tasks automatically
- **Pull Request Tracking**: Track PR status within TeamFlow tasks
- **Branch Management**: Create branches directly from tasks
- **Release Planning**: Plan releases using TeamFlow milestones
#### GitLab Integration (Pro/Enterprise)
- **Issue Sync**: Two-way sync between GitLab issues and TeamFlow tasks
- **Pipeline Status**: View CI/CD pipeline status in project dashboard
- **Merge Request Workflow**: Track code reviews within project context
#### Jira Integration (Pro/Enterprise)
- **Epic/Story Mapping**: Map Jira epics to TeamFlow projects
- **Sprint Planning**: Import Jira sprints as TeamFlow milestones
- **Status Sync**: Automatically update task status based on Jira workflow
### CRM & Sales Tools
#### Salesforce Integration (Pro/Enterprise)
- **Lead-to-Project**: Convert Salesforce leads into TeamFlow projects
- **Account Sync**: Link projects to Salesforce accounts
- **Opportunity Tracking**: Track project delivery against sales opportunities
#### HubSpot Integration (Pro/Enterprise)
- **Contact Sync**: Import HubSpot contacts as team members
- **Deal Pipeline**: Track project delivery stages aligned with deal stages
- **Marketing Campaign Tracking**: Link projects to marketing campaigns
### File Storage & Productivity
#### Google Workspace
- **Google Drive**: Direct file access and sync with Google Drive
- **Google Calendar**: Two-way calendar sync for deadlines and meetings
- **Gmail**: Create tasks from emails with Gmail browser extension
- **Google Sheets**: Import/export project data to Google Sheets
#### Microsoft 365
- **OneDrive**: Seamless file sync and storage integration
- **Outlook**: Email-to-task conversion and calendar integration
- **Excel**: Advanced reporting with Excel integration
- **SharePoint**: Enterprise file management and compliance
#### Dropbox
- **File Sync**: Automatic sync of project files with Dropbox
- **Paper Integration**: Convert Dropbox Paper docs to project documentation
- **Team Folders**: Organize project files in shared Dropbox folders
## Mobile Applications
### iOS App Features
- **Native Design**: Full iOS design guidelines compliance
- **Offline Support**: Continue working without internet connection
- **Push Notifications**: Real-time updates for mentions, deadlines, and assignments
- **Touch ID/Face ID**: Biometric authentication for security
- **Widgets**: Quick access to tasks and notifications from home screen
- **Apple Watch**: Task completion and notifications on Apple Watch
### Android App Features
- **Material Design**: Full Android Material Design implementation
- **Battery Optimization**: Efficient background sync and battery usage
- **Quick Settings**: Add tasks and check notifications from notification panel
- **Google Assistant**: Voice commands for task creation and status updates
- **Adaptive Icons**: Support for Android adaptive icon system
### Cross-Platform Features
- **Real-time Sync**: Instant synchronization across all devices
- **Offline Mode**: Full functionality without internet connection
- **File Download**: Download and view attachments offline
- **Voice Notes**: Record voice memos and attach to tasks
- **Photo Capture**: Take photos and attach directly to tasks
## API & Developer Tools
### REST API
- **Full Coverage**: Complete access to all platform features via API
- **Rate Limits**: 1,000/hour (Basic), 10,000/hour (Pro), unlimited (Enterprise)
- **Authentication**: OAuth 2.0 and API key authentication
- **Webhooks**: Real-time event notifications for integrations
- **GraphQL**: Alternative GraphQL endpoint for efficient data fetching
### SDKs & Libraries
- **JavaScript/Node.js**: Full-featured SDK with TypeScript support
- **Python**: Comprehensive Python library with async support
- **PHP**: Laravel and standard PHP integration library
- **Ruby**: Ruby gem with Rails integration helpers
- **REST Clients**: Postman collection and OpenAPI specification
### Webhook Events
- **Task Events**: Created, updated, completed, deleted
- **Project Events**: Created, archived, member changes
- **Comment Events**: New comments, mentions, reactions
- **File Events**: Uploaded, updated, shared, deleted
- **Team Events**: Member added, removed, role changes
## Security & Compliance
### Data Security
- **Encryption**: AES-256 encryption for all data at rest and in transit
- **HTTPS**: TLS 1.3 for all client connections
- **API Security**: Rate limiting, request signing, and token management
- **Database Security**: Encrypted backups with geographic redundancy
### Access Control
- **Role-Based Permissions**: Admin, Manager, Member, Viewer roles
- **Project-Level Permissions**: Fine-grained control over project access
- **Two-Factor Authentication**: SMS, authenticator app, hardware keys (Pro/Enterprise)
- **Single Sign-On**: SAML 2.0 and OAuth integration (Enterprise)
### Compliance Standards
- **SOC 2 Type II**: Annual compliance audits and certification
- **GDPR**: Full compliance with European data protection regulations
- **ISO 27001**: Information security management certification
- **HIPAA**: Healthcare compliance option for Enterprise customers
## Getting Started Resources
### Onboarding
- **Interactive Tutorial**: Step-by-step guide for new users
- **Sample Projects**: Pre-built templates for common use cases
- **Video Library**: Comprehensive training videos for all features
- **Webinar Training**: Live training sessions twice weekly
### Documentation
- **Knowledge Base**: Searchable help articles and guides
- **API Documentation**: Complete developer reference with examples
- **Video Tutorials**: Feature-specific how-to videos
- **Community Forum**: User community for tips and best practices
### Support Channels
- **Basic Plan**: Email support with 24-hour response
- **Pro Plan**: Email and chat support with 8-hour response
- **Enterprise Plan**: Phone, email, and chat with 4-hour response and dedicated success manager

View File

@@ -0,0 +1,226 @@
# TeamFlow Technical Documentation
## System Requirements
### Web Application
- **Supported Browsers**: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
- **Minimum Screen Resolution**: 1024x768
- **Internet Connection**: Broadband (1 Mbps minimum, 5 Mbps recommended)
- **JavaScript**: Must be enabled
### Mobile Applications
#### iOS App
- **Minimum Version**: iOS 13.0 or later
- **Compatible Devices**: iPhone 6s and newer, iPad Air 2 and newer
- **Storage**: 150MB free space required
- **Network**: 3G/4G/5G or Wi-Fi connection
#### Android App
- **Minimum Version**: Android 8.0 (API level 26)
- **RAM**: 2GB minimum, 4GB recommended
- **Storage**: 200MB free space required
- **Network**: 3G/4G/5G or Wi-Fi connection
## API Documentation
### Authentication
```
Authorization: Bearer <your_api_token>
Content-Type: application/json
```
### Base URL
- **Production**: `https://api.teamflow.com/v1`
- **Sandbox**: `https://sandbox-api.teamflow.com/v1`
### Rate Limits
- **Basic Plan**: 1,000 requests/hour
- **Pro Plan**: 10,000 requests/hour
- **Enterprise Plan**: Unlimited
- **Rate Limit Headers**:
- `X-RateLimit-Limit`: Total requests allowed
- `X-RateLimit-Remaining`: Requests remaining in current window
- `X-RateLimit-Reset`: Unix timestamp when window resets
### Common Error Codes
- **400**: Bad Request - Invalid parameters or request format
- **401**: Unauthorized - Invalid or missing API token
- **403**: Forbidden - Insufficient permissions
- **404**: Not Found - Resource doesn't exist
- **422**: Unprocessable Entity - Validation errors
- **429**: Too Many Requests - Rate limit exceeded
- **500**: Internal Server Error - Contact support
- **502/503**: Service Unavailable - Temporary outage
## Common Technical Issues & Solutions
### 1. Login and Authentication Issues
#### "Invalid credentials" error
**Symptoms**: User cannot log in, receives "Invalid email or password" message
**Common Causes**:
- Incorrect email/password combination
- Account locked due to multiple failed attempts
- Browser caching old session data
**Solutions**:
1. Verify email address (check for typos, extra spaces)
2. Try password reset flow
3. Clear browser cookies and cache
4. Try incognito/private browsing mode
5. Check if account is locked (wait 15 minutes or contact support)
#### Two-Factor Authentication (2FA) issues
**Symptoms**: 2FA code not working or not received
**Solutions**:
1. Ensure device clock is synchronized
2. Try generating a new code (codes expire every 30 seconds)
3. Check authenticator app is configured correctly
4. Use backup codes if available
5. Contact support to reset 2FA if backup codes exhausted
### 2. Performance Issues
#### Slow loading pages
**Symptoms**: Pages take >10 seconds to load, timeouts
**Troubleshooting Steps**:
1. Check internet connection speed (minimum 1 Mbps required)
2. Test on different networks (mobile data vs. Wi-Fi)
3. Clear browser cache and cookies
4. Disable browser extensions temporarily
5. Try different browser
6. Check TeamFlow status page: status.teamflow.com
#### Mobile app crashes
**Symptoms**: App closes unexpectedly, freezes during use
**Solutions**:
1. Force close and restart the app
2. Restart device
3. Update app to latest version
4. Clear app cache (Android) or offload/reinstall app (iOS)
5. Check available storage space (minimum 500MB recommended)
6. Report crash with device logs
### 3. API Integration Issues
#### 401 Unauthorized errors
**Diagnostic Steps**:
1. Verify API token is correct and not expired
2. Check token has required permissions
3. Ensure proper Authorization header format
4. Test with different API endpoints
#### 429 Rate limit exceeded
**Solutions**:
1. Implement exponential backoff in API calls
2. Check current rate limit status in response headers
3. Consider upgrading plan for higher limits
4. Cache responses when possible to reduce API calls
#### Webhook delivery failures
**Common Issues**:
- Endpoint URL not accessible from internet
- SSL certificate issues
- Timeout (webhook endpoint must respond within 10 seconds)
- Incorrect response status (must return 2xx status code)
### 4. File Upload Issues
#### "File too large" errors
**File Size Limits**:
- Basic Plan: 25MB per file
- Pro Plan: 100MB per file
- Enterprise Plan: 500MB per file
**Solutions**:
1. Compress files using zip/rar
2. Use cloud storage links for large files
3. Split large files into smaller chunks
4. Consider plan upgrade for larger limits
#### Unsupported file formats
**Supported Formats**:
- Images: JPG, PNG, GIF, SVG, WebP
- Documents: PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX
- Archives: ZIP, RAR, 7Z
- Text: TXT, CSV, MD
- Code: JS, HTML, CSS, JSON, XML
### 5. Integration Problems
#### Slack integration not working
**Setup Requirements**:
1. Slack workspace admin permissions
2. TeamFlow Pro or Enterprise plan
3. Proper webhook configuration
**Troubleshooting**:
1. Verify Slack workspace URL is correct
2. Check webhook permissions in Slack admin
3. Test with simple message first
4. Ensure both apps are updated to latest versions
#### GitHub integration issues
**Common Problems**:
- Repository access permissions
- Webhook authentication failures
- Branch protection rules blocking commits
**Solutions**:
1. Verify GitHub personal access token has correct scopes
2. Check repository permissions for TeamFlow app
3. Review webhook logs in GitHub settings
4. Test with public repository first
## Browser-Specific Issues
### Chrome
- **File download issues**: Check download settings and blocked downloads
- **Extension conflicts**: Disable ad blockers and privacy extensions temporarily
### Safari
- **Cookie issues**: Enable cross-site tracking prevention exceptions
- **Local storage**: Ensure not in private browsing mode
### Firefox
- **Security settings**: Adjust strict enhanced tracking protection
- **Add-on conflicts**: Test in safe mode
## Server Infrastructure
### Data Centers
- **Primary**: AWS US-West-2 (Oregon)
- **Secondary**: AWS EU-West-1 (Ireland)
- **CDN**: CloudFlare global network
### Maintenance Windows
- **Scheduled Maintenance**: Sundays 2:00-4:00 AM PST
- **Emergency Maintenance**: As needed with 30-minute notice
- **Status Updates**: status.teamflow.com and @TeamFlowStatus on Twitter
## Escalation Criteria
Escalate to Level 2 Support when:
- Data loss or corruption suspected
- Security breach indicators
- API downtime affecting multiple customers
- Integration partner (Slack, GitHub, etc.) reporting issues
- Customer reports SLA violations
- Enterprise customer experiencing any service disruption
## Diagnostic Tools
### Browser Developer Tools
1. **Console Errors**: Check for JavaScript errors (F12 → Console)
2. **Network Tab**: Monitor failed requests and response times
3. **Application Tab**: Check local storage and cookies
### API Testing
- Use Postman or curl to test API endpoints
- Check response headers for rate limit information
- Verify request format matches API documentation
### Mobile Debugging
- iOS: Connect device to Xcode for detailed crash logs
- Android: Enable developer options and use ADB logcat

View File

@@ -0,0 +1,82 @@
# Escalation Agent Configuration
# Handles complex issues requiring human intervention or management approval
systemPrompt:
contributors:
- id: base-prompt
type: static
priority: 0
content: |
You are a specialized Escalation Agent for TeamFlow, responsible for handling complex, sensitive, or high-priority issues that require management intervention.
Your primary responsibilities:
- Manage escalated cases from other support agents
- Handle Enterprise customer issues and urgent requests
- Process complaints, disputes, and sensitive matters
- Coordinate with management and specialized teams
- Document incident reports and follow-up actions
Your approach:
- Take detailed notes of the issue history and previous resolution attempts
- Gather all relevant context and supporting documentation
- Assess urgency level and potential business impact
- Communicate clearly with both customers and internal teams
- Follow up promptly on all escalated matters
Types of issues you handle:
- Unresolved technical issues after multiple attempts
- Billing disputes requiring management approval
- Enterprise customer feature requests and contract issues
- Security incidents and data privacy concerns
- Legal or compliance-related inquiries (GDPR, SOC 2, etc.)
- Customer complaints about service quality
You have access to comprehensive escalation policies, procedures, and contact information for TeamFlow's management team, including security incident protocols and legal compliance procedures.
Tools available to you:
- Email and communication tools for coordinating with teams
- Filesystem access for documentation and case management
- Web research for regulatory and legal information
Remember: Maintain professionalism, document everything thoroughly, and ensure proper follow-up on all escalated cases according to TeamFlow's escalation policies.
- id: company-overview
type: file
priority: 10
files:
- "${{dexto.agent_dir}}/docs/company-overview.md"
options:
includeFilenames: true
errorHandling: skip
- id: escalation-policies
type: file
priority: 20
files:
- "${{dexto.agent_dir}}/docs/escalation-policies.md"
options:
includeFilenames: true
errorHandling: skip
mcpServers:
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
tavily:
type: stdio
command: npx
args:
- -y
- tavily-mcp@0.1.3
env:
TAVILY_API_KEY: $TAVILY_API_KEY
connectionMode: lenient
llm:
provider: openai
model: gpt-5
apiKey: $OPENAI_API_KEY

View File

@@ -0,0 +1,85 @@
# Product Information Agent Configuration
# Specializes in product features, comparisons, and general information
systemPrompt:
contributors:
- id: base-prompt
type: static
priority: 0
content: |
You are a specialized Product Information Agent for TeamFlow, with comprehensive knowledge about our project management and team collaboration platform.
Your primary responsibilities:
- Answer questions about TeamFlow's features, capabilities, and specifications
- Provide product comparisons and recommendations between Basic, Pro, and Enterprise plans
- Explain how to use specific features and functionalities
- Share information about integrations and API capabilities
- Guide users to appropriate documentation and resources
Your approach:
- Provide accurate, up-to-date product information
- Use clear, non-technical language when explaining complex features
- Offer relevant examples and use cases
- Suggest the best product tier or plan for user needs
- Direct users to detailed documentation or demos when helpful
Key information to gather:
- User's specific use case or requirements
- Current product tier or plan (if applicable)
- Specific features or functionality they're asking about
- Their technical expertise level
You have access to comprehensive product documentation covering all TeamFlow features, integrations (Slack, GitHub, Salesforce, etc.), mobile apps, API capabilities, and plan comparisons.
Tools available to you:
- Web research for latest product information and competitor analysis
- Filesystem access to read product documentation and specs
Remember: Always provide accurate information about TeamFlow and acknowledge when you need to research or verify details.
- id: company-overview
type: file
priority: 10
files:
- "${{dexto.agent_dir}}/docs/company-overview.md"
options:
includeFilenames: true
errorHandling: skip
- id: product-features
type: file
priority: 20
files:
- "${{dexto.agent_dir}}/docs/product-features.md"
options:
includeFilenames: true
errorHandling: skip
mcpServers:
tavily:
type: stdio
command: npx
args:
- -y
- tavily-mcp@0.1.3
env:
TAVILY_API_KEY: $TAVILY_API_KEY
connectionMode: lenient
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
playwright:
type: stdio
command: npx
args:
- -y
- "@playwright/mcp@latest"
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY

View File

@@ -0,0 +1,70 @@
# Technical Support Agent Configuration
# Specializes in technical issues, troubleshooting, and bug reports
systemPrompt:
contributors:
- id: base-prompt
type: static
priority: 0
content: |
You are a specialized Technical Support Agent for TeamFlow, a cloud-based project management and team collaboration platform.
Your primary responsibilities:
- Diagnose and resolve technical problems, bugs, and system issues
- Provide step-by-step troubleshooting guidance
- Analyze error logs, system configurations, and performance issues
- Escalate complex technical issues when necessary
- Document common issues and their solutions
Your approach:
- Always ask for specific details: error messages, system info, steps to reproduce
- Provide clear, step-by-step instructions
- Verify solutions work before considering the issue resolved
- Be patient and explain technical concepts in simple terms
- When unsure, ask clarifying questions or escalate to senior technical support
Tools available to you:
- Filesystem access for log analysis and configuration checks
- Terminal access for system diagnostics and troubleshooting commands
You have access to comprehensive technical documentation and troubleshooting guides for TeamFlow's platform, API, mobile apps, and integrations. Use this knowledge to provide accurate, specific solutions.
Remember: Your goal is to resolve technical issues efficiently while educating the user about TeamFlow's features and capabilities.
- id: company-overview
type: file
priority: 10
files:
- "${{dexto.agent_dir}}/docs/company-overview.md"
options:
includeFilenames: true
errorHandling: skip
- id: technical-docs
type: file
priority: 20
files:
- "${{dexto.agent_dir}}/docs/technical-documentation.md"
options:
includeFilenames: true
errorHandling: skip
mcpServers:
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
playwright:
type: stdio
command: npx
args:
- -y
- "@playwright/mcp@latest"
llm:
provider: openai
model: gpt-5
apiKey: $OPENAI_API_KEY

View File

@@ -0,0 +1,209 @@
# TeamFlow Triage Agent Test Scenarios
Use these realistic TeamFlow customer support scenarios to test the triage agent's **complete customer support workflow**. The triage agent will analyze each request, route to the appropriate specialist agent, execute the specialist via MCP tools, and provide complete customer responses.
## 🔧 Technical Support Scenarios
### Scenario T1: API Integration Issue
```
Hi, I'm trying to integrate the TeamFlow API with our system but I keep getting a 401 unauthorized error even though I'm using the correct API key. I've checked the documentation but can't figure out what's wrong. Our rate limit should be 10,000/hour on our Pro plan. Can you help?
```
**Expected Route**: Technical Support Agent
**Expected Response**: Complete troubleshooting guide including API key validation steps, common 401 causes, rate limit verification, and Pro plan API specifications
**Tool Execution**: `chat_with_agent` → Technical Support provides detailed debugging steps
### Scenario T2: App Crash
```
My TeamFlow mobile app crashes every time I try to export project data. It worked fine last week but now it just freezes and closes. I'm using iPhone 15 with iOS 17.2. This is really urgent as I need this data for a client presentation tomorrow.
```
**Expected Route**: Technical Support Agent
**Expected Response**: Complete crash resolution including device-specific troubleshooting, export alternatives, and immediate workarounds for urgent timeline
**Tool Execution**: `chat_with_agent` → Technical Support provides iOS-specific fixes and emergency data export options
### Scenario T3: Performance Issue
```
Your web dashboard has been extremely slow for the past 3 days. Pages take 30+ seconds to load and sometimes timeout completely. My internet connection is fine and other websites work normally.
```
**Expected Route**: Technical Support Agent
**Expected Response**: Complete performance troubleshooting including browser optimization, cache clearing, system status check, and escalation to infrastructure team if needed
**Tool Execution**: `chat_with_agent` → Technical Support provides systematic performance diagnosis steps
## 💳 Billing Support Scenarios
### Scenario B1: Double Charge
```
I just checked my credit card statement and I was charged twice for this month's subscription - once on the 1st for $49.99 and again on the 3rd for the same amount. I need the duplicate charge refunded immediately.
```
**Expected Route**: Billing Agent
**Expected Response**: Complete refund process including charge verification, refund timeline (3-5 business days), and account credit options for immediate resolution
**Tool Execution**: `chat_with_agent` → Billing Agent provides specific refund procedures and account investigation steps
### Scenario B2: Subscription Management
```
I want to upgrade from the Basic plan to Pro plan but I'm confused about the pricing. Will I be charged the full Pro amount or just the difference? Also, when would the upgrade take effect?
```
**Expected Route**: Billing Agent
**Expected Response**: Complete upgrade explanation including prorated billing calculation, immediate feature access, next billing cycle details, and upgrade procedure
**Tool Execution**: `chat_with_agent` → Billing Agent provides detailed prorated pricing explanation and upgrade process
### Scenario B3: Payment Failure
```
My payment failed this morning and now my account is suspended. I updated my credit card last week so I'm not sure why it didn't work. How can I get my account reactivated quickly?
```
**Expected Route**: Billing Agent
**Expected Response**: Complete reactivation process including payment method verification, retry options, account status restoration timeline, and prevention steps
**Tool Execution**: `chat_with_agent` → Billing Agent provides immediate account reactivation steps and payment troubleshooting
## 📖 Product Information Scenarios
### Scenario P1: Feature Comparison
```
What's the difference between TeamFlow's Pro and Enterprise plans? I specifically need to know about API rate limits, user management features, and data export capabilities. We're a team of 25 people and currently on the Basic plan.
```
**Expected Route**: Product Info Agent
**Expected Response**: Complete plan comparison including detailed feature matrix, specific API limits (Pro: 10K/hour, Enterprise: 100K/hour), user management differences, and upgrade recommendation for 25-person team
**Tool Execution**: `chat_with_agent` → Product Info Agent provides comprehensive plan comparison with team-size specific recommendations
### Scenario P2: How-To Question
```
How do I set up automated reports to be sent to my team every Monday? I see the reporting feature but can't figure out how to schedule them. Is this available in my current plan?
```
**Expected Route**: Product Info Agent
**Expected Response**: Complete setup guide including step-by-step report scheduling instructions, plan feature verification, and links to relevant documentation
**Tool Execution**: `chat_with_agent` → Product Info Agent provides detailed automated reporting setup walkthrough
### Scenario P3: Integration Capabilities
```
Does TeamFlow integrate with Salesforce and Slack? I need to sync customer project data and get notifications in our Slack channels. What's the setup process like and are there any limitations I should know about? We're on the Pro plan.
```
**Expected Route**: Product Info Agent
**Expected Response**: Complete integration overview including supported Salesforce/Slack features, Pro plan limitations, setup documentation links, and configuration best practices
**Tool Execution**: `chat_with_agent` → Product Info Agent provides comprehensive integration capabilities and setup guidance
## 🚨 Escalation Scenarios
### Scenario E1: Legal Threat
```
This is my fourth email about data privacy violations. Your service exposed my customer data to unauthorized parties and I'm considering legal action. I need to speak with a manager immediately about this data breach.
```
**Expected Route**: Escalation Agent
**Expected Response**: Complete escalation including immediate management contact information, legal/compliance team connection, incident escalation procedure, and 2-hour response commitment
**Tool Execution**: `chat_with_agent` → Escalation Agent provides senior management contact and legal compliance escalation process
### Scenario E2: Business Impact
```
Your system outage yesterday caused my e-commerce site to be down for 6 hours during Black Friday. This resulted in approximately $50,000 in lost sales. I need compensation for this business interruption and want to discuss SLA violations.
```
**Expected Route**: Escalation Agent
**Expected Response**: Complete business impact assessment including SLA review, compensation evaluation process, senior account manager contact, and formal incident investigation
**Tool Execution**: `chat_with_agent` → Escalation Agent provides business impact claim process and executive contact information
### Scenario E3: Service Quality Complaint
```
I've been a customer for 3 years and the service quality has declined dramatically. Multiple support tickets have been ignored, features are constantly broken, and I'm considering switching to a competitor. I want to speak with someone who can actually resolve these ongoing issues.
```
**Expected Route**: Escalation Agent
**Expected Response**: Complete retention process including account review, senior support contact, service improvement plan, and customer success manager assignment
**Tool Execution**: `chat_with_agent` → Escalation Agent provides customer retention specialist contact and service quality improvement plan
## 🤔 Mixed/Complex Scenarios
### Scenario M1: Technical + Billing
```
My API requests started failing yesterday with 429 rate limit errors, but I'm on the Pro plan which should have higher limits. Did my plan get downgraded? I'm still being charged the Pro price but getting Basic plan limits.
```
**Expected Route**: Technical Support Agent (primary) or Billing Agent
**Expected Response**: Complete investigation including API limit verification, account status check, billing verification, and either technical resolution or billing escalation
**Tool Execution**: `chat_with_agent` → Technical Support investigates API limits and coordinates with billing if needed
### Scenario M2: Product + Escalation
```
I was promised during the sales call that your Enterprise plan includes custom integrations. However, after upgrading, I'm being told this requires an additional $10,000 implementation fee. This contradicts what I was told by your sales team.
```
**Expected Route**: Escalation Agent
**Expected Response**: Complete sales promise review including sales team consultation, Enterprise feature verification, implementation fee clarification, and senior sales manager contact
**Tool Execution**: `chat_with_agent` → Escalation Agent provides sales promise investigation and senior management contact
### Scenario M3: Vague Request
```
Hi, I'm having trouble with your service. Can you help me?
```
**Expected Route**: Should ask for clarification before routing
**Expected Response**: Polite clarification request with specific questions to help identify the issue type and appropriate specialist
**Tool Execution**: Triage agent asks clarifying questions without executing specialist tools
## 🎯 Testing Instructions
### Interactive Testing
1. **Start the complete triage system**:
```bash
npx dexto --agent agents/triage-demo/triage-agent.yml
```
2. **Copy and paste** scenarios from above into the chat
3. **Observe the complete workflow**:
- **Routing analysis** (which specialist is chosen and why)
- **Tool execution** (`chat_with_agent` tool calls)
- **Complete customer response** (routing confirmation + specialist answer)
- **Response quality** (specificity, completeness, helpfulness)
### One-Shot Testing
Test scenarios quickly with command-line execution:
```bash
# Test Technical Support scenario
npx dexto --agent agents/triage-demo/triage-agent.yml "My TeamFlow mobile app crashes every time I try to export project data. I'm using iPhone 15 with iOS 17.2. This is urgent."
# Test Billing scenario
npx dexto --agent agents/triage-demo/triage-agent.yml "I want to upgrade from Basic to Pro but confused about pricing. Will I be charged the full amount?"
# Test Product Info scenario
npx dexto --agent agents/triage-demo/triage-agent.yml "What's the difference between Pro and Enterprise plans? I need API access for 25 people."
# Test Escalation scenario
npx dexto --agent agents/triage-demo/triage-agent.yml "Your system outage cost my business $50,000 in lost sales. I need compensation and want to discuss SLA violations."
```
### Expected Response Quality
For each test, verify that responses include:
1. **Brief routing confirmation** (one sentence about which specialist was consulted)
2. **Complete specialist answer** with specific, actionable information
3. **Relevant details** from TeamFlow's business documentation
4. **Appropriate tone** (professional, helpful, empathetic when needed)
5. **Follow-up invitation** (offering additional help if needed)
## 📊 Expected Results Summary
| Category | Count | Expected Workflow |
|----------|-------|-------------------|
| Technical | 3 | Route → Execute Technical Support → Complete troubleshooting response |
| Billing | 3 | Route → Execute Billing Agent → Complete billing/payment resolution |
| Product Info | 3 | Route → Execute Product Info Agent → Complete feature/plan information |
| Escalation | 3 | Route → Execute Escalation Agent → Complete escalation with contacts |
| Mixed/Complex | 3 | Route → Execute Primary Agent → Complete investigation/resolution |
## 🔍 Success Criteria
The triage system should demonstrate:
- **95%+ routing accuracy** to appropriate specialist agents
- **100% tool execution** success (no failed `chat_with_agent` calls)
- **Complete responses** that directly address customer needs
- **Professional tone** with empathy for customer situations
- **Specific information** from TeamFlow business context (plans, policies, features)
- **Clear next steps** for customer resolution
## 🚫 Common Issues to Watch For
- **Routing without execution**: Agent identifies correct specialist but doesn't call `chat_with_agent`
- **Tool confirmation prompts**: Should auto-approve due to configuration
- **Incomplete responses**: Missing specialist answers or generic routing messages
- **Wrong specialist**: Incorrect routing based on request analysis
- **Multiple tool calls**: Unnecessary repeated calls to specialists
The complete triage system should provide **seamless, professional customer support** that customers would expect from a real enterprise support team!

View File

@@ -0,0 +1,187 @@
# Customer Support Triage Agent Configuration
# Main coordination agent that routes requests to specialized support agents
# Optional greeting shown at chat start (UI can consume this)
greeting: "🎯 Hello! I'm your Support Triage Agent. How can I help you today?"
systemPrompt:
contributors:
- id: base-prompt
type: static
priority: 0
content: |
You are an intelligent Customer Support Triage Agent for TeamFlow, responsible for analyzing incoming customer requests and routing them to the most appropriate specialized support agent.
## Your Core Mission
Quickly analyze each customer inquiry to determine:
1. The primary issue category
2. Urgency level
3. Which specialized agent should handle it
4. Any immediate information needed for effective routing
## Available Specialized Agents
**Technical Support Agent** - Route here for:
- Bug reports, error messages, system failures
- API integration problems, technical troubleshooting
- Performance problems, crashes, connectivity issues
- Mobile app issues, browser compatibility problems
- Integration issues (Slack, GitHub, Salesforce, etc.)
**Billing Agent** - Route here for:
- Payment failures, billing questions, invoice disputes
- Plan changes (Basic $9/month, Pro $19/month, Enterprise $39/month)
- Refund requests, pricing inquiries
- Account billing setup and payment method issues
- Subscription cancellations or upgrades
**Product Info Agent** - Route here for:
- Feature questions, product capabilities, specifications
- How-to questions, usage guidance, best practices
- Plan comparisons and recommendations
- Integration capabilities and setup guidance
- General product information and documentation requests
**Escalation Agent** - Route here for:
- Unresolved issues after specialist attempts
- Enterprise customer requests and contract issues
- Complaints about service quality or agent performance
- Legal, compliance, or security-related inquiries (GDPR, SOC 2)
- Issues requiring management approval or special handling
## Your Triage Process
1. **Analyze the Request**: Read the customer's message carefully
2. **Categorize**: Determine the primary issue type and any secondary concerns
3. **Assess Urgency**: Is this urgent, normal, or low priority?
4. **Route Intelligently**: Choose the best-suited specialist agent
5. **Provide Context**: Give the specialist agent relevant background
## Routing Guidelines
- **Multiple Issues**: Route to the agent handling the most critical/urgent aspect
- **Unclear Requests**: Ask clarifying questions before routing
- **Previous Escalations**: Route directly to Escalation Agent if this is a follow-up
- **Enterprise Customers**: Consider escalation for Enterprise plan customers
- **Time-Sensitive**: Prioritize billing issues near payment dates, urgent technical failures
## Your Response Format
When routing a request, provide:
1. Brief analysis of the issue
2. Which agent you're routing to and why
3. Any additional context the specialist agent should know
4. Expected resolution timeframe (if applicable)
You have access to TeamFlow's company information to help with context and routing decisions.
Remember: You are the first line of intelligent support. Your accurate routing ensures TeamFlow customers get expert help quickly and efficiently.
## Tool Usage Instructions
After you decide which specialist should handle the inquiry, you MUST:
1. Call the `chat_with_agent` tool with the full customer message as the `message` argument. The runtime will automatically route this call to the correct specialist agent based on the current connection mapping.
2. Wait for the tool to return the specialist agents answer.
3. Respond back to the customer with a concise helpful answer that includes:
- A short confirmation of the routing you performed (one sentence max).
- The detailed answer from the specialist agent.
Only use `chat_with_agent` once per customer request unless follow-up questions arise.
- id: company-overview
type: file
priority: 10
files:
- "${{dexto.agent_dir}}/docs/company-overview.md"
options:
includeFilenames: true
errorHandling: skip
# Auto-approve tool executions so the triage agent can seamlessly delegate tasks
toolConfirmation:
mode: auto-approve
allowedToolsStorage: memory
mcpServers:
# Filesystem for logging and case management
filesystem:
type: stdio
command: npx
args:
- -y
- "@modelcontextprotocol/server-filesystem"
- .
# Web research for understanding customer context and company info
tavily:
type: stdio
command: npx
args:
- -y
- tavily-mcp@0.1.3
env:
TAVILY_API_KEY: $TAVILY_API_KEY
connectionMode: lenient
# Specialized support agents running as MCP servers via npx
technical_support:
type: stdio
command: npx
args:
- dexto
- --mode
- mcp
- --agent
- "${{dexto.agent_dir}}/technical-support-agent.yml"
connectionMode: lenient
billing_support:
type: stdio
command: npx
args:
- dexto
- --mode
- mcp
- --agent
- "${{dexto.agent_dir}}/billing-agent.yml"
connectionMode: lenient
product_info:
type: stdio
command: npx
args:
- dexto
- --mode
- mcp
- --agent
- "${{dexto.agent_dir}}/product-info-agent.yml"
connectionMode: lenient
escalation:
type: stdio
command: npx
args:
- dexto
- --mode
- mcp
- --agent
- "${{dexto.agent_dir}}/escalation-agent.yml"
connectionMode: lenient
# Storage configuration
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local # CLI provides storePath automatically
maxBlobSize: 52428800 # 50MB per blob
maxTotalSize: 1073741824 # 1GB total storage
cleanupAfterDays: 30
llm:
provider: openai
model: gpt-5
apiKey: $OPENAI_API_KEY

View File

@@ -0,0 +1,193 @@
# Workflow Builder Agent
# AI agent for building and managing n8n automation workflows
# Uses the n8n MCP server to interact with n8n instances
mcpServers:
n8n:
type: stdio
command: npx
args:
- -y
- n8n-mcp
env:
MCP_MODE: stdio
N8N_API_URL: $N8N_MCP_URL
N8N_API_KEY: $N8N_MCP_TOKEN
timeout: 60000
connectionMode: strict
# Alternative: n8n's built-in MCP (read-only, doesn't support building workflows)
# n8n-builtin:
# type: stdio
# command: npx
# args:
# - -y
# - supergateway
# - --streamableHttp
# - $N8N_MCP_URL
# - --header
# - "authorization:Bearer $N8N_MCP_TOKEN"
greeting: "Hi! I'm your Workflow Builder Agent. I can help you create, manage, and automate n8n workflows. What would you like to build today?"
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: |
You are a Workflow Builder Agent specialized in creating and managing automation workflows using n8n. You have direct access to n8n instances through the MCP server, allowing you to build powerful integrations and automations.
## Your Capabilities
**Workflow Management:**
- Create new workflows from scratch based on user requirements
- List, view, and analyze existing workflows
- Update and modify workflow configurations
- Activate and deactivate workflows
- Delete workflows when requested
**Execution Management:**
- View workflow execution history
- Analyze execution results and identify failures
- Debug workflow issues by examining execution details
- Clean up old execution records
**Credential & Authentication:**
- Create new credentials for service integrations
- View credential schemas to understand required fields
- Manage credential lifecycle
**Organization:**
- Create and manage tags for workflow organization
- Assign tags to workflows for better categorization
- Manage projects (Enterprise feature)
- Create and manage variables
**Security & Monitoring:**
- Generate security audit reports
- Monitor workflow health and performance
- Identify potential issues in workflow configurations
## Workflow Building Guidelines
When creating workflows, follow these best practices:
1. **Understand the goal**: Ask clarifying questions to understand what the user wants to automate
2. **Plan the flow**: Break down the automation into logical steps (trigger -> processing -> output)
3. **Choose appropriate triggers**: Select the right trigger type (webhook, schedule, event-based)
4. **Error handling**: Include error handling nodes for robust workflows
5. **Test incrementally**: Suggest testing each part of the workflow
## Common Integration Patterns
- **Webhook-based**: Receive data from external services
- **Scheduled tasks**: Run workflows on a schedule (cron-based)
- **Event-driven**: React to events from connected services
- **Data transformation**: Process and transform data between systems
- **Multi-step pipelines**: Chain multiple operations together
## Interaction Guidelines
- Before creating workflows, confirm the user's requirements and expected behavior
- Explain what each workflow does in simple terms
- Warn about potential issues (rate limits, authentication, data formats)
- Suggest improvements to existing workflows when appropriate
- Always confirm before deleting or deactivating workflows
## Important: Service Credentials
This agent helps you design and build workflows, but **service credentials must be set up by the user directly in n8n**. The agent cannot create or access actual API keys.
When a workflow requires connecting to external services (Twitter, Google Sheets, Slack, etc.):
1. The user must go to their **n8n dashboard → Credentials** (left menu)
2. Click **Create** and select the service (e.g., "X (Twitter)", "Google Sheets")
3. Enter the required API keys, OAuth tokens, or authentication details
4. Save the credential - n8n will test and encrypt it automatically
**Always remind users:**
- Which credentials are needed for the workflow you're designing
- That credentials are stored securely (encrypted) in n8n, not in the workflow itself
- To use descriptive names for credentials (e.g., "Twitter - Marketing Account")
- To set up separate credentials for development and production environments
## Safety Notes
- Never expose sensitive credentials in responses
- Be cautious with workflows that modify production data
- Recommend testing in a safe environment first
- Alert users to potential security implications of their workflow designs
- id: date
type: dynamic
priority: 10
source: date
enabled: true
storage:
cache:
type: in-memory
database:
type: sqlite
blob:
type: local
maxBlobSize: 52428800
maxTotalSize: 1073741824
cleanupAfterDays: 30
llm:
provider: openai
model: gpt-5-mini
apiKey: $OPENAI_API_KEY
toolConfirmation:
mode: manual
allowedToolsStorage: memory
prompts:
- type: inline
id: social-media-scheduler
title: "Social Media Scheduler"
description: "Auto-post content to Twitter/LinkedIn from a spreadsheet"
prompt: |
Help me build a social media scheduler workflow with these requirements:
1. Read scheduled posts from Google Sheets (columns: date, time, platform, content, image_url)
2. Run on a schedule (every hour) to check for posts due
3. Post to Twitter/X and LinkedIn based on the platform column
4. Mark posts as "published" in the sheet after posting
5. Send a Slack notification when posts go live
Walk me through the n8n nodes needed and how to configure each one.
category: social-media
priority: 10
showInStarters: true
- type: inline
id: list-workflows
title: "List Workflows"
description: "View all workflows in your n8n instance"
prompt: "List all workflows in my n8n instance and show their status (active/inactive)."
category: workflows
priority: 9
showInStarters: true
- type: inline
id: create-workflow
title: "Create Workflow"
description: "Build a new automation workflow"
prompt: "I want to create a new automation workflow. Help me design and build it."
category: workflows
priority: 8
showInStarters: true
- type: inline
id: execution-history
title: "Execution History"
description: "View recent workflow executions"
prompt: "Show me the recent workflow executions and their status."
category: executions
priority: 7
showInStarters: true
- type: inline
id: debug-workflow
title: "Debug Workflow"
description: "Analyze and debug workflow issues"
prompt: "Help me debug a workflow that's not working correctly."
category: debugging
priority: 6
showInStarters: true

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 MiB

319
dexto/commands/README.md Normal file
View File

@@ -0,0 +1,319 @@
# Dexto Commands (File Prompts)
This directory contains File Prompts — reusable prompt templates that work like Claude Code's custom slash commands.
## Prompt Types in Dexto
Dexto supports four types of prompts, each with different capabilities:
### 1. 📁 File Prompts (Commands)
Location:
- Local: `commands/`
- Global: `~/.dexto/commands`
Format: Markdown files with frontmatter
Arguments: Positional placeholders (`$1`, `$2`, `$ARGUMENTS`)
Best for: Simple, file-based prompts you can version control
### 2. 🔌 MCP Prompts
Source: Connected MCP servers
Format: Defined by MCP protocol
Arguments: Named arguments (e.g., `report_type: "metrics"`)
Best for: Complex prompts from external services (GitHub, databases, etc.)
### 3. ⚡ Starter Prompts
Source: Built into Dexto
Format: Hardcoded in code
Arguments: Varies by prompt
Best for: Common operations provided out-of-the-box
### 4. ✨ Custom Prompts
Source: Created at runtime via API/UI
Format: Stored in database
Arguments: Positional placeholders like File Prompts
Best for: User-created prompts that need persistence
---
**Custom Commands (Create, Use, Manage)**
Custom commands are prompts you create at runtime. They live in the local database (not on disk) and are available to the active agent across sessions. They support the same placeholder behavior as file prompts:
- `$1..$9` and `$ARGUMENTS` positional placeholders
- `$$` escapes a literal dollar
- `{{name}}` named placeholders (when you declare `arguments`)
- If no placeholders are used in the template: arguments/context are appended at the end
Create via Web UI
- Open the “Create Custom Prompt” modal in the web UI
- Provide `name`, optional `title`/`description`, and the prompt `content`
- Use `$1..$9`/`$ARGUMENTS`/`{{name}}` placeholders in `content`
- Optionally attach a resource file; it will be stored and included when the prompt runs
Create via API
- POST `POST /api/prompts/custom` with JSON:
```
{
"name": "research-summary",
"title": "Research Summary",
"description": "Summarize research papers with key findings",
"content": "Summarize in style $1 with length $2.\n\nContent:\n$ARGUMENTS",
"arguments": [
{ "name": "style", "required": true },
{ "name": "length", "required": true }
],
"resource": {
"base64": "data:application/pdf;base64,...",
"mimeType": "application/pdf",
"filename": "paper.pdf"
}
}
```
- Declaring `arguments` is optional but recommended; it enables inline argument hints in the slash UI and required-arg validation.
- The `resource` field is optional; attached data is stored in the blob store and sent alongside the prompt when executed.
Delete via API
- `DELETE /api/prompts/custom/:name`
Preview resolution (without sending to LLM)
- `GET /api/prompts/:name/resolve?context=...&args={...}`
- `context` becomes `_context` for positional flows
- `args` is a JSON string for structured argument values
Argument Handling Summary
- Positional tokens typed after `/name` appear in `args._positional` and are expanded into `$1..$9` and `$ARGUMENTS`.
- Named args can be declared in `arguments` and referenced as `{{name}}`.
- If the template contains any placeholders ($1..$9, $ARGUMENTS, or {{name}}), arguments are considered deconstructed and are NOT appended.
- If the template contains no placeholders, providers append at the end:
- `Context: <_context>` if provided, otherwise
- `Arguments: key: value, ...`
---
## Creating File Prompts
### Basic Structure
Create a `.md` file in this directory with frontmatter:
```markdown
---
description: Short description of what this prompt does
argument-hint: [required-arg] [optional-arg?]
---
# Prompt Title
Your prompt content here using $1, $2, or $ARGUMENTS placeholders.
```
### Frontmatter Fields
| Field | Required | Description | Example |
|-------|----------|-------------|---------|
| `description` | ✅ Yes | Brief description shown in UI | `"Summarize text with style and length"` |
| `argument-hint` | ⚠️ Recommended | Argument names for UI hints | `"[style] [length]"` |
| `name` | ❌ Optional | Override filename as command name | `"quick-summary"` |
| `category` | ❌ Optional | Group prompts by category | `"text-processing"` |
| `id` | ❌ Optional | Unique identifier | `"summarize-v2"` |
### Argument Placeholders
File prompts support Claude Code's positional argument system:
| Placeholder | Expands To | Use Case |
|-------------|------------|----------|
| `$1`, `$2`, ..., `$9` | Individual arguments by position | Structured parameters |
| `$ARGUMENTS` | Remaining arguments after `$1..$9` | Free-form text content |
| `$$` | Literal dollar sign | When you need `$` in output |
### Examples
#### Example 1: Structured Arguments Only
```markdown
---
description: Translate text between languages
argument-hint: [from-lang] [to-lang] [text]
---
Translate from $1 to $2:
$3
```
Usage: `/translate english spanish "Hello world"`
Expands to:
```
Translate from english to spanish:
Hello world
```
#### Example 2: Mixed Structured + Free-form
```markdown
---
description: Analyze code with focus area
argument-hint: [file] [focus]
---
Analyze the code in **$1** focusing on: $2
Full input for context:
$ARGUMENTS
```
Usage: `/analyze utils.ts performance "function slow() { ... }"`
Expands to:
```
Analyze the code in **utils.ts** focusing on: performance
Full input for context:
utils.ts performance function slow() { ... }
```
#### Example 3: Free-form Only
```markdown
---
description: Improve any text
argument-hint: [text-to-improve]
---
Please improve the following text:
$ARGUMENTS
```
Usage: `/improve "This sentence not good"`
Expands to:
```
Please improve the following text:
This sentence not good
```
---
## Usage in the UI
### Invoking File Prompts
1. Type `/` in chat — opens slash command autocomplete
2. Select your prompt — shows inline argument hints
3. Provide arguments — positional order matters!
### Argument Display
The UI shows:
- `<argname>` — Required argument
- `<argname?>` — Optional argument
- Hover tooltip — Argument description (if provided)
Example UI display for summarize:
```
/summarize <style> <length>
^required ^required
```
---
## How Different Prompt Types Handle Arguments
### File Prompts vs MCP Prompts
File Prompts (like `summarize`):
```
User types: /summarize technical 100 "Machine learning..."
Expands: $1="technical", $2="100", $ARGUMENTS="technical 100 Machine learning..."
Result: Prompt text with placeholders replaced
```
MCP Prompts (like `generate-report`):
```
User types: /generate-report metrics
Maps: _positional=["metrics"] → report_type="metrics"
Result: MCP server receives {report_type: "metrics"}
```
Key difference:
- File prompts: Simple string replacement in markdown
- MCP prompts: Structured data passed to external servers
---
## Best Practices
### ✅ DO:
- Use descriptive names — `analyze-performance` not `analyze`
- Add clear descriptions — help users understand what it does
- Include usage examples — in the prompt content or description
- Use `argument-hint` — enables inline UI hints
- Keep it focused — one clear purpose per prompt
- Use `$1`, `$2` for structure — when you need specific parameters
- Use `$ARGUMENTS` for flexibility — when content is variable
### ❌ DON'T:
- Don't use spaces in filenames — use kebab-case: `my-prompt.md`
- Don't create overly complex prompts — split into multiple files
- Don't forget argument-hint — users need to know what to provide
- Don't rely on order if flexible — document expected argument positions
---
## Testing Your Prompts
1. Create the `.md` file in this directory
2. Restart the agent (or wait for hot reload)
3. Type `/your-prompt-name` in chat
4. Test with different arguments — verify placeholders expand correctly
---
## Advanced: Argument-Hint Parsing
The `argument-hint` field is parsed to create structured argument definitions:
```markdown
argument-hint: [style] [length?] [extra-param]
```
Becomes:
```json
[
{ "name": "style", "required": true },
{ "name": "length", "required": false },
{ "name": "extra-param", "required": true }
]
```
Rules:
- `[name]` = required argument
- `[name?]` = optional argument (with `?`)
- Order matters — matches positional `$1`, `$2` positions
---
## Troubleshooting
### Prompt doesn't appear in slash command list
- Check filename ends with `.md`
- Verify frontmatter is valid YAML
- Ensure description field is present
- Put your file in `commands/` (local) or `~/.dexto/commands` (global)
- Restart the agent
---
## Further Reading
- Prompt Manager Architecture: `packages/core/src/prompts/prompt-manager.ts`
- File Prompt Provider: `packages/core/src/prompts/providers/file-prompt-provider.ts`
- Placeholder Expansion: `packages/core/src/prompts/utils.ts` (expandPlaceholders function)

View File

@@ -0,0 +1,103 @@
---
description: "Review code for bugs, improvements, and best practices with actionable feedback"
id: code-review
name: code-review
category: coding
---
<!-- TODO: (355) Move all prompts off absolute path and into relative agent specific paths, referenced using @dexto.agent_dir colocated near their folders. This allows us to keep agent specific prompts -->
<!-- https://github.com/truffle-ai/dexto/pull/355#discussion_r2413003414 -->
# Code Review Assistant
I'm here to help you review code for bugs, improvements, and best practices. I'll analyze your code and provide actionable feedback with specific suggestions for improvement.
## How I Work
When you share code with me, I'll:
1. **Analyze the code structure** and identify potential issues
2. **Check for common bugs** and edge cases
3. **Suggest performance improvements** and optimizations
4. **Review code style** and adherence to best practices
5. **Provide specific, actionable feedback** with examples
6. **Consider the context** and purpose of your code
## Natural Language Examples
```bash
# Use natural language - I'll understand what you want!
/code-review function calculateTotal(items) { return items.reduce((sum, item) => sum + item.price, 0); }
/code-review this React component for accessibility issues
/code-review my Python function for error handling
/code-review this SQL query for performance
/code-review my API endpoint for security vulnerabilities
```
## What I'll Review
I analyze code for:
- **Bugs & Logic Errors**: Incorrect calculations, edge cases, null handling
- **Performance Issues**: Inefficient algorithms, memory leaks, unnecessary operations
- **Security Vulnerabilities**: SQL injection, XSS, input validation
- **Code Quality**: Readability, maintainability, naming conventions
- **Best Practices**: Design patterns, error handling, testing considerations
- **Accessibility**: For web applications and user interfaces
## Code Review Process
1. **Initial Scan**: Quick overview of structure and purpose
2. **Detailed Analysis**: Line-by-line review for specific issues
3. **Pattern Recognition**: Identify common anti-patterns and improvements
4. **Alternative Solutions**: Suggest better approaches when applicable
5. **Prioritization**: Rank issues by severity and impact
## Response Format
I'll structure my review as:
1. **Summary** - High-level assessment and key findings
2. **Critical Issues** - Bugs, security problems, major performance issues
3. **Improvements** - Code quality, readability, and maintainability
4. **Suggestions** - Alternative approaches and best practices
5. **Questions** - Clarifications needed to provide better feedback
6. **Overall Rating** - Code quality score with justification
## Tips for Better Reviews
- **Provide context**: What is this code supposed to do?
- **Include requirements**: Any specific constraints or performance needs?
- **Mention the language/framework**: So I can give language-specific advice
- **Share related code**: Dependencies, interfaces, or surrounding context
- **Ask specific questions**: "Focus on security" or "Check for memory leaks"
## Language-Specific Expertise
I can review code in:
- **JavaScript/TypeScript**: Frontend, Node.js, React, Vue, Angular
- **Python**: Web apps, data science, automation, APIs
- **Java/C#**: Enterprise applications, Android, .NET
- **Go/Rust**: Systems programming, performance-critical code
- **SQL**: Database queries, performance, security
- **HTML/CSS**: Accessibility, responsive design, best practices
## Security Focus Areas
When reviewing for security, I check:
- **Input Validation**: Sanitization, type checking, bounds checking
- **Authentication**: Session management, password handling
- **Authorization**: Access control, permission checks
- **Data Protection**: Encryption, secure storage, transmission
- **Common Vulnerabilities**: OWASP Top 10, injection attacks
## Performance Focus Areas
When reviewing for performance, I examine:
- **Algorithm Complexity**: Time and space complexity analysis
- **Resource Usage**: Memory allocation, CPU utilization
- **I/O Operations**: Database queries, file operations, network calls
- **Caching**: Opportunities for memoization and result caching
- **Optimization**: Unnecessary operations, redundant calculations
Now, share your code and I'll provide a comprehensive review! You can paste it directly or describe what you'd like me to focus on.

104
dexto/commands/debug.md Normal file
View File

@@ -0,0 +1,104 @@
---
description: "Debug code issues with systematic problem-solving and troubleshooting steps"
id: debug
name: debug
category: tools
---
# Debug Assistant
I'm here to help you debug code issues systematically. I'll analyze problems, identify root causes, and guide you through the debugging process step by step.
## How I Work
When you share a bug or issue with me, I'll:
1. **Understand the problem** - What's happening vs. what should happen
2. **Analyze the symptoms** - Error messages, unexpected behavior, performance issues
3. **Investigate potential causes** - Logic errors, data issues, environment problems
4. **Suggest debugging strategies** - Logging, testing, isolation techniques
5. **Provide step-by-step solutions** - Specific fixes and verification steps
6. **Help prevent future issues** - Best practices and defensive programming
## Natural Language Examples
```bash
# Use natural language - I'll understand what you want!
/debug my function returns undefined when it should return a number
/debug this React component won't render
/debug my API endpoint gives 500 errors
/debug why my loop runs forever
/debug my database query is slow
```
## Common Debugging Scenarios
I can help with:
- **Runtime Errors**: Crashes, exceptions, error messages
- **Logic Bugs**: Incorrect calculations, wrong outputs, unexpected behavior
- **Performance Issues**: Slow execution, memory leaks, infinite loops
- **Data Problems**: Incorrect values, null/undefined errors, type mismatches
- **Environment Issues**: Configuration problems, dependency conflicts
- **Race Conditions**: Timing issues, async problems, concurrency bugs
## Debugging Process
1. **Problem Description**: Clearly state what's wrong
2. **Expected vs. Actual**: What should happen vs. what does happen
3. **Environment Context**: Language, framework, platform, dependencies
4. **Reproduction Steps**: How to trigger the issue consistently
5. **Error Analysis**: Parse error messages and stack traces
6. **Root Cause Investigation**: Identify the underlying problem
7. **Solution Implementation**: Apply the fix and verify it works
8. **Prevention**: Learn from the issue to avoid it in the future
## Debugging Techniques I'll Suggest
- **Logging & Tracing**: Add debug output to track execution flow
- **Breakpoint Analysis**: Use debuggers to inspect state at specific points
- **Input Validation**: Check data types, ranges, and formats
- **Isolation Testing**: Test components independently to narrow down issues
- **Regression Testing**: Verify fixes don't break existing functionality
- **Performance Profiling**: Measure execution time and resource usage
## Response Format
I'll structure my debugging help as:
1. **Problem Summary** - Clear understanding of the issue
2. **Root Cause Analysis** - What's causing the problem
3. **Debugging Steps** - Specific actions to take
4. **Solution** - How to fix the issue
5. **Verification** - How to confirm the fix works
6. **Prevention** - How to avoid similar issues
## Tips for Better Debugging
- **Be specific**: "Function returns undefined" vs. "Something's not working"
- **Include context**: Error messages, code snippets, environment details
- **Describe steps**: How to reproduce the issue consistently
- **Share relevant code**: The problematic function or component
- **Mention recent changes**: What you modified before the issue appeared
## Language-Specific Debugging
I can help debug code in:
- **JavaScript/TypeScript**: Console logging, Chrome DevTools, Node.js debugging
- **Python**: Print statements, pdb debugger, logging module
- **Java**: System.out.println, debugger, logging frameworks
- **C/C++**: Printf debugging, gdb debugger, valgrind
- **SQL**: Query analysis, execution plans, performance tuning
- **Shell Scripts**: Echo statements, set -x, bash debugging
## Common Debugging Patterns
- **Null/Undefined Checks**: Always validate data before using it
- **Boundary Testing**: Test edge cases and limits
- **Error Handling**: Catch and handle exceptions gracefully
- **Logging Strategy**: Use appropriate log levels and meaningful messages
- **Unit Testing**: Write tests to catch issues early
- **Code Review**: Have others review your code for potential problems
Now, tell me what you're debugging! Describe the problem, share any error messages, and I'll help you track it down step by step.

71
dexto/commands/explain.md Normal file
View File

@@ -0,0 +1,71 @@
---
description: "Explain complex concepts in simple terms with examples and analogies"
id: explain
name: explain
category: learning
---
# Concept Explainer
I'm here to explain complex concepts in simple, engaging terms. I'll adapt my explanation to your level and provide practical examples, analogies, and real-world applications.
## How I Work
When you ask me to explain something, I'll:
1. **Start with a clear, simple definition** that captures the essence
2. **Break it down into key components** or characteristics
3. **Provide relatable examples** and analogies
4. **Show practical applications** and use cases
5. **Connect it to related concepts** you might already know
6. **Adapt the complexity** based on your level and context
## Natural Language Examples
```bash
# Use natural language - I'll understand what you want!
/explain quantum mechanics
/explain blockchain for beginners
/explain photosynthesis to a 10-year-old
/explain Bayes theorem with examples
/explain how neural networks work
```
## What I'll Provide
For each concept, I'll give you:
- **Simple Definition**: What it is in plain terms
- **Key Characteristics**: The main features or principles
- **Real Examples**: Concrete instances you can relate to
- **Analogies**: Comparisons to familiar concepts
- **Practical Uses**: Where and how it's applied
- **Related Ideas**: Connected concepts to explore next
## Level Adaptation
I automatically adjust my explanation based on:
- **Your stated level** (beginner, intermediate, expert)
- **The context** of your question
- **Your background** (technical, business, academic, etc.)
- **The complexity** of the concept itself
## Tips for Better Explanations
- **Be specific**: "Explain machine learning" vs "Explain how Netflix recommends movies"
- **Mention your level**: "Explain as if I'm a high school student"
- **Ask for examples**: "Give me real-world examples of this"
- **Request analogies**: "Use an analogy to explain this"
## Response Format
I'll structure my explanation as:
1. **Simple Definition** - One sentence that captures the essence
2. **Key Points** - 3-5 main characteristics or principles
3. **Examples & Analogies** - Real-world instances and comparisons
4. **How It Works** - Step-by-step breakdown (when applicable)
5. **Why It Matters** - Practical importance and applications
6. **Related Concepts** - What to explore next
Now, what would you like me to explain? Just tell me the concept and I'll adapt my explanation to your needs!

View File

@@ -0,0 +1,21 @@
---
description: Summarize text content with customizable style and length. Usage `/summarize technical 100 'Machine learning'`
argument-hint: [style] [length] [content]
---
# Summarize Content
Please summarize the following content using a **$1** style with approximately **$2** words.
Content to summarize: $ARGUMENTS
Guidelines:
- Use clear, concise language
- Focus on key points and main ideas
- Maintain the original intent and tone
- Structure the summary logically
Examples:
- Style: technical, casual, formal, academic
- Length: 50, 100, 200, 500 (word count)

54
dexto/compose.yaml Normal file
View File

@@ -0,0 +1,54 @@
# Comments are provided throughout this file to help you get started.
# If you need more help, visit the Docker Compose reference guide at
# https://docs.docker.com/go/compose-spec-reference/
# Here the instructions define your application as a service called "server".
# This service is built from the Dockerfile in the current directory.
# You can add other services your application may depend on here, such as a
# database or a cache. For examples, see the Awesome Compose repository:
# https://github.com/docker/awesome-compose
services:
server:
build:
context: .
env_file:
- .env
environment:
NODE_ENV: production
ports:
- 3001:3001
# The commented out section below is an example of how to define a PostgreSQL
# database that your application can use. `depends_on` tells Docker Compose to
# start the database before your application. The `db-data` volume persists the
# database data between container restarts. The `db-password` secret is used
# to set the database password. You must create `db/password.txt` and add
# a password of your choosing to it before running `docker-compose up`.
# depends_on:
# db:
# condition: service_healthy
# db:
# image: postgres
# restart: always
# user: postgres
# secrets:
# - db-password
# volumes:
# - db-data:/var/lib/postgresql/data
# environment:
# - POSTGRES_DB=example
# - POSTGRES_PASSWORD_FILE=/run/secrets/db-password
# expose:
# - 5432
# healthcheck:
# test: [ "CMD", "pg_isready" ]
# interval: 10s
# timeout: 5s
# retries: 5
# volumes:
# db-data:
# secrets:
# db-password:
# file: db/password.txt

20
dexto/docs/.gitignore vendored Normal file
View File

@@ -0,0 +1,20 @@
# Dependencies
/node_modules
# Production
/build
# Generated files
.docusaurus
.cache-loader
# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

41
dexto/docs/README.md Normal file
View File

@@ -0,0 +1,41 @@
# Website
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
### Installation
```
$ yarn
```
### Local Development
```
$ yarn start
```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
### Build
```
$ yarn build
```
This command generates static content into the `build` directory and can be served using any static contents hosting service.
### Deployment
Using SSH:
```
$ USE_SSH=true yarn deploy
```
Not using SSH:
```
$ GIT_USER=<Your GitHub username> yarn deploy
```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

View File

@@ -0,0 +1,34 @@
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
const sidebars: SidebarsConfig = {
apiSidebar: [
{
type: 'doc',
id: 'getting-started',
label: 'Getting Started',
},
{
type: 'link',
label: 'REST API Reference',
href: '/api/rest',
},
{
type: 'category',
label: 'Dexto SDK',
link: {
type: 'generated-index',
title: 'Dexto SDK API Reference',
description:
'Complete technical API reference for the Dexto SDK for TypeScript/JavaScript.',
},
items: [
{
type: 'autogenerated',
dirName: 'sdk',
},
],
},
],
};
export default sidebars;

View File

@@ -0,0 +1,9 @@
{
"label": "API Reference",
"position": 3,
"link": {
"type": "generated-index",
"title": "Dexto API Reference",
"description": "Welcome to the Dexto API documentation. Here you will find detailed information about using Dexto as a Library, and about our REST and SSE streaming APIs. To use the REST or SSE API, you must first start the Dexto server by running the following command in your terminal:\n\n```bash\ndexto --mode server\n```\n\nBy default, the server will start on `http://localhost:3001`."
}
}

View File

@@ -0,0 +1,54 @@
---
slug: /
sidebar_position: 1
---
# Getting Started
Welcome to the Dexto API. This guide will walk you through the essential first steps to begin interacting with your Dexto agent programmatically.
## 1. Starting the API Server
Before you can make any API calls, you must start the Dexto server. This single command enables both the REST and SSE streaming APIs.
Run the following command in your terminal:
```bash
dexto --mode server
```
By default, the server will run on port `3001`. You should see a confirmation message in your terminal indicating that the server has started successfully.
**Customize the port:**
```bash
dexto --mode server --port 8080
```
This starts the API server on port 8080 instead of the default 3001.
## 2. Choosing Your API
Dexto offers two distinct APIs to suit different use cases. Understanding when to use each is key to building your application effectively.
### When to use the REST API?
Use the **REST API** for synchronous, request-response actions where you want to perform a task and get a result immediately. It's ideal for:
- Managing resources (e.g., listing or adding MCP servers).
- Retrieving configuration or session data.
- Triggering a single, non-streamed agent response.
**Base URL**: `http://localhost:3001`
### When to use Server-Sent Events (SSE)?
Use **Server-Sent Events (SSE)** for building interactive, real-time applications. It's the best choice for:
- Streaming agent responses (`chunk` events) as they are generated.
- Receiving real-time events from the agent's core, such as `toolCall` and `toolResult`.
- Creating chat-like user interfaces.
**Stream URL**: `http://localhost:3001/api/message-stream`
## 3. What's Next?
Now that your server is running and you know which API to use, you can dive into the specifics:
- Explore the **[REST API Reference](/api/rest)** - comprehensive documentation of all HTTP endpoints.
- Learn about the **[SDK Events Reference](/api/sdk/events)**.

View File

@@ -0,0 +1,9 @@
{
"label": "Dexto SDK",
"position": 4,
"link": {
"type": "generated-index",
"title": "Dexto SDK API Reference",
"description": "Complete technical API reference for the Dexto SDK for TypeScript/JavaScript."
}
}

View File

@@ -0,0 +1,324 @@
---
sidebar_position: 7
---
# AgentFactory API
The `AgentFactory` namespace provides static methods for agent creation, installation, and management. Use these functions to create agents from inline configs, install agents from the bundled registry, install custom agents, and manage installed agents.
```typescript
import { AgentFactory } from '@dexto/agent-management';
```
---
## createAgent
Creates a `DextoAgent` from an inline configuration object. Use this when you have a config from a database, API, or constructed programmatically and don't need a registry file.
```typescript
async function AgentFactory.createAgent(
config: AgentConfig,
options?: CreateAgentOptions
): Promise<DextoAgent>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `config` | `AgentConfig` | Agent configuration object |
| `options.agentId` | `string` | (Optional) Override agent ID (affects log/storage paths) |
| `options.isInteractiveCli` | `boolean` | (Optional) If true, disables console logging |
**Returns:** `Promise<DextoAgent>` - Agent instance (not started)
**Example:**
```typescript
import { AgentFactory } from '@dexto/agent-management';
// Create from inline config
const agent = await AgentFactory.createAgent({
llm: {
provider: 'openai',
model: 'gpt-4o',
apiKey: process.env.OPENAI_API_KEY
},
systemPrompt: 'You are a helpful assistant.'
});
await agent.start();
// With custom agent ID (affects log/storage paths)
const agent = await AgentFactory.createAgent(config, { agentId: 'my-custom-agent' });
// From database
const configFromDb = await db.getAgentConfig(userId);
const agent = await AgentFactory.createAgent(configFromDb, { agentId: `user-${userId}` });
await agent.start();
```
---
## listAgents
Lists all installed and available agents from the bundled registry.
```typescript
async function AgentFactory.listAgents(): Promise<{
installed: AgentInfo[];
available: AgentInfo[];
}>
```
**Returns:** Object with `installed` and `available` agent arrays
```typescript
interface AgentInfo {
id: string; // Unique identifier
name: string; // Display name
description: string; // What the agent does
author: string; // Creator
tags: string[]; // Categorization tags
type: 'builtin' | 'custom';
}
```
**Example:**
```typescript
import { AgentFactory } from '@dexto/agent-management';
const { installed, available } = await AgentFactory.listAgents();
console.log('Installed agents:');
installed.forEach(agent => {
console.log(` - ${agent.name} (${agent.id})`);
});
console.log('\nAvailable to install:');
available.forEach(agent => {
console.log(` - ${agent.name}: ${agent.description}`);
});
```
---
## installAgent
Installs an agent from the bundled registry to the local agents directory (`~/.dexto/agents/`).
```typescript
async function AgentFactory.installAgent(
agentId: string,
options?: InstallOptions
): Promise<string>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `agentId` | `string` | Agent ID from bundled registry |
| `options.agentsDir` | `string` | (Optional) Custom agents directory |
**Returns:** `Promise<string>` - Path to installed agent's main config file
**Throws:** `DextoRuntimeError` if agent not found or installation fails
**Example:**
```typescript
import { AgentFactory } from '@dexto/agent-management';
// Install a bundled agent
const configPath = await AgentFactory.installAgent('coding-agent');
console.log(`Installed to: ${configPath}`);
```
### What Happens During Installation
1. Agent files are copied from bundled location to `~/.dexto/agents/{agentId}/`
2. Agent is added to the user's registry (`~/.dexto/agents/registry.json`)
3. User preferences are applied at runtime for the bundled coding-agent only
---
## installCustomAgent
Installs a custom agent from a local file or directory path.
```typescript
async function AgentFactory.installCustomAgent(
agentId: string,
sourcePath: string,
metadata: {
name?: string;
description: string;
author: string;
tags: string[];
},
options?: InstallOptions
): Promise<string>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `agentId` | `string` | Unique ID for the custom agent |
| `sourcePath` | `string` | Absolute path to agent YAML file or directory |
| `metadata.name` | `string` | (Optional) Display name (defaults to agentId) |
| `metadata.description` | `string` | Description of what the agent does |
| `metadata.author` | `string` | Creator of the agent |
| `metadata.tags` | `string[]` | Categorization tags |
| `options.agentsDir` | `string` | (Optional) Custom agents directory |
**Returns:** `Promise<string>` - Path to installed agent's main config file
**Throws:**
- `DextoRuntimeError` if agent ID conflicts with bundled agent
- `DextoRuntimeError` if agent ID already exists
- `DextoRuntimeError` if source path doesn't exist
**Example:**
```typescript
import { AgentFactory } from '@dexto/agent-management';
// Install from a single YAML file
const configPath = await AgentFactory.installCustomAgent(
'my-support-agent',
'/path/to/support-agent.yml',
{
description: 'Custom support agent for our product',
author: 'My Team',
tags: ['support', 'custom']
}
);
// Install from a directory (for agents with multiple files)
const configPath = await AgentFactory.installCustomAgent(
'my-complex-agent',
'/path/to/agent-directory/',
{
name: 'Complex Agent',
description: 'Agent with knowledge files and multiple configs',
author: 'My Team',
tags: ['complex', 'custom']
}
);
```
### Directory Structure for Multi-File Agents
When installing from a directory:
```
my-agent/
├── agent.yml # Main config (required, or specify custom name)
├── knowledge/
│ ├── docs.md
│ └── faq.md
└── prompts/
└── system.txt
```
---
## uninstallAgent
Removes an installed agent from disk and the user registry.
```typescript
async function AgentFactory.uninstallAgent(agentId: string): Promise<void>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `agentId` | `string` | Agent ID to uninstall |
**Throws:** `DextoRuntimeError` if agent is not installed
**Example:**
```typescript
import { AgentFactory } from '@dexto/agent-management';
// Uninstall an agent
await AgentFactory.uninstallAgent('my-custom-agent');
console.log('Agent uninstalled');
```
### What Happens During Uninstallation
1. Agent directory is removed from `~/.dexto/agents/{agentId}/`
2. Agent entry is removed from user registry (`~/.dexto/agents/registry.json`)
:::caution
Uninstallation is permanent. All agent files including conversation history (if stored locally) will be deleted.
:::
---
## InstallOptions
Options for installation functions:
```typescript
interface InstallOptions {
/** Directory where agents are stored (default: ~/.dexto/agents) */
agentsDir?: string;
}
```
---
## Complete Example
```typescript
import { AgentFactory } from '@dexto/agent-management';
import { AgentManager } from '@dexto/agent-management';
async function setupAgents() {
// List what's available
const { installed, available } = await AgentFactory.listAgents();
console.log(`${installed.length} installed, ${available.length} available`);
// Install a bundled agent if not already installed
if (!installed.some(a => a.id === 'coding-agent')) {
await AgentFactory.installAgent('coding-agent');
console.log('Installed coding-agent');
}
// Install a custom agent
await AgentFactory.installCustomAgent(
'team-agent',
'./my-agents/team-agent.yml',
{
description: 'Our team\'s custom agent',
author: 'Engineering Team',
tags: ['internal', 'custom']
}
);
// Now use AgentManager to work with installed agents
const manager = new AgentManager('~/.dexto/agents/registry.json');
await manager.loadRegistry();
const agent = await manager.loadAgent('team-agent');
await agent.start();
// ... use the agent ...
await agent.stop();
}
```
---
## File Locations
| Resource | Path |
| :--- | :--- |
| Agents directory | `~/.dexto/agents/` |
| User registry | `~/.dexto/agents/registry.json` |
| Per-agent configs | `~/.dexto/agents/{agentId}/` |
| Bundled registry | Bundled with `@dexto/agent-management` package |
---
## See Also
- [AgentManager API](./agent-manager.md) - Registry-based agent lifecycle management
- [Config Utilities](./config-utilities.md) - Lower-level config loading functions
- [Agent Orchestration Tutorial](/docs/tutorials/sdk/orchestration) - Step-by-step guide

View File

@@ -0,0 +1,263 @@
---
sidebar_position: 5
---
# AgentManager API
The `AgentManager` class provides registry-based agent lifecycle management. It loads agent configurations from a registry file and creates agent instances programmatically.
```typescript
import { AgentManager } from '@dexto/agent-management';
```
:::note When to use AgentManager
**`AgentManager`** - Registry-based. Use when you have a `registry.json` with multiple predefined agents.
:::
---
## Constructor
### `constructor`
Creates a new AgentManager instance pointing to a registry file.
```typescript
constructor(registryPath: string)
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `registryPath` | `string` | Path to registry.json file (absolute or relative) |
**Example:**
```typescript
// Project-local registry
const manager = new AgentManager('./agents/registry.json');
// Absolute path
const manager = new AgentManager('/path/to/registry.json');
```
---
## Methods
### `loadRegistry`
Loads the registry from file. Must be called before using sync methods like `listAgents()` or `hasAgent()`.
```typescript
async loadRegistry(): Promise<Registry>
```
**Returns:** `Promise<Registry>` - The loaded registry object
**Example:**
```typescript
const manager = new AgentManager('./registry.json');
await manager.loadRegistry();
// Now sync methods work
const agents = manager.listAgents();
```
:::note
`loadAgent()` automatically calls `loadRegistry()` if not already loaded.
:::
---
### `listAgents`
Returns metadata for all agents in the registry.
```typescript
listAgents(): AgentMetadata[]
```
**Returns:** `AgentMetadata[]` - Array of agent metadata objects
```typescript
interface AgentMetadata {
id: string; // Unique identifier
name: string; // Display name
description: string; // What the agent does
author?: string; // Creator
tags?: string[]; // Categorization tags
}
```
**Example:**
```typescript
const manager = new AgentManager('./registry.json');
await manager.loadRegistry();
const agents = manager.listAgents();
console.log(agents);
// [
// { id: 'coding-agent', name: 'Coding Assistant', description: '...', tags: ['coding'] },
// { id: 'support-agent', name: 'Support Assistant', description: '...', tags: ['support'] }
// ]
// Filter by tag
const codingAgents = agents.filter(a => a.tags?.includes('coding'));
```
---
### `hasAgent`
Checks if an agent exists in the registry.
```typescript
hasAgent(id: string): boolean
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `id` | `string` | Agent ID to check |
**Returns:** `boolean` - True if agent exists
**Example:**
```typescript
const manager = new AgentManager('./registry.json');
await manager.loadRegistry();
if (manager.hasAgent('coding-agent')) {
const agent = await manager.loadAgent('coding-agent');
}
```
---
### `loadAgent`
Loads a `DextoAgent` instance from the registry. Loads the agent's YAML config, enriches it with runtime paths, and returns an unstarted agent.
```typescript
async loadAgent(id: string): Promise<DextoAgent>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `id` | `string` | Agent ID from registry |
**Returns:** `Promise<DextoAgent>` - Agent instance (not started)
**Throws:**
- `DextoRuntimeError` if agent not found or config loading fails
- `DextoValidationError` if agent config validation fails
**Example:**
```typescript
const manager = new AgentManager('./registry.json');
const agent = await manager.loadAgent('coding-agent');
await agent.start();
// Use the agent
const session = await agent.createSession();
const response = await agent.generate('Write a function to reverse a string', session.id);
console.log(response.content);
await agent.stop();
```
---
## Registry Format
The registry file is a JSON file that describes available agents:
```json
{
"agents": [
{
"id": "coding-agent",
"name": "Coding Assistant",
"description": "Expert coding assistant for development tasks",
"configPath": "./coding-agent.yml",
"author": "Your Team",
"tags": ["coding", "development"]
},
{
"id": "support-agent",
"name": "Support Assistant",
"description": "Friendly customer support agent",
"configPath": "./support-agent.yml",
"tags": ["support", "customer-service"]
}
]
}
```
| Field | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| `id` | `string` | Yes | Unique identifier (used in `loadAgent()`) |
| `name` | `string` | Yes | Human-readable display name |
| `description` | `string` | Yes | What this agent does |
| `configPath` | `string` | Yes | Path to YAML config (relative to registry.json) |
| `author` | `string` | No | Creator of the agent |
| `tags` | `string[]` | No | Categorization tags |
---
## Complete Example
```typescript
import { AgentManager } from '@dexto/agent-management';
async function main() {
// Initialize manager
const manager = new AgentManager('./agents/registry.json');
await manager.loadRegistry();
// List available agents
console.log('Available agents:');
for (const agent of manager.listAgents()) {
console.log(` - ${agent.name} (${agent.id}): ${agent.description}`);
}
// Create and use an agent
if (manager.hasAgent('coding-agent')) {
const agent = await manager.loadAgent('coding-agent');
await agent.start();
const session = await agent.createSession();
const response = await agent.generate('Hello!', session.id);
console.log(response.content);
await agent.stop();
}
}
main();
```
---
## Error Handling
```typescript
import { AgentManager } from '@dexto/agent-management';
try {
const manager = new AgentManager('./registry.json');
const agent = await manager.loadAgent('non-existent-agent');
} catch (error) {
if (error.code === 'AGENT_NOT_FOUND') {
console.log('Agent not found in registry');
} else if (error.name === 'DextoValidationError') {
console.log('Agent config validation failed:', error.issues);
}
}
```
---
## See Also
- [Config Utilities](./config-utilities.md) - Lower-level config loading functions
- [AgentFactory API](./agent-factory.md) - Agent installation and management
- [Agent Orchestration Tutorial](/docs/tutorials/sdk/orchestration) - Step-by-step guide

View File

@@ -0,0 +1,209 @@
---
sidebar_position: 6
---
# Config Utilities
Utilities for loading and enriching agent configurations from YAML files. These functions are the building blocks for programmatic agent management.
```typescript
import { loadAgentConfig, enrichAgentConfig } from '@dexto/agent-management';
```
---
## loadAgentConfig
Loads and processes an agent configuration from a YAML file. Handles file reading, YAML parsing, and template variable expansion.
```typescript
async function loadAgentConfig(
configPath: string,
logger?: IDextoLogger
): Promise<AgentConfig>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `configPath` | `string` | Path to the YAML config file (absolute or relative) |
| `logger` | `IDextoLogger` | (Optional) Logger instance for debug output |
**Returns:** `Promise<AgentConfig>` - Parsed configuration object
**Throws:**
- `ConfigError` with `FILE_NOT_FOUND` if file doesn't exist
- `ConfigError` with `FILE_READ_ERROR` if file read fails
- `ConfigError` with `PARSE_ERROR` if YAML is invalid
### What It Does
1. **Reads the YAML file** from disk
2. **Parses YAML** into a JavaScript object
3. **Expands template variables** like `${{dexto.agent_dir}}`
4. **Expands environment variables** like `$OPENAI_API_KEY`
### Example
```typescript
import { loadAgentConfig } from '@dexto/agent-management';
// Load a config file
const config = await loadAgentConfig('./agents/my-agent.yml');
console.log(config.llm.provider); // 'openai'
console.log(config.llm.model); // 'gpt-4o'
```
### Template Variables
Config files can use template variables that are expanded at load time:
```yaml
# my-agent.yml
systemPrompt:
contributors:
- id: knowledge
type: file
files:
- ${{dexto.agent_dir}}/knowledge/docs.md
```
| Variable | Expands To |
| :--- | :--- |
| `${{dexto.agent_dir}}` | Directory containing the config file |
### Environment Variables
Environment variables are expanded during schema validation:
```yaml
llm:
provider: openai
model: gpt-4o
apiKey: $OPENAI_API_KEY # Expanded from environment
```
---
## enrichAgentConfig
Enriches a loaded configuration with per-agent runtime paths for logs, database, and blob storage. This function should be called after `loadAgentConfig` and before creating a `DextoAgent`.
```typescript
function enrichAgentConfig(
config: AgentConfig,
configPath?: string,
isInteractiveCli?: boolean
): AgentConfig
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `config` | `AgentConfig` | Configuration from `loadAgentConfig` |
| `configPath` | `string` | (Optional) Path to config file (used for agent ID derivation) |
| `isInteractiveCli` | `boolean` | (Optional) If true, disables console logging (default: false) |
**Returns:** `AgentConfig` - Enriched configuration with explicit paths
### What It Adds
Each agent gets isolated paths based on its ID:
| Resource | Path |
| :--- | :--- |
| Logs | `~/.dexto/agents/{agentId}/logs/{agentId}.log` |
| Database | `~/.dexto/agents/{agentId}/db/{agentId}.db` |
| Blob Storage | `~/.dexto/agents/{agentId}/blobs/` |
### Agent ID Derivation
The agent ID is derived in priority order:
1. `agentCard.name` from config (sanitized)
2. Config filename (without extension)
3. Fallback: `coding-agent`
### Example
```typescript
import { loadAgentConfig, enrichAgentConfig } from '@dexto/agent-management';
import { DextoAgent } from '@dexto/core';
// Load raw config
const config = await loadAgentConfig('./agents/coding-agent.yml');
// Enrich with runtime paths
const enrichedConfig = enrichAgentConfig(config, './agents/coding-agent.yml');
// Create agent with enriched config
const agent = new DextoAgent(enrichedConfig, './agents/coding-agent.yml');
await agent.start();
```
### Default Storage Configuration
If no storage is specified in the config, enrichment adds:
```typescript
{
storage: {
cache: { type: 'in-memory' },
database: { type: 'sqlite', path: '~/.dexto/agents/{agentId}/db/{agentId}.db' },
blob: { type: 'local', storePath: '~/.dexto/agents/{agentId}/blobs/' }
}
}
```
---
## Complete Usage Pattern
```typescript
import { loadAgentConfig, enrichAgentConfig } from '@dexto/agent-management';
import { DextoAgent } from '@dexto/core';
async function createAgentFromConfig(configPath: string): Promise<DextoAgent> {
// 1. Load the YAML config
const config = await loadAgentConfig(configPath);
// 2. Enrich with runtime paths
const enrichedConfig = enrichAgentConfig(config, configPath);
// 3. Create and start the agent
const agent = new DextoAgent(enrichedConfig, configPath);
await agent.start();
return agent;
}
// Usage
const agent = await createAgentFromConfig('./agents/my-agent.yml');
const session = await agent.createSession();
const response = await agent.generate('Hello!', session.id);
```
---
## Error Handling
```typescript
import { loadAgentConfig, enrichAgentConfig } from '@dexto/agent-management';
try {
const config = await loadAgentConfig('./agents/my-agent.yml');
const enriched = enrichAgentConfig(config, './agents/my-agent.yml');
} catch (error) {
if (error.code === 'FILE_NOT_FOUND') {
console.error('Config file not found:', error.path);
} else if (error.code === 'PARSE_ERROR') {
console.error('Invalid YAML:', error.message);
}
}
```
---
## See Also
- [AgentManager API](./agent-manager.md) - Higher-level registry-based management
- [AgentFactory API](./agent-factory.md) - Agent installation functions
- [Loading Agent Configs Tutorial](/docs/tutorials/sdk/config-files) - Step-by-step guide

View File

@@ -0,0 +1,596 @@
---
sidebar_position: 1
---
# DextoAgent API
Complete API reference for the main `DextoAgent` class. This is the core interface for the Dexto Agent SDK.
## Constructor and Lifecycle
### `constructor`
Creates a new Dexto agent instance with the provided configuration.
```typescript
constructor(config: AgentConfig)
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `config` | `AgentConfig` | Agent configuration object |
### `start`
Initializes and starts the agent with all required services.
```typescript
async start(): Promise<void>
```
**Parameters:** None
**Example:**
```typescript
const agent = new DextoAgent(config);
await agent.start();
```
### `stop`
Stops the agent and cleans up all resources.
```typescript
async stop(): Promise<void>
```
**Example:**
```typescript
await agent.stop();
```
---
## Core Methods
The Dexto Agent SDK provides three methods for processing messages:
- **`generate()`** - Recommended for most use cases. Returns a complete response.
- **`stream()`** - For real-time streaming UIs. Yields events as they arrive.
- **`run()`** - Lower-level method for direct control.
### `generate`
**Recommended method** for processing user input. Waits for complete response.
```typescript
async generate(
content: ContentInput,
sessionId: string,
options?: GenerateOptions
): Promise<GenerateResponse>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `content` | `string \| ContentPart[]` | User message (string) or multimodal content (array) |
| `sessionId` | `string` | **Required.** Session ID for the conversation |
| `options.signal` | `AbortSignal` | (Optional) For cancellation |
**Content Types:**
```typescript
// Simple string content
type ContentInput = string | ContentPart[];
// For multimodal content, use ContentPart array:
type ContentPart = TextPart | ImagePart | FilePart;
interface TextPart { type: 'text'; text: string; }
interface ImagePart { type: 'image'; image: string; mimeType?: string; }
interface FilePart { type: 'file'; data: string; mimeType: string; filename?: string; }
```
**Returns:** `Promise<GenerateResponse>`
```typescript
interface GenerateResponse {
content: string; // The AI's text response
reasoning?: string; // Extended thinking (o1/o3 models)
usage: TokenUsage; // Token usage statistics
toolCalls: AgentToolCall[]; // Tools that were called
sessionId: string;
messageId: string;
}
```
**Example:**
```typescript
const agent = new DextoAgent(config);
await agent.start();
const session = await agent.createSession();
// Simple text message
const response = await agent.generate('What is 2+2?', session.id);
console.log(response.content); // "4"
console.log(response.usage.totalTokens); // Token count
// With image URL (auto-detected)
const response = await agent.generate([
{ type: 'text', text: 'Describe this image' },
{ type: 'image', image: 'https://example.com/photo.jpg' }
], session.id);
// With image base64
const response = await agent.generate([
{ type: 'text', text: 'Describe this image' },
{ type: 'image', image: base64Image, mimeType: 'image/png' }
], session.id);
// With file URL
const response = await agent.generate([
{ type: 'text', text: 'Summarize this document' },
{ type: 'file', data: 'https://example.com/doc.pdf', mimeType: 'application/pdf' }
], session.id);
// With file base64
const response = await agent.generate([
{ type: 'text', text: 'Summarize this document' },
{ type: 'file', data: base64Pdf, mimeType: 'application/pdf', filename: 'doc.pdf' }
], session.id);
// With cancellation support
const controller = new AbortController();
const response = await agent.generate('Long task...', session.id, { signal: controller.signal });
await agent.stop();
```
### `stream`
For real-time streaming UIs. Yields events as they arrive.
```typescript
async stream(
content: ContentInput,
sessionId: string,
options?: StreamOptions
): Promise<AsyncIterableIterator<StreamingEvent>>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `content` | `string \| ContentPart[]` | User message (string) or multimodal content (array) |
| `sessionId` | `string` | **Required.** Session ID |
| `options.signal` | `AbortSignal` | (Optional) For cancellation |
**Returns:** `Promise<AsyncIterableIterator<StreamingEvent>>`
**Example:**
```typescript
const session = await agent.createSession();
// Simple text streaming
for await (const event of await agent.stream('Write a poem', session.id)) {
if (event.name === 'llm:chunk') {
process.stdout.write(event.content);
}
if (event.name === 'llm:tool-call') {
console.log(`\n[Using ${event.toolName}]\n`);
}
}
// Streaming with image
for await (const event of await agent.stream([
{ type: 'text', text: 'Describe this image' },
{ type: 'image', image: base64Image, mimeType: 'image/png' }
], session.id)) {
if (event.name === 'llm:chunk') {
process.stdout.write(event.content);
}
}
```
### `run`
Lower-level method for direct control. Prefer `generate()` for most use cases.
```typescript
async run(
textInput: string,
imageDataInput: { image: string; mimeType: string } | undefined,
fileDataInput: { data: string; mimeType: string; filename?: string } | undefined,
sessionId: string,
stream?: boolean
): Promise<string>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `textInput` | `string` | User message or query |
| `imageDataInput` | `{ image: string; mimeType: string } \| undefined` | Image data or undefined |
| `fileDataInput` | `{ data: string; mimeType: string; filename?: string } \| undefined` | File data or undefined |
| `sessionId` | `string` | **Required.** Session ID |
| `stream` | `boolean` | (Optional) Enable streaming (default: false) |
**Returns:** `Promise<string>` - AI response text
**Example:**
```typescript
const agent = new DextoAgent(config);
await agent.start();
const session = await agent.createSession();
// Recommended: Use generate() for most use cases
const response = await agent.generate(
"Explain quantum computing",
session.id
);
console.log(response.content);
// Lower-level run() method (returns just the text)
const responseText = await agent.run(
"Explain quantum computing",
undefined, // no image
undefined, // no file
session.id
);
await agent.stop();
```
### `cancel`
Cancels the currently running turn for a session.
```typescript
async cancel(sessionId: string): Promise<boolean>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `sessionId` | `string` | **Required.** Session ID to cancel |
**Returns:** `Promise<boolean>` - true if a run was in progress and cancelled
---
## Session Management
:::note Architectural Pattern
DextoAgent's core is **stateless** and does not track a "current" or "default" session. All session-specific operations require an explicit `sessionId` parameter. Application layers (CLI, WebUI, API servers) are responsible for managing which session is active in their own context.
:::
### `createSession`
Creates a new conversation session with optional custom ID.
```typescript
async createSession(sessionId?: string): Promise<ChatSession>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `sessionId` | `string` | (Optional) Custom session ID |
**Returns:** `Promise<ChatSession>`
**Example:**
```typescript
// Create a new session (auto-generated ID)
const session = await agent.createSession();
console.log(`Created session: ${session.id}`);
// Create a session with custom ID
const userSession = await agent.createSession('user-123');
// Use the session for conversations
await agent.generate("Hello!", session.id);
```
### `getSession`
Retrieves an existing session by its ID.
```typescript
async getSession(sessionId: string): Promise<ChatSession | undefined>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `sessionId` | `string` | Session ID to retrieve |
**Returns:** `Promise<ChatSession | undefined>`
### `listSessions`
Returns an array of all active session IDs.
```typescript
async listSessions(): Promise<string[]>
```
**Returns:** `Promise<string[]>` - Array of session IDs
### `deleteSession`
Permanently deletes a session and all its conversation history. This action cannot be undone.
```typescript
async deleteSession(sessionId: string): Promise<void>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `sessionId` | `string` | Session ID to delete |
**Note:** This completely removes the session and all associated conversation data from storage.
### `resetConversation`
Clears the conversation history of a session while keeping the session active.
```typescript
async resetConversation(sessionId: string): Promise<void>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `sessionId` | `string` | Session ID to reset |
### `getSessionMetadata`
Retrieves metadata for a session including creation time and message count.
```typescript
async getSessionMetadata(sessionId: string): Promise<SessionMetadata | undefined>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `sessionId` | `string` | Session ID |
**Returns:** `Promise<SessionMetadata | undefined>`
### `getSessionHistory`
Gets the complete conversation history for a session.
```typescript
async getSessionHistory(sessionId: string): Promise<ConversationHistory>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `sessionId` | `string` | Session ID |
**Returns:** `Promise<ConversationHistory>`
---
## Configuration
### `switchLLM`
Dynamically changes the LLM configuration for the agent or a specific session.
```typescript
async switchLLM(
llmUpdates: LLMUpdates,
sessionId?: string
): Promise<ValidatedLLMConfig>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `llmUpdates` | `LLMUpdates` | LLM configuration updates (model, provider, apiKey, etc.) |
| `sessionId` | `string` | (Optional) Target session ID |
**Returns:** `Promise<ValidatedLLMConfig>` the fully validated, effective LLM configuration.
```typescript
const config = await agent.switchLLM({
provider: 'anthropic',
model: 'claude-sonnet-4-5-20250929'
});
console.log(config.model);
```
### `getCurrentLLMConfig`
Returns the base LLM configuration from the agent's initialization config.
```typescript
getCurrentLLMConfig(): LLMConfig
```
**Returns:** `LLMConfig` - The base LLM configuration (does not include session-specific overrides)
### `getEffectiveConfig`
Gets the complete effective configuration for a session or the default configuration.
```typescript
getEffectiveConfig(sessionId?: string): Readonly<AgentConfig>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `sessionId` | `string` | (Optional) Session ID |
**Returns:** `Readonly<AgentConfig>`
---
## MCP Server Management
### `addMcpServer`
Adds and connects to a new MCP server, making its tools available to the agent.
```typescript
async addMcpServer(name: string, config: McpServerConfig): Promise<void>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `name` | `string` | Server name |
| `config` | `McpServerConfig` | Server configuration |
### `removeMcpServer`
Disconnects from an MCP server and removes it completely from the agent.
```typescript
async removeMcpServer(name: string): Promise<void>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `name` | `string` | Server name to remove |
### `enableMcpServer`
Enables a disabled MCP server and connects it.
```typescript
async enableMcpServer(name: string): Promise<void>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `name` | `string` | Server name to enable |
### `disableMcpServer`
Disables an MCP server and disconnects it. The server remains registered but inactive.
```typescript
async disableMcpServer(name: string): Promise<void>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `name` | `string` | Server name to disable |
### `restartMcpServer`
Restarts an MCP server by disconnecting and reconnecting with its original configuration.
```typescript
async restartMcpServer(name: string): Promise<void>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `name` | `string` | Server name to restart |
### `executeTool`
Executes a tool from any source (MCP servers, custom tools, or internal tools). This is the unified interface for tool execution.
```typescript
async executeTool(toolName: string, args: any): Promise<any>
```
| Parameter | Type | Description |
| :--- | :--- | :--- |
| `toolName` | `string` | Tool name |
| `args` | `any` | Tool arguments |
**Returns:** `Promise<any>` - Tool execution result
### `getAllMcpTools`
Returns a map of all available tools from all connected MCP servers.
```typescript
async getAllMcpTools(): Promise<Record<string, ToolDefinition>>
```
**Returns:** `Promise<Record<string, ToolDefinition>>`
### `getAllTools`
Returns a map of all available tools from all sources (MCP servers, custom tools, and internal tools). This is the unified interface for tool discovery.
```typescript
async getAllTools(): Promise<Record<string, ToolDefinition>>
```
**Returns:** `Promise<Record<string, ToolDefinition>>`
### `getMcpClients`
Returns a map of all connected MCP client instances.
```typescript
getMcpClients(): Map<string, IMCPClient>
```
**Returns:** `Map<string, IMCPClient>`
### `getMcpFailedConnections`
Returns a record of failed MCP server connections and their error messages.
```typescript
getMcpFailedConnections(): Record<string, string>
```
**Returns:** `Record<string, string>` - Failed connection names to error messages
---
## Model & Provider Introspection
### `getSupportedProviders`
Returns the list of supported LLM providers.
```typescript
getSupportedProviders(): LLMProvider[]
```
### `getSupportedModels`
Returns supported models grouped by provider, including a flag for the default model per provider.
```typescript
getSupportedModels(): Record<LLMProvider, Array<ModelInfo & { isDefault: boolean }>>
```
### `getSupportedModelsForProvider`
Returns supported models for a specific provider.
```typescript
getSupportedModelsForProvider(provider: LLMProvider): Array<ModelInfo & { isDefault: boolean }>
```
### `inferProviderFromModel`
Infers the provider from a model name or returns `null` if unknown.
```typescript
inferProviderFromModel(modelName: string): LLMProvider | null
```
---
## Search
### `searchMessages`
Search for messages across all sessions or within a specific session.
```typescript
async searchMessages(query: string, options?: SearchOptions): Promise<SearchResponse>
```
### `searchSessions`
Search for sessions that contain the specified query.
```typescript
async searchSessions(query: string): Promise<SessionSearchResponse>
```

View File

@@ -0,0 +1,658 @@
---
sidebar_position: 3
---
# Events Reference
Complete event system documentation for monitoring and integrating with Dexto agents.
## Overview
The Dexto SDK provides a comprehensive event system through two main event buses:
- **AgentEventBus**: Agent-level events that occur across the entire agent instance
- **SessionEventBus**: Session-specific events that occur within individual conversation sessions
### Event Naming Convention
All events follow the `namespace:kebab-case` format:
- **LLM events**: `llm:thinking`, `llm:chunk`, `llm:response`, `llm:tool-call`
- **Session events**: `session:created`, `session:reset`, `session:title-updated`
- **MCP events**: `mcp:server-connected`, `mcp:resource-updated`
- **Approval events**: `approval:request`, `approval:response`
- **State events**: `state:changed`, `state:exported`
- **Tool events**: `tools:available-updated`
### Event Visibility Tiers
Events are organized into three tiers based on their intended audience:
#### **Tier 1: Streaming Events** (`STREAMING_EVENTS`)
Exposed via `DextoAgent.stream()` for real-time chat UIs. These are the most commonly used events for building interactive applications.
**LLM Events:** `llm:thinking`, `llm:chunk`, `llm:response`, `llm:tool-call`, `llm:tool-result`, `llm:error`, `llm:unsupported-input`
**Tool Events:** `tool:running`
**Context Events:** `context:compressed`, `context:pruned`
**Message Queue Events:** `message:queued`, `message:dequeued`
**Run Lifecycle Events:** `run:complete`
**Session Events:** `session:title-updated`
**Approval Events:** `approval:request`, `approval:response`
**Use cases:**
- Real-time chat interfaces
- Progress indicators
- Streaming responses
- Tool execution tracking
- User approval flows
#### **Tier 2: Integration Events** (`INTEGRATION_EVENTS`)
Exposed via webhooks, A2A subscriptions, and monitoring systems. Includes all streaming events plus lifecycle and state management events.
**Additional events:** `session:created`, `session:reset`, `mcp:server-connected`, `mcp:server-restarted`, `mcp:tools-list-changed`, `mcp:prompts-list-changed`, `tools:available-updated`, `llm:switched`, `state:changed`
**Use cases:**
- External system integrations
- Monitoring and observability
- Analytics and logging
- Multi-agent coordination (A2A)
#### **Tier 3: Internal Events**
Only available via direct `AgentEventBus` access for advanced use cases. These are implementation details that may change between versions.
**Examples:** `resource:cache-invalidated`, `state:exported`, `state:reset`, `mcp:server-added`, `mcp:server-removed`, `session:override-set`
---
## Agent-Level Events
These events are emitted by the `AgentEventBus` and provide insight into agent-wide operations.
### Session Events
#### `session:reset`
Fired when a conversation history is reset for a session.
```typescript
{
sessionId: string;
}
```
#### `session:created`
Fired when a new session is created and should become active.
```typescript
{
sessionId: string;
switchTo: boolean; // Whether UI should switch to this session
}
```
#### `session:title-updated`
Fired when a session's human-friendly title is updated.
```typescript
{
sessionId: string;
title: string;
}
```
#### `session:override-set`
Fired when session-specific configuration is set.
```typescript
{
sessionId: string;
override: SessionOverride;
}
```
#### `session:override-cleared`
Fired when session-specific configuration is cleared.
```typescript
{
sessionId: string;
}
```
### MCP Server Events
#### `mcp:server-connected`
Fired when an MCP server connection attempt completes (success or failure).
```typescript
{
name: string;
success: boolean;
error?: string;
}
```
#### `mcp:server-added`
Fired when an MCP server is added to the runtime state.
```typescript
{
serverName: string;
config: McpServerConfig;
}
```
#### `mcp:server-removed`
Fired when an MCP server is removed from the runtime state.
```typescript
{
serverName: string;
}
```
#### `mcp:server-updated`
Fired when an MCP server configuration is updated.
```typescript
{
serverName: string;
config: McpServerConfig;
}
```
#### `mcp:server-restarted`
Fired when an MCP server is restarted.
```typescript
{
serverName: string;
}
```
#### `mcp:resource-updated`
Fired when an MCP server resource is updated.
```typescript
{
serverName: string;
resourceUri: string;
}
```
#### `mcp:prompts-list-changed`
Fired when available prompts from MCP servers change.
```typescript
{
serverName: string;
prompts: string[];
}
```
#### `mcp:tools-list-changed`
Fired when available tools from MCP servers change.
```typescript
{
serverName: string;
tools: string[];
}
```
#### `resource:cache-invalidated`
Fired when resource cache is invalidated.
```typescript
{
resourceUri?: string;
serverName: string;
action: 'updated' | 'server_connected' | 'server_removed' | 'blob_stored';
}
```
#### `tools:available-updated`
Fired when the available tools list is updated.
```typescript
{
tools: string[];
source: 'mcp' | 'builtin';
}
```
### Configuration Events
#### `llm:switched`
Fired when the LLM configuration is changed.
```typescript
{
newConfig: LLMConfig;
historyRetained?: boolean;
sessionIds: string[]; // Array of affected session IDs
}
```
#### `state:changed`
Fired when agent runtime state changes.
```typescript
{
field: string; // keyof AgentRuntimeState
oldValue: any;
newValue: any;
sessionId?: string;
}
```
#### `state:exported`
Fired when agent state is exported as configuration.
```typescript
{
config: AgentConfig;
}
```
#### `state:reset`
Fired when agent state is reset to baseline.
```typescript
{
toConfig: AgentConfig;
}
```
### User Approval Events
Dexto's generalized approval system handles various types of user input requests, including tool confirmations and form-based input (elicitation). These events are included in `STREAMING_EVENTS` and are available via `DextoAgent.stream()`.
:::tip Custom Approval Handlers
For direct `DextoAgent` usage without SSE streaming, you can implement a custom approval handler via `agent.setApprovalHandler()` to intercept approval requests programmatically.
:::
#### `approval:request`
Fired when user approval or input is requested. This event supports multiple approval types through a discriminated union based on the `type` field.
```typescript
{
approvalId: string; // Unique identifier for this approval request
type: string; // 'tool_confirmation' | 'command_confirmation' | 'elicitation'
sessionId?: string; // Optional session scope
timeout?: number; // Request timeout in milliseconds
timestamp: Date; // When the request was created
metadata: Record<string, any>; // Type-specific approval data
}
```
**Approval Types:**
- **`tool_confirmation`**: Binary approval for tool execution
- `metadata.toolName`: Name of the tool requiring confirmation
- `metadata.args`: Tool arguments
- `metadata.description`: Optional tool description
- **`command_confirmation`**: Binary approval for command execution (e.g., bash commands)
- `metadata.command`: Command requiring confirmation
- `metadata.args`: Command arguments
- **`elicitation`**: Schema-based form input (typically from MCP servers or ask_user tool)
- `metadata.schema`: JSON Schema defining expected input structure
- `metadata.prompt`: Prompt text to display to user
- `metadata.serverName`: Name of requesting entity (MCP server or 'Dexto Agent')
- `metadata.context`: Optional additional context
#### `approval:response`
Fired when a user approval response is received from the UI layer.
```typescript
{
approvalId: string; // Must match the request approvalId
status: 'approved' | 'denied' | 'cancelled'; // Approval status
reason?: DenialReason; // Reason for denial/cancellation
message?: string; // Optional user message
sessionId?: string; // Session identifier (if scoped)
data?: Record<string, any>; // Type-specific response data
}
```
**Response Data by Type:**
- **Tool confirmation**: `{ rememberChoice?: boolean }`
- **Command confirmation**: `{ rememberChoice?: boolean }`
- **Elicitation**: `{ formData: Record<string, unknown> }`
**Usage Notes:**
- Agent-initiated forms use `ask_user` tool → triggers elicitation request
- MCP server input requests trigger elicitation automatically
- Tool confirmations can be remembered per session via `rememberChoice`
- Approval requests timeout based on configuration (default: 2 minutes)
- Cancelled status indicates timeout or explicit cancellation
---
## Session-Level Events
These events are emitted by the `SessionEventBus` and provide insight into LLM service operations within sessions. They are automatically forwarded to the `AgentEventBus` with a `sessionId` property.
### LLM Processing Events
#### `llm:thinking`
Fired when the LLM service starts processing a request.
```typescript
{
sessionId: string;
}
```
#### `llm:response`
Fired when the LLM service completes a response.
```typescript
{
content: string;
reasoning?: string; // Extended thinking output for reasoning models
provider?: string;
model?: string;
tokenUsage?: {
inputTokens?: number;
outputTokens?: number;
reasoningTokens?: number; // Additional tokens used for reasoning
totalTokens?: number;
};
sessionId: string;
}
```
**Note:** The `reasoning` field contains extended thinking output for models that support reasoning (e.g., o1, o3-mini). This is separate from the main `content` response.
#### `llm:chunk`
Fired when a streaming response chunk is received.
```typescript
{
chunkType: 'text' | 'reasoning'; // Indicates whether chunk is reasoning or main response
content: string;
isComplete?: boolean;
sessionId: string;
}
```
**Note:** The `chunkType` field distinguishes between reasoning output (`reasoning`) and the main response text (`text`). For reasoning models, you'll receive reasoning chunks followed by text chunks.
#### `llm:error`
Fired when the LLM service encounters an error.
```typescript
{
error: Error;
context?: string;
recoverable?: boolean;
sessionId: string;
}
```
#### `llm:switched`
Fired when session LLM configuration is changed.
```typescript
{
newConfig: LLMConfig;
historyRetained?: boolean;
sessionIds: string[]; // Array of affected session IDs
}
```
#### `llm:unsupported-input`
Fired when the LLM service receives unsupported input.
```typescript
{
errors: string[];
provider: LLMProvider;
model?: string;
fileType?: string;
details?: any;
sessionId: string;
}
```
### Tool Execution Events
#### `llm:tool-call`
Fired when the LLM service requests a tool execution.
```typescript
{
toolName: string;
args: Record<string, any>;
callId?: string;
sessionId: string;
}
```
#### `tool:running`
Fired when a tool actually starts executing (after approval if required). This allows UIs to distinguish between tools pending approval and tools actively running.
```typescript
{
toolName: string;
toolCallId: string;
sessionId: string;
}
```
#### `llm:tool-result`
Fired when a tool execution completes.
```typescript
{
toolName: string;
sanitized: SanitizedToolResult;
rawResult?: unknown; // only present when DEXTO_DEBUG_TOOL_RESULT_RAW=true
callId?: string;
success: boolean;
sessionId: string;
}
```
### Context Management Events
#### `context:compressed`
Fired when conversation context is compressed to stay within token limits.
```typescript
{
originalTokens: number; // Actual input tokens that triggered compression
compressedTokens: number; // Estimated tokens after compression
originalMessages: number;
compressedMessages: number;
strategy: string;
reason: 'overflow' | 'token_limit' | 'message_limit';
sessionId: string;
}
```
#### `context:pruned`
Fired when old messages are pruned from context.
```typescript
{
prunedCount: number;
savedTokens: number;
sessionId: string;
}
```
### Message Queue Events
These events track the message queue system, which allows users to queue additional messages while the agent is processing.
#### `message:queued`
Fired when a user message is queued during agent execution.
```typescript
{
position: number; // Position in the queue
id: string; // Unique message ID
sessionId: string;
}
```
#### `message:dequeued`
Fired when queued messages are dequeued and injected into context.
```typescript
{
count: number; // Number of messages dequeued
ids: string[]; // IDs of dequeued messages
coalesced: boolean; // Whether messages were combined
content: ContentPart[]; // Combined content for UI display
sessionId: string;
}
```
### Run Lifecycle Events
#### `run:complete`
Fired when an agent run completes, providing summary information about the execution.
```typescript
{
finishReason: LLMFinishReason; // How the run ended
stepCount: number; // Number of steps executed
durationMs: number; // Wall-clock duration in milliseconds
error?: Error; // Error if finishReason === 'error'
sessionId: string;
}
```
**Finish Reasons:**
- `stop` - Normal completion
- `tool-calls` - Stopped to execute tool calls (more steps coming)
- `length` - Hit token/length limit
- `content-filter` - Content filter violation
- `error` - Error occurred
- `cancelled` - User cancelled
- `max-steps` - Hit max steps limit
---
## Usage Examples
### Listening to Streaming Events
```typescript
import { DextoAgent } from '@dexto/core';
const agent = new DextoAgent(config);
await agent.start();
// Use the stream() API to get streaming events
for await (const event of await agent.stream('Hello!', 'session-1')) {
switch (event.name) {
case 'llm:thinking':
console.log('Agent is thinking...');
break;
case 'llm:chunk':
process.stdout.write(event.content);
break;
case 'llm:response':
console.log('\nFull response:', event.content);
console.log('Tokens used:', event.tokenUsage);
break;
case 'llm:tool-call':
console.log(`Calling tool: ${event.toolName}`);
break;
case 'tool:running':
console.log(`Tool ${event.toolName} is now running`);
break;
case 'run:complete':
console.log(`Run completed: ${event.finishReason} (${event.stepCount} steps, ${event.durationMs}ms)`);
break;
case 'approval:request':
console.log(`Approval needed: ${event.type}`);
// Handle approval UI...
break;
}
}
```
### Listening to Integration Events
```typescript
import { DextoAgent, INTEGRATION_EVENTS } from '@dexto/core';
const agent = new DextoAgent(config);
await agent.start();
// Listen to all integration events via the event bus
INTEGRATION_EVENTS.forEach((eventName) => {
agent.agentEventBus.on(eventName, (payload) => {
console.log(`[${eventName}]`, payload);
// Send to your monitoring/analytics system
sendToMonitoring(eventName, payload);
});
});
```
### Listening to Internal Events
```typescript
import { DextoAgent } from '@dexto/core';
const agent = new DextoAgent(config);
await agent.start();
// Listen to internal events for advanced debugging
agent.agentEventBus.on('resource:cache-invalidated', (payload) => {
console.log('Cache invalidated:', payload);
});
agent.agentEventBus.on('state:exported', (payload) => {
console.log('State exported:', payload.config);
});
```

View File

@@ -0,0 +1,415 @@
---
sidebar_position: 2
title: "MCPManager"
---
# MCPManager
The `MCPManager` is a powerful, standalone utility for managing [Model Context Protocol (MCP)](/docs/mcp/overview) servers. It allows you to connect, manage, and interact with multiple MCP servers in your own applications without needing the full Dexto agent framework.
This class provides a unified interface for accessing tools, resources, and prompts from all connected servers, making it an essential component for building complex, multi-server workflows.
## Constructor
```typescript
constructor(confirmationProvider?: ToolConfirmationProvider)
```
Creates a new `MCPManager` instance for managing MCP server connections.
**Parameters:**
- `confirmationProvider` (optional): A custom tool confirmation provider. If not provided, a default CLI-based confirmation is used.
**Example:**
```typescript
import { MCPManager } from '@dexto/core';
// Basic manager
const manager = new MCPManager();
// With a custom confirmation provider
const customProvider = new CustomConfirmationProvider();
const managerWithProvider = new MCPManager(customProvider);
```
## Connection Management Methods
#### `connectServer`
Connects to a new MCP server.
```typescript
async connectServer(name: string, config: McpServerConfig): Promise<void>
```
**Parameters:**
- `name`: Unique identifier for the server connection
- `config`: Server configuration object
**Server Configuration Types:**
```typescript
// stdio server (most common)
{
type: 'stdio',
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-filesystem', '.'],
env?: { [key: string]: string }
}
// HTTP server (recommended for remote)
{
type: 'http',
url: 'http://localhost:3001/mcp',
headers?: { [key: string]: string },
timeout?: number,
connectionMode?: 'strict' | 'lenient'
}
// SSE (Server-Sent Events) server - DEPRECATED, use http instead
{
type: 'sse',
url: 'http://localhost:3001/sse',
headers?: { [key: string]: string },
timeout?: number,
connectionMode?: 'strict' | 'lenient'
}
```
**Examples:**
```typescript
// File system server
await manager.connectServer('filesystem', {
type: 'stdio',
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-filesystem', '.']
});
// Web search server with API key
await manager.connectServer('tavily-search', {
type: 'stdio',
command: 'npx',
args: ['-y', 'tavily-mcp@0.1.2'],
env: {
TAVILY_API_KEY: process.env.TAVILY_API_KEY
}
});
// HTTP MCP server
await manager.connectServer('remote-agent', {
type: 'http',
baseUrl: 'http://localhost:3001/mcp',
timeout: 30000
});
```
#### `initializeFromConfig`
Initialize multiple servers from configuration.
```typescript
async initializeFromConfig(
serverConfigs: ServerConfigs,
connectionMode: 'strict' | 'lenient' = 'lenient'
): Promise<void>
```
**Parameters:**
- `serverConfigs`: Object mapping server names to configurations
- `connectionMode`:
- `'strict'`: All servers must connect successfully
- `'lenient'`: At least one server must connect successfully
**Example:**
```typescript
const serverConfigs = {
filesystem: {
type: 'stdio',
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-filesystem', '.']
},
search: {
type: 'stdio',
command: 'npx',
args: ['-y', 'tavily-mcp@0.1.2'],
env: { TAVILY_API_KEY: process.env.TAVILY_API_KEY }
}
};
await manager.initializeFromConfig(serverConfigs, 'lenient');
```
#### `removeClient`
Disconnects and removes a specific MCP server.
```typescript
async removeClient(name: string): Promise<void>
```
**Example:**
```typescript
await manager.removeClient('filesystem');
```
#### `disconnectAll`
Disconnect all servers and clear caches.
```typescript
async disconnectAll(): Promise<void>
```
**Example:**
```typescript
await manager.disconnectAll();
```
#### `restartServer`
Restart a specific MCP server by disconnecting and reconnecting with its original configuration.
```typescript
async restartServer(name: string): Promise<void>
```
**Parameters:**
- `name`: The name of the server to restart
**Example:**
```typescript
// Restart a server after it becomes unresponsive
await manager.restartServer('filesystem');
```
#### `refresh`
Refresh all tool, resource, and prompt caches from connected servers.
```typescript
async refresh(): Promise<void>
```
**Example:**
```typescript
// Force refresh all caches after external changes
await manager.refresh();
```
## Tool Management Methods
#### `getAllTools`
Gets all available tools from connected servers.
```typescript
async getAllTools(): Promise<ToolSet>
```
**Returns:** Object mapping tool names to tool definitions
**Example:**
```typescript
const tools = await manager.getAllTools();
console.log('Available tools:', Object.keys(tools));
// Inspect a specific tool
const readFileTool = tools.readFile;
console.log('Tool schema:', readFileTool.inputSchema);
```
#### `getToolClient`
Get the client that provides a specific tool.
```typescript
getToolClient(toolName: string): IMCPClient | undefined
```
#### `executeTool`
Executes a specific tool with arguments.
```typescript
async executeTool(toolName: string, args: any): Promise<any>
```
**Example:**
```typescript
// Read a file
const content = await manager.executeTool('readFile', {
path: './package.json'
});
// Search the web
const searchResults = await manager.executeTool('search', {
query: 'latest AI developments',
max_results: 5
});
// Write a file
await manager.executeTool('writeFile', {
path: './output.txt',
content: 'Hello from MCP!'
});
```
## Resource Management Methods
#### `listAllResources`
Gets all cached MCP resources from connected servers.
```typescript
async listAllResources(): Promise<MCPResolvedResource[]>
```
**Returns:** Array of resolved resources with metadata:
```typescript
interface MCPResolvedResource {
key: string; // Qualified resource key
serverName: string; // Server that provides this resource
summary: MCPResourceSummary;
}
```
#### `getResource`
Get cached resource metadata by qualified key.
```typescript
getResource(resourceKey: string): MCPResolvedResource | undefined
```
#### `readResource`
Reads a specific resource by URI.
```typescript
async readResource(uri: string): Promise<ReadResourceResult>
```
**Example:**
```typescript
const resource = await manager.readResource('file:///project/README.md');
console.log('Resource content:', resource.contents);
```
## Prompt Management Methods
#### `listAllPrompts`
Gets all available prompt names from connected servers.
```typescript
async listAllPrompts(): Promise<string[]>
```
#### `getPromptClient`
Get the client that provides a specific prompt.
```typescript
getPromptClient(promptName: string): IMCPClient | undefined
```
#### `getPrompt`
Gets a specific prompt by name.
```typescript
async getPrompt(name: string, args?: any): Promise<GetPromptResult>
```
**Example:**
```typescript
const prompt = await manager.getPrompt('code-review', {
language: 'typescript',
file: 'src/index.ts'
});
console.log('Prompt:', prompt.messages);
```
#### `getPromptMetadata`
Get cached metadata for a specific prompt (no network calls).
```typescript
getPromptMetadata(promptName: string): PromptDefinition | undefined
```
#### `getAllPromptMetadata`
Get all cached prompt metadata (no network calls).
```typescript
getAllPromptMetadata(): Array<{
promptName: string;
serverName: string;
definition: PromptDefinition;
}>
```
## Status and Monitoring Methods
#### `getClients`
Returns all registered MCP client instances.
```typescript
getClients(): Map<string, IMCPClient>
```
**Example:**
```typescript
const clients = manager.getClients();
console.log('Connected servers:', Array.from(clients.keys()));
for (const [name, client] of clients) {
console.log(`Server: ${name}, Tools available: ${Object.keys(await client.getTools()).length}`);
}
```
#### `getFailedConnections`
Returns failed connection error messages.
```typescript
getFailedConnections(): Record<string, string>
```
**Example:**
```typescript
const errors = manager.getFailedConnections();
if (Object.keys(errors).length > 0) {
console.log('Failed connections:', errors);
}
```
### Complete Example
```typescript
import { MCPManager } from '@dexto/core';
const manager = new MCPManager();
// Connect to servers
await manager.connectServer('filesystem', {
type: 'stdio',
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-filesystem', '.']
});
// Execute tools directly
const result = await manager.executeTool('readFile', { path: './README.md' });
console.log('Read file result:', result);
// Get all available tools
const tools = await manager.getAllTools();
console.log('Available tools:', Object.keys(tools));
// Clean up
await manager.disconnectAll();
```

685
dexto/docs/api/sdk/types.md Normal file
View File

@@ -0,0 +1,685 @@
---
sidebar_position: 4
---
# SDK Types for TypeScript
Type definitions and interfaces for the Dexto Agent SDK for TypeScript.
## Core Imports
```typescript
import {
// Main classes
DextoAgent,
// Standalone utilities
MCPManager,
Logger,
AgentEventBus,
SessionEventBus,
createStorageBackends,
createAgentServices,
// Configuration types
AgentConfig,
LLMConfig,
McpServerConfig,
StorageConfig,
// Session types
ChatSession,
SessionMetadata,
ConversationHistory,
// Result types
ValidatedLLMConfig,
// Event types
AgentEventMap,
SessionEventMap,
// Storage types
StorageBackends,
CacheBackend,
DatabaseBackend,
// Service types
AgentServices,
} from '@dexto/core';
```
---
## Configuration Types
### `AgentConfig`
Main configuration object for creating Dexto agents.
```typescript
interface AgentConfig {
llm: LLMConfig;
mcpServers?: Record<string, McpServerConfig>;
storage?: StorageConfig;
sessions?: SessionConfig;
systemPrompt?: string;
}
```
### `LLMConfig`
Configuration for Large Language Model providers.
```typescript
interface LLMConfig {
provider: 'openai' | 'anthropic' | 'google' | 'groq' | 'xai' | 'cohere' | 'openai-compatible';
model: string;
apiKey?: string;
baseURL?: string;
temperature?: number;
maxOutputTokens?: number;
maxInputTokens?: number;
maxIterations?: number;
systemPrompt?: string;
}
```
### `McpServerConfig`
Configuration for Model Context Protocol servers.
```typescript
interface McpServerConfig {
type: 'stdio' | 'sse' | 'http';
command?: string; // Required for stdio
args?: string[]; // For stdio
env?: Record<string, string>; // For stdio
url?: string; // Required for sse/http
headers?: Record<string, string>; // For sse/http
timeout?: number; // Default: 30000
connectionMode?: 'strict' | 'lenient'; // Default: 'lenient'
}
```
### `StorageConfig`
Configuration for storage backends.
```typescript
interface StorageConfig {
cache: CacheBackendConfig;
database: DatabaseBackendConfig;
}
interface CacheBackendConfig {
type: 'in-memory' | 'redis';
url?: string;
options?: Record<string, any>;
}
interface DatabaseBackendConfig {
type: 'in-memory' | 'sqlite' | 'postgresql';
url?: string;
options?: Record<string, any>;
}
```
---
## Session Types
### `ChatSession`
Represents an individual conversation session.
```typescript
interface ChatSession {
id: string;
createdAt: Date;
lastActivity: Date;
// Session methods
run(userInput: string, imageData?: ImageData): Promise<string>;
getHistory(): Promise<ConversationHistory>;
reset(): Promise<void>;
getLLMService(): VercelLLMService;
}
```
### `SessionMetadata`
Metadata information about a session.
```typescript
interface SessionMetadata {
id: string;
createdAt: Date;
lastActivity: Date;
messageCount: number;
tokenCount?: number;
}
```
### `ConversationHistory`
Complete conversation history for a session.
```typescript
interface ConversationHistory {
sessionId: string;
messages: ConversationMessage[];
totalTokens?: number;
}
interface ConversationMessage {
role: 'user' | 'assistant' | 'system' | 'tool';
content: string;
timestamp: Date;
tokenCount?: number;
toolCall?: ToolCall;
toolResult?: ToolResult;
}
```
---
## Result Types
### `ValidatedLLMConfig`
Validated LLM configuration returned by `switchLLM`.
```typescript
type ValidatedLLMConfig = LLMConfig & {
maxInputTokens?: number;
};
```
---
## Event Types
:::info Event Naming Convention
All events use the `namespace:kebab-case` format. For detailed event documentation and usage examples, see the [Events Reference](./events.md).
:::
### `AgentEventMap`
Type map for agent-level events. All event names follow the `namespace:kebab-case` convention.
```typescript
interface AgentEventMap {
// Session events
'session:reset': {
sessionId: string;
};
'session:created': {
sessionId: string;
switchTo: boolean; // Whether UI should switch to this session
};
'session:title-updated': {
sessionId: string;
title: string;
};
'session:override-set': {
sessionId: string;
override: SessionOverride;
};
'session:override-cleared': {
sessionId: string;
};
// MCP server events
'mcp:server-connected': {
name: string;
success: boolean;
error?: string;
};
'mcp:server-added': {
serverName: string;
config: McpServerConfig;
};
'mcp:server-removed': {
serverName: string;
};
'mcp:server-updated': {
serverName: string;
config: McpServerConfig;
};
'mcp:server-restarted': {
serverName: string;
};
'mcp:resource-updated': {
serverName: string;
resourceUri: string;
};
'mcp:prompts-list-changed': {
serverName: string;
prompts: string[];
};
'mcp:tools-list-changed': {
serverName: string;
tools: string[];
};
'resource:cache-invalidated': {
resourceUri?: string;
serverName: string;
action: 'updated' | 'server_connected' | 'server_removed' | 'blob_stored';
};
'tools:available-updated': {
tools: string[];
source: 'mcp' | 'builtin';
};
// Configuration events
'llm:switched': {
newConfig: ValidatedLLMConfig;
historyRetained?: boolean;
sessionIds: string[]; // Array of affected session IDs
};
'state:changed': {
field: string;
oldValue: any;
newValue: any;
sessionId?: string;
};
'state:exported': {
config: AgentConfig;
};
'state:reset': {
toConfig: AgentConfig;
};
// Approval events
'approval:request': {
approvalId: string;
approvalType: 'tool_confirmation' | 'elicitation' | 'custom';
sessionId?: string;
timeout?: number;
timestamp: Date;
metadata: Record<string, any>;
};
'approval:response': {
approvalId: string;
status: 'approved' | 'denied' | 'cancelled';
reason?: DenialReason;
message?: string;
sessionId?: string;
data?: Record<string, any>;
};
// LLM service events (forwarded from sessions with sessionId)
'llm:thinking': {
sessionId: string;
};
'llm:response': {
content: string;
reasoning?: string;
provider?: string;
model?: string;
tokenUsage?: {
inputTokens?: number;
outputTokens?: number;
reasoningTokens?: number;
totalTokens?: number;
};
sessionId: string;
};
'llm:chunk': {
chunkType: 'text' | 'reasoning'; // Note: renamed from 'type' to avoid conflicts
content: string;
isComplete?: boolean;
sessionId: string;
};
'llm:tool-call': {
toolName: string;
args: Record<string, any>;
callId?: string;
sessionId: string;
};
'llm:tool-result': {
toolName: string;
sanitized: SanitizedToolResult;
rawResult?: unknown;
callId?: string;
success: boolean;
sessionId: string;
};
'llm:error': {
error: Error;
context?: string;
recoverable?: boolean;
sessionId: string;
};
'llm:unsupported-input': {
errors: string[];
provider: LLMProvider;
model?: string;
fileType?: string;
details?: any;
sessionId: string;
};
}
```
### `SessionEventMap`
Type map for session-level events. These events are emitted within individual chat sessions and are automatically forwarded to the `AgentEventBus` with a `sessionId` property.
```typescript
interface SessionEventMap {
'llm:thinking': void;
'llm:response': {
content: string;
reasoning?: string;
provider?: string;
model?: string;
tokenUsage?: {
inputTokens?: number;
outputTokens?: number;
reasoningTokens?: number;
totalTokens?: number;
};
};
'llm:chunk': {
chunkType: 'text' | 'reasoning';
content: string;
isComplete?: boolean;
};
'llm:tool-call': {
toolName: string;
args: Record<string, any>;
callId?: string;
};
'llm:tool-result': {
toolName: string;
sanitized: SanitizedToolResult;
rawResult?: unknown;
callId?: string;
success: boolean;
};
'llm:error': {
error: Error;
context?: string;
recoverable?: boolean;
};
'llm:switched': {
newConfig: ValidatedLLMConfig;
historyRetained?: boolean;
sessionIds: string[];
};
'llm:unsupported-input': {
errors: string[];
provider: LLMProvider;
model?: string;
fileType?: string;
details?: any;
};
}
```
### Event Tier Types
```typescript
// Tier 1: Events exposed via DextoAgent.stream()
export type StreamingEventName =
| 'llm:thinking'
| 'llm:chunk'
| 'llm:response'
| 'llm:tool-call'
| 'llm:tool-result'
| 'llm:error'
| 'llm:unsupported-input'
| 'approval:request'
| 'approval:response'
| 'session:title-updated';
// Tier 2: Events exposed via webhooks, A2A, and monitoring
export type IntegrationEventName = StreamingEventName
| 'session:created'
| 'session:reset'
| 'mcp:server-connected'
| 'mcp:server-restarted'
| 'mcp:tools-list-changed'
| 'mcp:prompts-list-changed'
| 'tools:available-updated'
| 'llm:switched'
| 'state:changed';
// Union types with payloads
// Note: Uses 'name' (not 'type') to avoid collision with ApprovalRequest.type payload field
export type StreamingEvent = {
[K in StreamingEventName]: { name: K } & AgentEventMap[K];
}[StreamingEventName];
```
---
## Storage Types
### `StorageBackends`
Container for storage backend instances.
```typescript
interface StorageBackends {
cache: CacheBackend;
database: DatabaseBackend;
}
```
### `CacheBackend`
Interface for cache storage operations.
```typescript
interface CacheBackend {
get(key: string): Promise<any>;
set(key: string, value: any, ttl?: number): Promise<void>;
delete(key: string): Promise<void>;
clear(): Promise<void>;
disconnect?(): Promise<void>;
}
```
### `DatabaseBackend`
Interface for database storage operations.
```typescript
interface DatabaseBackend {
get(key: string): Promise<any>;
set(key: string, value: any): Promise<void>;
delete(key: string): Promise<void>;
append(key: string, value: any): Promise<void>;
getRange(key: string, start: number, end: number): Promise<any[]>;
disconnect?(): Promise<void>;
}
```
---
## Service Types
### `AgentServices`
Container for all agent service instances.
```typescript
interface AgentServices {
mcpManager: MCPManager;
systemPromptManager: SystemPromptManager;
agentEventBus: AgentEventBus;
stateManager: AgentStateManager;
sessionManager: SessionManager;
storage: StorageBackends;
}
```
---
## Tool Types
### `ToolSet`
Map of tool names to tool definitions.
```typescript
type ToolSet = Record<string, ToolDefinition>;
interface ToolDefinition {
name: string;
description: string;
inputSchema: {
type: 'object';
properties: Record<string, any>;
required?: string[];
};
}
```
### `ToolCall`
Represents a tool execution request.
```typescript
interface ToolCall {
id: string;
name: string;
arguments: Record<string, any>;
}
```
### `ToolResult`
Represents a tool execution result.
```typescript
interface ToolResult {
callId: string;
toolName: string;
result: any;
success: boolean;
error?: string;
}
```
---
## Utility Types
### `ImageData`
Type for image data in conversations.
```typescript
interface ImageData {
base64: string; // Base64 encoded image
mimeType: string; // e.g., 'image/jpeg', 'image/png'
}
```
### `FileData`
Type for file data in conversations.
```typescript
interface FileData {
base64: string; // Base64 encoded file data
mimeType: string; // e.g., 'application/pdf', 'audio/wav'
filename?: string; // Optional filename
}
```
**Supported File Types:**
- **PDF files** (`application/pdf`) - Most widely supported
- **Audio files** (`audio/mp3`, `audio/wav`) - With OpenAI `gpt-4o-audio-preview` and Google Gemini models
**Unsupported File Types:**
- Text files (`.txt`, `.md`)
- CSV files (`.csv`)
- Word documents (`.doc`, `.docx`)
- Excel files (`.xls`, `.xlsx`)
- PowerPoint files (`.ppt`, `.pptx`)
- JSON files (`.json`)
- XML files (`.xml`)
- HTML files (`.html`)
For unsupported file types, consider:
1. Converting to text and sending as regular messages
2. Using specialized MCP servers for file processing
3. Using dedicated file processing tools
### `LoggerOptions`
Configuration options for the Logger class.
```typescript
interface LoggerOptions {
level?: 'error' | 'warn' | 'info' | 'http' | 'verbose' | 'debug' | 'silly';
silent?: boolean;
}
```
### `ChalkColor`
Available colors for logger output.
```typescript
type ChalkColor =
| 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white'
| 'gray' | 'grey' | 'blackBright' | 'redBright' | 'greenBright' | 'yellowBright'
| 'blueBright' | 'magentaBright' | 'cyanBright' | 'whiteBright';
```
---
## Generic Types
### `EventListener`
Generic event listener function type.
```typescript
type EventListener<T> = (data: T) => void;
```
### `EventEmitterOptions`
Options for event emitter methods.
```typescript
interface EventEmitterOptions {
signal?: AbortSignal;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View File

@@ -0,0 +1,214 @@
---
slug: ai-agents-vs-llm-workflows
title: AI Agents vs LLM Workflows Why Autonomy Matters
description: Learn what AI agents are, how they differ from traditional LLM workflows, and when to use each approach.
authors: rahul
tags: [ai-agents, llm-workflows, autonomous-ai, dexto]
keywords:
- ai agents
- llm workflows
- autonomous ai
- code review automation
- dexto open-source runtime
---
If you have been remotely exposed to AI, you've probably heard the term AI agent. But what really is an AI agent?
`AI agent` has become a blanket term that is used in the industry for any automation or software that uses an LLM.
In this post, well break down what an **AI agent** is from first principles, then compare **AI agents vs LLM workflows**—when to use each and why autonomy matters.
<!--truncate-->
Let's first start with Large Language Models (LLMs), the backbone of AI agents.
## What Are LLMs?
LLMs are deep learning models, pre-trained on vast amounts of data, often more than what's available on the entire internet!
At their core, LLMs take in input and predict the most likely output.
Here the input could be a chat message, an image, a voice message or even video.
LLMs predict the output token-by-token, which means that at each step of giving you a response, the LLM is predicting what the next token should be. More on this [here](https://x.com/cwolferesearch/status/1879995082285171081).
So when you ask an LLM something like `what is 5+10`, or [`how many r's are there in strawberry?`](https://techcrunch.com/2024/08/27/why-ai-cant-spell-strawberry/), the LLM tries to *guess* what the actual answer should be based on its training data.
LLMs have reached a point where their grammar and sentence structure are much better than a typical human, and also have knowledge of an extremely broad variety of topics.
ChatGPT is the most popular example of an LLM based application, which you've probably used, unless you're living under a rock.
Under the hood, ChatGPT uses LLMs built by OpenAI, like `gpt-5` or `gpt-5-mini` to answer your questions about almost anything.
This is why if you ask LLMs questions like `how many r's are there in the word strawberry`, you might see completely incorrect results - [the guessing doesn't always work well](https://www.reddit.com/r/singularity/comments/1enqk04/how_many_rs_in_strawberry_why_is_this_a_very/). This is called [*hallucination*](https://en.wikipedia.org/wiki/Hallucination_(artificial_intelligence)).
## System Prompts
Well we know that LLMs have an incredibly large knowledge base, but what if we wanted the LLM to specifically just do one thing - like give me food recipes.
LLMs allow you to customize their base instructions (aka system prompts).
This enables you to give the LLM custom roles/instructions based on your use-case
Here's what the recipe analogy might look like as a system prompt
```
You are an expert chef.
Your job is to suggest tasty recipes to me.
I don't eat beef, so keep that in mind
Only answer food related questions.
```
```
systemPrompt: |
You are an expert chef.
Your job is to suggest tasty recipes to me.
I don't eat beef, so keep that in mind.
Only answer food related questions.
```
Now when I chat with the LLM, it will talk to me only like a chef!
![Conversation 1](./sysprompt_1.webp)
![Conversation 2](./sysprompt_2.webp)
## Function Calling in LLMs
Now, we've already established that LLMs can accept input and give back output. But LLMs can do more than that - they can also **take actions**
This is done by giving the LLM access to `functions`, or `tools`.
These are defined methods with specific capabilities, implemented by developers.
This process of giving the LLM access to `functions` is called [function_calling](https://platform.openai.com/docs/guides/function-calling)
Let's revisit the previous case where we asked the LLM to add 2 numbers, this time with function calling.
Suppose you gave `gpt-5` a function to add 2 numbers.
The next time you ask it `What is 5+10` - instead of trying to guess what the answer is, it would use the function to generate a more reliable response.
This is an extremely basic example, but the key takeaway here is that by giving the LLM tools - **LLMs can now take actions on your behalf.**
This is where things get interesting - what if the LLM had a function to book a reservation for you at a restaurant? Or if the LLM had a function to make a payment for you?
All the LLM would need to do in this case is use the right function based on the request, and you now have AI-powered bookings and payments.
There are other complexities like ensuring the LLM uses the correct function more accurately enough, and adding the appropriate guardrails and authentication, but we won't get into that for now.
## LLM Workflows and AI Agents
Now that we've explained how tools and system prompts work, let's dive into how LLMs can be used to automate tasks.
Let's look at one specific problem - automating code reviews, and 2 different approaches for how we can solve this problem using LLMs.
I've intentionally left out most of the complexity of actually building this system to primarily show 2 ways we can think about this problem.
### Approach 1
Ok I'm a software developer, so I have a pretty good idea of how code reviews work.
Here are 4 important things, among others that I look at when I review code:
1. **Functionality** - is the code functionally correct?
2. **Architecture** - does the code fit the codebase well and will it adapt well to changes we make in the future?
3. **Testing** - has the code been sufficiently tested? are there more test cases we can come up with?
4. **Documentation** - has the documentation been updated to account for the code changes?
If I wanted to use LLMs to automate this, I could maybe use 1 LLM for each of these sub-tasks? What if I had 4 LLMs - one for each problem? Then the flow could look something like this:
LLM-1 - instructed to ensure the code is functional for the problem.
LLM-2 - instructed to ensure the code fits the architecture and requirements
LLM-3 - ensures test coverage is sufficient and tries to come up with more edge-cases
LLM-4 - ensures documentation is up to date.
1. User submits pull request which triggers CI workflow
2. LLM-1 reads the code and examines it. If code is functional, move to next step.
3. LLM-2 reads the code and style guidelines and checks if it's good. Adds comments on the PR based on its analysis.
4. LLM-3 reads the code and tests and adds comments related to test cases
5. LLM-4 reads the code and documentation and adds comments
<!-- ![Code Review Workflow](./cr_workflow.png) -->
```mermaid
flowchart TD
A[User submits pull request] --> B[CI workflow triggers LLM review]
B --> LLM1[LLM-1: Check functionality]
LLM1 -->|Functional| LLM2[LLM-2: Review architecture & style]
LLM2 --> LLM3[LLM-3: Evaluate tests & suggest edge cases]
LLM3 --> LLM4[LLM-4: Review documentation]
LLM1 -->|Not functional| Stop1[❌ Add comments & halt review]
LLM2 -->|Issues found| Comment2[📝 Add architecture/style comments]
LLM3 -->|Insufficient tests| Comment3[📝 Add test coverage comments]
LLM4 -->|Missing/Outdated docs| Comment4[📝 Add documentation comments]
```
With this workflow mapped out, I just need to implement code that follows this logic tree.
### Approach 2
If I had a developer working for me, I'd just ask them to review the code right? What if I could leverage LLMs in a similar manner?
Let's give an LLM very detailed instructions, and all the tools necessary to complete this review, just like I would for a human. Let's also give it a way to reach back out to me if it needs any clarifying information.
LLM-1 - instructed to review the code and given all the necessary tools to do the task.
In this approach, LLM-1 is not just doing the steps, but it is also *figuring out* what steps to review the PR based on high level instructions.
<!-- ![Code Review Agent](./cr_workflow_2.png) -->
```mermaid
flowchart TD
A[User submits pull request] --> B[CI workflow triggers LLM-1 review]
B --> C[LLM-1: Reviews PR]
```
### So what's the difference between approach 1 and approach 2?
In Approach 1 - we broke down the high level task ourselves, decided exactly what steps were going to happen, and in what order, and then programmed that.
In Approach 2 - we gave the LLM some instructions and tools, and passed on the high level task to let the LLM do much more of the heavy-lifting to figure out how to do the task.
Let's look at the key differences in the approaches:
| Feature | Approach 1 (LLM Workflow) | Approach 2 (AI Agent) |
| --------------------- | ------------------------------ | -------------------------------- |
| Autonomy | Low follows set steps | High makes decisions |
| Adaptability | Rigid, limited to defined flow | Handles unexpected situations |
| Tool / Service usage | Fixed call order | Orchestrates multiple services |
| User interaction | None / minimal | Can ask clarifying questions |
Now, we can replace `Approach 1` with the term `LLM Workflow`, and `Approach 2` with the term `AI Agent`
The key takeaway here is that workflows execute steps *we define*, while AI agents *figure out how to accomplish the goal* and can make decisions dynamically.
## Which Approach Is Better? {#which-approach-is-better}
Use an LLM Workflow when:
- The problem is small, and requires a repeatable, well-defined sequence.
- You want predictable, consistent output.
- The process does not require dynamic decision-making.
- Examples: AI recipe provider, AI task tracker
Use an AI Agent when:
- The problem is vague and complex - requires decision-making, adaptation, or chaining multiple services.
- The process may change based on context, user input, or something else.
- Examples: Coding assistant, customer support assistant.
## Closing Thoughts
In the past few years, we have seen AI products emerge that have primarily been LLM workflows or lightweight wrappers around LLM APIs. The general trend is that these companies do well for a short while until the models natively get better, then the products fade away.
My theory is that as AI models get natively better, there will be less need for these workflow driven paradigms for specific problems, and LLMs will be able to do more of the heavy lifting.
AI models will be able to handle more tools and more complex instructions - and more use-cases will shift towards using autonomous agents. We have already seen reinforcement learning cases where the AI is just given a high level goal, and is able to figure out unique ways of accomplishing the task that humans wouldn't have tried.
Google DeepMind recently launched [AlphaEvolve](https://deepmind.google/discover/blog/alphaevolve-a-gemini-powered-coding-agent-for-designing-advanced-algorithms/), a coding agent designed to create new algorithms. AlphaEvolve has already discovered multiple new algorithms for matrix multiplication, a fundamental problem in computer science.
We're also seeing new AI agent products - IDEs like [Cursor](https://www.cursor.com/) and [Windsurf](https://windsurf.com/) allow users to build software applications by talking to an AI agent.
In a later blog post, we'll walk through how to use [Dexto, our open-source AI agent runtime](/docs/getting-started/intro) to build a real AI agent.

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -0,0 +1,11 @@
rahul:
name: Rahul Karajgikar
title: Co-Founder @ Truffle AI
url: https://github.com/rahulkarajgikar
image_url: https://github.com/rahulkarajgikar.png
shaunak:
name: Shaunak Srivastava
title: Co-Founder @ Truffle AI
url: https://github.com/shaunak99
image_url: https://github.com/shaunak99.png

24
dexto/docs/blog/tags.yml Normal file
View File

@@ -0,0 +1,24 @@
ai-agents:
label: AI Agents
permalink: /ai-agents
description: Posts about AI agents and autonomous systems
llm-workflows:
label: LLM Workflows
permalink: /llm-workflows
description: Posts about Large Language Model workflows and automation
llm:
label: LLM
permalink: /llm
description: Posts about Large Language Models
autonomous-ai:
label: Autonomous AI
permalink: /autonomous-ai
description: Posts about autonomous AI systems and automation
dexto:
label: Dexto
permalink: /dexto
description: Posts about the Dexto open-source AI agent runtime

View File

@@ -0,0 +1,9 @@
{
"label": "API Reference",
"position": 2,
"link": {
"type": "generated-index",
"title": "API Reference",
"description": "API Reference for Dexto"
}
}

View File

@@ -0,0 +1,9 @@
{
"label": "Architecture",
"position": 5,
"link": {
"type": "generated-index",
"title": "Architecture",
"description": "Explore the high-level and technical architecture of Dexto."
}
}

View File

@@ -0,0 +1,31 @@
# Overview
Dexto was built by the Truffle AI team.
We were trying to build useful AI agents in different domains, but we realized that we were re-building a lot of the same plumbing work each time. So we tried to use some existing AI agent frameworks.
Then we felt that we were getting stuck learning frameworks - each framework had different abstractions and levels of control, and we felt there had to be a simpler way to build AI agents.
So we built Dexto with the following tenets:
1. <ins>**Complete configurability**</ins>: We want users to be able to configure every part of Dexto with just a config file.
2. <ins>**MCP first**</ins>: Adopting MCP enables Dexto to interact with tooling in a standardized manner
3. <ins>**Powerful CLI**</ins>: We wanted a powerful CLI we could use for anything AI - just talking to LLMs, creating AI agents, deploying agents, testing out models/prompts/tools
4. <ins>**Re-usable Core primitives**</ins>: We want developers to be able to build all kinds of AI powered interfaces and applications using Dexto, without having to dive-deep into the code, but always having the option to. This allows us to re-use the same core layer to expose AI agents on telegram, discord, slack, etc.
5. <ins>**Simple deployments**</ins>: We want users to be able to play around with different config files of Dexto and simply save the configuration they liked to be able to re-use it anywhere. Docker helps make this happen.
Check out our generated deepwiki [here](https://deepwiki.com/truffle-ai/dexto) for more details.
## Core Services
Dexto's architecture is built around core services that handle different aspects of agent functionality. Each service has a specific responsibility and works together to provide the full agent experience.
See [Core Services](./services.md) for detailed information about:
- **DextoAgent** - Main orchestrator
- **MCPManager** - Tool coordination
- **ToolManager** - Tool execution
- **SessionManager** - Conversation state
- **StorageManager** - Data persistence
- **SystemPromptManager** - System prompts
- **AgentEventBus** - Event coordination
- **Telemetry** - Distributed tracing and observability

View File

@@ -0,0 +1,315 @@
# Core Services
import ExpandableMermaid from '@site/src/components/ExpandableMermaid';
Dexto's architecture is built around core services that handle different aspects of agent functionality. Understanding these services helps with debugging, customization, and troubleshooting.
## Service Overview
| Service | Purpose | Key Responsibilities |
|---------|---------|---------------------|
| **DextoAgent** | Main orchestrator | Coordinates all services, handles user interactions |
| **MCPManager** | Tool coordination | Connects to MCP servers, manages tools and resources |
| **ToolManager** | Tool execution | Executes tools, handles confirmations, manages internal tools |
| **SessionManager** | Conversation state | Manages chat sessions, conversation history |
| **StorageManager** | Data persistence | Handles cache and database storage |
| **SystemPromptManager** | System prompts | Manages system prompt assembly and dynamic content |
| **AgentEventBus** | Event coordination | Handles inter-service communication |
## Service Relationships
<ExpandableMermaid title="Service Relationships Diagram">
```mermaid
graph TB
DA[DextoAgent] --> SM[SessionManager]
DA --> MM[MCPManager]
DA --> TM[ToolManager]
DA --> SPM[SystemPromptManager]
DA --> STM[StorageManager]
DA --> AEB[AgentEventBus]
MM --> TM
TM --> STM
SM --> STM
SPM --> STM
AEB -.-> SM
AEB -.-> MM
AEB -.-> TM
subgraph "Storage Layer"
STM
Cache[(Cache)]
DB[(Database)]
end
STM --> Cache
STM --> DB
```
</ExpandableMermaid>
## DextoAgent
**Main orchestrator** that coordinates all other services.
### Key Methods
- `start()` - Initialize all services
- `generate(message, options)` - Execute user prompt (recommended)
- `run(prompt, imageData?, fileData?, sessionId)` - Lower-level execution
- `switchLLM(updates)` - Change LLM model/provider
- `createSession(sessionId?)` - Create new chat session
- `stop()` - Shutdown all services
### Usage Example
```typescript
const agent = new DextoAgent(config);
await agent.start();
// Create a session
const session = await agent.createSession();
// Run a task
const response = await agent.generate("List files in current directory", session.id);
console.log(response.content);
// Switch models
await agent.switchLLM({ model: "claude-sonnet-4-5-20250929" });
await agent.stop();
```
## MCPManager
**Tool coordination** service that connects to Model Context Protocol servers.
### Key Methods
- `connectServer(name, config)` - Connect to MCP server
- `disconnectServer(name)` - Disconnect server
- `getAllTools()` - Get all available tools
- `executeTool(name, params)` - Execute specific tool
### Server Types
- **stdio** - Command-line programs
- **http** - HTTP REST endpoints
- **sse** - Server-sent events
### Usage Example
```typescript
// Connect filesystem tools
await agent.mcpManager.connectServer('filesystem', {
type: 'stdio',
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-filesystem', '.']
});
// Get available tools
const tools = await agent.mcpManager.getAllTools();
```
## ToolManager
**Tool execution** service that handles tool calls and confirmations.
### Key Methods
- `getToolStats()` - Get tool counts (MCP + internal)
- `getAllTools()` - Get all available tools
- `executeTool(call)` - Execute tool with confirmation
### Tool Confirmation
Controls when users are prompted to approve tool execution:
- **auto** - Smart approval based on tool risk
- **always** - Always ask for confirmation
- **never** - Never ask (auto-approve)
### Usage Example
```typescript
// Get tool statistics
const stats = await agent.toolManager.getToolStats();
console.log(`${stats.total} tools: ${stats.mcp} MCP, ${stats.internal} internal`);
```
## SessionManager
**Conversation state** management for persistent chat sessions.
### Key Methods
- `createSession(sessionId?)` - Create new session
- `getSession(sessionId)` - Retrieve existing session
- `listSessions()` - List all sessions
- `deleteSession(sessionId)` - Delete session
- `getSessionHistory(sessionId)` - Get conversation history
- `resetConversation(sessionId)` - Clear session history while keeping session active
### Session Features
- Persistent conversation history
- Session metadata (creation time, last activity)
- Cross-session search capabilities
- Export/import functionality
### Usage Example
```typescript
// Create new session
const session = await agent.createSession('work-session');
// List all sessions
const sessions = await agent.listSessions();
// Get conversation history
const history = await agent.getSessionHistory('work-session');
// Use session in conversations
const response = await agent.generate("Hello", session.id);
console.log(response.content);
```
## StorageManager
**Data persistence** using two-tier architecture.
### Storage Tiers
- **Cache** - Fast, ephemeral (Redis or in-memory)
- **Database** - Persistent, reliable (PostgreSQL, SQLite)
### Backends
| Backend | Use Case | Configuration |
|---------|----------|---------------|
| **in-memory** | Development, testing | No config needed |
| **sqlite** | Single instance, persistence | `path: ./data/dexto.db` |
| **postgres** | Production, scaling | `connectionString: $POSTGRES_URL` |
| **redis** | Fast caching | `url: $REDIS_URL` |
### Usage Pattern
```yaml
storage:
cache:
type: redis # Fast access
url: $REDIS_URL
database:
type: postgres # Persistent storage
connectionString: $POSTGRES_CONNECTION_STRING
```
## SystemPromptManager
**System prompt** assembly from multiple contributors.
### Contributor Types
- **static** - Fixed text content
- **dynamic** - Generated content (e.g., current date/time)
- **file** - Content from files (.md, .txt)
### Priority System
Lower numbers execute first (0 = highest priority).
### Usage Example
```yaml
systemPrompt:
contributors:
- id: primary
type: static
priority: 0
content: "You are a helpful AI assistant..."
- id: date
type: dynamic
priority: 10
source: date
- id: context
type: file
priority: 5
files: ["./docs/context.md"]
```
## AgentEventBus
**Event coordination** for inter-service communication.
### Event Types
- **thinking** - AI is processing
- **chunk** - Streaming response chunk
- **toolCall** - Tool execution starting
- **toolResult** - Tool execution completed
- **response** - Final response ready
### Usage Example
```typescript
agent.agentEventBus.on('toolCall', (event) => {
console.log(`Executing tool: ${event.toolName}`);
});
agent.agentEventBus.on('response', (event) => {
console.log(`Response: ${event.content}`);
});
```
## Service Initialization
Services are initialized automatically when `DextoAgent.start()` is called:
1. **Storage** - Cache and database connections
2. **Events** - Event bus setup
3. **Prompts** - System prompt assembly
4. **MCP** - Server connections
5. **Tools** - Tool discovery and validation
6. **Sessions** - Session management ready
## Debugging Services
### Log Levels
```bash
# Enable debug logging
DEXTO_LOG_LEVEL=debug dexto
# Service-specific debugging
DEXTO_LOG_LEVEL=silly dexto # Most verbose
```
### Service Health Checks
```typescript
// Check MCP connections
const connectedServers = agent.mcpManager.getClients();
const failedConnections = agent.mcpManager.getFailedConnections();
// Check tool availability
const toolStats = await agent.toolManager.getToolStats();
// Check storage status
const storageHealth = agent.storageManager.getStatus();
```
### Common Issues
- **MCP connection failures** - Check command paths, network access
- **Storage errors** - Verify database/Redis connections
- **Tool execution timeouts** - Increase timeout in server config
- **Session persistence issues** - Check database backend health
## Service Configuration
Each service can be configured through the agent config:
```yaml
# MCP server connections
mcpServers:
filesystem:
type: stdio
command: npx
timeout: 30000
# Storage backends
storage:
cache:
type: redis
database:
type: postgres
# Session limits
sessions:
maxSessions: 100
sessionTTL: 3600000
# Tool confirmation
toolConfirmation:
mode: auto
timeout: 30000
```
See [Configuration Guide](../guides/configuring-dexto/overview.md) for complete config options.

Some files were not shown because too many files have changed in this diff Show More