stagent 0.4.0 โ†’ 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +59 -23
  2. package/dist/cli.js +5 -0
  3. package/docs/.last-generated +1 -1
  4. package/docs/features/chat.md +54 -49
  5. package/docs/features/schedules.md +38 -32
  6. package/docs/features/settings.md +105 -50
  7. package/docs/manifest.json +8 -8
  8. package/docs/superpowers/specs/2026-03-27-chat-screenshot-display-design.md +303 -0
  9. package/package.json +3 -1
  10. package/src/app/api/chat/conversations/[id]/messages/route.ts +3 -2
  11. package/src/app/api/chat/entities/search/route.ts +97 -0
  12. package/src/app/api/documents/[id]/file/route.ts +4 -1
  13. package/src/app/api/projects/[id]/route.ts +119 -9
  14. package/src/app/api/projects/__tests__/delete-project.test.ts +170 -0
  15. package/src/app/api/settings/browser-tools/route.ts +68 -0
  16. package/src/app/settings/page.tsx +2 -0
  17. package/src/components/chat/chat-command-popover.tsx +277 -0
  18. package/src/components/chat/chat-input.tsx +85 -10
  19. package/src/components/chat/chat-message.tsx +9 -3
  20. package/src/components/chat/chat-shell.tsx +29 -5
  21. package/src/components/chat/screenshot-gallery.tsx +96 -0
  22. package/src/components/monitoring/log-entry.tsx +61 -27
  23. package/src/components/projects/project-detail.tsx +15 -2
  24. package/src/components/schedules/schedule-create-sheet.tsx +24 -330
  25. package/src/components/schedules/schedule-detail-sheet.tsx +37 -21
  26. package/src/components/schedules/schedule-edit-sheet.tsx +159 -0
  27. package/src/components/schedules/schedule-form.tsx +410 -0
  28. package/src/components/schedules/schedule-list.tsx +16 -0
  29. package/src/components/settings/browser-tools-section.tsx +247 -0
  30. package/src/components/settings/runtime-timeout-section.tsx +4 -4
  31. package/src/components/shared/command-palette.tsx +1 -30
  32. package/src/components/shared/screenshot-lightbox.tsx +151 -0
  33. package/src/hooks/use-caret-position.ts +104 -0
  34. package/src/hooks/use-chat-autocomplete.ts +290 -0
  35. package/src/lib/agents/__tests__/browser-mcp.test.ts +175 -0
  36. package/src/lib/agents/__tests__/claude-agent.test.ts +3 -0
  37. package/src/lib/agents/browser-mcp.ts +119 -0
  38. package/src/lib/agents/claude-agent.ts +66 -8
  39. package/src/lib/chat/command-data.ts +50 -0
  40. package/src/lib/chat/context-builder.ts +127 -3
  41. package/src/lib/chat/engine.ts +92 -11
  42. package/src/lib/chat/slash-commands.ts +191 -0
  43. package/src/lib/chat/tool-catalog.ts +185 -0
  44. package/src/lib/chat/tools/document-tools.ts +37 -0
  45. package/src/lib/chat/types.ts +11 -1
  46. package/src/lib/constants/settings.ts +4 -0
  47. package/src/lib/data/clear.ts +16 -4
  48. package/src/lib/db/bootstrap.ts +5 -0
  49. package/src/lib/db/migrations/0012_add_screenshot_columns.sql +5 -0
  50. package/src/lib/db/schema.ts +5 -0
  51. package/src/lib/screenshots/__tests__/persist.test.ts +104 -0
  52. package/src/lib/screenshots/persist.ts +114 -0
  53. package/src/lib/utils/stagent-paths.ts +4 -0
package/README.md CHANGED
@@ -58,7 +58,7 @@ Stagent ships a shared runtime registry that routes tasks, schedules, and workfl
58
58
  | โฐ | **[Schedules](#schedules)** | Recurring and one-shot automations with cadence, expiry, and firing controls |
59
59
  | ๐Ÿ“„ | **[Documents](#document-management)** | Upload, preprocess, inspect, and link files to tasks and projects |
60
60
  | ๐Ÿ“ฅ | **[Human-in-the-Loop Inbox](#inbox--human-in-the-loop)** | Approve tool use, answer questions, and review results from one queue |
61
- | ๐Ÿ’ฌ | **[Chat](#chat)** | Conversational AI with model selection, suggested prompts, and entity-aware responses |
61
+ | ๐Ÿ’ฌ | **[Chat](#chat)** | Tool catalog with model selection, @ mentions, slash commands, and browser automation |
62
62
  | ๐Ÿ‘€ | **[Monitoring](#monitoring)** | Live runtime visibility with log streaming, filters, and health signals |
63
63
  | ๐Ÿ” | **[Provider Runtimes](#provider-runtimes)** | Shared runtime layer with Claude Code and OpenAI Codex App Server adapters |
64
64
  | ๐Ÿงช | **[Parallel + Swarm Workflows](#parallel--swarm-workflows)** | Bounded fork/join and swarm orchestration without a free-form graph editor |
@@ -74,6 +74,8 @@ Stagent ships a shared runtime registry that routes tasks, schedules, and workfl
74
74
  | โŒจ๏ธ | **[Command Palette](#command-palette)** | Global `โŒ˜K` search for fast navigation across tasks, projects, workflows, and settings |
75
75
  | ๐Ÿ“– | **[Playbook](#playbook)** | Built-in documentation with usage-stage awareness, adoption heatmap, and guided learning journeys |
76
76
  | ๐Ÿ“š | **[Living Book](#living-book)** | AI-native book reader with 9 chapters, agent-powered regeneration, staleness detection, and reading paths |
77
+ | ๐ŸŒ | **[Environment](#environment)** | Control plane for Claude Code and Codex CLI environments with scanning, caching, sync, and templates |
78
+ | ๐Ÿ”ง | **[Browser Tools](#browser-tools)** | Chrome DevTools and Playwright MCP integration for browser automation in chat and task execution |
77
79
 
78
80
  ---
79
81
 
@@ -218,6 +220,28 @@ AI-native book reader at `/book` with 9 chapters across 3 parts (Foundation, Int
218
220
  - **Try It Now** โ€” each chapter links to related Playbook feature docs and user journeys
219
221
  - **Author's Notes** โ€” collapsible callout blocks with behind-the-scenes commentary
220
222
 
223
+ ### Environment
224
+
225
+ #### Environment
226
+ Stagent doubles as a **control plane for AI coding environments** โ€” scanning, caching, and syncing configuration for Claude Code and Codex CLI across projects. The environment dashboard surfaces detected tools, active configurations, git checkpoint status, and health scores.
227
+
228
+ - **Environment Scanner** โ€” detects Claude Code and Codex CLI configurations, MCP servers, skills, and project settings
229
+ - **Environment Cache** โ€” persists scanned state for fast dashboard rendering without re-scanning
230
+ - **Environment Dashboard** โ€” unified view of all detected environments with health indicators
231
+ - **Git Checkpoint Manager** โ€” tracks environment state via git commits for rollback and comparison
232
+ - **Environment Sync Engine** โ€” bidirectional sync between local config and cached state
233
+ - **Project Onboarding** โ€” guided flow for setting up new projects with environment-aware defaults
234
+ - **Environment Templates** โ€” reusable environment configurations for common project types
235
+ - **Cross-Project Comparison** โ€” compare environment settings across projects
236
+ - **Skill Portfolio** โ€” aggregate view of skills across all detected environments
237
+ - **Environment Health Scoring** โ€” composite health score based on configuration completeness and freshness
238
+ - **Agent Profile from Environment** โ€” auto-generate agent profiles from detected environment capabilities
239
+
240
+ <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/environment-list.png" alt="Stagent environment dashboard" width="1200" />
241
+
242
+ #### Browser Tools
243
+ Enable browser automation in chat and task execution through two MCP integrations: **Chrome DevTools MCP** (29 tools for connecting to a running Chrome instance via CDP) and **Playwright MCP** (50+ tools for headless browser automation). Configure both from Settings with independent toggles and permission tiering โ€” read-only operations auto-approve while mutations are gated through the inbox approval flow.
244
+
221
245
  ### Platform
222
246
 
223
247
  #### Tool Permission Persistence
@@ -254,13 +278,13 @@ When an agent needs approval or input, a notification appears in your inbox. Rev
254
278
  | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/inbox-expanded.png" alt="Inbox notification expanded" width="580" /> |
255
279
 
256
280
  #### Chat
257
- Conversational control plane for all workspace primitives โ€” projects, tasks, workflows, documents, and profiles are all reachable from the chat surface. Progressive 5-tier context injection (~53K token budget) builds workspace awareness from lightweight summaries up to full document content. Multi-provider model selection with cost tiers ($, $$, $$$) spans Claude Haiku through Opus and GPT-5.x models, with a Settings-level default preference. Claude.ai-style tabbed suggested prompts (Explore, Create, Analyze) with hover preview help new users discover workspace capabilities. Quick Access navigation pills in responses provide entity deep-linking โ€” click a mentioned project or task to jump directly to its detail view. Stagent CRUD tools let you create, update, and delete projects, tasks, and workflows through natural language. Streaming responses render in real time with full markdown support.
281
+ Conversational control plane for all workspace primitives โ€” projects, tasks, workflows, documents, and profiles are all reachable from the chat surface. The chat interface is organized as a **tool catalog** with five categories (Explore, Create, Debug, Automate, Smart Picks) that help discover workspace capabilities. Progressive 5-tier context injection (~53K token budget) builds workspace awareness from lightweight summaries up to full document content. **@ mentions** let you reference documents and entities directly in prompts with fuzzy search autocomplete, injecting their content as context. **Slash commands** (`/`) provide quick access to tools and actions. Multi-provider model selection with cost tiers ($, $$, $$$) spans Claude Haiku through Opus and GPT-5.x models. Browser automation via Chrome DevTools and Playwright MCP enables screenshot capture and web interaction from chat. Quick Access navigation pills in responses provide entity deep-linking. Stagent CRUD tools let you create, update, and delete workspace entities through natural language.
258
282
 
259
- <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/chat-conversation.png" alt="Stagent chat conversation with Quick Access navigation pills" width="1200" />
283
+ <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/chat-conversation.png" alt="Stagent chat conversation with @ document context" width="1200" />
260
284
 
261
- | Empty State & Suggested Prompts | Model Selector | Quick Access Pills |
285
+ | Tool Catalog | Model Selector | Create Tab |
262
286
  |:-:|:-:|:-:|
263
- | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/chat-list.png" alt="Chat empty state with suggested prompts" width="380" /> | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/chat-model-selector.png" alt="Chat model selector with cost tiers" width="380" /> | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/chat-quick-access.png" alt="Chat Quick Access navigation pills" width="380" /> |
287
+ | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/chat-list.png" alt="Chat tool catalog with category tabs" width="380" /> | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/chat-model-selector.png" alt="Chat model selector with cost tiers" width="380" /> | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/chat-create-tab.png" alt="Chat Create category prompts" width="380" /> |
264
288
 
265
289
  #### Monitoring
266
290
  Real-time agent log streaming via Server-Sent Events. Filter by task or event type, click entries to jump to task details, and auto-pause polling when the tab is hidden (Page Visibility API).
@@ -271,19 +295,19 @@ Real-time agent log streaming via Server-Sent Events. Filter by task or event ty
271
295
  File upload with drag-and-drop in task creation. Type-aware content preview for text, markdown (via react-markdown), code, and JSON. Copy-to-clipboard and download-as-file for task outputs.
272
296
 
273
297
  #### Settings
274
- Configuration hub with provider-aware sections: Claude authentication (API key or OAuth), OpenAI Codex runtime API-key management, tool permissions (saved "Always Allow" patterns with revoke), permission presets, budget configuration, and data management.
298
+ Configuration hub with provider-aware sections: Claude authentication (API key or OAuth), OpenAI Codex runtime API-key management, chat defaults (model selection), **browser tools** (Chrome DevTools and Playwright MCP toggles), runtime configuration (SDK timeout and max turns), tool permissions (saved "Always Allow" patterns with revoke), permission presets, budget guardrails, and data management.
275
299
 
276
300
  <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/settings-list.png" alt="Stagent settings" width="1200" />
277
301
 
278
- | Permission Presets | Budget Configuration | Data Management |
302
+ | Browser Tools | Permission Presets | Budget Configuration |
279
303
  |:-:|:-:|:-:|
280
- | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/settings-presets.png" alt="Tool permission presets" width="380" /> | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/settings-budget.png" alt="Budget configuration" width="380" /> | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/settings-data.png" alt="Data management" width="380" /> |
304
+ | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/settings-browser-tools.png" alt="Browser tools MCP toggles" width="380" /> | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/settings-presets.png" alt="Tool permission presets" width="380" /> | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/settings-budget.png" alt="Budget configuration" width="380" /> |
281
305
 
282
306
  #### CLI
283
307
  The `npx stagent` entry point boots a Next.js server from the published npm package. It is built from `bin/cli.ts` into `dist/cli.js` using tsup, and serves as the primary distribution channel โ€” no clone required.
284
308
 
285
309
  #### Database
286
- SQLite with WAL mode via better-sqlite3 + Drizzle ORM. Twelve tables: `projects`, `tasks`, `workflows`, `agent_logs`, `notifications`, `documents`, `schedules`, `settings`, `learned_context`, `usage_ledger`, `conversations`, `chat_messages`. Self-healing bootstrap โ€” tables are created on startup if missing.
310
+ SQLite with WAL mode via better-sqlite3 + Drizzle ORM. Fourteen tables: `projects`, `tasks`, `workflows`, `agent_logs`, `notifications`, `documents`, `schedules`, `settings`, `learned_context`, `usage_ledger`, `conversations`, `chat_messages`, `environments`, `environment_configs`. Self-healing bootstrap โ€” tables are created on startup if missing.
287
311
 
288
312
  #### Command Palette
289
313
  Global `โŒ˜K` command palette for fast navigation and search across tasks, projects, workflows, and settings. Recent items, fuzzy search, and keyboard-driven navigation.
@@ -293,7 +317,7 @@ Global `โŒ˜K` command palette for fast navigation and search across tasks, proje
293
317
  | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/command-palette-empty.png" alt="Command palette empty state" width="580" /> | <img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/command-palette-search.png" alt="Command palette search results" width="580" /> |
294
318
 
295
319
  #### App Shell
296
- Responsive sidebar with collapsible icon-only mode, custom Stagent logo, tooltip navigation, dark/light/system theme, and OKLCH hue 250 blue-indigo color palette. Built on shadcn/ui (New York style) with PWA manifest and app icons. Routes: Home, Dashboard, Inbox, Chat, Monitor, Projects, Workflows, Documents, Profiles, Schedules, Cost & Usage, Playbook, Settings.
320
+ Responsive sidebar with collapsible icon-only mode, custom Stagent logo, tooltip navigation, dark/light/system theme, and OKLCH hue 250 blue-indigo color palette. Built on shadcn/ui (New York style) with PWA manifest and app icons. Routes: Home, Dashboard, Inbox, Chat, Projects, Workflows, Documents, Monitor, Profiles, Schedules, Cost & Usage, AI Native Book, User Guide, Environment, Settings.
297
321
 
298
322
  #### E2E Test Automation
299
323
  API-level end-to-end test suite built on Vitest with 120-second timeouts and sequential execution. Five test files cover single-task execution, sequence workflows, parallel workflows, blueprints, and cross-runtime scenarios across both Claude and Codex backends. Tests skip gracefully when runtimes are not configured, preventing CI failures. Run with `npm run test:e2e`.
@@ -343,7 +367,9 @@ src/
343
367
  โ”‚ โ”œโ”€โ”€ schedules/ # Schedule management
344
368
  โ”‚ โ”œโ”€โ”€ costs/ # Cost & usage dashboard
345
369
  โ”‚ โ”œโ”€โ”€ playbook/ # Documentation & learning journeys
346
- โ”‚ โ”œโ”€โ”€ chat/ # Conversational AI
370
+ โ”‚ โ”œโ”€โ”€ chat/ # Conversational AI (tool catalog)
371
+ โ”‚ โ”œโ”€โ”€ book/ # AI Native Book reader
372
+ โ”‚ โ”œโ”€โ”€ environment/ # Environment control plane
347
373
  โ”‚ โ”œโ”€โ”€ inbox/ # Notifications
348
374
  โ”‚ โ”œโ”€โ”€ monitor/ # Log streaming
349
375
  โ”‚ โ””โ”€โ”€ settings/ # Configuration
@@ -357,9 +383,11 @@ src/
357
383
  โ”‚ โ”œโ”€โ”€ playbook/ # Playbook docs + journeys + adoption
358
384
  โ”‚ โ”œโ”€โ”€ schedules/ # Schedule management
359
385
  โ”‚ โ”œโ”€โ”€ monitoring/ # Log viewer
360
- โ”‚ โ”œโ”€โ”€ chat/ # Chat shell, messages, input composer
386
+ โ”‚ โ”œโ”€โ”€ chat/ # Chat shell, messages, input composer, tool catalog
387
+ โ”‚ โ”œโ”€โ”€ book/ # Book reader, chapters, reading paths
388
+ โ”‚ โ”œโ”€โ”€ environment/ # Environment dashboard, scanner, templates
361
389
  โ”‚ โ”œโ”€โ”€ notifications/ # Inbox + permission actions
362
- โ”‚ โ”œโ”€โ”€ settings/ # Auth, permissions, budgets, data mgmt
390
+ โ”‚ โ”œโ”€โ”€ settings/ # Auth, permissions, budgets, browser tools, data mgmt
363
391
  โ”‚ โ”œโ”€โ”€ shared/ # App shell, sidebar
364
392
  โ”‚ โ””โ”€โ”€ ui/ # shadcn/ui primitives
365
393
  โ””โ”€โ”€ lib/
@@ -454,24 +482,32 @@ All 14 features shipped across three layers:
454
482
  | **Core** | Project management, task board, agent integration, inbox notifications, monitoring dashboard |
455
483
  | **Polish** | Homepage dashboard, UX fixes, workflow engine, AI task assist, content handling, session management |
456
484
 
457
- ### Post-MVP โ€” 37 features shipped
485
+ ### Post-MVP โ€” 52 features shipped
458
486
 
459
487
  | Category | Features |
460
488
  |----------|---------|
461
489
  | **Documents** (5) | File attachments, preprocessing (5 formats), agent context injection, document browser, output generation |
462
490
  | **Agent Intelligence** (6) | Multi-agent routing, autonomous loops, multi-agent swarm, AI assistโ†’workflows, agent self-improvement, workflow context batching |
463
- | **Agent Profiles** (2) | Agent profile catalog (13+ profiles), workflow blueprints (8 templates) |
464
- | **UI Enhancement** (13) | Ambient approvals, learned context UX, micro-visualizations, command palette, operational surface, profile surface, accessibility, UI density, kanban operations, board persistence, detail view redesign, playbook documentation, workflow UX overhaul (in-progress) |
491
+ | **Agent Profiles** (2) | Agent profile catalog (21 profiles), workflow blueprints (8 templates) |
492
+ | **UI Enhancement** (13) | Ambient approvals, learned context UX, micro-visualizations, command palette, operational surface, profile surface, accessibility, UI density, kanban operations, board persistence, detail view redesign, playbook documentation, workflow UX overhaul |
465
493
  | **Platform** (8) | Scheduled prompt loops, tool permissions, provider runtimes, OpenAI Codex runtime, cross-provider profiles, parallel fork/join, tool permission presets, npm publish (deferred) |
466
494
  | **Runtime Quality** (2) | SDK runtime hardening, E2E test automation |
467
495
  | **Governance** (3) | Usage metering ledger, spend budget guardrails, cost & usage dashboard |
468
- | **Chat** (6) | Chat data layer, chat engine (5-tier context, CRUD tools), API routes (SSE streaming), UI shell, message rendering (Quick Access pills), input composer (model selector, suggested prompts) |
469
-
470
- ### In Progress
471
-
472
- | Feature | Description |
473
- |---------|-------------|
474
- | Workflow UX Overhaul | Document context propagation, output readability, dashboard visibility, AI assist guidance |
496
+ | **Chat** (6) | Chat data layer, chat engine (5-tier context, CRUD tools), API routes (SSE streaming), UI shell, message rendering (Quick Access pills), input composer (tool catalog, model selector) |
497
+ | **Environment** (11) | Environment scanner, cache, dashboard, git checkpoint manager, sync engine, project onboarding, templates, cross-project comparison, skill portfolio, health scoring, agent profile from environment |
498
+ | **Living Book** (5) | Content merge (chapters โ†’ playbook), author's notes, reading paths, markdown pipeline, self-updating chapters |
499
+
500
+ ### Planned
501
+
502
+ | Feature | Priority | Description |
503
+ |---------|----------|-------------|
504
+ | Browser Use | P1 | Chrome DevTools + Playwright MCP integration for browser automation |
505
+ | Workspace Context Awareness | P1 | Surface cwd, git branch, worktree status to chat agents |
506
+ | Chat Command Mentions | P1 | Slash commands for tools/actions + @ entity mentions |
507
+ | Task Hierarchy Clarity | P1 | Distinguish standalone vs workflow-bound tasks |
508
+ | Chat Conversation Persistence | P1 | URL/localStorage persistence for active conversations |
509
+ | Settings Interactive Controls | P2 | Slider upgrades for SDK Timeout and Max Turns |
510
+ | Agent Document API Access | P2 | MCP-based document tools for agent consumption |
475
511
 
476
512
  ---
477
513
 
package/dist/cli.js CHANGED
@@ -321,6 +321,11 @@ function bootstrapStagentDatabase(sqlite2) {
321
321
  addColumnIfMissing(`ALTER TABLE projects ADD COLUMN working_directory TEXT;`);
322
322
  addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN assigned_agent TEXT;`);
323
323
  addColumnIfMissing(`ALTER TABLE documents ADD COLUMN version INTEGER NOT NULL DEFAULT 1;`);
324
+ addColumnIfMissing(`ALTER TABLE documents ADD COLUMN source TEXT DEFAULT 'upload';`);
325
+ addColumnIfMissing(`ALTER TABLE documents ADD COLUMN conversation_id TEXT REFERENCES conversations(id);`);
326
+ addColumnIfMissing(`ALTER TABLE documents ADD COLUMN message_id TEXT;`);
327
+ sqlite2.exec(`CREATE INDEX IF NOT EXISTS idx_documents_source ON documents(source);`);
328
+ sqlite2.exec(`CREATE INDEX IF NOT EXISTS idx_documents_conversation_id ON documents(conversation_id);`);
324
329
  sqlite2.exec(`
325
330
  CREATE TABLE IF NOT EXISTS environment_scans (
326
331
  id TEXT PRIMARY KEY NOT NULL,
@@ -1 +1 @@
1
- 2026-03-22T20:46:49Z
1
+ 2026-03-28T00:33:25Z
@@ -3,100 +3,105 @@ title: "Chat"
3
3
  category: "feature-reference"
4
4
  section: "chat"
5
5
  route: "/chat"
6
- tags: ["chat", "conversations", "ai", "model-selection", "suggested-prompts", "quick-access", "streaming"]
6
+ tags: ["chat", "conversation", "ai", "tool-catalog", "mentions"]
7
7
  features: ["chat-data-layer", "chat-engine", "chat-api-routes", "chat-ui-shell", "chat-message-rendering", "chat-input-composer"]
8
8
  screengrabCount: 5
9
- lastUpdated: "2026-03-22"
9
+ lastUpdated: "2026-03-27"
10
10
  ---
11
11
 
12
12
  # Chat
13
13
 
14
- The Chat page is your conversational AI interface for managing and exploring your Stagent workspace. Ask questions about your projects, tasks, workflows, and documents โ€” the assistant understands your setup and responds with context-aware answers, complete with direct links to the entities it 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.
15
15
 
16
16
  ## Screenshots
17
17
 
18
- ![Chat empty state](../screengrabs/chat-list.png)
19
- *Empty state with hero heading, suggested prompt categories, and conversation sidebar*
20
-
21
- ![Active conversation](../screengrabs/chat-conversation.png)
22
- *Active conversation showing streamed responses with Quick Access navigation pills*
18
+ ![Chat tool catalog](../screengrabs/chat-list.png)
19
+ *Tool catalog with hero heading, category tabs (Explore / Create / Debug / Automate), Smart Picks row, and conversation sidebar*
23
20
 
24
21
  ![Model selector](../screengrabs/chat-model-selector.png)
25
- *Model selector dropdown showing available models grouped by provider with cost tiers*
22
+ *Model selector dropdown showing Claude and Codex models organized by provider with cost tiers*
26
23
 
27
- ![Suggested prompts โ€” Create tab](../screengrabs/chat-create-tab.png)
28
- *Suggested prompts with the Create tab selected, showing context-aware prompt suggestions*
24
+ ![Create category tab](../screengrabs/chat-create-tab.png)
25
+ *Create category selected, showing prompts for spinning up tasks, workflows, and projects*
29
26
 
30
- ![Quick Access pills](../screengrabs/chat-quick-access.png)
31
- *Quick Access navigation pill linking directly to a mentioned task*
27
+ ![Active conversation](../screengrabs/chat-conversation.png)
28
+ *Active conversation with @ document context injected and streamed response with formatted markdown*
29
+
30
+ ![Quick Access navigation](../screengrabs/chat-quick-access.png)
31
+ *Response content with Quick Access navigation pills linking directly to mentioned entities*
32
32
 
33
33
  ## Key Features
34
34
 
35
- ### Conversations
35
+ ### Tool Catalog
36
36
 
37
- Every chat starts a new conversation that is saved automatically. Your conversation history appears in the left sidebar, sorted by most recent. Click any past conversation to pick up where you left off. You can rename, archive, or delete conversations from the context menu.
37
+ When no conversation is active, the chat page displays a curated grid of suggested prompts organized into tabbed categories:
38
38
 
39
- On mobile and tablet, the conversation list is tucked behind a menu icon and slides in as an overlay so the message area gets full screen space.
39
+ - **Explore** -- Questions about your workspace: project statuses, task summaries, schedule overviews.
40
+ - **Create** -- Prompts that help you spin up new tasks, workflows, projects, and schedules.
41
+ - **Debug** -- Investigate failed tasks, review agent logs, and diagnose workflow issues.
42
+ - **Automate** -- Set up scheduled loops, bulk operations, and repeating workflows.
43
+ - **Smart Picks** -- A personalized row of suggestions generated from your actual workspace data. If you have a recently failed task, a prompt like "Why did [task name] fail?" appears automatically.
44
+
45
+ Click any suggestion to insert it into the input and start a conversation instantly.
40
46
 
41
47
  ### Model Selection
42
48
 
43
- Choose which AI model powers your conversation using the model selector at the bottom of the input area. Models are grouped by provider with clear cost and capability labels:
49
+ 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:
44
50
 
45
- - **Haiku 4.5** โ€” Fast responses at the lowest cost ($). The default choice for everyday questions.
46
- - **Sonnet 4.6** โ€” A balance of speed and depth ($$). Good for nuanced analysis.
47
- - **Opus 4.6** โ€” The most capable model ($$$). Best for complex reasoning and detailed answers.
48
- - **GPT-4o-mini** โ€” Fast alternative ($). Available when the Codex runtime is connected.
49
- - **GPT-4o** โ€” Balanced alternative ($$). Available when the Codex runtime is connected.
51
+ - **Haiku 4.5** -- Fast responses at the lowest cost ($). The default choice for everyday questions.
52
+ - **Sonnet 4.6** -- A balance of speed and depth ($$). Good for nuanced analysis.
53
+ - **Opus 4.6** -- The most capable model ($$$). Best for complex reasoning and detailed answers.
54
+ - **GPT-4o-mini** -- Fast alternative ($). Available when the Codex runtime is connected.
55
+ - **GPT-4o** -- Balanced alternative ($$). Available when the Codex runtime is connected.
50
56
 
51
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.
52
58
 
53
- ### Suggested Prompts
59
+ ### @ Mentions and Context
54
60
 
55
- When you open Chat with no active conversation, the hero area displays a grid of suggested prompts organized into tabbed categories. These prompts are generated from your actual workspace data:
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 grouped by entity type. When you select a mention, the assistant receives the full details of that entity as part of the conversation context -- so it can give precise, informed answers without you having to copy-paste information.
56
62
 
57
- - **Project-aware** โ€” "What's the status of [your project name]?"
58
- - **Task-aware** โ€” "Why did [a recently failed task] fail?"
59
- - **Document-aware** โ€” "Summarize [a recent document]"
60
- - **System** โ€” "What can you help me with?"
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.
61
64
 
62
- Click any suggestion to insert it into the input and start a conversation instantly.
65
+ ### Conversation Management
63
66
 
64
- ### Quick Access Navigation Pills
67
+ Every chat starts a new conversation that is saved automatically. Your conversation history appears in the left sidebar, sorted by most recent. Click any past conversation to pick up where you left off. You can rename, archive, or delete conversations from the context menu.
65
68
 
66
- When the assistant mentions a project, task, workflow, document, or schedule in its response, navigation pills appear at the bottom of the message bubble after streaming completes. Each pill shows an icon and label โ€” click it to jump directly to that entity's page. This turns the chat into a workspace control plane: ask a question, then navigate to the relevant item in one click.
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.
67
70
 
68
- ### Entity Management via Chat
71
+ ### Quick Access Navigation
69
72
 
70
- The assistant understands your Stagent workspace โ€” your projects, tasks, workflows, documents, and schedules. You can ask about statuses, request summaries, or get recommendations, and the assistant draws from your actual data to answer. The progressive context system loads relevant workspace information automatically so you don't need to explain your setup.
73
+ When the assistant mentions a project, task, workflow, document, or schedule in its response, navigation pills appear at the bottom of the message bubble after the response completes. Each pill shows an icon and label -- click it to jump directly to that entity's page. This turns the chat into a workspace control plane: ask a question, then navigate to the relevant item in one click.
71
74
 
72
75
  ### Streaming Responses
73
76
 
74
- Responses stream in token by token with a blinking cursor, so you see the answer forming in real time. A "Thinking..." indicator appears before the first token arrives. 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 for easy reference.
77
+ Responses stream in token by token with a blinking cursor, so you see the answer forming in real time. A "Thinking..." indicator appears before the first token arrives. 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 for easy reference.
75
78
 
76
79
  ## How To
77
80
 
78
- ### Start a Conversation
81
+ ### Start a New Conversation
79
82
 
80
83
  1. Click **Chat** in the sidebar (under the Work section).
81
- 2. Type your question in the input area at the bottom, or click a suggested prompt.
82
- 3. Press **Enter** to send. The assistant's response streams in immediately.
84
+ 2. Browse the tool catalog categories or type your question in the input area at the bottom.
85
+ 3. Click a suggested prompt to insert it, or type your own message.
86
+ 4. Press **Enter** to send. The assistant's response streams in immediately.
83
87
 
84
- ### Switch Models
88
+ ### Switch AI Models
85
89
 
86
- 1. Click the model selector to the left of the input area (it shows the current model name).
90
+ 1. Click the model selector to the left of the input area (it shows the current model name and cost tier).
87
91
  2. Choose a different model from the dropdown. Models are labeled with cost tiers ($, $$, $$$).
88
92
  3. Your next message will use the selected model. The choice is saved for this conversation.
89
93
 
90
- ### Use Suggested Prompts
94
+ ### Reference Documents in Chat
91
95
 
92
- 1. On the Chat page with no active conversation, browse the suggested prompt categories.
93
- 2. Click a prompt to insert it into the input area.
94
- 3. Edit the prompt text if needed, then press **Enter** to send.
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.
95
100
 
96
101
  ### Navigate to Entities from Chat
97
102
 
98
103
  1. Ask the assistant about a project, task, or other workspace item.
99
- 2. After the response finishes streaming, look for the Quick Access pills at the bottom of the message.
104
+ 2. After the response finishes, look for the Quick Access pills at the bottom of the message.
100
105
  3. Click a pill to navigate directly to that entity's detail page.
101
106
 
102
107
  ### Manage Conversations
@@ -112,8 +117,8 @@ Responses stream in token by token with a blinking cursor, so you see the answer
112
117
 
113
118
  ## Related
114
119
 
115
- - [Dashboard Kanban](./dashboard-kanban.md) โ€” manage the tasks your chat assistant references
116
- - [Profiles](./profiles.md) โ€” agent profiles that shape task execution behavior
117
- - [Projects](./projects.md) โ€” the projects that provide context to your chat conversations
118
- - [Documents](./documents.md) โ€” documents the assistant can summarize and reference
119
- - [Settings](./settings.md) โ€” configure your default chat model and other preferences
120
+ - [Settings](./settings.md) -- Configure default chat model and browser tools
121
+ - [Documents](./documents.md) -- Documents the assistant can summarize and reference via @ mentions
122
+ - [Projects](./projects.md) -- Projects that provide context to your chat conversations
123
+ - [Profiles](./profiles.md) -- Agent profiles that shape how the assistant responds
124
+ - [Dashboard Kanban](./dashboard-kanban.md) -- Manage the tasks your chat assistant references
@@ -3,66 +3,72 @@ title: "Schedules"
3
3
  category: "feature-reference"
4
4
  section: "schedules"
5
5
  route: "/schedules"
6
- tags: [schedules, automation, loops, recurring, intervals, autonomous]
7
- features: ["scheduled-prompt-loops", "autonomous-loop-execution"]
8
- screengrabCount: 1
9
- lastUpdated: "2026-03-21"
6
+ tags: ["schedules", "automation", "recurring", "prompts"]
7
+ features: ["scheduled-prompt-loops"]
8
+ screengrabCount: 3
9
+ lastUpdated: "2026-03-27"
10
10
  ---
11
11
 
12
12
  # Schedules
13
13
 
14
- Schedule recurring agent tasks with configurable intervals and autonomous loop execution. The scheduler engine manages the full execution lifecycle, running prompts on a cadence you define with preset intervals or custom timing. Autonomous loops add intelligent stop conditions so agents can iterate toward a goal and stop when done.
14
+ Automate recurring AI prompts on configurable intervals. Define what you want an agent to do, set a schedule, and let it run unattended. Each firing creates a tracked task with full execution history, so you always know what ran, when it ran, and what it produced. Pause, resume, or edit schedules at any time without losing history.
15
15
 
16
16
  ## Screenshots
17
17
 
18
- ![Schedules list showing active and paused schedules](../screengrabs/schedules-list.png)
19
- *The schedules list displays all configured schedules with their status, interval, next run time, and associated project.*
18
+ ![Schedules list showing active and paused schedules with status, frequency, and next firing time](../screengrabs/schedules-list.png)
19
+ *The schedules list displays all configured schedules with their current status, interval, next run time, and associated project.*
20
+
21
+ ![Schedule detail sheet showing configuration and firing history](../screengrabs/schedules-detail.png)
22
+ *The schedule detail sheet shows the full configuration, execution statistics, and a chronological firing history with results from each run.*
23
+
24
+ ![Schedule edit dialog with name, prompt, interval, runtime, and profile fields](../screengrabs/schedules-edit-form.png)
25
+ *The edit dialog lets you modify a schedule's name, prompt, interval, runtime provider, and agent profile without recreating it.*
20
26
 
21
27
  ## Key Features
22
28
 
23
- ### Preset Intervals
24
- Choose from six built-in interval presets for common scheduling patterns: every 5 minutes, 15 minutes, 30 minutes, hourly, every 2 hours, or daily at 9 AM. Presets cover the most common automation cadences without requiring manual configuration.
29
+ ### Schedule Management
30
+ Create, edit, pause, resume, and delete schedules from a single list view. Each schedule captures a complete execution context: a descriptive name, the prompt to send to the agent, the execution interval, a project for scoping, the provider runtime, and the agent profile that governs behavior. Schedules persist in the database and survive server restarts.
25
31
 
26
- ### Custom Intervals
27
- Define custom intervals beyond the presets using the interval parser. Specify any duration to match your exact automation needs, from rapid polling to weekly recurring tasks.
32
+ ### Schedule Editing
33
+ Edit any schedule after creation using the edit dialog. Update the schedule name, prompt text, execution interval, runtime provider (Claude or Codex), and agent profile without deleting and recreating the schedule. All changes take effect on the next firing.
28
34
 
29
- ### Schedule Configuration
30
- Each schedule captures a complete execution context: a descriptive name, the execution interval, the prompt to send to the agent, the project context for scoping, the provider runtime (Claude or Codex), and the agent profile that governs behavior.
35
+ ### Firing History
36
+ Every schedule firing creates a tracked child task. The detail view shows a chronological history of all past executions with their results, making it easy to audit what the agent did on each run and spot patterns over time.
31
37
 
32
- ### Scheduler Engine
33
- The scheduler engine runs as a background process initialized via the Next.js instrumentation hook. It tracks all active schedules, calculates next run times, triggers executions on cadence, and manages the lifecycle of each schedule through active, paused, and completed states.
38
+ ### Flexible Intervals
39
+ Choose from six built-in presets (every 5 minutes, 15 minutes, 30 minutes, hourly, every 2 hours, or daily at 9 AM) or define a custom interval. Advanced users can enter standard 5-field cron expressions for precise control. Human-friendly shorthand like `5m`, `2h`, or `1d` is also accepted.
34
40
 
35
- ### Autonomous Loop Execution
36
- Autonomous loops extend scheduled execution with intelligent stop conditions. Four stop condition types are available: max iterations (stop after N runs), time limit (stop after a duration), goal achieved (agent determines the objective is met), and error threshold (stop after too many failures). The loop executor passes iteration context between runs so the agent can build on previous results.
41
+ ### Runtime and Profile Selection
42
+ Choose which AI provider runtime (Claude or Codex) and which agent profile each schedule uses. This lets you match the right model and behavioral profile to each automation task, whether it needs a code reviewer, researcher, or general assistant.
37
43
 
38
44
  ### Pause and Resume
39
- Schedules can be paused and resumed without losing their configuration or execution history. Pausing a schedule suspends future runs while preserving the next-run calculation, so resuming picks up right where it left off.
45
+ Suspend a schedule without losing its configuration or execution history. Pausing stops future runs while preserving the next-run calculation, so resuming picks up right where it left off.
40
46
 
41
47
  ## How To
42
48
 
43
- ### Create a Recurring Schedule
44
- 1. Navigate to `/schedules` from the sidebar under the **Manage** group.
49
+ ### Create a New Schedule
50
+ 1. Navigate to **Schedules** from the sidebar under the Manage group.
45
51
  2. Click the **Create Schedule** button to open the creation form.
46
52
  3. Enter a descriptive name for the schedule.
47
- 4. Select an interval from the presets (5min, 15min, 30min, hourly, 2h, daily 9AM) or define a custom interval.
53
+ 4. Select an interval from the presets or define a custom interval.
48
54
  5. Write the prompt that the agent will execute on each run.
49
55
  6. Optionally select a project for context scoping.
50
56
  7. Choose the provider runtime and agent profile.
51
57
  8. Save the schedule. It begins executing on the configured cadence.
52
58
 
53
- ### Set Up an Autonomous Loop
54
- 1. Create a schedule with your desired prompt and interval.
55
- 2. Configure one or more stop conditions: set a max iteration count, a time limit, a goal description, or an error threshold.
56
- 3. Start the schedule. The loop executor passes context from each iteration to the next.
57
- 4. The loop automatically stops when any stop condition is met.
59
+ ### Edit an Existing Schedule
60
+ 1. Open the schedules list at **Schedules**.
61
+ 2. Select a schedule to open its detail view.
62
+ 3. Click the **Edit** button to open the edit dialog.
63
+ 4. Modify any combination of name, prompt, interval, runtime, or agent profile.
64
+ 5. Save your changes. They take effect on the next scheduled firing.
58
65
 
59
- ### Pause or Resume a Schedule
60
- 1. Open the schedules list at `/schedules`.
66
+ ### Pause and Resume a Schedule
67
+ 1. Open the schedules list at **Schedules**.
61
68
  2. Locate the schedule you want to control.
62
69
  3. Click the pause button to suspend future executions, or the resume button to reactivate a paused schedule.
63
- 4. The schedule status updates to reflect the current state.
70
+ 4. The schedule status updates immediately and the list reflects the new state.
64
71
 
65
72
  ## Related
66
- - [Monitoring](./monitoring.md)
67
- - [Profiles](./profiles.md)
68
- - [Cost & Usage](./cost-usage.md)
73
+ - [Profiles](./profiles.md) โ€” Agent profiles used by schedule firings
74
+ - [Monitor](./monitoring.md) โ€” View execution logs from schedule firings