stagent 0.6.3 → 0.8.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 (139) hide show
  1. package/README.md +21 -2
  2. package/dist/cli.js +226 -1
  3. package/docs/.coverage-gaps.json +66 -16
  4. package/docs/.last-generated +1 -1
  5. package/docs/features/dashboard-kanban.md +13 -7
  6. package/docs/features/settings.md +15 -3
  7. package/docs/features/tables.md +122 -0
  8. package/docs/index.md +3 -2
  9. package/docs/journeys/developer.md +26 -16
  10. package/docs/journeys/personal-use.md +23 -9
  11. package/docs/journeys/power-user.md +40 -14
  12. package/docs/journeys/work-use.md +43 -15
  13. package/docs/manifest.json +27 -17
  14. package/package.json +3 -1
  15. package/src/app/api/chat/entities/search/route.ts +12 -3
  16. package/src/app/api/projects/[id]/route.ts +37 -0
  17. package/src/app/api/projects/__tests__/delete-project.test.ts +12 -0
  18. package/src/app/api/snapshots/[id]/restore/route.ts +62 -0
  19. package/src/app/api/snapshots/[id]/route.ts +44 -0
  20. package/src/app/api/snapshots/route.ts +54 -0
  21. package/src/app/api/snapshots/settings/route.ts +67 -0
  22. package/src/app/api/tables/[id]/charts/[chartId]/route.ts +89 -0
  23. package/src/app/api/tables/[id]/charts/route.ts +72 -0
  24. package/src/app/api/tables/[id]/columns/route.ts +70 -0
  25. package/src/app/api/tables/[id]/export/route.ts +94 -0
  26. package/src/app/api/tables/[id]/history/route.ts +15 -0
  27. package/src/app/api/tables/[id]/import/route.ts +111 -0
  28. package/src/app/api/tables/[id]/route.ts +86 -0
  29. package/src/app/api/tables/[id]/rows/[rowId]/history/route.ts +32 -0
  30. package/src/app/api/tables/[id]/rows/[rowId]/route.ts +51 -0
  31. package/src/app/api/tables/[id]/rows/route.ts +101 -0
  32. package/src/app/api/tables/[id]/triggers/[triggerId]/route.ts +65 -0
  33. package/src/app/api/tables/[id]/triggers/route.ts +122 -0
  34. package/src/app/api/tables/route.ts +65 -0
  35. package/src/app/api/tables/templates/route.ts +92 -0
  36. package/src/app/globals.css +14 -0
  37. package/src/app/settings/page.tsx +2 -0
  38. package/src/app/tables/[id]/page.tsx +67 -0
  39. package/src/app/tables/page.tsx +21 -0
  40. package/src/app/tables/templates/page.tsx +19 -0
  41. package/src/components/book/book-reader.tsx +62 -9
  42. package/src/components/book/content-blocks.tsx +6 -1
  43. package/src/components/chat/chat-table-result.tsx +139 -0
  44. package/src/components/documents/document-browser.tsx +1 -1
  45. package/src/components/projects/project-form-sheet.tsx +3 -27
  46. package/src/components/schedules/schedule-form.tsx +5 -27
  47. package/src/components/settings/data-management-section.tsx +17 -12
  48. package/src/components/settings/database-snapshots-section.tsx +469 -0
  49. package/src/components/shared/app-sidebar.tsx +2 -0
  50. package/src/components/shared/document-picker-sheet.tsx +214 -11
  51. package/src/components/tables/table-browser.tsx +234 -0
  52. package/src/components/tables/table-cell-editor.tsx +226 -0
  53. package/src/components/tables/table-chart-builder.tsx +288 -0
  54. package/src/components/tables/table-chart-view.tsx +146 -0
  55. package/src/components/tables/table-column-header.tsx +103 -0
  56. package/src/components/tables/table-column-sheet.tsx +331 -0
  57. package/src/components/tables/table-create-sheet.tsx +240 -0
  58. package/src/components/tables/table-detail-sheet.tsx +144 -0
  59. package/src/components/tables/table-detail-tabs.tsx +278 -0
  60. package/src/components/tables/table-grid.tsx +61 -0
  61. package/src/components/tables/table-history-tab.tsx +148 -0
  62. package/src/components/tables/table-import-wizard.tsx +542 -0
  63. package/src/components/tables/table-list-table.tsx +95 -0
  64. package/src/components/tables/table-relation-combobox.tsx +217 -0
  65. package/src/components/tables/table-row-sheet.tsx +271 -0
  66. package/src/components/tables/table-spreadsheet.tsx +394 -0
  67. package/src/components/tables/table-template-gallery.tsx +162 -0
  68. package/src/components/tables/table-template-preview.tsx +219 -0
  69. package/src/components/tables/table-toolbar.tsx +79 -0
  70. package/src/components/tables/table-triggers-tab.tsx +446 -0
  71. package/src/components/tables/types.ts +6 -0
  72. package/src/components/tables/use-spreadsheet-keys.ts +171 -0
  73. package/src/components/tables/utils.ts +29 -0
  74. package/src/components/tasks/task-create-panel.tsx +5 -31
  75. package/src/components/tasks/task-edit-dialog.tsx +5 -27
  76. package/src/components/workflows/workflow-form-view.tsx +11 -35
  77. package/src/components/workflows/workflow-status-view.tsx +1 -1
  78. package/src/instrumentation.ts +3 -0
  79. package/src/lib/agents/__tests__/claude-agent.test.ts +5 -1
  80. package/src/lib/agents/claude-agent.ts +3 -1
  81. package/src/lib/agents/profiles/builtins/document-writer/SKILL.md +23 -0
  82. package/src/lib/agents/profiles/builtins/technical-writer/SKILL.md +10 -0
  83. package/src/lib/agents/profiles/builtins/technical-writer/profile.yaml +1 -1
  84. package/src/lib/agents/runtime/anthropic-direct.ts +29 -0
  85. package/src/lib/agents/runtime/openai-direct.ts +29 -0
  86. package/src/lib/book/chapter-generator.ts +81 -5
  87. package/src/lib/book/chapter-mapping.ts +58 -24
  88. package/src/lib/book/content.ts +83 -47
  89. package/src/lib/book/markdown-parser.ts +1 -1
  90. package/src/lib/book/reading-paths.ts +8 -8
  91. package/src/lib/book/types.ts +1 -1
  92. package/src/lib/book/update-detector.ts +4 -1
  93. package/src/lib/chat/stagent-tools.ts +2 -0
  94. package/src/lib/chat/tool-catalog.ts +34 -0
  95. package/src/lib/chat/tools/table-tools.ts +955 -0
  96. package/src/lib/chat/tools/workflow-tools.ts +9 -1
  97. package/src/lib/constants/table-status.ts +68 -0
  98. package/src/lib/data/__tests__/clear.test.ts +1 -1
  99. package/src/lib/data/clear.ts +45 -0
  100. package/src/lib/data/seed-data/__tests__/profiles.test.ts +28 -23
  101. package/src/lib/data/seed-data/conversations.ts +350 -42
  102. package/src/lib/data/seed-data/documents.ts +564 -591
  103. package/src/lib/data/seed-data/learned-context.ts +101 -22
  104. package/src/lib/data/seed-data/notifications.ts +344 -70
  105. package/src/lib/data/seed-data/profile-test-results.ts +92 -11
  106. package/src/lib/data/seed-data/profiles.ts +144 -46
  107. package/src/lib/data/seed-data/projects.ts +50 -18
  108. package/src/lib/data/seed-data/repo-imports.ts +28 -13
  109. package/src/lib/data/seed-data/schedules.ts +208 -41
  110. package/src/lib/data/seed-data/table-templates.ts +234 -0
  111. package/src/lib/data/seed-data/tasks.ts +614 -116
  112. package/src/lib/data/seed-data/usage-ledger.ts +182 -103
  113. package/src/lib/data/seed-data/user-tables.ts +203 -0
  114. package/src/lib/data/seed-data/views.ts +52 -7
  115. package/src/lib/data/seed-data/workflows.ts +231 -84
  116. package/src/lib/data/seed.ts +55 -14
  117. package/src/lib/data/tables.ts +417 -0
  118. package/src/lib/db/bootstrap.ts +227 -0
  119. package/src/lib/db/index.ts +9 -0
  120. package/src/lib/db/migrations/0019_add_tables_feature.sql +160 -0
  121. package/src/lib/db/migrations/0020_add_table_triggers.sql +19 -0
  122. package/src/lib/db/migrations/0021_add_row_history.sql +15 -0
  123. package/src/lib/db/schema.ts +368 -0
  124. package/src/lib/snapshots/auto-backup.ts +132 -0
  125. package/src/lib/snapshots/retention.ts +64 -0
  126. package/src/lib/snapshots/snapshot-manager.ts +429 -0
  127. package/src/lib/tables/computed.ts +61 -0
  128. package/src/lib/tables/context-builder.ts +139 -0
  129. package/src/lib/tables/formula-engine.ts +415 -0
  130. package/src/lib/tables/history.ts +115 -0
  131. package/src/lib/tables/import.ts +343 -0
  132. package/src/lib/tables/query-builder.ts +152 -0
  133. package/src/lib/tables/trigger-evaluator.ts +146 -0
  134. package/src/lib/tables/types.ts +141 -0
  135. package/src/lib/tables/validation.ts +119 -0
  136. package/src/lib/utils/stagent-paths.ts +20 -0
  137. package/src/lib/workflows/types.ts +1 -1
  138. package/tsconfig.json +3 -1
  139. /package/docs/features/{playbook.md → user-guide.md} +0 -0
@@ -16,7 +16,8 @@ export interface DocumentSeed {
16
16
  mimeType: string;
17
17
  size: number;
18
18
  storagePath: string;
19
- direction: "input";
19
+ direction: "input" | "output";
20
+ category: string | null;
20
21
  status: "uploaded";
21
22
  createdAt: Date;
22
23
  updatedAt: Date;
@@ -24,645 +25,622 @@ export interface DocumentSeed {
24
25
 
25
26
  interface DocumentDef {
26
27
  originalName: string;
27
- mimeType: string;
28
28
  projectIndex: number;
29
29
  taskIndex: number;
30
- content: string | (() => Promise<Buffer>);
31
- }
32
-
33
- // --- Binary file generators ---
34
-
35
- /** Create a minimal valid DOCX (Open XML) using JSZip */
36
- async function createDocx(textContent: string): Promise<Buffer> {
37
- const JSZip = (await import("jszip")).default;
38
- const zip = new JSZip();
39
-
40
- zip.file(
41
- "[Content_Types].xml",
42
- `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
43
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
44
- <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
45
- <Default Extension="xml" ContentType="application/xml"/>
46
- <Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
47
- </Types>`
48
- );
49
-
50
- zip.file(
51
- "_rels/.rels",
52
- `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
53
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
54
- <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
55
- </Relationships>`
56
- );
57
-
58
- const paragraphs = textContent
59
- .split("\n")
60
- .map(
61
- (line) =>
62
- `<w:p><w:r><w:t xml:space="preserve">${escapeXml(line)}</w:t></w:r></w:p>`
63
- )
64
- .join("");
65
-
66
- zip.file(
67
- "word/document.xml",
68
- `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
69
- <w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
70
- <w:body>${paragraphs}</w:body>
71
- </w:document>`
72
- );
73
-
74
- const buf = await zip.generateAsync({ type: "nodebuffer" });
75
- return Buffer.from(buf);
76
- }
77
-
78
- /** Create a minimal valid PPTX using JSZip */
79
- async function createPptx(slides: string[]): Promise<Buffer> {
80
- const JSZip = (await import("jszip")).default;
81
- const zip = new JSZip();
82
-
83
- const slideOverrides = slides
84
- .map(
85
- (_, i) =>
86
- `<Override PartName="/ppt/slides/slide${i + 1}.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"/>`
87
- )
88
- .join("");
89
-
90
- zip.file(
91
- "[Content_Types].xml",
92
- `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
93
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
94
- <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
95
- <Default Extension="xml" ContentType="application/xml"/>
96
- <Override PartName="/ppt/presentation.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"/>
97
- ${slideOverrides}
98
- </Types>`
99
- );
100
-
101
- zip.file(
102
- "_rels/.rels",
103
- `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
104
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
105
- <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="ppt/presentation.xml"/>
106
- </Relationships>`
107
- );
108
-
109
- const slideRels = slides
110
- .map(
111
- (_, i) =>
112
- `<Relationship Id="rId${i + 1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" Target="slides/slide${i + 1}.xml"/>`
113
- )
114
- .join("");
115
-
116
- zip.file(
117
- "ppt/_rels/presentation.xml.rels",
118
- `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
119
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
120
- ${slideRels}
121
- </Relationships>`
122
- );
123
-
124
- const slideIdList = slides
125
- .map((_, i) => `<p:sldId id="${256 + i}" r:id="rId${i + 1}"/>`)
126
- .join("");
127
-
128
- zip.file(
129
- "ppt/presentation.xml",
130
- `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
131
- <p:presentation xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"
132
- xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
133
- <p:sldIdLst>${slideIdList}</p:sldIdLst>
134
- </p:presentation>`
135
- );
136
-
137
- slides.forEach((text, i) => {
138
- zip.file(
139
- `ppt/slides/slide${i + 1}.xml`,
140
- `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
141
- <p:sld xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
142
- xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main">
143
- <p:cSld>
144
- <p:spTree>
145
- <p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr>
146
- <p:grpSpPr/>
147
- <p:sp>
148
- <p:nvSpPr><p:cNvPr id="2" name="Title"/><p:cNvSpPr/><p:nvPr/></p:nvSpPr>
149
- <p:spPr/>
150
- <p:txBody>
151
- <a:bodyPr/>
152
- <a:p><a:r><a:t>${escapeXml(text)}</a:t></a:r></a:p>
153
- </p:txBody>
154
- </p:sp>
155
- </p:spTree>
156
- </p:cSld>
157
- </p:sld>`
158
- );
159
- });
160
-
161
- const buf = await zip.generateAsync({ type: "nodebuffer" });
162
- return Buffer.from(buf);
30
+ direction: "input" | "output";
31
+ category: string | null;
32
+ content: string;
163
33
  }
164
34
 
165
- /** Create a valid XLSX using exceljs */
166
- async function createXlsx(csvContent: string): Promise<Buffer> {
167
- const ExcelJS = await import("exceljs");
168
- const workbook = new ExcelJS.Workbook();
169
- const ws = workbook.addWorksheet("Sheet1");
170
- const rows = csvContent.split("\n").map((line: string) => line.split(","));
171
- for (const row of rows) {
172
- ws.addRow(row);
173
- }
174
- const arrayBuffer = await workbook.xlsx.writeBuffer();
175
- return Buffer.from(arrayBuffer);
176
- }
177
-
178
- /** Create a minimal valid PDF with text content */
179
- function createPdfSync(textContent: string): Buffer {
180
- const lines = textContent.split("\n");
181
- const textOps = lines
182
- .map(
183
- (line, i) =>
184
- `1 0 0 1 50 ${750 - i * 14} Tm (${escapePdf(line)}) Tj`
185
- )
186
- .join("\n");
187
-
188
- const stream = `BT\n/F1 10 Tf\n${textOps}\nET`;
189
- const streamBytes = Buffer.from(stream, "utf-8");
190
-
191
- const objects: string[] = [];
192
- const offsets: number[] = [];
193
- let body = "";
194
-
195
- offsets.push(body.length);
196
- objects.push("1 0 obj\n<< /Type /Catalog /Pages 2 0 R >>\nendobj\n");
197
- body += objects[0];
198
-
199
- offsets.push(body.length);
200
- objects.push("2 0 obj\n<< /Type /Pages /Kids [3 0 R] /Count 1 >>\nendobj\n");
201
- body += objects[1];
202
-
203
- offsets.push(body.length);
204
- objects.push(
205
- "3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>\nendobj\n"
206
- );
207
- body += objects[2];
208
-
209
- offsets.push(body.length);
210
- objects.push(
211
- `4 0 obj\n<< /Length ${streamBytes.length} >>\nstream\n${stream}\nendstream\nendobj\n`
212
- );
213
- body += objects[3];
214
-
215
- offsets.push(body.length);
216
- objects.push(
217
- "5 0 obj\n<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>\nendobj\n"
218
- );
219
- body += objects[4];
220
-
221
- const header = "%PDF-1.4\n";
222
- const xrefOffset = header.length + body.length;
223
-
224
- let xref = `xref\n0 ${offsets.length + 1}\n0000000000 65535 f \n`;
225
- for (const offset of offsets) {
226
- xref += `${String(header.length + offset).padStart(10, "0")} 00000 n \n`;
227
- }
228
-
229
- const trailer = `trailer\n<< /Size ${offsets.length + 1} /Root 1 0 R >>\nstartxref\n${xrefOffset}\n%%EOF`;
230
-
231
- return Buffer.from(header + body + xref + trailer, "utf-8");
232
- }
233
-
234
- function escapeXml(text: string): string {
235
- return text
236
- .replace(/&/g, "&amp;")
237
- .replace(/</g, "&lt;")
238
- .replace(/>/g, "&gt;")
239
- .replace(/"/g, "&quot;");
240
- }
241
-
242
- function escapePdf(text: string): string {
243
- return text
244
- .replace(/\\/g, "\\\\")
245
- .replace(/\(/g, "\\(")
246
- .replace(/\)/g, "\\)");
247
- }
248
-
249
- // --- Document definitions ---
35
+ // --- All documents are markdown (.md) for simplicity and readability ---
250
36
 
251
37
  const DOCUMENTS: DocumentDef[] = [
252
- // Project 1 Investment Portfolio
38
+ // ── P1: Product Launch (2 input, 2 output) ────────────────────────
39
+ {
40
+ originalName: "launch-brief.md",
41
+ projectIndex: 0,
42
+ taskIndex: 0,
43
+ direction: "input",
44
+ category: "brief",
45
+ content: `# AI Copilot v2 Launch Brief
46
+
47
+ ## Product
48
+ AI Copilot v2 — multi-agent orchestration platform for business operations.
49
+ 52+ agent profiles, 25 workflow patterns, 5 AI runtimes.
50
+
51
+ ## Target Audience
52
+ - **Primary:** Solo founders running AI-assisted businesses
53
+ - **Secondary:** Agency owners managing multi-client AI operations
54
+ - **Tertiary:** PE operating partners standardizing portfolio AI
55
+
56
+ ## Positioning
57
+ - **Tagline:** "Your Business, Run by AI"
58
+ - **Category:** AI Agent Orchestration Platform
59
+ - **Differentiator:** The missing layer between "run an agent" and "run my business"
60
+
61
+ ## Launch Channels
62
+ 1. Product Hunt (Day 1 — Tuesday)
63
+ 2. Email sequence (3-touch, Day 0/3/7)
64
+ 3. LinkedIn thought leadership (5-post series)
65
+ 4. Twitter/X launch thread
66
+ 5. Blog: "Why Your Business Needs an AI Operations Layer"
67
+
68
+ ## Success Metrics
69
+ | Metric | Target |
70
+ |--------|--------|
71
+ | Signups (7 days) | 500 |
72
+ | Product Hunt upvotes | 50 |
73
+ | Press mentions | 3 |
74
+ | Email-to-trial conversion | 10% |
75
+
76
+ ## Timeline
77
+ - **Week -2:** Copy + landing page
78
+ - **Week -1:** A/B tests + social calendar
79
+ - **Week 0:** Launch day
80
+ - **Week +1:** Follow-up sequence + retargeting
81
+ `,
82
+ },
253
83
  {
254
- originalName: "portfolio-holdings.xlsx",
255
- mimeType:
256
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
84
+ originalName: "competitor-analysis.md",
257
85
  projectIndex: 0,
258
86
  taskIndex: 0,
259
- content: async () =>
260
- createXlsx(
261
- `Ticker,Shares,Avg Cost,Current Price,Market Value,Sector
262
- NVDA,45,285.50,890.25,40061.25,Technology
263
- AAPL,120,142.30,178.50,21420.00,Technology
264
- MSFT,65,310.00,415.80,27027.00,Technology
265
- GOOGL,80,125.40,172.30,13784.00,Technology
266
- AMZN,55,128.50,185.60,10208.00,Consumer
267
- JNJ,90,158.20,155.80,14022.00,Healthcare
268
- UNH,25,485.00,528.40,13210.00,Healthcare
269
- JPM,70,142.80,198.50,13895.00,Finance
270
- V,50,235.60,282.40,14120.00,Finance
271
- XOM,85,98.40,108.20,9197.00,Energy
272
- PG,60,148.50,165.20,9912.00,Consumer
273
- LLY,15,580.00,782.50,11737.50,Healthcare
274
- HD,35,325.00,348.90,12211.50,Consumer
275
- MA,40,368.50,462.80,18512.00,Finance
276
- CVX,55,152.30,158.40,8712.00,Energy`
277
- ),
87
+ direction: "input",
88
+ category: "research",
89
+ content: `# AI Copilot Competitive Analysis
90
+
91
+ ## 1. Cursor
92
+ - **Positioning:** "The AI Code Editor"
93
+ - **Pricing:** $20/mo (Pro), $40/mo (Business)
94
+ - **Strengths:** IDE-native, fast autocomplete, good UX
95
+ - **Weaknesses:** Code-only, no orchestration, no governance
96
+
97
+ ## 2. Windsurf (Codeium)
98
+ - **Positioning:** "The first agentic IDE"
99
+ - **Pricing:** Free tier, $15/mo (Pro)
100
+ - **Strengths:** Multi-file editing, strong free tier
101
+ - **Weaknesses:** Developer-only, no business operations
102
+
103
+ ## 3. GitHub Copilot
104
+ - **Positioning:** "Your AI pair programmer"
105
+ - **Pricing:** $10/mo (Individual), $19/seat (Business)
106
+ - **Strengths:** Massive distribution (GitHub), brand trust
107
+ - **Weaknesses:** Single-agent, no workflows, limited tools
108
+
109
+ ## 4. Tabnine
110
+ - **Positioning:** "AI that works where you work"
111
+ - **Pricing:** $12/mo (Pro), enterprise pricing
112
+ - **Strengths:** Privacy-focused, on-prem option
113
+ - **Weaknesses:** Autocomplete-only, no agentic capabilities
114
+
115
+ ## 5. Sourcegraph Cody
116
+ - **Positioning:** "AI coding assistant with codebase context"
117
+ - **Pricing:** Free tier, $9/seat (Pro)
118
+ - **Strengths:** Codebase understanding, search integration
119
+ - **Weaknesses:** Read-heavy, limited write operations
120
+
121
+ ## Key Gap
122
+ None of the 5 address multi-agent orchestration, governance, or business operations beyond code. Stagent's positioning as "business operations" is **uncontested**.
123
+ `,
278
124
  },
279
125
  {
280
- originalName: "semiconductor-research.pdf",
281
- mimeType: "application/pdf",
126
+ originalName: "launch-campaign-plan.md",
282
127
  projectIndex: 0,
283
128
  taskIndex: 1,
284
- content: () =>
285
- Promise.resolve(
286
- createPdfSync(
287
- `Semiconductor Industry ETF Analysis
288
-
289
- Market Overview
290
- The semiconductor sector has seen exceptional growth driven by AI
291
- infrastructure demand, automotive chip adoption, and cloud computing.
292
- Total addressable market projected at $1.2T by 2030.
293
-
294
- SOXX - iShares Semiconductor ETF
295
- Expense Ratio: 0.35%, Holdings: 30, 5-Year Return: +142%
296
- Top 5: NVDA 9.8%, AVGO 8.2%, AMD 7.1%, QCOM 5.5%, TXN 5.2%
297
-
298
- SMH - VanEck Semiconductor ETF
299
- Expense Ratio: 0.35%, Holdings: 25, 5-Year Return: +158%
300
- Top 5: NVDA 14.2%, TSM 12.8%, AVGO 6.5%, AMD 5.1%, ASML 4.8%
301
-
302
- PSI - Invesco Dynamic Semiconductors ETF
303
- Expense Ratio: 0.56%, Holdings: 30, 5-Year Return: +98%
304
-
305
- Recommendation: SMH for concentrated AI exposure, SOXX for diversification.`
306
- )
307
- ),
129
+ direction: "output",
130
+ category: "report",
131
+ content: `# AI Copilot v2 — Launch Campaign Plan
132
+ *Generated by GTM Launch Strategist Agent*
133
+
134
+ ## Executive Summary
135
+ Multi-channel launch targeting solo founders and agency owners. 3 headline variants tested, email sequence drafted, social calendar set.
136
+
137
+ ## Headline Variants
138
+ | Variant | Headline | Angle |
139
+ |---------|----------|-------|
140
+ | A | "Your Business, Run by AI" | Orchestration-led |
141
+ | B | "Stop Stitching Start Orchestrating" | Pain-led |
142
+ | C | "52 Agents. One Command Center." | Scale-led |
143
+
144
+ ## Email Sequence
145
+ - **Day 0:** Launch announcement + quick start
146
+ - **Day 3:** Feature deep-dive (workflows + governance)
147
+ - **Day 7:** Case study — "How a solo founder runs 3 businesses with Stagent"
148
+
149
+ ## Social Calendar
150
+ - **Week 1:** LinkedIn series (5 posts, MWF) + Twitter launch thread (Day 1)
151
+ - **Week 2:** Community engagement + retargeting
152
+
153
+ ## Recommendation
154
+ A/B test Variant A vs B. Orchestration messaging resonates with ops buyers. Pain-led converts better on cold traffic. Test with 50/50 split, 7-day window.
155
+ `,
308
156
  },
309
-
310
- // Project 2 — Landing Page
311
157
  {
312
- originalName: "competitor-audit.docx",
313
- mimeType:
314
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
315
- projectIndex: 1,
158
+ originalName: "social-media-calendar.md",
159
+ projectIndex: 0,
316
160
  taskIndex: 5,
317
- content: () =>
318
- createDocx(
319
- `Competitor Landing Page Audit
320
-
321
- 1. Notion (notion.so)
322
- Hero: "Your wiki, docs, & projects. Together."
323
- Strengths: Clean design, interactive demo, strong social proof (10M+ users)
324
- Weaknesses: Hero is text-heavy, no personalization
325
- CTA: "Get Notion free" - low commitment
326
-
327
- 2. Linear (linear.app)
328
- Hero: "Linear is a purpose-built tool for planning and building products"
329
- Strengths: Dark theme feels premium, keyboard shortcut demo, speed-focused
330
- Weaknesses: Appeals mainly to developers, narrow audience
331
- CTA: "Start building" - action-oriented
332
-
333
- 3. Vercel (vercel.com)
334
- Hero: "Develop. Preview. Ship." - three-word framework
335
- Strengths: Live deployment demo, framework logos, dark/light toggle
336
- Weaknesses: Very technical, assumes Next.js knowledge
337
- CTA: "Start Deploying" - verb-first
338
-
339
- 4. Stripe (stripe.com)
340
- Hero: "Financial infrastructure for the internet"
341
- Strengths: Animated code snippets, multiple audience entry points, trust badges
342
- Weaknesses: Dense page, high cognitive load
343
- CTA: "Start now" with "Contact sales" secondary
344
-
345
- Key Patterns:
346
- - All use social proof above the fold
347
- - 2 of 4 feature interactive demos
348
- - Average CTA count: 3 per page
349
-
350
- Opportunity: Dynamic hero based on referral source. None of the 4 do this.`
351
- ),
161
+ direction: "output",
162
+ category: "template",
163
+ content: `# AI Copilot v2 — Social Media Launch Calendar
164
+
165
+ ## Week 1
166
+ | Day | Channel | Content | Target |
167
+ |-----|---------|---------|--------|
168
+ | Mon | LinkedIn | "Why your AI agents need a manager" (narrative hook) | 1,200 impressions |
169
+ | Tue | Twitter | Launch thread (8 tweets, product screenshots, founder story) | 5,000 impressions |
170
+ | Wed | LinkedIn | "The governance gap in agentic AI" (problem framing, tag 3 voices) | 1,500 impressions |
171
+ | Fri | LinkedIn | "3 patterns for multi-agent workflows" (tactical, include diagram) | 1,800 impressions |
172
+
173
+ ## Week 2
174
+ | Day | Channel | Content | Target |
175
+ |-----|---------|---------|--------|
176
+ | Mon | LinkedIn | "Local-first AI — why it matters" (contrarian take) | 1,200 impressions |
177
+ | Wed | LinkedIn | "We gave 52 agents one command center" (product reveal) | 2,000 impressions |
178
+ | Fri | All | Community recap + user highlights | 1,000 impressions |
179
+ `,
352
180
  },
181
+
182
+ // ── P2: Content Engine (2 input, 1 output) ────────────────────────
353
183
  {
354
- originalName: "design-brief.pdf",
355
- mimeType: "application/pdf",
184
+ originalName: "seo-keyword-research.md",
356
185
  projectIndex: 1,
357
186
  taskIndex: 6,
358
- content: () =>
359
- Promise.resolve(
360
- createPdfSync(
361
- `Landing Page Design Brief
362
-
363
- Brand Voice
364
- Tone: Confident, not arrogant. Technical, but accessible.
365
- Personality: The smart colleague who explains things clearly
366
- Avoid: Jargon-heavy copy, exclamation marks, hyperbole
367
-
368
- Target Audience - Primary: Engineering Managers
369
- Age 30-45, managing 5-20 person teams
370
- Pain points: sprint planning overhead, context switching, tool fatigue
371
-
372
- Target Audience - Secondary: Individual Developers
373
- Age 25-35, working in fast-paced startups
374
- Pain points: slow tooling, too many tabs, broken workflows
375
-
376
- Messaging Pillars
377
- 1. Speed - "Build faster"
378
- 2. Intelligence - AI that understands your codebase
379
- 3. Simplicity - One tool, not ten
380
-
381
- Visual Direction
382
- - OKLCH color system, primary hue 250 (blue-indigo)
383
- - Monospace code snippets for technical credibility
384
- - Subtle animations on scroll
385
-
386
- Conversion Goals
387
- Primary: Sign up for free trial
388
- Secondary: Book a demo (enterprise)
389
- Tertiary: Newsletter subscription`
390
- )
391
- ),
187
+ direction: "input",
188
+ category: "research",
189
+ content: `# SEO Keyword Research — AI Agent Orchestration Cluster
190
+
191
+ | Keyword | Monthly Volume | Difficulty | CPC | SERP Features | Content Gap |
192
+ |---------|---------------|------------|-----|---------------|-------------|
193
+ | AI agent orchestration | 2,400 | 38 | $4.20 | Featured Snippet | No comprehensive guide |
194
+ | multi-agent framework | 1,800 | 42 | $3.80 | People Also Ask | Comparison missing |
195
+ | AI agent platform | 4,200 | 55 | $6.50 | Ads + Featured | Dominated by LangChain |
196
+ | agentic AI tools | 3,100 | 35 | $5.10 | People Also Ask | No tools roundup |
197
+ | AI workflow automation | 5,600 | 48 | $7.20 | Featured Snippet | Enterprise-focused only |
198
+ | agent governance AI | 890 | 22 | $3.40 | None | Zero coverage |
199
+ | AI operations platform | 1,200 | 30 | $4.80 | Ads | SaaS angle missing |
200
+ | multi-runtime AI | 340 | 15 | $2.90 | None | Zero coverage |
201
+ | AI agent scheduling | 720 | 28 | $3.20 | People Also Ask | Cron-focused only |
202
+ | heartbeat monitoring AI | 180 | 12 | $2.10 | None | Zero coverage |
203
+
204
+ ## Top Opportunity
205
+ "AI agent orchestration" — medium difficulty, no comprehensive guide exists. Target position 1-3 with a pillar page.
206
+ `,
207
+ },
208
+ {
209
+ originalName: "editorial-calendar.md",
210
+ projectIndex: 1,
211
+ taskIndex: 7,
212
+ direction: "input",
213
+ category: "template",
214
+ content: `# Editorial Calendar — Q2 2026
215
+
216
+ | Week | Topic | Primary Keyword | Target Words | Status | Publish Date |
217
+ |------|-------|----------------|-------------|--------|--------------|
218
+ | W14 | AI Agent Orchestration Guide | AI agent orchestration | 1,800 | Published | 2026-03-28 |
219
+ | W15 | Multi-Agent Workflows Explained | multi-agent framework | 1,500 | In Progress | 2026-04-04 |
220
+ | W16 | Governance for Agentic AI | agent governance AI | 1,600 | Outlined | 2026-04-11 |
221
+ | W17 | AI Ops for Solo Founders | AI operations platform | 1,400 | Planned | 2026-04-18 |
222
+ | W18 | Heartbeat Scheduling Deep Dive | heartbeat monitoring AI | 1,200 | Planned | 2026-04-25 |
223
+ | W19 | Multi-Runtime Architecture | multi-runtime AI | 1,800 | Planned | 2026-05-02 |
224
+ | W20 | AI Agent Tools Roundup 2026 | agentic AI tools | 2,000 | Planned | 2026-05-09 |
225
+
226
+ ## Distribution Plan
227
+ Each article gets: LinkedIn post (same day), newsletter feature, Twitter thread, Dev.to cross-post (3 days later for technical pieces).
228
+ `,
229
+ },
230
+ {
231
+ originalName: "weekly-content-report.md",
232
+ projectIndex: 1,
233
+ taskIndex: 7,
234
+ direction: "output",
235
+ category: "report",
236
+ content: `# Weekly Content Performance Report — W14
237
+ *Generated by Content Production Editor Agent*
238
+
239
+ ## Published This Week
240
+ **"AI Agent Orchestration Guide"** — 1,920 words, published Mar 28
241
+ - Organic sessions: 342 (first 5 days)
242
+ - Avg time on page: 4:12
243
+ - Backlinks acquired: 2 (DevOps Weekly, AI Newsletter)
244
+
245
+ ## SEO Performance
246
+ - Target keyword: "AI agent orchestration" — currently **position 14**
247
+ - Expected to reach page 1 within 3 weeks
248
+ - Secondary keywords indexed: 4 of 6
249
+
250
+ ## Distribution Metrics
251
+ | Channel | Metric | Value |
252
+ |---------|--------|-------|
253
+ | LinkedIn | Impressions | 1,240 |
254
+ | LinkedIn | Engagements | 89 (7.2% rate) |
255
+ | Newsletter | Open rate | 28% |
256
+ | Newsletter | CTR | 4.2% |
257
+ | Twitter thread | Impressions | 3,400 |
258
+
259
+ ## Next Week
260
+ - **Topic:** "Multi-Agent Workflows Explained"
261
+ - **Status:** Outline approved, draft in progress
262
+ - **Distribution:** LinkedIn + newsletter + Dev.to cross-post
263
+ `,
392
264
  },
393
265
 
394
- // Project 3 Lead Generation
266
+ // ── P3: Customer Success (2 input, 1 output) ─────────────────────
395
267
  {
396
- originalName: "prospect-list.xlsx",
397
- mimeType:
398
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
268
+ originalName: "customer-feedback-export.md",
399
269
  projectIndex: 2,
400
- taskIndex: 10,
401
- content: async () =>
402
- createXlsx(
403
- `Name,Title,Company,Industry,Size,LinkedIn URL,Email,Status
404
- Sarah Chen,VP Engineering,Acme Corp,SaaS,500-1000,linkedin.com/in/sarachen,s.chen@acmecorp.com,Qualified
405
- Marcus Johnson,Director of Engineering,Acme Corp,SaaS,500-1000,linkedin.com/in/marcusjohnson,m.johnson@acmecorp.com,Qualified
406
- Rachel Kim,VP Product,Acme Corp,SaaS,500-1000,linkedin.com/in/rachelkim,r.kim@acmecorp.com,Qualified
407
- David Park,CTO,TechStart Inc,DevTools,50-200,linkedin.com/in/davidpark,d.park@techstart.io,Qualified
408
- Lisa Wang,VP Engineering,TechStart Inc,DevTools,50-200,linkedin.com/in/lisawang,l.wang@techstart.io,Qualified
409
- James Miller,VP Product,CloudBase,Infrastructure,200-500,linkedin.com/in/jamesmiller,j.miller@cloudbase.dev,Contacted
410
- Maria Garcia,Director of Engineering,DataFlow AI,AI/ML,100-200,linkedin.com/in/mariagarcia,m.garcia@dataflow.ai,Qualified
411
- Tom Anderson,VP Engineering,ScaleUp HQ,FinTech,500-1000,linkedin.com/in/tomanderson,t.anderson@scaleuphq.com,Qualified
412
- Nina Patel,CTO,QuickShip,Logistics,200-500,linkedin.com/in/ninapatel,n.patel@quickship.co,Researching
413
- Alex Turner,Director of Engineering,BrightPath,EdTech,100-200,linkedin.com/in/alexturner,a.turner@brightpath.edu,Qualified
414
- Sophie Reed,VP Product,GreenGrid,CleanTech,50-200,linkedin.com/in/sophiereed,s.reed@greengrid.io,Researching
415
- Chris Wong,VP Engineering,NexaPay,FinTech,200-500,linkedin.com/in/chriswong,c.wong@nexapay.com,Qualified`
416
- ),
270
+ taskIndex: 13,
271
+ direction: "input",
272
+ category: "data",
273
+ content: `# Customer Health Data Export — Q1 2026
274
+
275
+ | Account | Plan | MRR | NPS Score | Last Login | Support Tickets | Health |
276
+ |---------|------|-----|-----------|------------|----------------|--------|
277
+ | Acme Corp | Team | $499 | 72 | 2026-04-02 | 1 | Green |
278
+ | DataFlow AI | Pro | $149 | 45 | 2026-03-28 | 3 | Yellow |
279
+ | ScaleUp HQ | Team | $499 | 81 | 2026-04-01 | 0 | Green |
280
+ | BrightPath | Pro | $149 | 28 | 2026-03-15 | 5 | Red |
281
+ | CloudBase | Pro | $149 | 65 | 2026-04-01 | 2 | Green |
282
+ | NexaPay | Team | $499 | 38 | 2026-03-20 | 4 | Yellow |
283
+ | QuickShip | Pro | $149 | 55 | 2026-03-30 | 1 | Green |
284
+ | TechStart | Community | $0 | 22 | 2026-02-28 | 6 | Red |
285
+ | GreenGrid | Pro | $149 | 70 | 2026-04-02 | 0 | Green |
286
+ | Meridian Corp | Team | $499 | 42 | 2026-03-25 | 3 | Yellow |
287
+
288
+ ## Summary
289
+ - **Green:** 5 accounts (50%) — healthy engagement
290
+ - **Yellow:** 3 accounts (30%) — watch closely
291
+ - **Red:** 2 accounts (20%) — immediate intervention needed
292
+ `,
417
293
  },
418
294
  {
419
- originalName: "outreach-templates.docx",
420
- mimeType:
421
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
295
+ originalName: "onboarding-playbook.md",
422
296
  projectIndex: 2,
423
297
  taskIndex: 12,
424
- content: () =>
425
- createDocx(
426
- `Personalized Outreach Email Templates
427
-
428
- Template 1: Pain Point Hook
429
- Subject: {Company}'s engineering velocity - quick question
430
-
431
- Hi {FirstName},
432
-
433
- I noticed {Company} recently {recent_event}. Congrats!
434
-
435
- When teams scale past {team_size} engineers, we often see sprint planning eat up 20%+ of leadership time. Is that something you're running into?
436
-
437
- We built something that cuts that overhead in half using AI-powered task routing. Would love 15 minutes to show you how {similar_company} uses it.
438
-
439
- Best, [Sender]
440
-
441
-
442
- Template 2: Social Proof
443
- Subject: How {similar_company} ships 2x faster
444
-
445
- Hi {FirstName},
446
-
447
- {similar_company}'s VP of Eng shared something interesting - their team went from 2-week sprints to continuous delivery. Deployment frequency up 180%.
448
-
449
- I think {Company} could see similar results given your {tech_stack} setup. Worth a quick chat?
450
-
451
- Cheers, [Sender]
452
-
453
-
454
- Template 3: Breakup / Last Touch
455
- Subject: Closing the loop
456
-
457
- Hi {FirstName},
458
-
459
- I've reached out a couple times and totally get it if the timing isn't right.
460
-
461
- If engineering velocity is ever a priority for {Company}, here's what we do: [one-liner + link].
462
-
463
- No hard feelings. The door's always open.
464
-
465
- All the best, [Sender]`
466
- ),
298
+ direction: "input",
299
+ category: "brief",
300
+ content: `# Customer Onboarding Playbook
301
+
302
+ ## Day 0: Welcome + Quick Start
303
+ - Send welcome email with getting started guide
304
+ - Trigger in-app checklist: create project, run first agent, set up workflow
305
+ - Segment by plan tier (Community/Pro/Team)
306
+
307
+ ## Day 2: Feature Spotlight
308
+ - Email: "Your first agent in 5 minutes" walkthrough
309
+ - Link to video tutorial (2 min)
310
+ - CTA: Run your first workflow
311
+
312
+ ## Day 5: Check-In
313
+ - Email: "How are things going?"
314
+ - Direct reply CTA — route to CS team
315
+ - **If no project created:** trigger CSM outreach
316
+
317
+ ## Day 14: Health Check
318
+ - Automated assessment: login frequency, feature adoption, support tickets
319
+ - Score: Green (active), Yellow (partial), Red (at-risk)
320
+ - **Red accounts:** immediate CSM call + personalized rescue plan
321
+
322
+ ## Success Metrics
323
+ | Metric | Target |
324
+ |--------|--------|
325
+ | Day 7 activation rate | 65% |
326
+ | Day 30 retention | 80% |
327
+ | NPS at Day 30 | 50+ |
328
+ `,
329
+ },
330
+ {
331
+ originalName: "churn-risk-report.md",
332
+ projectIndex: 2,
333
+ taskIndex: 13,
334
+ direction: "output",
335
+ category: "report",
336
+ content: `# Churn Risk Report — Q1 Cohort
337
+ *Generated by Customer Success Analyst Agent*
338
+
339
+ | Account | Risk Score | Primary Signal | Days Since Login | Open Tickets | NPS Trend | Intervention |
340
+ |---------|-----------|----------------|-----------------|-------------|-----------|--------------|
341
+ | BrightPath | 92 | Low usage + high tickets | 19 | 5 | Declining (-15) | Schedule CSM call — offer training session |
342
+ | TechStart | 88 | No login in 34 days | 34 | 6 | N/A (no response) | Executive outreach — potential churn |
343
+ | NexaPay | 65 | NPS drop + stalled onboarding | 14 | 4 | Declining (-8) | Feature walkthrough — focus on workflows |
344
+ | DataFlow AI | 45 | Moderate tickets | 6 | 3 | Stable | Monitor — send check-in email |
345
+ | Meridian Corp | 40 | NPS dip | 9 | 3 | Slight decline (-3) | Proactive NPS follow-up |
346
+
347
+ ## Key Finding
348
+ Accounts without a workflow created by Day 7 have an **82% churn correlation**. Recommend triggering proactive intervention at Day 5.
349
+ `,
467
350
  },
468
351
 
469
- // Project 4 Business Trip
352
+ // ── P4: TechVenture Partners (2 input, 2 output) ─────────────────
470
353
  {
471
- originalName: "trip-itinerary.docx",
472
- mimeType:
473
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
354
+ originalName: "financial-statements.md",
474
355
  projectIndex: 3,
475
- taskIndex: 17,
476
- content: () =>
477
- createDocx(
478
- `NYC Business Trip Itinerary - March 15-18, 2025
479
-
480
- Day 1 - Saturday, March 15
481
- 7:00 AM Depart SFO - United UA 456, Gate B12 (TSA Pre)
482
- 3:30 PM Arrive JFK Terminal 7 - Uber to hotel (~45 min)
483
- 4:30 PM Hotel check-in - The Manhattan Club, 200 W 56th St
484
- 6:00 PM Conference keynote - Javits Center, Hall 1A
485
- 8:00 PM Team dinner - Carbone, 181 Thompson St
486
-
487
- Day 2 - Sunday, March 16
488
- 8:30 AM Breakfast meeting - The Smith (J. Rivera, Acme Corp)
489
- 10:00 AM Partner meeting #1 - Acme Corp HQ, 350 5th Ave
490
- 12:00 PM Lunch - Le Bernardin, 155 W 51st St
491
- 2:00 PM Client meeting - DataFlow AI, 85 Broad St
492
- 4:30 PM Partner meeting #2 - ScaleUp HQ, 28 W 23rd St
493
- 7:00 PM Networking event - Rooftop at The Standard
494
-
495
- Day 3 - Monday, March 17
496
- 9:00 AM Workshop - Javits Center, Room 204
497
- 12:00 PM Working lunch - Hotel lobby cafe
498
- 2:00 PM Team standup (Zoom)
499
- 3:00 PM Hotel checkout
500
- 6:00 PM Depart JFK - United UA 891, Terminal 7
501
- 9:15 PM Arrive SFO
502
-
503
- Travel Budget:
504
- Flights: $660 | Hotel: $867 | Meals: $225
505
- Ground transport: $200 | Misc: $100
506
- Total: $2,052 (Pre-approved #EXP-2025-0342)`
507
- ),
356
+ taskIndex: 18,
357
+ direction: "input",
358
+ category: "data",
359
+ content: `# HealthSync Financial Summary 9 Quarters
360
+
361
+ | Metric | 2024 Q1 | 2024 Q2 | 2024 Q3 | 2024 Q4 | 2025 Q1 | 2025 Q2 | 2025 Q3 | 2025 Q4 | 2026 Q1 |
362
+ |--------|---------|---------|---------|---------|---------|---------|---------|---------|---------|
363
+ | ARR ($M) | 3.2 | 3.8 | 4.5 | 5.2 | 5.8 | 6.4 | 7.1 | 7.8 | 8.2 |
364
+ | MRR ($K) | 267 | 317 | 375 | 433 | 483 | 533 | 592 | 650 | 683 |
365
+ | Gross Margin (%) | 74 | 75 | 76 | 77 | 78 | 78 | 78 | 78 | 78 |
366
+ | Net Retention (%) | 108 | 110 | 112 | 115 | 116 | 117 | 118 | 118 | 118 |
367
+ | Burn Rate ($K/mo) | 420 | 410 | 400 | 395 | 390 | 385 | 380 | 380 | 380 |
368
+ | Runway (months) | 22 | 20 | 18 | 17 | 16 | 15 | 14 | 14 | 14 |
369
+ | Customer Count | 42 | 51 | 63 | 78 | 89 | 102 | 115 | 128 | 138 |
370
+ | Avg Contract Value ($K) | 76 | 75 | 71 | 67 | 65 | 63 | 62 | 61 | 59 |
371
+ `,
508
372
  },
509
373
  {
510
- originalName: "expense-report.xlsx",
511
- mimeType:
512
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
374
+ originalName: "market-sizing.md",
513
375
  projectIndex: 3,
514
376
  taskIndex: 19,
515
- content: async () =>
516
- createXlsx(
517
- `Date,Category,Vendor,Amount,Description,Receipt
518
- 2025-03-15,Airfare,United Airlines,342.00,SFO to JFK Economy Plus UA 456,receipt-001.pdf
519
- 2025-03-15,Ground Transport,Uber,62.50,JFK to Manhattan Club hotel,receipt-002.pdf
520
- 2025-03-15,Meals,Carbone Restaurant,89.00,Team dinner (4 people split),receipt-003.pdf
521
- 2025-03-16,Meals,The Smith NYC,28.50,Breakfast meeting with J. Rivera,receipt-004.pdf
522
- 2025-03-16,Ground Transport,Uber,18.75,Hotel to Acme Corp,receipt-005.pdf
523
- 2025-03-16,Meals,Le Bernardin,65.00,Working lunch,receipt-006.pdf
524
- 2025-03-16,Ground Transport,Uber,32.40,Acme to DataFlow AI,receipt-007.pdf
525
- 2025-03-16,Ground Transport,Lyft,24.80,DataFlow to ScaleUp HQ,receipt-008.pdf
526
- 2025-03-16,Meals,Rooftop at The Standard,42.00,Networking event,receipt-009.pdf
527
- 2025-03-17,Meals,Hotel Lobby Cafe,18.50,Working lunch,receipt-010.pdf
528
- 2025-03-17,Ground Transport,Uber,58.20,Manhattan Club to JFK,receipt-011.pdf
529
- 2025-03-17,Conference,TechConf 2025,299.00,Conference registration,receipt-012.pdf
530
- 2025-03-15,Hotel,The Manhattan Club,289.00,Night 1 Standard King,receipt-013.pdf
531
- 2025-03-16,Hotel,The Manhattan Club,289.00,Night 2 Standard King,receipt-014.pdf
532
- 2025-03-17,Hotel,The Manhattan Club,289.00,Night 3 Standard King,receipt-015.pdf
533
- 2025-03-15,Meals,Starbucks JFK,8.40,Coffee at terminal,receipt-016.pdf
534
- 2025-03-16,Miscellaneous,CVS Pharmacy,12.80,Phone charger,receipt-017.pdf
535
- 2025-03-17,Miscellaneous,Hotel Concierge,15.00,Luggage storage tip,receipt-018.pdf`
536
- ),
537
- },
538
-
539
- // Project 5 — Tax Filing
540
- {
541
- originalName: "tax-documents-checklist.pdf",
542
- mimeType: "application/pdf",
543
- projectIndex: 4,
544
- taskIndex: 20,
545
- content: () =>
546
- Promise.resolve(
547
- createPdfSync(
548
- `2025 Tax Documents Checklist
549
-
550
- INCOME DOCUMENTS
551
- [X] W-2 - TechCorp Inc (primary employer)
552
- Gross wages: $185,000 | Federal withholding: $37,200
553
- State withholding: $12,580 | Received: Jan 28
554
-
555
- [X] 1099-INT - Chase Bank (savings interest)
556
- Interest income: $1,240 | Received: Feb 2
377
+ direction: "input",
378
+ category: "research",
379
+ content: `# Healthcare Scheduling Market Analysis
557
380
 
558
- [X] 1099-DIV - Fidelity Investments
559
- Ordinary dividends: $3,850 | Qualified: $2,910
381
+ ## Total Addressable Market (TAM)
382
+ **US healthcare scheduling software: $12.4B (2026)**
560
383
 
561
- [X] 1099-B - Charles Schwab (stock sales)
562
- Proceeds: $42,800 | Cost basis: $38,200 | Net gain: $4,600
384
+ Growth drivers:
385
+ - Labor shortages forcing efficiency
386
+ - Patient no-show costs ($150B annually)
387
+ - Telehealth integration demand
563
388
 
564
- [ ] 1099-NEC - Freelance Client (PENDING)
565
- Expected: ~$8,500
389
+ ## Serviceable Addressable Market (SAM)
390
+ **AI-enabled scheduling, mid-market (10-200 providers): $3.8B**
566
391
 
567
- DEDUCTION DOCUMENTS
568
- [X] 1098 - Wells Fargo (mortgage interest)
569
- Interest paid: $18,400 | Property tax: $6,200
392
+ Key requirements: intelligent scheduling, no-show prediction, multi-provider coordination, EHR integration
570
393
 
571
- [X] Charitable donations - receipts compiled
572
- Cash: $2,400 | Goodwill (FMV): $800
394
+ ## Serviceable Obtainable Market (SOM)
395
+ **Outpatient clinics in top 20 metros: $420M**
573
396
 
574
- [ ] Home office measurements - pending calculation
397
+ Why: concentrated provider networks, highest no-show rates, most receptive to AI (34% have AI budget allocated)
575
398
 
576
- [X] State estimated tax payments
577
- Q1-Q4: $3,200 each | Total: $12,800
399
+ ## Competitive Landscape
400
+ 1. **Zocdoc** consumer-facing, not AI-native
401
+ 2. **Phreesia** — check-in focused, scheduling is secondary
402
+ 3. **QGenda** — physician scheduling, not patient-facing
403
+ 4. **Clockwise Health** — early stage, limited features
578
404
 
579
- STATUS: 7 of 8 documents collected (87.5%)`
580
- )
581
- ),
405
+ **None have true AI-powered scheduling optimization. Greenfield for an AI-native entrant like HealthSync.**
406
+ `,
582
407
  },
583
408
  {
584
- originalName: "deductible-expenses.xlsx",
585
- mimeType:
586
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
587
- projectIndex: 4,
409
+ originalName: "due-diligence-memo.md",
410
+ projectIndex: 3,
411
+ taskIndex: 20,
412
+ direction: "output",
413
+ category: "report",
414
+ content: `# HealthSync Due Diligence Memo
415
+ *Prepared by Portfolio Due Diligence Analyst Agent*
416
+
417
+ ## Executive Summary
418
+ HealthSync is a category-defining AI scheduling platform targeting mid-market outpatient practices. The company demonstrates strong product-market fit with 118% net retention and 42% ARR growth.
419
+
420
+ ## Investment Thesis
421
+ 1. **AI-native product** with proven 35% no-show reduction
422
+ 2. **Net retention 118%** signals expansion revenue
423
+ 3. **Greenfield competitive landscape** — no AI-native incumbents
424
+ 4. **$3.8B SAM** growing at 24% CAGR
425
+
426
+ ## Financial Highlights
427
+ | Metric | Value |
428
+ |--------|-------|
429
+ | ARR | $8.2M (42% YoY growth) |
430
+ | Gross margin | 78% |
431
+ | Net retention | 118% |
432
+ | Burn rate | $380K/mo |
433
+ | Runway | 14 months |
434
+ | LTV/CAC | 4.2x (payback 11 months) |
435
+
436
+ ## Top Risks
437
+ 1. **Customer concentration:** top 5 accounts = 62% of ARR
438
+ - *Mitigant:* Logo diversification plan targets 20 new logos in 12 months
439
+ 2. **Single-product risk:** scheduling only
440
+ - *Mitigant:* Waitlist management and patient engagement on roadmap
441
+ 3. **Regulatory:** HIPAA compliance complexity for new markets
442
+ - *Mitigant:* SOC 2 Type II certified, HIPAA BAA standard
443
+
444
+ ## Recommendation: **GO**
445
+ Invest at current $45M valuation ($5.5x ARR). Condition: Secure 3 new enterprise logos within 6 months.
446
+ `,
447
+ },
448
+ {
449
+ originalName: "board-deck.md",
450
+ projectIndex: 3,
588
451
  taskIndex: 21,
589
- content: async () =>
590
- createXlsx(
591
- `Date,Category,Description,Amount,Deductible,Notes
592
- 2025-01-05,Home Office,Internet service (pro-rata),45.00,Yes,8.3% of total
593
- 2025-01-05,Home Office,Electricity (pro-rata),32.00,Yes,8.3% of total
594
- 2025-01-12,Professional Dev,Udemy - Advanced TypeScript,29.99,Yes,Job-related
595
- 2025-01-15,Software,GitHub Pro subscription,7.00,Yes,Monthly
596
- 2025-01-15,Software,Figma Professional,15.00,Yes,Monthly
597
- 2025-01-20,Charitable,SF Food Bank donation,200.00,Yes,Receipt #4521
598
- 2025-02-01,Home Office,Ergonomic desk chair,485.00,Partial,May depreciate
599
- 2025-02-05,Home Office,Internet service (pro-rata),45.00,Yes,Monthly
600
- 2025-02-05,Home Office,Electricity (pro-rata),28.00,Yes,Lower winter bill
601
- 2025-02-10,Professional Dev,AWS SA exam fee,300.00,Yes,Certification
602
- 2025-02-14,Charitable,American Red Cross,150.00,Yes,Confirmation email
603
- 2025-02-15,Software,GitHub Pro subscription,7.00,Yes,Monthly
604
- 2025-02-15,Software,Figma Professional,15.00,Yes,Monthly
605
- 2025-03-01,Health,HSA contribution,500.00,Yes,Monthly
606
- 2025-03-05,Home Office,Internet service (pro-rata),45.00,Yes,Monthly
607
- 2025-03-05,Home Office,Electricity (pro-rata),35.00,Yes,Monthly
608
- 2025-03-10,Professional Dev,O'Reilly Safari,49.00,Yes,Annual
609
- 2025-03-12,Charitable,Local animal shelter,100.00,Yes,Receipt #782
610
- 2025-03-15,Software,GitHub Pro subscription,7.00,Yes,Monthly
611
- 2025-03-15,Software,Figma Professional,15.00,Yes,Monthly
612
- 2025-03-15,Equipment,External monitor (4K),650.00,Partial,Section 179
613
- 2025-03-20,Professional Dev,React Conference,350.00,Yes,Job-related
614
- 2025-04-01,Health,HSA contribution,500.00,Yes,Monthly
615
- 2025-04-05,Home Office,Internet (pro-rata),45.00,Yes,Monthly
616
- 2025-04-05,Home Office,Electricity (pro-rata),38.00,Yes,Spring cycle`
617
- ),
452
+ direction: "output",
453
+ category: "report",
454
+ content: `# TechVenture Partners — Q2 Portfolio Review
455
+
456
+ ## Portfolio Overview
457
+ 4 companies, $28M combined ARR, 38% weighted growth
458
+
459
+ ## Company Summaries
460
+
461
+ ### HealthSync
462
+ - **ARR:** $8.2M (+42%) | **GM:** 78% | **NRR:** 118%
463
+ - **Status:** GO recommendation, DD complete
464
+ - **Action:** Close investment at $45M valuation
465
+
466
+ ### NovaPay
467
+ - **ARR:** $12.1M (+35%) | **GM:** 72% | **NRR:** 112%
468
+ - **Status:** Stable, watching burn rate acceleration
469
+ - **Action:** CFO search in progress
470
+
471
+ ### DataBridge
472
+ - **ARR:** $5.4M (+48%) | **GM:** 68% | **NRR:** 125%
473
+ - **Status:** Fastest growth, needs sales capacity
474
+ - **Action:** Series A prep — target Q3 raise
475
+
476
+ ### CloudSecure
477
+ - **ARR:** $2.3M (+28%) | **GM:** 82% | **NRR:** 108%
478
+ - **Status:** Early but promising unit economics
479
+ - **Action:** Continue monitoring, next board review Q3
480
+
481
+ ## Key Actions
482
+ 1. Close HealthSync investment
483
+ 2. NovaPay CFO search
484
+ 3. DataBridge Series A prep
485
+
486
+ ## Risk Watch
487
+ - NovaPay burn acceleration
488
+ - DataBridge single-threaded sales
489
+ `,
618
490
  },
619
491
 
620
- // Extra office docs for variety
492
+ // ── P5: GreenLeaf Commerce (1 input) ──────────────────────────────
493
+ {
494
+ originalName: "product-catalog.md",
495
+ projectIndex: 4,
496
+ taskIndex: 24,
497
+ direction: "input",
498
+ category: "data",
499
+ content: `# GreenLeaf Commerce — Product Catalog (Top 10 SKUs)
500
+
501
+ | SKU | Product Name | Category | Price | Reviews | Rating | Monthly Searches | Listing Score |
502
+ |-----|-------------|----------|-------|---------|--------|-----------------|---------------|
503
+ | SKU-1042 | Bamboo Kitchen Set | Kitchen | $49.99 | 342 | 4.2 | 2,800 | 52 |
504
+ | SKU-1108 | Organic Cotton Sheets | Bedding | $89.99 | 1,205 | 4.6 | 4,200 | 71 |
505
+ | SKU-1215 | Recycled Glass Vases | Decor | $34.99 | 187 | 4.1 | 1,100 | 48 |
506
+ | SKU-1301 | Eco Yoga Mat | Fitness | $59.99 | 892 | 4.5 | 3,400 | 68 |
507
+ | SKU-1422 | Reusable Beeswax Wraps | Kitchen | $24.99 | 2,341 | 4.7 | 5,100 | 82 |
508
+ | SKU-1503 | Solar Garden Lights | Outdoor | $39.99 | 567 | 4.3 | 2,200 | 61 |
509
+ | SKU-1618 | Bamboo Toothbrush Set | Personal | $12.99 | 3,102 | 4.4 | 6,800 | 75 |
510
+ | SKU-1722 | Recycled Tote Bags | Accessories | $19.99 | 1,456 | 4.5 | 3,900 | 73 |
511
+ | SKU-1834 | Organic Face Serum | Beauty | $44.99 | 723 | 4.1 | 2,600 | 55 |
512
+ | SKU-1901 | Compostable Phone Case | Accessories | $29.99 | 445 | 3.9 | 1,800 | 44 |
513
+
514
+ ## Optimization Priority
515
+ Top opportunity: **Bamboo Kitchen Set (SKU-1042)** — 2.8K monthly searches but title misses primary keyword entirely. Listing score 52/100.
516
+ `,
517
+ },
621
518
 
622
- // Campaign pitch deck for lead gen
519
+ // ── P7: Revenue Operations (1 input, 1 output) ────────────────────
623
520
  {
624
- originalName: "campaign-pitch-deck.pptx",
625
- mimeType:
626
- "application/vnd.openxmlformats-officedocument.presentationml.presentation",
627
- projectIndex: 2,
628
- taskIndex: 13,
629
- content: () =>
630
- createPptx([
631
- "Lead Generation Campaign - Q2 2025",
632
- "Target Market: VP/Director-level at B2B SaaS companies (50-1000 employees)",
633
- "Campaign Strategy: 3-touch email sequence over 14 days, segmented by company size and role",
634
- "Prospect Pipeline: 15 qualified leads across 8 companies",
635
- "Email Templates: Pain Point Hook (cold), Social Proof (warm), Breakup (last touch)",
636
- "Success Metrics: 40% open rate target, 8% reply rate, 3 meetings booked per week",
637
- "Timeline: Week 1 first touch, Week 2 follow-ups, Week 3 breakup + new prospects",
638
- "Budget: $0 organic outreach + $500/mo email tooling",
639
- ]),
521
+ originalName: "pipeline-snapshot.md",
522
+ projectIndex: 6,
523
+ taskIndex: 36,
524
+ direction: "input",
525
+ category: "data",
526
+ content: `# Pipeline Snapshot — Week of March 31, 2026
527
+
528
+ | Deal Name | Owner | Stage | Amount | Days in Stage | Close Date | Next Step | Risk |
529
+ |-----------|-------|-------|--------|--------------|------------|-----------|------|
530
+ | Acme Corp Expansion | Sarah K | Negotiation | $180K | 3 | 2026-04-15 | Contract review | Low |
531
+ | Atlas Financial | Mike R | Evaluation | $95K | 8 | 2026-04-30 | Demo follow-up | Medium |
532
+ | Meridian Corp | Sarah K | Proposal | $220K | 12 | 2026-05-10 | VP meeting needed | High |
533
+ | Pinnacle Tech | Jordan L | Evaluation | $65K | 15 | 2026-05-30 | Re-qualify | High |
534
+ | DataPulse | Mike R | Discovery | $45K | 2 | 2026-06-15 | Discovery call #2 | Low |
535
+ | NexaHealth | Jordan L | Proposal | $150K | 5 | 2026-04-25 | Pricing discussion | Medium |
536
+ | CloudFirst | Sarah K | Negotiation | $310K | 1 | 2026-04-10 | MSA redline | Low |
537
+ | GreenTech Solutions | Mike R | Discovery | $75K | 4 | 2026-06-30 | Needs analysis | Low |
538
+ | Summit Partners | Jordan L | Evaluation | $120K | 7 | 2026-05-15 | Technical review | Medium |
539
+ | Vertex Labs | Sarah K | Discovery | $55K | 1 | 2026-07-15 | Intro meeting | Low |
540
+
541
+ ## Summary
542
+ - **Active deals:** 10 | **Total weighted:** $2.8M
543
+ - **Net new this week:** +3 deals ($175K)
544
+ - **Stalled (>5 days):** 3 deals (Meridian, Pinnacle, Atlas)
545
+ `,
546
+ },
547
+ {
548
+ originalName: "weekly-deal-review.md",
549
+ projectIndex: 6,
550
+ taskIndex: 37,
551
+ direction: "output",
552
+ category: "report",
553
+ content: `# Weekly Deal Review — Revenue Operations
554
+ *Generated by Revenue Operations Analyst Agent*
555
+
556
+ ## Pipeline Summary
557
+ - **Active deals:** 10 | **Total weighted:** $2.8M
558
+ - **Net new this week:** +3 deals ($175K)
559
+ - **Lost this week:** 0 | **Won this week:** 0
560
+
561
+ ## Forecast by Confidence
562
+ | Bucket | Amount | Deals |
563
+ |--------|--------|-------|
564
+ | Committed | $490K | Acme Corp + CloudFirst |
565
+ | Best case | $865K | + NexaHealth + Atlas |
566
+ | Upside | $1.34M | + Meridian + Summit |
567
+
568
+ ## Stalled Deals (Action Required)
569
+ 1. **Meridian Corp** ($220K) — 12 days, no activity
570
+ → VP-to-VP outreach, Sarah to schedule exec call
571
+ 2. **Pinnacle Tech** ($65K) — 15 days, close date pushed 3x
572
+ → Re-qualify — may not be a real opportunity
573
+ 3. **Atlas Financial** ($95K) — competitor mentioned
574
+ → Send competitive battle card, schedule value demo
575
+
576
+ ## Rep Coaching Notes
577
+ - **Sarah K:** Strong pipeline ($765K), close Acme this week
578
+ - **Mike R:** Needs help with Atlas — prep competitive response
579
+ - **Jordan L:** Pinnacle stall — coach on qualification criteria
580
+
581
+ ## Top 3 Actions This Week
582
+ 1. Close Acme Corp — contract in redline, push for signature
583
+ 2. Meridian rescue — exec outreach before deal goes cold
584
+ 3. Pinnacle qualification — go/no-go decision by Friday
585
+ `,
640
586
  },
641
587
 
642
- // Quarterly performance summary for portfolio project
588
+ // ── P8: Compliance (1 output) ─────────────────────────────────────
643
589
  {
644
- originalName: "q1-performance-summary.pptx",
645
- mimeType:
646
- "application/vnd.openxmlformats-officedocument.presentationml.presentation",
647
- projectIndex: 0,
648
- taskIndex: 3,
649
- content: () =>
650
- createPptx([
651
- "Q1 2025 Portfolio Performance Summary",
652
- "Portfolio Value: $238,419 (+12.4% YTD vs S&P 500 +8.2%)",
653
- "Top Performers: NVDA +34%, LLY +22%, MA +18%",
654
- "Underperformers: JNJ -1.5%, CVX +3.8%, XOM +2.1%",
655
- "Sector Allocation: Tech 42%, Healthcare 18%, Finance 15%, Consumer 12%, Energy 8%, Cash 5%",
656
- "Risk Assessment: Tech concentration at 42% exceeds 35% target",
657
- "Dividend Income: $1,842 Q1 ($7,368 annualized, 3.1% yield)",
658
- "Action Items: Trim NVDA by 20 shares, Add UNH +10, Initiate SCHD position",
659
- ]),
590
+ originalName: "compliance-audit-report.md",
591
+ projectIndex: 7,
592
+ taskIndex: 42,
593
+ direction: "output",
594
+ category: "report",
595
+ content: `# Monthly Compliance Audit Report — March 2026
596
+ *Generated by Compliance Audit Workflow*
597
+
598
+ ## Executive Summary
599
+ - **Overall posture:** GREEN (improving)
600
+ - **Controls satisfied:** 14 of 16 (87.5%)
601
+ - **Trend:** +1 control vs February (81.25%)
602
+
603
+ ## Audit Scope
604
+ | Metric | Value |
605
+ |--------|-------|
606
+ | Period | March 1-31, 2026 |
607
+ | Governed executions | 1,247 |
608
+ | Permission requests | 89 (82 approved, 7 denied) |
609
+ | Tool invocations | 3,420 |
610
+
611
+ ## Control Effectiveness
612
+ | Control | Status |
613
+ |---------|--------|
614
+ | CC1.1 - Access Control | PASS |
615
+ | CC1.2 - Authentication | PASS |
616
+ | CC2.1 - Risk Assessment | PASS |
617
+ | CC3.1 - Change Management | PASS |
618
+ | CC5.1 - Monitoring | PASS |
619
+ | CC6.1 - Logical Access | **PARTIAL** (3 Bash auto-approves) |
620
+ | CC7.2 - Incident Response | **PARTIAL** (budget breach alerts) |
621
+
622
+ ## Gap Analysis
623
+ 1. **CC6.1** — 3 Bash commands auto-approved that should require review
624
+ - Severity: Medium
625
+ - Remediation: Update auto-approve policy by April 15
626
+ 2. **CC7.2** — Heartbeat budget exceeded twice without notification
627
+ - Severity: Low
628
+ - Remediation: Add budget breach alert by April 10
629
+
630
+ ## Month-over-Month Trend
631
+ | Month | Score | Gaps | Posture |
632
+ |-------|-------|------|---------|
633
+ | January | 75.0% | 4 | YELLOW |
634
+ | February | 81.25% | 3 | YELLOW |
635
+ | March | 87.5% | 2 | GREEN |
636
+ | **Target (June)** | **93.75%** | **1 max** | **GREEN** |
637
+ `,
660
638
  },
661
639
  ];
662
640
 
663
641
  /**
664
642
  * Write document files to disk and return seed records.
665
- * Async because DOCX/PPTX generation uses JSZip's async API.
643
+ * All documents are markdown no async binary generation needed.
666
644
  */
667
645
  export async function createDocuments(
668
646
  projectIds: string[],
@@ -674,16 +652,10 @@ export async function createDocuments(
674
652
 
675
653
  for (const def of DOCUMENTS) {
676
654
  const id = crypto.randomUUID();
677
- const ext = def.originalName.split(".").pop()!;
678
- const filename = `${id}.${ext}`;
655
+ const filename = `${id}.md`;
679
656
  const storagePath = join(uploadsDir, filename);
680
657
 
681
- let buf: Buffer;
682
- if (typeof def.content === "function") {
683
- buf = await def.content();
684
- } else {
685
- buf = Buffer.from(def.content, "utf-8");
686
- }
658
+ const buf = Buffer.from(def.content, "utf-8");
687
659
  writeFileSync(storagePath, buf);
688
660
 
689
661
  const taskId = taskIds[def.taskIndex];
@@ -695,10 +667,11 @@ export async function createDocuments(
695
667
  projectId,
696
668
  filename,
697
669
  originalName: def.originalName,
698
- mimeType: def.mimeType,
670
+ mimeType: "text/markdown",
699
671
  size: buf.length,
700
672
  storagePath,
701
- direction: "input" as const,
673
+ direction: def.direction,
674
+ category: def.category,
702
675
  status: "uploaded" as const,
703
676
  createdAt: new Date(),
704
677
  updatedAt: new Date(),