@contractspec/lib.runtime-sandbox 0.11.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 (63) hide show
  1. package/dist/_virtual/rolldown_runtime.js +18 -0
  2. package/dist/adapters/pglite/adapter.js +97 -0
  3. package/dist/adapters/pglite/adapter.js.map +1 -0
  4. package/dist/adapters/pglite/index.js +3 -0
  5. package/dist/index.d.ts +23 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +24 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/ports/database.port.d.ts +70 -0
  10. package/dist/ports/database.port.d.ts.map +1 -0
  11. package/dist/types/database.types.d.ts +47 -0
  12. package/dist/types/database.types.d.ts.map +1 -0
  13. package/dist/web/database/migrations.d.ts +12 -0
  14. package/dist/web/database/migrations.d.ts.map +1 -0
  15. package/dist/web/database/migrations.js +746 -0
  16. package/dist/web/database/migrations.js.map +1 -0
  17. package/dist/web/database/schema.d.ts +7349 -0
  18. package/dist/web/database/schema.d.ts.map +1 -0
  19. package/dist/web/database/schema.js +528 -0
  20. package/dist/web/database/schema.js.map +1 -0
  21. package/dist/web/events/local-pubsub.d.ts +10 -0
  22. package/dist/web/events/local-pubsub.d.ts.map +1 -0
  23. package/dist/web/events/local-pubsub.js +24 -0
  24. package/dist/web/events/local-pubsub.js.map +1 -0
  25. package/dist/web/graphql/local-client.d.ts +20 -0
  26. package/dist/web/graphql/local-client.d.ts.map +1 -0
  27. package/dist/web/graphql/local-client.js +536 -0
  28. package/dist/web/graphql/local-client.js.map +1 -0
  29. package/dist/web/index.d.ts +15 -0
  30. package/dist/web/index.d.ts.map +1 -0
  31. package/dist/web/index.js +68 -0
  32. package/dist/web/index.js.map +1 -0
  33. package/dist/web/runtime/seeders/index.js +358 -0
  34. package/dist/web/runtime/seeders/index.js.map +1 -0
  35. package/dist/web/runtime/services.d.ts +60 -0
  36. package/dist/web/runtime/services.d.ts.map +1 -0
  37. package/dist/web/runtime/services.js +80 -0
  38. package/dist/web/runtime/services.js.map +1 -0
  39. package/dist/web/storage/indexeddb.d.ts +22 -0
  40. package/dist/web/storage/indexeddb.d.ts.map +1 -0
  41. package/dist/web/storage/indexeddb.js +85 -0
  42. package/dist/web/storage/indexeddb.js.map +1 -0
  43. package/dist/web/utils/id.d.ts +5 -0
  44. package/dist/web/utils/id.d.ts.map +1 -0
  45. package/dist/web/utils/id.js +9 -0
  46. package/dist/web/utils/id.js.map +1 -0
  47. package/package.json +70 -0
  48. package/src/adapters/pglite/adapter.ts +152 -0
  49. package/src/adapters/pglite/index.ts +1 -0
  50. package/src/index.ts +41 -0
  51. package/src/ports/database.port.ts +82 -0
  52. package/src/ports/index.ts +4 -0
  53. package/src/types/database.types.ts +55 -0
  54. package/src/types/index.ts +1 -0
  55. package/src/web/database/migrations.ts +760 -0
  56. package/src/web/database/schema.ts +596 -0
  57. package/src/web/events/local-pubsub.ts +28 -0
  58. package/src/web/graphql/local-client.ts +747 -0
  59. package/src/web/index.ts +21 -0
  60. package/src/web/runtime/seeders/index.ts +449 -0
  61. package/src/web/runtime/services.ts +132 -0
  62. package/src/web/storage/indexeddb.ts +116 -0
  63. package/src/web/utils/id.ts +7 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","names":[],"sources":["../../../src/web/database/schema.ts"],"sourcesContent":[],"mappings":";;;cAoBa,2CAAoB;;;EAApB,OAAA,EAAA;IAOX,EAAA,EAAA,oBAAA,CAAA,QAAA,CAAA;;;;;;;;gBAP+B,EAAA,KAAA;MAAA,YAAA,EAAA,IAAA;MASpB,eAYX,EAAA,KAAA;MAAA,iBAAA,EAAA,KAAA;;;;;;;;;;;;;mBAZuB;MAAA,UAAA,EAAA,KAAA;MAgBZ,YAAA,EAAA,KASX;MAAA,eAAA,EAAA,KAAA;;;;;;;;;;gBAT+B,QAAA;MAAA,UAAA,EAAA,QAAA;MAWpB,IAAA,EAAA,MAAA;MAYZ,WAAA,EAAA,MAAA;;;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;;;;;;;;;;;;;;;;;;;;cAEW,kCAAW;;;;QAMtB,oBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEW,yCAAkB;;;;QAQ7B,oBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEW,oCAAa;;;;QAQxB,oBAAA,CAAA"}
@@ -0,0 +1,528 @@
1
+ import { integer, pgTable, real, text, timestamp } from "drizzle-orm/pg-core";
2
+
3
+ //#region src/web/database/schema.ts
4
+ /**
5
+ * Drizzle schema for sandbox runtime database tables.
6
+ *
7
+ * This schema defines all tables used by the template examples:
8
+ * - Todos (tasks, categories)
9
+ * - Messaging (conversations, participants, messages)
10
+ * - Recipes (categories, recipes, ingredients, instructions)
11
+ * - CRM (pipelines, stages, deals, companies, contacts)
12
+ * - SaaS (projects, subscriptions, usage)
13
+ * - Agent Console (tools, definitions, runs, steps, logs)
14
+ * - Workflow System (definitions, steps, instances, approvals)
15
+ * - Marketplace (stores, products, orders, items, payouts, reviews)
16
+ * - Integration Hub (integrations, connections, syncs, mappings)
17
+ * - Analytics (dashboards, widgets, queries)
18
+ * - Policy-Safe Knowledge Assistant (contexts, rules, versions, snapshots, candidates, tasks)
19
+ */
20
+ const templateTaskCategory = pgTable("template_task_category", {
21
+ id: text("id").primaryKey(),
22
+ projectId: text("projectId").notNull(),
23
+ name: text("name").notNull(),
24
+ color: text("color"),
25
+ createdAt: timestamp("createdAt").defaultNow(),
26
+ updatedAt: timestamp("updatedAt").defaultNow()
27
+ });
28
+ const templateTask = pgTable("template_task", {
29
+ id: text("id").primaryKey(),
30
+ projectId: text("projectId").notNull(),
31
+ categoryId: text("categoryId"),
32
+ title: text("title").notNull(),
33
+ description: text("description"),
34
+ completed: integer("completed").default(0),
35
+ priority: text("priority").default("MEDIUM"),
36
+ dueDate: text("dueDate"),
37
+ tags: text("tags"),
38
+ createdAt: timestamp("createdAt").defaultNow(),
39
+ updatedAt: timestamp("updatedAt").defaultNow()
40
+ });
41
+ const templateConversation = pgTable("template_conversation", {
42
+ id: text("id").primaryKey(),
43
+ projectId: text("projectId").notNull(),
44
+ name: text("name"),
45
+ isGroup: integer("isGroup").default(0),
46
+ avatarUrl: text("avatarUrl"),
47
+ lastMessageId: text("lastMessageId"),
48
+ createdAt: timestamp("createdAt").defaultNow(),
49
+ updatedAt: timestamp("updatedAt").defaultNow()
50
+ });
51
+ const templateConversationParticipant = pgTable("template_conversation_participant", {
52
+ id: text("id").primaryKey(),
53
+ conversationId: text("conversationId").notNull(),
54
+ projectId: text("projectId").notNull(),
55
+ userId: text("userId").notNull(),
56
+ displayName: text("displayName"),
57
+ role: text("role"),
58
+ joinedAt: timestamp("joinedAt").defaultNow(),
59
+ lastReadAt: text("lastReadAt")
60
+ });
61
+ const templateMessage = pgTable("template_message", {
62
+ id: text("id").primaryKey(),
63
+ conversationId: text("conversationId").notNull(),
64
+ projectId: text("projectId").notNull(),
65
+ senderId: text("senderId").notNull(),
66
+ senderName: text("senderName"),
67
+ content: text("content").notNull(),
68
+ attachments: text("attachments"),
69
+ status: text("status").default("SENT"),
70
+ createdAt: timestamp("createdAt").defaultNow(),
71
+ updatedAt: timestamp("updatedAt").defaultNow()
72
+ });
73
+ const templateRecipeCategory = pgTable("template_recipe_category", {
74
+ id: text("id").primaryKey(),
75
+ nameEn: text("nameEn").notNull(),
76
+ nameFr: text("nameFr").notNull(),
77
+ icon: text("icon")
78
+ });
79
+ const templateRecipe = pgTable("template_recipe", {
80
+ id: text("id").primaryKey(),
81
+ projectId: text("projectId").notNull(),
82
+ categoryId: text("categoryId"),
83
+ slugEn: text("slugEn").notNull(),
84
+ slugFr: text("slugFr").notNull(),
85
+ nameEn: text("nameEn").notNull(),
86
+ nameFr: text("nameFr").notNull(),
87
+ descriptionEn: text("descriptionEn"),
88
+ descriptionFr: text("descriptionFr"),
89
+ heroImageUrl: text("heroImageUrl"),
90
+ prepTimeMinutes: integer("prepTimeMinutes"),
91
+ cookTimeMinutes: integer("cookTimeMinutes"),
92
+ servings: integer("servings"),
93
+ isFavorite: integer("isFavorite").default(0),
94
+ createdAt: timestamp("createdAt").defaultNow(),
95
+ updatedAt: timestamp("updatedAt").defaultNow()
96
+ });
97
+ const templateRecipeIngredient = pgTable("template_recipe_ingredient", {
98
+ id: text("id").primaryKey(),
99
+ recipeId: text("recipeId").notNull(),
100
+ nameEn: text("nameEn").notNull(),
101
+ nameFr: text("nameFr").notNull(),
102
+ quantity: text("quantity").notNull(),
103
+ ordering: integer("ordering").default(0)
104
+ });
105
+ const templateRecipeInstruction = pgTable("template_recipe_instruction", {
106
+ id: text("id").primaryKey(),
107
+ recipeId: text("recipeId").notNull(),
108
+ contentEn: text("contentEn").notNull(),
109
+ contentFr: text("contentFr").notNull(),
110
+ ordering: integer("ordering").default(0)
111
+ });
112
+ const crmPipeline = pgTable("crm_pipeline", {
113
+ id: text("id").primaryKey(),
114
+ projectId: text("projectId").notNull(),
115
+ name: text("name").notNull(),
116
+ createdAt: timestamp("createdAt").defaultNow(),
117
+ updatedAt: timestamp("updatedAt").defaultNow()
118
+ });
119
+ const crmStage = pgTable("crm_stage", {
120
+ id: text("id").primaryKey(),
121
+ pipelineId: text("pipelineId").notNull(),
122
+ name: text("name").notNull(),
123
+ position: integer("position").notNull(),
124
+ createdAt: timestamp("createdAt").defaultNow()
125
+ });
126
+ const crmDeal = pgTable("crm_deal", {
127
+ id: text("id").primaryKey(),
128
+ projectId: text("projectId").notNull(),
129
+ pipelineId: text("pipelineId").notNull(),
130
+ stageId: text("stageId").notNull(),
131
+ name: text("name").notNull(),
132
+ value: real("value").notNull().default(0),
133
+ currency: text("currency").default("USD"),
134
+ status: text("status").default("OPEN"),
135
+ contactId: text("contactId"),
136
+ companyId: text("companyId"),
137
+ ownerId: text("ownerId").notNull(),
138
+ expectedCloseDate: text("expectedCloseDate"),
139
+ wonSource: text("wonSource"),
140
+ lostReason: text("lostReason"),
141
+ notes: text("notes"),
142
+ createdAt: timestamp("createdAt").defaultNow(),
143
+ updatedAt: timestamp("updatedAt").defaultNow()
144
+ });
145
+ const crmCompany = pgTable("crm_company", {
146
+ id: text("id").primaryKey(),
147
+ projectId: text("projectId").notNull(),
148
+ name: text("name").notNull(),
149
+ domain: text("domain"),
150
+ industry: text("industry"),
151
+ size: text("size"),
152
+ website: text("website"),
153
+ createdAt: timestamp("createdAt").defaultNow(),
154
+ updatedAt: timestamp("updatedAt").defaultNow()
155
+ });
156
+ const crmContact = pgTable("crm_contact", {
157
+ id: text("id").primaryKey(),
158
+ projectId: text("projectId").notNull(),
159
+ companyId: text("companyId"),
160
+ firstName: text("firstName").notNull(),
161
+ lastName: text("lastName"),
162
+ email: text("email"),
163
+ phone: text("phone"),
164
+ title: text("title"),
165
+ createdAt: timestamp("createdAt").defaultNow(),
166
+ updatedAt: timestamp("updatedAt").defaultNow()
167
+ });
168
+ const saasProject = pgTable("saas_project", {
169
+ id: text("id").primaryKey(),
170
+ projectId: text("projectId").notNull(),
171
+ organizationId: text("organizationId").notNull(),
172
+ name: text("name").notNull(),
173
+ description: text("description"),
174
+ status: text("status").default("DRAFT"),
175
+ tier: text("tier").default("FREE"),
176
+ createdAt: timestamp("createdAt").defaultNow(),
177
+ updatedAt: timestamp("updatedAt").defaultNow()
178
+ });
179
+ const saasSubscription = pgTable("saas_subscription", {
180
+ id: text("id").primaryKey(),
181
+ projectId: text("projectId").notNull(),
182
+ organizationId: text("organizationId").notNull(),
183
+ plan: text("plan").notNull().default("FREE"),
184
+ status: text("status").default("ACTIVE"),
185
+ billingCycle: text("billingCycle").default("MONTHLY"),
186
+ currentPeriodStart: text("currentPeriodStart"),
187
+ currentPeriodEnd: text("currentPeriodEnd"),
188
+ cancelAtPeriodEnd: integer("cancelAtPeriodEnd").default(0),
189
+ createdAt: timestamp("createdAt").defaultNow(),
190
+ updatedAt: timestamp("updatedAt").defaultNow()
191
+ });
192
+ const saasUsage = pgTable("saas_usage", {
193
+ id: text("id").primaryKey(),
194
+ projectId: text("projectId").notNull(),
195
+ organizationId: text("organizationId").notNull(),
196
+ metricName: text("metricName").notNull(),
197
+ value: real("value").notNull().default(0),
198
+ periodStart: text("periodStart").notNull(),
199
+ periodEnd: text("periodEnd").notNull(),
200
+ createdAt: timestamp("createdAt").defaultNow()
201
+ });
202
+ const agentTool = pgTable("agent_tool", {
203
+ id: text("id").primaryKey(),
204
+ projectId: text("projectId").notNull(),
205
+ organizationId: text("organizationId").notNull(),
206
+ name: text("name").notNull(),
207
+ description: text("description"),
208
+ version: text("version").default("1.0.0"),
209
+ category: text("category").default("UTILITY"),
210
+ status: text("status").default("ACTIVE"),
211
+ inputSchema: text("inputSchema"),
212
+ outputSchema: text("outputSchema"),
213
+ endpoint: text("endpoint"),
214
+ createdAt: timestamp("createdAt").defaultNow(),
215
+ updatedAt: timestamp("updatedAt").defaultNow()
216
+ });
217
+ const agentDefinition = pgTable("agent_definition", {
218
+ id: text("id").primaryKey(),
219
+ projectId: text("projectId").notNull(),
220
+ organizationId: text("organizationId").notNull(),
221
+ name: text("name").notNull(),
222
+ description: text("description"),
223
+ modelProvider: text("modelProvider").default("openai"),
224
+ modelName: text("modelName").default("gpt-4"),
225
+ systemPrompt: text("systemPrompt"),
226
+ temperature: real("temperature").default(.7),
227
+ maxTokens: integer("maxTokens").default(4096),
228
+ status: text("status").default("DRAFT"),
229
+ createdAt: timestamp("createdAt").defaultNow(),
230
+ updatedAt: timestamp("updatedAt").defaultNow()
231
+ });
232
+ const agentToolAssignment = pgTable("agent_tool_assignment", {
233
+ id: text("id").primaryKey(),
234
+ agentId: text("agentId").notNull(),
235
+ toolId: text("toolId").notNull(),
236
+ assignedAt: timestamp("assignedAt").defaultNow()
237
+ });
238
+ const agentRun = pgTable("agent_run", {
239
+ id: text("id").primaryKey(),
240
+ projectId: text("projectId").notNull(),
241
+ agentId: text("agentId").notNull(),
242
+ status: text("status").default("QUEUED"),
243
+ input: text("input"),
244
+ output: text("output"),
245
+ totalTokens: integer("totalTokens").default(0),
246
+ promptTokens: integer("promptTokens").default(0),
247
+ completionTokens: integer("completionTokens").default(0),
248
+ estimatedCostUsd: real("estimatedCostUsd").default(0),
249
+ durationMs: integer("durationMs"),
250
+ errorMessage: text("errorMessage"),
251
+ queuedAt: timestamp("queuedAt").defaultNow(),
252
+ startedAt: text("startedAt"),
253
+ completedAt: text("completedAt")
254
+ });
255
+ const agentRunStep = pgTable("agent_run_step", {
256
+ id: text("id").primaryKey(),
257
+ runId: text("runId").notNull(),
258
+ stepNumber: integer("stepNumber").notNull(),
259
+ type: text("type").notNull(),
260
+ toolId: text("toolId"),
261
+ toolInput: text("toolInput"),
262
+ toolOutput: text("toolOutput"),
263
+ reasoning: text("reasoning"),
264
+ tokensUsed: integer("tokensUsed").default(0),
265
+ durationMs: integer("durationMs"),
266
+ status: text("status").default("PENDING"),
267
+ createdAt: timestamp("createdAt").defaultNow()
268
+ });
269
+ const agentRunLog = pgTable("agent_run_log", {
270
+ id: text("id").primaryKey(),
271
+ runId: text("runId").notNull(),
272
+ level: text("level").default("INFO"),
273
+ message: text("message").notNull(),
274
+ metadata: text("metadata"),
275
+ timestamp: timestamp("timestamp").defaultNow()
276
+ });
277
+ const workflowDefinition = pgTable("workflow_definition", {
278
+ id: text("id").primaryKey(),
279
+ projectId: text("projectId").notNull(),
280
+ organizationId: text("organizationId").notNull(),
281
+ name: text("name").notNull(),
282
+ description: text("description"),
283
+ type: text("type").default("APPROVAL"),
284
+ status: text("status").default("DRAFT"),
285
+ createdAt: timestamp("createdAt").defaultNow(),
286
+ updatedAt: timestamp("updatedAt").defaultNow()
287
+ });
288
+ const workflowStep = pgTable("workflow_step", {
289
+ id: text("id").primaryKey(),
290
+ definitionId: text("definitionId").notNull(),
291
+ name: text("name").notNull(),
292
+ description: text("description"),
293
+ stepOrder: integer("stepOrder").notNull(),
294
+ type: text("type").default("APPROVAL"),
295
+ requiredRoles: text("requiredRoles"),
296
+ autoApproveCondition: text("autoApproveCondition"),
297
+ timeoutHours: integer("timeoutHours"),
298
+ createdAt: timestamp("createdAt").defaultNow()
299
+ });
300
+ const workflowInstance = pgTable("workflow_instance", {
301
+ id: text("id").primaryKey(),
302
+ projectId: text("projectId").notNull(),
303
+ definitionId: text("definitionId").notNull(),
304
+ status: text("status").default("PENDING"),
305
+ currentStepId: text("currentStepId"),
306
+ data: text("data"),
307
+ requestedBy: text("requestedBy").notNull(),
308
+ startedAt: timestamp("startedAt").defaultNow(),
309
+ completedAt: text("completedAt")
310
+ });
311
+ const workflowApproval = pgTable("workflow_approval", {
312
+ id: text("id").primaryKey(),
313
+ instanceId: text("instanceId").notNull(),
314
+ stepId: text("stepId").notNull(),
315
+ status: text("status").default("PENDING"),
316
+ actorId: text("actorId"),
317
+ comment: text("comment"),
318
+ decidedAt: text("decidedAt"),
319
+ createdAt: timestamp("createdAt").defaultNow()
320
+ });
321
+ const marketplaceStore = pgTable("marketplace_store", {
322
+ id: text("id").primaryKey(),
323
+ projectId: text("projectId").notNull(),
324
+ organizationId: text("organizationId").notNull(),
325
+ name: text("name").notNull(),
326
+ description: text("description"),
327
+ status: text("status").default("PENDING"),
328
+ rating: real("rating").default(0),
329
+ reviewCount: integer("reviewCount").default(0),
330
+ createdAt: timestamp("createdAt").defaultNow(),
331
+ updatedAt: timestamp("updatedAt").defaultNow()
332
+ });
333
+ const marketplaceProduct = pgTable("marketplace_product", {
334
+ id: text("id").primaryKey(),
335
+ storeId: text("storeId").notNull(),
336
+ name: text("name").notNull(),
337
+ description: text("description"),
338
+ price: real("price").notNull().default(0),
339
+ currency: text("currency").default("USD"),
340
+ status: text("status").default("DRAFT"),
341
+ stock: integer("stock").default(0),
342
+ category: text("category"),
343
+ imageUrl: text("imageUrl"),
344
+ createdAt: timestamp("createdAt").defaultNow(),
345
+ updatedAt: timestamp("updatedAt").defaultNow()
346
+ });
347
+ const marketplaceOrder = pgTable("marketplace_order", {
348
+ id: text("id").primaryKey(),
349
+ projectId: text("projectId").notNull(),
350
+ storeId: text("storeId").notNull(),
351
+ customerId: text("customerId").notNull(),
352
+ status: text("status").default("PENDING"),
353
+ total: real("total").notNull().default(0),
354
+ currency: text("currency").default("USD"),
355
+ shippingAddress: text("shippingAddress"),
356
+ createdAt: timestamp("createdAt").defaultNow(),
357
+ updatedAt: timestamp("updatedAt").defaultNow()
358
+ });
359
+ const marketplaceOrderItem = pgTable("marketplace_order_item", {
360
+ id: text("id").primaryKey(),
361
+ orderId: text("orderId").notNull(),
362
+ productId: text("productId").notNull(),
363
+ quantity: integer("quantity").notNull().default(1),
364
+ price: real("price").notNull().default(0),
365
+ createdAt: timestamp("createdAt").defaultNow()
366
+ });
367
+ const marketplacePayout = pgTable("marketplace_payout", {
368
+ id: text("id").primaryKey(),
369
+ storeId: text("storeId").notNull(),
370
+ amount: real("amount").notNull().default(0),
371
+ currency: text("currency").default("USD"),
372
+ status: text("status").default("PENDING"),
373
+ processedAt: text("processedAt"),
374
+ createdAt: timestamp("createdAt").defaultNow()
375
+ });
376
+ const marketplaceReview = pgTable("marketplace_review", {
377
+ id: text("id").primaryKey(),
378
+ productId: text("productId").notNull(),
379
+ customerId: text("customerId").notNull(),
380
+ orderId: text("orderId"),
381
+ rating: integer("rating").notNull(),
382
+ comment: text("comment"),
383
+ createdAt: timestamp("createdAt").defaultNow()
384
+ });
385
+ const integration = pgTable("integration", {
386
+ id: text("id").primaryKey(),
387
+ projectId: text("projectId").notNull(),
388
+ organizationId: text("organizationId").notNull(),
389
+ name: text("name").notNull(),
390
+ description: text("description"),
391
+ type: text("type").notNull(),
392
+ status: text("status").default("INACTIVE"),
393
+ iconUrl: text("iconUrl"),
394
+ createdAt: timestamp("createdAt").defaultNow(),
395
+ updatedAt: timestamp("updatedAt").defaultNow()
396
+ });
397
+ const integrationConnection = pgTable("integration_connection", {
398
+ id: text("id").primaryKey(),
399
+ integrationId: text("integrationId").notNull(),
400
+ name: text("name").notNull(),
401
+ status: text("status").default("DISCONNECTED"),
402
+ credentials: text("credentials"),
403
+ config: text("config"),
404
+ lastSyncAt: text("lastSyncAt"),
405
+ errorMessage: text("errorMessage"),
406
+ createdAt: timestamp("createdAt").defaultNow(),
407
+ updatedAt: timestamp("updatedAt").defaultNow()
408
+ });
409
+ const integrationSyncConfig = pgTable("integration_sync_config", {
410
+ id: text("id").primaryKey(),
411
+ connectionId: text("connectionId").notNull(),
412
+ name: text("name").notNull(),
413
+ sourceEntity: text("sourceEntity").notNull(),
414
+ targetEntity: text("targetEntity").notNull(),
415
+ frequency: text("frequency").default("DAILY"),
416
+ status: text("status").default("ACTIVE"),
417
+ lastRunAt: text("lastRunAt"),
418
+ lastRunStatus: text("lastRunStatus"),
419
+ recordsSynced: integer("recordsSynced").default(0),
420
+ createdAt: timestamp("createdAt").defaultNow(),
421
+ updatedAt: timestamp("updatedAt").defaultNow()
422
+ });
423
+ const integrationFieldMapping = pgTable("integration_field_mapping", {
424
+ id: text("id").primaryKey(),
425
+ syncConfigId: text("syncConfigId").notNull(),
426
+ sourceField: text("sourceField").notNull(),
427
+ targetField: text("targetField").notNull(),
428
+ transformType: text("transformType"),
429
+ transformConfig: text("transformConfig"),
430
+ createdAt: timestamp("createdAt").defaultNow()
431
+ });
432
+ const analyticsDashboard = pgTable("analytics_dashboard", {
433
+ id: text("id").primaryKey(),
434
+ projectId: text("projectId").notNull(),
435
+ organizationId: text("organizationId").notNull(),
436
+ name: text("name").notNull(),
437
+ slug: text("slug").notNull(),
438
+ description: text("description"),
439
+ status: text("status").default("DRAFT"),
440
+ refreshInterval: text("refreshInterval").default("NONE"),
441
+ isPublic: integer("isPublic").default(0),
442
+ shareToken: text("shareToken"),
443
+ createdAt: timestamp("createdAt").defaultNow(),
444
+ updatedAt: timestamp("updatedAt").defaultNow()
445
+ });
446
+ const analyticsWidget = pgTable("analytics_widget", {
447
+ id: text("id").primaryKey(),
448
+ dashboardId: text("dashboardId").notNull(),
449
+ name: text("name").notNull(),
450
+ type: text("type").notNull(),
451
+ gridX: integer("gridX").default(0),
452
+ gridY: integer("gridY").default(0),
453
+ gridWidth: integer("gridWidth").default(6),
454
+ gridHeight: integer("gridHeight").default(4),
455
+ queryId: text("queryId"),
456
+ config: text("config"),
457
+ createdAt: timestamp("createdAt").defaultNow(),
458
+ updatedAt: timestamp("updatedAt").defaultNow()
459
+ });
460
+ const analyticsQuery = pgTable("analytics_query", {
461
+ id: text("id").primaryKey(),
462
+ projectId: text("projectId").notNull(),
463
+ organizationId: text("organizationId").notNull(),
464
+ name: text("name").notNull(),
465
+ description: text("description"),
466
+ type: text("type").notNull(),
467
+ definition: text("definition").notNull(),
468
+ sql: text("sql"),
469
+ cacheTtlSeconds: integer("cacheTtlSeconds").default(300),
470
+ isShared: integer("isShared").default(0),
471
+ createdAt: timestamp("createdAt").defaultNow(),
472
+ updatedAt: timestamp("updatedAt").defaultNow()
473
+ });
474
+ const psaUserContext = pgTable("psa_user_context", {
475
+ projectId: text("projectId").primaryKey(),
476
+ locale: text("locale").notNull(),
477
+ jurisdiction: text("jurisdiction").notNull(),
478
+ allowedScope: text("allowedScope").notNull(),
479
+ kbSnapshotId: text("kbSnapshotId")
480
+ });
481
+ const psaRule = pgTable("psa_rule", {
482
+ id: text("id").primaryKey(),
483
+ projectId: text("projectId").notNull(),
484
+ jurisdiction: text("jurisdiction").notNull(),
485
+ topicKey: text("topicKey").notNull()
486
+ });
487
+ const psaRuleVersion = pgTable("psa_rule_version", {
488
+ id: text("id").primaryKey(),
489
+ ruleId: text("ruleId").notNull(),
490
+ jurisdiction: text("jurisdiction").notNull(),
491
+ topicKey: text("topicKey").notNull(),
492
+ version: integer("version").notNull(),
493
+ content: text("content").notNull(),
494
+ status: text("status").notNull(),
495
+ sourceRefsJson: text("sourceRefsJson").notNull(),
496
+ approvedBy: text("approvedBy"),
497
+ approvedAt: text("approvedAt"),
498
+ createdAt: timestamp("createdAt").defaultNow()
499
+ });
500
+ const psaSnapshot = pgTable("psa_snapshot", {
501
+ id: text("id").primaryKey(),
502
+ jurisdiction: text("jurisdiction").notNull(),
503
+ asOfDate: text("asOfDate").notNull(),
504
+ includedRuleVersionIdsJson: text("includedRuleVersionIdsJson").notNull(),
505
+ publishedAt: text("publishedAt").notNull()
506
+ });
507
+ const psaChangeCandidate = pgTable("psa_change_candidate", {
508
+ id: text("id").primaryKey(),
509
+ projectId: text("projectId").notNull(),
510
+ jurisdiction: text("jurisdiction").notNull(),
511
+ detectedAt: text("detectedAt").notNull(),
512
+ diffSummary: text("diffSummary").notNull(),
513
+ riskLevel: text("riskLevel").notNull(),
514
+ proposedRuleVersionIdsJson: text("proposedRuleVersionIdsJson").notNull()
515
+ });
516
+ const psaReviewTask = pgTable("psa_review_task", {
517
+ id: text("id").primaryKey(),
518
+ changeCandidateId: text("changeCandidateId").notNull(),
519
+ status: text("status").notNull(),
520
+ assignedRole: text("assignedRole").notNull(),
521
+ decision: text("decision"),
522
+ decidedAt: text("decidedAt"),
523
+ decidedBy: text("decidedBy")
524
+ });
525
+
526
+ //#endregion
527
+ export { agentDefinition, agentRun, agentRunLog, agentRunStep, agentTool, agentToolAssignment, analyticsDashboard, analyticsQuery, analyticsWidget, crmCompany, crmContact, crmDeal, crmPipeline, crmStage, integration, integrationConnection, integrationFieldMapping, integrationSyncConfig, marketplaceOrder, marketplaceOrderItem, marketplacePayout, marketplaceProduct, marketplaceReview, marketplaceStore, psaChangeCandidate, psaReviewTask, psaRule, psaRuleVersion, psaSnapshot, psaUserContext, saasProject, saasSubscription, saasUsage, templateConversation, templateConversationParticipant, templateMessage, templateRecipe, templateRecipeCategory, templateRecipeIngredient, templateRecipeInstruction, templateTask, templateTaskCategory, workflowApproval, workflowDefinition, workflowInstance, workflowStep };
528
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","names":[],"sources":["../../../src/web/database/schema.ts"],"sourcesContent":["/**\n * Drizzle schema for sandbox runtime database tables.\n *\n * This schema defines all tables used by the template examples:\n * - Todos (tasks, categories)\n * - Messaging (conversations, participants, messages)\n * - Recipes (categories, recipes, ingredients, instructions)\n * - CRM (pipelines, stages, deals, companies, contacts)\n * - SaaS (projects, subscriptions, usage)\n * - Agent Console (tools, definitions, runs, steps, logs)\n * - Workflow System (definitions, steps, instances, approvals)\n * - Marketplace (stores, products, orders, items, payouts, reviews)\n * - Integration Hub (integrations, connections, syncs, mappings)\n * - Analytics (dashboards, widgets, queries)\n * - Policy-Safe Knowledge Assistant (contexts, rules, versions, snapshots, candidates, tasks)\n */\nimport { integer, pgTable, real, text, timestamp } from 'drizzle-orm/pg-core';\n\n// ============ Todos Template ============\n\nexport const templateTaskCategory = pgTable('template_task_category', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n name: text('name').notNull(),\n color: text('color'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const templateTask = pgTable('template_task', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n categoryId: text('categoryId'),\n title: text('title').notNull(),\n description: text('description'),\n completed: integer('completed').default(0),\n priority: text('priority').default('MEDIUM'),\n dueDate: text('dueDate'),\n tags: text('tags'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\n// ============ Messaging Template ============\n\nexport const templateConversation = pgTable('template_conversation', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n name: text('name'),\n isGroup: integer('isGroup').default(0),\n avatarUrl: text('avatarUrl'),\n lastMessageId: text('lastMessageId'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const templateConversationParticipant = pgTable(\n 'template_conversation_participant',\n {\n id: text('id').primaryKey(),\n conversationId: text('conversationId').notNull(),\n projectId: text('projectId').notNull(),\n userId: text('userId').notNull(),\n displayName: text('displayName'),\n role: text('role'),\n joinedAt: timestamp('joinedAt').defaultNow(),\n lastReadAt: text('lastReadAt'),\n }\n);\n\nexport const templateMessage = pgTable('template_message', {\n id: text('id').primaryKey(),\n conversationId: text('conversationId').notNull(),\n projectId: text('projectId').notNull(),\n senderId: text('senderId').notNull(),\n senderName: text('senderName'),\n content: text('content').notNull(),\n attachments: text('attachments'),\n status: text('status').default('SENT'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\n// ============ Recipes Template ============\n\nexport const templateRecipeCategory = pgTable('template_recipe_category', {\n id: text('id').primaryKey(),\n nameEn: text('nameEn').notNull(),\n nameFr: text('nameFr').notNull(),\n icon: text('icon'),\n});\n\nexport const templateRecipe = pgTable('template_recipe', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n categoryId: text('categoryId'),\n slugEn: text('slugEn').notNull(),\n slugFr: text('slugFr').notNull(),\n nameEn: text('nameEn').notNull(),\n nameFr: text('nameFr').notNull(),\n descriptionEn: text('descriptionEn'),\n descriptionFr: text('descriptionFr'),\n heroImageUrl: text('heroImageUrl'),\n prepTimeMinutes: integer('prepTimeMinutes'),\n cookTimeMinutes: integer('cookTimeMinutes'),\n servings: integer('servings'),\n isFavorite: integer('isFavorite').default(0),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const templateRecipeIngredient = pgTable('template_recipe_ingredient', {\n id: text('id').primaryKey(),\n recipeId: text('recipeId').notNull(),\n nameEn: text('nameEn').notNull(),\n nameFr: text('nameFr').notNull(),\n quantity: text('quantity').notNull(),\n ordering: integer('ordering').default(0),\n});\n\nexport const templateRecipeInstruction = pgTable(\n 'template_recipe_instruction',\n {\n id: text('id').primaryKey(),\n recipeId: text('recipeId').notNull(),\n contentEn: text('contentEn').notNull(),\n contentFr: text('contentFr').notNull(),\n ordering: integer('ordering').default(0),\n }\n);\n\n// ============ CRM Template ============\n\nexport const crmPipeline = pgTable('crm_pipeline', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n name: text('name').notNull(),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const crmStage = pgTable('crm_stage', {\n id: text('id').primaryKey(),\n pipelineId: text('pipelineId').notNull(),\n name: text('name').notNull(),\n position: integer('position').notNull(),\n createdAt: timestamp('createdAt').defaultNow(),\n});\n\nexport const crmDeal = pgTable('crm_deal', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n pipelineId: text('pipelineId').notNull(),\n stageId: text('stageId').notNull(),\n name: text('name').notNull(),\n value: real('value').notNull().default(0),\n currency: text('currency').default('USD'),\n status: text('status').default('OPEN'),\n contactId: text('contactId'),\n companyId: text('companyId'),\n ownerId: text('ownerId').notNull(),\n expectedCloseDate: text('expectedCloseDate'),\n wonSource: text('wonSource'),\n lostReason: text('lostReason'),\n notes: text('notes'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const crmCompany = pgTable('crm_company', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n name: text('name').notNull(),\n domain: text('domain'),\n industry: text('industry'),\n size: text('size'),\n website: text('website'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const crmContact = pgTable('crm_contact', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n companyId: text('companyId'),\n firstName: text('firstName').notNull(),\n lastName: text('lastName'),\n email: text('email'),\n phone: text('phone'),\n title: text('title'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\n// ============ SaaS Template ============\n\nexport const saasProject = pgTable('saas_project', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n organizationId: text('organizationId').notNull(),\n name: text('name').notNull(),\n description: text('description'),\n status: text('status').default('DRAFT'),\n tier: text('tier').default('FREE'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const saasSubscription = pgTable('saas_subscription', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n organizationId: text('organizationId').notNull(),\n plan: text('plan').notNull().default('FREE'),\n status: text('status').default('ACTIVE'),\n billingCycle: text('billingCycle').default('MONTHLY'),\n currentPeriodStart: text('currentPeriodStart'),\n currentPeriodEnd: text('currentPeriodEnd'),\n cancelAtPeriodEnd: integer('cancelAtPeriodEnd').default(0),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const saasUsage = pgTable('saas_usage', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n organizationId: text('organizationId').notNull(),\n metricName: text('metricName').notNull(),\n value: real('value').notNull().default(0),\n periodStart: text('periodStart').notNull(),\n periodEnd: text('periodEnd').notNull(),\n createdAt: timestamp('createdAt').defaultNow(),\n});\n\n// ============ Agent Console Template ============\n\nexport const agentTool = pgTable('agent_tool', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n organizationId: text('organizationId').notNull(),\n name: text('name').notNull(),\n description: text('description'),\n version: text('version').default('1.0.0'),\n category: text('category').default('UTILITY'),\n status: text('status').default('ACTIVE'),\n inputSchema: text('inputSchema'),\n outputSchema: text('outputSchema'),\n endpoint: text('endpoint'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const agentDefinition = pgTable('agent_definition', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n organizationId: text('organizationId').notNull(),\n name: text('name').notNull(),\n description: text('description'),\n modelProvider: text('modelProvider').default('openai'),\n modelName: text('modelName').default('gpt-4'),\n systemPrompt: text('systemPrompt'),\n temperature: real('temperature').default(0.7),\n maxTokens: integer('maxTokens').default(4096),\n status: text('status').default('DRAFT'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const agentToolAssignment = pgTable('agent_tool_assignment', {\n id: text('id').primaryKey(),\n agentId: text('agentId').notNull(),\n toolId: text('toolId').notNull(),\n assignedAt: timestamp('assignedAt').defaultNow(),\n});\n\nexport const agentRun = pgTable('agent_run', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n agentId: text('agentId').notNull(),\n status: text('status').default('QUEUED'),\n input: text('input'),\n output: text('output'),\n totalTokens: integer('totalTokens').default(0),\n promptTokens: integer('promptTokens').default(0),\n completionTokens: integer('completionTokens').default(0),\n estimatedCostUsd: real('estimatedCostUsd').default(0),\n durationMs: integer('durationMs'),\n errorMessage: text('errorMessage'),\n queuedAt: timestamp('queuedAt').defaultNow(),\n startedAt: text('startedAt'),\n completedAt: text('completedAt'),\n});\n\nexport const agentRunStep = pgTable('agent_run_step', {\n id: text('id').primaryKey(),\n runId: text('runId').notNull(),\n stepNumber: integer('stepNumber').notNull(),\n type: text('type').notNull(),\n toolId: text('toolId'),\n toolInput: text('toolInput'),\n toolOutput: text('toolOutput'),\n reasoning: text('reasoning'),\n tokensUsed: integer('tokensUsed').default(0),\n durationMs: integer('durationMs'),\n status: text('status').default('PENDING'),\n createdAt: timestamp('createdAt').defaultNow(),\n});\n\nexport const agentRunLog = pgTable('agent_run_log', {\n id: text('id').primaryKey(),\n runId: text('runId').notNull(),\n level: text('level').default('INFO'),\n message: text('message').notNull(),\n metadata: text('metadata'),\n timestamp: timestamp('timestamp').defaultNow(),\n});\n\n// ============ Workflow Template ============\n\nexport const workflowDefinition = pgTable('workflow_definition', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n organizationId: text('organizationId').notNull(),\n name: text('name').notNull(),\n description: text('description'),\n type: text('type').default('APPROVAL'),\n status: text('status').default('DRAFT'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const workflowStep = pgTable('workflow_step', {\n id: text('id').primaryKey(),\n definitionId: text('definitionId').notNull(),\n name: text('name').notNull(),\n description: text('description'),\n stepOrder: integer('stepOrder').notNull(),\n type: text('type').default('APPROVAL'),\n requiredRoles: text('requiredRoles'),\n autoApproveCondition: text('autoApproveCondition'),\n timeoutHours: integer('timeoutHours'),\n createdAt: timestamp('createdAt').defaultNow(),\n});\n\nexport const workflowInstance = pgTable('workflow_instance', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n definitionId: text('definitionId').notNull(),\n status: text('status').default('PENDING'),\n currentStepId: text('currentStepId'),\n data: text('data'),\n requestedBy: text('requestedBy').notNull(),\n startedAt: timestamp('startedAt').defaultNow(),\n completedAt: text('completedAt'),\n});\n\nexport const workflowApproval = pgTable('workflow_approval', {\n id: text('id').primaryKey(),\n instanceId: text('instanceId').notNull(),\n stepId: text('stepId').notNull(),\n status: text('status').default('PENDING'),\n actorId: text('actorId'),\n comment: text('comment'),\n decidedAt: text('decidedAt'),\n createdAt: timestamp('createdAt').defaultNow(),\n});\n\n// ============ Marketplace Template ============\n\nexport const marketplaceStore = pgTable('marketplace_store', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n organizationId: text('organizationId').notNull(),\n name: text('name').notNull(),\n description: text('description'),\n status: text('status').default('PENDING'),\n rating: real('rating').default(0),\n reviewCount: integer('reviewCount').default(0),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const marketplaceProduct = pgTable('marketplace_product', {\n id: text('id').primaryKey(),\n storeId: text('storeId').notNull(),\n name: text('name').notNull(),\n description: text('description'),\n price: real('price').notNull().default(0),\n currency: text('currency').default('USD'),\n status: text('status').default('DRAFT'),\n stock: integer('stock').default(0),\n category: text('category'),\n imageUrl: text('imageUrl'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const marketplaceOrder = pgTable('marketplace_order', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n storeId: text('storeId').notNull(),\n customerId: text('customerId').notNull(),\n status: text('status').default('PENDING'),\n total: real('total').notNull().default(0),\n currency: text('currency').default('USD'),\n shippingAddress: text('shippingAddress'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const marketplaceOrderItem = pgTable('marketplace_order_item', {\n id: text('id').primaryKey(),\n orderId: text('orderId').notNull(),\n productId: text('productId').notNull(),\n quantity: integer('quantity').notNull().default(1),\n price: real('price').notNull().default(0),\n createdAt: timestamp('createdAt').defaultNow(),\n});\n\nexport const marketplacePayout = pgTable('marketplace_payout', {\n id: text('id').primaryKey(),\n storeId: text('storeId').notNull(),\n amount: real('amount').notNull().default(0),\n currency: text('currency').default('USD'),\n status: text('status').default('PENDING'),\n processedAt: text('processedAt'),\n createdAt: timestamp('createdAt').defaultNow(),\n});\n\nexport const marketplaceReview = pgTable('marketplace_review', {\n id: text('id').primaryKey(),\n productId: text('productId').notNull(),\n customerId: text('customerId').notNull(),\n orderId: text('orderId'),\n rating: integer('rating').notNull(),\n comment: text('comment'),\n createdAt: timestamp('createdAt').defaultNow(),\n});\n\n// ============ Integration Hub Template ============\n\nexport const integration = pgTable('integration', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n organizationId: text('organizationId').notNull(),\n name: text('name').notNull(),\n description: text('description'),\n type: text('type').notNull(),\n status: text('status').default('INACTIVE'),\n iconUrl: text('iconUrl'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const integrationConnection = pgTable('integration_connection', {\n id: text('id').primaryKey(),\n integrationId: text('integrationId').notNull(),\n name: text('name').notNull(),\n status: text('status').default('DISCONNECTED'),\n credentials: text('credentials'),\n config: text('config'),\n lastSyncAt: text('lastSyncAt'),\n errorMessage: text('errorMessage'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const integrationSyncConfig = pgTable('integration_sync_config', {\n id: text('id').primaryKey(),\n connectionId: text('connectionId').notNull(),\n name: text('name').notNull(),\n sourceEntity: text('sourceEntity').notNull(),\n targetEntity: text('targetEntity').notNull(),\n frequency: text('frequency').default('DAILY'),\n status: text('status').default('ACTIVE'),\n lastRunAt: text('lastRunAt'),\n lastRunStatus: text('lastRunStatus'),\n recordsSynced: integer('recordsSynced').default(0),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const integrationFieldMapping = pgTable('integration_field_mapping', {\n id: text('id').primaryKey(),\n syncConfigId: text('syncConfigId').notNull(),\n sourceField: text('sourceField').notNull(),\n targetField: text('targetField').notNull(),\n transformType: text('transformType'),\n transformConfig: text('transformConfig'),\n createdAt: timestamp('createdAt').defaultNow(),\n});\n\n// ============ Analytics Dashboard Template ============\n\nexport const analyticsDashboard = pgTable('analytics_dashboard', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n organizationId: text('organizationId').notNull(),\n name: text('name').notNull(),\n slug: text('slug').notNull(),\n description: text('description'),\n status: text('status').default('DRAFT'),\n refreshInterval: text('refreshInterval').default('NONE'),\n isPublic: integer('isPublic').default(0),\n shareToken: text('shareToken'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const analyticsWidget = pgTable('analytics_widget', {\n id: text('id').primaryKey(),\n dashboardId: text('dashboardId').notNull(),\n name: text('name').notNull(),\n type: text('type').notNull(),\n gridX: integer('gridX').default(0),\n gridY: integer('gridY').default(0),\n gridWidth: integer('gridWidth').default(6),\n gridHeight: integer('gridHeight').default(4),\n queryId: text('queryId'),\n config: text('config'),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\nexport const analyticsQuery = pgTable('analytics_query', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n organizationId: text('organizationId').notNull(),\n name: text('name').notNull(),\n description: text('description'),\n type: text('type').notNull(),\n definition: text('definition').notNull(),\n sql: text('sql'),\n cacheTtlSeconds: integer('cacheTtlSeconds').default(300),\n isShared: integer('isShared').default(0),\n createdAt: timestamp('createdAt').defaultNow(),\n updatedAt: timestamp('updatedAt').defaultNow(),\n});\n\n// ============ Policy-Safe Knowledge Assistant Template ============\n\nexport const psaUserContext = pgTable('psa_user_context', {\n projectId: text('projectId').primaryKey(),\n locale: text('locale').notNull(),\n jurisdiction: text('jurisdiction').notNull(),\n allowedScope: text('allowedScope').notNull(),\n kbSnapshotId: text('kbSnapshotId'),\n});\n\nexport const psaRule = pgTable('psa_rule', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n jurisdiction: text('jurisdiction').notNull(),\n topicKey: text('topicKey').notNull(),\n});\n\nexport const psaRuleVersion = pgTable('psa_rule_version', {\n id: text('id').primaryKey(),\n ruleId: text('ruleId').notNull(),\n jurisdiction: text('jurisdiction').notNull(),\n topicKey: text('topicKey').notNull(),\n version: integer('version').notNull(),\n content: text('content').notNull(),\n status: text('status').notNull(),\n sourceRefsJson: text('sourceRefsJson').notNull(),\n approvedBy: text('approvedBy'),\n approvedAt: text('approvedAt'),\n createdAt: timestamp('createdAt').defaultNow(),\n});\n\nexport const psaSnapshot = pgTable('psa_snapshot', {\n id: text('id').primaryKey(),\n jurisdiction: text('jurisdiction').notNull(),\n asOfDate: text('asOfDate').notNull(),\n includedRuleVersionIdsJson: text('includedRuleVersionIdsJson').notNull(),\n publishedAt: text('publishedAt').notNull(),\n});\n\nexport const psaChangeCandidate = pgTable('psa_change_candidate', {\n id: text('id').primaryKey(),\n projectId: text('projectId').notNull(),\n jurisdiction: text('jurisdiction').notNull(),\n detectedAt: text('detectedAt').notNull(),\n diffSummary: text('diffSummary').notNull(),\n riskLevel: text('riskLevel').notNull(),\n proposedRuleVersionIdsJson: text('proposedRuleVersionIdsJson').notNull(),\n});\n\nexport const psaReviewTask = pgTable('psa_review_task', {\n id: text('id').primaryKey(),\n changeCandidateId: text('changeCandidateId').notNull(),\n status: text('status').notNull(),\n assignedRole: text('assignedRole').notNull(),\n decision: text('decision'),\n decidedAt: text('decidedAt'),\n decidedBy: text('decidedBy'),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,MAAa,uBAAuB,QAAQ,0BAA0B;CACpE,IAAI,KAAK,KAAK,CAAC,YAAY;CAC3B,WAAW,KAAK,YAAY,CAAC,SAAS;CACtC,MAAM,KAAK,OAAO,CAAC,SAAS;CAC5B,OAAO,KAAK,QAAQ;CACpB,WAAW,UAAU,YAAY,CAAC,YAAY;CAC9C,WAAW,UAAU,YAAY,CAAC,YAAY;CAC/C,CAAC;AAEF,MAAa,eAAe,QAAQ,iBAAiB;CACnD,IAAI,KAAK,KAAK,CAAC,YAAY;CAC3B,WAAW,KAAK,YAAY,CAAC,SAAS;CACtC,YAAY,KAAK,aAAa;CAC9B,OAAO,KAAK,QAAQ,CAAC,SAAS;CAC9B,aAAa,KAAK,cAAc;CAChC,WAAW,QAAQ,YAAY,CAAC,QAAQ,EAAE;CAC1C,UAAU,KAAK,WAAW,CAAC,QAAQ,SAAS;CAC5C,SAAS,KAAK,UAAU;CACxB,MAAM,KAAK,OAAO;CAClB,WAAW,UAAU,YAAY,CAAC,YAAY;CAC9C,WAAW,UAAU,YAAY,CAAC,YAAY;CAC/C,CAAC;AAIF,MAAa,uBAAuB,QAAQ,yBAAyB;CACnE,IAAI,KAAK,KAAK,CAAC,YAAY;CAC3B,WAAW,KAAK,YAAY,CAAC,SAAS;CACtC,MAAM,KAAK,OAAO;CAClB,SAAS,QAAQ,UAAU,CAAC,QAAQ,EAAE;CACtC,WAAW,KAAK,YAAY;CAC5B,eAAe,KAAK,gBAAgB;CACpC,WAAW,UAAU,YAAY,CAAC,YAAY;CAC9C,WAAW,UAAU,YAAY,CAAC,YAAY;CAC/C,CAAC;AAEF,MAAa,kCAAkC,QA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/web/events/local-pubsub.d.ts
2
+ type Listener<TPayload> = (payload: TPayload) => void;
3
+ declare class LocalEventBus {
4
+ private listeners;
5
+ emit<TPayload = unknown>(event: string, payload: TPayload): void;
6
+ subscribe<TPayload = unknown>(event: string, listener: Listener<TPayload>): () => void;
7
+ }
8
+ //#endregion
9
+ export { LocalEventBus };
10
+ //# sourceMappingURL=local-pubsub.d.ts.map