stagent 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +191 -0
- package/README.md +399 -0
- package/components.json +21 -0
- package/dist/cli.js +171 -0
- package/drizzle.config.ts +12 -0
- package/next.config.mjs +15 -0
- package/package.json +114 -0
- package/postcss.config.mjs +8 -0
- package/public/icon-512.png +0 -0
- package/public/icon.svg +13 -0
- package/public/readme/home-workspace.png +0 -0
- package/public/readme/inbox-approvals.png +0 -0
- package/public/readme/workflow-blueprints.png +0 -0
- package/public/stagent-s-128.png +0 -0
- package/public/stagent-s-64.png +0 -0
- package/src/app/api/blueprints/[id]/instantiate/route.ts +27 -0
- package/src/app/api/blueprints/[id]/route.ts +39 -0
- package/src/app/api/blueprints/import/route.ts +68 -0
- package/src/app/api/blueprints/route.ts +29 -0
- package/src/app/api/command-palette/recent/route.ts +31 -0
- package/src/app/api/data/clear/route.ts +22 -0
- package/src/app/api/data/seed/route.ts +22 -0
- package/src/app/api/documents/[id]/file/route.ts +44 -0
- package/src/app/api/documents/[id]/route.ts +123 -0
- package/src/app/api/documents/route.ts +59 -0
- package/src/app/api/logs/stream/route.ts +101 -0
- package/src/app/api/notifications/[id]/route.ts +36 -0
- package/src/app/api/notifications/mark-all-read/route.ts +13 -0
- package/src/app/api/notifications/pending-approvals/route.ts +10 -0
- package/src/app/api/notifications/pending-approvals/stream/route.ts +101 -0
- package/src/app/api/notifications/route.ts +34 -0
- package/src/app/api/permissions/route.ts +46 -0
- package/src/app/api/profiles/[id]/route.ts +79 -0
- package/src/app/api/profiles/[id]/test/route.ts +42 -0
- package/src/app/api/profiles/import/route.ts +108 -0
- package/src/app/api/profiles/route.ts +50 -0
- package/src/app/api/projects/[id]/route.ts +72 -0
- package/src/app/api/projects/route.ts +53 -0
- package/src/app/api/schedules/[id]/route.ts +185 -0
- package/src/app/api/schedules/route.ts +117 -0
- package/src/app/api/settings/budgets/route.ts +24 -0
- package/src/app/api/settings/openai/route.ts +24 -0
- package/src/app/api/settings/route.ts +21 -0
- package/src/app/api/settings/test/route.ts +26 -0
- package/src/app/api/tasks/[id]/cancel/route.ts +21 -0
- package/src/app/api/tasks/[id]/execute/route.ts +90 -0
- package/src/app/api/tasks/[id]/logs/route.ts +95 -0
- package/src/app/api/tasks/[id]/output/route.ts +47 -0
- package/src/app/api/tasks/[id]/respond/route.ts +64 -0
- package/src/app/api/tasks/[id]/resume/route.ts +76 -0
- package/src/app/api/tasks/[id]/route.ts +77 -0
- package/src/app/api/tasks/assist/route.ts +35 -0
- package/src/app/api/tasks/route.ts +82 -0
- package/src/app/api/uploads/[id]/route.ts +81 -0
- package/src/app/api/uploads/cleanup/route.ts +7 -0
- package/src/app/api/uploads/route.ts +66 -0
- package/src/app/api/workflows/[id]/execute/route.ts +82 -0
- package/src/app/api/workflows/[id]/route.ts +133 -0
- package/src/app/api/workflows/[id]/status/route.ts +54 -0
- package/src/app/api/workflows/[id]/steps/[stepId]/retry/route.ts +22 -0
- package/src/app/api/workflows/route.ts +61 -0
- package/src/app/apple-icon.tsx +31 -0
- package/src/app/costs/page.tsx +256 -0
- package/src/app/dashboard/page.tsx +44 -0
- package/src/app/documents/[id]/page.tsx +46 -0
- package/src/app/documents/page.tsx +45 -0
- package/src/app/error.tsx +26 -0
- package/src/app/global-error.tsx +23 -0
- package/src/app/globals.css +733 -0
- package/src/app/icon.tsx +30 -0
- package/src/app/inbox/loading.tsx +15 -0
- package/src/app/inbox/page.tsx +35 -0
- package/src/app/layout.tsx +78 -0
- package/src/app/manifest.ts +32 -0
- package/src/app/monitor/page.tsx +37 -0
- package/src/app/page.tsx +162 -0
- package/src/app/profiles/[id]/edit/page.tsx +39 -0
- package/src/app/profiles/[id]/page.tsx +33 -0
- package/src/app/profiles/new/page.tsx +22 -0
- package/src/app/profiles/page.tsx +19 -0
- package/src/app/projects/[id]/page.tsx +134 -0
- package/src/app/projects/loading.tsx +17 -0
- package/src/app/projects/page.tsx +32 -0
- package/src/app/schedules/[id]/page.tsx +47 -0
- package/src/app/schedules/page.tsx +18 -0
- package/src/app/settings/loading.tsx +24 -0
- package/src/app/settings/page.tsx +27 -0
- package/src/app/tasks/[id]/page.tsx +45 -0
- package/src/app/tasks/new/page.tsx +27 -0
- package/src/app/workflows/[id]/edit/page.tsx +66 -0
- package/src/app/workflows/[id]/page.tsx +37 -0
- package/src/app/workflows/blueprints/[id]/page.tsx +40 -0
- package/src/app/workflows/blueprints/new/page.tsx +20 -0
- package/src/app/workflows/blueprints/page.tsx +11 -0
- package/src/app/workflows/new/page.tsx +36 -0
- package/src/app/workflows/page.tsx +18 -0
- package/src/components/charts/donut-ring.tsx +64 -0
- package/src/components/charts/mini-bar.tsx +75 -0
- package/src/components/charts/sparkline.tsx +107 -0
- package/src/components/costs/cost-dashboard.tsx +877 -0
- package/src/components/costs/cost-filters.tsx +179 -0
- package/src/components/dashboard/activity-feed.tsx +95 -0
- package/src/components/dashboard/greeting.tsx +30 -0
- package/src/components/dashboard/priority-queue.tsx +79 -0
- package/src/components/dashboard/quick-actions.tsx +62 -0
- package/src/components/dashboard/recent-projects.tsx +79 -0
- package/src/components/dashboard/stats-cards.tsx +114 -0
- package/src/components/documents/document-browser.tsx +235 -0
- package/src/components/documents/document-detail-view.tsx +367 -0
- package/src/components/documents/document-grid.tsx +78 -0
- package/src/components/documents/document-preview.tsx +68 -0
- package/src/components/documents/document-table.tsx +119 -0
- package/src/components/documents/document-upload-dialog.tsx +153 -0
- package/src/components/documents/types.ts +6 -0
- package/src/components/documents/utils.ts +57 -0
- package/src/components/monitoring/connection-indicator.tsx +14 -0
- package/src/components/monitoring/log-entry.tsx +79 -0
- package/src/components/monitoring/log-filters.tsx +57 -0
- package/src/components/monitoring/log-stream.tsx +144 -0
- package/src/components/monitoring/monitor-overview-wrapper.tsx +64 -0
- package/src/components/monitoring/monitor-overview.tsx +119 -0
- package/src/components/notifications/failure-action.tsx +38 -0
- package/src/components/notifications/inbox-list.tsx +165 -0
- package/src/components/notifications/message-response.tsx +196 -0
- package/src/components/notifications/notification-item.tsx +250 -0
- package/src/components/notifications/pending-approval-host.tsx +478 -0
- package/src/components/notifications/permission-action.tsx +37 -0
- package/src/components/notifications/permission-response-actions.tsx +126 -0
- package/src/components/notifications/unread-badge.tsx +35 -0
- package/src/components/profiles/profile-browser.tsx +117 -0
- package/src/components/profiles/profile-card.tsx +78 -0
- package/src/components/profiles/profile-detail-view.tsx +564 -0
- package/src/components/profiles/profile-form-view.tsx +480 -0
- package/src/components/profiles/profile-import-dialog.tsx +113 -0
- package/src/components/projects/project-card.tsx +58 -0
- package/src/components/projects/project-create-dialog.tsx +140 -0
- package/src/components/projects/project-detail.tsx +68 -0
- package/src/components/projects/project-edit-dialog.tsx +219 -0
- package/src/components/projects/project-list.tsx +108 -0
- package/src/components/schedules/schedule-create-dialog.tsx +403 -0
- package/src/components/schedules/schedule-detail-view.tsx +274 -0
- package/src/components/schedules/schedule-list.tsx +242 -0
- package/src/components/schedules/schedule-status-badge.tsx +16 -0
- package/src/components/settings/api-key-form.tsx +141 -0
- package/src/components/settings/auth-config-section.tsx +141 -0
- package/src/components/settings/auth-method-selector.tsx +67 -0
- package/src/components/settings/auth-status-badge.tsx +40 -0
- package/src/components/settings/auth-status-dot.tsx +59 -0
- package/src/components/settings/budget-guardrails-section.tsx +842 -0
- package/src/components/settings/data-management-section.tsx +141 -0
- package/src/components/settings/openai-runtime-section.tsx +104 -0
- package/src/components/settings/permissions-section.tsx +91 -0
- package/src/components/shared/app-sidebar.tsx +123 -0
- package/src/components/shared/card-skeleton.tsx +42 -0
- package/src/components/shared/command-palette.tsx +250 -0
- package/src/components/shared/confirm-dialog.tsx +52 -0
- package/src/components/shared/empty-state.tsx +24 -0
- package/src/components/shared/error-state.tsx +32 -0
- package/src/components/shared/form-section-card.tsx +33 -0
- package/src/components/shared/section-heading.tsx +14 -0
- package/src/components/shared/stagent-logo.tsx +21 -0
- package/src/components/shared/theme-toggle.tsx +46 -0
- package/src/components/tasks/ai-assist-panel.tsx +210 -0
- package/src/components/tasks/content-preview.tsx +89 -0
- package/src/components/tasks/empty-board.tsx +12 -0
- package/src/components/tasks/file-upload.tsx +120 -0
- package/src/components/tasks/kanban-board.tsx +275 -0
- package/src/components/tasks/kanban-column.tsx +75 -0
- package/src/components/tasks/skeleton-board.tsx +21 -0
- package/src/components/tasks/task-attachments.tsx +114 -0
- package/src/components/tasks/task-card.tsx +101 -0
- package/src/components/tasks/task-create-panel.tsx +360 -0
- package/src/components/tasks/task-detail-view.tsx +356 -0
- package/src/components/ui/alert-dialog.tsx +196 -0
- package/src/components/ui/badge.tsx +50 -0
- package/src/components/ui/button.tsx +71 -0
- package/src/components/ui/card.tsx +92 -0
- package/src/components/ui/checkbox.tsx +32 -0
- package/src/components/ui/command.tsx +184 -0
- package/src/components/ui/dialog.tsx +158 -0
- package/src/components/ui/dropdown-menu.tsx +257 -0
- package/src/components/ui/form.tsx +167 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/popover.tsx +89 -0
- package/src/components/ui/progress.tsx +31 -0
- package/src/components/ui/radio-group.tsx +45 -0
- package/src/components/ui/scroll-area.tsx +58 -0
- package/src/components/ui/select.tsx +190 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/sheet.tsx +143 -0
- package/src/components/ui/sidebar.tsx +726 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/slider.tsx +63 -0
- package/src/components/ui/sonner.tsx +36 -0
- package/src/components/ui/switch.tsx +35 -0
- package/src/components/ui/table.tsx +116 -0
- package/src/components/ui/tabs.tsx +91 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/tooltip.tsx +57 -0
- package/src/components/workflows/blueprint-editor.tsx +109 -0
- package/src/components/workflows/blueprint-gallery.tsx +155 -0
- package/src/components/workflows/blueprint-preview.tsx +240 -0
- package/src/components/workflows/loop-status-view.tsx +272 -0
- package/src/components/workflows/swarm-dashboard.tsx +185 -0
- package/src/components/workflows/workflow-form-view.tsx +1376 -0
- package/src/components/workflows/workflow-list.tsx +230 -0
- package/src/components/workflows/workflow-status-view.tsx +477 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/instrumentation.ts +7 -0
- package/src/lib/agents/claude-agent.ts +737 -0
- package/src/lib/agents/execution-manager.ts +27 -0
- package/src/lib/agents/profiles/assignment-validation.ts +75 -0
- package/src/lib/agents/profiles/builtins/code-reviewer/SKILL.md +21 -0
- package/src/lib/agents/profiles/builtins/code-reviewer/profile.yaml +28 -0
- package/src/lib/agents/profiles/builtins/data-analyst/SKILL.md +25 -0
- package/src/lib/agents/profiles/builtins/data-analyst/profile.yaml +27 -0
- package/src/lib/agents/profiles/builtins/devops-engineer/SKILL.md +34 -0
- package/src/lib/agents/profiles/builtins/devops-engineer/profile.yaml +27 -0
- package/src/lib/agents/profiles/builtins/document-writer/SKILL.md +16 -0
- package/src/lib/agents/profiles/builtins/document-writer/profile.yaml +27 -0
- package/src/lib/agents/profiles/builtins/general/SKILL.md +13 -0
- package/src/lib/agents/profiles/builtins/general/profile.yaml +18 -0
- package/src/lib/agents/profiles/builtins/health-fitness-coach/SKILL.md +34 -0
- package/src/lib/agents/profiles/builtins/health-fitness-coach/profile.yaml +26 -0
- package/src/lib/agents/profiles/builtins/learning-coach/SKILL.md +35 -0
- package/src/lib/agents/profiles/builtins/learning-coach/profile.yaml +26 -0
- package/src/lib/agents/profiles/builtins/project-manager/SKILL.md +26 -0
- package/src/lib/agents/profiles/builtins/project-manager/profile.yaml +26 -0
- package/src/lib/agents/profiles/builtins/researcher/SKILL.md +15 -0
- package/src/lib/agents/profiles/builtins/researcher/profile.yaml +27 -0
- package/src/lib/agents/profiles/builtins/shopping-assistant/SKILL.md +34 -0
- package/src/lib/agents/profiles/builtins/shopping-assistant/profile.yaml +26 -0
- package/src/lib/agents/profiles/builtins/technical-writer/SKILL.md +31 -0
- package/src/lib/agents/profiles/builtins/technical-writer/profile.yaml +29 -0
- package/src/lib/agents/profiles/builtins/travel-planner/SKILL.md +23 -0
- package/src/lib/agents/profiles/builtins/travel-planner/profile.yaml +26 -0
- package/src/lib/agents/profiles/builtins/wealth-manager/SKILL.md +24 -0
- package/src/lib/agents/profiles/builtins/wealth-manager/profile.yaml +26 -0
- package/src/lib/agents/profiles/compatibility.ts +109 -0
- package/src/lib/agents/profiles/registry.ts +293 -0
- package/src/lib/agents/profiles/test-runner.ts +18 -0
- package/src/lib/agents/profiles/test-types.ts +20 -0
- package/src/lib/agents/profiles/types.ts +43 -0
- package/src/lib/agents/router.ts +56 -0
- package/src/lib/agents/runtime/catalog.ts +85 -0
- package/src/lib/agents/runtime/claude-sdk.ts +12 -0
- package/src/lib/agents/runtime/claude.ts +370 -0
- package/src/lib/agents/runtime/codex-app-server-client.ts +289 -0
- package/src/lib/agents/runtime/index.ts +167 -0
- package/src/lib/agents/runtime/openai-codex.ts +1089 -0
- package/src/lib/agents/runtime/task-assist-types.ts +8 -0
- package/src/lib/agents/runtime/types.ts +30 -0
- package/src/lib/constants/settings.ts +13 -0
- package/src/lib/constants/status-colors.ts +44 -0
- package/src/lib/constants/task-status.ts +49 -0
- package/src/lib/data/clear.ts +63 -0
- package/src/lib/data/seed-data/documents.ts +715 -0
- package/src/lib/data/seed-data/logs.ts +195 -0
- package/src/lib/data/seed-data/notifications.ts +141 -0
- package/src/lib/data/seed-data/profiles.ts +175 -0
- package/src/lib/data/seed-data/projects.ts +61 -0
- package/src/lib/data/seed-data/schedules.ts +108 -0
- package/src/lib/data/seed-data/tasks.ts +341 -0
- package/src/lib/data/seed-data/usage-ledger.ts +130 -0
- package/src/lib/data/seed-data/workflows.ts +213 -0
- package/src/lib/data/seed.ts +129 -0
- package/src/lib/db/index.ts +221 -0
- package/src/lib/db/migrations/0000_aromatic_gargoyle.sql +59 -0
- package/src/lib/db/migrations/0001_first_iron_patriot.sql +6 -0
- package/src/lib/db/migrations/0002_add_resume_count.sql +1 -0
- package/src/lib/db/migrations/0003_add_settings.sql +5 -0
- package/src/lib/db/migrations/0004_add_documents.sql +20 -0
- package/src/lib/db/migrations/0005_add_document_preprocessing.sql +4 -0
- package/src/lib/db/migrations/0006_add_agent_profile.sql +2 -0
- package/src/lib/db/migrations/0007_add_usage_metering_ledger.sql +30 -0
- package/src/lib/db/migrations/0008_add_document_version.sql +1 -0
- package/src/lib/db/migrations/meta/0000_snapshot.json +416 -0
- package/src/lib/db/migrations/meta/0001_snapshot.json +461 -0
- package/src/lib/db/migrations/meta/0002_snapshot.json +469 -0
- package/src/lib/db/migrations/meta/_journal.json +27 -0
- package/src/lib/db/schema.ts +227 -0
- package/src/lib/documents/cleanup.ts +50 -0
- package/src/lib/documents/context-builder.ts +75 -0
- package/src/lib/documents/output-scanner.ts +166 -0
- package/src/lib/documents/processor.ts +120 -0
- package/src/lib/documents/processors/image.ts +21 -0
- package/src/lib/documents/processors/office.ts +36 -0
- package/src/lib/documents/processors/pdf.ts +12 -0
- package/src/lib/documents/processors/spreadsheet.ts +18 -0
- package/src/lib/documents/processors/text.ts +8 -0
- package/src/lib/documents/registry.ts +25 -0
- package/src/lib/notifications/actionable.ts +108 -0
- package/src/lib/notifications/permissions.ts +169 -0
- package/src/lib/queries/chart-data.ts +184 -0
- package/src/lib/schedules/interval-parser.ts +110 -0
- package/src/lib/schedules/scheduler.ts +220 -0
- package/src/lib/settings/auth.ts +98 -0
- package/src/lib/settings/budget-guardrails.ts +590 -0
- package/src/lib/settings/helpers.ts +23 -0
- package/src/lib/settings/openai-auth.ts +80 -0
- package/src/lib/settings/permissions.ts +102 -0
- package/src/lib/usage/ledger.ts +489 -0
- package/src/lib/usage/pricing.ts +68 -0
- package/src/lib/utils/crypto.ts +90 -0
- package/src/lib/utils/format-timestamp.ts +46 -0
- package/src/lib/utils/session-cleanup.ts +26 -0
- package/src/lib/utils/stagent-paths.ts +18 -0
- package/src/lib/utils.ts +6 -0
- package/src/lib/validators/blueprint.ts +43 -0
- package/src/lib/validators/profile.ts +64 -0
- package/src/lib/validators/project.ts +17 -0
- package/src/lib/validators/settings.ts +57 -0
- package/src/lib/validators/task.ts +30 -0
- package/src/lib/workflows/blueprints/builtins/code-review-pipeline.yaml +72 -0
- package/src/lib/workflows/blueprints/builtins/documentation-generation.yaml +62 -0
- package/src/lib/workflows/blueprints/builtins/investment-research.yaml +81 -0
- package/src/lib/workflows/blueprints/builtins/meal-planning.yaml +73 -0
- package/src/lib/workflows/blueprints/builtins/product-research.yaml +72 -0
- package/src/lib/workflows/blueprints/builtins/research-report.yaml +77 -0
- package/src/lib/workflows/blueprints/builtins/sprint-planning.yaml +77 -0
- package/src/lib/workflows/blueprints/builtins/travel-planning.yaml +80 -0
- package/src/lib/workflows/blueprints/instantiator.ts +131 -0
- package/src/lib/workflows/blueprints/registry.ts +128 -0
- package/src/lib/workflows/blueprints/template.ts +58 -0
- package/src/lib/workflows/blueprints/types.ts +38 -0
- package/src/lib/workflows/definition-validation.ts +121 -0
- package/src/lib/workflows/engine.ts +1113 -0
- package/src/lib/workflows/loop-executor.ts +270 -0
- package/src/lib/workflows/parallel.ts +55 -0
- package/src/lib/workflows/swarm.ts +97 -0
- package/src/lib/workflows/types.ts +112 -0
- package/tsconfig.json +41 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
export interface TaskSeed {
|
|
2
|
+
id: string;
|
|
3
|
+
projectId: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
status: "planned" | "queued" | "running" | "completed" | "failed";
|
|
7
|
+
priority: number;
|
|
8
|
+
result: string | null;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
updatedAt: Date;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createTasks(projectIds: string[]): TaskSeed[] {
|
|
14
|
+
const now = Date.now();
|
|
15
|
+
const DAY = 86_400_000;
|
|
16
|
+
const HOUR = 3_600_000;
|
|
17
|
+
const [p1, p2, p3, p4, p5] = projectIds;
|
|
18
|
+
|
|
19
|
+
return [
|
|
20
|
+
// Project 1 — Investment Portfolio (5 tasks)
|
|
21
|
+
{
|
|
22
|
+
id: crypto.randomUUID(),
|
|
23
|
+
projectId: p1,
|
|
24
|
+
title: "Analyze current portfolio allocation",
|
|
25
|
+
description:
|
|
26
|
+
"Review all holdings, calculate sector weights, and identify concentration risks",
|
|
27
|
+
status: "completed",
|
|
28
|
+
priority: 3,
|
|
29
|
+
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),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: crypto.randomUUID(),
|
|
36
|
+
projectId: p1,
|
|
37
|
+
title: "Research top semiconductor ETFs",
|
|
38
|
+
description:
|
|
39
|
+
"Compare SOXX, SMH, and PSI on expense ratio, holdings, and 5-year returns",
|
|
40
|
+
status: "completed",
|
|
41
|
+
priority: 2,
|
|
42
|
+
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),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: crypto.randomUUID(),
|
|
49
|
+
projectId: p1,
|
|
50
|
+
title: "Compare dividend yield strategies",
|
|
51
|
+
description:
|
|
52
|
+
"Evaluate high-yield vs dividend growth approaches for income generation",
|
|
53
|
+
status: "running",
|
|
54
|
+
priority: 2,
|
|
55
|
+
result: null,
|
|
56
|
+
createdAt: new Date(now - 8 * DAY),
|
|
57
|
+
updatedAt: new Date(now - 2 * HOUR),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: crypto.randomUUID(),
|
|
61
|
+
projectId: p1,
|
|
62
|
+
title: "Generate quarterly performance report",
|
|
63
|
+
description:
|
|
64
|
+
"Create a comprehensive Q1 performance summary with benchmarks",
|
|
65
|
+
status: "planned",
|
|
66
|
+
priority: 1,
|
|
67
|
+
result: null,
|
|
68
|
+
createdAt: new Date(now - 5 * DAY),
|
|
69
|
+
updatedAt: new Date(now - 5 * DAY),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: crypto.randomUUID(),
|
|
73
|
+
projectId: p1,
|
|
74
|
+
title: "Set up automated portfolio alerts",
|
|
75
|
+
description:
|
|
76
|
+
"Configure price alerts and rebalancing triggers for key positions",
|
|
77
|
+
status: "planned",
|
|
78
|
+
priority: 0,
|
|
79
|
+
result: null,
|
|
80
|
+
createdAt: new Date(now - 3 * DAY),
|
|
81
|
+
updatedAt: new Date(now - 3 * DAY),
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
// Project 2 — Landing Page (5 tasks)
|
|
85
|
+
{
|
|
86
|
+
id: crypto.randomUUID(),
|
|
87
|
+
projectId: p2,
|
|
88
|
+
title: "Audit competitor landing pages",
|
|
89
|
+
description:
|
|
90
|
+
"Analyze 4 competitor landing pages for design patterns, CTAs, and messaging",
|
|
91
|
+
status: "completed",
|
|
92
|
+
priority: 3,
|
|
93
|
+
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),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: crypto.randomUUID(),
|
|
100
|
+
projectId: p2,
|
|
101
|
+
title: "Write hero section copy and CTA",
|
|
102
|
+
description:
|
|
103
|
+
"Draft 3 headline variants and supporting copy for the hero section",
|
|
104
|
+
status: "completed",
|
|
105
|
+
priority: 2,
|
|
106
|
+
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),
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: crypto.randomUUID(),
|
|
113
|
+
projectId: p2,
|
|
114
|
+
title: "Design responsive hero component",
|
|
115
|
+
description:
|
|
116
|
+
"Build the hero section with responsive layout and animation",
|
|
117
|
+
status: "running",
|
|
118
|
+
priority: 2,
|
|
119
|
+
result: null,
|
|
120
|
+
createdAt: new Date(now - 6 * DAY),
|
|
121
|
+
updatedAt: new Date(now - 1 * HOUR),
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: crypto.randomUUID(),
|
|
125
|
+
projectId: p2,
|
|
126
|
+
title: "Build testimonial carousel section",
|
|
127
|
+
description:
|
|
128
|
+
"Create a responsive carousel with customer quotes and logos",
|
|
129
|
+
status: "queued",
|
|
130
|
+
priority: 1,
|
|
131
|
+
result: null,
|
|
132
|
+
createdAt: new Date(now - 4 * DAY),
|
|
133
|
+
updatedAt: new Date(now - 4 * DAY),
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: crypto.randomUUID(),
|
|
137
|
+
projectId: p2,
|
|
138
|
+
title: "Set up A/B test for CTA variants",
|
|
139
|
+
description:
|
|
140
|
+
"Configure split testing for the two hero copy variants",
|
|
141
|
+
status: "planned",
|
|
142
|
+
priority: 0,
|
|
143
|
+
result: null,
|
|
144
|
+
createdAt: new Date(now - 2 * DAY),
|
|
145
|
+
updatedAt: new Date(now - 2 * DAY),
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
// Project 3 — Lead Generation (5 tasks)
|
|
149
|
+
{
|
|
150
|
+
id: crypto.randomUUID(),
|
|
151
|
+
projectId: p3,
|
|
152
|
+
title: "Search LinkedIn for VP-level prospects",
|
|
153
|
+
description:
|
|
154
|
+
"Identify VP/Director-level decision-makers at target SaaS companies",
|
|
155
|
+
status: "completed",
|
|
156
|
+
priority: 3,
|
|
157
|
+
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),
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: crypto.randomUUID(),
|
|
164
|
+
projectId: p3,
|
|
165
|
+
title: "Enrich prospect data with company info",
|
|
166
|
+
description:
|
|
167
|
+
"Pull company size, funding, and tech stack data for each prospect",
|
|
168
|
+
status: "failed",
|
|
169
|
+
priority: 2,
|
|
170
|
+
result: null,
|
|
171
|
+
createdAt: new Date(now - 7 * DAY),
|
|
172
|
+
updatedAt: new Date(now - 6 * DAY),
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: crypto.randomUUID(),
|
|
176
|
+
projectId: p3,
|
|
177
|
+
title: "Draft personalized outreach sequences",
|
|
178
|
+
description:
|
|
179
|
+
"Write 3-email sequences personalized for each prospect segment",
|
|
180
|
+
status: "queued",
|
|
181
|
+
priority: 2,
|
|
182
|
+
result: null,
|
|
183
|
+
createdAt: new Date(now - 5 * DAY),
|
|
184
|
+
updatedAt: new Date(now - 5 * DAY),
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
id: crypto.randomUUID(),
|
|
188
|
+
projectId: p3,
|
|
189
|
+
title: "Set up email tracking dashboard",
|
|
190
|
+
description:
|
|
191
|
+
"Create dashboard to monitor open rates, clicks, and replies",
|
|
192
|
+
status: "planned",
|
|
193
|
+
priority: 1,
|
|
194
|
+
result: null,
|
|
195
|
+
createdAt: new Date(now - 3 * DAY),
|
|
196
|
+
updatedAt: new Date(now - 3 * DAY),
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
id: crypto.randomUUID(),
|
|
200
|
+
projectId: p3,
|
|
201
|
+
title: "Analyze response rates and optimize",
|
|
202
|
+
description:
|
|
203
|
+
"Review campaign performance and adjust messaging for better conversion",
|
|
204
|
+
status: "planned",
|
|
205
|
+
priority: 0,
|
|
206
|
+
result: null,
|
|
207
|
+
createdAt: new Date(now - 1 * DAY),
|
|
208
|
+
updatedAt: new Date(now - 1 * DAY),
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
// Project 4 — Business Trip (5 tasks, all completed)
|
|
212
|
+
{
|
|
213
|
+
id: crypto.randomUUID(),
|
|
214
|
+
projectId: p4,
|
|
215
|
+
title: "Book round-trip flights SFO → JFK",
|
|
216
|
+
description:
|
|
217
|
+
"Find and book optimal flights for March 15-18 trip",
|
|
218
|
+
status: "completed",
|
|
219
|
+
priority: 3,
|
|
220
|
+
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.",
|
|
222
|
+
createdAt: new Date(now - 7 * DAY),
|
|
223
|
+
updatedAt: new Date(now - 6 * DAY),
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: crypto.randomUUID(),
|
|
227
|
+
projectId: p4,
|
|
228
|
+
title: "Reserve hotel near conference venue",
|
|
229
|
+
description:
|
|
230
|
+
"Book hotel in Midtown Manhattan for 3 nights",
|
|
231
|
+
status: "completed",
|
|
232
|
+
priority: 3,
|
|
233
|
+
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.",
|
|
235
|
+
createdAt: new Date(now - 7 * DAY),
|
|
236
|
+
updatedAt: new Date(now - 6 * DAY),
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: crypto.randomUUID(),
|
|
240
|
+
projectId: p4,
|
|
241
|
+
title: "Create day-by-day meeting itinerary",
|
|
242
|
+
description:
|
|
243
|
+
"Organize all meetings, events, and travel logistics by day",
|
|
244
|
+
status: "completed",
|
|
245
|
+
priority: 2,
|
|
246
|
+
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.",
|
|
248
|
+
createdAt: new Date(now - 6 * DAY),
|
|
249
|
+
updatedAt: new Date(now - 5 * DAY),
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
id: crypto.randomUUID(),
|
|
253
|
+
projectId: p4,
|
|
254
|
+
title: "Submit pre-trip expense approval",
|
|
255
|
+
description:
|
|
256
|
+
"File expense pre-approval for estimated trip costs",
|
|
257
|
+
status: "completed",
|
|
258
|
+
priority: 1,
|
|
259
|
+
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.",
|
|
261
|
+
createdAt: new Date(now - 5 * DAY),
|
|
262
|
+
updatedAt: new Date(now - 4 * DAY),
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: crypto.randomUUID(),
|
|
266
|
+
projectId: p4,
|
|
267
|
+
title: "Compile post-trip expense report",
|
|
268
|
+
description:
|
|
269
|
+
"Gather receipts and submit final expense report",
|
|
270
|
+
status: "completed",
|
|
271
|
+
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),
|
|
275
|
+
updatedAt: new Date(now - 3 * DAY),
|
|
276
|
+
},
|
|
277
|
+
|
|
278
|
+
// Project 5 — Tax Filing (5 tasks)
|
|
279
|
+
{
|
|
280
|
+
id: crypto.randomUUID(),
|
|
281
|
+
projectId: p5,
|
|
282
|
+
title: "Gather W-2 and 1099 forms",
|
|
283
|
+
description:
|
|
284
|
+
"Collect all tax documents from employers and financial institutions",
|
|
285
|
+
status: "completed",
|
|
286
|
+
priority: 3,
|
|
287
|
+
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).",
|
|
289
|
+
createdAt: new Date(now - 5 * DAY),
|
|
290
|
+
updatedAt: new Date(now - 3 * DAY),
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
id: crypto.randomUUID(),
|
|
294
|
+
projectId: p5,
|
|
295
|
+
title: "Categorize deductible expenses",
|
|
296
|
+
description:
|
|
297
|
+
"Sort expenses into IRS-recognized deduction categories",
|
|
298
|
+
status: "running",
|
|
299
|
+
priority: 2,
|
|
300
|
+
result: null,
|
|
301
|
+
createdAt: new Date(now - 4 * DAY),
|
|
302
|
+
updatedAt: new Date(now - 3 * HOUR),
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
id: crypto.randomUUID(),
|
|
306
|
+
projectId: p5,
|
|
307
|
+
title: "Calculate home office deduction",
|
|
308
|
+
description:
|
|
309
|
+
"Measure dedicated space and calculate simplified vs actual method",
|
|
310
|
+
status: "queued",
|
|
311
|
+
priority: 1,
|
|
312
|
+
result: null,
|
|
313
|
+
createdAt: new Date(now - 3 * DAY),
|
|
314
|
+
updatedAt: new Date(now - 3 * DAY),
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: crypto.randomUUID(),
|
|
318
|
+
projectId: p5,
|
|
319
|
+
title: "Review estimated tax payments",
|
|
320
|
+
description:
|
|
321
|
+
"Reconcile quarterly estimated payments against actual liability",
|
|
322
|
+
status: "planned",
|
|
323
|
+
priority: 1,
|
|
324
|
+
result: null,
|
|
325
|
+
createdAt: new Date(now - 2 * DAY),
|
|
326
|
+
updatedAt: new Date(now - 2 * DAY),
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
id: crypto.randomUUID(),
|
|
330
|
+
projectId: p5,
|
|
331
|
+
title: "Prepare documents for CPA review",
|
|
332
|
+
description:
|
|
333
|
+
"Organize all forms, deductions, and summaries into a CPA-ready package",
|
|
334
|
+
status: "planned",
|
|
335
|
+
priority: 0,
|
|
336
|
+
result: null,
|
|
337
|
+
createdAt: new Date(now - 1 * DAY),
|
|
338
|
+
updatedAt: new Date(now - 1 * DAY),
|
|
339
|
+
},
|
|
340
|
+
];
|
|
341
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { ScheduleSeed } from "./schedules";
|
|
2
|
+
import type { TaskSeed } from "./tasks";
|
|
3
|
+
import type { WorkflowSeed } from "./workflows";
|
|
4
|
+
import type { UsageLedgerWriteInput } from "@/lib/usage/ledger";
|
|
5
|
+
|
|
6
|
+
export function createUsageLedgerSeeds(input: {
|
|
7
|
+
tasks: TaskSeed[];
|
|
8
|
+
workflows: WorkflowSeed[];
|
|
9
|
+
schedules: ScheduleSeed[];
|
|
10
|
+
}): UsageLedgerWriteInput[] {
|
|
11
|
+
const completedTasks = input.tasks.filter((task) => task.status === "completed");
|
|
12
|
+
const runningTask = input.tasks.find((task) => task.status === "running");
|
|
13
|
+
const failedTask = input.tasks.find((task) => task.status === "failed");
|
|
14
|
+
const [workflow] = input.workflows;
|
|
15
|
+
const [schedule] = input.schedules;
|
|
16
|
+
|
|
17
|
+
const now = Date.now();
|
|
18
|
+
const HOUR = 3_600_000;
|
|
19
|
+
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
taskId: completedTasks[0]?.id ?? null,
|
|
23
|
+
projectId: completedTasks[0]?.projectId ?? null,
|
|
24
|
+
activityType: "task_run",
|
|
25
|
+
runtimeId: "claude-code",
|
|
26
|
+
providerId: "anthropic",
|
|
27
|
+
modelId: "claude-sonnet-4-20250514",
|
|
28
|
+
status: "completed",
|
|
29
|
+
inputTokens: 2_400,
|
|
30
|
+
outputTokens: 1_200,
|
|
31
|
+
totalTokens: 3_600,
|
|
32
|
+
startedAt: new Date(now - 48 * HOUR),
|
|
33
|
+
finishedAt: new Date(now - 48 * HOUR + 120_000),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
taskId: completedTasks[1]?.id ?? null,
|
|
37
|
+
projectId: completedTasks[1]?.projectId ?? null,
|
|
38
|
+
activityType: "task_run",
|
|
39
|
+
runtimeId: "openai-codex-app-server",
|
|
40
|
+
providerId: "openai",
|
|
41
|
+
modelId: "codex-mini-latest",
|
|
42
|
+
status: "completed",
|
|
43
|
+
inputTokens: 1_900,
|
|
44
|
+
outputTokens: 850,
|
|
45
|
+
totalTokens: 2_750,
|
|
46
|
+
startedAt: new Date(now - 30 * HOUR),
|
|
47
|
+
finishedAt: new Date(now - 30 * HOUR + 90_000),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
taskId: failedTask?.id ?? null,
|
|
51
|
+
projectId: failedTask?.projectId ?? null,
|
|
52
|
+
activityType: "task_run",
|
|
53
|
+
runtimeId: "claude-code",
|
|
54
|
+
providerId: "anthropic",
|
|
55
|
+
modelId: "claude-sonnet-4-20250514",
|
|
56
|
+
status: "failed",
|
|
57
|
+
inputTokens: 900,
|
|
58
|
+
outputTokens: 0,
|
|
59
|
+
totalTokens: 900,
|
|
60
|
+
startedAt: new Date(now - 18 * HOUR),
|
|
61
|
+
finishedAt: new Date(now - 18 * HOUR + 45_000),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
taskId: runningTask?.id ?? null,
|
|
65
|
+
projectId: runningTask?.projectId ?? null,
|
|
66
|
+
workflowId: workflow?.id ?? null,
|
|
67
|
+
activityType: "workflow_step",
|
|
68
|
+
runtimeId: "claude-code",
|
|
69
|
+
providerId: "anthropic",
|
|
70
|
+
modelId: "claude-sonnet-4-20250514",
|
|
71
|
+
status: "completed",
|
|
72
|
+
inputTokens: 3_200,
|
|
73
|
+
outputTokens: 1_650,
|
|
74
|
+
totalTokens: 4_850,
|
|
75
|
+
startedAt: new Date(now - 12 * HOUR),
|
|
76
|
+
finishedAt: new Date(now - 12 * HOUR + 150_000),
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
taskId: completedTasks[2]?.id ?? null,
|
|
80
|
+
projectId: completedTasks[2]?.projectId ?? null,
|
|
81
|
+
scheduleId: schedule?.id ?? null,
|
|
82
|
+
activityType: "scheduled_firing",
|
|
83
|
+
runtimeId: "openai-codex-app-server",
|
|
84
|
+
providerId: "openai",
|
|
85
|
+
modelId: "codex-mini-latest",
|
|
86
|
+
status: "completed",
|
|
87
|
+
inputTokens: 2_700,
|
|
88
|
+
outputTokens: 1_100,
|
|
89
|
+
totalTokens: 3_800,
|
|
90
|
+
startedAt: new Date(now - 8 * HOUR),
|
|
91
|
+
finishedAt: new Date(now - 8 * HOUR + 80_000),
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
activityType: "task_assist",
|
|
95
|
+
runtimeId: "claude-code",
|
|
96
|
+
providerId: "anthropic",
|
|
97
|
+
modelId: "claude-sonnet-4-20250514",
|
|
98
|
+
status: "completed",
|
|
99
|
+
inputTokens: 750,
|
|
100
|
+
outputTokens: 320,
|
|
101
|
+
totalTokens: 1_070,
|
|
102
|
+
startedAt: new Date(now - 6 * HOUR),
|
|
103
|
+
finishedAt: new Date(now - 6 * HOUR + 20_000),
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
activityType: "task_assist",
|
|
107
|
+
runtimeId: "openai-codex-app-server",
|
|
108
|
+
providerId: "openai",
|
|
109
|
+
modelId: "codex-mini-latest",
|
|
110
|
+
status: "completed",
|
|
111
|
+
inputTokens: 680,
|
|
112
|
+
outputTokens: 290,
|
|
113
|
+
totalTokens: 970,
|
|
114
|
+
startedAt: new Date(now - 4 * HOUR),
|
|
115
|
+
finishedAt: new Date(now - 4 * HOUR + 20_000),
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
activityType: "profile_test",
|
|
119
|
+
runtimeId: "claude-code",
|
|
120
|
+
providerId: "anthropic",
|
|
121
|
+
modelId: "claude-sonnet-4-20250514",
|
|
122
|
+
status: "completed",
|
|
123
|
+
inputTokens: 1_100,
|
|
124
|
+
outputTokens: 540,
|
|
125
|
+
totalTokens: 1_640,
|
|
126
|
+
startedAt: new Date(now - 2 * HOUR),
|
|
127
|
+
finishedAt: new Date(now - 2 * HOUR + 35_000),
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import type { WorkflowDefinition } from "@/lib/workflows/types";
|
|
2
|
+
|
|
3
|
+
export interface WorkflowSeed {
|
|
4
|
+
id: string;
|
|
5
|
+
projectId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
definition: string;
|
|
8
|
+
status: "draft" | "active" | "paused" | "completed";
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
updatedAt: Date;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createWorkflows(projectIds: string[]): WorkflowSeed[] {
|
|
14
|
+
const now = Date.now();
|
|
15
|
+
const DAY = 86_400_000;
|
|
16
|
+
const [p1, p2, p3, p4, p5] = projectIds;
|
|
17
|
+
|
|
18
|
+
const portfolioRebalance: WorkflowDefinition = {
|
|
19
|
+
pattern: "sequence",
|
|
20
|
+
steps: [
|
|
21
|
+
{
|
|
22
|
+
id: "analyze",
|
|
23
|
+
name: "Analyze current allocation",
|
|
24
|
+
prompt:
|
|
25
|
+
"Read the portfolio holdings CSV and calculate current sector weights, position sizes, and concentration risks. Output a summary table.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "compare",
|
|
29
|
+
name: "Compare to target allocation",
|
|
30
|
+
prompt:
|
|
31
|
+
"Compare current allocation against the target: Tech ≤35%, Healthcare 15-20%, Finance 15-20%, Consumer 10-15%, Energy 5-10%, Cash 5%. Identify overweight and underweight sectors.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "recommend",
|
|
35
|
+
name: "Generate trade recommendations",
|
|
36
|
+
prompt:
|
|
37
|
+
"Based on the allocation gaps, recommend specific trades (buy/sell/trim) to rebalance. Minimize transaction count and tax impact. Output as a trade list.",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const landingPageBuild: WorkflowDefinition = {
|
|
43
|
+
pattern: "checkpoint",
|
|
44
|
+
steps: [
|
|
45
|
+
{
|
|
46
|
+
id: "research",
|
|
47
|
+
name: "Research & competitive analysis",
|
|
48
|
+
prompt:
|
|
49
|
+
"Audit 4 competitor landing pages (Notion, Linear, Vercel, Stripe). Document design patterns, CTAs, messaging, and identify gaps we can exploit.",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "copy",
|
|
53
|
+
name: "Write copy variants",
|
|
54
|
+
prompt:
|
|
55
|
+
"Using competitive insights, write 3 hero headline variants with supporting copy. Follow the design brief brand voice. Include CTA text.",
|
|
56
|
+
requiresApproval: true,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "build",
|
|
60
|
+
name: "Build responsive hero",
|
|
61
|
+
prompt:
|
|
62
|
+
"Implement the approved hero section as a responsive React component using Tailwind CSS. Include animations, responsive breakpoints, and dark mode.",
|
|
63
|
+
requiresApproval: true,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "test",
|
|
67
|
+
name: "Set up A/B test",
|
|
68
|
+
prompt:
|
|
69
|
+
"Configure A/B test infrastructure for the top 2 hero variants. Set up event tracking for CTA clicks, scroll depth, and time on page.",
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const leadGenPipeline: WorkflowDefinition = {
|
|
75
|
+
pattern: "planner-executor",
|
|
76
|
+
steps: [
|
|
77
|
+
{
|
|
78
|
+
id: "plan",
|
|
79
|
+
name: "Plan outreach campaign",
|
|
80
|
+
prompt:
|
|
81
|
+
"Given 15 qualified prospects across 8 companies, create a campaign plan: segment prospects by company size and role, assign email templates, set send schedule (stagger across 2 weeks), and define success metrics.",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "personalize",
|
|
85
|
+
name: "Personalize email sequences",
|
|
86
|
+
prompt:
|
|
87
|
+
"For each prospect, fill in personalization tokens in the assigned template: company name, recent events (from LinkedIn/Crunchbase), team size, similar customer references. Output ready-to-send emails.",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "enrich",
|
|
91
|
+
name: "Enrich with company data",
|
|
92
|
+
prompt:
|
|
93
|
+
"For each prospect company, pull: funding stage, employee count, tech stack (from job postings), recent news. Append to prospect records.",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "schedule",
|
|
97
|
+
name: "Schedule and send",
|
|
98
|
+
prompt:
|
|
99
|
+
"Schedule all personalized emails according to the campaign plan. Send Day 1 emails immediately, queue follow-ups at 3-day and 7-day intervals.",
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const tripPlanning: WorkflowDefinition = {
|
|
105
|
+
pattern: "sequence",
|
|
106
|
+
steps: [
|
|
107
|
+
{
|
|
108
|
+
id: "flights",
|
|
109
|
+
name: "Book flights",
|
|
110
|
+
prompt:
|
|
111
|
+
"Search for round-trip flights SFO→JFK departing March 15 AM, returning March 18 PM. Prefer United (status match). Budget: $700 max. Book Economy Plus with aisle seats.",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: "hotel",
|
|
115
|
+
name: "Reserve hotel",
|
|
116
|
+
prompt:
|
|
117
|
+
"Book hotel in Midtown Manhattan for 3 nights (Mar 15-18). Requirements: walking distance to Javits Center, standard king room, free cancellation. Budget: $300/night max.",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: "itinerary",
|
|
121
|
+
name: "Create itinerary",
|
|
122
|
+
prompt:
|
|
123
|
+
"Build a day-by-day schedule combining: conference sessions, 3 client meetings (Acme Corp 350 5th Ave, DataFlow AI 85 Broad St, ScaleUp HQ 28 W 23rd St), team dinner, and ground transport estimates.",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: "expenses",
|
|
127
|
+
name: "Submit expense pre-approval",
|
|
128
|
+
prompt:
|
|
129
|
+
"Compile all costs (flights, hotel, per diem meals at $75/day, estimated ground transport $200, misc $100) into an expense pre-approval form. Submit for manager approval.",
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const taxPrepWorkflow: WorkflowDefinition = {
|
|
135
|
+
pattern: "checkpoint",
|
|
136
|
+
steps: [
|
|
137
|
+
{
|
|
138
|
+
id: "gather",
|
|
139
|
+
name: "Gather tax documents",
|
|
140
|
+
prompt:
|
|
141
|
+
"Create a checklist of all required 2025 tax documents: W-2s, 1099s (INT, DIV, B, NEC), 1098 mortgage, charitable receipts, estimated tax payment records. Track status of each.",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: "categorize",
|
|
145
|
+
name: "Categorize deductions",
|
|
146
|
+
prompt:
|
|
147
|
+
"Sort all expenses into IRS-recognized categories: home office (simplified vs actual method), professional development, software/tools, charitable donations, health (HSA). Calculate subtotals.",
|
|
148
|
+
requiresApproval: true,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: "calculate",
|
|
152
|
+
name: "Calculate home office deduction",
|
|
153
|
+
prompt:
|
|
154
|
+
"Compare simplified method ($5/sq ft × 150 sq ft = $750) vs actual expense method (pro-rata utilities, internet, depreciation). Recommend the higher-value method with documentation requirements.",
|
|
155
|
+
requiresApproval: true,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: "package",
|
|
159
|
+
name: "Prepare CPA package",
|
|
160
|
+
prompt:
|
|
161
|
+
"Compile all documents, categorized deductions, and calculations into a CPA-ready package. Include summary cover sheet with key numbers: gross income, total deductions, estimated tax liability.",
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
return [
|
|
167
|
+
{
|
|
168
|
+
id: crypto.randomUUID(),
|
|
169
|
+
projectId: p1,
|
|
170
|
+
name: "Portfolio Rebalance Analysis",
|
|
171
|
+
definition: JSON.stringify(portfolioRebalance),
|
|
172
|
+
status: "completed",
|
|
173
|
+
createdAt: new Date(now - 13 * DAY),
|
|
174
|
+
updatedAt: new Date(now - 11 * DAY),
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
id: crypto.randomUUID(),
|
|
178
|
+
projectId: p2,
|
|
179
|
+
name: "Landing Page Build Pipeline",
|
|
180
|
+
definition: JSON.stringify(landingPageBuild),
|
|
181
|
+
status: "active",
|
|
182
|
+
createdAt: new Date(now - 11 * DAY),
|
|
183
|
+
updatedAt: new Date(now - 1 * DAY),
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: crypto.randomUUID(),
|
|
187
|
+
projectId: p3,
|
|
188
|
+
name: "Lead Generation Campaign",
|
|
189
|
+
definition: JSON.stringify(leadGenPipeline),
|
|
190
|
+
status: "paused",
|
|
191
|
+
createdAt: new Date(now - 9 * DAY),
|
|
192
|
+
updatedAt: new Date(now - 6 * DAY),
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: crypto.randomUUID(),
|
|
196
|
+
projectId: p4,
|
|
197
|
+
name: "NYC Trip Logistics",
|
|
198
|
+
definition: JSON.stringify(tripPlanning),
|
|
199
|
+
status: "completed",
|
|
200
|
+
createdAt: new Date(now - 7 * DAY),
|
|
201
|
+
updatedAt: new Date(now - 3 * DAY),
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: crypto.randomUUID(),
|
|
205
|
+
projectId: p5,
|
|
206
|
+
name: "Tax Filing Workflow",
|
|
207
|
+
definition: JSON.stringify(taxPrepWorkflow),
|
|
208
|
+
status: "active",
|
|
209
|
+
createdAt: new Date(now - 5 * DAY),
|
|
210
|
+
updatedAt: new Date(now - 1 * DAY),
|
|
211
|
+
},
|
|
212
|
+
];
|
|
213
|
+
}
|