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.
- package/README.md +21 -2
- package/dist/cli.js +272 -1
- package/docs/.coverage-gaps.json +66 -16
- package/docs/.last-generated +1 -1
- package/docs/features/dashboard-kanban.md +13 -7
- package/docs/features/settings.md +15 -3
- package/docs/features/tables.md +122 -0
- package/docs/index.md +3 -2
- package/docs/journeys/developer.md +26 -16
- package/docs/journeys/personal-use.md +23 -9
- package/docs/journeys/power-user.md +40 -14
- package/docs/journeys/work-use.md +43 -15
- package/docs/manifest.json +27 -17
- package/package.json +3 -2
- package/src/app/api/chat/entities/search/route.ts +12 -3
- package/src/app/api/documents/[id]/route.ts +5 -1
- package/src/app/api/documents/[id]/versions/route.ts +53 -0
- package/src/app/api/documents/route.ts +5 -1
- package/src/app/api/projects/[id]/documents/route.ts +124 -0
- package/src/app/api/projects/[id]/route.ts +72 -3
- package/src/app/api/projects/__tests__/delete-project.test.ts +13 -0
- package/src/app/api/schedules/route.ts +19 -1
- package/src/app/api/snapshots/[id]/restore/route.ts +62 -0
- package/src/app/api/snapshots/[id]/route.ts +44 -0
- package/src/app/api/snapshots/route.ts +54 -0
- package/src/app/api/snapshots/settings/route.ts +67 -0
- package/src/app/api/tables/[id]/charts/[chartId]/route.ts +89 -0
- package/src/app/api/tables/[id]/charts/route.ts +72 -0
- package/src/app/api/tables/[id]/columns/route.ts +70 -0
- package/src/app/api/tables/[id]/export/route.ts +94 -0
- package/src/app/api/tables/[id]/history/route.ts +15 -0
- package/src/app/api/tables/[id]/import/route.ts +111 -0
- package/src/app/api/tables/[id]/route.ts +86 -0
- package/src/app/api/tables/[id]/rows/[rowId]/history/route.ts +32 -0
- package/src/app/api/tables/[id]/rows/[rowId]/route.ts +51 -0
- package/src/app/api/tables/[id]/rows/route.ts +101 -0
- package/src/app/api/tables/[id]/triggers/[triggerId]/route.ts +65 -0
- package/src/app/api/tables/[id]/triggers/route.ts +122 -0
- package/src/app/api/tables/route.ts +65 -0
- package/src/app/api/tables/templates/route.ts +92 -0
- package/src/app/api/tasks/[id]/route.ts +37 -2
- package/src/app/api/tasks/[id]/siblings/route.ts +48 -0
- package/src/app/api/tasks/route.ts +8 -9
- package/src/app/api/workflows/[id]/documents/route.ts +209 -0
- package/src/app/api/workflows/[id]/execute/route.ts +6 -2
- package/src/app/api/workflows/[id]/route.ts +16 -3
- package/src/app/api/workflows/[id]/status/route.ts +18 -2
- package/src/app/api/workflows/route.ts +13 -2
- package/src/app/documents/page.tsx +5 -1
- package/src/app/layout.tsx +0 -1
- package/src/app/manifest.ts +3 -3
- package/src/app/projects/[id]/page.tsx +62 -2
- package/src/app/settings/page.tsx +2 -0
- package/src/app/tables/[id]/page.tsx +67 -0
- package/src/app/tables/page.tsx +21 -0
- package/src/app/tables/templates/page.tsx +19 -0
- package/src/components/chat/chat-table-result.tsx +139 -0
- package/src/components/documents/document-browser.tsx +1 -1
- package/src/components/documents/document-chip-bar.tsx +17 -1
- package/src/components/documents/document-detail-view.tsx +51 -0
- package/src/components/documents/document-grid.tsx +5 -0
- package/src/components/documents/document-table.tsx +4 -0
- package/src/components/documents/types.ts +3 -0
- package/src/components/projects/project-form-sheet.tsx +109 -2
- package/src/components/schedules/schedule-form.tsx +91 -1
- package/src/components/settings/data-management-section.tsx +17 -12
- package/src/components/settings/database-snapshots-section.tsx +469 -0
- package/src/components/shared/app-sidebar.tsx +2 -0
- package/src/components/shared/document-picker-sheet.tsx +486 -0
- package/src/components/tables/table-browser.tsx +234 -0
- package/src/components/tables/table-cell-editor.tsx +226 -0
- package/src/components/tables/table-chart-builder.tsx +288 -0
- package/src/components/tables/table-chart-view.tsx +146 -0
- package/src/components/tables/table-column-header.tsx +103 -0
- package/src/components/tables/table-column-sheet.tsx +331 -0
- package/src/components/tables/table-create-sheet.tsx +240 -0
- package/src/components/tables/table-detail-sheet.tsx +144 -0
- package/src/components/tables/table-detail-tabs.tsx +278 -0
- package/src/components/tables/table-grid.tsx +61 -0
- package/src/components/tables/table-history-tab.tsx +148 -0
- package/src/components/tables/table-import-wizard.tsx +542 -0
- package/src/components/tables/table-list-table.tsx +95 -0
- package/src/components/tables/table-relation-combobox.tsx +217 -0
- package/src/components/tables/table-spreadsheet.tsx +499 -0
- package/src/components/tables/table-template-gallery.tsx +162 -0
- package/src/components/tables/table-template-preview.tsx +219 -0
- package/src/components/tables/table-toolbar.tsx +79 -0
- package/src/components/tables/table-triggers-tab.tsx +446 -0
- package/src/components/tables/types.ts +6 -0
- package/src/components/tables/use-spreadsheet-keys.ts +171 -0
- package/src/components/tables/utils.ts +29 -0
- package/src/components/tasks/task-card.tsx +8 -1
- package/src/components/tasks/task-create-panel.tsx +111 -14
- package/src/components/tasks/task-detail-view.tsx +47 -0
- package/src/components/tasks/task-edit-dialog.tsx +103 -2
- package/src/components/workflows/workflow-form-view.tsx +207 -7
- package/src/components/workflows/workflow-kanban-card.tsx +8 -1
- package/src/components/workflows/workflow-list.tsx +90 -45
- package/src/components/workflows/workflow-status-view.tsx +168 -23
- package/src/instrumentation.ts +3 -0
- package/src/lib/__tests__/npx-process-cwd.test.ts +17 -2
- package/src/lib/agents/__tests__/claude-agent.test.ts +5 -1
- package/src/lib/agents/claude-agent.ts +3 -1
- package/src/lib/agents/profiles/registry.ts +6 -3
- package/src/lib/agents/runtime/anthropic-direct.ts +29 -0
- package/src/lib/agents/runtime/openai-direct.ts +29 -0
- package/src/lib/book/__tests__/chapter-slugs.test.ts +80 -0
- package/src/lib/book/chapter-generator.ts +4 -19
- package/src/lib/book/chapter-mapping.ts +17 -0
- package/src/lib/book/content.ts +5 -16
- package/src/lib/book/update-detector.ts +3 -16
- package/src/lib/chat/engine.ts +1 -0
- package/src/lib/chat/stagent-tools.ts +2 -0
- package/src/lib/chat/system-prompt.ts +9 -1
- package/src/lib/chat/tool-catalog.ts +35 -0
- package/src/lib/chat/tools/settings-tools.ts +109 -0
- package/src/lib/chat/tools/table-tools.ts +955 -0
- package/src/lib/chat/tools/workflow-tools.ts +145 -2
- package/src/lib/constants/table-status.ts +68 -0
- package/src/lib/data/__tests__/clear.test.ts +1 -1
- package/src/lib/data/clear.ts +57 -0
- package/src/lib/data/seed-data/__tests__/profiles.test.ts +28 -23
- package/src/lib/data/seed-data/conversations.ts +350 -42
- package/src/lib/data/seed-data/documents.ts +564 -591
- package/src/lib/data/seed-data/learned-context.ts +101 -22
- package/src/lib/data/seed-data/notifications.ts +344 -70
- package/src/lib/data/seed-data/profile-test-results.ts +92 -11
- package/src/lib/data/seed-data/profiles.ts +144 -46
- package/src/lib/data/seed-data/projects.ts +50 -18
- package/src/lib/data/seed-data/repo-imports.ts +28 -13
- package/src/lib/data/seed-data/schedules.ts +208 -41
- package/src/lib/data/seed-data/table-templates.ts +234 -0
- package/src/lib/data/seed-data/tasks.ts +614 -116
- package/src/lib/data/seed-data/usage-ledger.ts +182 -103
- package/src/lib/data/seed-data/user-tables.ts +203 -0
- package/src/lib/data/seed-data/views.ts +52 -7
- package/src/lib/data/seed-data/workflows.ts +231 -84
- package/src/lib/data/seed.ts +55 -14
- package/src/lib/data/tables.ts +417 -0
- package/src/lib/db/bootstrap.ts +275 -0
- package/src/lib/db/index.ts +9 -0
- package/src/lib/db/migrations/0016_add_workflow_document_inputs.sql +13 -0
- package/src/lib/db/migrations/0017_add_document_picker_tables.sql +25 -0
- package/src/lib/db/migrations/0018_add_workflow_run_number.sql +2 -0
- package/src/lib/db/migrations/0019_add_tables_feature.sql +160 -0
- package/src/lib/db/migrations/0020_add_table_triggers.sql +19 -0
- package/src/lib/db/migrations/0021_add_row_history.sql +15 -0
- package/src/lib/db/schema.ts +445 -0
- package/src/lib/docs/reader.ts +2 -3
- package/src/lib/documents/context-builder.ts +75 -2
- package/src/lib/documents/document-resolver.ts +119 -0
- package/src/lib/documents/processors/spreadsheet.ts +2 -1
- package/src/lib/schedules/scheduler.ts +31 -1
- package/src/lib/snapshots/auto-backup.ts +132 -0
- package/src/lib/snapshots/retention.ts +64 -0
- package/src/lib/snapshots/snapshot-manager.ts +429 -0
- package/src/lib/tables/computed.ts +61 -0
- package/src/lib/tables/context-builder.ts +139 -0
- package/src/lib/tables/formula-engine.ts +415 -0
- package/src/lib/tables/history.ts +115 -0
- package/src/lib/tables/import.ts +343 -0
- package/src/lib/tables/query-builder.ts +152 -0
- package/src/lib/tables/trigger-evaluator.ts +146 -0
- package/src/lib/tables/types.ts +141 -0
- package/src/lib/tables/validation.ts +119 -0
- package/src/lib/utils/app-root.ts +20 -0
- package/src/lib/utils/stagent-paths.ts +20 -0
- package/src/lib/validators/__tests__/task.test.ts +43 -10
- package/src/lib/validators/task.ts +7 -1
- package/src/lib/workflows/blueprints/registry.ts +3 -3
- package/src/lib/workflows/engine.ts +24 -8
- package/src/lib/workflows/types.ts +14 -0
- package/tsconfig.json +3 -1
- package/public/icon.svg +0 -13
- package/src/components/tasks/file-upload.tsx +0 -120
- /package/docs/features/{playbook.md → user-guide.md} +0 -0
|
@@ -3,128 +3,207 @@ import type { TaskSeed } from "./tasks";
|
|
|
3
3
|
import type { WorkflowSeed } from "./workflows";
|
|
4
4
|
import type { UsageLedgerWriteInput } from "@/lib/usage/ledger";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Generate 45 usage ledger entries spread over 21 days with 3 runtimes.
|
|
8
|
+
* This produces rich data for the Cost & Usage dashboard charts.
|
|
9
|
+
*/
|
|
6
10
|
export function createUsageLedgerSeeds(input: {
|
|
7
11
|
tasks: TaskSeed[];
|
|
8
12
|
workflows: WorkflowSeed[];
|
|
9
13
|
schedules: ScheduleSeed[];
|
|
10
14
|
}): UsageLedgerWriteInput[] {
|
|
11
|
-
const completedTasks = input.tasks.filter((
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const [workflow] = input.workflows;
|
|
15
|
-
const [schedule] = input.schedules;
|
|
15
|
+
const completedTasks = input.tasks.filter((t) => t.status === "completed");
|
|
16
|
+
const runningTasks = input.tasks.filter((t) => t.status === "running");
|
|
17
|
+
const failedTasks = input.tasks.filter((t) => t.status === "failed");
|
|
16
18
|
|
|
17
19
|
const now = Date.now();
|
|
18
20
|
const HOUR = 3_600_000;
|
|
21
|
+
const DAY = 86_400_000;
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
// Runtimes
|
|
24
|
+
const claude = { runtimeId: "claude-agent-sdk", providerId: "anthropic", modelId: "claude-sonnet-4-5-20250514" };
|
|
25
|
+
const codex = { runtimeId: "openai-codex-app-server", providerId: "openai", modelId: "codex-mini-latest" };
|
|
26
|
+
const ollama = { runtimeId: "ollama", providerId: "local", modelId: "llama-3.1-8b" };
|
|
27
|
+
|
|
28
|
+
const seeds: UsageLedgerWriteInput[] = [];
|
|
29
|
+
|
|
30
|
+
// ── task_run entries (15) — spread across 21 days ─────────────────
|
|
31
|
+
completedTasks.slice(0, 10).forEach((task, i) => {
|
|
32
|
+
const daysAgo = 20 - i * 2;
|
|
33
|
+
const runtime = i % 3 === 0 ? codex : i % 3 === 1 ? ollama : claude;
|
|
34
|
+
seeds.push({
|
|
35
|
+
taskId: task.id,
|
|
36
|
+
projectId: task.projectId,
|
|
24
37
|
activityType: "task_run",
|
|
25
|
-
|
|
26
|
-
providerId: "anthropic",
|
|
27
|
-
modelId: "claude-sonnet-4-20250514",
|
|
38
|
+
...runtime,
|
|
28
39
|
status: "completed",
|
|
29
|
-
inputTokens:
|
|
30
|
-
outputTokens:
|
|
31
|
-
totalTokens:
|
|
32
|
-
startedAt: new Date(now -
|
|
33
|
-
finishedAt: new Date(now -
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
inputTokens: 1800 + i * 400,
|
|
41
|
+
outputTokens: 800 + i * 200,
|
|
42
|
+
totalTokens: 2600 + i * 600,
|
|
43
|
+
startedAt: new Date(now - daysAgo * DAY),
|
|
44
|
+
finishedAt: new Date(now - daysAgo * DAY + 90_000 + i * 15_000),
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Running tasks — in progress
|
|
49
|
+
runningTasks.slice(0, 3).forEach((task, i) => {
|
|
50
|
+
seeds.push({
|
|
51
|
+
taskId: task.id,
|
|
52
|
+
projectId: task.projectId,
|
|
38
53
|
activityType: "task_run",
|
|
39
|
-
|
|
40
|
-
providerId: "openai",
|
|
41
|
-
modelId: "codex-mini-latest",
|
|
54
|
+
...claude,
|
|
42
55
|
status: "completed",
|
|
43
|
-
inputTokens:
|
|
44
|
-
outputTokens:
|
|
45
|
-
totalTokens:
|
|
46
|
-
startedAt: new Date(now -
|
|
47
|
-
finishedAt: new Date(now -
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
56
|
+
inputTokens: 2200 + i * 300,
|
|
57
|
+
outputTokens: 900 + i * 150,
|
|
58
|
+
totalTokens: 3100 + i * 450,
|
|
59
|
+
startedAt: new Date(now - (4 + i) * HOUR),
|
|
60
|
+
finishedAt: new Date(now - (4 + i) * HOUR + 120_000),
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Failed tasks
|
|
65
|
+
failedTasks.forEach((task, i) => {
|
|
66
|
+
seeds.push({
|
|
67
|
+
taskId: task.id,
|
|
68
|
+
projectId: task.projectId,
|
|
52
69
|
activityType: "task_run",
|
|
53
|
-
|
|
54
|
-
providerId: "anthropic",
|
|
55
|
-
modelId: "claude-sonnet-4-20250514",
|
|
70
|
+
...(i === 0 ? claude : codex),
|
|
56
71
|
status: "failed",
|
|
57
|
-
inputTokens:
|
|
72
|
+
inputTokens: 600 + i * 200,
|
|
58
73
|
outputTokens: 0,
|
|
59
|
-
totalTokens:
|
|
60
|
-
startedAt: new Date(now -
|
|
61
|
-
finishedAt: new Date(now -
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
74
|
+
totalTokens: 600 + i * 200,
|
|
75
|
+
startedAt: new Date(now - (7 - i) * DAY),
|
|
76
|
+
finishedAt: new Date(now - (7 - i) * DAY + 30_000),
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// ── workflow_step entries (8) ─────────────────────────────────────
|
|
81
|
+
input.workflows.slice(0, 4).forEach((wf, i) => {
|
|
82
|
+
const stepsPerWorkflow = 2;
|
|
83
|
+
for (let s = 0; s < stepsPerWorkflow; s++) {
|
|
84
|
+
const daysAgo = 18 - i * 3 - s;
|
|
85
|
+
const runtime = i % 2 === 0 ? claude : codex;
|
|
86
|
+
seeds.push({
|
|
87
|
+
workflowId: wf.id,
|
|
88
|
+
projectId: wf.projectId,
|
|
89
|
+
activityType: "workflow_step",
|
|
90
|
+
...runtime,
|
|
91
|
+
status: "completed",
|
|
92
|
+
inputTokens: 2800 + s * 500,
|
|
93
|
+
outputTokens: 1400 + s * 250,
|
|
94
|
+
totalTokens: 4200 + s * 750,
|
|
95
|
+
startedAt: new Date(now - daysAgo * DAY),
|
|
96
|
+
finishedAt: new Date(now - daysAgo * DAY + 140_000),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// ── scheduled_firing entries (6) ──────────────────────────────────
|
|
102
|
+
input.schedules.filter((s) => s.firingCount > 0).slice(0, 3).forEach((sched, i) => {
|
|
103
|
+
for (let f = 0; f < 2; f++) {
|
|
104
|
+
const daysAgo = 14 - i * 4 - f * 2;
|
|
105
|
+
const runtime = sched.type === "heartbeat" ? ollama : claude;
|
|
106
|
+
seeds.push({
|
|
107
|
+
scheduleId: sched.id,
|
|
108
|
+
projectId: sched.projectId,
|
|
109
|
+
activityType: "scheduled_firing",
|
|
110
|
+
...runtime,
|
|
111
|
+
status: "completed",
|
|
112
|
+
inputTokens: 1200 + f * 300,
|
|
113
|
+
outputTokens: 500 + f * 150,
|
|
114
|
+
totalTokens: 1700 + f * 450,
|
|
115
|
+
startedAt: new Date(now - daysAgo * DAY),
|
|
116
|
+
finishedAt: new Date(now - daysAgo * DAY + 60_000),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
// ── task_assist entries (5) ───────────────────────────────────────
|
|
122
|
+
for (let i = 0; i < 5; i++) {
|
|
123
|
+
const daysAgo = 15 - i * 3;
|
|
124
|
+
const runtime = i % 3 === 0 ? claude : i % 3 === 1 ? codex : ollama;
|
|
125
|
+
seeds.push({
|
|
94
126
|
activityType: "task_assist",
|
|
95
|
-
|
|
96
|
-
providerId: "anthropic",
|
|
97
|
-
modelId: "claude-sonnet-4-20250514",
|
|
127
|
+
...runtime,
|
|
98
128
|
status: "completed",
|
|
99
|
-
inputTokens:
|
|
100
|
-
outputTokens:
|
|
101
|
-
totalTokens:
|
|
102
|
-
startedAt: new Date(now -
|
|
103
|
-
finishedAt: new Date(now -
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
129
|
+
inputTokens: 500 + i * 100,
|
|
130
|
+
outputTokens: 200 + i * 60,
|
|
131
|
+
totalTokens: 700 + i * 160,
|
|
132
|
+
startedAt: new Date(now - daysAgo * DAY),
|
|
133
|
+
finishedAt: new Date(now - daysAgo * DAY + 15_000),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// ── chat_turn entries (4) ─────────────────────────────────────────
|
|
138
|
+
for (let i = 0; i < 4; i++) {
|
|
139
|
+
const hoursAgo = 8 + i * 12;
|
|
140
|
+
const runtime = i % 2 === 0 ? claude : ollama;
|
|
141
|
+
seeds.push({
|
|
142
|
+
activityType: "chat_turn",
|
|
143
|
+
...runtime,
|
|
110
144
|
status: "completed",
|
|
111
|
-
inputTokens:
|
|
112
|
-
outputTokens:
|
|
113
|
-
totalTokens:
|
|
114
|
-
startedAt: new Date(now -
|
|
115
|
-
finishedAt: new Date(now -
|
|
116
|
-
}
|
|
117
|
-
|
|
145
|
+
inputTokens: 800 + i * 200,
|
|
146
|
+
outputTokens: 400 + i * 100,
|
|
147
|
+
totalTokens: 1200 + i * 300,
|
|
148
|
+
startedAt: new Date(now - hoursAgo * HOUR),
|
|
149
|
+
finishedAt: new Date(now - hoursAgo * HOUR + 8_000),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// ── profile_test entries (3) ──────────────────────────────────────
|
|
154
|
+
for (let i = 0; i < 3; i++) {
|
|
155
|
+
const daysAgo = 10 - i * 4;
|
|
156
|
+
seeds.push({
|
|
118
157
|
activityType: "profile_test",
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
158
|
+
...claude,
|
|
159
|
+
status: "completed",
|
|
160
|
+
inputTokens: 1000 + i * 200,
|
|
161
|
+
outputTokens: 500 + i * 100,
|
|
162
|
+
totalTokens: 1500 + i * 300,
|
|
163
|
+
startedAt: new Date(now - daysAgo * DAY),
|
|
164
|
+
finishedAt: new Date(now - daysAgo * DAY + 30_000),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// ── task_resume entries (2) ───────────────────────────────────────
|
|
169
|
+
runningTasks.slice(0, 2).forEach((task, i) => {
|
|
170
|
+
seeds.push({
|
|
171
|
+
taskId: task.id,
|
|
172
|
+
projectId: task.projectId,
|
|
173
|
+
activityType: "task_resume",
|
|
174
|
+
...claude,
|
|
122
175
|
status: "completed",
|
|
123
|
-
inputTokens:
|
|
124
|
-
outputTokens:
|
|
125
|
-
totalTokens:
|
|
126
|
-
startedAt: new Date(now - 2 * HOUR),
|
|
127
|
-
finishedAt: new Date(now - 2 * HOUR +
|
|
128
|
-
}
|
|
129
|
-
|
|
176
|
+
inputTokens: 3000 + i * 500,
|
|
177
|
+
outputTokens: 1500 + i * 200,
|
|
178
|
+
totalTokens: 4500 + i * 700,
|
|
179
|
+
startedAt: new Date(now - (2 + i) * HOUR),
|
|
180
|
+
finishedAt: new Date(now - (2 + i) * HOUR + 100_000),
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// ── pattern_extraction (1) ────────────────────────────────────────
|
|
185
|
+
seeds.push({
|
|
186
|
+
activityType: "pattern_extraction",
|
|
187
|
+
...claude,
|
|
188
|
+
status: "completed",
|
|
189
|
+
inputTokens: 1800,
|
|
190
|
+
outputTokens: 600,
|
|
191
|
+
totalTokens: 2400,
|
|
192
|
+
startedAt: new Date(now - 5 * DAY),
|
|
193
|
+
finishedAt: new Date(now - 5 * DAY + 25_000),
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
// ── context_summarization (1) ─────────────────────────────────────
|
|
197
|
+
seeds.push({
|
|
198
|
+
activityType: "context_summarization",
|
|
199
|
+
...ollama,
|
|
200
|
+
status: "completed",
|
|
201
|
+
inputTokens: 2200,
|
|
202
|
+
outputTokens: 400,
|
|
203
|
+
totalTokens: 2600,
|
|
204
|
+
startedAt: new Date(now - 3 * DAY),
|
|
205
|
+
finishedAt: new Date(now - 3 * DAY + 18_000),
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
return seeds;
|
|
130
209
|
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seed realistic user-created tables with columns and rows.
|
|
3
|
+
* These showcase the Tables feature with business data tied to seed projects.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface UserTableSeed {
|
|
7
|
+
id: string;
|
|
8
|
+
projectId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
source: "manual" | "agent" | "template";
|
|
12
|
+
columns: UserTableColumnSeed[];
|
|
13
|
+
rows: Record<string, unknown>[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface UserTableColumnSeed {
|
|
17
|
+
name: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
dataType: "text" | "number" | "date" | "boolean" | "select" | "url" | "email" | "computed";
|
|
20
|
+
required?: boolean;
|
|
21
|
+
config?: Record<string, unknown> | null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function createUserTables(projectIds: string[]): UserTableSeed[] {
|
|
25
|
+
const [p1, p2, p3, p4, p5, _p6, p7] = projectIds;
|
|
26
|
+
|
|
27
|
+
return [
|
|
28
|
+
// ── P1: Launch Campaign Tracker ─────────────────────────────────
|
|
29
|
+
{
|
|
30
|
+
id: crypto.randomUUID(),
|
|
31
|
+
projectId: p1,
|
|
32
|
+
name: "Launch Campaign Tracker",
|
|
33
|
+
description: "Track launch channels, status, and performance metrics for the AI Copilot v2 launch",
|
|
34
|
+
source: "manual",
|
|
35
|
+
columns: [
|
|
36
|
+
{ name: "channel", displayName: "Channel", dataType: "text", required: true },
|
|
37
|
+
{ name: "status", displayName: "Status", dataType: "select", config: { options: ["Planned", "In Progress", "Live", "Completed", "Paused"] } },
|
|
38
|
+
{ name: "owner", displayName: "Owner", dataType: "text" },
|
|
39
|
+
{ name: "launch_date", displayName: "Launch Date", dataType: "date" },
|
|
40
|
+
{ name: "impressions", displayName: "Impressions", dataType: "number" },
|
|
41
|
+
{ name: "signups", displayName: "Signups", dataType: "number" },
|
|
42
|
+
{ name: "conversion_rate", displayName: "Conv. Rate", dataType: "computed", config: { formula: "IF(impressions > 0, ROUND(signups / impressions * 100, 1), 0)", suffix: "%" } },
|
|
43
|
+
{ name: "notes", displayName: "Notes", dataType: "text" },
|
|
44
|
+
],
|
|
45
|
+
rows: [
|
|
46
|
+
{ channel: "Product Hunt", status: "Completed", owner: "GTM Agent", launch_date: "2026-03-25", impressions: 12400, signups: 342, notes: "Featured #3 of the day" },
|
|
47
|
+
{ channel: "LinkedIn Series", status: "Live", owner: "Content Agent", launch_date: "2026-03-28", impressions: 8200, signups: 89, notes: "5-post series, MWF cadence" },
|
|
48
|
+
{ channel: "Email Sequence", status: "Live", owner: "GTM Agent", launch_date: "2026-03-25", impressions: 4500, signups: 198, notes: "3-touch: announce, deep-dive, case study" },
|
|
49
|
+
{ channel: "Twitter Launch Thread", status: "Completed", owner: "GTM Agent", launch_date: "2026-03-25", impressions: 18900, signups: 124, notes: "8-tweet thread, product screenshots" },
|
|
50
|
+
{ channel: "Blog Post", status: "Live", owner: "Content Agent", launch_date: "2026-03-28", impressions: 2100, signups: 45, notes: "AI Agent Orchestration Guide — pillar page" },
|
|
51
|
+
{ channel: "Hacker News", status: "Planned", owner: "Founder", launch_date: "2026-04-08", impressions: 0, signups: 0, notes: "Show HN submission, timing TBD" },
|
|
52
|
+
{ channel: "Dev.to Cross-post", status: "In Progress", owner: "Content Agent", launch_date: "2026-04-04", impressions: 0, signups: 0, notes: "Cross-post 3 days after blog publish" },
|
|
53
|
+
{ channel: "Retargeting Ads", status: "Planned", owner: "GTM Agent", launch_date: "2026-04-10", impressions: 0, signups: 0, notes: "Meta + Google, $500 budget" },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
// ── P2: Editorial Calendar ──────────────────────────────────────
|
|
58
|
+
{
|
|
59
|
+
id: crypto.randomUUID(),
|
|
60
|
+
projectId: p2,
|
|
61
|
+
name: "Content Pipeline",
|
|
62
|
+
description: "Track articles from ideation through publication with SEO metrics and distribution status",
|
|
63
|
+
source: "agent",
|
|
64
|
+
columns: [
|
|
65
|
+
{ name: "title", displayName: "Title", dataType: "text", required: true },
|
|
66
|
+
{ name: "keyword", displayName: "Primary Keyword", dataType: "text" },
|
|
67
|
+
{ name: "status", displayName: "Status", dataType: "select", config: { options: ["Idea", "Outlined", "Drafting", "Editing", "Published", "Distributed"] } },
|
|
68
|
+
{ name: "word_count", displayName: "Words", dataType: "number" },
|
|
69
|
+
{ name: "publish_date", displayName: "Publish Date", dataType: "date" },
|
|
70
|
+
{ name: "organic_sessions", displayName: "Organic Sessions", dataType: "number" },
|
|
71
|
+
{ name: "backlinks", displayName: "Backlinks", dataType: "number" },
|
|
72
|
+
{ name: "serp_position", displayName: "SERP Position", dataType: "number" },
|
|
73
|
+
],
|
|
74
|
+
rows: [
|
|
75
|
+
{ title: "AI Agent Orchestration Guide", keyword: "AI agent orchestration", status: "Published", word_count: 1920, publish_date: "2026-03-28", organic_sessions: 342, backlinks: 2, serp_position: 14 },
|
|
76
|
+
{ title: "Multi-Agent Workflows Explained", keyword: "multi-agent framework", status: "Drafting", word_count: 800, publish_date: "2026-04-04", organic_sessions: 0, backlinks: 0, serp_position: 0 },
|
|
77
|
+
{ title: "Governance for Agentic AI", keyword: "agent governance AI", status: "Outlined", word_count: 0, publish_date: "2026-04-11", organic_sessions: 0, backlinks: 0, serp_position: 0 },
|
|
78
|
+
{ title: "AI Ops for Solo Founders", keyword: "AI operations platform", status: "Idea", word_count: 0, publish_date: "2026-04-18", organic_sessions: 0, backlinks: 0, serp_position: 0 },
|
|
79
|
+
{ title: "Heartbeat Scheduling Deep Dive", keyword: "heartbeat monitoring AI", status: "Idea", word_count: 0, publish_date: "2026-04-25", organic_sessions: 0, backlinks: 0, serp_position: 0 },
|
|
80
|
+
{ title: "Multi-Runtime Architecture", keyword: "multi-runtime AI", status: "Idea", word_count: 0, publish_date: "2026-05-02", organic_sessions: 0, backlinks: 0, serp_position: 0 },
|
|
81
|
+
{ title: "AI Agent Tools Roundup 2026", keyword: "agentic AI tools", status: "Idea", word_count: 0, publish_date: "2026-05-09", organic_sessions: 0, backlinks: 0, serp_position: 0 },
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
// ── P3: Customer Health Tracker ─────────────────────────────────
|
|
86
|
+
{
|
|
87
|
+
id: crypto.randomUUID(),
|
|
88
|
+
projectId: p3,
|
|
89
|
+
name: "Customer Health Scores",
|
|
90
|
+
description: "Account-level health monitoring with NPS, usage, and churn risk signals",
|
|
91
|
+
source: "agent",
|
|
92
|
+
columns: [
|
|
93
|
+
{ name: "account", displayName: "Account", dataType: "text", required: true },
|
|
94
|
+
{ name: "plan", displayName: "Plan", dataType: "select", config: { options: ["Community", "Pro", "Team"] } },
|
|
95
|
+
{ name: "mrr", displayName: "MRR ($)", dataType: "number" },
|
|
96
|
+
{ name: "nps", displayName: "NPS", dataType: "number" },
|
|
97
|
+
{ name: "health", displayName: "Health", dataType: "select", config: { options: ["Green", "Yellow", "Red"] } },
|
|
98
|
+
{ name: "last_login", displayName: "Last Login", dataType: "date" },
|
|
99
|
+
{ name: "open_tickets", displayName: "Open Tickets", dataType: "number" },
|
|
100
|
+
{ name: "csm", displayName: "CSM Owner", dataType: "text" },
|
|
101
|
+
{ name: "intervention", displayName: "Intervention", dataType: "text" },
|
|
102
|
+
],
|
|
103
|
+
rows: [
|
|
104
|
+
{ account: "Acme Corp", plan: "Team", mrr: 499, nps: 72, health: "Green", last_login: "2026-04-02", open_tickets: 1, csm: "Sarah", intervention: "" },
|
|
105
|
+
{ account: "DataFlow AI", plan: "Pro", mrr: 149, nps: 45, health: "Yellow", last_login: "2026-03-28", open_tickets: 3, csm: "Mike", intervention: "Send check-in email" },
|
|
106
|
+
{ account: "ScaleUp HQ", plan: "Team", mrr: 499, nps: 81, health: "Green", last_login: "2026-04-01", open_tickets: 0, csm: "Sarah", intervention: "" },
|
|
107
|
+
{ account: "BrightPath", plan: "Pro", mrr: 149, nps: 28, health: "Red", last_login: "2026-03-15", open_tickets: 5, csm: "Jordan", intervention: "Schedule CSM call — offer training" },
|
|
108
|
+
{ account: "CloudBase", plan: "Pro", mrr: 149, nps: 65, health: "Green", last_login: "2026-04-01", open_tickets: 2, csm: "Mike", intervention: "" },
|
|
109
|
+
{ account: "NexaPay", plan: "Team", mrr: 499, nps: 38, health: "Yellow", last_login: "2026-03-20", open_tickets: 4, csm: "Jordan", intervention: "Feature walkthrough — workflows" },
|
|
110
|
+
{ account: "QuickShip", plan: "Pro", mrr: 149, nps: 55, health: "Green", last_login: "2026-03-30", open_tickets: 1, csm: "Sarah", intervention: "" },
|
|
111
|
+
{ account: "TechStart", plan: "Community", mrr: 0, nps: 22, health: "Red", last_login: "2026-02-28", open_tickets: 6, csm: "Jordan", intervention: "Executive outreach — likely churned" },
|
|
112
|
+
{ account: "GreenGrid", plan: "Pro", mrr: 149, nps: 70, health: "Green", last_login: "2026-04-02", open_tickets: 0, csm: "Mike", intervention: "" },
|
|
113
|
+
{ account: "Meridian Corp", plan: "Team", mrr: 499, nps: 42, health: "Yellow", last_login: "2026-03-25", open_tickets: 3, csm: "Sarah", intervention: "Proactive NPS follow-up" },
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
// ── P4: Portfolio KPI Dashboard ─────────────────────────────────
|
|
118
|
+
{
|
|
119
|
+
id: crypto.randomUUID(),
|
|
120
|
+
projectId: p4,
|
|
121
|
+
name: "Portfolio Company KPIs",
|
|
122
|
+
description: "Quarterly KPI tracking across all 4 portfolio companies for board reporting",
|
|
123
|
+
source: "agent",
|
|
124
|
+
columns: [
|
|
125
|
+
{ name: "company", displayName: "Company", dataType: "text", required: true },
|
|
126
|
+
{ name: "arr", displayName: "ARR ($M)", dataType: "number" },
|
|
127
|
+
{ name: "arr_growth", displayName: "ARR Growth (%)", dataType: "number" },
|
|
128
|
+
{ name: "gross_margin", displayName: "Gross Margin (%)", dataType: "number" },
|
|
129
|
+
{ name: "nrr", displayName: "Net Retention (%)", dataType: "number" },
|
|
130
|
+
{ name: "burn_rate", displayName: "Burn ($K/mo)", dataType: "number" },
|
|
131
|
+
{ name: "runway_months", displayName: "Runway (mo)", dataType: "number" },
|
|
132
|
+
{ name: "status", displayName: "Status", dataType: "select", config: { options: ["On Track", "Watch", "At Risk", "Outperforming"] } },
|
|
133
|
+
{ name: "next_action", displayName: "Next Action", dataType: "text" },
|
|
134
|
+
],
|
|
135
|
+
rows: [
|
|
136
|
+
{ company: "HealthSync", arr: 8.2, arr_growth: 42, gross_margin: 78, nrr: 118, burn_rate: 380, runway_months: 14, status: "On Track", next_action: "Close investment at $45M" },
|
|
137
|
+
{ company: "NovaPay", arr: 12.1, arr_growth: 35, gross_margin: 72, nrr: 112, burn_rate: 520, runway_months: 11, status: "Watch", next_action: "CFO search — burn rate concern" },
|
|
138
|
+
{ company: "DataBridge", arr: 5.4, arr_growth: 48, gross_margin: 68, nrr: 125, burn_rate: 290, runway_months: 18, status: "Outperforming", next_action: "Series A prep — Q3 target" },
|
|
139
|
+
{ company: "CloudSecure", arr: 2.3, arr_growth: 28, gross_margin: 82, nrr: 108, burn_rate: 180, runway_months: 22, status: "On Track", next_action: "Continue monitoring — Q3 review" },
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
// ── P5: Product Listing Scorecard ───────────────────────────────
|
|
144
|
+
{
|
|
145
|
+
id: crypto.randomUUID(),
|
|
146
|
+
projectId: p5,
|
|
147
|
+
name: "Listing Optimization Scorecard",
|
|
148
|
+
description: "Track product listing quality scores, A/B test status, and revenue impact for GreenLeaf Commerce",
|
|
149
|
+
source: "manual",
|
|
150
|
+
columns: [
|
|
151
|
+
{ name: "sku", displayName: "SKU", dataType: "text", required: true },
|
|
152
|
+
{ name: "product_name", displayName: "Product", dataType: "text" },
|
|
153
|
+
{ name: "listing_score", displayName: "Score", dataType: "number" },
|
|
154
|
+
{ name: "keyword_coverage", displayName: "Keyword Coverage (%)", dataType: "number" },
|
|
155
|
+
{ name: "test_status", displayName: "A/B Test", dataType: "select", config: { options: ["Not Started", "Running", "Winner Found", "Deployed"] } },
|
|
156
|
+
{ name: "revenue_before", displayName: "Rev. Before ($)", dataType: "number" },
|
|
157
|
+
{ name: "revenue_after", displayName: "Rev. After ($)", dataType: "number" },
|
|
158
|
+
{ name: "lift", displayName: "Revenue Lift (%)", dataType: "computed", config: { formula: "IF(revenue_before > 0, ROUND((revenue_after - revenue_before) / revenue_before * 100, 1), 0)", suffix: "%" } },
|
|
159
|
+
],
|
|
160
|
+
rows: [
|
|
161
|
+
{ sku: "SKU-1042", product_name: "Bamboo Kitchen Set", listing_score: 82, keyword_coverage: 85, test_status: "Deployed", revenue_before: 1240, revenue_after: 1890 },
|
|
162
|
+
{ sku: "SKU-1108", product_name: "Organic Cotton Sheets", listing_score: 71, keyword_coverage: 62, test_status: "Running", revenue_before: 3200, revenue_after: 0 },
|
|
163
|
+
{ sku: "SKU-1215", product_name: "Recycled Glass Vases", listing_score: 48, keyword_coverage: 34, test_status: "Running", revenue_before: 890, revenue_after: 0 },
|
|
164
|
+
{ sku: "SKU-1301", product_name: "Eco Yoga Mat", listing_score: 68, keyword_coverage: 55, test_status: "Not Started", revenue_before: 2800, revenue_after: 0 },
|
|
165
|
+
{ sku: "SKU-1422", product_name: "Reusable Beeswax Wraps", listing_score: 82, keyword_coverage: 78, test_status: "Not Started", revenue_before: 4100, revenue_after: 0 },
|
|
166
|
+
{ sku: "SKU-1503", product_name: "Solar Garden Lights", listing_score: 61, keyword_coverage: 48, test_status: "Not Started", revenue_before: 1600, revenue_after: 0 },
|
|
167
|
+
{ sku: "SKU-1618", product_name: "Bamboo Toothbrush Set", listing_score: 75, keyword_coverage: 72, test_status: "Not Started", revenue_before: 5200, revenue_after: 0 },
|
|
168
|
+
{ sku: "SKU-1722", product_name: "Recycled Tote Bags", listing_score: 73, keyword_coverage: 68, test_status: "Not Started", revenue_before: 3400, revenue_after: 0 },
|
|
169
|
+
],
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
// ── P7: Deal Pipeline Tracker ───────────────────────────────────
|
|
173
|
+
{
|
|
174
|
+
id: crypto.randomUUID(),
|
|
175
|
+
projectId: p7,
|
|
176
|
+
name: "Deal Pipeline",
|
|
177
|
+
description: "Active sales pipeline with risk scoring, stage tracking, and coaching actions",
|
|
178
|
+
source: "agent",
|
|
179
|
+
columns: [
|
|
180
|
+
{ name: "deal_name", displayName: "Deal", dataType: "text", required: true },
|
|
181
|
+
{ name: "owner", displayName: "Owner", dataType: "text" },
|
|
182
|
+
{ name: "stage", displayName: "Stage", dataType: "select", config: { options: ["Discovery", "Evaluation", "Proposal", "Negotiation", "Closed Won", "Closed Lost"] } },
|
|
183
|
+
{ name: "amount", displayName: "Amount ($K)", dataType: "number" },
|
|
184
|
+
{ name: "days_in_stage", displayName: "Days in Stage", dataType: "number" },
|
|
185
|
+
{ name: "close_date", displayName: "Close Date", dataType: "date" },
|
|
186
|
+
{ name: "risk", displayName: "Risk", dataType: "select", config: { options: ["Low", "Medium", "High"] } },
|
|
187
|
+
{ name: "next_step", displayName: "Next Step", dataType: "text" },
|
|
188
|
+
],
|
|
189
|
+
rows: [
|
|
190
|
+
{ deal_name: "Acme Corp Expansion", owner: "Sarah K", stage: "Negotiation", amount: 180, days_in_stage: 3, close_date: "2026-04-15", risk: "Low", next_step: "Contract review" },
|
|
191
|
+
{ deal_name: "Atlas Financial", owner: "Mike R", stage: "Evaluation", amount: 95, days_in_stage: 8, close_date: "2026-04-30", risk: "Medium", next_step: "Demo follow-up — competitive" },
|
|
192
|
+
{ deal_name: "Meridian Corp", owner: "Sarah K", stage: "Proposal", amount: 220, days_in_stage: 12, close_date: "2026-05-10", risk: "High", next_step: "VP-to-VP outreach" },
|
|
193
|
+
{ deal_name: "Pinnacle Tech", owner: "Jordan L", stage: "Evaluation", amount: 65, days_in_stage: 15, close_date: "2026-05-30", risk: "High", next_step: "Re-qualify — go/no-go Friday" },
|
|
194
|
+
{ deal_name: "DataPulse", owner: "Mike R", stage: "Discovery", amount: 45, days_in_stage: 2, close_date: "2026-06-15", risk: "Low", next_step: "Discovery call #2" },
|
|
195
|
+
{ deal_name: "NexaHealth", owner: "Jordan L", stage: "Proposal", amount: 150, days_in_stage: 5, close_date: "2026-04-25", risk: "Medium", next_step: "Pricing discussion" },
|
|
196
|
+
{ deal_name: "CloudFirst", owner: "Sarah K", stage: "Negotiation", amount: 310, days_in_stage: 1, close_date: "2026-04-10", risk: "Low", next_step: "MSA redline" },
|
|
197
|
+
{ deal_name: "GreenTech Solutions", owner: "Mike R", stage: "Discovery", amount: 75, days_in_stage: 4, close_date: "2026-06-30", risk: "Low", next_step: "Needs analysis" },
|
|
198
|
+
{ deal_name: "Summit Partners", owner: "Jordan L", stage: "Evaluation", amount: 120, days_in_stage: 7, close_date: "2026-05-15", risk: "Medium", next_step: "Technical review" },
|
|
199
|
+
{ deal_name: "Vertex Labs", owner: "Sarah K", stage: "Discovery", amount: 55, days_in_stage: 1, close_date: "2026-07-15", risk: "Low", next_step: "Intro meeting" },
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
];
|
|
203
|
+
}
|
|
@@ -27,34 +27,79 @@ export function createViews(): ViewSeed[] {
|
|
|
27
27
|
columns: null,
|
|
28
28
|
density: "comfortable",
|
|
29
29
|
isDefault: false,
|
|
30
|
-
createdAt: new Date(now -
|
|
30
|
+
createdAt: new Date(now - 14 * DAY),
|
|
31
31
|
updatedAt: new Date(now - 2 * DAY),
|
|
32
32
|
},
|
|
33
|
+
{
|
|
34
|
+
id: crypto.randomUUID(),
|
|
35
|
+
surface: "tasks",
|
|
36
|
+
name: "Running & Failed",
|
|
37
|
+
filters: JSON.stringify([
|
|
38
|
+
{ column: "status", operator: "in", value: ["running", "failed"] },
|
|
39
|
+
]),
|
|
40
|
+
sorting: JSON.stringify([{ id: "updatedAt", desc: true }]),
|
|
41
|
+
columns: null,
|
|
42
|
+
density: "compact",
|
|
43
|
+
isDefault: false,
|
|
44
|
+
createdAt: new Date(now - 10 * DAY),
|
|
45
|
+
updatedAt: new Date(now - 1 * DAY),
|
|
46
|
+
},
|
|
33
47
|
{
|
|
34
48
|
id: crypto.randomUUID(),
|
|
35
49
|
surface: "documents",
|
|
36
|
-
name: "
|
|
50
|
+
name: "Output Reports",
|
|
37
51
|
filters: JSON.stringify([
|
|
38
|
-
{ column: "
|
|
52
|
+
{ column: "direction", operator: "eq", value: "output" },
|
|
39
53
|
]),
|
|
40
54
|
sorting: JSON.stringify([{ id: "updatedAt", desc: true }]),
|
|
41
55
|
columns: null,
|
|
42
56
|
density: "comfortable",
|
|
43
57
|
isDefault: false,
|
|
44
|
-
createdAt: new Date(now -
|
|
58
|
+
createdAt: new Date(now - 7 * DAY),
|
|
45
59
|
updatedAt: new Date(now - 1 * DAY),
|
|
46
60
|
},
|
|
47
61
|
{
|
|
48
62
|
id: crypto.randomUUID(),
|
|
49
63
|
surface: "workflows",
|
|
50
|
-
name: "
|
|
51
|
-
filters:
|
|
64
|
+
name: "Active Pipelines",
|
|
65
|
+
filters: JSON.stringify([
|
|
66
|
+
{ column: "status", operator: "eq", value: "active" },
|
|
67
|
+
]),
|
|
52
68
|
sorting: JSON.stringify([{ id: "updatedAt", desc: true }]),
|
|
53
69
|
columns: null,
|
|
54
70
|
density: "compact",
|
|
55
71
|
isDefault: true,
|
|
56
|
-
createdAt: new Date(now -
|
|
72
|
+
createdAt: new Date(now - 12 * DAY),
|
|
57
73
|
updatedAt: new Date(now - 3 * DAY),
|
|
58
74
|
},
|
|
75
|
+
{
|
|
76
|
+
id: crypto.randomUUID(),
|
|
77
|
+
surface: "schedules",
|
|
78
|
+
name: "Heartbeat Monitors",
|
|
79
|
+
filters: JSON.stringify([
|
|
80
|
+
{ column: "type", operator: "eq", value: "heartbeat" },
|
|
81
|
+
]),
|
|
82
|
+
sorting: JSON.stringify([{ id: "lastFiredAt", desc: true }]),
|
|
83
|
+
columns: null,
|
|
84
|
+
density: "comfortable",
|
|
85
|
+
isDefault: false,
|
|
86
|
+
createdAt: new Date(now - 5 * DAY),
|
|
87
|
+
updatedAt: new Date(now - 1 * DAY),
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: crypto.randomUUID(),
|
|
91
|
+
surface: "notifications",
|
|
92
|
+
name: "Pending Approvals",
|
|
93
|
+
filters: JSON.stringify([
|
|
94
|
+
{ column: "type", operator: "eq", value: "permission_required" },
|
|
95
|
+
{ column: "response", operator: "is_empty" },
|
|
96
|
+
]),
|
|
97
|
+
sorting: JSON.stringify([{ id: "createdAt", desc: true }]),
|
|
98
|
+
columns: null,
|
|
99
|
+
density: "comfortable",
|
|
100
|
+
isDefault: false,
|
|
101
|
+
createdAt: new Date(now - 8 * DAY),
|
|
102
|
+
updatedAt: new Date(now - 2 * DAY),
|
|
103
|
+
},
|
|
59
104
|
];
|
|
60
105
|
}
|