stagent 0.4.0 → 0.6.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 (276) hide show
  1. package/README.md +67 -31
  2. package/dist/cli.js +151 -2
  3. package/docs/.coverage-gaps.json +21 -0
  4. package/docs/.last-generated +1 -1
  5. package/docs/features/agent-intelligence.md +36 -14
  6. package/docs/features/chat.md +53 -71
  7. package/docs/features/cost-usage.md +14 -10
  8. package/docs/features/dashboard-kanban.md +30 -13
  9. package/docs/features/delivery-channels.md +198 -0
  10. package/docs/features/design-system.md +10 -10
  11. package/docs/features/documents.md +8 -8
  12. package/docs/features/home-workspace.md +20 -15
  13. package/docs/features/inbox-notifications.md +22 -10
  14. package/docs/features/keyboard-navigation.md +11 -11
  15. package/docs/features/monitoring.md +1 -1
  16. package/docs/features/playbook.md +30 -32
  17. package/docs/features/profiles.md +33 -11
  18. package/docs/features/projects.md +2 -2
  19. package/docs/features/provider-runtimes.md +58 -14
  20. package/docs/features/schedules.md +77 -41
  21. package/docs/features/settings.md +134 -51
  22. package/docs/features/shared-components.md +7 -15
  23. package/docs/features/tool-permissions.md +9 -9
  24. package/docs/features/workflows.md +32 -21
  25. package/docs/getting-started.md +33 -9
  26. package/docs/index.md +25 -16
  27. package/docs/journeys/developer.md +124 -207
  28. package/docs/journeys/personal-use.md +70 -79
  29. package/docs/journeys/power-user.md +107 -151
  30. package/docs/journeys/work-use.md +81 -113
  31. package/docs/manifest.json +79 -47
  32. package/docs/superpowers/plans/2026-03-30-finish-in-progress-features.md +547 -0
  33. package/docs/superpowers/specs/2026-03-27-chat-screenshot-display-design.md +303 -0
  34. package/docs/use-cases/agency-operator.md +84 -0
  35. package/docs/use-cases/solo-founder.md +75 -0
  36. package/docs/why-stagent.md +59 -0
  37. package/package.json +12 -3
  38. package/src/app/api/channels/[id]/route.ts +103 -0
  39. package/src/app/api/channels/[id]/test/route.ts +52 -0
  40. package/src/app/api/channels/inbound/slack/route.ts +109 -0
  41. package/src/app/api/channels/inbound/telegram/poll/route.ts +128 -0
  42. package/src/app/api/channels/inbound/telegram/route.ts +76 -0
  43. package/src/app/api/channels/route.ts +71 -0
  44. package/src/app/api/chat/conversations/[id]/messages/route.ts +3 -2
  45. package/src/app/api/chat/conversations/route.ts +15 -0
  46. package/src/app/api/chat/entities/search/route.ts +112 -0
  47. package/src/app/api/documents/[id]/file/route.ts +4 -1
  48. package/src/app/api/environment/profiles/suggest/route.ts +19 -3
  49. package/src/app/api/environment/scan/route.ts +8 -1
  50. package/src/app/api/handoffs/[id]/route.ts +76 -0
  51. package/src/app/api/handoffs/route.ts +89 -0
  52. package/src/app/api/memory/route.ts +181 -0
  53. package/src/app/api/profiles/[id]/route.ts +16 -1
  54. package/src/app/api/profiles/[id]/test/route.ts +4 -0
  55. package/src/app/api/profiles/[id]/test-results/route.ts +22 -0
  56. package/src/app/api/profiles/[id]/test-single/route.ts +64 -0
  57. package/src/app/api/profiles/assist/route.ts +35 -0
  58. package/src/app/api/profiles/import-repo/apply-updates/route.ts +123 -0
  59. package/src/app/api/profiles/import-repo/check-updates/route.ts +163 -0
  60. package/src/app/api/profiles/import-repo/confirm/route.ts +118 -0
  61. package/src/app/api/profiles/import-repo/preview/route.ts +107 -0
  62. package/src/app/api/profiles/import-repo/route.ts +29 -0
  63. package/src/app/api/profiles/import-repo/scan/route.ts +25 -0
  64. package/src/app/api/profiles/route.ts +73 -22
  65. package/src/app/api/projects/[id]/route.ts +119 -9
  66. package/src/app/api/projects/__tests__/delete-project.test.ts +170 -0
  67. package/src/app/api/runtimes/ollama/route.ts +86 -0
  68. package/src/app/api/runtimes/suggest/route.ts +29 -0
  69. package/src/app/api/schedules/[id]/heartbeat-history/route.ts +77 -0
  70. package/src/app/api/schedules/[id]/route.ts +41 -3
  71. package/src/app/api/schedules/parse/route.ts +66 -0
  72. package/src/app/api/schedules/route.ts +71 -12
  73. package/src/app/api/settings/author-default/route.ts +7 -0
  74. package/src/app/api/settings/browser-tools/route.ts +68 -0
  75. package/src/app/api/settings/learning/route.ts +41 -0
  76. package/src/app/api/settings/ollama/route.ts +34 -0
  77. package/src/app/api/settings/providers/route.ts +57 -0
  78. package/src/app/api/settings/routing/route.ts +24 -0
  79. package/src/app/api/settings/web-search/route.ts +28 -0
  80. package/src/app/api/tasks/[id]/execute/route.ts +13 -1
  81. package/src/app/documents/page.tsx +3 -0
  82. package/src/app/environment/page.tsx +8 -1
  83. package/src/app/settings/page.tsx +12 -4
  84. package/src/app/workflows/[id]/edit/page.tsx +2 -0
  85. package/src/app/workflows/new/page.tsx +2 -0
  86. package/src/components/chat/chat-command-popover.tsx +280 -0
  87. package/src/components/chat/chat-input.tsx +90 -10
  88. package/src/components/chat/chat-message.tsx +9 -3
  89. package/src/components/chat/chat-model-selector.tsx +42 -1
  90. package/src/components/chat/chat-shell.tsx +31 -5
  91. package/src/components/chat/screenshot-gallery.tsx +96 -0
  92. package/src/components/dashboard/welcome-landing.tsx +9 -9
  93. package/src/components/environment/artifact-card.tsx +27 -1
  94. package/src/components/environment/environment-dashboard.tsx +50 -2
  95. package/src/components/environment/environment-summary-card.tsx +5 -2
  96. package/src/components/environment/suggested-profiles.tsx +117 -52
  97. package/src/components/handoffs/handoff-approval-card.tsx +159 -0
  98. package/src/components/memory/memory-browser.tsx +315 -0
  99. package/src/components/monitoring/log-entry.tsx +61 -27
  100. package/src/components/profiles/learned-context-panel.tsx +4 -4
  101. package/src/components/profiles/profile-assist-panel.tsx +512 -0
  102. package/src/components/profiles/profile-browser.tsx +109 -8
  103. package/src/components/profiles/profile-card.tsx +29 -1
  104. package/src/components/profiles/profile-detail-view.tsx +200 -28
  105. package/src/components/profiles/profile-form-view.tsx +220 -82
  106. package/src/components/profiles/repo-import-wizard.tsx +648 -0
  107. package/src/components/profiles/smoke-test-editor.tsx +106 -0
  108. package/src/components/projects/project-detail.tsx +15 -2
  109. package/src/components/schedules/schedule-create-sheet.tsx +32 -330
  110. package/src/components/schedules/schedule-detail-sheet.tsx +37 -21
  111. package/src/components/schedules/schedule-edit-sheet.tsx +159 -0
  112. package/src/components/schedules/schedule-form.tsx +749 -0
  113. package/src/components/schedules/schedule-list.tsx +31 -2
  114. package/src/components/settings/auth-method-selector.tsx +7 -1
  115. package/src/components/settings/browser-tools-section.tsx +247 -0
  116. package/src/components/settings/budget-guardrails-section.tsx +111 -48
  117. package/src/components/settings/channels-section.tsx +526 -0
  118. package/src/components/settings/chat-settings-section.tsx +27 -1
  119. package/src/components/settings/data-management-section.tsx +8 -6
  120. package/src/components/settings/learning-context-section.tsx +124 -0
  121. package/src/components/settings/ollama-section.tsx +270 -0
  122. package/src/components/settings/providers-runtimes-section.tsx +499 -0
  123. package/src/components/settings/runtime-timeout-section.tsx +4 -4
  124. package/src/components/settings/web-search-section.tsx +101 -0
  125. package/src/components/shared/command-palette.tsx +1 -30
  126. package/src/components/shared/screenshot-lightbox.tsx +151 -0
  127. package/src/components/shared/tag-input.tsx +156 -0
  128. package/src/components/tasks/kanban-board.tsx +32 -0
  129. package/src/components/tasks/kanban-column.tsx +4 -2
  130. package/src/components/tasks/task-card.tsx +1 -0
  131. package/src/components/tasks/task-chip-bar.tsx +6 -1
  132. package/src/components/tasks/task-create-panel.tsx +55 -5
  133. package/src/components/workflows/workflow-form-view.tsx +38 -3
  134. package/src/hooks/use-caret-position.ts +104 -0
  135. package/src/hooks/use-chat-autocomplete.ts +288 -0
  136. package/src/hooks/use-project-skills.ts +66 -0
  137. package/src/hooks/use-tag-suggestions.ts +31 -0
  138. package/src/instrumentation.ts +4 -1
  139. package/src/lib/agents/__tests__/browser-mcp.test.ts +175 -0
  140. package/src/lib/agents/__tests__/claude-agent.test.ts +6 -0
  141. package/src/lib/agents/__tests__/learned-context.test.ts +10 -0
  142. package/src/lib/agents/agentic-loop.ts +235 -0
  143. package/src/lib/agents/browser-mcp.ts +174 -0
  144. package/src/lib/agents/claude-agent.ts +83 -198
  145. package/src/lib/agents/handoff/bus.ts +164 -0
  146. package/src/lib/agents/handoff/governance.ts +47 -0
  147. package/src/lib/agents/handoff/types.ts +16 -0
  148. package/src/lib/agents/learned-context.ts +27 -7
  149. package/src/lib/agents/memory/decay.ts +61 -0
  150. package/src/lib/agents/memory/extractor.ts +181 -0
  151. package/src/lib/agents/memory/retrieval.ts +96 -0
  152. package/src/lib/agents/memory/types.ts +6 -0
  153. package/src/lib/agents/profiles/__tests__/project-profiles.test.ts +119 -0
  154. package/src/lib/agents/profiles/__tests__/registry.test.ts +11 -3
  155. package/src/lib/agents/profiles/builtins/code-reviewer/profile.yaml +2 -2
  156. package/src/lib/agents/profiles/builtins/content-creator/SKILL.md +19 -0
  157. package/src/lib/agents/profiles/builtins/content-creator/profile.yaml +27 -0
  158. package/src/lib/agents/profiles/builtins/customer-support-agent/SKILL.md +19 -0
  159. package/src/lib/agents/profiles/builtins/customer-support-agent/profile.yaml +26 -0
  160. package/src/lib/agents/profiles/builtins/data-analyst/profile.yaml +2 -2
  161. package/src/lib/agents/profiles/builtins/devops-engineer/profile.yaml +2 -2
  162. package/src/lib/agents/profiles/builtins/document-writer/profile.yaml +2 -2
  163. package/src/lib/agents/profiles/builtins/financial-analyst/SKILL.md +19 -0
  164. package/src/lib/agents/profiles/builtins/financial-analyst/profile.yaml +24 -0
  165. package/src/lib/agents/profiles/builtins/general/profile.yaml +2 -2
  166. package/src/lib/agents/profiles/builtins/health-fitness-coach/profile.yaml +2 -2
  167. package/src/lib/agents/profiles/builtins/learning-coach/profile.yaml +2 -2
  168. package/src/lib/agents/profiles/builtins/marketing-strategist/SKILL.md +19 -0
  169. package/src/lib/agents/profiles/builtins/marketing-strategist/profile.yaml +27 -0
  170. package/src/lib/agents/profiles/builtins/operations-coordinator/SKILL.md +19 -0
  171. package/src/lib/agents/profiles/builtins/operations-coordinator/profile.yaml +26 -0
  172. package/src/lib/agents/profiles/builtins/project-manager/profile.yaml +2 -2
  173. package/src/lib/agents/profiles/builtins/researcher/SKILL.md +1 -0
  174. package/src/lib/agents/profiles/builtins/researcher/profile.yaml +2 -2
  175. package/src/lib/agents/profiles/builtins/sales-researcher/SKILL.md +19 -0
  176. package/src/lib/agents/profiles/builtins/sales-researcher/profile.yaml +26 -0
  177. package/src/lib/agents/profiles/builtins/shopping-assistant/SKILL.md +1 -0
  178. package/src/lib/agents/profiles/builtins/shopping-assistant/profile.yaml +2 -2
  179. package/src/lib/agents/profiles/builtins/sweep/profile.yaml +1 -1
  180. package/src/lib/agents/profiles/builtins/technical-writer/profile.yaml +2 -2
  181. package/src/lib/agents/profiles/builtins/travel-planner/SKILL.md +2 -0
  182. package/src/lib/agents/profiles/builtins/travel-planner/profile.yaml +2 -2
  183. package/src/lib/agents/profiles/builtins/wealth-manager/SKILL.md +2 -0
  184. package/src/lib/agents/profiles/builtins/wealth-manager/profile.yaml +2 -2
  185. package/src/lib/agents/profiles/project-profiles.ts +193 -0
  186. package/src/lib/agents/profiles/registry.ts +130 -6
  187. package/src/lib/agents/profiles/types.ts +28 -0
  188. package/src/lib/agents/router.ts +174 -2
  189. package/src/lib/agents/runtime/__tests__/catalog.test.ts +15 -4
  190. package/src/lib/agents/runtime/anthropic-direct.ts +644 -0
  191. package/src/lib/agents/runtime/catalog.ts +57 -2
  192. package/src/lib/agents/runtime/claude.ts +205 -1
  193. package/src/lib/agents/runtime/index.ts +22 -0
  194. package/src/lib/agents/runtime/ollama-adapter.ts +409 -0
  195. package/src/lib/agents/runtime/openai-direct.ts +514 -0
  196. package/src/lib/agents/runtime/profile-assist-types.ts +30 -0
  197. package/src/lib/agents/runtime/types.ts +2 -0
  198. package/src/lib/agents/tool-permissions.ts +203 -0
  199. package/src/lib/channels/gateway.ts +321 -0
  200. package/src/lib/channels/poller.ts +268 -0
  201. package/src/lib/channels/registry.ts +90 -0
  202. package/src/lib/channels/slack-adapter.ts +188 -0
  203. package/src/lib/channels/telegram-adapter.ts +218 -0
  204. package/src/lib/channels/types.ts +43 -0
  205. package/src/lib/channels/webhook-adapter.ts +74 -0
  206. package/src/lib/chat/command-data.ts +50 -0
  207. package/src/lib/chat/context-builder.ts +147 -3
  208. package/src/lib/chat/engine.ts +182 -19
  209. package/src/lib/chat/ollama-engine.ts +198 -0
  210. package/src/lib/chat/slash-commands.ts +191 -0
  211. package/src/lib/chat/stagent-tools.ts +106 -20
  212. package/src/lib/chat/tool-catalog.ts +209 -0
  213. package/src/lib/chat/tool-registry.ts +90 -0
  214. package/src/lib/chat/tools/chat-history-tools.ts +4 -4
  215. package/src/lib/chat/tools/document-tools.ts +43 -6
  216. package/src/lib/chat/tools/handoff-tools.ts +70 -0
  217. package/src/lib/chat/tools/notification-tools.ts +4 -4
  218. package/src/lib/chat/tools/profile-tools.ts +3 -3
  219. package/src/lib/chat/tools/project-tools.ts +3 -3
  220. package/src/lib/chat/tools/schedule-tools.ts +29 -13
  221. package/src/lib/chat/tools/settings-tools.ts +2 -2
  222. package/src/lib/chat/tools/task-tools.ts +66 -11
  223. package/src/lib/chat/tools/usage-tools.ts +2 -2
  224. package/src/lib/chat/tools/workflow-tools.ts +8 -8
  225. package/src/lib/chat/types.ts +22 -6
  226. package/src/lib/constants/known-tools.ts +19 -0
  227. package/src/lib/constants/prose-styles.ts +1 -1
  228. package/src/lib/constants/settings.ts +11 -0
  229. package/src/lib/data/channel-bindings.ts +85 -0
  230. package/src/lib/data/clear.ts +38 -4
  231. package/src/lib/data/profile-test-results.ts +48 -0
  232. package/src/lib/data/seed-data/conversations.ts +196 -0
  233. package/src/lib/data/seed-data/learned-context.ts +99 -0
  234. package/src/lib/data/seed-data/notifications.ts +54 -1
  235. package/src/lib/data/seed-data/profile-test-results.ts +96 -0
  236. package/src/lib/data/seed-data/repo-imports.ts +51 -0
  237. package/src/lib/data/seed-data/views.ts +60 -0
  238. package/src/lib/data/seed.ts +51 -0
  239. package/src/lib/db/bootstrap.ts +167 -0
  240. package/src/lib/db/migrations/0012_add_screenshot_columns.sql +5 -0
  241. package/src/lib/db/migrations/0013_add_repo_imports.sql +15 -0
  242. package/src/lib/db/migrations/0014_add_linked_profile_id.sql +3 -0
  243. package/src/lib/db/migrations/0015_add_channel_bindings.sql +23 -0
  244. package/src/lib/db/schema.ts +192 -1
  245. package/src/lib/environment/__tests__/auto-scan.test.ts +86 -0
  246. package/src/lib/environment/__tests__/profile-linker.test.ts +187 -0
  247. package/src/lib/environment/auto-scan.ts +48 -0
  248. package/src/lib/environment/data.ts +25 -0
  249. package/src/lib/environment/profile-generator.ts +40 -10
  250. package/src/lib/environment/profile-linker.ts +143 -0
  251. package/src/lib/environment/profile-rules.ts +96 -0
  252. package/src/lib/import/dedup.ts +149 -0
  253. package/src/lib/import/format-adapter.ts +631 -0
  254. package/src/lib/import/github-api.ts +219 -0
  255. package/src/lib/import/repo-scanner.ts +251 -0
  256. package/src/lib/schedules/__tests__/nlp-parser.test.ts +330 -0
  257. package/src/lib/schedules/active-hours.ts +120 -0
  258. package/src/lib/schedules/heartbeat-parser.ts +224 -0
  259. package/src/lib/schedules/heartbeat-prompt.ts +153 -0
  260. package/src/lib/schedules/nlp-parser.ts +357 -0
  261. package/src/lib/schedules/scheduler.ts +218 -3
  262. package/src/lib/screenshots/__tests__/persist.test.ts +104 -0
  263. package/src/lib/screenshots/persist.ts +114 -0
  264. package/src/lib/settings/__tests__/budget-guardrails.test.ts +39 -1
  265. package/src/lib/settings/helpers.ts +6 -0
  266. package/src/lib/settings/routing.ts +24 -0
  267. package/src/lib/settings/runtime-setup.ts +28 -1
  268. package/src/lib/usage/ledger.ts +2 -1
  269. package/src/lib/utils/stagent-paths.ts +4 -0
  270. package/src/lib/validators/__tests__/settings.test.ts +9 -0
  271. package/src/lib/validators/profile.ts +39 -0
  272. package/src/lib/workflows/blueprints/builtins/business-daily-briefing.yaml +102 -0
  273. package/src/lib/workflows/blueprints/builtins/content-marketing-pipeline.yaml +90 -0
  274. package/src/lib/workflows/blueprints/builtins/customer-support-triage.yaml +107 -0
  275. package/src/lib/workflows/blueprints/builtins/financial-reporting.yaml +104 -0
  276. package/src/lib/workflows/blueprints/builtins/lead-research-pipeline.yaml +82 -0
@@ -3,117 +3,99 @@ 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"]
7
- features: ["chat-data-layer", "chat-engine", "chat-api-routes", "chat-ui-shell", "chat-message-rendering", "chat-input-composer"]
8
- screengrabCount: 5
9
- lastUpdated: "2026-03-22"
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 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. Conversations can also originate from Slack and Telegram via bidirectional delivery channels.
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*
32
29
 
33
30
  ## Key Features
34
31
 
35
- ### Conversations
32
+ ### Tool Catalog
36
33
 
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.
34
+ When no conversation is active, the chat page displays a curated grid of suggested prompts organized into tabbed categories:
38
35
 
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.
36
+ - **Explore** -- Questions about your workspace: project statuses, task summaries, schedule overviews.
37
+ - **Create** -- Prompts that help you spin up new tasks, workflows, projects, and schedules.
38
+ - **Debug** -- Investigate failed tasks, review agent logs, and diagnose workflow issues.
39
+ - **Automate** -- Set up scheduled loops, bulk operations, and repeating workflows.
40
+ - **Smart Picks** -- A personalized row of suggestions generated from your actual workspace data.
40
41
 
41
42
  ### Model Selection
42
43
 
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:
44
-
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.
50
-
51
- 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.
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:
52
45
 
53
- ### Suggested Prompts
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).
54
51
 
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:
52
+ ### @ Mentions and Context
56
53
 
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?"
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.
61
55
 
62
- Click any suggestion to insert it into the input and start a conversation instantly.
56
+ ### Conversation Management
63
57
 
64
- ### Quick Access Navigation Pills
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.
65
59
 
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.
60
+ ### Channel Conversations
67
61
 
68
- ### Entity Management via Chat
69
-
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.
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.
71
63
 
72
64
  ### Streaming Responses
73
65
 
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.
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.
75
67
 
76
68
  ## How To
77
69
 
78
- ### Start a Conversation
70
+ ### Start a New Conversation
79
71
 
80
72
  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.
83
-
84
- ### Switch Models
85
-
86
- 1. Click the model selector to the left of the input area (it shows the current model name).
87
- 2. Choose a different model from the dropdown. Models are labeled with cost tiers ($, $$, $$$).
88
- 3. Your next message will use the selected model. The choice is saved for this conversation.
89
-
90
- ### Use Suggested Prompts
91
-
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.
73
+ 2. Browse the tool catalog categories or type your question in the input area.
74
+ 3. Click a suggested prompt to insert it, or type your own message.
75
+ 4. Press **Enter** to send. The response streams in immediately.
95
76
 
96
- ### Navigate to Entities from Chat
77
+ ### Switch AI Models
97
78
 
98
- 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.
100
- 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.
101
82
 
102
- ### Manage Conversations
83
+ ### Reference Entities in Chat
103
84
 
104
- 1. Right-click (or long-press on mobile) a conversation in the sidebar to rename, archive, or delete it.
105
- 2. Click "New Chat" at the top of the conversation list to start a fresh conversation.
106
- 3. Archived conversations can be restored from the conversation list filters.
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.
107
88
 
108
- ### Stop a Response
89
+ ### Chat from Slack or Telegram
109
90
 
110
- 1. While a response is streaming, the Send button changes to a Stop button (square icon).
111
- 2. Click Stop to cancel the response. The partial text is preserved in the conversation.
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.
112
94
 
113
95
  ## Related
114
96
 
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
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
100
+ - [Profiles](./profiles.md) -- Agent profiles that shape how the assistant responds
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: 1
9
- lastUpdated: "2026-03-21"
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
  ![Cost and usage dashboard with spend breakdown](../screengrabs/cost-usage-list.png)
19
19
  *The cost and usage dashboard showing spend metrics, provider breakdown, and budget pacing indicators.*
20
20
 
21
+ ![Cost and usage below fold](../screengrabs/cost-usage-below-fold.png)
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) and Codex (App Server). The breakdown helps you understand which provider is driving costs and make informed decisions about runtime selection.
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 can pause new executions to prevent further charges.
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 **Configure** group.
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 Claude vs. Codex spend.
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. Drill into the usage ledger to find high-token-count tasks.
56
- 4. Consider switching to a different provider runtime or adjusting task prompts to reduce token usage.
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)
@@ -3,15 +3,15 @@ title: "Dashboard Kanban"
3
3
  category: "feature-reference"
4
4
  section: "dashboard-kanban"
5
5
  route: "/dashboard"
6
- tags: [tasks, kanban, board, table, filter, create, ai-assist, drag-and-drop]
7
- features: ["task-board", "kanban-board-operations", "micro-visualizations", "task-definition-ai", "detail-view-redesign", "ui-density-refinement"]
8
- screengrabCount: 2
9
- lastUpdated: "2026-03-21"
6
+ tags: [tasks, kanban, board, table, filter, create, ai-assist, drag-and-drop, bulk-operations, heartbeat]
7
+ features: ["task-board", "kanban-board-operations", "micro-visualizations", "task-definition-ai", "detail-view-redesign", "ui-density-refinement", "heartbeat-scheduler"]
8
+ screengrabCount: 5
9
+ lastUpdated: "2026-03-31"
10
10
  ---
11
11
 
12
12
  # Dashboard Kanban
13
13
 
14
- The Dashboard is your primary task management surface. It presents all tasks as a Kanban board with drag-and-drop columns, or as a sortable table whichever fits your workflow. A powerful filter bar, AI-assisted task creation, and inline editing let you manage agent work without switching context.
14
+ The Dashboard is your primary task management surface. It presents all tasks as a Kanban board with drag-and-drop columns, or as a sortable table -- whichever fits your workflow. A powerful filter bar, AI-assisted task creation, bulk operations, and inline editing let you manage agent work without switching context.
15
15
 
16
16
  ## Screenshots
17
17
 
@@ -21,26 +21,41 @@ The Dashboard is your primary task management surface. It presents all tasks as
21
21
  ![Dashboard table view](../screengrabs/dashboard-table.png)
22
22
  *Table view with sortable columns for title, status, priority, project, and timestamps*
23
23
 
24
+ ![Task detail sheet](../screengrabs/dashboard-card-detail.png)
25
+ *Task detail sheet showing task properties, description, and execution history*
26
+
27
+ ![Task edit dialog](../screengrabs/dashboard-card-edit.png)
28
+ *Task edit dialog for updating task details from the kanban board*
29
+
30
+ ![Bulk select mode](../screengrabs/dashboard-bulk-select.png)
31
+ *Kanban board in select mode with checked cards and bulk action toolbar*
32
+
24
33
  ## Key Features
25
34
 
26
35
  ### Kanban Board
27
- Tasks are organized into five columns Planned, Queued, Running, Completed, and Failed. Each column shows a count of its tasks. Cards display the task title, priority badge, and quick-action buttons for editing and deleting.
36
+ Tasks are organized into five columns -- Planned, Queued, Running, Completed, and Failed. Each column shows a count of its tasks. Cards display the task title, priority badge, agent profile, and quick-action buttons for editing and deleting. Heartbeat-generated tasks show a heartbeat badge to distinguish them from manually created work.
28
37
 
29
38
  ### Drag-and-Drop Reordering
30
39
  Drag task cards between columns to change their status, or within a column to reorder priority. The board updates the database in real time as you drop cards.
31
40
 
32
41
  ### Board and Table Toggle
33
- Switch between the visual Kanban board and a dense table view using the toggle in the toolbar. The table view provides sortable columns for title, status, priority, project, and timestamps ideal for bulk review.
42
+ Switch between the visual Kanban board and a dense table view using the toggle in the toolbar. The table view provides sortable columns for title, status, priority, project, and timestamps -- ideal for bulk review.
34
43
 
35
44
  ### Filter Bar
36
45
  Combobox filters for project, status, and priority let you narrow the board or table to exactly the tasks you care about. Filters persist across view toggles.
37
46
 
38
47
  ### AI-Assisted Task Creation
39
- The task creation form at `/tasks/new` includes fields for title, description, project, priority, runtime, and agent profile. The AI Assist button analyzes your title and description, then enhances them with structured context, acceptance criteria, and suggested parameters.
48
+ The task creation form includes fields for title, description, project, priority, runtime, and agent profile. The AI Assist button analyzes your title and description, then enhances them with structured context, acceptance criteria, and suggested parameters.
40
49
 
41
50
  ### Task Detail View
42
51
  Click any task card to open a detail panel with the full description, execution logs, status history, and action buttons. Edit the task inline or trigger execution directly from the detail view.
43
52
 
53
+ ### Bulk Select Mode
54
+ Enter select mode to check multiple task cards across any column. A toolbar appears with bulk actions: queue selected tasks for execution, move them to a different status, or delete tasks that are no longer needed. This is essential when autonomous workflows or heartbeat schedules generate many tasks overnight.
55
+
56
+ ### Heartbeat Badges
57
+ Tasks created by heartbeat schedules display a heartbeat badge on their kanban card. This visual indicator distinguishes proactively generated work from tasks you created manually, making it easy to audit what your scheduled agents produced.
58
+
44
59
  ## How To
45
60
 
46
61
  ### Create a New Task
@@ -53,7 +68,7 @@ Click any task card to open a detail panel with the full description, execution
53
68
  ### Move a Task Between Statuses
54
69
  1. In the board view, click and hold a task card.
55
70
  2. Drag it to the target column (e.g., from Planned to Queued).
56
- 3. Release to drop the status updates immediately.
71
+ 3. Release to drop -- the status updates immediately.
57
72
 
58
73
  ### Filter Tasks
59
74
  1. Use the filter bar at the top of the dashboard.
@@ -61,13 +76,15 @@ Click any task card to open a detail panel with the full description, execution
61
76
  3. The board or table updates instantly to show matching tasks.
62
77
  4. Clear filters by clicking the reset button.
63
78
 
64
- ### Edit a Task
65
- 1. Click the edit icon on any task card, or open the task detail view.
66
- 2. Modify the title, description, priority, or other fields.
67
- 3. Save changes the card updates across all views.
79
+ ### Bulk-Manage Tasks
80
+ 1. Click the "Select" button in the toolbar to enter bulk select mode.
81
+ 2. Check the boxes on multiple task cards.
82
+ 3. Use the bulk action toolbar to queue, move, or delete selected tasks.
83
+ 4. Confirm the action and exit select mode.
68
84
 
69
85
  ## Related
70
86
  - [Home Workspace](./home-workspace.md)
71
87
  - [Projects](./projects.md)
72
88
  - [Workflows](./workflows.md)
73
89
  - [Profiles](./profiles.md)
90
+ - [Schedules](./schedules.md)
@@ -0,0 +1,198 @@
1
+ ---
2
+ title: "Delivery Channels"
3
+ category: "feature-reference"
4
+ section: "delivery-channels"
5
+ route: "/settings"
6
+ tags: ["delivery-channels", "slack", "telegram", "webhook", "notifications", "integrations", "bidirectional", "chat"]
7
+ features: ["delivery-channels", "bidirectional-channel-chat"]
8
+ manual: true
9
+ screengrabCount: 0
10
+ lastUpdated: "2026-04-01"
11
+ ---
12
+
13
+ # Delivery Channels
14
+
15
+ Delivery Channels connect Stagent to external messaging services. Channels support two modes:
16
+
17
+ - **Outbound** -- Stagent pushes notifications when scheduled tasks fire, complete, or need attention
18
+ - **Bidirectional (Chat)** -- Users can chat with Stagent agents directly from Slack or Telegram, and receive responses in the same conversation
19
+
20
+ Channels are configured in Settings and can be toggled between outbound-only and bidirectional mode at any time.
21
+
22
+ ## Key Features
23
+
24
+ ### Channel Types
25
+
26
+ Three adapter types are supported, each requiring different configuration:
27
+
28
+ | Type | Outbound Config | Bidirectional Config | Best For |
29
+ |------|----------------|---------------------|----------|
30
+ | **Slack** | Incoming Webhook URL | + Bot Token, Signing Secret, Channel ID | Team chat and notifications |
31
+ | **Telegram** | Bot Token + Chat ID | Same (no extra config needed) | Personal AI assistant via messaging |
32
+ | **Webhook** | URL + optional headers | N/A (outbound only) | Custom integrations, Zapier, n8n |
33
+
34
+ ### Bidirectional Chat
35
+
36
+ When Chat mode is enabled on a Slack or Telegram channel, you can message Stagent directly from your messaging app. Stagent processes your message through the same chat engine used in the web UI, including:
37
+
38
+ - **Multi-turn conversations** -- context is maintained across messages
39
+ - **Tool access** -- the agent can query projects, tasks, documents, schedules, and more
40
+ - **Permission handling** -- if a tool requires approval, Stagent asks in the channel and you reply with "approve" or "deny"
41
+ - **Turn locking** -- if you send a message while the agent is still processing, you get a "Still processing, please wait..." reply
42
+
43
+ Channel conversations also appear in the Stagent Chat sidebar, so you can continue them from the web UI.
44
+
45
+ ### Connection Testing
46
+
47
+ Every channel has a test status indicator:
48
+
49
+ | Status | Meaning |
50
+ |--------|---------|
51
+ | **untested** | Channel created but never tested |
52
+ | **ok** | Last test message was delivered successfully |
53
+ | **failed** | Last test or delivery failed -- check configuration |
54
+
55
+ Click **Test** next to any channel to send a probe message and update the status.
56
+
57
+ ### Channel Controls
58
+
59
+ Each channel card in Settings has:
60
+
61
+ - **Chat** toggle -- enable/disable bidirectional chat mode (Slack and Telegram only)
62
+ - **Active** toggle -- enable/disable the channel entirely (preserves configuration)
63
+ - **Test** button -- send a test message to verify connectivity
64
+ - **Delete** button -- remove the channel
65
+
66
+ When Chat is enabled, a webhook URL is displayed below the channel card for reference.
67
+
68
+ ### Schedule Integration
69
+
70
+ When a schedule fires, Stagent checks if it has delivery channels assigned. If so, a notification is posted to each active channel containing:
71
+
72
+ - The schedule name and firing number
73
+ - The task prompt (truncated)
74
+ - A link back to the task
75
+
76
+ Delivery failures are logged but never block task execution -- the agent work completes even if the notification fails to send.
77
+
78
+ ### Auto-Polling (Local Development)
79
+
80
+ For local development, Stagent includes a built-in poller that checks Telegram and Slack for new messages every 5 seconds. This runs automatically when the dev server starts -- no public URL or webhook registration needed. The poller only polls channels that have both Chat enabled and Active status on.
81
+
82
+ ## How To
83
+
84
+ ### Connect Slack to Stagent
85
+
86
+ This walkthrough creates a Slack App and connects it to Stagent for both outbound notifications and bidirectional chat.
87
+
88
+ **Part 1 -- Create the Slack App**
89
+
90
+ 1. Go to [api.slack.com/apps](https://api.slack.com/apps) and click **Create New App**
91
+ 2. Choose **From scratch**
92
+ 3. Enter an App Name (e.g., "Stagent") and select the workspace you want to post to
93
+ 4. Click **Create App**
94
+
95
+ **Part 2 -- Enable Incoming Webhooks (for outbound notifications)**
96
+
97
+ 5. In the app settings sidebar, click **Incoming Webhooks**
98
+ 6. Toggle **Activate Incoming Webhooks** to **On**
99
+ 7. Scroll down and click **Add New Webhook to Workspace**
100
+ 8. Select the Slack channel where you want notifications (e.g., `#all-stagent`)
101
+ 9. Click **Allow** to authorize the webhook
102
+ 10. Copy the generated **Webhook URL** (starts with `https://hooks.slack.com/services/...`)
103
+
104
+ **Part 3 -- Add Bot Scopes (for bidirectional chat)**
105
+
106
+ 11. In the app settings sidebar, click **OAuth & Permissions**
107
+ 12. Scroll down to **Bot Token Scopes**
108
+ 13. Click **Add an OAuth Scope** and add these scopes:
109
+ - `channels:history` -- read messages from public channels
110
+ - `chat:write` -- send messages as the bot
111
+ 14. Scroll up and click **Reinstall to Stagent** to apply the new scopes
112
+ 15. Copy the **Bot User OAuth Token** (starts with `xoxb-...`)
113
+
114
+ **Part 4 -- Get the Channel ID**
115
+
116
+ 16. Open Slack in a browser and navigate to the target channel
117
+ 17. The Channel ID is in the URL: `app.slack.com/client/WORKSPACE_ID/CHANNEL_ID` -- copy the `CHANNEL_ID` (starts with `C`)
118
+
119
+ **Part 5 -- Add the Channel in Stagent**
120
+
121
+ 18. Open **Settings** in Stagent (sidebar → Configure → Settings)
122
+ 19. Scroll down to the **Delivery Channels** section
123
+ 20. Click **+ Add Channel**
124
+ 21. Set Channel Type to **Slack**
125
+ 22. Enter a descriptive name (e.g., "Stagent #all-stagent")
126
+ 23. Paste the **Webhook URL** from step 10
127
+ 24. Paste the **Bot Token** from step 15
128
+ 25. Optionally paste the **Signing Secret** (from Basic Information → App Credentials)
129
+ 26. Paste the **Channel ID** from step 17
130
+ 27. Click **Create Channel**
131
+ 28. Click **Test** -- verify the status changes to green **ok**
132
+ 29. Toggle **Chat** on to enable bidirectional mode
133
+ 30. Send a message in the Slack channel mentioning @Stagent -- you should receive a response within seconds
134
+
135
+ ### Add a Telegram Channel
136
+
137
+ **Part 1 -- Create the Bot**
138
+
139
+ 1. Open Telegram and message [@BotFather](https://t.me/BotFather)
140
+ 2. Send `/newbot`, follow the prompts, and copy the **Bot Token** (format: `123456:ABC-DEF...`)
141
+ 3. Search for your bot by its username and **send it any message** (e.g., "hello") -- this is required before you can retrieve your Chat ID
142
+ 4. Get your **Chat ID** by visiting `https://api.telegram.org/bot<TOKEN>/getUpdates` in your browser -- the `chat.id` field in the JSON response contains the value you need (negative for groups). If the result array is empty, send another message to the bot first, then reload the URL
143
+
144
+ **Part 2 -- Add the Channel in Stagent**
145
+
146
+ 5. In Stagent Settings → Delivery Channels → **+ Add Channel**
147
+ 6. Set Channel Type to **Telegram**
148
+ 7. Enter the Bot Token and Chat ID
149
+ 8. Click **Create Channel**
150
+ 9. Click **Test** -- verify the status changes to green **ok**
151
+ 10. Open the bot conversation in Telegram and confirm the test message was delivered
152
+ 11. Toggle **Chat** on to enable bidirectional mode
153
+ 12. Send a message to your bot in Telegram -- you should receive a response within seconds
154
+
155
+ ### Add a Generic Webhook
156
+
157
+ 1. In Stagent Settings → Delivery Channels → **+ Add Channel**
158
+ 2. Set Channel Type to **Webhook**
159
+ 3. Enter the destination **URL** (any HTTP endpoint that accepts POST requests)
160
+ 4. Optionally enter **Custom Headers** as JSON (e.g., `{"Authorization": "Bearer your-token"}`)
161
+ 5. Click **Create Channel** → **Test** → verify green **ok**
162
+
163
+ Webhooks are outbound-only. The webhook receives a JSON POST body with this structure:
164
+
165
+ ```json
166
+ {
167
+ "subject": "Schedule fired: Daily Report (#5)",
168
+ "body": "Task prompt text...",
169
+ "format": "markdown",
170
+ "metadata": {
171
+ "scheduleId": "...",
172
+ "taskId": "...",
173
+ "firingNumber": 5
174
+ },
175
+ "timestamp": "2026-03-31T10:00:00Z",
176
+ "source": "stagent"
177
+ }
178
+ ```
179
+
180
+ ### Enable or Disable Bidirectional Chat
181
+
182
+ To toggle Chat mode on an existing channel:
183
+
184
+ 1. Go to Settings → Delivery Channels
185
+ 2. Find the channel card for Slack or Telegram
186
+ 3. Toggle the **Chat** switch on or off
187
+ 4. When Chat is on, the channel shows a blue "Chat" badge and displays the webhook URL
188
+ 5. The auto-poller starts/stops polling that channel within 5 seconds
189
+
190
+ ### Conversations from Channels
191
+
192
+ Channel conversations appear in the **Chat** sidebar alongside regular conversations. They are titled "Channel: [channel name]" and use the Sonnet model by default. You can view and continue these conversations from the web UI as well.
193
+
194
+ ## Related
195
+
196
+ - [Settings](./settings.md) -- Delivery Channels live in the Settings page
197
+ - [Schedules](./schedules.md) -- Attach channels to schedules for automated notifications
198
+ - [Chat](./chat.md) -- Channel conversations appear in the Chat sidebar
@@ -1,23 +1,23 @@
1
1
  ---
2
- title: "Design System Calm Ops"
2
+ title: "Design System -- Calm Ops"
3
3
  category: "feature-reference"
4
4
  section: "design-system"
5
5
  route: "cross-cutting"
6
6
  tags: [design, tokens, oklch, typography, elevation, components, calm-ops]
7
7
  features: ["calm-ops-design-system", "oklch-color-tokens", "shared-component-library"]
8
8
  screengrabCount: 0
9
- lastUpdated: "2026-03-21"
9
+ lastUpdated: "2026-03-31"
10
10
  ---
11
11
 
12
- # Design System Calm Ops
12
+ # Design System -- Calm Ops
13
13
 
14
- Stagent follows the "Calm Ops" design philosophy: opaque surfaces, border-centric elevation, and zero glass morphism. The system is defined in `design-system/MASTER.md` and implemented through CSS custom properties in `src/app/globals.css`.
14
+ Stagent follows the "Calm Ops" design philosophy: opaque surfaces, border-centric elevation, and zero glass morphism. The system prioritizes readability and scan speed on operational screens.
15
15
 
16
16
  ## Key Features
17
17
 
18
18
  ### Color System
19
19
 
20
- OKLCH color space with an accent hue of ~250 (indigo/blue-violet). Light-first theme with dark mode support. All color tokens are defined as OKLCH values, ensuring perceptual uniformity across the palette. Forbidden patterns: `rgba()`, `backdrop-filter`, `glass-*`, `gradient-*`.
20
+ OKLCH color space with an accent hue of ~250 (indigo/blue-violet). Light-first theme with dark mode support. All color tokens are defined as OKLCH values, ensuring perceptual uniformity across the palette.
21
21
 
22
22
  ### Elevation Model
23
23
 
@@ -34,14 +34,14 @@ Four elevation levels replace shadow-heavy or glass-based depth cues:
34
34
 
35
35
  Three surface tiers create visual nesting without transparency:
36
36
 
37
- - **surface-1** white / raised (cards, panels)
38
- - **surface-2** muted (page backgrounds, secondary areas)
39
- - **surface-3** inset (code blocks, input fields)
37
+ - **surface-1** -- white / raised (cards, panels)
38
+ - **surface-2** -- muted (page backgrounds, secondary areas)
39
+ - **surface-3** -- inset (code blocks, input fields)
40
40
 
41
41
  ### Typography
42
42
 
43
- - **Body text**: Inter clean, highly legible at 14px base size.
44
- - **Monospace**: JetBrains Mono code blocks, terminal output, status values.
43
+ - **Body text**: Inter -- clean, highly legible at 14px base size.
44
+ - **Monospace**: JetBrains Mono -- code blocks, terminal output, status values.
45
45
 
46
46
  ### Spacing
47
47
 
@@ -6,7 +6,7 @@ route: "/documents"
6
6
  tags: [documents, upload, preprocessing, pdf, office, text-extraction, agent-context]
7
7
  features: ["document-manager", "file-attachment-data-layer", "document-preprocessing", "agent-document-context", "document-output-generation"]
8
8
  screengrabCount: 2
9
- lastUpdated: "2026-03-21"
9
+ lastUpdated: "2026-03-31"
10
10
  ---
11
11
 
12
12
  # Documents
@@ -31,11 +31,11 @@ The upload dialog accepts files via drag-and-drop or file picker. A visual indic
31
31
 
32
32
  ### Supported File Types
33
33
  Stagent processes a range of document formats:
34
- - **PDF** Text extraction via pdf-parse.
35
- - **Text** Plain text, Markdown, code files.
36
- - **Images** Metadata extraction (dimensions, format) via image-size.
37
- - **Office Documents** Word documents via mammoth, presentations and archives via jszip.
38
- - **Spreadsheets** Excel and CSV files via xlsx parser.
34
+ - **PDF** -- Text extraction via pdf-parse.
35
+ - **Text** -- Plain text, Markdown, code files.
36
+ - **Images** -- Metadata extraction (dimensions, format).
37
+ - **Office Documents** -- Word documents, presentations, and archives.
38
+ - **Spreadsheets** -- Excel and CSV files.
39
39
 
40
40
  ### Automatic Preprocessing
41
41
  After upload, Stagent automatically extracts text content from supported file types. The extracted text is stored alongside the original file, ready to be injected into agent context. Processing status is visible on each document card.
@@ -51,9 +51,9 @@ Agents can generate documents as output during task execution. Generated files a
51
51
  ### Upload Documents
52
52
  1. Navigate to `/documents` and click "Upload."
53
53
  2. Drag and drop files into the upload zone, or click to browse.
54
- 3. Select one or more files supported types are shown in the dialog.
54
+ 3. Select one or more files -- supported types are shown in the dialog.
55
55
  4. Click "Upload" to start the process.
56
- 5. Preprocessing begins automatically watch the status indicator on each document.
56
+ 5. Preprocessing begins automatically -- watch the status indicator on each document.
57
57
 
58
58
  ### Attach Documents to a Task
59
59
  1. When creating or editing a task, look for the document attachment field.