stagent 0.11.0 → 0.11.2
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 +74 -29
- package/docs/getting-started.md +1 -1
- package/docs/superpowers/plans/2026-04-07-instance-bootstrap.md +2 -2
- package/package.json +3 -3
- package/src/components/book/content-blocks.tsx +1 -1
- package/src/components/playbook/playbook-detail-view.tsx +1 -1
- package/src/lib/agents/profiles/registry.ts +79 -22
- package/src/lib/environment/__tests__/auto-promote.test.ts +3 -3
- package/src/lib/environment/profile-generator.ts +2 -2
- package/src/lib/instance/__tests__/detect.test.ts +1 -1
- package/src/lib/instance/fingerprint.ts +1 -1
- package/src/lib/utils/stagent-paths.ts +4 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://stagent.io) [](https://www.npmjs.com/package/stagent) [](https://nextjs.org/) [](https://react.dev/) [](https://www.typescriptlang.org/) [](https://docs.anthropic.com/) [](https://developers.openai.com/codex/app-server) [](LICENSE)
|
|
6
6
|
|
|
7
|
-
**[stagent.io](https://stagent.io)** · **[GitHub](https://github.com/
|
|
7
|
+
**[stagent.io](https://stagent.io)** · **[GitHub](https://github.com/manavsehgal/stagent)**
|
|
8
8
|
|
|
9
9
|
## Quick Start
|
|
10
10
|
|
|
@@ -16,13 +16,13 @@ Open [localhost:3000](http://localhost:3000). That's it — zero config, local S
|
|
|
16
16
|
|
|
17
17
|
**Profiles & Policies** · **Blueprints & Schedules** · **Built-in Playbook** · **Open Source**
|
|
18
18
|
|
|
19
|
-
<img src="https://raw.githubusercontent.com/
|
|
19
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/home-list.png" alt="Stagent home workspace" width="1200" />
|
|
20
20
|
|
|
21
21
|
| Home Workspace | Reusable Profiles | Workflow Blueprints | Governed Execution |
|
|
22
22
|
|:-:|:-:|:-:|:-:|
|
|
23
23
|
| Workspace briefing with active work, pending review, project signals, and live activity | Specialist definitions with prompts, tool policy, and runtime tuning you can reuse | Pre-configured templates with dynamic forms, YAML editing, and lineage tracking | Human-in-the-loop approvals, tool permissions, and ambient supervision |
|
|
24
24
|
|
|
25
|
-
<img src="https://raw.githubusercontent.com/
|
|
25
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/home-below-fold.png" alt="Stagent home workspace below fold — projects, activity feed, and signals" width="1200" />
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
@@ -39,6 +39,51 @@ The AI agent stack is broken for business operators. You can spin up an agent in
|
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
|
+
## About Author
|
|
43
|
+
|
|
44
|
+
<!-- ABOUT:BEGIN source=https://stagent.io/about/ -->
|
|
45
|
+
|
|
46
|
+
### Manav Sehgal
|
|
47
|
+
|
|
48
|
+
Solutions Leader, AWS Frontier AI.
|
|
49
|
+
|
|
50
|
+
Author, AI Native open book. 2M+ Kaggle views. Ex Amazon AGI.
|
|
51
|
+
|
|
52
|
+
#### A personal research project
|
|
53
|
+
|
|
54
|
+
Stagent & AI Native — Free and open source. Building AI Native over weekends, using personal laptop and capped AI plans.
|
|
55
|
+
|
|
56
|
+
#### Executive Credentials
|
|
57
|
+
|
|
58
|
+
- Harvard — Disruptive Strategy
|
|
59
|
+
- MIT Sloan — Design Thinking
|
|
60
|
+
- Berkeley Haas — Leading Innovative Change
|
|
61
|
+
|
|
62
|
+
#### Short version
|
|
63
|
+
|
|
64
|
+
> "Stagent is a personal research project exploring what it takes to build AI-native on a shoestring budget over weekends." The AI Native open book serves as its 14-chapter playbook expanding this research.
|
|
65
|
+
|
|
66
|
+
### Bio
|
|
67
|
+
|
|
68
|
+
Manav is a solutions leader at AWS Frontier AI, collaborating with Anthropic, NVIDIA, and Disney on production AI and agentic systems. His 25-year career spans Xerox PARC (1996), HCL's digital practice, Daily Mail, Amazon AGI, and AWS, where he has delivered scale AI programs for Amazon Retail and Alexa. He led AWS pandemic response which was honored by President of India award for the customer. He holds credentials from Harvard, MIT Sloan, Berkeley Haas. He has studied Computer Engineering and Lean Management.
|
|
69
|
+
|
|
70
|
+
### Research Premise
|
|
71
|
+
|
|
72
|
+
"Stagent is a personal research project exploring what an AI-native operating system looks like." The AI Native book is its 14-chapter playbook for building autonomous business systems with AI agents.
|
|
73
|
+
|
|
74
|
+
### Attribution
|
|
75
|
+
|
|
76
|
+
Stagent and AI Native are personal works of Manav Sehgal created in own personal time and resources. While they may refer to AWS technologies which enable the AI Native promise, the opinions expressed in the website are author's personal opinions and not that of the employer.
|
|
77
|
+
|
|
78
|
+
### Previously published
|
|
79
|
+
|
|
80
|
+
- Data Science Solutions (2017)
|
|
81
|
+
- React Speed Coding (2015)
|
|
82
|
+
|
|
83
|
+
<!-- ABOUT:END -->
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
42
87
|
## Runtime Bridge
|
|
43
88
|
|
|
44
89
|
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.
|
|
@@ -86,9 +131,9 @@ Run the same business process on different AI providers without changing a line
|
|
|
86
131
|
## Architecture
|
|
87
132
|
|
|
88
133
|
<picture>
|
|
89
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/
|
|
90
|
-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/
|
|
91
|
-
<img src="https://raw.githubusercontent.com/
|
|
134
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/architecture-dark.svg">
|
|
135
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/architecture-light.svg">
|
|
136
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/architecture-light.svg" alt="Stagent architecture diagram" width="900" />
|
|
92
137
|
</picture>
|
|
93
138
|
|
|
94
139
|
**Key design decisions:**
|
|
@@ -115,18 +160,18 @@ Workspace-level briefing with active work, pending review, failed items, project
|
|
|
115
160
|
#### Task Execution
|
|
116
161
|
Status-driven execution board with five columns: Planned → Queued → Running → Completed → Failed. Filter across projects, create tasks inline, and open task detail to inspect status, description, and runtime state without leaving the board.
|
|
117
162
|
|
|
118
|
-
<img src="https://raw.githubusercontent.com/
|
|
163
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/dashboard-list.png" alt="Stagent kanban board" width="1200" />
|
|
119
164
|
|
|
120
165
|
| Table View |
|
|
121
166
|
|:-:|
|
|
122
|
-
| <img src="https://raw.githubusercontent.com/
|
|
167
|
+
| <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/dashboard-table.png" alt="Dashboard table view" width="580" /> |
|
|
123
168
|
|
|
124
169
|
#### Projects
|
|
125
170
|
Create and organize projects as containers for related tasks. Each project can specify a working directory — agent tasks resolve `cwd` from the project's path, enabling agents to operate on external codebases. Server-rendered project cards with task counts, status badges, and a detail view at `/projects/[id]`.
|
|
126
171
|
|
|
127
172
|
| Project Cards | Project Detail |
|
|
128
173
|
|:-:|:-:|
|
|
129
|
-
| <img src="https://raw.githubusercontent.com/
|
|
174
|
+
| <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/projects-list.png" alt="Project cards overview" width="580" /> | <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/projects-detail.png" alt="Project detail view" width="580" /> |
|
|
130
175
|
|
|
131
176
|
### Agent
|
|
132
177
|
|
|
@@ -146,7 +191,7 @@ OpenAI Codex App Server is integrated as Stagent's second governed runtime. Code
|
|
|
146
191
|
#### Agent Profiles
|
|
147
192
|
Profile-backed execution with specialist definitions for different job types. Each profile packages instructions, allowed tools, max turns, and output format so teams can reuse behavior intentionally instead of relying on ad hoc prompts. Profile cards display role-based icon circles with keyword-inferred colors (blue for work, purple for personal), alongside domain tags, runtime badges, and tool counts. Workflow steps and schedules can reference profiles directly, and runtimes can be selected independently when provider support differs.
|
|
148
193
|
|
|
149
|
-
<img src="https://raw.githubusercontent.com/
|
|
194
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/profiles-list.png" alt="Stagent agent profiles with role-based icon circles" width="1200" />
|
|
150
195
|
|
|
151
196
|
#### Workflows
|
|
152
197
|
Multi-step task orchestration with six patterns:
|
|
@@ -190,11 +235,11 @@ Curated agent profiles across work and personal domains, built as portable Claud
|
|
|
190
235
|
#### Workflow Blueprints
|
|
191
236
|
Pre-configured workflow templates across work and personal domains. Browse blueprints in a gallery with pattern-colored icon circles, domain tags, and difficulty badges. Preview steps and required variables, fill in a dynamic form, and create draft workflows with resolved prompts and profile assignments. Create custom blueprints via YAML or import from GitHub URLs. Lineage tracking connects workflows back to their source blueprint.
|
|
192
237
|
|
|
193
|
-
<img src="https://raw.githubusercontent.com/
|
|
238
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/workflows-list.png" alt="Stagent workflows with keyword-inferred icon circles" width="1200" />
|
|
194
239
|
|
|
195
240
|
| Workflow Detail |
|
|
196
241
|
|:-:|
|
|
197
|
-
| <img src="https://raw.githubusercontent.com/
|
|
242
|
+
| <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/workflows-detail.png" alt="Workflow detail with steps and status" width="580" /> |
|
|
198
243
|
|
|
199
244
|
### Documents
|
|
200
245
|
|
|
@@ -203,7 +248,7 @@ Full document browser at `/documents` with table and grid views. Upload files wi
|
|
|
203
248
|
|
|
204
249
|
| Table View | Grid View |
|
|
205
250
|
|:-:|:-:|
|
|
206
|
-
| <img src="https://raw.githubusercontent.com/
|
|
251
|
+
| <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/documents-list.png" alt="Documents table view" width="580" /> | <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/documents-grid.png" alt="Documents grid view" width="580" /> |
|
|
207
252
|
|
|
208
253
|
#### Document Preprocessing
|
|
209
254
|
Automatic text extraction on upload for five file types: text, PDF (pdf-parse), images (image-size), Office documents (mammoth/jszip), and spreadsheets (xlsx). Extracted text, processed paths, and processing errors are tracked per document.
|
|
@@ -216,11 +261,11 @@ Airtable-like structured data system at `/tables` with 14 features. Create table
|
|
|
216
261
|
|
|
217
262
|
| Table List | Spreadsheet Editor |
|
|
218
263
|
|:-:|:-:|
|
|
219
|
-
| <img src="https://raw.githubusercontent.com/
|
|
264
|
+
| <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/tables-list.png" alt="Tables list view" width="580" /> | <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/tables-detail.png" alt="Table spreadsheet editor" width="580" /> |
|
|
220
265
|
|
|
221
266
|
| Charts | Template Gallery |
|
|
222
267
|
|:-:|:-:|
|
|
223
|
-
| <img src="https://raw.githubusercontent.com/
|
|
268
|
+
| <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/tables-detail-charts.png" alt="Table charts tab" width="580" /> | <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/tables-templates.png" alt="Table template gallery" width="580" /> |
|
|
224
269
|
|
|
225
270
|
- **Charts** — Bar, line, pie, and scatter charts with configurable X/Y axes and aggregation
|
|
226
271
|
- **Workflow triggers** — Automated actions fired when row data matches conditions
|
|
@@ -234,7 +279,7 @@ Airtable-like structured data system at `/tables` with 14 features. Create table
|
|
|
234
279
|
#### Playbook
|
|
235
280
|
Built-in documentation system at `/playbook` with usage-stage awareness that adapts content to your experience level (new, early, active, power user). Browse feature reference docs and guided learning journeys organized by persona (Personal, Work, Power User, Developer). Adoption heatmap tracks which features you've explored, while journey cards show progress through multi-step learning paths. Markdown rendering with automatic internal link resolution, table of contents, related docs, and screengrab embedding.
|
|
236
281
|
|
|
237
|
-
<img src="https://raw.githubusercontent.com/
|
|
282
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/playbook-list.png" alt="Stagent playbook documentation" width="1200" />
|
|
238
283
|
|
|
239
284
|
#### Living Book
|
|
240
285
|
AI-native book reader at `/book` with 9 chapters across 3 parts (Foundation, Intelligence, Autonomy). Each chapter is generated from Stagent's own source code and feature docs by the document-writer agent — making this a book that writes itself.
|
|
@@ -263,7 +308,7 @@ Stagent doubles as a **control plane for AI coding environments** — scanning,
|
|
|
263
308
|
- **Environment Health Scoring** — composite health score based on configuration completeness and freshness
|
|
264
309
|
- **Agent Profile from Environment** — auto-generate agent profiles from detected environment capabilities
|
|
265
310
|
|
|
266
|
-
<img src="https://raw.githubusercontent.com/
|
|
311
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/environment-list.png" alt="Stagent environment dashboard" width="1200" />
|
|
267
312
|
|
|
268
313
|
#### Browser Tools
|
|
269
314
|
Enable browser automation in chat and task execution through two MCP integrations: **Chrome DevTools MCP** (29 tools for connecting to a running Chrome instance via CDP) and **Playwright MCP** (50+ tools for headless browser automation). Configure both from Settings with independent toggles and permission tiering — read-only operations auto-approve while mutations are gated through the inbox approval flow.
|
|
@@ -285,7 +330,7 @@ Hourly poller checks the upstream `origin/main` for new commits and surfaces the
|
|
|
285
330
|
#### Schedules
|
|
286
331
|
Time-based scheduling for agent tasks with human-friendly intervals (`5m`, `2h`, `1d`) and raw 5-field cron expressions. One-shot and recurring modes with pause/resume lifecycle, expiry limits, and max firings. Each firing creates a child task through the shared execution pipeline, and schedules can now target a runtime explicitly. Scheduler runs as a poll-based engine started via Next.js instrumentation hook.
|
|
287
332
|
|
|
288
|
-
<img src="https://raw.githubusercontent.com/
|
|
333
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/schedules-list.png" alt="Stagent schedules" width="1200" />
|
|
289
334
|
|
|
290
335
|
#### Micro-Visualizations
|
|
291
336
|
Pure SVG chart primitives (Sparkline, MiniBar, DonutRing) with zero charting dependencies. Integrated into: homepage stats cards (7-day trends), activity feed (24h bar chart), project cards (completion donuts), monitor overview (success rate), and project detail (stacked status + 14-day sparkline). Full accessibility with `role="img"` and `aria-label`.
|
|
@@ -293,27 +338,27 @@ Pure SVG chart primitives (Sparkline, MiniBar, DonutRing) with zero charting dep
|
|
|
293
338
|
#### Cost & Usage
|
|
294
339
|
Provider-normalized metering tracks token and spend activity across tasks, resumes, workflow child tasks, schedules, task assist, and profile tests. The dedicated `Cost & Usage` surface adds summary cards, trend views, provider/model breakdowns, and budget-aware audit visibility on top of the usage ledger.
|
|
295
340
|
|
|
296
|
-
<img src="https://raw.githubusercontent.com/
|
|
341
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/cost-usage-list.png" alt="Stagent cost and usage dashboard" width="1200" />
|
|
297
342
|
|
|
298
343
|
### UI & DevEx
|
|
299
344
|
|
|
300
345
|
#### Inbox & Human-in-the-Loop
|
|
301
346
|
When an agent needs approval or input, a notification appears in your inbox. Review tool permission requests with "Allow Once" / "Always Allow" / "Deny" buttons, answer agent questions, and see task completion summaries. Supports bulk dismiss and 10s polling.
|
|
302
347
|
|
|
303
|
-
<img src="https://raw.githubusercontent.com/
|
|
348
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/inbox-list.png" alt="Stagent inbox approval flow" width="1200" />
|
|
304
349
|
|
|
305
350
|
| Expanded Notification |
|
|
306
351
|
|:-:|
|
|
307
|
-
| <img src="https://raw.githubusercontent.com/
|
|
352
|
+
| <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/inbox-expanded.png" alt="Inbox notification expanded" width="580" /> |
|
|
308
353
|
|
|
309
354
|
#### Chat
|
|
310
355
|
Conversational control plane for all workspace primitives — projects, tasks, workflows, documents, and profiles are all reachable from the chat surface. The chat interface is organized as a **tool catalog** with five categories (Explore, Create, Debug, Automate, Smart Picks) that help discover workspace capabilities. Progressive 5-tier context injection (~53K token budget) builds workspace awareness from lightweight summaries up to full document content. **@ mentions** let you reference documents and entities directly in prompts with fuzzy search autocomplete, injecting their content as context. **Slash commands** (`/`) provide quick access to tools and actions. Multi-provider model selection with cost tiers ($, $$, $$$) spans Claude Haiku through Opus and GPT-5.x models. Browser automation via Chrome DevTools and Playwright MCP enables screenshot capture and web interaction from chat. Quick Access navigation pills in responses provide entity deep-linking. Stagent CRUD tools let you create, update, and delete workspace entities through natural language.
|
|
311
356
|
|
|
312
|
-
<img src="https://raw.githubusercontent.com/
|
|
357
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/chat-conversation.png" alt="Stagent chat conversation with @ document context" width="1200" />
|
|
313
358
|
|
|
314
359
|
| Tool Catalog | Model Selector | Create Tab |
|
|
315
360
|
|:-:|:-:|:-:|
|
|
316
|
-
| <img src="https://raw.githubusercontent.com/
|
|
361
|
+
| <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/chat-list.png" alt="Chat tool catalog with category tabs" width="380" /> | <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/chat-model-selector.png" alt="Chat model selector with cost tiers" width="380" /> | <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/chat-create-tab.png" alt="Chat Create category prompts" width="380" /> |
|
|
317
362
|
|
|
318
363
|
#### Skill Composition
|
|
319
364
|
Activate up to three skills in a single conversation with conflict detection and runtime-aware capability gates. The Skills tab in the chat popover surfaces `+ Add` buttons on inactive skills, active badges with deactivate actions, and an "N of M active" indicator. When two skills issue polarity-divergent directives on shared keywords, a conflict dialog previews the excerpts and lets you confirm with `force:true` or back out. Composition honors the runtime capability matrix — Claude Code and Codex App Server support up to 3 active skills, while Ollama stays at 1. Conversations persist active skills through an additive `active_skill_ids` column that preserves legacy single-skill reads.
|
|
@@ -324,7 +369,7 @@ Structured `#key:value` filter grammar across chat, documents, and the `⌘K` pa
|
|
|
324
369
|
#### Monitoring
|
|
325
370
|
Real-time agent log streaming via Server-Sent Events. Filter by task or event type, click entries to jump to task details, and auto-pause polling when the tab is hidden (Page Visibility API).
|
|
326
371
|
|
|
327
|
-
<img src="https://raw.githubusercontent.com/
|
|
372
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/monitor-list.png" alt="Stagent monitoring dashboard" width="1200" />
|
|
328
373
|
|
|
329
374
|
#### Content Handling
|
|
330
375
|
File upload with drag-and-drop in task creation. Type-aware content preview for text, markdown (via react-markdown), code, and JSON. Copy-to-clipboard and download-as-file for task outputs.
|
|
@@ -332,11 +377,11 @@ File upload with drag-and-drop in task creation. Type-aware content preview for
|
|
|
332
377
|
#### Settings
|
|
333
378
|
Configuration hub with provider-aware sections: Claude authentication (API key or OAuth), OpenAI Codex runtime API-key management, chat defaults (model selection), **browser tools** (Chrome DevTools and Playwright MCP toggles), runtime configuration (SDK timeout and max turns), tool permissions (saved "Always Allow" patterns with revoke), permission presets, budget guardrails, **database snapshots** (automatic backups with configurable retention and one-click restore), and data management.
|
|
334
379
|
|
|
335
|
-
<img src="https://raw.githubusercontent.com/
|
|
380
|
+
<img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/settings-list.png" alt="Stagent settings" width="1200" />
|
|
336
381
|
|
|
337
382
|
| Browser Tools | Permission Presets | Budget Configuration |
|
|
338
383
|
|:-:|:-:|:-:|
|
|
339
|
-
| <img src="https://raw.githubusercontent.com/
|
|
384
|
+
| <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/settings-browser-tools.png" alt="Browser tools MCP toggles" width="380" /> | <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/settings-presets.png" alt="Tool permission presets" width="380" /> | <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/settings-budget.png" alt="Budget configuration" width="380" /> |
|
|
340
385
|
|
|
341
386
|
#### CLI
|
|
342
387
|
The `npx stagent` entry point boots a Next.js server from the published npm package. It is built from `bin/cli.ts` into `dist/cli.js` using tsup, and serves as the primary distribution channel — no clone required.
|
|
@@ -349,7 +394,7 @@ Global `⌘K` command palette for fast navigation and search across tasks, proje
|
|
|
349
394
|
|
|
350
395
|
| Empty Palette | Search Results |
|
|
351
396
|
|:-:|:-:|
|
|
352
|
-
| <img src="https://raw.githubusercontent.com/
|
|
397
|
+
| <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/command-palette-empty.png" alt="Command palette empty state" width="580" /> | <img src="https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme/command-palette-search.png" alt="Command palette search results" width="580" /> |
|
|
353
398
|
|
|
354
399
|
#### App Shell
|
|
355
400
|
Responsive sidebar with collapsible icon-only mode, custom Stagent logo, tooltip navigation, dark/light/system theme, and OKLCH hue 250 blue-indigo color palette. Built on shadcn/ui (New York style) with PWA manifest and app icons. Routes: Home, Dashboard, Inbox, Chat, Projects, Workflows, Documents, Monitor, Profiles, Schedules, Cost & Usage, AI Native Book, User Guide, Environment, Settings.
|
|
@@ -552,7 +597,7 @@ All 14 features shipped across three layers:
|
|
|
552
597
|
### Contributor Setup
|
|
553
598
|
|
|
554
599
|
```bash
|
|
555
|
-
git clone https://github.com/
|
|
600
|
+
git clone https://github.com/manavsehgal/stagent.git && cd stagent && npm install
|
|
556
601
|
|
|
557
602
|
# Set up one or both runtime credentials
|
|
558
603
|
cat > .env.local <<'EOF'
|
|
@@ -580,4 +625,4 @@ See `AGENTS.md` for architecture details and development conventions.
|
|
|
580
625
|
|
|
581
626
|
Licensed under the [Apache License 2.0](LICENSE).
|
|
582
627
|
|
|
583
|
-
Copyright 2025-2026 [
|
|
628
|
+
Copyright 2025-2026 [Manav Sehgal](https://github.com/manavsehgal)
|
package/docs/getting-started.md
CHANGED
|
@@ -28,7 +28,7 @@ This downloads and launches Stagent on [localhost:3000](http://localhost:3000).
|
|
|
28
28
|
For contributors or developers who want full control:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
git clone https://github.com/
|
|
31
|
+
git clone https://github.com/manavsehgal/stagent.git
|
|
32
32
|
cd stagent && npm install
|
|
33
33
|
npm run dev
|
|
34
34
|
```
|
|
@@ -255,7 +255,7 @@ describe("isPrivateInstance", () => {
|
|
|
255
255
|
});
|
|
256
256
|
|
|
257
257
|
it("returns true when STAGENT_DATA_DIR is a custom path", async () => {
|
|
258
|
-
vi.stubEnv("STAGENT_DATA_DIR", "/Users/
|
|
258
|
+
vi.stubEnv("STAGENT_DATA_DIR", "/Users/manavsehgal/.stagent-wealth");
|
|
259
259
|
const { isPrivateInstance } = await loadDetect();
|
|
260
260
|
expect(isPrivateInstance()).toBe(true);
|
|
261
261
|
});
|
|
@@ -1605,7 +1605,7 @@ git commit -m "feat(instance): wire ensureInstance into instrumentation hook"
|
|
|
1605
1605
|
Run these commands and verify expected output:
|
|
1606
1606
|
|
|
1607
1607
|
```bash
|
|
1608
|
-
cd /Users/
|
|
1608
|
+
cd /Users/manavsehgal/Developer/stagent
|
|
1609
1609
|
grep "STAGENT_DEV_MODE=true" .env.local && echo "env gate: OK"
|
|
1610
1610
|
ls .git/stagent-dev-mode && echo "sentinel gate: OK"
|
|
1611
1611
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stagent",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "AI Business Operating System — run your business with AI agents. Local-first, multi-provider, governed.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
],
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|
|
41
|
-
"url": "https://github.com/
|
|
41
|
+
"url": "https://github.com/manavsehgal/stagent.git"
|
|
42
42
|
},
|
|
43
43
|
"bugs": {
|
|
44
|
-
"url": "https://github.com/
|
|
44
|
+
"url": "https://github.com/manavsehgal/stagent/issues"
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://stagent.io",
|
|
47
47
|
"scripts": {
|
|
@@ -143,7 +143,7 @@ function CodeBlockView({
|
|
|
143
143
|
|
|
144
144
|
/* ─── ImageBlock ─── */
|
|
145
145
|
|
|
146
|
-
const BOOK_IMAGE_BASE = "https://raw.githubusercontent.com/
|
|
146
|
+
const BOOK_IMAGE_BASE = "https://raw.githubusercontent.com/manavsehgal/stagent/main/book/images";
|
|
147
147
|
|
|
148
148
|
function ImageBlockView({
|
|
149
149
|
src,
|
|
@@ -130,7 +130,7 @@ export function PlaybookDetailView({
|
|
|
130
130
|
|
|
131
131
|
// Resolve image paths to GitHub raw URLs (public/readme/ excluded from npm package)
|
|
132
132
|
const GITHUB_RAW_BASE =
|
|
133
|
-
"https://raw.githubusercontent.com/
|
|
133
|
+
"https://raw.githubusercontent.com/manavsehgal/stagent/main/public/readme";
|
|
134
134
|
let resolvedSrc = src;
|
|
135
135
|
if (src.includes("screengrabs/")) {
|
|
136
136
|
resolvedSrc = `${GITHUB_RAW_BASE}/${src.split("screengrabs/").pop()}`;
|
|
@@ -11,6 +11,7 @@ import { invalidateLatestScan, getLatestScan } from "@/lib/environment/data";
|
|
|
11
11
|
import { db } from "@/lib/db";
|
|
12
12
|
import { environmentArtifacts } from "@/lib/db/schema";
|
|
13
13
|
import { eq, and } from "drizzle-orm";
|
|
14
|
+
import { getStagentProfilesDir } from "@/lib/utils/stagent-paths";
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Builtins ship inside the repo at src/lib/agents/profiles/builtins/.
|
|
@@ -36,6 +37,12 @@ const SKILLS_DIR = path.join(
|
|
|
36
37
|
"skills"
|
|
37
38
|
);
|
|
38
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Auto-promoted profiles (from environment discovery) are written here
|
|
42
|
+
* instead of SKILLS_DIR to avoid colliding with Claude Code's skill namespace.
|
|
43
|
+
*/
|
|
44
|
+
const PROMOTED_PROFILES_DIR = getStagentProfilesDir();
|
|
45
|
+
|
|
39
46
|
// ---------------------------------------------------------------------------
|
|
40
47
|
// Cache
|
|
41
48
|
// ---------------------------------------------------------------------------
|
|
@@ -43,37 +50,44 @@ const SKILLS_DIR = path.join(
|
|
|
43
50
|
let profileCache: Map<string, AgentProfile> | null = null;
|
|
44
51
|
let profileCacheSignature: string | null = null;
|
|
45
52
|
|
|
46
|
-
function
|
|
47
|
-
if (!fs.existsSync(
|
|
48
|
-
return "missing";
|
|
49
|
-
}
|
|
53
|
+
function getDirectorySignatureParts(baseDir: string): string[] {
|
|
54
|
+
if (!fs.existsSync(baseDir)) return [];
|
|
50
55
|
|
|
51
56
|
const entries = fs
|
|
52
|
-
.readdirSync(
|
|
57
|
+
.readdirSync(baseDir, { withFileTypes: true })
|
|
53
58
|
.filter((entry) => entry.isDirectory())
|
|
54
59
|
.sort((a, b) => a.name.localeCompare(b.name));
|
|
55
60
|
|
|
56
|
-
const
|
|
61
|
+
const parts: string[] = [];
|
|
57
62
|
|
|
58
63
|
for (const entry of entries) {
|
|
59
|
-
const dir = path.join(
|
|
64
|
+
const dir = path.join(baseDir, entry.name);
|
|
60
65
|
const yamlPath = path.join(dir, "profile.yaml");
|
|
61
66
|
const skillPath = path.join(dir, "SKILL.md");
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
parts.push(entry.name);
|
|
64
69
|
|
|
65
70
|
if (fs.existsSync(yamlPath)) {
|
|
66
71
|
const stats = fs.statSync(yamlPath);
|
|
67
|
-
|
|
72
|
+
parts.push(`yaml:${stats.mtimeMs}:${stats.size}`);
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
if (fs.existsSync(skillPath)) {
|
|
71
76
|
const stats = fs.statSync(skillPath);
|
|
72
|
-
|
|
77
|
+
parts.push(`skill:${stats.mtimeMs}:${stats.size}`);
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
80
|
|
|
76
|
-
return
|
|
81
|
+
return parts;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function getSkillsDirectorySignature(): string {
|
|
85
|
+
const skillsParts = getDirectorySignatureParts(SKILLS_DIR);
|
|
86
|
+
const promotedParts = getDirectorySignatureParts(PROMOTED_PROFILES_DIR);
|
|
87
|
+
|
|
88
|
+
if (skillsParts.length === 0 && promotedParts.length === 0) return "missing";
|
|
89
|
+
|
|
90
|
+
return [...skillsParts, "||promoted||", ...promotedParts].join("|");
|
|
77
91
|
}
|
|
78
92
|
|
|
79
93
|
// ---------------------------------------------------------------------------
|
|
@@ -156,15 +170,16 @@ function ensureBuiltins(): void {
|
|
|
156
170
|
// scanProfiles — read .claude/skills/*/profile.yaml, validate, pair w/ SKILL.md
|
|
157
171
|
// ---------------------------------------------------------------------------
|
|
158
172
|
|
|
159
|
-
function
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
173
|
+
function scanProfilesFromDir(
|
|
174
|
+
baseDir: string,
|
|
175
|
+
profiles: Map<string, AgentProfile>
|
|
176
|
+
): void {
|
|
177
|
+
if (!fs.existsSync(baseDir)) return;
|
|
163
178
|
|
|
164
|
-
for (const entry of fs.readdirSync(
|
|
179
|
+
for (const entry of fs.readdirSync(baseDir, { withFileTypes: true })) {
|
|
165
180
|
if (!entry.isDirectory()) continue;
|
|
166
181
|
|
|
167
|
-
const dir = path.join(
|
|
182
|
+
const dir = path.join(baseDir, entry.name);
|
|
168
183
|
const yamlPath = path.join(dir, "profile.yaml");
|
|
169
184
|
const skillPath = path.join(dir, "SKILL.md");
|
|
170
185
|
|
|
@@ -232,6 +247,12 @@ function scanProfiles(): Map<string, AgentProfile> {
|
|
|
232
247
|
}
|
|
233
248
|
}
|
|
234
249
|
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function scanProfiles(): Map<string, AgentProfile> {
|
|
253
|
+
const profiles = new Map<string, AgentProfile>();
|
|
254
|
+
scanProfilesFromDir(SKILLS_DIR, profiles);
|
|
255
|
+
scanProfilesFromDir(PROMOTED_PROFILES_DIR, profiles);
|
|
235
256
|
return profiles;
|
|
236
257
|
}
|
|
237
258
|
|
|
@@ -317,6 +338,28 @@ export function createProfile(config: ProfileConfig, skillMd: string): void {
|
|
|
317
338
|
invalidateLatestScan();
|
|
318
339
|
}
|
|
319
340
|
|
|
341
|
+
/**
|
|
342
|
+
* Create an auto-promoted profile in ~/.stagent/profiles/ (not ~/.claude/skills/).
|
|
343
|
+
* This avoids colliding with Claude Code's skill discovery namespace.
|
|
344
|
+
*/
|
|
345
|
+
export function createPromotedProfile(config: ProfileConfig, skillMd: string): void {
|
|
346
|
+
const result = ProfileConfigSchema.safeParse(config);
|
|
347
|
+
if (!result.success) {
|
|
348
|
+
throw new Error(`Invalid profile: ${result.error.issues.map(i => i.message).join(", ")}`);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
const dir = path.join(PROMOTED_PROFILES_DIR, config.id);
|
|
352
|
+
if (fs.existsSync(path.join(dir, "profile.yaml"))) {
|
|
353
|
+
throw new Error(`Profile "${config.id}" already exists`);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
357
|
+
fs.writeFileSync(path.join(dir, "profile.yaml"), yaml.dump(config));
|
|
358
|
+
fs.writeFileSync(path.join(dir, "SKILL.md"), skillMd);
|
|
359
|
+
reloadProfiles();
|
|
360
|
+
invalidateLatestScan();
|
|
361
|
+
}
|
|
362
|
+
|
|
320
363
|
/** Update an existing custom profile (rejects builtins) */
|
|
321
364
|
export function updateProfile(id: string, config: ProfileConfig, skillMd: string): void {
|
|
322
365
|
if (isBuiltin(id)) {
|
|
@@ -328,8 +371,15 @@ export function updateProfile(id: string, config: ProfileConfig, skillMd: string
|
|
|
328
371
|
throw new Error(`Invalid profile: ${result.error.issues.map(i => i.message).join(", ")}`);
|
|
329
372
|
}
|
|
330
373
|
|
|
331
|
-
const
|
|
332
|
-
|
|
374
|
+
const skillsDir = path.join(SKILLS_DIR, id);
|
|
375
|
+
const promotedDir = path.join(PROMOTED_PROFILES_DIR, id);
|
|
376
|
+
const dir = fs.existsSync(skillsDir)
|
|
377
|
+
? skillsDir
|
|
378
|
+
: fs.existsSync(promotedDir)
|
|
379
|
+
? promotedDir
|
|
380
|
+
: null;
|
|
381
|
+
|
|
382
|
+
if (!dir) {
|
|
333
383
|
throw new Error(`Profile "${id}" not found`);
|
|
334
384
|
}
|
|
335
385
|
|
|
@@ -339,14 +389,21 @@ export function updateProfile(id: string, config: ProfileConfig, skillMd: string
|
|
|
339
389
|
invalidateLatestScan();
|
|
340
390
|
}
|
|
341
391
|
|
|
342
|
-
/** Delete a custom profile (rejects builtins) */
|
|
392
|
+
/** Delete a custom profile (rejects builtins). Checks both user and promoted dirs. */
|
|
343
393
|
export function deleteProfile(id: string): void {
|
|
344
394
|
if (isBuiltin(id)) {
|
|
345
395
|
throw new Error("Cannot delete built-in profiles");
|
|
346
396
|
}
|
|
347
397
|
|
|
348
|
-
const
|
|
349
|
-
|
|
398
|
+
const skillsDir = path.join(SKILLS_DIR, id);
|
|
399
|
+
const promotedDir = path.join(PROMOTED_PROFILES_DIR, id);
|
|
400
|
+
const dir = fs.existsSync(skillsDir)
|
|
401
|
+
? skillsDir
|
|
402
|
+
: fs.existsSync(promotedDir)
|
|
403
|
+
? promotedDir
|
|
404
|
+
: null;
|
|
405
|
+
|
|
406
|
+
if (!dir) {
|
|
350
407
|
throw new Error(`Profile "${id}" not found`);
|
|
351
408
|
}
|
|
352
409
|
|
|
@@ -17,19 +17,19 @@ vi.mock("../data", () => ({
|
|
|
17
17
|
|
|
18
18
|
vi.mock("@/lib/agents/profiles/registry", () => ({
|
|
19
19
|
listProfiles: vi.fn(() => []),
|
|
20
|
-
|
|
20
|
+
createPromotedProfile: vi.fn(),
|
|
21
21
|
}));
|
|
22
22
|
|
|
23
23
|
import { autoPromoteUnlinkedSkills } from "../profile-generator";
|
|
24
24
|
import { getSettingSync } from "@/lib/settings/helpers";
|
|
25
25
|
import { linkArtifactsToProfiles } from "../profile-linker";
|
|
26
26
|
import { getArtifacts } from "../data";
|
|
27
|
-
import {
|
|
27
|
+
import { createPromotedProfile } from "@/lib/agents/profiles/registry";
|
|
28
28
|
|
|
29
29
|
const mockGetSettingSync = getSettingSync as ReturnType<typeof vi.fn>;
|
|
30
30
|
const mockLinker = linkArtifactsToProfiles as ReturnType<typeof vi.fn>;
|
|
31
31
|
const mockGetArtifacts = getArtifacts as ReturnType<typeof vi.fn>;
|
|
32
|
-
const mockCreateProfile =
|
|
32
|
+
const mockCreateProfile = createPromotedProfile as ReturnType<typeof vi.fn>;
|
|
33
33
|
|
|
34
34
|
function unlinkedSkill(name: string) {
|
|
35
35
|
return {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { getArtifacts } from "./data";
|
|
6
6
|
import { evaluateRules, generateTier2Suggestions, type ProfileSuggestion } from "./profile-rules";
|
|
7
|
-
import { listProfiles,
|
|
7
|
+
import { listProfiles, createPromotedProfile } from "@/lib/agents/profiles/registry";
|
|
8
8
|
import type { ProfileConfig } from "@/lib/validators/profile";
|
|
9
9
|
import { getSettingSync } from "@/lib/settings/helpers";
|
|
10
10
|
import { SETTINGS_KEYS } from "@/lib/constants/settings";
|
|
@@ -126,7 +126,7 @@ export function createProfileFromSuggestion(
|
|
|
126
126
|
skillMd = skillMd.replace(suggestion.systemPrompt, overrides.systemPrompt);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
createPromotedProfile(config, skillMd);
|
|
130
130
|
|
|
131
131
|
// Note: the created profile will have author "stagent-env" which,
|
|
132
132
|
// combined with the env- prefix on the ID, identifies it as environment-originated.
|
|
@@ -83,7 +83,7 @@ describe("isPrivateInstance", () => {
|
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
it("returns true when STAGENT_DATA_DIR is a custom path", async () => {
|
|
86
|
-
vi.stubEnv("STAGENT_DATA_DIR", "/Users/
|
|
86
|
+
vi.stubEnv("STAGENT_DATA_DIR", "/Users/manavsehgal/.stagent-wealth");
|
|
87
87
|
const { isPrivateInstance } = await loadDetect();
|
|
88
88
|
expect(isPrivateInstance()).toBe(true);
|
|
89
89
|
});
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* The fingerprint is derived from:
|
|
10
10
|
* 1. os.hostname() — e.g., "macbook-pro.local"
|
|
11
|
-
* 2. os.userInfo().username — e.g., "
|
|
11
|
+
* 2. os.userInfo().username — e.g., "manavsehgal"
|
|
12
12
|
* 3. SHA-256 of the first non-internal MAC address
|
|
13
13
|
*
|
|
14
14
|
* The MAC is hashed before it leaves the process so the raw network identifier
|
|
@@ -52,3 +52,7 @@ export function getStagentCodexConfigPath(): string {
|
|
|
52
52
|
export function getStagentCodexAuthPath(): string {
|
|
53
53
|
return join(getStagentCodexDir(), "auth.json");
|
|
54
54
|
}
|
|
55
|
+
|
|
56
|
+
export function getStagentProfilesDir(): string {
|
|
57
|
+
return join(getStagentDataDir(), "profiles");
|
|
58
|
+
}
|