stagent 0.3.1 → 0.3.3

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 (42) hide show
  1. package/dist/cli.js +2 -0
  2. package/docs/.last-generated +1 -0
  3. package/docs/features/agent-intelligence.md +60 -0
  4. package/docs/features/chat.md +119 -0
  5. package/docs/features/cost-usage.md +61 -0
  6. package/docs/features/dashboard-kanban.md +73 -0
  7. package/docs/features/design-system.md +73 -0
  8. package/docs/features/documents.md +76 -0
  9. package/docs/features/home-workspace.md +66 -0
  10. package/docs/features/inbox-notifications.md +67 -0
  11. package/docs/features/keyboard-navigation.md +62 -0
  12. package/docs/features/monitoring.md +59 -0
  13. package/docs/features/playbook.md +57 -0
  14. package/docs/features/profiles.md +57 -0
  15. package/docs/features/projects.md +67 -0
  16. package/docs/features/provider-runtimes.md +49 -0
  17. package/docs/features/schedules.md +68 -0
  18. package/docs/features/settings.md +85 -0
  19. package/docs/features/shared-components.md +78 -0
  20. package/docs/features/tool-permissions.md +57 -0
  21. package/docs/features/workflows.md +81 -0
  22. package/docs/getting-started.md +141 -0
  23. package/docs/index.md +50 -0
  24. package/docs/journeys/developer.md +303 -0
  25. package/docs/journeys/personal-use.md +209 -0
  26. package/docs/journeys/power-user.md +248 -0
  27. package/docs/journeys/work-use.md +226 -0
  28. package/docs/manifest.json +240 -0
  29. package/package.json +2 -1
  30. package/src/app/api/environment/checkpoints/[id]/route.ts +3 -2
  31. package/src/app/api/environment/checkpoints/route.ts +2 -1
  32. package/src/app/api/environment/scan/route.ts +2 -1
  33. package/src/lib/agents/claude-agent.ts +3 -2
  34. package/src/lib/agents/runtime/claude.ts +4 -3
  35. package/src/lib/agents/runtime/openai-codex.ts +4 -3
  36. package/src/lib/chat/engine.ts +2 -1
  37. package/src/lib/chat/model-discovery.ts +2 -1
  38. package/src/lib/docs/reader.ts +11 -1
  39. package/src/lib/environment/scanner.ts +2 -1
  40. package/src/lib/environment/sync/mcp-sync.ts +2 -1
  41. package/src/lib/environment/sync-engine.ts +2 -1
  42. package/src/lib/environment/workspace-context.ts +6 -1
@@ -0,0 +1,62 @@
1
+ ---
2
+ title: "Keyboard Navigation"
3
+ category: "feature-reference"
4
+ section: "keyboard-navigation"
5
+ route: "cross-cutting"
6
+ tags: [keyboard, command-palette, accessibility, aria, a11y, navigation]
7
+ features: ["command-palette-enhancement", "accessibility"]
8
+ screengrabCount: 2
9
+ lastUpdated: "2026-03-21"
10
+ ---
11
+
12
+ # Keyboard Navigation
13
+
14
+ Stagent is designed for keyboard-first operation. The command palette provides instant access to any resource, and all interactive elements support full keyboard navigation with visible focus indicators.
15
+
16
+ ## Screenshots
17
+
18
+ ![Command palette in empty state](../screengrabs/command-palette-empty.png)
19
+ *The command palette (Meta+K) showing recent items and navigation shortcuts.*
20
+
21
+ ![Command palette with search results](../screengrabs/command-palette-search.png)
22
+ *Searching across projects, tasks, and workflows from the command palette.*
23
+
24
+ ## Key Features
25
+
26
+ ### Command Palette
27
+
28
+ Activated with **Meta+K** (Cmd+K on macOS, Ctrl+K on other platforms), the command palette provides:
29
+
30
+ - **Recent items** — quick access to recently viewed projects, tasks, and workflows.
31
+ - **Cross-entity search** — type to search across projects, tasks, workflows, documents, and schedules in a single unified list.
32
+ - **Keyboard navigation** — arrow keys to browse results, Enter to select, Escape to dismiss.
33
+ - **Action shortcuts** — create new tasks, projects, or workflows directly from the palette.
34
+
35
+ ### Focus-Visible Rings
36
+
37
+ All interactive cards, buttons, and links display a visible focus ring when navigated via keyboard (`:focus-visible`). The ring uses the accent color at reduced opacity to remain visible without being distracting.
38
+
39
+ ### Skip-to-Content Link
40
+
41
+ A hidden skip link appears on Tab press, allowing keyboard users to bypass the sidebar and jump directly to the main content area.
42
+
43
+ ### ARIA Labels
44
+
45
+ All interactive elements carry descriptive ARIA labels. Status badges include `aria-label` text that reads the status aloud (e.g., "Status: completed"). Icon-only buttons have accessible names.
46
+
47
+ ### Kanban Keyboard Drag-and-Drop
48
+
49
+ Kanban board cards support full keyboard-driven reordering:
50
+
51
+ 1. **Space** — pick up the focused card.
52
+ 2. **Arrow keys** — move the card between columns or positions.
53
+ 3. **Space** — drop the card in its new position.
54
+ 4. **Escape** — cancel the drag and return the card to its original position.
55
+
56
+ A live region announces the card's current position during the drag operation for screen reader users.
57
+
58
+ ## Related
59
+
60
+ - [Design System](./design-system.md)
61
+ - [Dashboard & Kanban](./dashboard-kanban.md)
62
+ - [Shared Components](./shared-components.md)
@@ -0,0 +1,59 @@
1
+ ---
2
+ title: "Monitoring"
3
+ category: "feature-reference"
4
+ section: "monitoring"
5
+ route: "/monitor"
6
+ tags: [monitoring, agent-logs, activity, real-time, execution]
7
+ features: ["monitoring-dashboard"]
8
+ screengrabCount: 1
9
+ lastUpdated: "2026-03-21"
10
+ ---
11
+
12
+ # Monitoring
13
+
14
+ Real-time agent activity monitoring for all running tasks in your workspace. The monitoring dashboard provides a live view of agent logs with timestamps, task associations, and status indicators, giving you full visibility into what your agents are doing at any moment.
15
+
16
+ ## Screenshots
17
+
18
+ ![Monitoring dashboard showing agent activity logs](../screengrabs/monitor-list.png)
19
+ *The monitoring dashboard displays a chronological feed of agent activity with status indicators and task associations.*
20
+
21
+ ## Key Features
22
+
23
+ ### Real-Time Activity Feed
24
+ The monitoring dashboard streams agent log entries as they happen. Each log entry includes a timestamp, the associated task name, the agent profile performing the work, and a status indicator showing whether the operation succeeded, failed, or is still in progress.
25
+
26
+ ### Task Association Tracking
27
+ Every log entry is linked to its parent task, making it easy to trace agent activity back to the work item that triggered it. Click any task reference to jump directly to the task detail view.
28
+
29
+ ### Status Indicators
30
+ Visual status badges distinguish between different activity states: running operations appear with an active indicator, completed work shows a success badge, and errors are highlighted with a destructive badge for immediate visibility.
31
+
32
+ ### Execution Progress Monitoring
33
+ Track the progress of long-running agent executions across all active tasks. The dashboard aggregates activity from every running agent, providing a single pane of glass for workspace-wide oversight.
34
+
35
+ ### Error Detection
36
+ Failed operations and agent errors surface prominently in the activity feed. Error entries include the error message and context, enabling quick diagnosis without needing to dig into individual task logs.
37
+
38
+ ## How To
39
+
40
+ ### Monitor Active Agents
41
+ 1. Navigate to `/monitor` from the sidebar under the **Manage** group.
42
+ 2. The activity feed loads automatically with the most recent log entries.
43
+ 3. New entries appear at the top of the feed in real time as agents execute tasks.
44
+
45
+ ### Investigate an Error
46
+ 1. Look for log entries with a destructive (red) status badge in the activity feed.
47
+ 2. Read the error message displayed in the log entry detail.
48
+ 3. Click the associated task name to navigate to the full task detail view.
49
+ 4. Review the complete execution log for additional context.
50
+
51
+ ### Filter by Task
52
+ 1. Open the monitoring dashboard at `/monitor`.
53
+ 2. Use the task association links to identify activity related to a specific task.
54
+ 3. Click through to the task detail page for the complete execution history of that task.
55
+
56
+ ## Related
57
+ - [Dashboard & Kanban](./dashboard-kanban.md)
58
+ - [Cost & Usage](./cost-usage.md)
59
+ - [Inbox & Notifications](./inbox-notifications.md)
@@ -0,0 +1,57 @@
1
+ ---
2
+ title: "Playbook"
3
+ category: "feature-reference"
4
+ section: "playbook"
5
+ route: "/playbook"
6
+ tags: [playbook, documentation, guides, reference, articles]
7
+ features: ["playbook-documentation"]
8
+ screengrabCount: 1
9
+ lastUpdated: "2026-03-21"
10
+ ---
11
+
12
+ # Playbook
13
+
14
+ Built-in documentation system that surfaces product guides and feature reference articles directly within the Stagent workspace. Playbook articles are generated from feature specs and screengrabs, giving users browsable, searchable documentation without leaving the app. Articles are organized by section for easy discovery.
15
+
16
+ ## Screenshots
17
+
18
+ ![Playbook article list with sections](../screengrabs/playbook-list.png)
19
+ *The playbook page displaying a list of documentation articles organized by section with search capability.*
20
+
21
+ ## Key Features
22
+
23
+ ### In-App Documentation
24
+ The playbook embeds product documentation directly into the Stagent interface. Users can read feature guides, reference articles, and how-to instructions without switching to an external docs site or wiki.
25
+
26
+ ### Feature Reference Articles
27
+ Each article covers a specific feature area with an overview, screenshots, key features, step-by-step instructions, and links to related articles. Articles are generated from structured feature specs and include annotated screengrabs for visual context.
28
+
29
+ ### Section Organization
30
+ Articles are grouped into logical sections that mirror the application's navigation structure. Sections such as workspace, tasks, workflows, documents, agents, automation, and configuration make it easy to find documentation relevant to the feature you are using.
31
+
32
+ ### Search Capability
33
+ A search function lets you find articles by keyword across all playbook content. Search matches against article titles, tags, and body text to surface relevant documentation quickly.
34
+
35
+ ## How To
36
+
37
+ ### Browse Documentation
38
+ 1. Navigate to `/playbook` from the sidebar.
39
+ 2. Scroll through the article list to see all available documentation.
40
+ 3. Articles are organized by section for logical grouping.
41
+ 4. Click any article title to open the full article view.
42
+
43
+ ### Search for a Topic
44
+ 1. Open the playbook at `/playbook`.
45
+ 2. Use the search field to enter keywords related to your question.
46
+ 3. Results filter in real time as you type.
47
+ 4. Click a matching article to read the full documentation.
48
+
49
+ ### Find Related Features
50
+ 1. Open any playbook article.
51
+ 2. Scroll to the **Related** section at the bottom.
52
+ 3. Click related article links to navigate to documentation for connected features.
53
+
54
+ ## Related
55
+ - [Home & Workspace](./home-workspace.md)
56
+ - [Dashboard & Kanban](./dashboard-kanban.md)
57
+ - [Settings](./settings.md)
@@ -0,0 +1,57 @@
1
+ ---
2
+ title: "Profiles"
3
+ category: "feature-reference"
4
+ section: "profiles"
5
+ route: "/profiles"
6
+ tags: [profiles, agents, routing, multi-agent, catalog, cross-provider]
7
+ features: ["agent-profile-catalog", "multi-agent-routing", "cross-provider-profile-compatibility"]
8
+ screengrabCount: 1
9
+ lastUpdated: "2026-03-21"
10
+ ---
11
+
12
+ # Profiles
13
+
14
+ Browse and manage 21 specialized agent profiles that define how agents behave when executing tasks. Each profile encapsulates a distinct persona with tailored capabilities, system prompts, and behavioral constraints. Profiles work across providers (Claude and Codex), and the auto-detect router can automatically select the best-fit profile for any given task.
15
+
16
+ ## Screenshots
17
+
18
+ ![Agent profiles catalog showing profile cards](../screengrabs/profiles-list.png)
19
+ *The profiles catalog displays all 21 agent profiles as cards with name, description, and capability indicators.*
20
+
21
+ ## Key Features
22
+
23
+ ### Agent Profile Catalog
24
+ The catalog presents 21 specialized profiles organized as browsable cards: General, Code Reviewer, Data Analyst, DevOps Engineer, Document Writer, Researcher, Project Manager, QA Tester, Technical Writer, Wealth Manager, Health & Fitness Coach, Learning Coach, Travel Planner, Shopping Assistant, API Tester, Launch Copy Chief, Portfolio Review Coach, Pricing QA Analyst, Revenue Operations Analyst, and Sweep. Each card shows the profile name, a description of its specialization, and its core capabilities.
25
+
26
+ ### Multi-Agent Routing
27
+ The task classifier analyzes incoming tasks and routes them to the most appropriate agent profile based on the task description, project context, and required capabilities. Auto-detect mode selects the best-fit profile automatically, while manual mode lets you choose a specific profile for any task.
28
+
29
+ ### Cross-Provider Compatibility
30
+ Profiles are provider-agnostic and work with both Claude (via Agent SDK) and Codex (via App Server). The same profile definition produces consistent behavior regardless of which provider runtime executes the task, ensuring predictable results across your workspace.
31
+
32
+ ### Profile Cards
33
+ Each profile card displays the agent's name, a concise description of its specialization, and the capabilities it brings to task execution. Cards are interactive with keyboard navigation and focus-visible rings following the Calm Ops design system.
34
+
35
+ ## How To
36
+
37
+ ### Browse Available Profiles
38
+ 1. Navigate to `/profiles` from the sidebar under the **Manage** group.
39
+ 2. Scroll through the catalog to see all 21 available agent profiles.
40
+ 3. Read each card's description to understand what the profile specializes in.
41
+
42
+ ### Assign a Profile to a Task
43
+ 1. Open a task in the task detail or create a new task.
44
+ 2. Locate the **Agent Profile** selector in the task form.
45
+ 3. Choose a specific profile from the dropdown, or select **Auto-detect** to let the router choose.
46
+ 4. Execute the task. The selected profile's system prompt and behavioral constraints will govern the agent's behavior.
47
+
48
+ ### Use Auto-Detect Routing
49
+ 1. When creating or editing a task, set the agent profile to **Auto-detect**.
50
+ 2. The task classifier analyzes the task description and project context.
51
+ 3. The best-fit profile is selected automatically when the task executes.
52
+ 4. Check the agent logs to see which profile was selected and why.
53
+
54
+ ## Related
55
+ - [Agent Intelligence](./agent-intelligence.md)
56
+ - [Settings](./settings.md)
57
+ - [Provider Runtimes](./provider-runtimes.md)
@@ -0,0 +1,67 @@
1
+ ---
2
+ title: "Projects"
3
+ category: "feature-reference"
4
+ section: "projects"
5
+ route: "/projects"
6
+ tags: [projects, workspaces, tasks, working-directory, organization]
7
+ features: ["project-management", "detail-view-redesign"]
8
+ screengrabCount: 2
9
+ lastUpdated: "2026-03-21"
10
+ ---
11
+
12
+ # Projects
13
+
14
+ Projects are workspaces that group related tasks, workflows, and documents under a shared context. Each project can specify a working directory, enabling agents to execute file-system-aware tasks within the correct folder on your machine.
15
+
16
+ ## Screenshots
17
+
18
+ ![Projects list view](../screengrabs/projects-list.png)
19
+ *Project cards showing name, status, and description for each workspace*
20
+
21
+ ![Project detail view](../screengrabs/projects-detail.png)
22
+ *Project detail page with associated tasks, workflows, and documents*
23
+
24
+ ## Key Features
25
+
26
+ ### Project Workspaces
27
+ Each project acts as a container for related work. Tasks, workflows, and documents associated with a project share context, making it easy to organize complex initiatives with multiple agent activities.
28
+
29
+ ### Project Cards
30
+ The project list displays cards with the project name, current status, and a brief description. Cards are interactive — click to navigate to the project detail page.
31
+
32
+ ### Project Detail Page
33
+ The detail page shows everything associated with a project: its tasks (with status), linked workflows, and attached documents. This is your single-pane view of all activity within a project.
34
+
35
+ ### Working Directory
36
+ Each project can specify a local file-system path as its working directory. When agents execute tasks for this project, they resolve file operations relative to this directory. This enables safe, scoped file access without giving agents free rein over your machine.
37
+
38
+ ### Create Project Dialog
39
+ The creation dialog collects a project name, description, and optional working directory. Projects can be created empty and populated with tasks and documents later.
40
+
41
+ ## How To
42
+
43
+ ### Create a New Project
44
+ 1. Navigate to `/projects` and click "New Project."
45
+ 2. Enter a name and description for the project.
46
+ 3. Optionally set a working directory (e.g., `/Users/you/code/my-repo`).
47
+ 4. Click "Create" to add the project.
48
+
49
+ ### View Project Details
50
+ 1. Click any project card on the projects list page.
51
+ 2. The detail page shows all associated tasks, workflows, and documents.
52
+ 3. Click any linked item to navigate directly to its detail view.
53
+
54
+ ### Associate Tasks with a Project
55
+ 1. When creating or editing a task, select a project from the project dropdown.
56
+ 2. The task will appear in the project's detail page under associated tasks.
57
+ 3. The agent executing the task will use the project's working directory as its base path.
58
+
59
+ ### Manage Project Status
60
+ 1. Open the project detail page.
61
+ 2. Update the project status as work progresses (e.g., Active, Completed, Archived).
62
+ 3. Status changes are reflected on the project card in the list view.
63
+
64
+ ## Related
65
+ - [Dashboard Kanban](./dashboard-kanban.md)
66
+ - [Workflows](./workflows.md)
67
+ - [Documents](./documents.md)
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: "Provider Runtimes"
3
+ category: "feature-reference"
4
+ section: "provider-runtimes"
5
+ route: "cross-cutting"
6
+ tags: [claude, codex, runtime, oauth, websocket, mcp, providers]
7
+ features: ["provider-runtime-abstraction", "openai-codex-app-server", "cross-provider-profile-compatibility"]
8
+ screengrabCount: 0
9
+ lastUpdated: "2026-03-21"
10
+ ---
11
+
12
+ # Provider Runtimes
13
+
14
+ Stagent supports two provider runtimes, allowing tasks and workflows to target either Claude or Codex depending on the use case. Profiles are compatible across providers, so switching runtimes does not require redefining agent behavior. Runtime selection is exposed via dropdown in task and workflow creation forms.
15
+
16
+ ## Key Features
17
+
18
+ ### Provider Runtime Abstraction
19
+
20
+ A unified interface sits between the task execution layer and the underlying provider. Both runtimes expose the same lifecycle hooks — start, poll, resume, cancel — so the execution manager and workflow engine operate identically regardless of which provider is active.
21
+
22
+ ### Claude Runtime (Agent SDK)
23
+
24
+ The Claude runtime uses the Anthropic Agent SDK with two authentication modes:
25
+
26
+ - **OAuth** — uses Max subscription tokens via the OAuth flow (default, no credit burn).
27
+ - **API Key** — uses `ANTHROPIC_API_KEY` from `.env.local` for direct API access.
28
+
29
+ Capabilities include resumable conversations, human-in-the-loop approvals via the `canUseTool` polling pattern, and MCP (Model Context Protocol) server integration for extended tool use.
30
+
31
+ ### Codex Runtime (App Server)
32
+
33
+ The Codex runtime connects to the OpenAI Codex App Server over WebSocket using JSON-RPC. Key characteristics:
34
+
35
+ - **Resumable threads** — long-running tasks persist across reconnections.
36
+ - **WebSocket transport** — low-latency bidirectional communication.
37
+ - **Integration point** — `src/lib/agents/runtime/codex-app-server-client.ts`.
38
+
39
+ Codex SDK reference documentation is captured at `.claude/reference/developers-openai-com-codex-sdk/`.
40
+
41
+ ### Cross-Provider Profile Compatibility
42
+
43
+ Agent profiles (General, Code Reviewer, Researcher, Document Writer) are defined independently of the provider runtime. A profile specifies behavioral traits — system prompt, tool preferences, stop conditions — that translate cleanly to either Claude or Codex. Switching the runtime dropdown on a task preserves the selected profile and its configuration.
44
+
45
+ ## Related
46
+
47
+ - [Agent Intelligence](./agent-intelligence.md)
48
+ - [Profiles](./profiles.md)
49
+ - [Settings](./settings.md)
@@ -0,0 +1,68 @@
1
+ ---
2
+ title: "Schedules"
3
+ category: "feature-reference"
4
+ section: "schedules"
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"
10
+ ---
11
+
12
+ # Schedules
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.
15
+
16
+ ## Screenshots
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.*
20
+
21
+ ## Key Features
22
+
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.
25
+
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.
28
+
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.
31
+
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.
34
+
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.
37
+
38
+ ### 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.
40
+
41
+ ## How To
42
+
43
+ ### Create a Recurring Schedule
44
+ 1. Navigate to `/schedules` from the sidebar under the **Manage** group.
45
+ 2. Click the **Create Schedule** button to open the creation form.
46
+ 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.
48
+ 5. Write the prompt that the agent will execute on each run.
49
+ 6. Optionally select a project for context scoping.
50
+ 7. Choose the provider runtime and agent profile.
51
+ 8. Save the schedule. It begins executing on the configured cadence.
52
+
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.
58
+
59
+ ### Pause or Resume a Schedule
60
+ 1. Open the schedules list at `/schedules`.
61
+ 2. Locate the schedule you want to control.
62
+ 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.
64
+
65
+ ## Related
66
+ - [Monitoring](./monitoring.md)
67
+ - [Profiles](./profiles.md)
68
+ - [Cost & Usage](./cost-usage.md)
@@ -0,0 +1,85 @@
1
+ ---
2
+ title: "Settings"
3
+ category: "feature-reference"
4
+ section: "settings"
5
+ route: "/settings"
6
+ tags: [settings, authentication, budget, permissions, data, providers, oauth, api-key, codex]
7
+ features: ["tool-permission-persistence", "provider-runtime-abstraction", "spend-budget-guardrails", "tool-permission-presets", "openai-codex-app-server"]
8
+ screengrabCount: 4
9
+ lastUpdated: "2026-03-21"
10
+ ---
11
+
12
+ # Settings
13
+
14
+ Configure authentication, budgets, tool permissions, and data management from a single settings page. Settings supports two provider runtimes -- Claude (Agent SDK with OAuth or API key) and Codex (App Server with WebSocket JSON-RPC) -- along with budget guardrails, permission presets with risk-level badges, and data management tools for clearing or exporting workspace data.
15
+
16
+ ## Screenshots
17
+
18
+ ![Settings page overview with authentication section](../screengrabs/settings-list.png)
19
+ *The settings page showing the authentication section with provider configuration, OAuth vs API key selection, and connection test.*
20
+
21
+ ![Budget settings section](../screengrabs/settings-budget.png)
22
+ *Budget configuration with overall spend cap, monthly split, OAuth billing indicator, and current pacing meter.*
23
+
24
+ ![Permission presets section](../screengrabs/settings-presets.png)
25
+ *Tool permission presets showing Read Only, Git Safe, and Full Auto tiers with risk-level badges.*
26
+
27
+ ![Data management section](../screengrabs/settings-data.png)
28
+ *Data management section with clear data and export options.*
29
+
30
+ ## Key Features
31
+
32
+ ### Authentication
33
+ Configure how Stagent authenticates with provider runtimes. For Claude, choose between OAuth (uses your Max subscription with no additional API charges) and API Key (uses your Anthropic API key from `.env.local`). For Codex, configure the App Server connection endpoint. A connection test button validates that your credentials and endpoints are working.
34
+
35
+ ### Provider Runtime Abstraction
36
+ Two provider runtimes are supported out of the box. Claude uses the Anthropic Agent SDK and supports both OAuth and API key authentication modes. Codex connects via the App Server using WebSocket JSON-RPC for real-time communication. The runtime abstraction means tasks and profiles work identically regardless of which provider executes them.
37
+
38
+ ### Budget Configuration
39
+ Set an overall spend cap to limit total workspace costs. Configure monthly splits to distribute the budget across billing periods. The OAuth billing indicator shows whether the current authentication method incurs API charges. A pacing meter visualizes current spend against the budget, with color-coded status for healthy, warning, and critical spend levels.
40
+
41
+ ### Permission Presets
42
+ Three permission tiers control what tools agents are allowed to use. **Read Only** grants access to file reading and search tools with no write permissions -- the lowest risk tier. **Git Safe** adds version-controlled write operations (file edits, git commits) with moderate risk. **Full Auto** enables all tools including shell commands, network access, and file system writes -- the highest risk tier. Each tier displays a risk badge for clear visibility.
43
+
44
+ ### Tool Permission Persistence
45
+ The "Always Allow" feature remembers tool permission decisions across sessions. When you approve a tool for a given permission tier, the decision is stored in the settings table so agents do not prompt for the same permission again.
46
+
47
+ ### Data Management
48
+ Clear workspace data or export it for backup. The clear data function removes tasks, logs, documents, and other workspace content while preserving settings. Export creates a snapshot of your workspace data for external storage or migration.
49
+
50
+ ## How To
51
+
52
+ ### Configure Claude Authentication
53
+ 1. Navigate to `/settings` from the sidebar under the **Configure** group.
54
+ 2. In the **Authentication** section, select either **OAuth** or **API Key** for the Claude runtime.
55
+ 3. For OAuth, ensure you have an active Claude Max subscription. For API Key, verify that `ANTHROPIC_API_KEY` is set in `.env.local`.
56
+ 4. Click **Test Connection** to validate the configuration.
57
+
58
+ ### Set Up Codex Runtime
59
+ 1. Open the **Authentication** section in settings.
60
+ 2. Locate the Codex App Server configuration.
61
+ 3. Enter the WebSocket endpoint for the Codex App Server.
62
+ 4. Test the connection to verify connectivity.
63
+
64
+ ### Configure Budget Guardrails
65
+ 1. Navigate to the **Budget** section in settings.
66
+ 2. Enter the overall spend cap amount.
67
+ 3. Set the monthly split to distribute the budget.
68
+ 4. Monitor the pacing meter to track spend against the cap.
69
+ 5. Alerts will notify you when spend approaches the limit.
70
+
71
+ ### Choose a Permission Preset
72
+ 1. Open the **Permission Presets** section in settings.
73
+ 2. Review the three tiers: Read Only, Git Safe, and Full Auto.
74
+ 3. Note the risk badge on each tier to understand the permission scope.
75
+ 4. Select the tier that matches your risk tolerance for agent operations.
76
+
77
+ ### Clear Workspace Data
78
+ 1. Scroll to the **Data Management** section in settings.
79
+ 2. Click **Clear Data** to remove workspace content (tasks, logs, documents).
80
+ 3. Confirm the action. Settings are preserved; only workspace data is cleared.
81
+
82
+ ## Related
83
+ - [Cost & Usage](./cost-usage.md)
84
+ - [Tool Permissions](./tool-permissions.md)
85
+ - [Provider Runtimes](./provider-runtimes.md)
@@ -0,0 +1,78 @@
1
+ ---
2
+ title: "Shared Components"
3
+ category: "feature-reference"
4
+ section: "shared-components"
5
+ route: "cross-cutting"
6
+ tags: [components, page-shell, detail-pane, status-chip, filter-bar, data-table, reusable]
7
+ features: ["shared-component-library", "page-shell", "detail-pane", "status-chip", "filter-bar", "view-switcher"]
8
+ screengrabCount: 0
9
+ lastUpdated: "2026-03-21"
10
+ ---
11
+
12
+ # Shared Components
13
+
14
+ Stagent maintains a library of reusable components that enforce layout consistency and reduce duplication across all surfaces. These components implement the Calm Ops design tokens and are used throughout the application.
15
+
16
+ ## Key Features
17
+
18
+ ### PageShell
19
+
20
+ Unified page layout wrapper used by all detail, create, and edit pages. Provides consistent max-width, padding, and spacing. Accepts a header slot and body content.
21
+
22
+ **Location**: `src/components/shared/`
23
+
24
+ ### DetailPane
25
+
26
+ A 420px right-rail panel for viewing and editing entity details without leaving the list view. Slides in from the right with a semi-opaque backdrop. Used on projects, tasks, workflows, and documents surfaces.
27
+
28
+ ### StatusChip
29
+
30
+ Five status chip families that map to entity lifecycle states. Each chip renders a colored dot indicator alongside the status label. Variants follow the badge color system (indigo/running, green/completed, gray/queued, red/failed, outline/planned).
31
+
32
+ ### FilterBar
33
+
34
+ Horizontal filter strip placed below page headers. Supports multiple filter types (select, search, date range) and displays an active filter count badge. Filters persist in URL search params for shareable filtered views.
35
+
36
+ ### ViewSwitcher
37
+
38
+ Toggle between saved view modes on a per-surface basis. Common modes include table view and grid/card view. The active view preference persists in local storage.
39
+
40
+ ### TrustTierBadge
41
+
42
+ Displayed in the sidebar footer, this badge shows the current tool permission tier (Read Only, Git Safe, Full Auto). Clicking opens a popover with tier details and a link to Settings.
43
+
44
+ ### DataTable
45
+
46
+ A sortable, paginated table component built on top of shadcn's Table primitives. Supports row selection, bulk actions, and column visibility toggles. Used on documents, schedules, and workflow steps surfaces.
47
+
48
+ ### PageHeader
49
+
50
+ Renders the page title, optional subtitle, and action buttons (e.g., "New Task", "Upload Document") in a consistent layout across all top-level pages.
51
+
52
+ ### EmptyState
53
+
54
+ A centered illustration + message component shown when a list or table has no data. Includes a primary action button to help users get started (e.g., "Create your first project").
55
+
56
+ **Location**: `src/components/shared/empty-state.tsx`
57
+
58
+ ### ErrorState
59
+
60
+ Displays error messages with a retry action. Used as an error boundary fallback and in API error scenarios.
61
+
62
+ **Location**: `src/components/shared/error-state.tsx`
63
+
64
+ ### SectionHeading
65
+
66
+ A styled heading component used to separate logical sections within a page or form. Renders an h2 with consistent font size, weight, and bottom margin.
67
+
68
+ **Location**: `src/components/shared/section-heading.tsx`
69
+
70
+ ### FormSectionCard
71
+
72
+ Groups related form fields inside an elevation-1 card with a section title. Used in create and edit forms to visually organize field groups (e.g., "Basic Info", "Configuration", "Schedule").
73
+
74
+ ## Related
75
+
76
+ - [Design System](./design-system.md)
77
+ - [Keyboard Navigation](./keyboard-navigation.md)
78
+ - [Dashboard & Kanban](./dashboard-kanban.md)
@@ -0,0 +1,57 @@
1
+ ---
2
+ title: "Tool Permissions"
3
+ category: "feature-reference"
4
+ section: "tool-permissions"
5
+ route: "cross-cutting"
6
+ tags: [permissions, trust, safety, approval, human-in-the-loop, presets]
7
+ features: ["tool-permission-persistence", "tool-permission-presets", "ambient-approval-toast"]
8
+ screengrabCount: 1
9
+ lastUpdated: "2026-03-21"
10
+ ---
11
+
12
+ # Tool Permissions
13
+
14
+ Stagent provides a layered permission system that balances agent autonomy with human oversight. Trust tiers control what tools an agent can invoke, while persistence and ambient approval mechanisms reduce friction for trusted operations.
15
+
16
+ ## Screenshots
17
+
18
+ ![Permission presets in settings](../screengrabs/settings-presets.png)
19
+ *Settings page showing the three trust tier presets — Read Only, Git Safe, and Full Auto.*
20
+
21
+ ## Key Features
22
+
23
+ ### Trust Tier Presets
24
+
25
+ Three built-in permission tiers provide progressively broader agent access:
26
+
27
+ - **Read Only** — safe browsing and file reading. No writes, no shell commands.
28
+ - **Git Safe** — read operations plus git commands (status, diff, log, commit). No arbitrary shell execution.
29
+ - **Full Auto** — all tools available, including shell commands and file writes.
30
+
31
+ Presets are configured in the Settings page and apply globally to all agent executions.
32
+
33
+ ### Trust Tier Badge
34
+
35
+ The sidebar footer displays a `TrustTierBadge` showing the current permission level at a glance. Clicking the badge opens a popover with details about what the active tier permits.
36
+
37
+ ### Tool Permission Persistence ("Always Allow")
38
+
39
+ When an agent requests a tool that requires approval, the user can click "Always Allow" to persist that permission. On subsequent runs, the tool is pre-approved without prompting. Persisted permissions are stored in the `settings` table and can be revoked in Settings.
40
+
41
+ ### Permission Pre-Check
42
+
43
+ Before executing a task, the runtime performs a permission pre-check against the current trust tier and any persisted "Always Allow" entries. Tools that fall within scope proceed automatically; tools outside scope trigger the approval flow.
44
+
45
+ ### Human-in-the-Loop Approval
46
+
47
+ When a tool request exceeds the current trust tier and has not been persisted, a notification is created in the `notifications` table. The user can approve or deny from the Inbox or from the task detail view, keeping the agent paused until a decision is made.
48
+
49
+ ### Ambient Approval Toast
50
+
51
+ For quick permission grants without navigating away from the current context, ambient toast notifications appear when an agent requests a tool. The user can approve directly from the toast, maintaining workflow continuity.
52
+
53
+ ## Related
54
+
55
+ - [Settings](./settings.md)
56
+ - [Inbox & Notifications](./inbox-notifications.md)
57
+ - [Provider Runtimes](./provider-runtimes.md)