@keystrokehq/keystroke 0.1.85 → 0.1.86
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/dist/agent.cjs +1 -1
- package/dist/agent.mjs +1 -1
- package/dist/{dist-DkHw1pqF.mjs → dist-D85iXpqD.mjs} +783 -1
- package/dist/dist-D85iXpqD.mjs.map +1 -0
- package/dist/{dist-DajpGaON.cjs → dist-DjNuXI4b.cjs} +783 -1
- package/dist/dist-DjNuXI4b.cjs.map +1 -0
- package/dist/trigger.cjs +1 -1
- package/dist/trigger.mjs +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.mjs +1 -1
- package/package.json +1 -1
- package/dist/dist-DajpGaON.cjs.map +0 -1
- package/dist/dist-DkHw1pqF.mjs.map +0 -1
|
@@ -10590,8 +10590,710 @@ const managedServiceCredentialsSqlite = sqliteTable("managed_service_credentials
|
|
|
10590
10590
|
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
10591
10591
|
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull()
|
|
10592
10592
|
}, (table) => [uniqueIndex$1("managed_service_credentials_org_kind_provider_unique").on(table.organizationId, table.kind, table.provider), index$1("managed_service_credentials_org_kind_idx").on(table.organizationId, table.kind)]);
|
|
10593
|
+
const agents = pgTable("agents", {
|
|
10594
|
+
id: text("id").primaryKey(),
|
|
10595
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
10596
|
+
projectId: text("project_id").notNull(),
|
|
10597
|
+
slug: text("slug").notNull(),
|
|
10598
|
+
name: text("name"),
|
|
10599
|
+
description: text("description"),
|
|
10600
|
+
route: text("route").notNull(),
|
|
10601
|
+
moduleFile: text("module_file").notNull(),
|
|
10602
|
+
model: text("model").notNull(),
|
|
10603
|
+
systemPrompt: text("system_prompt").notNull(),
|
|
10604
|
+
toolCount: integer$1("tool_count"),
|
|
10605
|
+
credentialCount: integer$1("credential_count"),
|
|
10606
|
+
appSlugs: jsonb("app_slugs").$type(),
|
|
10607
|
+
registeredAt: timestamp("registered_at", { withTimezone: true }).notNull(),
|
|
10608
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
10609
|
+
deletedAt: timestamp("deleted_at", { withTimezone: true })
|
|
10610
|
+
}, (table) => [
|
|
10611
|
+
index("agents_organization_id_idx").on(table.organizationId),
|
|
10612
|
+
uniqueIndex("agents_project_id_slug_idx").on(table.projectId, table.slug),
|
|
10613
|
+
uniqueIndex("agents_project_id_route_idx").on(table.projectId, table.route)
|
|
10614
|
+
]);
|
|
10615
|
+
const agentsSqlite = sqliteTable("agents", {
|
|
10616
|
+
id: text$1("id").primaryKey(),
|
|
10617
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
10618
|
+
projectId: text$1("project_id").notNull(),
|
|
10619
|
+
slug: text$1("slug").notNull(),
|
|
10620
|
+
name: text$1("name"),
|
|
10621
|
+
description: text$1("description"),
|
|
10622
|
+
route: text$1("route").notNull(),
|
|
10623
|
+
moduleFile: text$1("module_file").notNull(),
|
|
10624
|
+
model: text$1("model").notNull(),
|
|
10625
|
+
systemPrompt: text$1("system_prompt").notNull(),
|
|
10626
|
+
toolCount: integer("tool_count"),
|
|
10627
|
+
credentialCount: integer("credential_count"),
|
|
10628
|
+
appSlugs: text$1("app_slugs", { mode: "json" }).$type(),
|
|
10629
|
+
registeredAt: integer("registered_at", { mode: "timestamp_ms" }).notNull(),
|
|
10630
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull(),
|
|
10631
|
+
deletedAt: integer("deleted_at", { mode: "timestamp_ms" })
|
|
10632
|
+
}, (table) => [
|
|
10633
|
+
index$1("agents_organization_id_idx").on(table.organizationId),
|
|
10634
|
+
uniqueIndex$1("agents_project_id_slug_idx").on(table.projectId, table.slug),
|
|
10635
|
+
uniqueIndex$1("agents_project_id_route_idx").on(table.projectId, table.route)
|
|
10636
|
+
]);
|
|
10637
|
+
const agentSessions = pgTable("agent_sessions", {
|
|
10638
|
+
id: text("id").primaryKey(),
|
|
10639
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
10640
|
+
projectId: text("project_id").notNull(),
|
|
10641
|
+
agentId: text("agent_id").notNull().references(() => agents.id),
|
|
10642
|
+
sourceKind: text("source_kind").$type().notNull().default("api"),
|
|
10643
|
+
sourceId: text("source_id"),
|
|
10644
|
+
parentSpanId: text("parent_span_id"),
|
|
10645
|
+
ranByUserId: text("ran_by_user_id"),
|
|
10646
|
+
title: text("title"),
|
|
10647
|
+
canceledAt: timestamp("canceled_at", { withTimezone: true }),
|
|
10648
|
+
status: text("status").$type(),
|
|
10649
|
+
totalDurationMs: integer$1("total_duration_ms").notNull().default(0),
|
|
10650
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
10651
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
10652
|
+
deletedAt: timestamp("deleted_at", { withTimezone: true })
|
|
10653
|
+
}, (table) => [index("agent_sessions_organization_id_idx").on(table.organizationId), index("agent_sessions_agent_updated_idx").on(table.agentId, table.updatedAt)]);
|
|
10654
|
+
const agentSessionsSqlite = sqliteTable("agent_sessions", {
|
|
10655
|
+
id: text$1("id").primaryKey(),
|
|
10656
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
10657
|
+
projectId: text$1("project_id").notNull(),
|
|
10658
|
+
agentId: text$1("agent_id").notNull().references(() => agentsSqlite.id),
|
|
10659
|
+
sourceKind: text$1("source_kind").$type().notNull().default("api"),
|
|
10660
|
+
sourceId: text$1("source_id"),
|
|
10661
|
+
parentSpanId: text$1("parent_span_id"),
|
|
10662
|
+
ranByUserId: text$1("ran_by_user_id"),
|
|
10663
|
+
title: text$1("title"),
|
|
10664
|
+
canceledAt: integer("canceled_at", { mode: "timestamp_ms" }),
|
|
10665
|
+
status: text$1("status").$type(),
|
|
10666
|
+
totalDurationMs: integer("total_duration_ms").notNull().default(0),
|
|
10667
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
10668
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull(),
|
|
10669
|
+
deletedAt: integer("deleted_at", { mode: "timestamp_ms" })
|
|
10670
|
+
}, (table) => [index$1("agent_sessions_organization_id_idx").on(table.organizationId), index$1("agent_sessions_agent_updated_idx").on(table.agentId, table.updatedAt)]);
|
|
10671
|
+
const agentEvents = pgTable("agent_events", {
|
|
10672
|
+
id: text("id").primaryKey(),
|
|
10673
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
10674
|
+
sessionId: text("session_id").notNull().references(() => agentSessions.id),
|
|
10675
|
+
seq: integer$1("seq").notNull(),
|
|
10676
|
+
eventType: text("event_type").notNull(),
|
|
10677
|
+
payload: jsonb("payload").notNull(),
|
|
10678
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
10679
|
+
deletedAt: timestamp("deleted_at", { withTimezone: true })
|
|
10680
|
+
}, (table) => [index("agent_events_organization_id_idx").on(table.organizationId), index("agent_events_session_event_seq_idx").on(table.sessionId, table.eventType, table.seq)]);
|
|
10681
|
+
const agentEventsSqlite = sqliteTable("agent_events", {
|
|
10682
|
+
id: text$1("id").primaryKey(),
|
|
10683
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
10684
|
+
sessionId: text$1("session_id").notNull().references(() => agentSessionsSqlite.id),
|
|
10685
|
+
seq: integer("seq").notNull(),
|
|
10686
|
+
eventType: text$1("event_type").notNull(),
|
|
10687
|
+
payload: text$1("payload", { mode: "json" }).notNull(),
|
|
10688
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
10689
|
+
deletedAt: integer("deleted_at", { mode: "timestamp_ms" })
|
|
10690
|
+
}, (table) => [index$1("agent_events_organization_id_idx").on(table.organizationId), index$1("agent_events_session_event_seq_idx").on(table.sessionId, table.eventType, table.seq)]);
|
|
10691
|
+
const triggers = pgTable("triggers", {
|
|
10692
|
+
id: text("id").primaryKey(),
|
|
10693
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
10694
|
+
projectId: text("project_id").notNull(),
|
|
10695
|
+
slug: text("slug").notNull(),
|
|
10696
|
+
kind: text("kind").$type().notNull(),
|
|
10697
|
+
name: text("name"),
|
|
10698
|
+
description: text("description"),
|
|
10699
|
+
moduleFile: text("module_file").notNull(),
|
|
10700
|
+
origin: text("origin").$type().notNull().default("project"),
|
|
10701
|
+
config: jsonb("config").$type(),
|
|
10702
|
+
state: jsonb("state").$type(),
|
|
10703
|
+
schedule: text("schedule"),
|
|
10704
|
+
nextRunAt: timestamp("next_run_at", { withTimezone: true }),
|
|
10705
|
+
enabled: integer$1("enabled").notNull().default(1),
|
|
10706
|
+
lifecycle: jsonb("lifecycle").$type(),
|
|
10707
|
+
createdBySessionId: text("created_by_session_id"),
|
|
10708
|
+
triggerHash: text("trigger_hash"),
|
|
10709
|
+
overviewMarkdown: text("overview_markdown"),
|
|
10710
|
+
overviewHash: text("overview_hash"),
|
|
10711
|
+
overviewModel: text("overview_model"),
|
|
10712
|
+
overviewStatus: text("overview_status").$type().notNull().default("idle"),
|
|
10713
|
+
overviewGeneratedAt: timestamp("overview_generated_at", { withTimezone: true }),
|
|
10714
|
+
registeredAt: timestamp("registered_at", { withTimezone: true }).notNull(),
|
|
10715
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
10716
|
+
deletedAt: timestamp("deleted_at", { withTimezone: true })
|
|
10717
|
+
}, (table) => [
|
|
10718
|
+
index("triggers_organization_id_idx").on(table.organizationId),
|
|
10719
|
+
uniqueIndex("triggers_project_id_slug_idx").on(table.projectId, table.slug),
|
|
10720
|
+
index("triggers_next_run_at_enabled_idx").on(table.nextRunAt, table.enabled)
|
|
10721
|
+
]);
|
|
10722
|
+
const triggersSqlite = sqliteTable("triggers", {
|
|
10723
|
+
id: text$1("id").primaryKey(),
|
|
10724
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
10725
|
+
projectId: text$1("project_id").notNull(),
|
|
10726
|
+
slug: text$1("slug").notNull(),
|
|
10727
|
+
kind: text$1("kind").$type().notNull(),
|
|
10728
|
+
name: text$1("name"),
|
|
10729
|
+
description: text$1("description"),
|
|
10730
|
+
moduleFile: text$1("module_file").notNull(),
|
|
10731
|
+
origin: text$1("origin").$type().notNull().default("project"),
|
|
10732
|
+
config: text$1("config", { mode: "json" }).$type(),
|
|
10733
|
+
state: text$1("state", { mode: "json" }).$type(),
|
|
10734
|
+
schedule: text$1("schedule"),
|
|
10735
|
+
nextRunAt: integer("next_run_at", { mode: "timestamp_ms" }),
|
|
10736
|
+
enabled: integer("enabled").notNull().default(1),
|
|
10737
|
+
lifecycle: text$1("lifecycle", { mode: "json" }).$type(),
|
|
10738
|
+
createdBySessionId: text$1("created_by_session_id"),
|
|
10739
|
+
triggerHash: text$1("trigger_hash"),
|
|
10740
|
+
overviewMarkdown: text$1("overview_markdown"),
|
|
10741
|
+
overviewHash: text$1("overview_hash"),
|
|
10742
|
+
overviewModel: text$1("overview_model"),
|
|
10743
|
+
overviewStatus: text$1("overview_status").$type().notNull().default("idle"),
|
|
10744
|
+
overviewGeneratedAt: integer("overview_generated_at", { mode: "timestamp_ms" }),
|
|
10745
|
+
registeredAt: integer("registered_at", { mode: "timestamp_ms" }).notNull(),
|
|
10746
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull(),
|
|
10747
|
+
deletedAt: integer("deleted_at", { mode: "timestamp_ms" })
|
|
10748
|
+
}, (table) => [
|
|
10749
|
+
index$1("triggers_organization_id_idx").on(table.organizationId),
|
|
10750
|
+
uniqueIndex$1("triggers_project_id_slug_idx").on(table.projectId, table.slug),
|
|
10751
|
+
index$1("triggers_next_run_at_enabled_idx").on(table.nextRunAt, table.enabled)
|
|
10752
|
+
]);
|
|
10753
|
+
const triggerAttachments = pgTable("trigger_attachments", {
|
|
10754
|
+
id: text("id").primaryKey(),
|
|
10755
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
10756
|
+
projectId: text("project_id").notNull(),
|
|
10757
|
+
triggerId: text("trigger_id").notNull().references(() => triggers.id),
|
|
10758
|
+
slug: text("slug").notNull(),
|
|
10759
|
+
targetKind: text("target_kind").$type().notNull().default("workflow"),
|
|
10760
|
+
workflowSlug: text("workflow_slug"),
|
|
10761
|
+
agentSlug: text("agent_slug"),
|
|
10762
|
+
prompt: text("prompt"),
|
|
10763
|
+
registeredAt: timestamp("registered_at", { withTimezone: true }).notNull(),
|
|
10764
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
10765
|
+
disabledAt: timestamp("disabled_at", { withTimezone: true }),
|
|
10766
|
+
deletedAt: timestamp("deleted_at", { withTimezone: true })
|
|
10767
|
+
}, (table) => [index("trigger_attachments_organization_id_idx").on(table.organizationId), uniqueIndex("trigger_attachments_project_id_slug_idx").on(table.projectId, table.slug)]);
|
|
10768
|
+
const triggerAttachmentsSqlite = sqliteTable("trigger_attachments", {
|
|
10769
|
+
id: text$1("id").primaryKey(),
|
|
10770
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
10771
|
+
projectId: text$1("project_id").notNull(),
|
|
10772
|
+
triggerId: text$1("trigger_id").notNull().references(() => triggersSqlite.id),
|
|
10773
|
+
slug: text$1("slug").notNull(),
|
|
10774
|
+
targetKind: text$1("target_kind").$type().notNull().default("workflow"),
|
|
10775
|
+
workflowSlug: text$1("workflow_slug"),
|
|
10776
|
+
agentSlug: text$1("agent_slug"),
|
|
10777
|
+
prompt: text$1("prompt"),
|
|
10778
|
+
registeredAt: integer("registered_at", { mode: "timestamp_ms" }).notNull(),
|
|
10779
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull(),
|
|
10780
|
+
disabledAt: integer("disabled_at", { mode: "timestamp_ms" }),
|
|
10781
|
+
deletedAt: integer("deleted_at", { mode: "timestamp_ms" })
|
|
10782
|
+
}, (table) => [index$1("trigger_attachments_organization_id_idx").on(table.organizationId), uniqueIndex$1("trigger_attachments_project_id_slug_idx").on(table.projectId, table.slug)]);
|
|
10783
|
+
const triggerRuns = pgTable("trigger_runs", {
|
|
10784
|
+
id: text("id").primaryKey(),
|
|
10785
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
10786
|
+
projectId: text("project_id").notNull(),
|
|
10787
|
+
triggerId: text("trigger_id").notNull().references(() => triggers.id),
|
|
10788
|
+
sourcePath: text("source_path"),
|
|
10789
|
+
triggerType: text("trigger_type").$type().notNull(),
|
|
10790
|
+
outcome: text("outcome").$type().notNull().default("dispatched"),
|
|
10791
|
+
reason: text("reason").$type(),
|
|
10792
|
+
detail: text("detail"),
|
|
10793
|
+
payload: jsonb("payload"),
|
|
10794
|
+
triggeredAt: timestamp("triggered_at", { withTimezone: true }).notNull()
|
|
10795
|
+
}, (table) => [
|
|
10796
|
+
index("trigger_runs_organization_id_idx").on(table.organizationId),
|
|
10797
|
+
index("trigger_runs_project_trigger_triggered_idx").on(table.projectId, table.triggerId, table.triggeredAt),
|
|
10798
|
+
index("trigger_runs_project_triggered_idx").on(table.projectId, table.triggeredAt)
|
|
10799
|
+
]);
|
|
10800
|
+
const triggerRunsSqlite = sqliteTable("trigger_runs", {
|
|
10801
|
+
id: text$1("id").primaryKey(),
|
|
10802
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
10803
|
+
projectId: text$1("project_id").notNull(),
|
|
10804
|
+
triggerId: text$1("trigger_id").notNull().references(() => triggersSqlite.id),
|
|
10805
|
+
sourcePath: text$1("source_path"),
|
|
10806
|
+
triggerType: text$1("trigger_type").$type().notNull(),
|
|
10807
|
+
outcome: text$1("outcome").$type().notNull().default("dispatched"),
|
|
10808
|
+
reason: text$1("reason").$type(),
|
|
10809
|
+
detail: text$1("detail"),
|
|
10810
|
+
payload: text$1("payload", { mode: "json" }),
|
|
10811
|
+
triggeredAt: integer("triggered_at", { mode: "timestamp_ms" }).notNull()
|
|
10812
|
+
}, (table) => [
|
|
10813
|
+
index$1("trigger_runs_organization_id_idx").on(table.organizationId),
|
|
10814
|
+
index$1("trigger_runs_project_trigger_triggered_idx").on(table.projectId, table.triggerId, table.triggeredAt),
|
|
10815
|
+
index$1("trigger_runs_project_triggered_idx").on(table.projectId, table.triggeredAt)
|
|
10816
|
+
]);
|
|
10817
|
+
const workflowSubscriptions = pgTable("workflow_subscriptions", {
|
|
10818
|
+
id: text("id").primaryKey(),
|
|
10819
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
10820
|
+
projectId: text("project_id").notNull(),
|
|
10821
|
+
workflowSlug: text("workflow_slug").notNull(),
|
|
10822
|
+
userId: text("user_id").notNull(),
|
|
10823
|
+
enabled: integer$1("enabled").notNull(),
|
|
10824
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
10825
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
10826
|
+
}, (table) => [index("workflow_subscriptions_organization_id_idx").on(table.organizationId), uniqueIndex("workflow_subscriptions_project_workflow_user").on(table.projectId, table.workflowSlug, table.userId)]);
|
|
10827
|
+
const workflowSubscriptionsSqlite = sqliteTable("workflow_subscriptions", {
|
|
10828
|
+
id: text$1("id").primaryKey(),
|
|
10829
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
10830
|
+
projectId: text$1("project_id").notNull(),
|
|
10831
|
+
workflowSlug: text$1("workflow_slug").notNull(),
|
|
10832
|
+
userId: text$1("user_id").notNull(),
|
|
10833
|
+
enabled: integer("enabled", { mode: "boolean" }).notNull(),
|
|
10834
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
10835
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull()
|
|
10836
|
+
}, (table) => [index$1("workflow_subscriptions_organization_id_idx").on(table.organizationId), uniqueIndex$1("workflow_subscriptions_project_workflow_user").on(table.projectId, table.workflowSlug, table.userId)]);
|
|
10837
|
+
const workflowRuns = pgTable("workflow_runs", {
|
|
10838
|
+
id: text("id").primaryKey(),
|
|
10839
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
10840
|
+
projectId: text("project_id").notNull(),
|
|
10841
|
+
workflowSlug: text("workflow_slug").notNull(),
|
|
10842
|
+
attachmentId: text("attachment_id").references(() => triggerAttachments.id),
|
|
10843
|
+
subscriptionId: text("subscription_id").references(() => workflowSubscriptions.id),
|
|
10844
|
+
triggerRunId: text("trigger_run_id").references(() => triggerRuns.id),
|
|
10845
|
+
parentWorkflowRunId: text("parent_workflow_run_id"),
|
|
10846
|
+
parentSpanId: text("parent_span_id"),
|
|
10847
|
+
sourceKind: text("source_kind").$type().notNull().default("api"),
|
|
10848
|
+
sourceId: text("source_id"),
|
|
10849
|
+
ranByUserId: text("ran_by_user_id"),
|
|
10850
|
+
credentialContext: jsonb("credential_context").$type(),
|
|
10851
|
+
status: text("status").$type().notNull(),
|
|
10852
|
+
trigger: text("trigger").$type().notNull(),
|
|
10853
|
+
triggeredAt: timestamp("triggered_at", { withTimezone: true }).notNull(),
|
|
10854
|
+
startedAt: timestamp("started_at", { withTimezone: true }),
|
|
10855
|
+
finishedAt: timestamp("finished_at", { withTimezone: true }),
|
|
10856
|
+
input: jsonb("input"),
|
|
10857
|
+
output: jsonb("output"),
|
|
10858
|
+
error: jsonb("error")
|
|
10859
|
+
}, (table) => [index("workflow_runs_organization_id_idx").on(table.organizationId), index("workflow_runs_project_workflow_triggered_idx").on(table.projectId, table.workflowSlug, table.triggeredAt)]);
|
|
10860
|
+
const workflowRunsSqlite = sqliteTable("workflow_runs", {
|
|
10861
|
+
id: text$1("id").primaryKey(),
|
|
10862
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
10863
|
+
projectId: text$1("project_id").notNull(),
|
|
10864
|
+
workflowSlug: text$1("workflow_slug").notNull(),
|
|
10865
|
+
attachmentId: text$1("attachment_id").references(() => triggerAttachmentsSqlite.id),
|
|
10866
|
+
subscriptionId: text$1("subscription_id").references(() => workflowSubscriptionsSqlite.id),
|
|
10867
|
+
triggerRunId: text$1("trigger_run_id").references(() => triggerRunsSqlite.id),
|
|
10868
|
+
parentWorkflowRunId: text$1("parent_workflow_run_id"),
|
|
10869
|
+
parentSpanId: text$1("parent_span_id"),
|
|
10870
|
+
sourceKind: text$1("source_kind").$type().notNull().default("api"),
|
|
10871
|
+
sourceId: text$1("source_id"),
|
|
10872
|
+
ranByUserId: text$1("ran_by_user_id"),
|
|
10873
|
+
credentialContext: text$1("credential_context", { mode: "json" }).$type(),
|
|
10874
|
+
status: text$1("status").$type().notNull(),
|
|
10875
|
+
trigger: text$1("trigger").$type().notNull(),
|
|
10876
|
+
triggeredAt: integer("triggered_at", { mode: "timestamp_ms" }).notNull(),
|
|
10877
|
+
startedAt: integer("started_at", { mode: "timestamp_ms" }),
|
|
10878
|
+
finishedAt: integer("finished_at", { mode: "timestamp_ms" }),
|
|
10879
|
+
input: text$1("input", { mode: "json" }),
|
|
10880
|
+
output: text$1("output", { mode: "json" }),
|
|
10881
|
+
error: text$1("error", { mode: "json" })
|
|
10882
|
+
}, (table) => [index$1("workflow_runs_organization_id_idx").on(table.organizationId), index$1("workflow_runs_project_workflow_triggered_idx").on(table.projectId, table.workflowSlug, table.triggeredAt)]);
|
|
10883
|
+
/**
|
|
10884
|
+
* Append-only durable execution log. One row per workflow lifecycle transition.
|
|
10885
|
+
* Replay reads these in `seq` order and short-circuits already-completed primitives.
|
|
10886
|
+
*/
|
|
10887
|
+
const workflowEvents = pgTable("workflow_events", {
|
|
10888
|
+
id: text("id").primaryKey(),
|
|
10889
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
10890
|
+
runId: text("run_id").notNull().references(() => workflowRuns.id),
|
|
10891
|
+
projectId: text("project_id").notNull(),
|
|
10892
|
+
seq: integer$1("seq").notNull(),
|
|
10893
|
+
type: text("type").$type().notNull(),
|
|
10894
|
+
correlationId: text("correlation_id"),
|
|
10895
|
+
data: jsonb("data"),
|
|
10896
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull()
|
|
10897
|
+
}, (table) => [
|
|
10898
|
+
index("workflow_events_organization_id_idx").on(table.organizationId),
|
|
10899
|
+
uniqueIndex("workflow_events_run_id_seq_unique").on(table.runId, table.seq),
|
|
10900
|
+
index("workflow_events_run_id_type_idx").on(table.runId, table.type),
|
|
10901
|
+
index("workflow_events_correlation_id_idx").on(table.correlationId)
|
|
10902
|
+
]);
|
|
10903
|
+
const workflowEventsSqlite = sqliteTable("workflow_events", {
|
|
10904
|
+
id: text$1("id").primaryKey(),
|
|
10905
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
10906
|
+
runId: text$1("run_id").notNull().references(() => workflowRunsSqlite.id),
|
|
10907
|
+
projectId: text$1("project_id").notNull(),
|
|
10908
|
+
seq: integer("seq").notNull(),
|
|
10909
|
+
type: text$1("type").$type().notNull(),
|
|
10910
|
+
correlationId: text$1("correlation_id"),
|
|
10911
|
+
data: text$1("data", { mode: "json" }),
|
|
10912
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull()
|
|
10913
|
+
}, (table) => [
|
|
10914
|
+
index$1("workflow_events_organization_id_idx").on(table.organizationId),
|
|
10915
|
+
uniqueIndex$1("workflow_events_run_id_seq_unique").on(table.runId, table.seq),
|
|
10916
|
+
index$1("workflow_events_run_id_type_idx").on(table.runId, table.type),
|
|
10917
|
+
index$1("workflow_events_correlation_id_idx").on(table.correlationId)
|
|
10918
|
+
]);
|
|
10919
|
+
const workflowHooks = pgTable("workflow_hooks", {
|
|
10920
|
+
hookId: text("hook_id").primaryKey(),
|
|
10921
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
10922
|
+
runId: text("run_id").notNull().references(() => workflowRuns.id),
|
|
10923
|
+
projectId: text("project_id").notNull(),
|
|
10924
|
+
token: text("token").notNull(),
|
|
10925
|
+
correlationId: text("correlation_id").notNull(),
|
|
10926
|
+
status: text("status").$type().notNull(),
|
|
10927
|
+
schema: jsonb("schema"),
|
|
10928
|
+
payload: jsonb("payload"),
|
|
10929
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
10930
|
+
resumedAt: timestamp("resumed_at", { withTimezone: true })
|
|
10931
|
+
}, (table) => [
|
|
10932
|
+
index("workflow_hooks_organization_id_idx").on(table.organizationId),
|
|
10933
|
+
uniqueIndex("workflow_hooks_token_unique").on(table.token),
|
|
10934
|
+
index("workflow_hooks_run_id_idx").on(table.runId)
|
|
10935
|
+
]);
|
|
10936
|
+
const workflowHooksSqlite = sqliteTable("workflow_hooks", {
|
|
10937
|
+
hookId: text$1("hook_id").primaryKey(),
|
|
10938
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
10939
|
+
runId: text$1("run_id").notNull().references(() => workflowRunsSqlite.id),
|
|
10940
|
+
projectId: text$1("project_id").notNull(),
|
|
10941
|
+
token: text$1("token").notNull(),
|
|
10942
|
+
correlationId: text$1("correlation_id").notNull(),
|
|
10943
|
+
status: text$1("status").$type().notNull(),
|
|
10944
|
+
schema: text$1("schema", { mode: "json" }),
|
|
10945
|
+
payload: text$1("payload", { mode: "json" }),
|
|
10946
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
10947
|
+
resumedAt: integer("resumed_at", { mode: "timestamp_ms" })
|
|
10948
|
+
}, (table) => [
|
|
10949
|
+
index$1("workflow_hooks_organization_id_idx").on(table.organizationId),
|
|
10950
|
+
uniqueIndex$1("workflow_hooks_token_unique").on(table.token),
|
|
10951
|
+
index$1("workflow_hooks_run_id_idx").on(table.runId)
|
|
10952
|
+
]);
|
|
10953
|
+
const credentialInstances = pgTable("credential_instances", {
|
|
10954
|
+
id: text("id").primaryKey(),
|
|
10955
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
10956
|
+
projectId: text("project_id").notNull(),
|
|
10957
|
+
appSlug: text("app_slug").notNull(),
|
|
10958
|
+
slug: text("slug").notNull(),
|
|
10959
|
+
name: text("name"),
|
|
10960
|
+
scopeType: text("scope_type").$type().notNull(),
|
|
10961
|
+
scopeId: text("scope_id"),
|
|
10962
|
+
label: text("label"),
|
|
10963
|
+
isDefault: integer$1("is_default").notNull(),
|
|
10964
|
+
authKind: text("auth_kind").$type().notNull(),
|
|
10965
|
+
ciphertext: text("ciphertext"),
|
|
10966
|
+
connectionId: text("connection_id"),
|
|
10967
|
+
/** MCP entity id that owns connection_id when multiple scopes share one connection. */
|
|
10968
|
+
sharedConnectionId: text("shared_connection_id"),
|
|
10969
|
+
grantedScopes: jsonb("granted_scopes").$type(),
|
|
10970
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
10971
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
10972
|
+
lastUsedAt: timestamp("last_used_at", { withTimezone: true })
|
|
10973
|
+
}, (table) => [
|
|
10974
|
+
index("credential_instances_organization_id_idx").on(table.organizationId),
|
|
10975
|
+
uniqueIndex("credential_instances_project_scope_slug_unique").on(table.projectId, table.scopeType, table.scopeId, table.slug),
|
|
10976
|
+
index("credential_instances_project_app_slug_scope_idx").on(table.projectId, table.appSlug, table.scopeType, table.scopeId)
|
|
10977
|
+
]);
|
|
10978
|
+
const credentialInstancesSqlite = sqliteTable("credential_instances", {
|
|
10979
|
+
id: text$1("id").primaryKey(),
|
|
10980
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
10981
|
+
projectId: text$1("project_id").notNull(),
|
|
10982
|
+
appSlug: text$1("app_slug").notNull(),
|
|
10983
|
+
slug: text$1("slug").notNull(),
|
|
10984
|
+
name: text$1("name"),
|
|
10985
|
+
scopeType: text$1("scope_type").$type().notNull(),
|
|
10986
|
+
scopeId: text$1("scope_id"),
|
|
10987
|
+
label: text$1("label"),
|
|
10988
|
+
isDefault: integer("is_default", { mode: "boolean" }).notNull(),
|
|
10989
|
+
authKind: text$1("auth_kind").$type().notNull(),
|
|
10990
|
+
ciphertext: text$1("ciphertext"),
|
|
10991
|
+
connectionId: text$1("connection_id"),
|
|
10992
|
+
/** MCP entity id that owns connection_id when multiple scopes share one connection. */
|
|
10993
|
+
sharedConnectionId: text$1("shared_connection_id"),
|
|
10994
|
+
grantedScopes: text$1("granted_scopes", { mode: "json" }).$type(),
|
|
10995
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
10996
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull(),
|
|
10997
|
+
lastUsedAt: integer("last_used_at", { mode: "timestamp_ms" })
|
|
10998
|
+
}, (table) => [
|
|
10999
|
+
index$1("credential_instances_organization_id_idx").on(table.organizationId),
|
|
11000
|
+
uniqueIndex$1("credential_instances_project_scope_slug_unique").on(table.projectId, table.scopeType, table.scopeId, table.slug),
|
|
11001
|
+
index$1("credential_instances_project_app_slug_scope_idx").on(table.projectId, table.appSlug, table.scopeType, table.scopeId)
|
|
11002
|
+
]);
|
|
11003
|
+
const credentialAssignments = pgTable("credential_assignments", {
|
|
11004
|
+
id: text("id").primaryKey(),
|
|
11005
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
11006
|
+
projectId: text("project_id").notNull(),
|
|
11007
|
+
targetType: text("target_type").$type().notNull(),
|
|
11008
|
+
targetKey: text("target_key").notNull(),
|
|
11009
|
+
/** '*' = wildcard; else runtime consumer id (step correlation id or tool slug). */
|
|
11010
|
+
consumerId: text("consumer_id").notNull(),
|
|
11011
|
+
credentialSlug: text("credential_slug").notNull(),
|
|
11012
|
+
instanceId: text("instance_id").notNull(),
|
|
11013
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
11014
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
11015
|
+
}, (table) => [index("credential_assignments_organization_id_idx").on(table.organizationId), uniqueIndex("credential_assignments_project_target_consumer_slug").on(table.projectId, table.targetType, table.targetKey, table.consumerId, table.credentialSlug)]);
|
|
11016
|
+
const credentialAssignmentsSqlite = sqliteTable("credential_assignments", {
|
|
11017
|
+
id: text$1("id").primaryKey(),
|
|
11018
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
11019
|
+
projectId: text$1("project_id").notNull(),
|
|
11020
|
+
targetType: text$1("target_type").$type().notNull(),
|
|
11021
|
+
targetKey: text$1("target_key").notNull(),
|
|
11022
|
+
consumerId: text$1("consumer_id").notNull(),
|
|
11023
|
+
credentialSlug: text$1("credential_slug").notNull(),
|
|
11024
|
+
instanceId: text$1("instance_id").notNull(),
|
|
11025
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
11026
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull()
|
|
11027
|
+
}, (table) => [index$1("credential_assignments_organization_id_idx").on(table.organizationId), uniqueIndex$1("credential_assignments_project_target_consumer_slug").on(table.projectId, table.targetType, table.targetKey, table.consumerId, table.credentialSlug)]);
|
|
11028
|
+
const jobs = pgTable("jobs", {
|
|
11029
|
+
id: text("id").primaryKey(),
|
|
11030
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
11031
|
+
projectId: text("project_id").notNull(),
|
|
11032
|
+
kind: text("kind").$type().notNull(),
|
|
11033
|
+
targetId: text("target_id").notNull(),
|
|
11034
|
+
runId: text("run_id").notNull(),
|
|
11035
|
+
trigger: text("trigger").$type().notNull(),
|
|
11036
|
+
payload: jsonb("payload"),
|
|
11037
|
+
parent: jsonb("parent").$type(),
|
|
11038
|
+
status: text("status").$type().notNull(),
|
|
11039
|
+
scheduledAt: timestamp("scheduled_at", { withTimezone: true }).notNull(),
|
|
11040
|
+
attempt: integer$1("attempt").notNull(),
|
|
11041
|
+
maxAttempts: integer$1("max_attempts").notNull(),
|
|
11042
|
+
leasedBy: text("leased_by"),
|
|
11043
|
+
leaseExpiresAt: timestamp("lease_expires_at", { withTimezone: true }),
|
|
11044
|
+
completedAt: timestamp("completed_at", { withTimezone: true }),
|
|
11045
|
+
error: jsonb("error")
|
|
11046
|
+
}, (table) => [index("jobs_organization_id_idx").on(table.organizationId)]);
|
|
11047
|
+
const jobsSqlite = sqliteTable("jobs", {
|
|
11048
|
+
id: text$1("id").primaryKey(),
|
|
11049
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
11050
|
+
projectId: text$1("project_id").notNull(),
|
|
11051
|
+
kind: text$1("kind").$type().notNull(),
|
|
11052
|
+
targetId: text$1("target_id").notNull(),
|
|
11053
|
+
runId: text$1("run_id").notNull(),
|
|
11054
|
+
trigger: text$1("trigger").$type().notNull(),
|
|
11055
|
+
payload: text$1("payload", { mode: "json" }),
|
|
11056
|
+
parent: text$1("parent", { mode: "json" }).$type(),
|
|
11057
|
+
status: text$1("status").$type().notNull(),
|
|
11058
|
+
scheduledAt: integer("scheduled_at", { mode: "timestamp_ms" }).notNull(),
|
|
11059
|
+
attempt: integer("attempt").notNull(),
|
|
11060
|
+
maxAttempts: integer("max_attempts").notNull(),
|
|
11061
|
+
leasedBy: text$1("leased_by"),
|
|
11062
|
+
leaseExpiresAt: integer("lease_expires_at", { mode: "timestamp_ms" }),
|
|
11063
|
+
completedAt: integer("completed_at", { mode: "timestamp_ms" }),
|
|
11064
|
+
error: text$1("error", { mode: "json" })
|
|
11065
|
+
}, (table) => [index$1("jobs_organization_id_idx").on(table.organizationId)]);
|
|
11066
|
+
const gatewayAttachments = pgTable("gateway_attachments", {
|
|
11067
|
+
id: text("id").primaryKey(),
|
|
11068
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
11069
|
+
projectId: text("project_id").notNull(),
|
|
11070
|
+
slug: text("slug").notNull(),
|
|
11071
|
+
agentSlug: text("agent_slug").notNull(),
|
|
11072
|
+
moduleFile: text("module_file"),
|
|
11073
|
+
platform: text("platform").notNull(),
|
|
11074
|
+
teamId: text("team_id"),
|
|
11075
|
+
channelId: text("channel_id").notNull(),
|
|
11076
|
+
source: jsonb("source").$type().notNull(),
|
|
11077
|
+
registeredAt: timestamp("registered_at", { withTimezone: true }).notNull(),
|
|
11078
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
11079
|
+
deletedAt: timestamp("deleted_at", { withTimezone: true })
|
|
11080
|
+
}, (table) => [
|
|
11081
|
+
index("gateway_attachments_organization_id_idx").on(table.organizationId),
|
|
11082
|
+
uniqueIndex("gateway_attachments_project_id_slug_idx").on(table.projectId, table.slug),
|
|
11083
|
+
uniqueIndex("gateway_attachments_project_platform_channel_active").on(table.projectId, table.platform, table.channelId).where(sql`${table.deletedAt} is null`)
|
|
11084
|
+
]);
|
|
11085
|
+
const gatewayAttachmentsSqlite = sqliteTable("gateway_attachments", {
|
|
11086
|
+
id: text$1("id").primaryKey(),
|
|
11087
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
11088
|
+
projectId: text$1("project_id").notNull(),
|
|
11089
|
+
slug: text$1("slug").notNull(),
|
|
11090
|
+
agentSlug: text$1("agent_slug").notNull(),
|
|
11091
|
+
moduleFile: text$1("module_file"),
|
|
11092
|
+
platform: text$1("platform").notNull(),
|
|
11093
|
+
teamId: text$1("team_id"),
|
|
11094
|
+
channelId: text$1("channel_id").notNull(),
|
|
11095
|
+
source: text$1("source", { mode: "json" }).$type().notNull(),
|
|
11096
|
+
registeredAt: integer("registered_at", { mode: "timestamp_ms" }).notNull(),
|
|
11097
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull(),
|
|
11098
|
+
deletedAt: integer("deleted_at", { mode: "timestamp_ms" })
|
|
11099
|
+
}, (table) => [
|
|
11100
|
+
index$1("gateway_attachments_organization_id_idx").on(table.organizationId),
|
|
11101
|
+
uniqueIndex$1("gateway_attachments_project_id_slug_idx").on(table.projectId, table.slug),
|
|
11102
|
+
uniqueIndex$1("gateway_attachments_project_platform_channel_active").on(table.projectId, table.platform, table.channelId).where(sql`${table.deletedAt} is null`)
|
|
11103
|
+
]);
|
|
11104
|
+
const gatewayThreadSessions = pgTable("gateway_thread_sessions", {
|
|
11105
|
+
threadId: text("thread_id").primaryKey(),
|
|
11106
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
11107
|
+
agentId: text("agent_id").notNull().references(() => agents.id),
|
|
11108
|
+
sessionId: text("session_id").notNull().references(() => agentSessions.id),
|
|
11109
|
+
attachmentId: text("attachment_id").notNull().references(() => gatewayAttachments.id),
|
|
11110
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
11111
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
11112
|
+
}, (table) => [index("gateway_thread_sessions_organization_id_idx").on(table.organizationId)]);
|
|
11113
|
+
const gatewayThreadSessionsSqlite = sqliteTable("gateway_thread_sessions", {
|
|
11114
|
+
threadId: text$1("thread_id").primaryKey(),
|
|
11115
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
11116
|
+
agentId: text$1("agent_id").notNull().references(() => agentsSqlite.id),
|
|
11117
|
+
sessionId: text$1("session_id").notNull().references(() => agentSessionsSqlite.id),
|
|
11118
|
+
attachmentId: text$1("attachment_id").notNull().references(() => gatewayAttachmentsSqlite.id),
|
|
11119
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
11120
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull()
|
|
11121
|
+
}, (table) => [index$1("gateway_thread_sessions_organization_id_idx").on(table.organizationId)]);
|
|
11122
|
+
const traceSpans = pgTable("trace_spans", {
|
|
11123
|
+
id: text("id").primaryKey(),
|
|
11124
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
11125
|
+
traceId: text("trace_id").notNull(),
|
|
11126
|
+
parentSpanId: text("parent_span_id"),
|
|
11127
|
+
kind: text("kind").$type().notNull(),
|
|
11128
|
+
refId: text("ref_id").notNull(),
|
|
11129
|
+
name: text("name").notNull(),
|
|
11130
|
+
status: text("status").$type().notNull(),
|
|
11131
|
+
startedAt: timestamp("started_at", { withTimezone: true }).notNull(),
|
|
11132
|
+
finishedAt: timestamp("finished_at", { withTimezone: true }),
|
|
11133
|
+
metadata: jsonb("metadata"),
|
|
11134
|
+
error: jsonb("error")
|
|
11135
|
+
}, (table) => [
|
|
11136
|
+
index("trace_spans_organization_id_idx").on(table.organizationId),
|
|
11137
|
+
index("trace_spans_trace_id_started_at_idx").on(table.traceId, table.startedAt),
|
|
11138
|
+
index("trace_spans_ref_id_kind_started_at_idx").on(table.refId, table.kind, table.startedAt)
|
|
11139
|
+
]);
|
|
11140
|
+
const traceSpansSqlite = sqliteTable("trace_spans", {
|
|
11141
|
+
id: text$1("id").primaryKey(),
|
|
11142
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
11143
|
+
traceId: text$1("trace_id").notNull(),
|
|
11144
|
+
parentSpanId: text$1("parent_span_id"),
|
|
11145
|
+
kind: text$1("kind").$type().notNull(),
|
|
11146
|
+
refId: text$1("ref_id").notNull(),
|
|
11147
|
+
name: text$1("name").notNull(),
|
|
11148
|
+
status: text$1("status").$type().notNull(),
|
|
11149
|
+
startedAt: integer("started_at", { mode: "timestamp_ms" }).notNull(),
|
|
11150
|
+
finishedAt: integer("finished_at", { mode: "timestamp_ms" }),
|
|
11151
|
+
metadata: text$1("metadata", { mode: "json" }),
|
|
11152
|
+
error: text$1("error", { mode: "json" })
|
|
11153
|
+
}, (table) => [
|
|
11154
|
+
index$1("trace_spans_organization_id_idx").on(table.organizationId),
|
|
11155
|
+
index$1("trace_spans_trace_id_started_at_idx").on(table.traceId, table.startedAt),
|
|
11156
|
+
index$1("trace_spans_ref_id_kind_started_at_idx").on(table.refId, table.kind, table.startedAt)
|
|
11157
|
+
]);
|
|
11158
|
+
const traceLogs = pgTable("trace_logs", {
|
|
11159
|
+
id: text("id").primaryKey(),
|
|
11160
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
11161
|
+
traceId: text("trace_id").notNull(),
|
|
11162
|
+
spanId: text("span_id").notNull().references(() => traceSpans.id),
|
|
11163
|
+
seq: integer$1("seq").notNull(),
|
|
11164
|
+
level: text("level").$type().notNull(),
|
|
11165
|
+
message: text("message").notNull(),
|
|
11166
|
+
data: jsonb("data"),
|
|
11167
|
+
source: text("source").$type().notNull(),
|
|
11168
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull()
|
|
11169
|
+
}, (table) => [
|
|
11170
|
+
index("trace_logs_organization_id_idx").on(table.organizationId),
|
|
11171
|
+
index("trace_logs_trace_id_seq_idx").on(table.traceId, table.seq),
|
|
11172
|
+
index("trace_logs_span_id_seq_idx").on(table.spanId, table.seq)
|
|
11173
|
+
]);
|
|
11174
|
+
const traceLogsSqlite = sqliteTable("trace_logs", {
|
|
11175
|
+
id: text$1("id").primaryKey(),
|
|
11176
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
11177
|
+
traceId: text$1("trace_id").notNull(),
|
|
11178
|
+
spanId: text$1("span_id").notNull().references(() => traceSpansSqlite.id),
|
|
11179
|
+
seq: integer("seq").notNull(),
|
|
11180
|
+
level: text$1("level").$type().notNull(),
|
|
11181
|
+
message: text$1("message").notNull(),
|
|
11182
|
+
data: text$1("data", { mode: "json" }),
|
|
11183
|
+
source: text$1("source").$type().notNull(),
|
|
11184
|
+
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull()
|
|
11185
|
+
}, (table) => [
|
|
11186
|
+
index$1("trace_logs_organization_id_idx").on(table.organizationId),
|
|
11187
|
+
index$1("trace_logs_trace_id_seq_idx").on(table.traceId, table.seq),
|
|
11188
|
+
index$1("trace_logs_span_id_seq_idx").on(table.spanId, table.seq)
|
|
11189
|
+
]);
|
|
11190
|
+
const skills = pgTable("skills", {
|
|
11191
|
+
id: text("id").primaryKey(),
|
|
11192
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
11193
|
+
projectId: text("project_id").notNull(),
|
|
11194
|
+
slug: text("slug").notNull(),
|
|
11195
|
+
name: text("name"),
|
|
11196
|
+
description: text("description"),
|
|
11197
|
+
moduleFile: text("module_file").notNull(),
|
|
11198
|
+
registeredAt: timestamp("registered_at", { withTimezone: true }).notNull(),
|
|
11199
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
11200
|
+
deletedAt: timestamp("deleted_at", { withTimezone: true })
|
|
11201
|
+
}, (table) => [index("skills_organization_id_idx").on(table.organizationId), uniqueIndex("skills_project_id_slug_idx").on(table.projectId, table.slug)]);
|
|
11202
|
+
const skillsSqlite = sqliteTable("skills", {
|
|
11203
|
+
id: text$1("id").primaryKey(),
|
|
11204
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
11205
|
+
projectId: text$1("project_id").notNull(),
|
|
11206
|
+
slug: text$1("slug").notNull(),
|
|
11207
|
+
name: text$1("name"),
|
|
11208
|
+
description: text$1("description"),
|
|
11209
|
+
moduleFile: text$1("module_file").notNull(),
|
|
11210
|
+
registeredAt: integer("registered_at", { mode: "timestamp_ms" }).notNull(),
|
|
11211
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull(),
|
|
11212
|
+
deletedAt: integer("deleted_at", { mode: "timestamp_ms" })
|
|
11213
|
+
}, (table) => [index$1("skills_organization_id_idx").on(table.organizationId), uniqueIndex$1("skills_project_id_slug_idx").on(table.projectId, table.slug)]);
|
|
11214
|
+
const workflows = pgTable("workflows", {
|
|
11215
|
+
id: text("id").primaryKey(),
|
|
11216
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
11217
|
+
projectId: text("project_id").notNull(),
|
|
11218
|
+
slug: text("slug").notNull(),
|
|
11219
|
+
name: text("name").notNull(),
|
|
11220
|
+
description: text("description").notNull(),
|
|
11221
|
+
moduleFile: text("module_file").notNull(),
|
|
11222
|
+
subscribable: integer$1("subscribable").notNull(),
|
|
11223
|
+
registeredAt: timestamp("registered_at", { withTimezone: true }).notNull(),
|
|
11224
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
11225
|
+
deletedAt: timestamp("deleted_at", { withTimezone: true }),
|
|
11226
|
+
requestSchema: jsonb("request_schema").$type().notNull().default({}),
|
|
11227
|
+
runInputValues: jsonb("run_input_values").$type(),
|
|
11228
|
+
canvasAnnotationsJson: jsonb("canvas_annotations_json").$type(),
|
|
11229
|
+
canvasAnnotationsHash: text("canvas_annotations_hash"),
|
|
11230
|
+
canvasAnnotationsModel: text("canvas_annotations_model"),
|
|
11231
|
+
canvasAnnotationsStatus: text("canvas_annotations_status").$type().notNull().default("idle"),
|
|
11232
|
+
canvasAnnotationsGeneratedAt: timestamp("canvas_annotations_generated_at", { withTimezone: true }),
|
|
11233
|
+
overviewSummary: text("overview_summary"),
|
|
11234
|
+
overviewPhasesJson: jsonb("overview_phases_json").$type(),
|
|
11235
|
+
overviewHash: text("overview_hash"),
|
|
11236
|
+
overviewModel: text("overview_model"),
|
|
11237
|
+
overviewStatus: text("overview_status").$type().notNull().default("idle"),
|
|
11238
|
+
overviewGeneratedAt: timestamp("overview_generated_at", { withTimezone: true })
|
|
11239
|
+
}, (table) => [index("workflows_organization_id_idx").on(table.organizationId), uniqueIndex("workflows_project_id_slug_idx").on(table.projectId, table.slug)]);
|
|
11240
|
+
const workflowsSqlite = sqliteTable("workflows", {
|
|
11241
|
+
id: text$1("id").primaryKey(),
|
|
11242
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
11243
|
+
projectId: text$1("project_id").notNull(),
|
|
11244
|
+
slug: text$1("slug").notNull(),
|
|
11245
|
+
name: text$1("name").notNull(),
|
|
11246
|
+
description: text$1("description").notNull(),
|
|
11247
|
+
moduleFile: text$1("module_file").notNull(),
|
|
11248
|
+
subscribable: integer("subscribable", { mode: "boolean" }).notNull(),
|
|
11249
|
+
registeredAt: integer("registered_at", { mode: "timestamp_ms" }).notNull(),
|
|
11250
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull(),
|
|
11251
|
+
deletedAt: integer("deleted_at", { mode: "timestamp_ms" }),
|
|
11252
|
+
requestSchema: text$1("request_schema", { mode: "json" }).$type().notNull().default({}),
|
|
11253
|
+
runInputValues: text$1("run_input_values", { mode: "json" }).$type(),
|
|
11254
|
+
canvasAnnotationsJson: text$1("canvas_annotations_json", { mode: "json" }).$type(),
|
|
11255
|
+
canvasAnnotationsHash: text$1("canvas_annotations_hash"),
|
|
11256
|
+
canvasAnnotationsModel: text$1("canvas_annotations_model"),
|
|
11257
|
+
canvasAnnotationsStatus: text$1("canvas_annotations_status").$type().notNull().default("idle"),
|
|
11258
|
+
canvasAnnotationsGeneratedAt: integer("canvas_annotations_generated_at", { mode: "timestamp_ms" }),
|
|
11259
|
+
overviewSummary: text$1("overview_summary"),
|
|
11260
|
+
overviewPhasesJson: text$1("overview_phases_json", { mode: "json" }).$type(),
|
|
11261
|
+
overviewHash: text$1("overview_hash"),
|
|
11262
|
+
overviewModel: text$1("overview_model"),
|
|
11263
|
+
overviewStatus: text$1("overview_status").$type().notNull().default("idle"),
|
|
11264
|
+
overviewGeneratedAt: integer("overview_generated_at", { mode: "timestamp_ms" })
|
|
11265
|
+
}, (table) => [index$1("workflows_organization_id_idx").on(table.organizationId), uniqueIndex$1("workflows_project_id_slug_idx").on(table.projectId, table.slug)]);
|
|
11266
|
+
const resourceActivity = pgTable("resource_activity", {
|
|
11267
|
+
id: text("id").primaryKey(),
|
|
11268
|
+
organizationId: text("organization_id").notNull().references(() => organizations.id),
|
|
11269
|
+
projectId: text("project_id").notNull(),
|
|
11270
|
+
userId: text("user_id").notNull(),
|
|
11271
|
+
resourceKind: text("resource_kind").notNull(),
|
|
11272
|
+
resourceId: text("resource_id").notNull(),
|
|
11273
|
+
lastOpenedAt: timestamp("last_opened_at", { withTimezone: true }).notNull()
|
|
11274
|
+
}, (table) => [
|
|
11275
|
+
index("resource_activity_organization_id_idx").on(table.organizationId),
|
|
11276
|
+
uniqueIndex("resource_activity_project_user_kind_resource").on(table.projectId, table.userId, table.resourceKind, table.resourceId),
|
|
11277
|
+
index("resource_activity_user_last_opened_at").on(table.userId, table.lastOpenedAt)
|
|
11278
|
+
]);
|
|
11279
|
+
const resourceActivitySqlite = sqliteTable("resource_activity", {
|
|
11280
|
+
id: text$1("id").primaryKey(),
|
|
11281
|
+
organizationId: text$1("organization_id").notNull().references(() => organizationsSqlite.id),
|
|
11282
|
+
projectId: text$1("project_id").notNull(),
|
|
11283
|
+
userId: text$1("user_id").notNull(),
|
|
11284
|
+
resourceKind: text$1("resource_kind").notNull(),
|
|
11285
|
+
resourceId: text$1("resource_id").notNull(),
|
|
11286
|
+
lastOpenedAt: integer("last_opened_at", { mode: "timestamp_ms" }).notNull()
|
|
11287
|
+
}, (table) => [
|
|
11288
|
+
index$1("resource_activity_organization_id_idx").on(table.organizationId),
|
|
11289
|
+
uniqueIndex$1("resource_activity_project_user_kind_resource").on(table.projectId, table.userId, table.resourceKind, table.resourceId),
|
|
11290
|
+
index$1("resource_activity_user_last_opened_at").on(table.userId, table.lastOpenedAt)
|
|
11291
|
+
]);
|
|
10593
11292
|
/**
|
|
10594
11293
|
* Platform control-plane tables — Postgres (hosted) or SQLite (local dev).
|
|
11294
|
+
*
|
|
11295
|
+
* Tenant (project-runtime) tables live under `./tables/tenant/` — staged here for
|
|
11296
|
+
* the single-db merge; `@keystrokehq/database` still owns the live runtime schema.
|
|
10595
11297
|
*/
|
|
10596
11298
|
const tableRegistry = {
|
|
10597
11299
|
organizations: {
|
|
@@ -10697,6 +11399,86 @@ const tableRegistry = {
|
|
|
10697
11399
|
managedServiceCredentials: {
|
|
10698
11400
|
pg: managedServiceCredentials,
|
|
10699
11401
|
sqlite: managedServiceCredentialsSqlite
|
|
11402
|
+
},
|
|
11403
|
+
agents: {
|
|
11404
|
+
pg: agents,
|
|
11405
|
+
sqlite: agentsSqlite
|
|
11406
|
+
},
|
|
11407
|
+
agentSessions: {
|
|
11408
|
+
pg: agentSessions,
|
|
11409
|
+
sqlite: agentSessionsSqlite
|
|
11410
|
+
},
|
|
11411
|
+
agentEvents: {
|
|
11412
|
+
pg: agentEvents,
|
|
11413
|
+
sqlite: agentEventsSqlite
|
|
11414
|
+
},
|
|
11415
|
+
triggers: {
|
|
11416
|
+
pg: triggers,
|
|
11417
|
+
sqlite: triggersSqlite
|
|
11418
|
+
},
|
|
11419
|
+
triggerAttachments: {
|
|
11420
|
+
pg: triggerAttachments,
|
|
11421
|
+
sqlite: triggerAttachmentsSqlite
|
|
11422
|
+
},
|
|
11423
|
+
triggerRuns: {
|
|
11424
|
+
pg: triggerRuns,
|
|
11425
|
+
sqlite: triggerRunsSqlite
|
|
11426
|
+
},
|
|
11427
|
+
workflowRuns: {
|
|
11428
|
+
pg: workflowRuns,
|
|
11429
|
+
sqlite: workflowRunsSqlite
|
|
11430
|
+
},
|
|
11431
|
+
workflowEvents: {
|
|
11432
|
+
pg: workflowEvents,
|
|
11433
|
+
sqlite: workflowEventsSqlite
|
|
11434
|
+
},
|
|
11435
|
+
workflowHooks: {
|
|
11436
|
+
pg: workflowHooks,
|
|
11437
|
+
sqlite: workflowHooksSqlite
|
|
11438
|
+
},
|
|
11439
|
+
credentialInstances: {
|
|
11440
|
+
pg: credentialInstances,
|
|
11441
|
+
sqlite: credentialInstancesSqlite
|
|
11442
|
+
},
|
|
11443
|
+
credentialAssignments: {
|
|
11444
|
+
pg: credentialAssignments,
|
|
11445
|
+
sqlite: credentialAssignmentsSqlite
|
|
11446
|
+
},
|
|
11447
|
+
jobs: {
|
|
11448
|
+
pg: jobs,
|
|
11449
|
+
sqlite: jobsSqlite
|
|
11450
|
+
},
|
|
11451
|
+
gatewayAttachments: {
|
|
11452
|
+
pg: gatewayAttachments,
|
|
11453
|
+
sqlite: gatewayAttachmentsSqlite
|
|
11454
|
+
},
|
|
11455
|
+
gatewayThreadSessions: {
|
|
11456
|
+
pg: gatewayThreadSessions,
|
|
11457
|
+
sqlite: gatewayThreadSessionsSqlite
|
|
11458
|
+
},
|
|
11459
|
+
traceSpans: {
|
|
11460
|
+
pg: traceSpans,
|
|
11461
|
+
sqlite: traceSpansSqlite
|
|
11462
|
+
},
|
|
11463
|
+
traceLogs: {
|
|
11464
|
+
pg: traceLogs,
|
|
11465
|
+
sqlite: traceLogsSqlite
|
|
11466
|
+
},
|
|
11467
|
+
skills: {
|
|
11468
|
+
pg: skills,
|
|
11469
|
+
sqlite: skillsSqlite
|
|
11470
|
+
},
|
|
11471
|
+
workflows: {
|
|
11472
|
+
pg: workflows,
|
|
11473
|
+
sqlite: workflowsSqlite
|
|
11474
|
+
},
|
|
11475
|
+
workflowSubscriptions: {
|
|
11476
|
+
pg: workflowSubscriptions,
|
|
11477
|
+
sqlite: workflowSubscriptionsSqlite
|
|
11478
|
+
},
|
|
11479
|
+
resourceActivity: {
|
|
11480
|
+
pg: resourceActivity,
|
|
11481
|
+
sqlite: resourceActivitySqlite
|
|
10700
11482
|
}
|
|
10701
11483
|
};
|
|
10702
11484
|
buildPgSchema(tableRegistry);
|
|
@@ -29946,4 +30728,4 @@ async function storeFile(data, options) {
|
|
|
29946
30728
|
//#endregion
|
|
29947
30729
|
export { defineMcp as A, isCredentialError as C, connectMcpDefinition as D, withCredentialAssignments as E, connectMcpServer as O, enrichCredentialError as S, resolveMcpTools as T, serializeWorkflowError as _, createDirectActionRunner as a, captureCredentialToolErrors as b, executeWorkflow as c, isWorkflow as d, promptLlm as f, runWithWorkflowContext as g, resolveWorkflowTool as h, createActionRunner as i, isMcp as j, connectMcpStdio as k, isRunCanceledError as l, registerWorkflowToolExecutor as m, RunCanceledError as n, defineWorkflow as o, registerFileStore as p, RunTimeoutError as r, deserializeWorkflowError as s, MemoryEventLog as t, isRunTimeoutError as u, storeFile as v, resolveActionCredentials as w, createCredentialResolver as x, buildCredentialRunContext as y };
|
|
29948
30730
|
|
|
29949
|
-
//# sourceMappingURL=dist-
|
|
30731
|
+
//# sourceMappingURL=dist-D85iXpqD.mjs.map
|