stagent 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/cli.js +146 -2
- package/docs/.coverage-gaps.json +21 -0
- package/docs/.last-generated +1 -1
- package/docs/features/agent-intelligence.md +36 -14
- package/docs/features/chat.md +33 -56
- package/docs/features/cost-usage.md +14 -10
- package/docs/features/dashboard-kanban.md +30 -13
- package/docs/features/delivery-channels.md +198 -0
- package/docs/features/design-system.md +10 -10
- package/docs/features/documents.md +8 -8
- package/docs/features/home-workspace.md +20 -15
- package/docs/features/inbox-notifications.md +22 -10
- package/docs/features/keyboard-navigation.md +11 -11
- package/docs/features/monitoring.md +1 -1
- package/docs/features/playbook.md +30 -32
- package/docs/features/profiles.md +33 -11
- package/docs/features/projects.md +2 -2
- package/docs/features/provider-runtimes.md +58 -14
- package/docs/features/schedules.md +70 -40
- package/docs/features/settings.md +74 -46
- package/docs/features/shared-components.md +7 -15
- package/docs/features/tool-permissions.md +9 -9
- package/docs/features/workflows.md +32 -21
- package/docs/getting-started.md +33 -9
- package/docs/index.md +25 -16
- package/docs/journeys/developer.md +124 -207
- package/docs/journeys/personal-use.md +70 -79
- package/docs/journeys/power-user.md +107 -151
- package/docs/journeys/work-use.md +81 -113
- package/docs/manifest.json +77 -45
- package/docs/superpowers/plans/2026-03-30-finish-in-progress-features.md +547 -0
- package/docs/use-cases/agency-operator.md +84 -0
- package/docs/use-cases/solo-founder.md +75 -0
- package/docs/why-stagent.md +59 -0
- package/package.json +10 -3
- package/src/app/api/channels/[id]/route.ts +104 -0
- package/src/app/api/channels/[id]/test/route.ts +52 -0
- package/src/app/api/channels/inbound/slack/route.ts +116 -0
- package/src/app/api/channels/inbound/telegram/poll/route.ts +140 -0
- package/src/app/api/channels/inbound/telegram/route.ts +87 -0
- package/src/app/api/channels/route.ts +72 -0
- package/src/app/api/chat/conversations/route.ts +15 -0
- package/src/app/api/chat/entities/search/route.ts +46 -31
- package/src/app/api/data/clear/route.ts +4 -0
- package/src/app/api/data/seed/route.ts +4 -0
- package/src/app/api/documents/route.ts +36 -6
- package/src/app/api/environment/profiles/suggest/route.ts +19 -3
- package/src/app/api/environment/scan/route.ts +8 -1
- package/src/app/api/handoffs/[id]/route.ts +76 -0
- package/src/app/api/handoffs/route.ts +89 -0
- package/src/app/api/memory/route.ts +181 -0
- package/src/app/api/profiles/[id]/route.ts +16 -1
- package/src/app/api/profiles/[id]/test/route.ts +4 -0
- package/src/app/api/profiles/[id]/test-results/route.ts +22 -0
- package/src/app/api/profiles/[id]/test-single/route.ts +64 -0
- package/src/app/api/profiles/assist/route.ts +35 -0
- package/src/app/api/profiles/import-repo/apply-updates/route.ts +123 -0
- package/src/app/api/profiles/import-repo/check-updates/route.ts +163 -0
- package/src/app/api/profiles/import-repo/confirm/route.ts +118 -0
- package/src/app/api/profiles/import-repo/preview/route.ts +107 -0
- package/src/app/api/profiles/import-repo/route.ts +29 -0
- package/src/app/api/profiles/import-repo/scan/route.ts +25 -0
- package/src/app/api/profiles/route.ts +73 -22
- package/src/app/api/runtimes/ollama/route.ts +86 -0
- package/src/app/api/runtimes/suggest/route.ts +29 -0
- package/src/app/api/schedules/[id]/heartbeat-history/route.ts +77 -0
- package/src/app/api/schedules/[id]/route.ts +41 -3
- package/src/app/api/schedules/parse/route.ts +66 -0
- package/src/app/api/schedules/route.ts +71 -12
- package/src/app/api/settings/author-default/route.ts +7 -0
- package/src/app/api/settings/learning/route.ts +41 -0
- package/src/app/api/settings/ollama/route.ts +34 -0
- package/src/app/api/settings/providers/route.ts +57 -0
- package/src/app/api/settings/routing/route.ts +24 -0
- package/src/app/api/settings/web-search/route.ts +28 -0
- package/src/app/api/tasks/[id]/execute/route.ts +13 -1
- package/src/app/api/tasks/[id]/respond/route.ts +23 -1
- package/src/app/documents/page.tsx +3 -0
- package/src/app/environment/page.tsx +8 -1
- package/src/app/settings/page.tsx +10 -4
- package/src/app/workflows/[id]/edit/page.tsx +2 -0
- package/src/app/workflows/new/page.tsx +2 -0
- package/src/components/chat/chat-command-popover.tsx +22 -19
- package/src/components/chat/chat-input.tsx +5 -0
- package/src/components/chat/chat-model-selector.tsx +42 -1
- package/src/components/chat/chat-shell.tsx +2 -0
- package/src/components/dashboard/welcome-landing.tsx +9 -9
- package/src/components/environment/artifact-card.tsx +27 -1
- package/src/components/environment/environment-dashboard.tsx +50 -2
- package/src/components/environment/environment-summary-card.tsx +5 -2
- package/src/components/environment/suggested-profiles.tsx +117 -52
- package/src/components/handoffs/handoff-approval-card.tsx +159 -0
- package/src/components/memory/memory-browser.tsx +315 -0
- package/src/components/profiles/learned-context-panel.tsx +4 -4
- package/src/components/profiles/profile-assist-panel.tsx +512 -0
- package/src/components/profiles/profile-browser.tsx +109 -8
- package/src/components/profiles/profile-card.tsx +29 -1
- package/src/components/profiles/profile-detail-view.tsx +200 -28
- package/src/components/profiles/profile-form-view.tsx +220 -82
- package/src/components/profiles/repo-import-wizard.tsx +648 -0
- package/src/components/profiles/smoke-test-editor.tsx +106 -0
- package/src/components/schedules/schedule-create-sheet.tsx +9 -1
- package/src/components/schedules/schedule-form.tsx +348 -9
- package/src/components/schedules/schedule-list.tsx +15 -2
- package/src/components/settings/auth-method-selector.tsx +7 -1
- package/src/components/settings/budget-guardrails-section.tsx +111 -48
- package/src/components/settings/channels-section.tsx +526 -0
- package/src/components/settings/chat-settings-section.tsx +27 -1
- package/src/components/settings/data-management-section.tsx +8 -6
- package/src/components/settings/learning-context-section.tsx +124 -0
- package/src/components/settings/ollama-section.tsx +270 -0
- package/src/components/settings/providers-runtimes-section.tsx +499 -0
- package/src/components/settings/web-search-section.tsx +101 -0
- package/src/components/shared/tag-input.tsx +156 -0
- package/src/components/tasks/kanban-board.tsx +32 -0
- package/src/components/tasks/kanban-column.tsx +4 -2
- package/src/components/tasks/task-card.tsx +1 -0
- package/src/components/tasks/task-chip-bar.tsx +6 -1
- package/src/components/tasks/task-create-panel.tsx +55 -5
- package/src/components/workflows/workflow-form-view.tsx +38 -3
- package/src/hooks/use-chat-autocomplete.ts +24 -26
- package/src/hooks/use-project-skills.ts +66 -0
- package/src/hooks/use-tag-suggestions.ts +31 -0
- package/src/instrumentation.ts +4 -1
- package/src/lib/agents/__tests__/claude-agent.test.ts +3 -0
- package/src/lib/agents/__tests__/learned-context.test.ts +10 -0
- package/src/lib/agents/agentic-loop.ts +235 -0
- package/src/lib/agents/browser-mcp.ts +59 -4
- package/src/lib/agents/claude-agent.ts +27 -200
- package/src/lib/agents/handoff/bus.ts +164 -0
- package/src/lib/agents/handoff/governance.ts +47 -0
- package/src/lib/agents/handoff/types.ts +16 -0
- package/src/lib/agents/learned-context.ts +27 -7
- package/src/lib/agents/memory/decay.ts +61 -0
- package/src/lib/agents/memory/extractor.ts +181 -0
- package/src/lib/agents/memory/retrieval.ts +96 -0
- package/src/lib/agents/memory/types.ts +6 -0
- package/src/lib/agents/profiles/__tests__/project-profiles.test.ts +119 -0
- package/src/lib/agents/profiles/__tests__/registry.test.ts +11 -3
- package/src/lib/agents/profiles/builtins/code-reviewer/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/content-creator/SKILL.md +19 -0
- package/src/lib/agents/profiles/builtins/content-creator/profile.yaml +27 -0
- package/src/lib/agents/profiles/builtins/customer-support-agent/SKILL.md +19 -0
- package/src/lib/agents/profiles/builtins/customer-support-agent/profile.yaml +26 -0
- package/src/lib/agents/profiles/builtins/data-analyst/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/devops-engineer/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/document-writer/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/financial-analyst/SKILL.md +19 -0
- package/src/lib/agents/profiles/builtins/financial-analyst/profile.yaml +24 -0
- package/src/lib/agents/profiles/builtins/general/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/health-fitness-coach/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/learning-coach/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/marketing-strategist/SKILL.md +19 -0
- package/src/lib/agents/profiles/builtins/marketing-strategist/profile.yaml +27 -0
- package/src/lib/agents/profiles/builtins/operations-coordinator/SKILL.md +19 -0
- package/src/lib/agents/profiles/builtins/operations-coordinator/profile.yaml +26 -0
- package/src/lib/agents/profiles/builtins/project-manager/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/researcher/SKILL.md +1 -0
- package/src/lib/agents/profiles/builtins/researcher/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/sales-researcher/SKILL.md +19 -0
- package/src/lib/agents/profiles/builtins/sales-researcher/profile.yaml +26 -0
- package/src/lib/agents/profiles/builtins/shopping-assistant/SKILL.md +1 -0
- package/src/lib/agents/profiles/builtins/shopping-assistant/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/sweep/profile.yaml +1 -1
- package/src/lib/agents/profiles/builtins/technical-writer/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/travel-planner/SKILL.md +2 -0
- package/src/lib/agents/profiles/builtins/travel-planner/profile.yaml +2 -2
- package/src/lib/agents/profiles/builtins/wealth-manager/SKILL.md +2 -0
- package/src/lib/agents/profiles/builtins/wealth-manager/profile.yaml +2 -2
- package/src/lib/agents/profiles/project-profiles.ts +193 -0
- package/src/lib/agents/profiles/registry.ts +130 -6
- package/src/lib/agents/profiles/types.ts +28 -0
- package/src/lib/agents/router.ts +174 -2
- package/src/lib/agents/runtime/__tests__/catalog.test.ts +15 -4
- package/src/lib/agents/runtime/anthropic-direct.ts +644 -0
- package/src/lib/agents/runtime/catalog.ts +57 -2
- package/src/lib/agents/runtime/claude.ts +205 -1
- package/src/lib/agents/runtime/index.ts +22 -0
- package/src/lib/agents/runtime/ollama-adapter.ts +409 -0
- package/src/lib/agents/runtime/openai-direct.ts +514 -0
- package/src/lib/agents/runtime/profile-assist-types.ts +30 -0
- package/src/lib/agents/runtime/types.ts +2 -0
- package/src/lib/agents/tool-permissions.ts +203 -0
- package/src/lib/channels/gateway.ts +321 -0
- package/src/lib/channels/poller.ts +268 -0
- package/src/lib/channels/registry.ts +90 -0
- package/src/lib/channels/slack-adapter.ts +188 -0
- package/src/lib/channels/telegram-adapter.ts +218 -0
- package/src/lib/channels/types.ts +75 -0
- package/src/lib/channels/webhook-adapter.ts +74 -0
- package/src/lib/chat/context-builder.ts +22 -2
- package/src/lib/chat/engine.ts +95 -13
- package/src/lib/chat/ollama-engine.ts +198 -0
- package/src/lib/chat/stagent-tools.ts +106 -20
- package/src/lib/chat/tool-catalog.ts +24 -0
- package/src/lib/chat/tool-registry.ts +90 -0
- package/src/lib/chat/tools/chat-history-tools.ts +4 -4
- package/src/lib/chat/tools/document-tools.ts +7 -7
- package/src/lib/chat/tools/handoff-tools.ts +70 -0
- package/src/lib/chat/tools/notification-tools.ts +4 -4
- package/src/lib/chat/tools/profile-tools.ts +3 -3
- package/src/lib/chat/tools/project-tools.ts +3 -3
- package/src/lib/chat/tools/schedule-tools.ts +29 -13
- package/src/lib/chat/tools/settings-tools.ts +2 -2
- package/src/lib/chat/tools/task-tools.ts +66 -11
- package/src/lib/chat/tools/usage-tools.ts +2 -2
- package/src/lib/chat/tools/workflow-tools.ts +8 -8
- package/src/lib/chat/types.ts +11 -5
- package/src/lib/constants/known-tools.ts +19 -0
- package/src/lib/constants/prose-styles.ts +1 -1
- package/src/lib/constants/settings.ts +7 -0
- package/src/lib/data/channel-bindings.ts +85 -0
- package/src/lib/data/clear.ts +22 -0
- package/src/lib/data/profile-test-results.ts +48 -0
- package/src/lib/data/seed-data/conversations.ts +196 -0
- package/src/lib/data/seed-data/learned-context.ts +99 -0
- package/src/lib/data/seed-data/notifications.ts +54 -1
- package/src/lib/data/seed-data/profile-test-results.ts +96 -0
- package/src/lib/data/seed-data/repo-imports.ts +51 -0
- package/src/lib/data/seed-data/views.ts +60 -0
- package/src/lib/data/seed.ts +51 -0
- package/src/lib/db/bootstrap.ts +162 -0
- package/src/lib/db/migrations/0013_add_repo_imports.sql +15 -0
- package/src/lib/db/migrations/0014_add_linked_profile_id.sql +3 -0
- package/src/lib/db/migrations/0015_add_channel_bindings.sql +23 -0
- package/src/lib/db/schema.ts +190 -1
- package/src/lib/environment/__tests__/auto-scan.test.ts +86 -0
- package/src/lib/environment/__tests__/profile-linker.test.ts +187 -0
- package/src/lib/environment/auto-scan.ts +48 -0
- package/src/lib/environment/data.ts +25 -0
- package/src/lib/environment/profile-generator.ts +40 -10
- package/src/lib/environment/profile-linker.ts +143 -0
- package/src/lib/environment/profile-rules.ts +96 -0
- package/src/lib/import/dedup.ts +149 -0
- package/src/lib/import/format-adapter.ts +631 -0
- package/src/lib/import/github-api.ts +219 -0
- package/src/lib/import/repo-scanner.ts +251 -0
- package/src/lib/schedules/__tests__/nlp-parser.test.ts +330 -0
- package/src/lib/schedules/active-hours.ts +120 -0
- package/src/lib/schedules/heartbeat-parser.ts +224 -0
- package/src/lib/schedules/heartbeat-prompt.ts +153 -0
- package/src/lib/schedules/nlp-parser.ts +357 -0
- package/src/lib/schedules/scheduler.ts +218 -3
- package/src/lib/settings/__tests__/budget-guardrails.test.ts +39 -1
- package/src/lib/settings/helpers.ts +6 -0
- package/src/lib/settings/routing.ts +24 -0
- package/src/lib/settings/runtime-setup.ts +28 -1
- package/src/lib/usage/ledger.ts +2 -1
- package/src/lib/validators/__tests__/settings.test.ts +9 -0
- package/src/lib/validators/profile.ts +39 -0
- package/src/lib/workflows/blueprints/builtins/business-daily-briefing.yaml +102 -0
- package/src/lib/workflows/blueprints/builtins/content-marketing-pipeline.yaml +90 -0
- package/src/lib/workflows/blueprints/builtins/customer-support-triage.yaml +107 -0
- package/src/lib/workflows/blueprints/builtins/financial-reporting.yaml +104 -0
- package/src/lib/workflows/blueprints/builtins/lead-research-pipeline.yaml +82 -0
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Stagent
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> AI Business Operating System — Run your business with AI agents. Local-first, multi-provider, governed.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/stagent) [](https://nextjs.org/) [](https://react.dev/) [](https://www.typescriptlang.org/) [](https://docs.anthropic.com/) [](https://developers.openai.com/codex/app-server) [](LICENSE)
|
|
5
|
+
[](https://stagent.io) [](https://www.npmjs.com/package/stagent) [](https://nextjs.org/) [](https://react.dev/) [](https://www.typescriptlang.org/) [](https://docs.anthropic.com/) [](https://developers.openai.com/codex/app-server) [](LICENSE)
|
|
6
6
|
|
|
7
7
|
**[stagent.io](https://stagent.io)** · **[GitHub](https://github.com/navam-io/stagent)**
|
|
8
8
|
|
|
@@ -28,20 +28,20 @@ Open [localhost:3000](http://localhost:3000). That's it — zero config, local S
|
|
|
28
28
|
|
|
29
29
|
## Why Stagent
|
|
30
30
|
|
|
31
|
-
AI
|
|
31
|
+
The AI agent stack is broken for business operators. You can spin up an agent in minutes — but running it reliably for real work means stitching together orchestration, governance, cost controls, and team coordination yourself. Stagent closes that gap with a single local-first platform where agents do the work and you stay in control.
|
|
32
32
|
|
|
33
33
|
- **Local-first** — SQLite database, no cloud dependency, `npx stagent` and go
|
|
34
34
|
- **Multi-provider** — Claude Code + OpenAI Codex App Server behind one runtime registry
|
|
35
|
-
- **
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
- **
|
|
35
|
+
- **Your rules, enforced** — Tool permissions, inbox approvals, and audit trails for every agent action
|
|
36
|
+
- **Your AI team** — 21 specialist profiles ready to deploy, each with instructions, tool policies, and runtime tuning
|
|
37
|
+
- **Business processes, automated** — 6 workflow patterns (sequence, planner-executor, checkpoint, parallel, loop, swarm)
|
|
38
|
+
- **Know what you spend** — Usage metering, budgets, and spend visibility per provider and model
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
42
|
## Runtime Bridge
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Run the same business process on different AI providers without changing a line of configuration. Stagent's shared runtime registry routes tasks, schedules, and workflow steps through **Claude Code** (Anthropic Claude Agent SDK) and **OpenAI Codex App Server**, landing everything in the same inbox, monitoring, and cost surfaces. Switching providers is a settings change, not a rewrite.
|
|
45
45
|
|
|
46
46
|
---
|
|
47
47
|
|
package/dist/cli.js
CHANGED
|
@@ -106,7 +106,13 @@ var STAGENT_TABLES = [
|
|
|
106
106
|
"conversations",
|
|
107
107
|
"chat_messages",
|
|
108
108
|
"reading_progress",
|
|
109
|
-
"bookmarks"
|
|
109
|
+
"bookmarks",
|
|
110
|
+
"profile_test_results",
|
|
111
|
+
"repo_imports",
|
|
112
|
+
"agent_memory",
|
|
113
|
+
"channel_configs",
|
|
114
|
+
"channel_bindings",
|
|
115
|
+
"agent_messages"
|
|
110
116
|
];
|
|
111
117
|
function bootstrapStagentDatabase(sqlite2) {
|
|
112
118
|
sqlite2.exec(`
|
|
@@ -224,6 +230,16 @@ function bootstrapStagentDatabase(sqlite2) {
|
|
|
224
230
|
expires_at INTEGER,
|
|
225
231
|
last_fired_at INTEGER,
|
|
226
232
|
next_fire_at INTEGER,
|
|
233
|
+
type TEXT DEFAULT 'scheduled' NOT NULL,
|
|
234
|
+
heartbeat_checklist TEXT,
|
|
235
|
+
active_hours_start INTEGER,
|
|
236
|
+
active_hours_end INTEGER,
|
|
237
|
+
active_timezone TEXT DEFAULT 'UTC',
|
|
238
|
+
suppression_count INTEGER DEFAULT 0 NOT NULL,
|
|
239
|
+
last_action_at INTEGER,
|
|
240
|
+
heartbeat_budget_per_day INTEGER,
|
|
241
|
+
heartbeat_spent_today INTEGER DEFAULT 0 NOT NULL,
|
|
242
|
+
heartbeat_budget_reset_at INTEGER,
|
|
227
243
|
created_at INTEGER NOT NULL,
|
|
228
244
|
updated_at INTEGER NOT NULL,
|
|
229
245
|
FOREIGN KEY (project_id) REFERENCES projects(id) ON UPDATE NO ACTION ON DELETE NO ACTION
|
|
@@ -320,6 +336,17 @@ function bootstrapStagentDatabase(sqlite2) {
|
|
|
320
336
|
sqlite2.exec(`CREATE INDEX IF NOT EXISTS idx_tasks_schedule_id ON tasks(schedule_id);`);
|
|
321
337
|
addColumnIfMissing(`ALTER TABLE projects ADD COLUMN working_directory TEXT;`);
|
|
322
338
|
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN assigned_agent TEXT;`);
|
|
339
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN type TEXT DEFAULT 'scheduled' NOT NULL;`);
|
|
340
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN heartbeat_checklist TEXT;`);
|
|
341
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN active_hours_start INTEGER;`);
|
|
342
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN active_hours_end INTEGER;`);
|
|
343
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN active_timezone TEXT DEFAULT 'UTC';`);
|
|
344
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN suppression_count INTEGER DEFAULT 0 NOT NULL;`);
|
|
345
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN last_action_at INTEGER;`);
|
|
346
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN heartbeat_budget_per_day INTEGER;`);
|
|
347
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN heartbeat_spent_today INTEGER DEFAULT 0 NOT NULL;`);
|
|
348
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN heartbeat_budget_reset_at INTEGER;`);
|
|
349
|
+
addColumnIfMissing(`ALTER TABLE tasks ADD COLUMN source_type TEXT;`);
|
|
323
350
|
addColumnIfMissing(`ALTER TABLE documents ADD COLUMN version INTEGER NOT NULL DEFAULT 1;`);
|
|
324
351
|
addColumnIfMissing(`ALTER TABLE documents ADD COLUMN source TEXT DEFAULT 'upload';`);
|
|
325
352
|
addColumnIfMissing(`ALTER TABLE documents ADD COLUMN conversation_id TEXT REFERENCES conversations(id);`);
|
|
@@ -358,6 +385,7 @@ function bootstrapStagentDatabase(sqlite2) {
|
|
|
358
385
|
metadata TEXT,
|
|
359
386
|
size_bytes INTEGER DEFAULT 0 NOT NULL,
|
|
360
387
|
modified_at INTEGER NOT NULL,
|
|
388
|
+
linked_profile_id TEXT,
|
|
361
389
|
created_at INTEGER NOT NULL,
|
|
362
390
|
FOREIGN KEY (scan_id) REFERENCES environment_scans(id) ON UPDATE NO ACTION ON DELETE NO ACTION
|
|
363
391
|
);
|
|
@@ -415,6 +443,8 @@ function bootstrapStagentDatabase(sqlite2) {
|
|
|
415
443
|
|
|
416
444
|
CREATE INDEX IF NOT EXISTS idx_env_templates_scope ON environment_templates(scope);
|
|
417
445
|
`);
|
|
446
|
+
addColumnIfMissing(`ALTER TABLE environment_artifacts ADD COLUMN linked_profile_id TEXT;`);
|
|
447
|
+
sqlite2.exec(`CREATE INDEX IF NOT EXISTS idx_env_artifacts_linked_profile ON environment_artifacts(linked_profile_id);`);
|
|
418
448
|
const legacyConv = sqlite2.prepare(
|
|
419
449
|
`SELECT sql FROM sqlite_master WHERE type='table' AND name='conversations'`
|
|
420
450
|
).get();
|
|
@@ -475,6 +505,120 @@ function bootstrapStagentDatabase(sqlite2) {
|
|
|
475
505
|
|
|
476
506
|
CREATE INDEX IF NOT EXISTS idx_bookmarks_chapter_id ON bookmarks(chapter_id);
|
|
477
507
|
`);
|
|
508
|
+
sqlite2.exec(`
|
|
509
|
+
CREATE TABLE IF NOT EXISTS repo_imports (
|
|
510
|
+
id TEXT PRIMARY KEY NOT NULL,
|
|
511
|
+
repo_url TEXT NOT NULL,
|
|
512
|
+
repo_owner TEXT NOT NULL,
|
|
513
|
+
repo_name TEXT NOT NULL,
|
|
514
|
+
branch TEXT NOT NULL,
|
|
515
|
+
commit_sha TEXT NOT NULL,
|
|
516
|
+
profile_ids TEXT NOT NULL,
|
|
517
|
+
skill_count INTEGER NOT NULL,
|
|
518
|
+
last_checked_at INTEGER,
|
|
519
|
+
created_at INTEGER NOT NULL
|
|
520
|
+
);
|
|
521
|
+
|
|
522
|
+
CREATE INDEX IF NOT EXISTS idx_repo_imports_repo_url ON repo_imports(repo_url);
|
|
523
|
+
CREATE INDEX IF NOT EXISTS idx_repo_imports_owner_name ON repo_imports(repo_owner, repo_name);
|
|
524
|
+
`);
|
|
525
|
+
sqlite2.exec(`
|
|
526
|
+
CREATE TABLE IF NOT EXISTS agent_memory (
|
|
527
|
+
id TEXT PRIMARY KEY NOT NULL,
|
|
528
|
+
profile_id TEXT NOT NULL,
|
|
529
|
+
category TEXT NOT NULL,
|
|
530
|
+
content TEXT NOT NULL,
|
|
531
|
+
confidence INTEGER DEFAULT 700 NOT NULL,
|
|
532
|
+
source_task_id TEXT,
|
|
533
|
+
tags TEXT,
|
|
534
|
+
last_accessed_at INTEGER,
|
|
535
|
+
access_count INTEGER DEFAULT 0 NOT NULL,
|
|
536
|
+
decay_rate INTEGER DEFAULT 10 NOT NULL,
|
|
537
|
+
status TEXT DEFAULT 'active' NOT NULL,
|
|
538
|
+
created_at INTEGER NOT NULL,
|
|
539
|
+
updated_at INTEGER NOT NULL,
|
|
540
|
+
FOREIGN KEY (source_task_id) REFERENCES tasks(id) ON UPDATE NO ACTION ON DELETE NO ACTION
|
|
541
|
+
);
|
|
542
|
+
|
|
543
|
+
CREATE INDEX IF NOT EXISTS idx_agent_memory_profile_status ON agent_memory(profile_id, status);
|
|
544
|
+
CREATE INDEX IF NOT EXISTS idx_agent_memory_confidence ON agent_memory(confidence);
|
|
545
|
+
`);
|
|
546
|
+
sqlite2.exec(`
|
|
547
|
+
CREATE TABLE IF NOT EXISTS profile_test_results (
|
|
548
|
+
id TEXT PRIMARY KEY NOT NULL,
|
|
549
|
+
profile_id TEXT NOT NULL,
|
|
550
|
+
runtime_id TEXT NOT NULL,
|
|
551
|
+
report_json TEXT NOT NULL,
|
|
552
|
+
total_passed INTEGER DEFAULT 0 NOT NULL,
|
|
553
|
+
total_failed INTEGER DEFAULT 0 NOT NULL,
|
|
554
|
+
created_at INTEGER NOT NULL
|
|
555
|
+
);
|
|
556
|
+
|
|
557
|
+
CREATE INDEX IF NOT EXISTS idx_profile_test_results_profile_runtime ON profile_test_results(profile_id, runtime_id);
|
|
558
|
+
`);
|
|
559
|
+
sqlite2.exec(`
|
|
560
|
+
CREATE TABLE IF NOT EXISTS channel_configs (
|
|
561
|
+
id TEXT PRIMARY KEY NOT NULL,
|
|
562
|
+
channel_type TEXT NOT NULL,
|
|
563
|
+
name TEXT NOT NULL,
|
|
564
|
+
config TEXT NOT NULL,
|
|
565
|
+
status TEXT DEFAULT 'active' NOT NULL,
|
|
566
|
+
test_status TEXT DEFAULT 'untested' NOT NULL,
|
|
567
|
+
created_at INTEGER NOT NULL,
|
|
568
|
+
updated_at INTEGER NOT NULL
|
|
569
|
+
);
|
|
570
|
+
|
|
571
|
+
CREATE INDEX IF NOT EXISTS idx_channel_configs_type ON channel_configs(channel_type);
|
|
572
|
+
`);
|
|
573
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN delivery_channels TEXT;`);
|
|
574
|
+
addColumnIfMissing(`ALTER TABLE channel_configs ADD COLUMN direction TEXT DEFAULT 'outbound' NOT NULL;`);
|
|
575
|
+
sqlite2.exec(`
|
|
576
|
+
CREATE TABLE IF NOT EXISTS channel_bindings (
|
|
577
|
+
id TEXT PRIMARY KEY NOT NULL,
|
|
578
|
+
channel_config_id TEXT NOT NULL,
|
|
579
|
+
conversation_id TEXT NOT NULL,
|
|
580
|
+
external_thread_id TEXT,
|
|
581
|
+
runtime_id TEXT NOT NULL,
|
|
582
|
+
model_id TEXT,
|
|
583
|
+
profile_id TEXT,
|
|
584
|
+
status TEXT DEFAULT 'active' NOT NULL,
|
|
585
|
+
pending_request_id TEXT,
|
|
586
|
+
created_at INTEGER NOT NULL,
|
|
587
|
+
updated_at INTEGER NOT NULL,
|
|
588
|
+
FOREIGN KEY (channel_config_id) REFERENCES channel_configs(id) ON UPDATE NO ACTION ON DELETE NO ACTION,
|
|
589
|
+
FOREIGN KEY (conversation_id) REFERENCES conversations(id) ON UPDATE NO ACTION ON DELETE NO ACTION
|
|
590
|
+
);
|
|
591
|
+
|
|
592
|
+
CREATE INDEX IF NOT EXISTS idx_channel_bindings_config ON channel_bindings(channel_config_id);
|
|
593
|
+
CREATE INDEX IF NOT EXISTS idx_channel_bindings_conversation ON channel_bindings(conversation_id);
|
|
594
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_channel_bindings_config_thread ON channel_bindings(channel_config_id, external_thread_id);
|
|
595
|
+
`);
|
|
596
|
+
sqlite2.exec(`
|
|
597
|
+
CREATE TABLE IF NOT EXISTS agent_messages (
|
|
598
|
+
id TEXT PRIMARY KEY NOT NULL,
|
|
599
|
+
from_profile_id TEXT NOT NULL,
|
|
600
|
+
to_profile_id TEXT NOT NULL,
|
|
601
|
+
task_id TEXT,
|
|
602
|
+
target_task_id TEXT,
|
|
603
|
+
subject TEXT NOT NULL,
|
|
604
|
+
body TEXT NOT NULL,
|
|
605
|
+
attachments TEXT,
|
|
606
|
+
priority INTEGER DEFAULT 2 NOT NULL,
|
|
607
|
+
status TEXT DEFAULT 'pending' NOT NULL,
|
|
608
|
+
requires_approval INTEGER DEFAULT 0 NOT NULL,
|
|
609
|
+
approved_by TEXT,
|
|
610
|
+
parent_message_id TEXT,
|
|
611
|
+
chain_depth INTEGER DEFAULT 0 NOT NULL,
|
|
612
|
+
created_at INTEGER NOT NULL,
|
|
613
|
+
responded_at INTEGER,
|
|
614
|
+
expires_at INTEGER,
|
|
615
|
+
FOREIGN KEY (task_id) REFERENCES tasks(id) ON UPDATE NO ACTION ON DELETE NO ACTION,
|
|
616
|
+
FOREIGN KEY (target_task_id) REFERENCES tasks(id) ON UPDATE NO ACTION ON DELETE NO ACTION
|
|
617
|
+
);
|
|
618
|
+
|
|
619
|
+
CREATE INDEX IF NOT EXISTS idx_agent_messages_to_status ON agent_messages(to_profile_id, status);
|
|
620
|
+
CREATE INDEX IF NOT EXISTS idx_agent_messages_task ON agent_messages(task_id);
|
|
621
|
+
`);
|
|
478
622
|
}
|
|
479
623
|
function hasLegacyStagentTables(sqlite2) {
|
|
480
624
|
const placeholders = STAGENT_TABLES.map(() => "?").join(", ");
|
|
@@ -544,7 +688,7 @@ Examples:
|
|
|
544
688
|
node dist/cli.js --data-dir ~/.stagent-dogfood --port 3100
|
|
545
689
|
`;
|
|
546
690
|
}
|
|
547
|
-
program.name("stagent").description("
|
|
691
|
+
program.name("stagent").description("AI Business Operating System").version(pkg.version).addHelpText("after", getHelpText).option("-p, --port <number>", "port to start on", "3000").option("--data-dir <path>", "custom data directory (overrides STAGENT_DATA_DIR)").option("--reset", "delete the local database before starting").option("--no-open", "don't auto-open browser").parse();
|
|
548
692
|
var opts = program.opts();
|
|
549
693
|
if (opts.dataDir) {
|
|
550
694
|
process.env.STAGENT_DATA_DIR = opts.dataDir;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generated": "2026-03-31T21:00:00Z",
|
|
3
|
+
"totalFeatures": 31,
|
|
4
|
+
"coveredFeatures": 28,
|
|
5
|
+
"uncoveredFeatures": 3,
|
|
6
|
+
"coveragePercent": 90.3,
|
|
7
|
+
"gaps": {
|
|
8
|
+
"book-content-merge": {
|
|
9
|
+
"availableScreenshots": ["book-reader.png"],
|
|
10
|
+
"note": "Book reader screenshot exists but not referenced in any journey doc"
|
|
11
|
+
},
|
|
12
|
+
"book-reading-paths": {
|
|
13
|
+
"availableScreenshots": ["book-reader.png", "book-chapter-nav.png"],
|
|
14
|
+
"note": "Book navigation screenshots exist but not referenced in any journey doc"
|
|
15
|
+
},
|
|
16
|
+
"browser-tool-orchestration": {
|
|
17
|
+
"availableScreenshots": ["settings-browser-tools.png"],
|
|
18
|
+
"note": "Browser tools settings screenshot exists but not referenced in any journey doc"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
package/docs/.last-generated
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2026-
|
|
1
|
+
2026-04-01T05:15:01Z
|
|
@@ -3,38 +3,36 @@ title: "Agent Intelligence"
|
|
|
3
3
|
category: "feature-reference"
|
|
4
4
|
section: "agent-intelligence"
|
|
5
5
|
route: "cross-cutting"
|
|
6
|
-
tags: [ai-assist, routing, autonomous, swarm, self-improvement, context, parallel]
|
|
7
|
-
features: ["task-definition-ai", "multi-agent-routing", "autonomous-loop-execution", "multi-agent-swarm", "agent-self-improvement", "workflow-context-batching", "parallel-research-fork-join"]
|
|
6
|
+
tags: [ai-assist, routing, autonomous, swarm, self-improvement, context, parallel, episodic-memory, handoffs]
|
|
7
|
+
features: ["task-definition-ai", "multi-agent-routing", "autonomous-loop-execution", "multi-agent-swarm", "agent-self-improvement", "workflow-context-batching", "parallel-research-fork-join", "agent-episodic-memory", "agent-async-handoffs"]
|
|
8
8
|
screengrabCount: 0
|
|
9
|
-
lastUpdated: "2026-03-
|
|
9
|
+
lastUpdated: "2026-03-31"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# Agent Intelligence
|
|
13
13
|
|
|
14
|
-
Stagent layers several AI-powered capabilities on top of basic task execution. From one-click description improvement to multi-agent coordination, these features reduce manual effort and improve output quality across the workspace.
|
|
15
|
-
|
|
16
|
-
## Screenshots
|
|
14
|
+
Stagent layers several AI-powered capabilities on top of basic task execution. From one-click description improvement to multi-agent coordination, episodic memory, and async handoffs, these features reduce manual effort and improve output quality across the workspace.
|
|
17
15
|
|
|
18
16
|
## Key Features
|
|
19
17
|
|
|
20
18
|
### Task Definition AI Assist
|
|
21
19
|
|
|
22
|
-
A single-click "AI Assist" button on the task creation form takes the current title and generates a richer, more actionable description. The improved text is previewed before applying, so
|
|
20
|
+
A single-click "AI Assist" button on the task creation form takes the current title and generates a richer, more actionable description. The improved text is previewed before applying, so you retain full control.
|
|
23
21
|
|
|
24
22
|
### Multi-Agent Routing
|
|
25
23
|
|
|
26
|
-
When a task is created, the task classifier analyzes its content and automatically selects the best-fit agent profile from the registry
|
|
24
|
+
When a task is created, the task classifier analyzes its content and automatically selects the best-fit agent profile from the registry. The selected profile can be overridden manually via the profile dropdown. The router considers task content, project context, profile capabilities, and runtime availability.
|
|
27
25
|
|
|
28
26
|
### Autonomous Loop Execution
|
|
29
27
|
|
|
30
28
|
Tasks can run in autonomous loops with configurable stop conditions:
|
|
31
29
|
|
|
32
|
-
- **Iteration limit**
|
|
33
|
-
- **Time limit**
|
|
34
|
-
- **Success criteria**
|
|
35
|
-
- **Error threshold**
|
|
30
|
+
- **Iteration limit** -- stop after N iterations.
|
|
31
|
+
- **Time limit** -- stop after a duration elapses.
|
|
32
|
+
- **Success criteria** -- stop when the agent reports completion.
|
|
33
|
+
- **Error threshold** -- stop after repeated failures.
|
|
36
34
|
|
|
37
|
-
Loops support pause and resume. The
|
|
35
|
+
Loops support pause and resume. The loop status view provides real-time progress and control.
|
|
38
36
|
|
|
39
37
|
### Multi-Agent Swarm
|
|
40
38
|
|
|
@@ -42,7 +40,30 @@ For complex tasks that benefit from multiple perspectives, the swarm feature coo
|
|
|
42
40
|
|
|
43
41
|
### Agent Self-Improvement
|
|
44
42
|
|
|
45
|
-
Agents accumulate learned context across iterations, stored in the
|
|
43
|
+
Agents accumulate learned context across iterations, stored in the database. This behavioral context feeds back into subsequent runs, allowing agents to refine their approach over time without manual prompt tuning. Context proposals require human approval before being applied.
|
|
44
|
+
|
|
45
|
+
### Agent Episodic Memory
|
|
46
|
+
|
|
47
|
+
Distinct from behavioral learned context, episodic memory captures factual knowledge the agent discovers during task execution. Key characteristics:
|
|
48
|
+
|
|
49
|
+
- **Memory extraction** -- agents identify and store important facts, decisions, and discoveries as discrete memory entries
|
|
50
|
+
- **Confidence scoring** -- each memory has a confidence level based on source reliability
|
|
51
|
+
- **Time-based decay** -- older memories gradually lose relevance weight, keeping the context window focused on current knowledge
|
|
52
|
+
- **Relevance-filtered retrieval** -- when executing a new task, the agent retrieves only memories relevant to the current context
|
|
53
|
+
- **Operator review** -- a memory browser UI lets you inspect, edit, and delete stored memories
|
|
54
|
+
|
|
55
|
+
Episodic memory means agents build institutional knowledge over time. A financial analyst profile that researches a company once can recall that research in future tasks without re-doing the work.
|
|
56
|
+
|
|
57
|
+
### Agent Async Handoffs
|
|
58
|
+
|
|
59
|
+
Agents can hand off work to other agents asynchronously through a message bus:
|
|
60
|
+
|
|
61
|
+
- **send_handoff tool** -- agents use this tool to delegate work to another profile
|
|
62
|
+
- **Governance gates** -- chain depth limits prevent infinite handoff loops, and self-handoff is blocked
|
|
63
|
+
- **Inbox approvals** -- handoff requests surface in the inbox for human approval before the receiving agent begins work
|
|
64
|
+
- **Handoff policies** -- configure which profiles can hand off to which, and under what conditions
|
|
65
|
+
|
|
66
|
+
This enables multi-agent workflows where a researcher discovers a code issue and hands it off to the code reviewer without requiring a pre-built workflow definition.
|
|
46
67
|
|
|
47
68
|
### Workflow Context Batching
|
|
48
69
|
|
|
@@ -58,3 +79,4 @@ Research tasks can be forked into concurrent sub-tasks that investigate differen
|
|
|
58
79
|
- [Profiles](./profiles.md)
|
|
59
80
|
- [Workflows](./workflows.md)
|
|
60
81
|
- [Schedules](./schedules.md)
|
|
82
|
+
- [Inbox & Notifications](./inbox-notifications.md)
|
package/docs/features/chat.md
CHANGED
|
@@ -3,15 +3,15 @@ title: "Chat"
|
|
|
3
3
|
category: "feature-reference"
|
|
4
4
|
section: "chat"
|
|
5
5
|
route: "/chat"
|
|
6
|
-
tags: ["chat", "conversation", "ai", "tool-catalog", "mentions"]
|
|
7
|
-
features: ["chat-data-layer", "chat-engine", "chat-api-routes", "chat-ui-shell", "chat-message-rendering", "chat-input-composer"]
|
|
8
|
-
screengrabCount:
|
|
9
|
-
lastUpdated: "2026-03-
|
|
6
|
+
tags: ["chat", "conversation", "ai", "tool-catalog", "mentions", "channels", "bidirectional"]
|
|
7
|
+
features: ["chat-data-layer", "chat-engine", "chat-api-routes", "chat-ui-shell", "chat-message-rendering", "chat-input-composer", "bidirectional-channel-chat"]
|
|
8
|
+
screengrabCount: 4
|
|
9
|
+
lastUpdated: "2026-03-31"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# Chat
|
|
13
13
|
|
|
14
|
-
The Chat page is your AI-powered command center for everything in your workspace. Instead of a blank prompt, you land on a **Tool Catalog** that organizes suggested prompts into four action-oriented categories -- Explore, Create, Debug, and Automate -- plus a Smart Picks row of personalized suggestions drawn from your actual projects, tasks, and documents. Pick a model, choose a prompt (or type your own), and get context-aware answers with direct links to the items the assistant mentions.
|
|
14
|
+
The Chat page is your AI-powered command center for everything in your workspace. Instead of a blank prompt, you land on a **Tool Catalog** that organizes suggested prompts into four action-oriented categories -- Explore, Create, Debug, and Automate -- plus a Smart Picks row of personalized suggestions drawn from your actual projects, tasks, and documents. Pick a model, choose a prompt (or type your own), and get context-aware answers with direct links to the items the assistant mentions. Conversations can also originate from Slack and Telegram via bidirectional delivery channels.
|
|
15
15
|
|
|
16
16
|
## Screenshots
|
|
17
17
|
|
|
@@ -27,9 +27,6 @@ The Chat page is your AI-powered command center for everything in your workspace
|
|
|
27
27
|

|
|
28
28
|
*Active conversation with @ document context injected and streamed response with formatted markdown*
|
|
29
29
|
|
|
30
|
-

|
|
31
|
-
*Response content with Quick Access navigation pills linking directly to mentioned entities*
|
|
32
|
-
|
|
33
30
|
## Key Features
|
|
34
31
|
|
|
35
32
|
### Tool Catalog
|
|
@@ -40,85 +37,65 @@ When no conversation is active, the chat page displays a curated grid of suggest
|
|
|
40
37
|
- **Create** -- Prompts that help you spin up new tasks, workflows, projects, and schedules.
|
|
41
38
|
- **Debug** -- Investigate failed tasks, review agent logs, and diagnose workflow issues.
|
|
42
39
|
- **Automate** -- Set up scheduled loops, bulk operations, and repeating workflows.
|
|
43
|
-
- **Smart Picks** -- A personalized row of suggestions generated from your actual workspace data.
|
|
44
|
-
|
|
45
|
-
Click any suggestion to insert it into the input and start a conversation instantly.
|
|
40
|
+
- **Smart Picks** -- A personalized row of suggestions generated from your actual workspace data.
|
|
46
41
|
|
|
47
42
|
### Model Selection
|
|
48
43
|
|
|
49
44
|
Choose which AI model powers your conversation using the model selector at the bottom-left of the input area. Models are grouped by provider with clear cost and capability labels:
|
|
50
45
|
|
|
51
|
-
- **Haiku 4.5** -- Fast responses at the lowest cost ($).
|
|
52
|
-
- **Sonnet 4.6** -- A balance of speed and depth ($$).
|
|
53
|
-
- **Opus 4.6** -- The most capable model ($$$).
|
|
54
|
-
- **GPT-4o-mini**
|
|
55
|
-
- **
|
|
56
|
-
|
|
57
|
-
Your preferred default model can be set in the Settings page under "Chat default model." The selection persists per conversation, so switching models mid-conversation is seamless.
|
|
46
|
+
- **Haiku 4.5** -- Fast responses at the lowest cost ($).
|
|
47
|
+
- **Sonnet 4.6** -- A balance of speed and depth ($$).
|
|
48
|
+
- **Opus 4.6** -- The most capable model ($$$).
|
|
49
|
+
- **GPT-4o-mini** / **GPT-4o** -- Available when the Codex runtime is connected.
|
|
50
|
+
- **Ollama models** -- Available when a local Ollama instance is connected ($0).
|
|
58
51
|
|
|
59
52
|
### @ Mentions and Context
|
|
60
53
|
|
|
61
|
-
Type **@** in the chat input to reference a specific project, task, workflow, document, profile, or schedule by name. An autocomplete popover appears with fuzzy-searchable results
|
|
62
|
-
|
|
63
|
-
The assistant also loads workspace context automatically in the background. Your active project, recent tasks, running workflows, and linked documents are all available to the model without any extra effort on your part.
|
|
54
|
+
Type **@** in the chat input to reference a specific project, task, workflow, document, profile, or schedule by name. An autocomplete popover appears with fuzzy-searchable results. When you select a mention, the assistant receives the full details of that entity as part of the conversation context.
|
|
64
55
|
|
|
65
56
|
### Conversation Management
|
|
66
57
|
|
|
67
|
-
Every chat starts a new conversation that is saved automatically. Your conversation history appears in the left sidebar, sorted by most recent.
|
|
68
|
-
|
|
69
|
-
On smaller screens, the conversation list is tucked behind a menu icon and slides in as an overlay so the message area gets full screen space.
|
|
58
|
+
Every chat starts a new conversation that is saved automatically. Your conversation history appears in the left sidebar, sorted by most recent. Channel conversations from Slack and Telegram also appear here, titled "Channel: [channel name]," so you can continue them from the web UI.
|
|
70
59
|
|
|
71
|
-
###
|
|
60
|
+
### Channel Conversations
|
|
72
61
|
|
|
73
|
-
When
|
|
62
|
+
When bidirectional chat is enabled on a Slack or Telegram delivery channel, messages sent to Stagent from those platforms create conversations visible in the Chat sidebar. The same chat engine handles both web and channel conversations, including tool access, permission handling, and multi-turn context.
|
|
74
63
|
|
|
75
64
|
### Streaming Responses
|
|
76
65
|
|
|
77
|
-
Responses stream in token by token with a blinking cursor
|
|
66
|
+
Responses stream in token by token with a blinking cursor. Markdown formatting -- headings, lists, code blocks with syntax highlighting, tables, and links -- renders as the text streams in. Code blocks include a copy button and language label.
|
|
78
67
|
|
|
79
68
|
## How To
|
|
80
69
|
|
|
81
70
|
### Start a New Conversation
|
|
82
71
|
|
|
83
72
|
1. Click **Chat** in the sidebar (under the Work section).
|
|
84
|
-
2. Browse the tool catalog categories or type your question in the input area
|
|
73
|
+
2. Browse the tool catalog categories or type your question in the input area.
|
|
85
74
|
3. Click a suggested prompt to insert it, or type your own message.
|
|
86
|
-
4. Press **Enter** to send. The
|
|
75
|
+
4. Press **Enter** to send. The response streams in immediately.
|
|
87
76
|
|
|
88
77
|
### Switch AI Models
|
|
89
78
|
|
|
90
|
-
1. Click the model selector to the left of the input area
|
|
91
|
-
2. Choose a different model from the dropdown. Models are labeled with cost tiers
|
|
92
|
-
3. Your next message will use the selected model.
|
|
93
|
-
|
|
94
|
-
### Reference Documents in Chat
|
|
95
|
-
|
|
96
|
-
1. In the chat input, type **@** followed by the name of a document, project, task, or other entity.
|
|
97
|
-
2. An autocomplete popover appears -- use arrow keys or click to select the entity you want.
|
|
98
|
-
3. The selected mention appears as a highlighted reference in your message.
|
|
99
|
-
4. When you send the message, the assistant receives the full context of the mentioned entity and can answer questions about it in detail.
|
|
100
|
-
|
|
101
|
-
### Navigate to Entities from Chat
|
|
102
|
-
|
|
103
|
-
1. Ask the assistant about a project, task, or other workspace item.
|
|
104
|
-
2. After the response finishes, look for the Quick Access pills at the bottom of the message.
|
|
105
|
-
3. Click a pill to navigate directly to that entity's detail page.
|
|
79
|
+
1. Click the model selector to the left of the input area.
|
|
80
|
+
2. Choose a different model from the dropdown. Models are labeled with cost tiers.
|
|
81
|
+
3. Your next message will use the selected model.
|
|
106
82
|
|
|
107
|
-
###
|
|
83
|
+
### Reference Entities in Chat
|
|
108
84
|
|
|
109
|
-
1.
|
|
110
|
-
2.
|
|
111
|
-
3.
|
|
85
|
+
1. Type **@** followed by the name of a document, project, task, or other entity.
|
|
86
|
+
2. An autocomplete popover appears -- use arrow keys or click to select.
|
|
87
|
+
3. The assistant receives the full context of the mentioned entity.
|
|
112
88
|
|
|
113
|
-
###
|
|
89
|
+
### Chat from Slack or Telegram
|
|
114
90
|
|
|
115
|
-
1.
|
|
116
|
-
2.
|
|
91
|
+
1. Configure a delivery channel with Chat mode enabled (see [Settings](./settings.md)).
|
|
92
|
+
2. Send a message to Stagent from Slack or Telegram.
|
|
93
|
+
3. The conversation appears in the Chat sidebar and can be continued from either platform.
|
|
117
94
|
|
|
118
95
|
## Related
|
|
119
96
|
|
|
120
|
-
- [Settings](./settings.md) -- Configure default chat model and
|
|
121
|
-
- [Documents](./documents.md) -- Documents the assistant can
|
|
122
|
-
- [Projects](./projects.md) -- Projects that provide context to
|
|
97
|
+
- [Settings](./settings.md) -- Configure default chat model, Ollama, and delivery channels
|
|
98
|
+
- [Documents](./documents.md) -- Documents the assistant can reference via @ mentions
|
|
99
|
+
- [Projects](./projects.md) -- Projects that provide context to conversations
|
|
123
100
|
- [Profiles](./profiles.md) -- Agent profiles that shape how the assistant responds
|
|
124
|
-
- [
|
|
101
|
+
- [Delivery Channels](./delivery-channels.md) -- Bidirectional Slack and Telegram integration
|
|
@@ -3,21 +3,24 @@ title: "Cost & Usage"
|
|
|
3
3
|
category: "feature-reference"
|
|
4
4
|
section: "cost-usage"
|
|
5
5
|
route: "/costs"
|
|
6
|
-
tags: [costs, usage, budget, metering, tokens, spend, guardrails]
|
|
6
|
+
tags: [costs, usage, budget, metering, tokens, spend, guardrails, ollama]
|
|
7
7
|
features: ["cost-and-usage-dashboard", "usage-metering-ledger", "spend-budget-guardrails"]
|
|
8
|
-
screengrabCount:
|
|
9
|
-
lastUpdated: "2026-03-
|
|
8
|
+
screengrabCount: 2
|
|
9
|
+
lastUpdated: "2026-03-31"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# Cost & Usage
|
|
13
13
|
|
|
14
|
-
Track spend across providers and monitor token consumption with the cost and usage dashboard. The usage metering ledger records every token used by task, project, and provider, while budget guardrails enforce configurable spend caps to prevent runaway costs. Visual meters give you an at-a-glance view of current spend versus your configured budget.
|
|
14
|
+
Track spend across providers and monitor token consumption with the cost and usage dashboard. The usage metering ledger records every token used by task, project, and provider, while budget guardrails enforce configurable spend caps to prevent runaway costs. Visual meters give you an at-a-glance view of current spend versus your configured budget. Tasks executed via Ollama (local models) are tracked at $0.
|
|
15
15
|
|
|
16
16
|
## Screenshots
|
|
17
17
|
|
|
18
18
|

|
|
19
19
|
*The cost and usage dashboard showing spend metrics, provider breakdown, and budget pacing indicators.*
|
|
20
20
|
|
|
21
|
+

|
|
22
|
+
*Detailed usage table and cost trends below the summary cards.*
|
|
23
|
+
|
|
21
24
|
## Key Features
|
|
22
25
|
|
|
23
26
|
### Spend Dashboard
|
|
@@ -27,10 +30,10 @@ The cost dashboard provides an overview of total spend across all provider runti
|
|
|
27
30
|
Every agent execution records token consumption in the usage ledger. The ledger tracks input tokens, output tokens, and total tokens broken down by individual task, parent project, and provider runtime. This granular data enables precise cost attribution and optimization.
|
|
28
31
|
|
|
29
32
|
### Provider Breakdown
|
|
30
|
-
Spend is segmented by provider runtime, showing separate cost totals for Claude (Agent SDK
|
|
33
|
+
Spend is segmented by provider runtime, showing separate cost totals for Claude (Agent SDK and Direct API), Codex (App Server and Direct API), and Ollama ($0 local). The breakdown helps you understand which provider is driving costs and make informed decisions about runtime selection.
|
|
31
34
|
|
|
32
35
|
### Budget Guardrails
|
|
33
|
-
Configure spend caps to prevent unexpected cost overruns. Set an overall budget limit and monthly allocation splits. When spend approaches the cap, alerts notify you before the limit is reached. Once the cap is hit, guardrails
|
|
36
|
+
Configure spend caps to prevent unexpected cost overruns. Set an overall budget limit and monthly allocation splits. When spend approaches the cap, alerts notify you before the limit is reached. Once the cap is hit, guardrails pause new executions to prevent further charges.
|
|
34
37
|
|
|
35
38
|
### Visual Budget Meters
|
|
36
39
|
Progress bars and visual meters display current spend relative to your configured budget. Color-coded indicators shift from green to yellow to red as spend approaches the cap, providing immediate visual feedback on budget health.
|
|
@@ -38,9 +41,9 @@ Progress bars and visual meters display current spend relative to your configure
|
|
|
38
41
|
## How To
|
|
39
42
|
|
|
40
43
|
### Review Current Spend
|
|
41
|
-
1. Navigate to `/costs` from the sidebar under the **
|
|
44
|
+
1. Navigate to `/costs` from the sidebar under the **Manage** group.
|
|
42
45
|
2. View the total spend summary at the top of the dashboard.
|
|
43
|
-
3. Check the provider breakdown to see
|
|
46
|
+
3. Check the provider breakdown to see spend by runtime.
|
|
44
47
|
4. Review the visual meters for budget pacing.
|
|
45
48
|
|
|
46
49
|
### Set a Budget Cap
|
|
@@ -52,10 +55,11 @@ Progress bars and visual meters display current spend relative to your configure
|
|
|
52
55
|
### Investigate High Spend
|
|
53
56
|
1. Open the cost dashboard at `/costs`.
|
|
54
57
|
2. Identify which provider or project is contributing the most spend.
|
|
55
|
-
3.
|
|
56
|
-
4. Consider switching to
|
|
58
|
+
3. Scroll down to the usage breakdown table for granular task-level data.
|
|
59
|
+
4. Consider switching to Ollama (local models) for tasks that do not require cloud-level capability, or adjust task prompts to reduce token usage.
|
|
57
60
|
|
|
58
61
|
## Related
|
|
59
62
|
- [Settings](./settings.md)
|
|
60
63
|
- [Monitoring](./monitoring.md)
|
|
61
64
|
- [Schedules](./schedules.md)
|
|
65
|
+
- [Provider Runtimes](./provider-runtimes.md)
|