stagent 0.6.2 → 0.7.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 (176) hide show
  1. package/README.md +21 -2
  2. package/dist/cli.js +272 -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 -2
  15. package/src/app/api/chat/entities/search/route.ts +12 -3
  16. package/src/app/api/documents/[id]/route.ts +5 -1
  17. package/src/app/api/documents/[id]/versions/route.ts +53 -0
  18. package/src/app/api/documents/route.ts +5 -1
  19. package/src/app/api/projects/[id]/documents/route.ts +124 -0
  20. package/src/app/api/projects/[id]/route.ts +72 -3
  21. package/src/app/api/projects/__tests__/delete-project.test.ts +13 -0
  22. package/src/app/api/schedules/route.ts +19 -1
  23. package/src/app/api/snapshots/[id]/restore/route.ts +62 -0
  24. package/src/app/api/snapshots/[id]/route.ts +44 -0
  25. package/src/app/api/snapshots/route.ts +54 -0
  26. package/src/app/api/snapshots/settings/route.ts +67 -0
  27. package/src/app/api/tables/[id]/charts/[chartId]/route.ts +89 -0
  28. package/src/app/api/tables/[id]/charts/route.ts +72 -0
  29. package/src/app/api/tables/[id]/columns/route.ts +70 -0
  30. package/src/app/api/tables/[id]/export/route.ts +94 -0
  31. package/src/app/api/tables/[id]/history/route.ts +15 -0
  32. package/src/app/api/tables/[id]/import/route.ts +111 -0
  33. package/src/app/api/tables/[id]/route.ts +86 -0
  34. package/src/app/api/tables/[id]/rows/[rowId]/history/route.ts +32 -0
  35. package/src/app/api/tables/[id]/rows/[rowId]/route.ts +51 -0
  36. package/src/app/api/tables/[id]/rows/route.ts +101 -0
  37. package/src/app/api/tables/[id]/triggers/[triggerId]/route.ts +65 -0
  38. package/src/app/api/tables/[id]/triggers/route.ts +122 -0
  39. package/src/app/api/tables/route.ts +65 -0
  40. package/src/app/api/tables/templates/route.ts +92 -0
  41. package/src/app/api/tasks/[id]/route.ts +37 -2
  42. package/src/app/api/tasks/[id]/siblings/route.ts +48 -0
  43. package/src/app/api/tasks/route.ts +8 -9
  44. package/src/app/api/workflows/[id]/documents/route.ts +209 -0
  45. package/src/app/api/workflows/[id]/execute/route.ts +6 -2
  46. package/src/app/api/workflows/[id]/route.ts +16 -3
  47. package/src/app/api/workflows/[id]/status/route.ts +18 -2
  48. package/src/app/api/workflows/route.ts +13 -2
  49. package/src/app/documents/page.tsx +5 -1
  50. package/src/app/layout.tsx +0 -1
  51. package/src/app/manifest.ts +3 -3
  52. package/src/app/projects/[id]/page.tsx +62 -2
  53. package/src/app/settings/page.tsx +2 -0
  54. package/src/app/tables/[id]/page.tsx +67 -0
  55. package/src/app/tables/page.tsx +21 -0
  56. package/src/app/tables/templates/page.tsx +19 -0
  57. package/src/components/chat/chat-table-result.tsx +139 -0
  58. package/src/components/documents/document-browser.tsx +1 -1
  59. package/src/components/documents/document-chip-bar.tsx +17 -1
  60. package/src/components/documents/document-detail-view.tsx +51 -0
  61. package/src/components/documents/document-grid.tsx +5 -0
  62. package/src/components/documents/document-table.tsx +4 -0
  63. package/src/components/documents/types.ts +3 -0
  64. package/src/components/projects/project-form-sheet.tsx +109 -2
  65. package/src/components/schedules/schedule-form.tsx +91 -1
  66. package/src/components/settings/data-management-section.tsx +17 -12
  67. package/src/components/settings/database-snapshots-section.tsx +469 -0
  68. package/src/components/shared/app-sidebar.tsx +2 -0
  69. package/src/components/shared/document-picker-sheet.tsx +486 -0
  70. package/src/components/tables/table-browser.tsx +234 -0
  71. package/src/components/tables/table-cell-editor.tsx +226 -0
  72. package/src/components/tables/table-chart-builder.tsx +288 -0
  73. package/src/components/tables/table-chart-view.tsx +146 -0
  74. package/src/components/tables/table-column-header.tsx +103 -0
  75. package/src/components/tables/table-column-sheet.tsx +331 -0
  76. package/src/components/tables/table-create-sheet.tsx +240 -0
  77. package/src/components/tables/table-detail-sheet.tsx +144 -0
  78. package/src/components/tables/table-detail-tabs.tsx +278 -0
  79. package/src/components/tables/table-grid.tsx +61 -0
  80. package/src/components/tables/table-history-tab.tsx +148 -0
  81. package/src/components/tables/table-import-wizard.tsx +542 -0
  82. package/src/components/tables/table-list-table.tsx +95 -0
  83. package/src/components/tables/table-relation-combobox.tsx +217 -0
  84. package/src/components/tables/table-spreadsheet.tsx +499 -0
  85. package/src/components/tables/table-template-gallery.tsx +162 -0
  86. package/src/components/tables/table-template-preview.tsx +219 -0
  87. package/src/components/tables/table-toolbar.tsx +79 -0
  88. package/src/components/tables/table-triggers-tab.tsx +446 -0
  89. package/src/components/tables/types.ts +6 -0
  90. package/src/components/tables/use-spreadsheet-keys.ts +171 -0
  91. package/src/components/tables/utils.ts +29 -0
  92. package/src/components/tasks/task-card.tsx +8 -1
  93. package/src/components/tasks/task-create-panel.tsx +111 -14
  94. package/src/components/tasks/task-detail-view.tsx +47 -0
  95. package/src/components/tasks/task-edit-dialog.tsx +103 -2
  96. package/src/components/workflows/workflow-form-view.tsx +207 -7
  97. package/src/components/workflows/workflow-kanban-card.tsx +8 -1
  98. package/src/components/workflows/workflow-list.tsx +90 -45
  99. package/src/components/workflows/workflow-status-view.tsx +168 -23
  100. package/src/instrumentation.ts +3 -0
  101. package/src/lib/__tests__/npx-process-cwd.test.ts +17 -2
  102. package/src/lib/agents/__tests__/claude-agent.test.ts +5 -1
  103. package/src/lib/agents/claude-agent.ts +3 -1
  104. package/src/lib/agents/profiles/registry.ts +6 -3
  105. package/src/lib/agents/runtime/anthropic-direct.ts +29 -0
  106. package/src/lib/agents/runtime/openai-direct.ts +29 -0
  107. package/src/lib/book/__tests__/chapter-slugs.test.ts +80 -0
  108. package/src/lib/book/chapter-generator.ts +4 -19
  109. package/src/lib/book/chapter-mapping.ts +17 -0
  110. package/src/lib/book/content.ts +5 -16
  111. package/src/lib/book/update-detector.ts +3 -16
  112. package/src/lib/chat/engine.ts +1 -0
  113. package/src/lib/chat/stagent-tools.ts +2 -0
  114. package/src/lib/chat/system-prompt.ts +9 -1
  115. package/src/lib/chat/tool-catalog.ts +35 -0
  116. package/src/lib/chat/tools/settings-tools.ts +109 -0
  117. package/src/lib/chat/tools/table-tools.ts +955 -0
  118. package/src/lib/chat/tools/workflow-tools.ts +145 -2
  119. package/src/lib/constants/table-status.ts +68 -0
  120. package/src/lib/data/__tests__/clear.test.ts +1 -1
  121. package/src/lib/data/clear.ts +57 -0
  122. package/src/lib/data/seed-data/__tests__/profiles.test.ts +28 -23
  123. package/src/lib/data/seed-data/conversations.ts +350 -42
  124. package/src/lib/data/seed-data/documents.ts +564 -591
  125. package/src/lib/data/seed-data/learned-context.ts +101 -22
  126. package/src/lib/data/seed-data/notifications.ts +344 -70
  127. package/src/lib/data/seed-data/profile-test-results.ts +92 -11
  128. package/src/lib/data/seed-data/profiles.ts +144 -46
  129. package/src/lib/data/seed-data/projects.ts +50 -18
  130. package/src/lib/data/seed-data/repo-imports.ts +28 -13
  131. package/src/lib/data/seed-data/schedules.ts +208 -41
  132. package/src/lib/data/seed-data/table-templates.ts +234 -0
  133. package/src/lib/data/seed-data/tasks.ts +614 -116
  134. package/src/lib/data/seed-data/usage-ledger.ts +182 -103
  135. package/src/lib/data/seed-data/user-tables.ts +203 -0
  136. package/src/lib/data/seed-data/views.ts +52 -7
  137. package/src/lib/data/seed-data/workflows.ts +231 -84
  138. package/src/lib/data/seed.ts +55 -14
  139. package/src/lib/data/tables.ts +417 -0
  140. package/src/lib/db/bootstrap.ts +275 -0
  141. package/src/lib/db/index.ts +9 -0
  142. package/src/lib/db/migrations/0016_add_workflow_document_inputs.sql +13 -0
  143. package/src/lib/db/migrations/0017_add_document_picker_tables.sql +25 -0
  144. package/src/lib/db/migrations/0018_add_workflow_run_number.sql +2 -0
  145. package/src/lib/db/migrations/0019_add_tables_feature.sql +160 -0
  146. package/src/lib/db/migrations/0020_add_table_triggers.sql +19 -0
  147. package/src/lib/db/migrations/0021_add_row_history.sql +15 -0
  148. package/src/lib/db/schema.ts +445 -0
  149. package/src/lib/docs/reader.ts +2 -3
  150. package/src/lib/documents/context-builder.ts +75 -2
  151. package/src/lib/documents/document-resolver.ts +119 -0
  152. package/src/lib/documents/processors/spreadsheet.ts +2 -1
  153. package/src/lib/schedules/scheduler.ts +31 -1
  154. package/src/lib/snapshots/auto-backup.ts +132 -0
  155. package/src/lib/snapshots/retention.ts +64 -0
  156. package/src/lib/snapshots/snapshot-manager.ts +429 -0
  157. package/src/lib/tables/computed.ts +61 -0
  158. package/src/lib/tables/context-builder.ts +139 -0
  159. package/src/lib/tables/formula-engine.ts +415 -0
  160. package/src/lib/tables/history.ts +115 -0
  161. package/src/lib/tables/import.ts +343 -0
  162. package/src/lib/tables/query-builder.ts +152 -0
  163. package/src/lib/tables/trigger-evaluator.ts +146 -0
  164. package/src/lib/tables/types.ts +141 -0
  165. package/src/lib/tables/validation.ts +119 -0
  166. package/src/lib/utils/app-root.ts +20 -0
  167. package/src/lib/utils/stagent-paths.ts +20 -0
  168. package/src/lib/validators/__tests__/task.test.ts +43 -10
  169. package/src/lib/validators/task.ts +7 -1
  170. package/src/lib/workflows/blueprints/registry.ts +3 -3
  171. package/src/lib/workflows/engine.ts +24 -8
  172. package/src/lib/workflows/types.ts +14 -0
  173. package/tsconfig.json +3 -1
  174. package/public/icon.svg +0 -13
  175. package/src/components/tasks/file-upload.tsx +0 -120
  176. /package/docs/features/{playbook.md → user-guide.md} +0 -0
@@ -1,339 +1,837 @@
1
+ import { SAMPLE_PROFILE_IDS } from "./profiles";
2
+
1
3
  export interface TaskSeed {
2
4
  id: string;
3
5
  projectId: string;
4
6
  title: string;
5
7
  description: string;
6
- status: "planned" | "queued" | "running" | "completed" | "failed";
8
+ status: "planned" | "queued" | "running" | "completed" | "failed" | "cancelled";
7
9
  priority: number;
8
10
  result: string | null;
11
+ agentProfile: string | null;
12
+ sourceType: "manual" | "scheduled" | "heartbeat" | "workflow" | null;
13
+ workflowId: string | null;
14
+ scheduleId: string | null;
9
15
  createdAt: Date;
10
16
  updatedAt: Date;
11
17
  }
12
18
 
13
- export function createTasks(projectIds: string[]): TaskSeed[] {
19
+ export function createTasks(
20
+ projectIds: string[],
21
+ workflowIds: string[],
22
+ scheduleIds: string[]
23
+ ): TaskSeed[] {
14
24
  const now = Date.now();
15
25
  const DAY = 86_400_000;
16
26
  const HOUR = 3_600_000;
17
- const [p1, p2, p3, p4, p5] = projectIds;
27
+ const [p1, p2, p3, p4, p5, p6, p7, p8] = projectIds;
28
+ const [w1, w2, w3, w4, w5, w6, w7, w8] = workflowIds;
29
+ const [s1, s2, s3, s4, s5, _s6, s7, s8] = scheduleIds;
18
30
 
19
31
  return [
20
- // Project 1Investment Portfolio (5 tasks)
32
+ // ── P1: Product Launch AI Copilot v2 (6 tasks) ────────────────
21
33
  {
22
34
  id: crypto.randomUUID(),
23
35
  projectId: p1,
24
- title: "Analyze current portfolio allocation",
36
+ title: "Competitive analysis: 5 AI copilot products",
25
37
  description:
26
- "Review all holdings, calculate sector weights, and identify concentration risks",
38
+ "Analyze Cursor, Windsurf, Cody, Tabnine, and Copilot — document positioning, pricing, feature gaps, and messaging angles",
27
39
  status: "completed",
28
40
  priority: 3,
29
41
  result:
30
- "Portfolio allocation: Tech 42%, Healthcare 18%, Finance 15%, Consumer 12%, Energy 8%, Cash 5%. Top concentration risk: NVDA at 15% of total portfolio. Recommendation: rebalance tech exposure below 35%.",
31
- createdAt: new Date(now - 13 * DAY),
32
- updatedAt: new Date(now - 12 * DAY),
42
+ "Competitive matrix complete. Key insight: all 5 competitors lead with speed/productivity messaging. None emphasize orchestration or governance. Positioning gap: 'AI that runs your business, not just your code.' Pricing ranges $10-40/seat/mo our $149/mo flat positions us as a team tool, not per-seat. Cursor and Windsurf have the strongest brand but weakest multi-agent story.",
43
+ agentProfile: SAMPLE_PROFILE_IDS[0],
44
+ sourceType: "workflow",
45
+ workflowId: w1,
46
+ scheduleId: null,
47
+ createdAt: new Date(now - 20 * DAY),
48
+ updatedAt: new Date(now - 18 * DAY),
33
49
  },
34
50
  {
35
51
  id: crypto.randomUUID(),
36
52
  projectId: p1,
37
- title: "Research top semiconductor ETFs",
53
+ title: "Write 3 hero headline variants + email sequence",
38
54
  description:
39
- "Compare SOXX, SMH, and PSI on expense ratio, holdings, and 5-year returns",
55
+ "Draft headline variants for the launch page plus a 3-touch email sequence targeting mid-market ops teams",
40
56
  status: "completed",
41
57
  priority: 2,
42
58
  result:
43
- "ETF comparison: SOXX (0.35% ER, 30 holdings, +142% 5yr) vs SMH (0.35% ER, 25 holdings, +158% 5yr) vs PSI (0.56% ER, 30 holdings, +98% 5yr). Recommendation: SMH for concentrated exposure, SOXX for broader diversification.",
44
- createdAt: new Date(now - 12 * DAY),
45
- updatedAt: new Date(now - 10 * DAY),
59
+ "Variant A: \"Your Business, Run by AI\" (orchestration-led). Variant B: \"Stop Stitching Start Orchestrating\" (pain-led). Variant C: \"52 Agents. One Command Center.\" (scale-led). Email sequence: Day 0 announcement, Day 3 feature deep-dive, Day 7 case study. Recommended: A/B test A vs B — orchestration resonates with ops buyers, pain-led converts better on cold traffic.",
60
+ agentProfile: SAMPLE_PROFILE_IDS[0],
61
+ sourceType: "workflow",
62
+ workflowId: w1,
63
+ scheduleId: null,
64
+ createdAt: new Date(now - 17 * DAY),
65
+ updatedAt: new Date(now - 15 * DAY),
46
66
  },
47
67
  {
48
68
  id: crypto.randomUUID(),
49
69
  projectId: p1,
50
- title: "Compare dividend yield strategies",
70
+ title: "Build responsive launch landing page",
51
71
  description:
52
- "Evaluate high-yield vs dividend growth approaches for income generation",
72
+ "Implement hero section, feature grid, pricing table, and social proof as responsive React components with OG tags",
53
73
  status: "running",
54
74
  priority: 2,
55
75
  result: null,
56
- createdAt: new Date(now - 8 * DAY),
76
+ agentProfile: SAMPLE_PROFILE_IDS[0],
77
+ sourceType: "workflow",
78
+ workflowId: w1,
79
+ scheduleId: null,
80
+ createdAt: new Date(now - 14 * DAY),
57
81
  updatedAt: new Date(now - 2 * HOUR),
58
82
  },
59
83
  {
60
84
  id: crypto.randomUUID(),
61
85
  projectId: p1,
62
- title: "Generate quarterly performance report",
86
+ title: "Configure A/B test for hero variants",
63
87
  description:
64
- "Create a comprehensive Q1 performance summary with benchmarks",
88
+ "Set up split test for headline variants A vs B with conversion tracking — 7-day window, 95% confidence",
89
+ status: "queued",
90
+ priority: 1,
91
+ result: null,
92
+ agentProfile: SAMPLE_PROFILE_IDS[0],
93
+ sourceType: "manual",
94
+ workflowId: null,
95
+ scheduleId: null,
96
+ createdAt: new Date(now - 10 * DAY),
97
+ updatedAt: new Date(now - 10 * DAY),
98
+ },
99
+ {
100
+ id: crypto.randomUUID(),
101
+ projectId: p1,
102
+ title: "Draft Product Hunt launch copy",
103
+ description:
104
+ "Write tagline, description, first comment, and maker story for PH launch day",
65
105
  status: "planned",
66
106
  priority: 1,
67
107
  result: null,
108
+ agentProfile: SAMPLE_PROFILE_IDS[0],
109
+ sourceType: "manual",
110
+ workflowId: null,
111
+ scheduleId: null,
68
112
  createdAt: new Date(now - 5 * DAY),
69
113
  updatedAt: new Date(now - 5 * DAY),
70
114
  },
71
115
  {
72
116
  id: crypto.randomUUID(),
73
117
  projectId: p1,
74
- title: "Set up automated portfolio alerts",
118
+ title: "Generate social media launch calendar",
75
119
  description:
76
- "Configure price alerts and rebalancing triggers for key positions",
77
- status: "planned",
78
- priority: 0,
120
+ "Create a 2-week social content calendar: LinkedIn posts, Twitter threads, and short-form video scripts",
121
+ status: "failed",
122
+ priority: 1,
79
123
  result: null,
80
- createdAt: new Date(now - 3 * DAY),
81
- updatedAt: new Date(now - 3 * DAY),
124
+ agentProfile: SAMPLE_PROFILE_IDS[0],
125
+ sourceType: "scheduled",
126
+ workflowId: null,
127
+ scheduleId: s1,
128
+ createdAt: new Date(now - 8 * DAY),
129
+ updatedAt: new Date(now - 7 * DAY),
82
130
  },
83
131
 
84
- // Project 2 Landing Page (5 tasks)
132
+ // ── P2: Content Engine (6 tasks) ────────────────────────────────
85
133
  {
86
134
  id: crypto.randomUUID(),
87
135
  projectId: p2,
88
- title: "Audit competitor landing pages",
136
+ title: "Keyword research: 'AI agent orchestration'",
89
137
  description:
90
- "Analyze 4 competitor landing pages for design patterns, CTAs, and messaging",
138
+ "Research keyword cluster around AI agent orchestration — volume, difficulty, SERP features, content gaps",
91
139
  status: "completed",
92
140
  priority: 3,
93
141
  result:
94
- "Analyzed Notion, Linear, Vercel, and Stripe. Key patterns: all use social proof above fold, 2 of 4 use interactive demos, average CTA count is 3. Weakness: most lack personalization. Opportunity: dynamic hero based on referral source.",
95
- createdAt: new Date(now - 11 * DAY),
96
- updatedAt: new Date(now - 9 * DAY),
142
+ "Primary keyword: 'AI agent orchestration' (2,400 mo/vol, KD 38). Cluster: 'multi-agent framework' (1,800), 'AI agent platform' (4,200), 'agentic AI tools' (3,100). Content gap: no comprehensive comparison post exists. Top opportunity: '2026 Guide to AI Agent Orchestration Platforms' estimated 8K organic visits/mo at position 3.",
143
+ agentProfile: SAMPLE_PROFILE_IDS[1],
144
+ sourceType: "workflow",
145
+ workflowId: w2,
146
+ scheduleId: null,
147
+ createdAt: new Date(now - 16 * DAY),
148
+ updatedAt: new Date(now - 14 * DAY),
97
149
  },
98
150
  {
99
151
  id: crypto.randomUUID(),
100
152
  projectId: p2,
101
- title: "Write hero section copy and CTA",
153
+ title: "Write article: 'AI Agent Orchestration Guide'",
102
154
  description:
103
- "Draft 3 headline variants and supporting copy for the hero section",
155
+ "1,800-word SEO article with 7 H2 sections, 3 internal links, and embedded comparison table",
104
156
  status: "completed",
105
157
  priority: 2,
106
158
  result:
107
- 'Variant A: "Ship faster with AI-powered workflows" (benefit-led). Variant B: "Your team\'s missing engineer" (metaphor). Variant C: "From idea to production in minutes" (speed). Recommended: A/B test Variant A vs C. CTA: "Start building free" with "No credit card required" subtext.',
108
- createdAt: new Date(now - 9 * DAY),
109
- updatedAt: new Date(now - 7 * DAY),
159
+ "Article published at /blog/ai-agent-orchestration-guide. 1,920 words, Flesch-Kincaid 42, keyword density 1.4%. Includes comparison table (Stagent vs CrewAI vs AutoGen vs LangGraph), 3 internal links, and 'Start Free' CTA. LinkedIn hook and newsletter intro drafted.",
160
+ agentProfile: SAMPLE_PROFILE_IDS[1],
161
+ sourceType: "workflow",
162
+ workflowId: w2,
163
+ scheduleId: null,
164
+ createdAt: new Date(now - 13 * DAY),
165
+ updatedAt: new Date(now - 10 * DAY),
166
+ },
167
+ {
168
+ id: crypto.randomUUID(),
169
+ projectId: p2,
170
+ title: "Draft LinkedIn thought leadership series",
171
+ description:
172
+ "Write 5 LinkedIn posts: AI ops mental models, agent governance, multi-runtime architecture",
173
+ status: "completed",
174
+ priority: 2,
175
+ result:
176
+ "5-post series complete. Post 1: 'Why your AI agents need a manager' (narrative hook). Post 2: 'The governance gap in agentic AI' (problem framing). Post 3: '3 patterns for multi-agent workflows' (tactical). Post 4: 'Local-first AI — why it matters' (contrarian). Post 5: 'We gave 52 agents one command center' (product story). Scheduled: Mon/Wed/Fri 8:30am ET.",
177
+ agentProfile: SAMPLE_PROFILE_IDS[1],
178
+ sourceType: "scheduled",
179
+ workflowId: null,
180
+ scheduleId: s2,
181
+ createdAt: new Date(now - 11 * DAY),
182
+ updatedAt: new Date(now - 8 * DAY),
110
183
  },
111
184
  {
112
185
  id: crypto.randomUUID(),
113
186
  projectId: p2,
114
- title: "Design responsive hero component",
187
+ title: "Write weekly newsletter edition #14",
115
188
  description:
116
- "Build the hero section with responsive layout and animation",
189
+ "Curate top 5 AI agent news items, write editorial intro, include 1 product update",
117
190
  status: "running",
118
191
  priority: 2,
119
192
  result: null,
120
- createdAt: new Date(now - 6 * DAY),
193
+ agentProfile: SAMPLE_PROFILE_IDS[1],
194
+ sourceType: "manual",
195
+ workflowId: null,
196
+ scheduleId: null,
197
+ createdAt: new Date(now - 3 * DAY),
121
198
  updatedAt: new Date(now - 1 * HOUR),
122
199
  },
123
200
  {
124
201
  id: crypto.randomUUID(),
125
202
  projectId: p2,
126
- title: "Build testimonial carousel section",
203
+ title: "Create content performance dashboard",
127
204
  description:
128
- "Create a responsive carousel with customer quotes and logos",
205
+ "Build a tracking table: article URL, publish date, organic sessions, backlinks, conversions",
129
206
  status: "queued",
130
207
  priority: 1,
131
208
  result: null,
132
- createdAt: new Date(now - 4 * DAY),
133
- updatedAt: new Date(now - 4 * DAY),
209
+ agentProfile: SAMPLE_PROFILE_IDS[1],
210
+ sourceType: "manual",
211
+ workflowId: null,
212
+ scheduleId: null,
213
+ createdAt: new Date(now - 2 * DAY),
214
+ updatedAt: new Date(now - 2 * DAY),
134
215
  },
135
216
  {
136
217
  id: crypto.randomUUID(),
137
218
  projectId: p2,
138
- title: "Set up A/B test for CTA variants",
219
+ title: "Research competitor content strategies",
139
220
  description:
140
- "Configure split testing for the two hero copy variants",
221
+ "Analyze content output of CrewAI, LangChain, and AutoGen — topics, frequency, engagement",
141
222
  status: "planned",
142
223
  priority: 0,
143
224
  result: null,
144
- createdAt: new Date(now - 2 * DAY),
145
- updatedAt: new Date(now - 2 * DAY),
225
+ agentProfile: SAMPLE_PROFILE_IDS[1],
226
+ sourceType: "manual",
227
+ workflowId: null,
228
+ scheduleId: null,
229
+ createdAt: new Date(now - 1 * DAY),
230
+ updatedAt: new Date(now - 1 * DAY),
146
231
  },
147
232
 
148
- // Project 3 Lead Generation (5 tasks)
233
+ // ── P3: Customer Success Automation (6 tasks) ───────────────────
149
234
  {
150
235
  id: crypto.randomUUID(),
151
236
  projectId: p3,
152
- title: "Search LinkedIn for VP-level prospects",
237
+ title: "Build onboarding email sequence",
153
238
  description:
154
- "Identify VP/Director-level decision-makers at target SaaS companies",
239
+ "Create 3-email welcome flow: Day 0 quick start, Day 2 feature spotlight, Day 5 check-in",
155
240
  status: "completed",
156
241
  priority: 3,
157
242
  result:
158
- "Found 15 qualified prospects across 8 companies. Breakdown: 6 VP Engineering, 4 VP Product, 3 Director of Engineering, 2 CTO. Top targets: Acme Corp (3 contacts), TechStart Inc (2 contacts).",
159
- createdAt: new Date(now - 9 * DAY),
160
- updatedAt: new Date(now - 7 * DAY),
243
+ "Onboarding sequence live. Day 0: Welcome + quick start guide (42% open rate). Day 2: 'Your first agent in 5 minutes' feature walkthrough (38% open). Day 5: 'How are things going?' with direct reply CTA (28% open, 12% reply rate). Segment: Pro plan users get extended sequence with API docs.",
244
+ agentProfile: SAMPLE_PROFILE_IDS[2],
245
+ sourceType: "workflow",
246
+ workflowId: w3,
247
+ scheduleId: null,
248
+ createdAt: new Date(now - 15 * DAY),
249
+ updatedAt: new Date(now - 12 * DAY),
161
250
  },
162
251
  {
163
252
  id: crypto.randomUUID(),
164
253
  projectId: p3,
165
- title: "Enrich prospect data with company info",
254
+ title: "Analyze churn signals for Q1 cohort",
166
255
  description:
167
- "Pull company size, funding, and tech stack data for each prospect",
168
- status: "failed",
256
+ "Pull usage, NPS, and support data for Jan-Mar signups — score each account green/yellow/red",
257
+ status: "completed",
258
+ priority: 3,
259
+ result:
260
+ "Q1 cohort analysis (47 accounts): 31 green (66%), 11 yellow (23%), 5 red (11%). Red accounts: 3 have login gaps >14 days, 2 filed >5 support tickets. Common churn signal: no workflow created by Day 7 (82% correlation with churn). Recommendation: trigger a CSM call for any account without a workflow by Day 5.",
261
+ agentProfile: SAMPLE_PROFILE_IDS[2],
262
+ sourceType: "heartbeat",
263
+ workflowId: null,
264
+ scheduleId: s3,
265
+ createdAt: new Date(now - 12 * DAY),
266
+ updatedAt: new Date(now - 9 * DAY),
267
+ },
268
+ {
269
+ id: crypto.randomUUID(),
270
+ projectId: p3,
271
+ title: "Draft intervention playbook for at-risk accounts",
272
+ description:
273
+ "Create response templates for the 3 main churn signals: low usage, high tickets, NPS drop",
274
+ status: "running",
169
275
  priority: 2,
170
276
  result: null,
277
+ agentProfile: SAMPLE_PROFILE_IDS[2],
278
+ sourceType: "manual",
279
+ workflowId: null,
280
+ scheduleId: null,
171
281
  createdAt: new Date(now - 7 * DAY),
172
- updatedAt: new Date(now - 6 * DAY),
282
+ updatedAt: new Date(now - 3 * HOUR),
173
283
  },
174
284
  {
175
285
  id: crypto.randomUUID(),
176
286
  projectId: p3,
177
- title: "Draft personalized outreach sequences",
287
+ title: "Monitor NPS survey responses",
178
288
  description:
179
- "Write 3-email sequences personalized for each prospect segment",
180
- status: "queued",
289
+ "Process latest NPS batch — flag detractors, route promoters for testimonial ask, update health scores",
290
+ status: "running",
181
291
  priority: 2,
182
292
  result: null,
183
- createdAt: new Date(now - 5 * DAY),
184
- updatedAt: new Date(now - 5 * DAY),
293
+ agentProfile: SAMPLE_PROFILE_IDS[2],
294
+ sourceType: "heartbeat",
295
+ workflowId: null,
296
+ scheduleId: s3,
297
+ createdAt: new Date(now - 4 * DAY),
298
+ updatedAt: new Date(now - 2 * HOUR),
185
299
  },
186
300
  {
187
301
  id: crypto.randomUUID(),
188
302
  projectId: p3,
189
- title: "Set up email tracking dashboard",
303
+ title: "Set up support ticket triage automation",
190
304
  description:
191
- "Create dashboard to monitor open rates, clicks, and replies",
192
- status: "planned",
305
+ "Classify incoming tickets by urgency and route to appropriate queue: bug, feature request, billing, how-to",
306
+ status: "queued",
193
307
  priority: 1,
194
308
  result: null,
195
- createdAt: new Date(now - 3 * DAY),
196
- updatedAt: new Date(now - 3 * DAY),
309
+ agentProfile: SAMPLE_PROFILE_IDS[2],
310
+ sourceType: "manual",
311
+ workflowId: null,
312
+ scheduleId: null,
313
+ createdAt: new Date(now - 2 * DAY),
314
+ updatedAt: new Date(now - 2 * DAY),
197
315
  },
198
316
  {
199
317
  id: crypto.randomUUID(),
200
318
  projectId: p3,
201
- title: "Analyze response rates and optimize",
319
+ title: "Build customer health dashboard",
202
320
  description:
203
- "Review campaign performance and adjust messaging for better conversion",
321
+ "Create a table tracking: account name, plan, MRR, NPS score, last login, health status",
204
322
  status: "planned",
205
323
  priority: 0,
206
324
  result: null,
325
+ agentProfile: SAMPLE_PROFILE_IDS[2],
326
+ sourceType: "manual",
327
+ workflowId: null,
328
+ scheduleId: null,
207
329
  createdAt: new Date(now - 1 * DAY),
208
330
  updatedAt: new Date(now - 1 * DAY),
209
331
  },
210
332
 
211
- // Project 4 Business Trip (5 tasks, all completed)
333
+ // ── P4: Client: TechVenture Partners (6 tasks) ──────────────────
212
334
  {
213
335
  id: crypto.randomUUID(),
214
336
  projectId: p4,
215
- title: "Book round-trip flights SFO JFK",
337
+ title: "Financial deep dive: HealthSync (portco #1)",
216
338
  description:
217
- "Find and book optimal flights for March 15-18 trip",
339
+ "Analyze 3 years of financials ARR, gross margins, net retention, burn rate, and runway",
218
340
  status: "completed",
219
341
  priority: 3,
220
342
  result:
221
- "Booked United UA 456 SFO→JFK Mar 15 dep 7:00am arr 3:30pm ($342). Return UA 891 JFK→SFO Mar 18 dep 6:00pm arr 9:15pm ($318). Total: $660. Economy Plus, aisle seats.",
343
+ "HealthSync financials: ARR $8.2M (growing 42% YoY), gross margin 78%, net retention 118%, burn $380K/mo, 14-month runway. Strong unit economics CAC payback 11 months, LTV/CAC 4.2x. Risk: revenue concentrated in top 5 accounts (62% of ARR). Recommendation: invest at current valuation if logo diversification plan is credible.",
344
+ agentProfile: SAMPLE_PROFILE_IDS[3],
345
+ sourceType: "workflow",
346
+ workflowId: w4,
347
+ scheduleId: null,
348
+ createdAt: new Date(now - 13 * DAY),
349
+ updatedAt: new Date(now - 10 * DAY),
350
+ },
351
+ {
352
+ id: crypto.randomUUID(),
353
+ projectId: p4,
354
+ title: "Market sizing: vertical SaaS in healthcare scheduling",
355
+ description:
356
+ "Size the TAM/SAM/SOM for AI-powered healthcare scheduling — top-down and bottom-up approaches",
357
+ status: "completed",
358
+ priority: 2,
359
+ result:
360
+ "TAM: $12.4B (US healthcare scheduling software). SAM: $3.8B (AI-enabled, mid-market practices 10-200 providers). SOM: $420M (outpatient clinics in top 20 metros). Growth: 24% CAGR driven by labor shortages and no-show reduction (AI scheduling cuts no-shows 35%). Competitor landscape: 4 incumbents, none with true AI scheduling — greenfield for AI-native entrant.",
361
+ agentProfile: SAMPLE_PROFILE_IDS[3],
362
+ sourceType: "workflow",
363
+ workflowId: w4,
364
+ scheduleId: null,
365
+ createdAt: new Date(now - 11 * DAY),
366
+ updatedAt: new Date(now - 8 * DAY),
367
+ },
368
+ {
369
+ id: crypto.randomUUID(),
370
+ projectId: p4,
371
+ title: "Write DD memo for HealthSync investment",
372
+ description:
373
+ "Synthesize financial analysis, market sizing, and competitive positioning into a board-ready DD memo",
374
+ status: "completed",
375
+ priority: 3,
376
+ result:
377
+ "DD memo delivered (12 pages). Executive summary: HealthSync is a category-defining AI scheduling platform in a $3.8B SAM growing 24% annually. Investment thesis: (1) AI-native product with 35% no-show reduction, (2) net retention 118% signals strong product-market fit, (3) greenfield competitive landscape. Top risk: customer concentration. Go recommendation with condition: secure 3 new enterprise logos in 6 months.",
378
+ agentProfile: SAMPLE_PROFILE_IDS[3],
379
+ sourceType: "workflow",
380
+ workflowId: w4,
381
+ scheduleId: null,
222
382
  createdAt: new Date(now - 7 * DAY),
223
- updatedAt: new Date(now - 6 * DAY),
383
+ updatedAt: new Date(now - 5 * DAY),
384
+ },
385
+ {
386
+ id: crypto.randomUUID(),
387
+ projectId: p4,
388
+ title: "Generate Q2 board deck for portfolio review",
389
+ description:
390
+ "Pull KPIs across all 4 portcos, create a standardized board deck with financials, milestones, and risks",
391
+ status: "running",
392
+ priority: 2,
393
+ result: null,
394
+ agentProfile: SAMPLE_PROFILE_IDS[3],
395
+ sourceType: "scheduled",
396
+ workflowId: null,
397
+ scheduleId: s4,
398
+ createdAt: new Date(now - 4 * DAY),
399
+ updatedAt: new Date(now - 1 * HOUR),
400
+ },
401
+ {
402
+ id: crypto.randomUUID(),
403
+ projectId: p4,
404
+ title: "Competitive analysis: DataPulse acquisition target",
405
+ description:
406
+ "Research DataPulse as a bolt-on acquisition for HealthSync — product overlap, team, and valuation comps",
407
+ status: "planned",
408
+ priority: 1,
409
+ result: null,
410
+ agentProfile: SAMPLE_PROFILE_IDS[3],
411
+ sourceType: "manual",
412
+ workflowId: null,
413
+ scheduleId: null,
414
+ createdAt: new Date(now - 2 * DAY),
415
+ updatedAt: new Date(now - 2 * DAY),
224
416
  },
225
417
  {
226
418
  id: crypto.randomUUID(),
227
419
  projectId: p4,
228
- title: "Reserve hotel near conference venue",
420
+ title: "Pull financial data for NovaPay (portco #2)",
229
421
  description:
230
- "Book hotel in Midtown Manhattan for 3 nights",
422
+ "Extract and normalize quarterly financials from NovaPay's reporting package for portfolio tracking",
423
+ status: "failed",
424
+ priority: 2,
425
+ result: null,
426
+ agentProfile: SAMPLE_PROFILE_IDS[3],
427
+ sourceType: "workflow",
428
+ workflowId: w4,
429
+ scheduleId: null,
430
+ createdAt: new Date(now - 6 * DAY),
431
+ updatedAt: new Date(now - 5 * DAY),
432
+ },
433
+
434
+ // ── P5: Client: GreenLeaf Commerce (6 tasks) ────────────────────
435
+ {
436
+ id: crypto.randomUUID(),
437
+ projectId: p5,
438
+ title: "Scrape current product listings for top 20 SKUs",
439
+ description:
440
+ "Pull title, description, bullet points, images, price, and review score for the 20 highest-revenue products",
231
441
  status: "completed",
232
442
  priority: 3,
233
443
  result:
234
- "Booked The Manhattan Club, 200 W 56th St. Standard King, 3 nights Mar 15-18. Rate: $289/night ($867 total). Walking distance to Javits Center. Free cancellation until Mar 13.",
444
+ "Scraped 20 SKUs. Average listing score: 64/100. Key gaps: 8 listings missing keyword-rich bullet points, 5 have <4 images (benchmark is 7+), 3 have review counts <50. Top opportunity: 'Bamboo Kitchen Set' (SKU-1042) has 2.8K monthly searches but title misses primary keyword entirely.",
445
+ agentProfile: "general",
446
+ sourceType: "workflow",
447
+ workflowId: w5,
448
+ scheduleId: null,
449
+ createdAt: new Date(now - 11 * DAY),
450
+ updatedAt: new Date(now - 9 * DAY),
451
+ },
452
+ {
453
+ id: crypto.randomUUID(),
454
+ projectId: p5,
455
+ title: "Rewrite optimized copy for top 10 SKUs",
456
+ description:
457
+ "Generate new titles, bullet points, and descriptions with keyword optimization for the 10 highest-opportunity products",
458
+ status: "completed",
459
+ priority: 2,
460
+ result:
461
+ "Rewrote listings for 10 SKUs. Average keyword coverage improved from 34% to 82%. Title optimizations: all under 200 chars with primary keyword in first 80 chars. Bullet points: 5 per listing, benefit-led format with keyword integration. A/B test staged for top 3 SKUs: Bamboo Kitchen Set, Organic Cotton Sheets, Recycled Glass Vases.",
462
+ agentProfile: "general",
463
+ sourceType: "workflow",
464
+ workflowId: w5,
465
+ scheduleId: null,
466
+ createdAt: new Date(now - 8 * DAY),
467
+ updatedAt: new Date(now - 6 * DAY),
468
+ },
469
+ {
470
+ id: crypto.randomUUID(),
471
+ projectId: p5,
472
+ title: "Monitor review sentiment for flagged products",
473
+ description:
474
+ "Track new 1-2 star reviews across flagged SKUs, draft response templates, and alert client",
475
+ status: "running",
476
+ priority: 2,
477
+ result: null,
478
+ agentProfile: "general",
479
+ sourceType: "heartbeat",
480
+ workflowId: null,
481
+ scheduleId: s5,
482
+ createdAt: new Date(now - 5 * DAY),
483
+ updatedAt: new Date(now - 2 * HOUR),
484
+ },
485
+ {
486
+ id: crypto.randomUUID(),
487
+ projectId: p5,
488
+ title: "Generate ad copy variants for spring campaign",
489
+ description:
490
+ "Write 5 ad copy variants for the spring sale: headline, body, and CTA for each channel (Meta, Google, TikTok)",
491
+ status: "queued",
492
+ priority: 1,
493
+ result: null,
494
+ agentProfile: "general",
495
+ sourceType: "manual",
496
+ workflowId: null,
497
+ scheduleId: null,
498
+ createdAt: new Date(now - 3 * DAY),
499
+ updatedAt: new Date(now - 3 * DAY),
500
+ },
501
+ {
502
+ id: crypto.randomUUID(),
503
+ projectId: p5,
504
+ title: "Analyze competitor pricing changes",
505
+ description:
506
+ "Pull competitor price data for the top 10 overlapping SKUs, calculate price gap, and recommend adjustments",
507
+ status: "queued",
508
+ priority: 1,
509
+ result: null,
510
+ agentProfile: "general",
511
+ sourceType: "heartbeat",
512
+ workflowId: null,
513
+ scheduleId: s5,
514
+ createdAt: new Date(now - 2 * DAY),
515
+ updatedAt: new Date(now - 2 * DAY),
516
+ },
517
+ {
518
+ id: crypto.randomUUID(),
519
+ projectId: p5,
520
+ title: "Build listing performance tracker",
521
+ description:
522
+ "Create a tracking table: SKU, listing score, organic rank, conversion rate, revenue impact",
523
+ status: "planned",
524
+ priority: 0,
525
+ result: null,
526
+ agentProfile: "general",
527
+ sourceType: "manual",
528
+ workflowId: null,
529
+ scheduleId: null,
530
+ createdAt: new Date(now - 1 * DAY),
531
+ updatedAt: new Date(now - 1 * DAY),
532
+ },
533
+
534
+ // ── P6: Client: MedReach Health (6 tasks) ───────────────────────
535
+ {
536
+ id: crypto.randomUUID(),
537
+ projectId: p6,
538
+ title: "Draft referral campaign landing page",
539
+ description:
540
+ "Write HIPAA-compliant landing page copy for the provider referral program",
541
+ status: "completed",
542
+ priority: 3,
543
+ result:
544
+ "Landing page copy complete. Hero: 'Grow Your Practice with Trusted Referrals'. 3 sections: value prop, how it works (3-step flow), and trust signals (HIPAA badge, provider count, patient satisfaction). All claims sourced — no unsubstantiated health outcomes. Legal disclaimer included per FTC guidelines.",
545
+ agentProfile: "general",
546
+ sourceType: "workflow",
547
+ workflowId: w6,
548
+ scheduleId: null,
549
+ createdAt: new Date(now - 9 * DAY),
550
+ updatedAt: new Date(now - 7 * DAY),
551
+ },
552
+ {
553
+ id: crypto.randomUUID(),
554
+ projectId: p6,
555
+ title: "HIPAA compliance review: referral campaign",
556
+ description:
557
+ "Scan all campaign content for PHI references, testimonial compliance, and disclaimer requirements",
558
+ status: "completed",
559
+ priority: 3,
560
+ result:
561
+ "Compliance review passed with 2 minor flags: (1) Patient testimonial on slide 3 needs explicit written consent documentation — obtained. (2) 'Improve health outcomes' claim on email #2 needs citation — replaced with 'streamline referral workflows'. All content now clear for legal review.",
562
+ agentProfile: "general",
563
+ sourceType: "workflow",
564
+ workflowId: w6,
565
+ scheduleId: null,
235
566
  createdAt: new Date(now - 7 * DAY),
236
567
  updatedAt: new Date(now - 6 * DAY),
237
568
  },
238
569
  {
239
570
  id: crypto.randomUUID(),
240
- projectId: p4,
241
- title: "Create day-by-day meeting itinerary",
571
+ projectId: p6,
572
+ title: "Write provider outreach email templates",
242
573
  description:
243
- "Organize all meetings, events, and travel logistics by day",
574
+ "Create 3 email templates: initial outreach, follow-up, and referral confirmation all HIPAA compliant",
244
575
  status: "completed",
245
576
  priority: 2,
246
577
  result:
247
- "3-day itinerary: Day 1 Conference keynote + 2 partner meetings. Day 2 3 client meetings (Midtown, FiDi, Chelsea) + team dinner at Carbone. Day 3 Workshop session + departure prep. All Uber estimates included.",
578
+ "3 email templates complete. Template 1: Introduction + program overview (no patient data). Template 2: Follow-up with case study (anonymized). Template 3: Referral confirmation with next steps. All templates reviewed for PHI absence. Merge fields: {provider_name}, {practice_name}, {specialty} only.",
579
+ agentProfile: "general",
580
+ sourceType: "manual",
581
+ workflowId: null,
582
+ scheduleId: null,
248
583
  createdAt: new Date(now - 6 * DAY),
249
584
  updatedAt: new Date(now - 5 * DAY),
250
585
  },
251
586
  {
252
587
  id: crypto.randomUUID(),
253
- projectId: p4,
254
- title: "Submit pre-trip expense approval",
588
+ projectId: p6,
589
+ title: "Create social media content calendar",
255
590
  description:
256
- "File expense pre-approval for estimated trip costs",
591
+ "Plan 4 weeks of healthcare marketing social posts — educational content, provider spotlights, patient tips",
257
592
  status: "completed",
258
593
  priority: 1,
259
594
  result:
260
- "Pre-approval submitted and approved. Breakdown: Flights $660, Hotel $867, Meals (per diem) $225, Ground transport $200, Misc $100. Total approved: $2,052. Approval #EXP-2025-0342.",
595
+ "4-week calendar: 3 posts/week across LinkedIn and Facebook. Week 1: Provider spotlight series. Week 2: Patient education (symptoms awareness). Week 3: Telehealth tips. Week 4: Community health events. All posts pre-cleared for compliance. No patient-identifiable content.",
596
+ agentProfile: "general",
597
+ sourceType: "manual",
598
+ workflowId: null,
599
+ scheduleId: null,
261
600
  createdAt: new Date(now - 5 * DAY),
262
601
  updatedAt: new Date(now - 4 * DAY),
263
602
  },
264
603
  {
265
604
  id: crypto.randomUUID(),
266
- projectId: p4,
267
- title: "Compile post-trip expense report",
605
+ projectId: p6,
606
+ title: "Set up referral tracking analytics",
268
607
  description:
269
- "Gather receipts and submit final expense report",
270
- status: "completed",
608
+ "Configure analytics to track referral sources, conversion rates, and provider engagement",
609
+ status: "planned",
271
610
  priority: 1,
272
- result:
273
- "Final expense report submitted. Actual spend: Flights $660, Hotel $867, Meals $198, Uber/Lyft $156, Conference fee $299. Total: $2,180 (6.2% over estimate). All receipts attached. Reimbursement ETA: 5 business days.",
274
- createdAt: new Date(now - 4 * DAY),
611
+ result: null,
612
+ agentProfile: "general",
613
+ sourceType: "manual",
614
+ workflowId: null,
615
+ scheduleId: null,
616
+ createdAt: new Date(now - 3 * DAY),
275
617
  updatedAt: new Date(now - 3 * DAY),
276
618
  },
619
+ {
620
+ id: crypto.randomUUID(),
621
+ projectId: p6,
622
+ title: "Route legal sign-off package",
623
+ description:
624
+ "Compile all reviewed content with compliance annotations and submit to legal@medreach.health",
625
+ status: "cancelled",
626
+ priority: 2,
627
+ result: null,
628
+ agentProfile: "general",
629
+ sourceType: "workflow",
630
+ workflowId: w6,
631
+ scheduleId: null,
632
+ createdAt: new Date(now - 6 * DAY),
633
+ updatedAt: new Date(now - 4 * DAY),
634
+ },
277
635
 
278
- // Project 5 Tax Filing (5 tasks)
636
+ // ── P7: Revenue Operations Command (6 tasks) ────────────────────
279
637
  {
280
638
  id: crypto.randomUUID(),
281
- projectId: p5,
282
- title: "Gather W-2 and 1099 forms",
639
+ projectId: p7,
640
+ title: "Pull weekly pipeline snapshot",
641
+ description:
642
+ "Export all deals in stages 2-5: deal name, owner, amount, stage, days in stage, close date, and next step",
643
+ status: "completed",
644
+ priority: 3,
645
+ result:
646
+ "Pipeline snapshot: 34 active deals, $2.8M total weighted pipeline. Stage distribution: Discovery (8), Evaluation (12), Proposal (9), Negotiation (5). Net new this week: +6 deals ($420K). Lost: 2 deals ($180K) — both lost to CrewAI on pricing. Velocity: average 18 days Discovery→Proposal.",
647
+ agentProfile: SAMPLE_PROFILE_IDS[4],
648
+ sourceType: "workflow",
649
+ workflowId: w7,
650
+ scheduleId: null,
651
+ createdAt: new Date(now - 7 * DAY),
652
+ updatedAt: new Date(now - 5 * DAY),
653
+ },
654
+ {
655
+ id: crypto.randomUUID(),
656
+ projectId: p7,
657
+ title: "Score deal risk for stalled opportunities",
283
658
  description:
284
- "Collect all tax documents from employers and financial institutions",
659
+ "Calculate risk score for each deal: days stalled, champion engagement, competitive mentions, budget status",
285
660
  status: "completed",
286
661
  priority: 3,
287
662
  result:
288
- "Collected: W-2 from TechCorp Inc, 1099-INT from Chase Bank, 1099-DIV from Fidelity, 1099-B from Schwab, 1098 mortgage interest from Wells Fargo. All documents verified against prior year. Missing: 1099-NEC from freelance client (followed up).",
663
+ "Risk assessment: 7 deals flagged elevated risk. Top 3: (1) Meridian Corp 12 days no activity, champion OOO. (2) Atlas Financial — competitor mentioned in last call, budget freeze rumored. (3) Pinnacle Tech close date pushed 3x, no exec sponsor. Recommendation: Meridian needs VP-to-VP outreach, Atlas needs competitive battle card, Pinnacle needs qualification review.",
664
+ agentProfile: SAMPLE_PROFILE_IDS[4],
665
+ sourceType: "heartbeat",
666
+ workflowId: null,
667
+ scheduleId: s7,
289
668
  createdAt: new Date(now - 5 * DAY),
290
669
  updatedAt: new Date(now - 3 * DAY),
291
670
  },
292
671
  {
293
672
  id: crypto.randomUUID(),
294
- projectId: p5,
295
- title: "Categorize deductible expenses",
673
+ projectId: p7,
674
+ title: "Generate rep coaching notes",
296
675
  description:
297
- "Sort expenses into IRS-recognized deduction categories",
676
+ "For each sales rep, identify coaching opportunities based on deal patterns, win rates, and activity metrics",
298
677
  status: "running",
299
678
  priority: 2,
300
679
  result: null,
301
- createdAt: new Date(now - 4 * DAY),
302
- updatedAt: new Date(now - 3 * HOUR),
680
+ agentProfile: SAMPLE_PROFILE_IDS[4],
681
+ sourceType: "scheduled",
682
+ workflowId: null,
683
+ scheduleId: s7,
684
+ createdAt: new Date(now - 3 * DAY),
685
+ updatedAt: new Date(now - 4 * HOUR),
303
686
  },
304
687
  {
305
688
  id: crypto.randomUUID(),
306
- projectId: p5,
307
- title: "Calculate home office deduction",
689
+ projectId: p7,
690
+ title: "Write weekly executive operating note",
308
691
  description:
309
- "Measure dedicated space and calculate simplified vs actual method",
692
+ "Compile pipeline created vs target, forecast by confidence bucket, top risks, and 3 highest-leverage actions",
693
+ status: "running",
694
+ priority: 2,
695
+ result: null,
696
+ agentProfile: SAMPLE_PROFILE_IDS[4],
697
+ sourceType: "workflow",
698
+ workflowId: w7,
699
+ scheduleId: null,
700
+ createdAt: new Date(now - 2 * DAY),
701
+ updatedAt: new Date(now - 1 * HOUR),
702
+ },
703
+ {
704
+ id: crypto.randomUUID(),
705
+ projectId: p7,
706
+ title: "Build forecast accuracy tracker",
707
+ description:
708
+ "Track committed vs actual closed-won by month, measure forecast accuracy, and flag bias patterns",
310
709
  status: "queued",
311
710
  priority: 1,
312
711
  result: null,
712
+ agentProfile: SAMPLE_PROFILE_IDS[4],
713
+ sourceType: "manual",
714
+ workflowId: null,
715
+ scheduleId: null,
716
+ createdAt: new Date(now - 1 * DAY),
717
+ updatedAt: new Date(now - 1 * DAY),
718
+ },
719
+ {
720
+ id: crypto.randomUUID(),
721
+ projectId: p7,
722
+ title: "Analyze win/loss patterns for Q1",
723
+ description:
724
+ "Review closed-won and closed-lost deals from Q1 — identify patterns in deal size, industry, sales cycle, and loss reasons",
725
+ status: "planned",
726
+ priority: 0,
727
+ result: null,
728
+ agentProfile: SAMPLE_PROFILE_IDS[4],
729
+ sourceType: "manual",
730
+ workflowId: null,
731
+ scheduleId: null,
732
+ createdAt: new Date(now - 1 * DAY),
733
+ updatedAt: new Date(now - 1 * DAY),
734
+ },
735
+
736
+ // ── P8: Compliance & Audit Trail (6 tasks) ──────────────────────
737
+ {
738
+ id: crypto.randomUUID(),
739
+ projectId: p8,
740
+ title: "Gather March execution logs",
741
+ description:
742
+ "Collect all governed execution logs, permission decisions, tool usage, and data access patterns for March",
743
+ status: "completed",
744
+ priority: 3,
745
+ result:
746
+ "March audit evidence collected: 1,247 task executions, 89 permission requests (82 approved, 7 denied), 3,420 tool invocations. Top tools: Read (1,890), Write (680), WebSearch (450), Bash (320), SendEmail (80). 100% of Write operations required approval. No unauthorized data access detected.",
747
+ agentProfile: "general",
748
+ sourceType: "workflow",
749
+ workflowId: w8,
750
+ scheduleId: null,
751
+ createdAt: new Date(now - 5 * DAY),
752
+ updatedAt: new Date(now - 4 * DAY),
753
+ },
754
+ {
755
+ id: crypto.randomUUID(),
756
+ projectId: p8,
757
+ title: "Analyze SOC 2 control compliance",
758
+ description:
759
+ "Compare execution patterns against SOC 2 Type II controls — identify gaps and rate severity",
760
+ status: "completed",
761
+ priority: 3,
762
+ result:
763
+ "SOC 2 analysis: 14 of 16 controls fully satisfied. 2 gaps identified: (1) CC6.1 — 3 instances of auto-approved Bash commands that should require manual review (Medium severity). (2) CC7.2 — heartbeat budget exceeded on 2 occasions without alert (Low severity). Remediation: tighten auto-approve policy for Bash, add budget breach notification.",
764
+ agentProfile: "general",
765
+ sourceType: "workflow",
766
+ workflowId: w8,
767
+ scheduleId: null,
768
+ createdAt: new Date(now - 4 * DAY),
769
+ updatedAt: new Date(now - 3 * DAY),
770
+ },
771
+ {
772
+ id: crypto.randomUUID(),
773
+ projectId: p8,
774
+ title: "Generate March compliance report",
775
+ description:
776
+ "Write the monthly report: executive summary, control effectiveness, gap analysis with remediation timelines",
777
+ status: "completed",
778
+ priority: 2,
779
+ result:
780
+ "March compliance report delivered (8 pages). Overall posture: GREEN. Control effectiveness: 87.5% (14/16). 2 gaps with remediation plans — both scheduled for completion by April 15. Trend: improving from February (81.25%, 3 gaps). Recommendation: promote auto-approve policy tightening to all projects.",
781
+ agentProfile: "general",
782
+ sourceType: "workflow",
783
+ workflowId: w8,
784
+ scheduleId: null,
313
785
  createdAt: new Date(now - 3 * DAY),
314
786
  updatedAt: new Date(now - 3 * DAY),
315
787
  },
316
788
  {
317
789
  id: crypto.randomUUID(),
318
- projectId: p5,
319
- title: "Review estimated tax payments",
790
+ projectId: p8,
791
+ title: "Prepare executive compliance brief",
320
792
  description:
321
- "Reconcile quarterly estimated payments against actual liability",
322
- status: "planned",
793
+ "1-page brief: overall posture, top findings, remediation progress, and recommended policy updates",
794
+ status: "completed",
795
+ priority: 2,
796
+ result:
797
+ "Executive brief delivered. Headline: 'March Compliance Posture — GREEN, improving trend.' Key metrics: 1,247 governed executions, 0 unauthorized access incidents, 2 policy gaps (both medium/low). Board-ready format with month-over-month trend chart. Attached to the Monthly Compliance Audit workflow output.",
798
+ agentProfile: "general",
799
+ sourceType: "workflow",
800
+ workflowId: w8,
801
+ scheduleId: null,
802
+ createdAt: new Date(now - 3 * DAY),
803
+ updatedAt: new Date(now - 3 * DAY),
804
+ },
805
+ {
806
+ id: crypto.randomUUID(),
807
+ projectId: p8,
808
+ title: "Audit permission escalation patterns",
809
+ description:
810
+ "Review which tools trigger the most permission requests and whether auto-approve policies are appropriately scoped",
811
+ status: "completed",
323
812
  priority: 1,
324
- result: null,
325
- createdAt: new Date(now - 2 * DAY),
326
- updatedAt: new Date(now - 2 * DAY),
813
+ result:
814
+ "Escalation analysis: Write (41% of all permission requests), SendEmail (22%), Bash (18%), WebSearch (12%), Other (7%). Auto-approve coverage: Read and Grep at 100%, WebSearch at 60% (appropriate for non-sensitive contexts). Recommendation: keep Write at 100% manual approval, consider auto-approving WebSearch for researcher profile only.",
815
+ agentProfile: "general",
816
+ sourceType: "scheduled",
817
+ workflowId: null,
818
+ scheduleId: s8,
819
+ createdAt: new Date(now - 4 * DAY),
820
+ updatedAt: new Date(now - 3 * DAY),
327
821
  },
328
822
  {
329
823
  id: crypto.randomUUID(),
330
- projectId: p5,
331
- title: "Prepare documents for CPA review",
824
+ projectId: p8,
825
+ title: "Plan April audit scope expansion",
332
826
  description:
333
- "Organize all forms, deductions, and summaries into a CPA-ready package",
827
+ "Scope the April audit to include heartbeat budget compliance, cross-project data access, and channel delivery audit",
334
828
  status: "planned",
335
- priority: 0,
829
+ priority: 1,
336
830
  result: null,
831
+ agentProfile: "general",
832
+ sourceType: "manual",
833
+ workflowId: null,
834
+ scheduleId: null,
337
835
  createdAt: new Date(now - 1 * DAY),
338
836
  updatedAt: new Date(now - 1 * DAY),
339
837
  },