stagent 0.9.5 → 0.10.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.
- package/README.md +5 -42
- package/dist/cli.js +42 -18
- package/docs/.coverage-gaps.json +13 -55
- package/docs/.last-generated +1 -1
- package/docs/features/provider-runtimes.md +4 -0
- package/docs/features/schedules.md +32 -4
- package/docs/features/settings.md +28 -5
- package/docs/features/tables.md +9 -2
- package/docs/features/workflows.md +10 -4
- package/docs/journeys/developer.md +15 -1
- package/docs/journeys/personal-use.md +21 -4
- package/docs/superpowers/plans/2026-04-07-instance-bootstrap.md +1691 -0
- package/docs/superpowers/plans/2026-04-08-schedule-orchestration.md +2983 -0
- package/docs/superpowers/plans/2026-04-11-schedule-maxturns-api-control.md +551 -0
- package/docs/superpowers/plans/2026-04-11-task-create-profile-validation.md +864 -0
- package/docs/superpowers/plans/2026-04-11-task-runtime-stagent-mcp-injection.md +739 -0
- package/docs/superpowers/specs/2026-04-08-chat-sse-resilience-hotfix-design.md +201 -0
- package/docs/superpowers/specs/2026-04-08-schedule-orchestration-design.md +371 -0
- package/docs/superpowers/specs/2026-04-08-swarm-visibility-design.md +213 -0
- package/package.json +3 -2
- package/src/__tests__/instrumentation-smoke.test.ts +15 -0
- package/src/app/analytics/page.tsx +1 -21
- package/src/app/api/chat/conversations/[id]/messages/route.ts +22 -1
- package/src/app/api/diagnostics/chat-streams/route.ts +65 -0
- package/src/app/api/instance/config/route.ts +41 -0
- package/src/app/api/instance/init/route.ts +34 -0
- package/src/app/api/instance/upgrade/check/route.ts +26 -0
- package/src/app/api/instance/upgrade/route.ts +96 -0
- package/src/app/api/instance/upgrade/status/route.ts +35 -0
- package/src/app/api/memory/route.ts +0 -11
- package/src/app/api/notifications/route.ts +4 -2
- package/src/app/api/projects/[id]/route.ts +5 -155
- package/src/app/api/projects/__tests__/delete-project.test.ts +10 -19
- package/src/app/api/schedules/[id]/execute/route.ts +111 -0
- package/src/app/api/schedules/[id]/route.ts +9 -1
- package/src/app/api/schedules/__tests__/execute-route.test.ts +118 -0
- package/src/app/api/schedules/route.ts +3 -12
- package/src/app/api/settings/openai/login/route.ts +22 -0
- package/src/app/api/settings/openai/logout/route.ts +7 -0
- package/src/app/api/settings/openai/route.ts +21 -1
- package/src/app/api/settings/providers/route.ts +35 -8
- package/src/app/api/tables/[id]/enrich/__tests__/route.test.ts +153 -0
- package/src/app/api/tables/[id]/enrich/plan/route.ts +98 -0
- package/src/app/api/tables/[id]/enrich/route.ts +147 -0
- package/src/app/api/tables/[id]/enrich/runs/route.ts +25 -0
- package/src/app/api/tasks/[id]/execute/route.ts +0 -21
- package/src/app/api/workflows/[id]/resume/route.ts +59 -0
- package/src/app/api/workflows/[id]/status/route.ts +22 -8
- package/src/app/api/workspace/context/route.ts +2 -0
- package/src/app/api/workspace/fix-data-dir/route.ts +81 -0
- package/src/app/chat/page.tsx +11 -0
- package/src/app/inbox/page.tsx +12 -5
- package/src/app/layout.tsx +42 -21
- package/src/app/page.tsx +0 -2
- package/src/app/settings/page.tsx +6 -9
- package/src/components/chat/__tests__/chat-session-provider.test.tsx +408 -0
- package/src/components/chat/chat-command-popover.tsx +2 -2
- package/src/components/chat/chat-input.tsx +2 -3
- package/src/components/chat/chat-session-provider.tsx +720 -0
- package/src/components/chat/chat-shell.tsx +92 -401
- package/src/components/instance/__tests__/instance-section.test.tsx +125 -0
- package/src/components/instance/instance-section.tsx +382 -0
- package/src/components/instance/upgrade-badge.tsx +219 -0
- package/src/components/notifications/__tests__/batch-proposal-review.test.tsx +95 -0
- package/src/components/notifications/__tests__/notification-item.test.tsx +106 -0
- package/src/components/notifications/batch-proposal-review.tsx +20 -5
- package/src/components/notifications/inbox-list.tsx +11 -2
- package/src/components/notifications/notification-item.tsx +56 -2
- package/src/components/notifications/pending-approval-host.tsx +56 -37
- package/src/components/schedules/schedule-create-sheet.tsx +19 -1
- package/src/components/schedules/schedule-edit-sheet.tsx +20 -1
- package/src/components/schedules/schedule-form.tsx +31 -0
- package/src/components/settings/__tests__/providers-runtimes-section.test.tsx +149 -0
- package/src/components/settings/auth-method-selector.tsx +19 -4
- package/src/components/settings/auth-status-badge.tsx +28 -3
- package/src/components/settings/openai-chatgpt-auth-control.tsx +278 -0
- package/src/components/settings/openai-runtime-section.tsx +7 -1
- package/src/components/settings/providers-runtimes-section.tsx +138 -19
- package/src/components/shared/app-sidebar.tsx +4 -3
- package/src/components/shared/command-palette.tsx +4 -5
- package/src/components/shared/theme-toggle.tsx +5 -24
- package/src/components/shared/workspace-indicator.tsx +61 -2
- package/src/components/tables/__tests__/table-enrichment-sheet.test.tsx +130 -0
- package/src/components/tables/table-create-sheet.tsx +4 -0
- package/src/components/tables/table-enrichment-runs.tsx +103 -0
- package/src/components/tables/table-enrichment-sheet.tsx +538 -0
- package/src/components/tables/table-spreadsheet.tsx +29 -5
- package/src/components/tables/table-toolbar.tsx +10 -1
- package/src/components/tasks/kanban-board.tsx +1 -0
- package/src/components/tasks/kanban-column.tsx +53 -14
- package/src/components/tasks/task-bento-grid.tsx +19 -0
- package/src/components/tasks/task-card.tsx +26 -3
- package/src/components/tasks/task-chip-bar.tsx +24 -0
- package/src/components/tasks/task-result-renderer.tsx +1 -1
- package/src/components/workflows/delay-step-body.tsx +109 -0
- package/src/components/workflows/hooks/use-workflow-status.ts +50 -0
- package/src/components/workflows/loop-status-view.tsx +1 -1
- package/src/components/workflows/shared/step-result.tsx +78 -0
- package/src/components/workflows/shared/workflow-header.tsx +141 -0
- package/src/components/workflows/shared/workflow-loading-skeleton.tsx +36 -0
- package/src/components/workflows/swarm-dashboard.tsx +2 -15
- package/src/components/workflows/views/loop-pattern-view.tsx +137 -0
- package/src/components/workflows/views/sequence-pattern-view.tsx +511 -0
- package/src/components/workflows/workflow-form-view.tsx +133 -16
- package/src/components/workflows/workflow-status-view.tsx +30 -740
- package/src/instrumentation-node.ts +94 -0
- package/src/instrumentation.ts +4 -48
- package/src/lib/agents/__tests__/claude-agent.test.ts +199 -0
- package/src/lib/agents/__tests__/execution-manager.test.ts +1 -27
- package/src/lib/agents/__tests__/failure-reason.test.ts +68 -0
- package/src/lib/agents/__tests__/learned-context.test.ts +0 -11
- package/src/lib/agents/__tests__/learning-session.test.ts +158 -0
- package/src/lib/agents/__tests__/pattern-extractor.test.ts +48 -0
- package/src/lib/agents/claude-agent.ts +155 -18
- package/src/lib/agents/execution-manager.ts +0 -35
- package/src/lib/agents/learned-context.ts +0 -12
- package/src/lib/agents/learning-session.ts +18 -5
- package/src/lib/agents/profiles/__tests__/registry.test.ts +6 -4
- package/src/lib/agents/profiles/builtins/upgrade-assistant/SKILL.md +70 -0
- package/src/lib/agents/profiles/builtins/upgrade-assistant/profile.yaml +32 -0
- package/src/lib/agents/runtime/__tests__/openai-codex-auth.test.ts +118 -0
- package/src/lib/agents/runtime/codex-app-server-client.ts +11 -5
- package/src/lib/agents/runtime/openai-codex-auth.ts +389 -0
- package/src/lib/agents/runtime/openai-codex.ts +29 -60
- package/src/lib/agents/runtime/types.ts +8 -0
- package/src/lib/book/chapter-mapping.ts +11 -0
- package/src/lib/book/content.ts +10 -0
- package/src/lib/chat/__tests__/active-streams.test.ts +49 -0
- package/src/lib/chat/__tests__/finalize-safety-net.test.ts +139 -0
- package/src/lib/chat/__tests__/reconcile.test.ts +137 -0
- package/src/lib/chat/__tests__/stream-telemetry.test.ts +151 -0
- package/src/lib/chat/active-streams.ts +27 -0
- package/src/lib/chat/codex-engine.ts +16 -17
- package/src/lib/chat/context-builder.ts +5 -3
- package/src/lib/chat/engine.ts +50 -3
- package/src/lib/chat/reconcile.ts +117 -0
- package/src/lib/chat/stagent-tools.ts +1 -0
- package/src/lib/chat/stream-telemetry.ts +132 -0
- package/src/lib/chat/suggested-prompts.ts +28 -1
- package/src/lib/chat/system-prompt.ts +26 -1
- package/src/lib/chat/tool-catalog.ts +2 -1
- package/src/lib/chat/tools/__tests__/enrich-table-tool.test.ts +127 -0
- package/src/lib/chat/tools/__tests__/schedule-tools.test.ts +261 -0
- package/src/lib/chat/tools/__tests__/task-tools.test.ts +352 -0
- package/src/lib/chat/tools/__tests__/workflow-tools-dedup.test.ts +217 -0
- package/src/lib/chat/tools/document-tools.ts +29 -13
- package/src/lib/chat/tools/helpers.ts +39 -0
- package/src/lib/chat/tools/notification-tools.ts +9 -5
- package/src/lib/chat/tools/project-tools.ts +33 -0
- package/src/lib/chat/tools/schedule-tools.ts +44 -11
- package/src/lib/chat/tools/table-tools.ts +71 -0
- package/src/lib/chat/tools/task-tools.ts +84 -20
- package/src/lib/chat/tools/workflow-tools.ts +234 -32
- package/src/lib/constants/settings.ts +8 -18
- package/src/lib/data/__tests__/clear.test.ts +56 -2
- package/src/lib/data/clear.ts +20 -15
- package/src/lib/data/delete-project.ts +171 -0
- package/src/lib/db/__tests__/bootstrap.test.ts +1 -1
- package/src/lib/db/bootstrap.ts +45 -16
- package/src/lib/db/index.ts +5 -0
- package/src/lib/db/migrations/0009_add_app_instances.sql +25 -0
- package/src/lib/db/migrations/0024_add_workflow_resume_at.sql +10 -0
- package/src/lib/db/migrations/0025_drop_app_instances.sql +3 -0
- package/src/lib/db/migrations/0026_drop_license.sql +3 -0
- package/src/lib/db/migrations/meta/_journal.json +21 -0
- package/src/lib/db/schema.ts +68 -23
- package/src/lib/environment/workspace-context.ts +13 -1
- package/src/lib/import/dedup.ts +4 -54
- package/src/lib/instance/__tests__/bootstrap.test.ts +362 -0
- package/src/lib/instance/__tests__/detect.test.ts +115 -0
- package/src/lib/instance/__tests__/fingerprint.test.ts +48 -0
- package/src/lib/instance/__tests__/git-ops.test.ts +95 -0
- package/src/lib/instance/__tests__/settings.test.ts +83 -0
- package/src/lib/instance/__tests__/upgrade-poller.test.ts +131 -0
- package/src/lib/instance/bootstrap.ts +270 -0
- package/src/lib/instance/detect.ts +49 -0
- package/src/lib/instance/fingerprint.ts +78 -0
- package/src/lib/instance/git-ops.ts +95 -0
- package/src/lib/instance/settings.ts +61 -0
- package/src/lib/instance/types.ts +77 -0
- package/src/lib/instance/upgrade-poller.ts +153 -0
- package/src/lib/notifications/__tests__/visibility.test.ts +51 -0
- package/src/lib/notifications/visibility.ts +33 -0
- package/src/lib/schedules/__tests__/collision-check.test.ts +93 -0
- package/src/lib/schedules/__tests__/config.test.ts +62 -0
- package/src/lib/schedules/__tests__/firing-metrics.test.ts +99 -0
- package/src/lib/schedules/__tests__/integration.test.ts +82 -0
- package/src/lib/schedules/__tests__/slot-claim.test.ts +242 -0
- package/src/lib/schedules/__tests__/tick-scheduler.test.ts +102 -0
- package/src/lib/schedules/__tests__/turn-budget.test.ts +228 -0
- package/src/lib/schedules/collision-check.ts +105 -0
- package/src/lib/schedules/config.ts +53 -0
- package/src/lib/schedules/scheduler.ts +232 -13
- package/src/lib/schedules/slot-claim.ts +105 -0
- package/src/lib/settings/__tests__/openai-auth.test.ts +101 -0
- package/src/lib/settings/__tests__/openai-login-manager.test.ts +64 -0
- package/src/lib/settings/__tests__/runtime-setup.test.ts +33 -0
- package/src/lib/settings/openai-auth.ts +105 -10
- package/src/lib/settings/openai-login-manager.ts +260 -0
- package/src/lib/settings/runtime-setup.ts +14 -4
- package/src/lib/tables/__tests__/enrichment-planner.test.ts +124 -0
- package/src/lib/tables/__tests__/enrichment.test.ts +147 -0
- package/src/lib/tables/enrichment-planner.ts +454 -0
- package/src/lib/tables/enrichment.ts +328 -0
- package/src/lib/tables/query-builder.ts +5 -2
- package/src/lib/tables/trigger-evaluator.ts +3 -2
- package/src/lib/theme.ts +71 -0
- package/src/lib/usage/ledger.ts +2 -18
- package/src/lib/util/__tests__/similarity.test.ts +106 -0
- package/src/lib/util/similarity.ts +77 -0
- package/src/lib/utils/format-timestamp.ts +24 -0
- package/src/lib/utils/stagent-paths.ts +12 -0
- package/src/lib/validators/__tests__/blueprint.test.ts +172 -0
- package/src/lib/validators/__tests__/settings.test.ts +10 -0
- package/src/lib/validators/blueprint.ts +70 -9
- package/src/lib/validators/profile.ts +2 -2
- package/src/lib/validators/settings.ts +3 -1
- package/src/lib/workflows/__tests__/delay.test.ts +196 -0
- package/src/lib/workflows/__tests__/engine.test.ts +8 -0
- package/src/lib/workflows/__tests__/loop-executor.test.ts +54 -0
- package/src/lib/workflows/__tests__/post-action.test.ts +108 -0
- package/src/lib/workflows/blueprints/instantiator.ts +22 -1
- package/src/lib/workflows/blueprints/types.ts +10 -2
- package/src/lib/workflows/delay.ts +106 -0
- package/src/lib/workflows/engine.ts +207 -4
- package/src/lib/workflows/loop-executor.ts +349 -24
- package/src/lib/workflows/post-action.ts +91 -0
- package/src/lib/workflows/types.ts +166 -1
- package/src/app/api/license/checkout/route.ts +0 -28
- package/src/app/api/license/portal/route.ts +0 -26
- package/src/app/api/license/route.ts +0 -89
- package/src/app/api/license/usage/route.ts +0 -63
- package/src/app/api/marketplace/browse/route.ts +0 -15
- package/src/app/api/marketplace/import/route.ts +0 -28
- package/src/app/api/marketplace/publish/route.ts +0 -40
- package/src/app/api/onboarding/email/route.ts +0 -53
- package/src/app/api/settings/telemetry/route.ts +0 -14
- package/src/app/api/sync/export/route.ts +0 -54
- package/src/app/api/sync/restore/route.ts +0 -37
- package/src/app/api/sync/sessions/route.ts +0 -24
- package/src/app/auth/callback/route.ts +0 -73
- package/src/app/marketplace/page.tsx +0 -19
- package/src/components/analytics/analytics-gate-card.tsx +0 -101
- package/src/components/marketplace/blueprint-card.tsx +0 -61
- package/src/components/marketplace/marketplace-browser.tsx +0 -131
- package/src/components/onboarding/email-capture-card.tsx +0 -104
- package/src/components/settings/activation-form.tsx +0 -95
- package/src/components/settings/cloud-account-section.tsx +0 -147
- package/src/components/settings/cloud-sync-section.tsx +0 -155
- package/src/components/settings/subscription-section.tsx +0 -410
- package/src/components/settings/telemetry-section.tsx +0 -80
- package/src/components/shared/premium-gate-overlay.tsx +0 -50
- package/src/components/shared/schedule-gate-dialog.tsx +0 -64
- package/src/components/shared/upgrade-banner.tsx +0 -112
- package/src/hooks/use-supabase-auth.ts +0 -79
- package/src/lib/billing/email.ts +0 -54
- package/src/lib/billing/products.ts +0 -80
- package/src/lib/billing/stripe.ts +0 -101
- package/src/lib/cloud/supabase-browser.ts +0 -32
- package/src/lib/cloud/supabase-client.ts +0 -56
- package/src/lib/license/__tests__/features.test.ts +0 -56
- package/src/lib/license/__tests__/key-format.test.ts +0 -88
- package/src/lib/license/__tests__/manager.test.ts +0 -64
- package/src/lib/license/__tests__/tier-limits.test.ts +0 -79
- package/src/lib/license/cloud-validation.ts +0 -60
- package/src/lib/license/features.ts +0 -44
- package/src/lib/license/key-format.ts +0 -101
- package/src/lib/license/limit-check.ts +0 -111
- package/src/lib/license/limit-queries.ts +0 -51
- package/src/lib/license/manager.ts +0 -345
- package/src/lib/license/notifications.ts +0 -59
- package/src/lib/license/tier-limits.ts +0 -71
- package/src/lib/marketplace/marketplace-client.ts +0 -107
- package/src/lib/sync/cloud-sync.ts +0 -235
- package/src/lib/telemetry/conversion-events.ts +0 -71
- package/src/lib/telemetry/queue.ts +0 -122
- package/src/lib/validators/license.ts +0 -33
package/README.md
CHANGED
|
@@ -39,47 +39,6 @@ The AI agent stack is broken for business operators. You can spin up an agent in
|
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
|
-
## Community & Premium Editions
|
|
43
|
-
|
|
44
|
-
Stagent is **free and fully functional** as a local-first tool. The Community Edition (Apache 2.0) includes everything you need to run AI agents, workflows, and schedules on your machine. Premium tiers add cloud sync, expanded limits, marketplace access, and analytics for power users and teams.
|
|
45
|
-
|
|
46
|
-
### Feature Comparison
|
|
47
|
-
|
|
48
|
-
| Capability | Community (Free) | Premium |
|
|
49
|
-
|---|---|---|
|
|
50
|
-
| Local tasks & workflows | Unlimited | Unlimited |
|
|
51
|
-
| Agent profiles | All built-in | All built-in |
|
|
52
|
-
| Human-in-the-loop approval | Full | Full |
|
|
53
|
-
| Agent memories per profile | 50 | 200 - Unlimited |
|
|
54
|
-
| Learned context versions | 10 | 50 - Unlimited |
|
|
55
|
-
| Active schedules | 5 | 20 - Unlimited |
|
|
56
|
-
| History retention | 30 days | 180 days - Unlimited |
|
|
57
|
-
| Cloud sync & backup | — | Solo and above |
|
|
58
|
-
| Marketplace blueprints | Browse only | Import & Publish |
|
|
59
|
-
| Outcome analytics | — | Operator and above |
|
|
60
|
-
|
|
61
|
-
### Soft Limits
|
|
62
|
-
|
|
63
|
-
| Resource | Community Limit | At Limit |
|
|
64
|
-
|---|---|---|
|
|
65
|
-
| Agent memories | 50 per profile | New writes blocked, existing preserved |
|
|
66
|
-
| Context versions | 10 per profile | New proposals blocked |
|
|
67
|
-
| Active schedules | 5 | New schedule creation returns 402 |
|
|
68
|
-
| Task history | 30 days | Older entries pruned daily |
|
|
69
|
-
|
|
70
|
-
### Pricing
|
|
71
|
-
|
|
72
|
-
| Tier | Price | Best For |
|
|
73
|
-
|---|---|---|
|
|
74
|
-
| Community | Free forever | Individual developers, evaluation |
|
|
75
|
-
| Solo | $19/mo | Power users, expanded limits |
|
|
76
|
-
| Operator | $49/mo | Professionals, analytics, cloud sync |
|
|
77
|
-
| Scale | $99/mo | Teams, marketplace publishing, unlimited |
|
|
78
|
-
|
|
79
|
-
[Get Premium →](https://stagent.io/pricing)
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
42
|
## Runtime Bridge
|
|
84
43
|
|
|
85
44
|
Run the same business process on different AI providers without changing a line of configuration. Stagent's shared runtime registry routes tasks, schedules, and workflow steps through **Claude Code** (Anthropic Claude Agent SDK) and **OpenAI Codex App Server**, landing everything in the same inbox, monitoring, and cost surfaces. Switching providers is a settings change, not a rewrite.
|
|
@@ -123,7 +82,11 @@ Run the same business process on different AI providers without changing a line
|
|
|
123
82
|
|
|
124
83
|
## Architecture
|
|
125
84
|
|
|
126
|
-
<
|
|
85
|
+
<picture>
|
|
86
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/architecture-dark.svg">
|
|
87
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/architecture-light.svg">
|
|
88
|
+
<img src="https://raw.githubusercontent.com/navam-io/stagent/main/public/readme/architecture-light.svg" alt="Stagent architecture diagram" width="900" />
|
|
89
|
+
</picture>
|
|
127
90
|
|
|
128
91
|
**Key design decisions:**
|
|
129
92
|
|
package/dist/cli.js
CHANGED
|
@@ -130,8 +130,8 @@ var STAGENT_TABLES = [
|
|
|
130
130
|
"user_table_triggers",
|
|
131
131
|
"user_table_row_history",
|
|
132
132
|
"snapshots",
|
|
133
|
-
"
|
|
134
|
-
"
|
|
133
|
+
"workflow_execution_stats",
|
|
134
|
+
"schedule_firing_metrics"
|
|
135
135
|
];
|
|
136
136
|
function bootstrapStagentDatabase(sqlite2) {
|
|
137
137
|
sqlite2.exec(`
|
|
@@ -175,6 +175,7 @@ function bootstrapStagentDatabase(sqlite2) {
|
|
|
175
175
|
status TEXT DEFAULT 'draft' NOT NULL,
|
|
176
176
|
run_number INTEGER DEFAULT 0 NOT NULL,
|
|
177
177
|
runtime_id TEXT,
|
|
178
|
+
resume_at INTEGER,
|
|
178
179
|
created_at INTEGER NOT NULL,
|
|
179
180
|
updated_at INTEGER NOT NULL,
|
|
180
181
|
FOREIGN KEY (project_id) REFERENCES projects(id) ON UPDATE NO ACTION ON DELETE NO ACTION
|
|
@@ -276,6 +277,32 @@ function bootstrapStagentDatabase(sqlite2) {
|
|
|
276
277
|
CREATE INDEX IF NOT EXISTS idx_schedules_next_fire_at ON schedules(next_fire_at);
|
|
277
278
|
CREATE INDEX IF NOT EXISTS idx_schedules_project_id ON schedules(project_id);
|
|
278
279
|
|
|
280
|
+
-- schedule_firing_metrics is placed here (between schedules indexes and
|
|
281
|
+
-- notifications indexes) to satisfy its foreign-key dependency on schedules.
|
|
282
|
+
-- Future tables with FK dependencies should follow the same "place after
|
|
283
|
+
-- parent table" discipline rather than batching all CREATE TABLE at the top.
|
|
284
|
+
CREATE TABLE IF NOT EXISTS schedule_firing_metrics (
|
|
285
|
+
id TEXT PRIMARY KEY NOT NULL,
|
|
286
|
+
schedule_id TEXT NOT NULL,
|
|
287
|
+
task_id TEXT,
|
|
288
|
+
fired_at INTEGER NOT NULL,
|
|
289
|
+
slot_claimed_at INTEGER,
|
|
290
|
+
completed_at INTEGER,
|
|
291
|
+
slot_wait_ms INTEGER,
|
|
292
|
+
duration_ms INTEGER,
|
|
293
|
+
turn_count INTEGER,
|
|
294
|
+
max_turns_at_firing INTEGER,
|
|
295
|
+
event_loop_lag_ms REAL,
|
|
296
|
+
peak_rss_mb INTEGER,
|
|
297
|
+
chat_streams_active INTEGER,
|
|
298
|
+
concurrent_schedules INTEGER,
|
|
299
|
+
failure_reason TEXT,
|
|
300
|
+
FOREIGN KEY (schedule_id) REFERENCES schedules(id) ON UPDATE NO ACTION ON DELETE NO ACTION,
|
|
301
|
+
FOREIGN KEY (task_id) REFERENCES tasks(id) ON UPDATE NO ACTION ON DELETE NO ACTION
|
|
302
|
+
);
|
|
303
|
+
|
|
304
|
+
CREATE INDEX IF NOT EXISTS idx_sfm_schedule_time ON schedule_firing_metrics(schedule_id, fired_at);
|
|
305
|
+
|
|
279
306
|
CREATE INDEX IF NOT EXISTS idx_notifications_task_id ON notifications(task_id);
|
|
280
307
|
CREATE INDEX IF NOT EXISTS idx_notifications_read ON notifications(read);
|
|
281
308
|
CREATE INDEX IF NOT EXISTS idx_documents_task_id ON documents(task_id);
|
|
@@ -344,6 +371,7 @@ function bootstrapStagentDatabase(sqlite2) {
|
|
|
344
371
|
|
|
345
372
|
CREATE INDEX IF NOT EXISTS idx_views_surface ON views(surface);
|
|
346
373
|
CREATE INDEX IF NOT EXISTS idx_views_surface_default ON views(surface, is_default);
|
|
374
|
+
|
|
347
375
|
`);
|
|
348
376
|
const addColumnIfMissing = (ddl) => {
|
|
349
377
|
try {
|
|
@@ -380,6 +408,7 @@ function bootstrapStagentDatabase(sqlite2) {
|
|
|
380
408
|
addColumnIfMissing(`ALTER TABLE documents ADD COLUMN source TEXT DEFAULT 'upload';`);
|
|
381
409
|
addColumnIfMissing(`ALTER TABLE documents ADD COLUMN conversation_id TEXT REFERENCES conversations(id);`);
|
|
382
410
|
addColumnIfMissing(`ALTER TABLE documents ADD COLUMN message_id TEXT;`);
|
|
411
|
+
addColumnIfMissing(`ALTER TABLE workflows ADD COLUMN resume_at INTEGER;`);
|
|
383
412
|
sqlite2.exec(`CREATE INDEX IF NOT EXISTS idx_documents_source ON documents(source);`);
|
|
384
413
|
sqlite2.exec(`CREATE INDEX IF NOT EXISTS idx_documents_conversation_id ON documents(conversation_id);`);
|
|
385
414
|
sqlite2.exec(`
|
|
@@ -605,6 +634,15 @@ function bootstrapStagentDatabase(sqlite2) {
|
|
|
605
634
|
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN failure_streak INTEGER DEFAULT 0 NOT NULL;`);
|
|
606
635
|
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN last_failure_reason TEXT;`);
|
|
607
636
|
addColumnIfMissing(`ALTER TABLE channel_configs ADD COLUMN direction TEXT DEFAULT 'outbound' NOT NULL;`);
|
|
637
|
+
addColumnIfMissing(`ALTER TABLE tasks ADD COLUMN slot_claimed_at INTEGER;`);
|
|
638
|
+
addColumnIfMissing(`ALTER TABLE tasks ADD COLUMN lease_expires_at INTEGER;`);
|
|
639
|
+
addColumnIfMissing(`ALTER TABLE tasks ADD COLUMN failure_reason TEXT;`);
|
|
640
|
+
addColumnIfMissing(`ALTER TABLE tasks ADD COLUMN max_turns INTEGER;`);
|
|
641
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN max_turns INTEGER;`);
|
|
642
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN max_turns_set_at INTEGER;`);
|
|
643
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN max_run_duration_sec INTEGER;`);
|
|
644
|
+
addColumnIfMissing(`ALTER TABLE schedules ADD COLUMN turn_budget_breach_streak INTEGER DEFAULT 0 NOT NULL;`);
|
|
645
|
+
sqlite2.exec(`CREATE INDEX IF NOT EXISTS idx_tasks_running_scheduled ON tasks(status, source_type, lease_expires_at);`);
|
|
608
646
|
sqlite2.exec(`
|
|
609
647
|
CREATE TABLE IF NOT EXISTS channel_bindings (
|
|
610
648
|
id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -902,21 +940,6 @@ function bootstrapStagentDatabase(sqlite2) {
|
|
|
902
940
|
CREATE INDEX IF NOT EXISTS idx_snapshots_type ON snapshots(type);
|
|
903
941
|
CREATE INDEX IF NOT EXISTS idx_snapshots_created_at ON snapshots(created_at);
|
|
904
942
|
|
|
905
|
-
CREATE TABLE IF NOT EXISTS license (
|
|
906
|
-
id TEXT PRIMARY KEY NOT NULL,
|
|
907
|
-
supabase_user_id TEXT,
|
|
908
|
-
tier TEXT DEFAULT 'community' NOT NULL,
|
|
909
|
-
status TEXT DEFAULT 'inactive' NOT NULL,
|
|
910
|
-
email TEXT,
|
|
911
|
-
activated_at INTEGER,
|
|
912
|
-
expires_at INTEGER,
|
|
913
|
-
last_validated_at INTEGER,
|
|
914
|
-
grace_period_expires_at INTEGER,
|
|
915
|
-
encrypted_token TEXT,
|
|
916
|
-
created_at INTEGER NOT NULL,
|
|
917
|
-
updated_at INTEGER NOT NULL
|
|
918
|
-
);
|
|
919
|
-
|
|
920
943
|
CREATE TABLE IF NOT EXISTS workflow_execution_stats (
|
|
921
944
|
id TEXT PRIMARY KEY,
|
|
922
945
|
pattern TEXT NOT NULL,
|
|
@@ -1010,7 +1033,8 @@ Examples:
|
|
|
1010
1033
|
node dist/cli.js --data-dir ~/.stagent-dogfood --port 3100
|
|
1011
1034
|
`;
|
|
1012
1035
|
}
|
|
1013
|
-
program.name("stagent").description("AI Business Operating System").version(pkg.version).addHelpText("after", getHelpText).option("-p, --port <number>", "port to start on", "3000").option("--data-dir <path>", "custom data directory (overrides STAGENT_DATA_DIR)").option("--reset", "delete the local database before starting").option("--no-open", "don't auto-open browser")
|
|
1036
|
+
program.name("stagent").description("AI Business Operating System").version(pkg.version).addHelpText("after", getHelpText).option("-p, --port <number>", "port to start on", "3000").option("--data-dir <path>", "custom data directory (overrides STAGENT_DATA_DIR)").option("--reset", "delete the local database before starting").option("--no-open", "don't auto-open browser");
|
|
1037
|
+
program.parse();
|
|
1014
1038
|
var opts = program.opts();
|
|
1015
1039
|
if (opts.dataDir) {
|
|
1016
1040
|
process.env.STAGENT_DATA_DIR = opts.dataDir;
|
package/docs/.coverage-gaps.json
CHANGED
|
@@ -1,71 +1,29 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generated": "2026-04-
|
|
2
|
+
"generated": "2026-04-08T20:00:00Z",
|
|
3
3
|
"summary": {
|
|
4
|
-
"totalFeatures":
|
|
5
|
-
"coveredFeatures":
|
|
6
|
-
"gapCount":
|
|
4
|
+
"totalFeatures": 86,
|
|
5
|
+
"coveredFeatures": 85,
|
|
6
|
+
"gapCount": 1,
|
|
7
7
|
"unusedScreenshotCount": 0,
|
|
8
8
|
"brokenReferences": 0,
|
|
9
|
-
"orphanedImages":
|
|
9
|
+
"orphanedImages": 0
|
|
10
10
|
},
|
|
11
11
|
"gaps": [
|
|
12
|
-
{
|
|
13
|
-
"feature": "book-content-merge",
|
|
14
|
-
"category": "Living Book",
|
|
15
|
-
"screenshots": ["book-list.png"],
|
|
16
|
-
"journeyCoverage": [],
|
|
17
|
-
"suggestedPersona": "personal",
|
|
18
|
-
"note": "Book reader captured but not referenced in any journey"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"feature": "book-reading-paths",
|
|
22
|
-
"category": "Living Book",
|
|
23
|
-
"screenshots": ["book-list.png"],
|
|
24
|
-
"journeyCoverage": [],
|
|
25
|
-
"suggestedPersona": "personal",
|
|
26
|
-
"note": "Book navigation not in any journey"
|
|
27
|
-
},
|
|
28
12
|
{
|
|
29
13
|
"feature": "tables-document-import",
|
|
30
14
|
"category": "Structured Data",
|
|
31
15
|
"screenshots": [],
|
|
32
16
|
"journeyCoverage": ["work-use"],
|
|
33
17
|
"suggestedPersona": "work",
|
|
34
|
-
"note": "Import wizard
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"feature": "database-snapshot-backup",
|
|
38
|
-
"category": "Platform",
|
|
39
|
-
"screenshots": ["settings-snapshots.png"],
|
|
40
|
-
"journeyCoverage": [],
|
|
41
|
-
"suggestedPersona": "developer",
|
|
42
|
-
"note": "New feature - settings snapshot card captured, not yet in any journey"
|
|
18
|
+
"note": "Import wizard has no dedicated screenshot. The feature is referenced narratively in the Work journey at Step 7, but a dedicated capture is blocked by the Tables list being empty (no seed data). Residual gap — revisit after seeding sample tables."
|
|
43
19
|
}
|
|
44
20
|
],
|
|
45
|
-
"brokenReferences": [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{ "file": "personal-use.md", "screenshot": "dashboard-card-detail.png", "status": "STALE", "note": "Old screenshot in public/readme/" },
|
|
53
|
-
{ "file": "personal-use.md", "screenshot": "settings-channels.png", "status": "STALE", "note": "Old screenshot in public/readme/" },
|
|
54
|
-
{ "file": "power-user.md", "screenshot": "settings-ollama-connected.png", "status": "STALE", "note": "Old screenshot in public/readme/" },
|
|
55
|
-
{ "file": "power-user.md", "screenshot": "chat-model-selector.png", "status": "STALE", "note": "Old screenshot in public/readme/" },
|
|
56
|
-
{ "file": "power-user.md", "screenshot": "schedules-detail.png", "status": "STALE", "note": "Old screenshot in public/readme/" },
|
|
57
|
-
{ "file": "power-user.md", "screenshot": "chat-create-tab.png", "status": "STALE", "note": "Old screenshot in public/readme/" },
|
|
58
|
-
{ "file": "work-use.md", "screenshot": "chat-conversation.png", "status": "STALE", "note": "Old screenshot in public/readme/" },
|
|
59
|
-
{ "file": "work-use.md", "screenshot": "settings-channels.png", "status": "STALE", "note": "Old screenshot in public/readme/" }
|
|
60
|
-
],
|
|
61
|
-
"orphanedImages": [
|
|
62
|
-
"book-chapter-header.png", "book-chapter-nav.png", "book-reader.png",
|
|
63
|
-
"book-settings.png", "book-toc.png", "book-try-it-now.png",
|
|
64
|
-
"chat-conversation.png", "chat-create-tab.png", "chat-model-selector.png",
|
|
65
|
-
"chat-quick-access.png", "dashboard-card-detail.png", "playbook-list.png",
|
|
66
|
-
"schedules-detail.png", "schedules-edit-form.png", "settings-browser-tools.png",
|
|
67
|
-
"settings-channels-add-form.png", "settings-channels-telegram-form.png",
|
|
68
|
-
"settings-channels-webhook-form.png", "settings-channels.png",
|
|
69
|
-
"settings-ollama-connected.png"
|
|
21
|
+
"brokenReferences": [],
|
|
22
|
+
"orphanedImages": [],
|
|
23
|
+
"notes": [
|
|
24
|
+
"Closed 3 of 4 prior gaps: book-content-merge, book-reading-paths, database-snapshot-backup.",
|
|
25
|
+
"Closed 14 prior broken references — journey docs now reference only fixtures that exist in public/readme/.",
|
|
26
|
+
"Cleared 20 orphaned images by overwriting public/readme/ with the fresh screengrab set.",
|
|
27
|
+
"Added 4 new feature entries to reflect schedule-orchestration-v2, workflow-step-delays, bulk-row-enrichment, instance-bootstrap/upgrade-session/license-metering."
|
|
70
28
|
]
|
|
71
29
|
}
|
package/docs/.last-generated
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2026-04-
|
|
1
|
+
2026-04-08T20:00:00Z
|
|
@@ -51,6 +51,10 @@ The Codex runtime connects to the OpenAI Codex App Server over WebSocket using J
|
|
|
51
51
|
|
|
52
52
|
- Resumable threads with persistent state across reconnections.
|
|
53
53
|
- WebSocket transport for low-latency bidirectional communication.
|
|
54
|
+
- Two auth modes for Codex App Server:
|
|
55
|
+
- **ChatGPT** -- browser sign-in tied to your ChatGPT plan, with cached session reuse in Stagent's isolated Codex home
|
|
56
|
+
- **API Key** -- direct API-key auth using `OPENAI_API_KEY`
|
|
57
|
+
- OpenAI Direct remains a separate API-key-backed runtime even when Codex App Server uses ChatGPT auth.
|
|
54
58
|
|
|
55
59
|
### OpenAI Direct API Runtime
|
|
56
60
|
|
|
@@ -3,10 +3,10 @@ title: "Schedules"
|
|
|
3
3
|
category: "feature-reference"
|
|
4
4
|
section: "schedules"
|
|
5
5
|
route: "/schedules"
|
|
6
|
-
tags: ["schedules", "automation", "recurring", "prompts", "heartbeat", "natural-language", "proactive"]
|
|
7
|
-
features: ["scheduled-prompt-loops", "heartbeat-scheduler", "natural-language-scheduling"]
|
|
8
|
-
screengrabCount:
|
|
9
|
-
lastUpdated: "2026-
|
|
6
|
+
tags: ["schedules", "automation", "recurring", "prompts", "heartbeat", "natural-language", "proactive", "orchestration", "concurrency"]
|
|
7
|
+
features: ["scheduled-prompt-loops", "heartbeat-scheduler", "natural-language-scheduling", "schedule-orchestration-v2"]
|
|
8
|
+
screengrabCount: 4
|
|
9
|
+
lastUpdated: "2026-04-08"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# Schedules
|
|
@@ -21,6 +21,12 @@ Automate recurring AI prompts on configurable intervals with two distinct schedu
|
|
|
21
21
|

|
|
22
22
|
*The schedule detail sheet shows full configuration, checklist items (for heartbeats), execution statistics, and chronological firing history.*
|
|
23
23
|
|
|
24
|
+

|
|
25
|
+
*The Create Schedule sheet exposes the new per-schedule turn-budget field. Max agent steps per run caps how many actions the agent takes in a single firing before the runtime aborts.*
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
*Filled schedule form showing a weekday 9am security audit with a 250-step budget. Writing "MAX N turns" in your prompt is a hint to the model — the Max agent steps field is the enforced runtime limit.*
|
|
29
|
+
|
|
24
30
|
## Key Features
|
|
25
31
|
|
|
26
32
|
### Two Schedule Types
|
|
@@ -66,6 +72,28 @@ Every schedule firing creates a tracked child task. The detail view shows a chro
|
|
|
66
72
|
### Pause and Resume
|
|
67
73
|
Suspend a schedule without losing its configuration or execution history. Pausing stops future runs while preserving the next-run calculation, so resuming picks up right where it left off.
|
|
68
74
|
|
|
75
|
+
## Orchestration & Safety
|
|
76
|
+
|
|
77
|
+
Schedule orchestration v2 adds four orchestration primitives that keep concurrent schedules, long-running firings, and noisy prompts from destabilising the workspace.
|
|
78
|
+
|
|
79
|
+
### Global Concurrency Cap
|
|
80
|
+
A configurable ceiling on how many scheduled runs can execute simultaneously. When the cap is reached, new firings are queued rather than launched in parallel. The atomic slot-claim primitive ensures that two schedules firing at the exact same tick cannot both slip past the limit — at most one claims each available slot. The cap adapts to chat pressure: active streaming chat sessions count against the ceiling so scheduled runs do not contend with interactive work.
|
|
81
|
+
|
|
82
|
+
### Lease Reaper
|
|
83
|
+
Each running firing holds a lease recorded in the slot registry. A background reaper periodically checks for stale leases — firings whose host process died or whose runtime never responded — and reclaims their slots via `AbortController`. This is the safety net that prevents hung runs from permanently occupying capacity.
|
|
84
|
+
|
|
85
|
+
### Pre-Flight Cron Collision Warning
|
|
86
|
+
When you save a schedule whose cron expression overlaps with an existing schedule (both would fire in the same minute on the same day), the form shows a warning banner at save time listing the conflicting schedules. You can still save — collisions are not blocked — but you see the conflict before committing so you can spread the load if desired.
|
|
87
|
+
|
|
88
|
+
### Per-Schedule Turn Budget
|
|
89
|
+
The **Max agent steps per run** field caps the number of agent actions (messages, tool calls, sub-responses) allowed in a single firing. The runtime enforces this as a hard limit — not a prompt hint — and emits an explicit `failure_reason` if the budget is exceeded. Most schedules run comfortably in the 50–500 step range; heavy research runs sometimes need 2,000+. A separate streak counter grants one grace breach before the schedule is auto-paused, so a single over-budget run does not kill a stable schedule.
|
|
90
|
+
|
|
91
|
+
### Manual Execute with Force-Bypass
|
|
92
|
+
The schedule detail view exposes a manual execute action that runs the schedule once, immediately, without waiting for the next scheduled tick. Manual runs still honour the concurrency cap by default; power users can force-bypass the cap for urgent one-off runs, with the bypass recorded in the audit ledger as a `manual_force_bypass` usage event.
|
|
93
|
+
|
|
94
|
+
### Firing Metrics for Tuning
|
|
95
|
+
Every firing writes a row into `schedule_firing_metrics` capturing start time, end time, steps consumed, tool calls made, and terminal reason. This is the forensic trail you use to tune `Max agent steps`, detect runaway prompts, and spot schedules that routinely run close to their budget.
|
|
96
|
+
|
|
69
97
|
## How To
|
|
70
98
|
|
|
71
99
|
### Create a Clock-Driven Schedule
|
|
@@ -3,10 +3,10 @@ title: "Settings"
|
|
|
3
3
|
category: "feature-reference"
|
|
4
4
|
section: "settings"
|
|
5
5
|
route: "/settings"
|
|
6
|
-
tags: ["settings", "configuration", "auth", "runtime", "browser-tools", "permissions", "budget", "ollama", "channels"]
|
|
7
|
-
features: ["session-management", "tool-permission-persistence", "tool-permission-presets", "browser-use", "spend-budget-guardrails", "settings-interactive-controls", "ollama-runtime-provider", "multi-channel-delivery", "bidirectional-channel-chat", "database-snapshot-backup"]
|
|
8
|
-
screengrabCount:
|
|
9
|
-
lastUpdated: "2026-04-
|
|
6
|
+
tags: ["settings", "configuration", "auth", "runtime", "browser-tools", "permissions", "budget", "ollama", "channels", "instance", "upgrade"]
|
|
7
|
+
features: ["session-management", "tool-permission-persistence", "tool-permission-presets", "browser-use", "spend-budget-guardrails", "settings-interactive-controls", "ollama-runtime-provider", "multi-channel-delivery", "bidirectional-channel-chat", "database-snapshot-backup", "instance-bootstrap", "upgrade-detection", "upgrade-session", "instance-license-metering"]
|
|
8
|
+
screengrabCount: 11
|
|
9
|
+
lastUpdated: "2026-04-08"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# Settings
|
|
@@ -49,7 +49,7 @@ The Settings page is the central configuration hub for Stagent. From a single sc
|
|
|
49
49
|
|
|
50
50
|
### Authentication
|
|
51
51
|
|
|
52
|
-
Choose how Stagent connects to
|
|
52
|
+
Choose how Stagent connects to each provider runtime. For **Anthropic**, **OAuth** uses your existing Max subscription at no additional API cost, while **API Key** uses the Anthropic key stored in your environment. For **OpenAI**, Codex App Server can use either an **OpenAI API key** or **ChatGPT** browser sign-in, while OpenAI Direct continues to use an API key. Connection tests validate the currently selected runtime mode and the OpenAI section shows active ChatGPT account and Codex rate-limit state when available.
|
|
53
53
|
|
|
54
54
|
### Ollama Runtime (Local Models)
|
|
55
55
|
|
|
@@ -172,6 +172,29 @@ Protect your workspace with automatic and manual database backups:
|
|
|
172
172
|
2. Toggle on the preset that matches your comfort level.
|
|
173
173
|
3. The preset's tools are added to your approved list immediately.
|
|
174
174
|
|
|
175
|
+
## Instance & Upgrades
|
|
176
|
+
|
|
177
|
+

|
|
178
|
+
*The Instance section shows the installation metadata and the upgrade flow entry point.*
|
|
179
|
+
|
|
180
|
+
### Instance Section
|
|
181
|
+
The **Instance** card surfaces metadata about this installation: the stable `instanceId`, the current instance branch (e.g., `local` for single-clone users, `wealth-mgr` for private instances), the upstream remote it tracks, and whether the first-boot bootstrap has completed. Power users also see the guardrail state — whether a pre-push hook is installed and whether `pushRemote=no_push` is set on the instance branch.
|
|
182
|
+
|
|
183
|
+
### Dev Mode Gate
|
|
184
|
+
When `STAGENT_DEV_MODE=true` is set in `.env.local` or the `.git/stagent-dev-mode` sentinel file is present, the Instance section displays a "Dev mode" banner and the upgrade machinery is intentionally bypassed. This is the gate that protects the main dev repo from having a pre-push hook installed by the instance-bootstrap flow — contributors working on Stagent itself must not have their own push workflow broken.
|
|
185
|
+
|
|
186
|
+
### Upgrade Detection
|
|
187
|
+
An hourly scheduled poll runs `git fetch` against the upstream remote and compares `HEAD` to `origin/main`. When upstream is ahead, the sidebar shows a small **Upgrade available** badge next to Settings and the Instance card surfaces a "New version available" card with the number of commits behind. Detection is `git`-based rather than GitHub REST to avoid rate limits. Three consecutive poll failures escalate to a persistent notification.
|
|
188
|
+
|
|
189
|
+
### Upgrade Session
|
|
190
|
+
Clicking **Start upgrade** opens the upgrade session as a right-side sheet — not a full-page navigation, so you can glance back at your workspace while the upgrade runs. The session is backed by a task row with the `upgrade-assistant` profile, so it reuses all the existing execution infrastructure: fire-and-forget launch, canUseTool approval caching, SSE log streaming, and conflict resolution via the pending-approval host. If merge conflicts occur, a 3-card cluster (Keep mine / Take theirs / Show diff) appears inline and you resolve them without leaving the sheet.
|
|
191
|
+
|
|
192
|
+
### Footer Upgrade Button
|
|
193
|
+
A subtle **Upgrade** button appears in the sidebar footer once an upgrade is available — the same surface that shows trust tier and the command palette shortcut. Clicking it opens the same upgrade session sheet from any page without navigating to Settings first.
|
|
194
|
+
|
|
195
|
+
### Hybrid Licensing
|
|
196
|
+
Local-only features (task execution, workflows, schedules, tables) remain unlimited regardless of license state. Cloud features (sync, marketplace, team sharing) are metered via a `(email, machineFingerprint, instanceId)` tuple so the same user on the same machine counts as one seat across multiple instance branches. Seat state is refreshed on each boot via the LicenseManager.
|
|
197
|
+
|
|
175
198
|
## Related
|
|
176
199
|
|
|
177
200
|
- [Cost & Usage](./cost-usage.md)
|
package/docs/features/tables.md
CHANGED
|
@@ -4,9 +4,9 @@ category: "feature-reference"
|
|
|
4
4
|
section: "tables"
|
|
5
5
|
route: "/tables"
|
|
6
6
|
tags: [tables, structured-data, spreadsheet, charts, triggers, templates, import, export, formulas]
|
|
7
|
-
features: ["tables-data-layer", "tables-list-page", "tables-spreadsheet-editor", "tables-document-import", "tables-template-gallery", "tables-agent-integration", "tables-chat-queries", "tables-computed-columns", "tables-cross-joins", "tables-agent-charts", "tables-workflow-triggers", "tables-nl-creation", "tables-export", "tables-versioning"]
|
|
7
|
+
features: ["tables-data-layer", "tables-list-page", "tables-spreadsheet-editor", "tables-document-import", "tables-template-gallery", "tables-agent-integration", "tables-chat-queries", "tables-computed-columns", "tables-cross-joins", "tables-agent-charts", "tables-workflow-triggers", "tables-nl-creation", "tables-export", "tables-versioning", "bulk-row-enrichment"]
|
|
8
8
|
screengrabCount: 8
|
|
9
|
-
lastUpdated: "2026-04-
|
|
9
|
+
lastUpdated: "2026-04-08"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# Tables
|
|
@@ -114,6 +114,13 @@ Every row edit is tracked. The History tab shows a timeline of changes, and you
|
|
|
114
114
|
2. The agent will use its table tools to read, filter, aggregate, or update the data as needed.
|
|
115
115
|
3. Results appear in the task output, and any row changes are reflected in the table immediately.
|
|
116
116
|
|
|
117
|
+
### Bulk Row Enrichment
|
|
118
|
+
Enrich every matching row in a table by generating a loop workflow that iterates over the rows and writes results back via a `postAction`. Trigger it two ways:
|
|
119
|
+
- **From chat:** ask "enrich the Leads table with a one-line company summary for each row" — the `enrich_table` chat tool plans a loop workflow scoped to the matching rows.
|
|
120
|
+
- **From the Tables API:** `POST /api/tables/:id/enrich` with a prompt, target column, and optional row filter.
|
|
121
|
+
|
|
122
|
+
Each iteration binds the current row's fields as `{{row.field}}` in the prompt template, so the agent sees only that row's context. Execution is sequential (not parallel) to keep the spend budget predictable, and the loop is idempotent — already-populated cells are skipped on re-run so you can safely resume an interrupted enrichment. The generated workflow appears in the Workflows list so you can watch progress, pause, or inspect per-row results.
|
|
123
|
+
|
|
117
124
|
## Related
|
|
118
125
|
|
|
119
126
|
- [Documents](./documents.md) -- Upload files and attach them to tasks for agent context.
|
|
@@ -3,10 +3,10 @@ title: "Workflows"
|
|
|
3
3
|
category: "feature-reference"
|
|
4
4
|
section: "workflows"
|
|
5
5
|
route: "/workflows"
|
|
6
|
-
tags: [workflows, patterns, sequence, parallel, swarm, autonomous, templates, multi-step, blueprints]
|
|
7
|
-
features: ["workflow-engine", "workflow-blueprints", "ai-assist-workflow-creation", "workflow-context-batching", "business-function-profiles"]
|
|
8
|
-
screengrabCount:
|
|
9
|
-
lastUpdated: "2026-
|
|
6
|
+
tags: [workflows, patterns, sequence, parallel, swarm, autonomous, templates, multi-step, blueprints, delays, drip]
|
|
7
|
+
features: ["workflow-engine", "workflow-blueprints", "ai-assist-workflow-creation", "workflow-context-batching", "business-function-profiles", "workflow-step-delays"]
|
|
8
|
+
screengrabCount: 4
|
|
9
|
+
lastUpdated: "2026-04-08"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# Workflows
|
|
@@ -24,6 +24,9 @@ Workflows let you orchestrate multi-step agent operations using six built-in pat
|
|
|
24
24
|

|
|
25
25
|
*Workflow blueprints gallery with pre-built workflow templates*
|
|
26
26
|
|
|
27
|
+

|
|
28
|
+
*The workflow create form exposes an "Add Delay" button alongside "Add Step". Delay steps pause execution for a schedule-based duration (30m, 2h, 3d, 1w) before the next step runs — ideal for drip sequences and cooldown windows.*
|
|
29
|
+
|
|
27
30
|
## Key Features
|
|
28
31
|
|
|
29
32
|
### Six Pattern Types
|
|
@@ -35,6 +38,9 @@ Workflows support six orchestration patterns:
|
|
|
35
38
|
- **Parallel Research** -- Fans out multiple steps to run concurrently, then merges results.
|
|
36
39
|
- **Multi-Agent Swarm** -- Multiple agent profiles collaborate on a shared objective with dynamic handoffs.
|
|
37
40
|
|
|
41
|
+
### Step Delays (Drip Sequences & Cooldowns)
|
|
42
|
+
Insert pure time-delay steps between agent steps using the **Add Delay** button in the create form. Delays accept compact durations like `30m`, `2h`, `3d`, or `1w`. Execution model is schedule-based, not sleep-based: the delay is persisted in `workflows.resume_at` and the scheduler resumes the workflow when the time is up. This means delays survive process restarts — a 3-day cooldown will resume correctly even if the dev server is stopped and restarted in between. Resume is atomic and idempotent: the scheduler and a manual "Resume Now" click cannot double-fire the same delay. Delay steps are the primitive behind drip email campaigns, staggered onboarding sequences, and cooldown windows between automated actions.
|
|
43
|
+
|
|
38
44
|
### Workflow Blueprints
|
|
39
45
|
The blueprint gallery offers pre-built workflow templates for common patterns:
|
|
40
46
|
- **Technical blueprints** -- code review pipelines, deploy-and-verify, research synthesis, documentation generation
|
|
@@ -6,7 +6,7 @@ difficulty: "advanced"
|
|
|
6
6
|
estimatedTime: "30 minutes"
|
|
7
7
|
sections: ["settings", "environment", "chat", "monitoring", "profiles", "workflows", "tables", "schedules", "delivery-channels"]
|
|
8
8
|
tags: ["advanced", "developer", "settings", "environment", "cli", "api", "monitoring", "profiles", "ollama", "channels", "handoffs", "memory", "tables"]
|
|
9
|
-
lastUpdated: "2026-04-
|
|
9
|
+
lastUpdated: "2026-04-08"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# Developer Guide
|
|
@@ -98,6 +98,20 @@ Riley sets up Slack and Telegram as delivery channels for schedule notifications
|
|
|
98
98
|
3. Use **Clear Data** cautiously -- it removes all workspace content while preserving settings
|
|
99
99
|
4. Use **Populate Sample Data** for demos or testing
|
|
100
100
|
|
|
101
|
+
### Step 6a: Take a Database Snapshot Backup
|
|
102
|
+
|
|
103
|
+
Riley wants a point-in-time backup before running a risky migration or a destructive clear.
|
|
104
|
+
|
|
105
|
+

|
|
106
|
+
|
|
107
|
+
1. Scroll to the **Snapshots** card inside **Data Management**
|
|
108
|
+
2. Click **Create Snapshot** — Stagent copies the SQLite database (with WAL checkpoint) into a named, timestamped snapshot file stored alongside the live DB
|
|
109
|
+
3. Give the snapshot a descriptive label ("before-v2-migration", "post-sample-seed") so future-you can find it
|
|
110
|
+
4. To restore, pick a snapshot from the list and click **Restore** — the live DB is atomically swapped with the snapshot contents
|
|
111
|
+
5. To archive off-host, click **Download** to get a `.sqlite` file you can stash in your backup system
|
|
112
|
+
|
|
113
|
+
> **Tip:** Snapshots are the fastest safety net for experiments that touch tables, workflows, or schedules. Always take one before clearing data or trying an unfamiliar migration path.
|
|
114
|
+
|
|
101
115
|
### Step 7: Explore the Environment Dashboard
|
|
102
116
|
|
|
103
117
|
Riley switches to the Environment page to understand the control plane.
|
|
@@ -4,9 +4,9 @@ category: "user-journey"
|
|
|
4
4
|
persona: "personal"
|
|
5
5
|
difficulty: "beginner"
|
|
6
6
|
estimatedTime: "30 minutes"
|
|
7
|
-
sections: ["home-workspace", "dashboard-kanban", "projects", "chat", "tables", "schedules", "user-guide"]
|
|
8
|
-
tags: ["beginner", "solo", "tasks", "kanban", "chat", "tables", "schedules", "delivery-channels"]
|
|
9
|
-
lastUpdated: "2026-04-
|
|
7
|
+
sections: ["home-workspace", "dashboard-kanban", "projects", "chat", "tables", "schedules", "user-guide", "book"]
|
|
8
|
+
tags: ["beginner", "solo", "tasks", "kanban", "chat", "tables", "schedules", "delivery-channels", "book"]
|
|
9
|
+
lastUpdated: "2026-04-08"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# Personal Use Guide
|
|
@@ -205,7 +205,24 @@ Alex discovers the built-in documentation hub.
|
|
|
205
205
|
3. Check the **guided journeys** for your current skill level
|
|
206
206
|
4. Use the feature grid to discover areas you have not tried yet
|
|
207
207
|
|
|
208
|
-
### Step 15:
|
|
208
|
+
### Step 15: Read the AI Native Book
|
|
209
|
+
|
|
210
|
+
Alex wants deeper context on how Stagent fits into the broader shift to AI-native work. The Living Book is built into the sidebar under the **Learn** group.
|
|
211
|
+
|
|
212
|
+

|
|
213
|
+
|
|
214
|
+
1. Click **AI Native Book** in the sidebar under the **Learn** group to open the chapter list
|
|
215
|
+
2. Scan the table of contents — chapters are organised from foundational concepts (From Hierarchy to Intelligence) through advanced topics (Autonomous Organization, The Road Ahead)
|
|
216
|
+
3. Pick a reading path that matches your current focus:
|
|
217
|
+
- **Newcomer path** — start with the intro chapters on the AI-native blueprint and refinery
|
|
218
|
+
- **Practitioner path** — jump straight to the chapters on workflow orchestration, scheduled intelligence, and human-in-the-loop
|
|
219
|
+
- **Visionary path** — skip ahead to agent self-improvement, multi-agent swarms, and the governance layer
|
|
220
|
+
4. As you read, the book merges content updates on each upgrade — new chapters and revisions appear automatically when you pull the latest release, so the book stays in sync with the product
|
|
221
|
+
5. Reading progress persists per chapter, so you can dip in and out without losing your place
|
|
222
|
+
|
|
223
|
+
> **Tip:** The book treats every example project as a case study — when you see a workflow or schedule described in a chapter, try building the same thing in your own workspace to anchor the idea in muscle memory.
|
|
224
|
+
|
|
225
|
+
### Step 16: What's Next
|
|
209
226
|
|
|
210
227
|
Alex now has a solid foundation: a project, organized tasks on a kanban board, a heartbeat schedule for proactive monitoring, and Telegram notifications for staying connected on the go. Here is where to go from here:
|
|
211
228
|
|