@runfusion/fusion 0.76.0-beta.1 → 0.76.0-beta.2

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 (138) hide show
  1. package/dist/bin.js +503 -213
  2. package/dist/child-process-worker.js +466 -207
  3. package/dist/client/.vite/manifest.json +260 -260
  4. package/dist/client/assets/{AgentDetailView-Cbl1sw6i.js → AgentDetailView-gak4EWTI.js} +1 -1
  5. package/dist/client/assets/{AgentPermissionPolicyEditor-DD1U5M9p.js → AgentPermissionPolicyEditor-DP1QbZL-.js} +1 -1
  6. package/dist/client/assets/{AgentsView-BMcCbple.js → AgentsView-DAMRTKzI.js} +3 -3
  7. package/dist/client/assets/ChatView-iE-2gf5P.js +13 -0
  8. package/dist/client/assets/{CommandCenter-D7mcD61V.js → CommandCenter-B6RnkLYm.js} +1 -1
  9. package/dist/client/assets/{DevServerView-DaqCn0p5.js → DevServerView-DcFL_LzK.js} +1 -1
  10. package/dist/client/assets/{DirectoryPicker-CLdqqqYN.js → DirectoryPicker-CtjqrYoO.js} +1 -1
  11. package/dist/client/assets/{DocumentsView-BOROVxPm.js → DocumentsView-BkAe2S4H.js} +1 -1
  12. package/dist/client/assets/{EvalsView-BQMXRUlQ.js → EvalsView-CbGA9dMn.js} +1 -1
  13. package/dist/client/assets/{ExperimentalAgentOnboardingModal-1GNeCIQT.js → ExperimentalAgentOnboardingModal-CMgO_S8T.js} +1 -1
  14. package/dist/client/assets/{GoalsView-Cr3c_2GC.js → GoalsView-_3P9J5sf.js} +1 -1
  15. package/dist/client/assets/{InsightsView-DgVBVQM4.js → InsightsView-DOhO7xH5.js} +1 -1
  16. package/dist/client/assets/{MemoryView-C0VzzMSw.js → MemoryView-DwJas8vi.js} +1 -1
  17. package/dist/client/assets/{PiExtensionsManager-D1kkkVtP.js → PiExtensionsManager-B_LiW_e9.js} +1 -1
  18. package/dist/client/assets/{PluginManager-BW-_Zyo5.js → PluginManager-BkB6WLQc.js} +1 -1
  19. package/dist/client/assets/{PullRequestView-Cmlo4nWA.js → PullRequestView-DcH5tmYc.js} +1 -1
  20. package/dist/client/assets/{ReportModal-BWuaroTF.js → ReportModal-BOEbqtqG.js} +1 -1
  21. package/dist/client/assets/{ResearchView-BmkF_vZU.js → ResearchView-Dp6V42pI.js} +1 -1
  22. package/dist/client/assets/{SecretsView-DVc8Hky0.js → SecretsView-BCqXHB2L.js} +1 -1
  23. package/dist/client/assets/{SessionTerminal-DCXrxA57.js → SessionTerminal-CkdoQv4y.js} +1 -1
  24. package/dist/client/assets/{SettingsModal-DZ32F1c-.js → SettingsModal-D4Fn4GlS.js} +3 -3
  25. package/dist/client/assets/{SettingsModal-DqwpLnDU.js → SettingsModal-Dc7YG6KB.js} +1 -1
  26. package/dist/client/assets/{SettingsTextareaRow-B5spAoOY.js → SettingsTextareaRow-WSkBoAOO.js} +1 -1
  27. package/dist/client/assets/{SetupWizardModal-VTBLyFzr.js → SetupWizardModal-VTrJAsKd.js} +2 -2
  28. package/dist/client/assets/{SkillsView-CR91ey9d.js → SkillsView-CXeXOxfF.js} +1 -1
  29. package/dist/client/assets/{WorkflowNodeEditor-BzGh_Fd9.js → WorkflowNodeEditor-DoxLGPRF.js} +1 -1
  30. package/dist/client/assets/{agent-import-generation-D27NKQsr.js → agent-import-generation-upc0yw-M.js} +1 -1
  31. package/dist/client/assets/{agentsOrgChartLayout-C2K_M3x3.js → agentsOrgChartLayout-C3iumMrW.js} +1 -1
  32. package/dist/client/assets/{architectureDiagram-3BPJPVTR-BQy8UcRx.js → architectureDiagram-3BPJPVTR-D6jqc3fJ.js} +1 -1
  33. package/dist/client/assets/{blockDiagram-GPEHLZMM-CZG1bqFQ.js → blockDiagram-GPEHLZMM-DY3AKuPD.js} +1 -1
  34. package/dist/client/assets/{c4Diagram-AAUBKEIU-CZmO_kg3.js → c4Diagram-AAUBKEIU-CpD52V4g.js} +1 -1
  35. package/dist/client/assets/channel-CaxOu15c.js +1 -0
  36. package/dist/client/assets/{chunk-2J33WTMH-jsad6DTE.js → chunk-2J33WTMH-CPeIHyAX.js} +1 -1
  37. package/dist/client/assets/{chunk-4BX2VUAB-DX7SuvwP.js → chunk-4BX2VUAB-ivAwI4xM.js} +1 -1
  38. package/dist/client/assets/{chunk-55IACEB6-De20xFgU.js → chunk-55IACEB6-BtVQ5XaZ.js} +1 -1
  39. package/dist/client/assets/{chunk-727SXJPM-CNiri9yW.js → chunk-727SXJPM-1eap1vDU.js} +1 -1
  40. package/dist/client/assets/{chunk-AQP2D5EJ-DvDqG-ax.js → chunk-AQP2D5EJ-B2NB3BW9.js} +1 -1
  41. package/dist/client/assets/{chunk-FMBD7UC4-DkMdKaUq.js → chunk-FMBD7UC4-Hk_smNYv.js} +1 -1
  42. package/dist/client/assets/{chunk-ND2GUHAM-Do5BwIrI.js → chunk-ND2GUHAM-BmGCAojk.js} +1 -1
  43. package/dist/client/assets/{chunk-QZHKN3VN-BnJgt9vl.js → chunk-QZHKN3VN-D0aXZ8CV.js} +1 -1
  44. package/dist/client/assets/classDiagram-4FO5ZUOK-DXIkGbsl.js +1 -0
  45. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-DXIkGbsl.js +1 -0
  46. package/dist/client/assets/{cose-bilkent-S5V4N54A-D-ivAzzF.js → cose-bilkent-S5V4N54A-DAbu_gnF.js} +1 -1
  47. package/dist/client/assets/{dagre-BM42HDAG-Bpd9L0or.js → dagre-BM42HDAG-BdmLlrDJ.js} +1 -1
  48. package/dist/client/assets/{dashboard-view-DSvVO6Vr.js → dashboard-view-BoFBSXUn.js} +1 -1
  49. package/dist/client/assets/{dashboard-view-CgBo8Ctn.js → dashboard-view-CULL1yhL.js} +1 -1
  50. package/dist/client/assets/{dashboard-view-C-XU9CVv.js → dashboard-view-CxXMDfNY.js} +1 -1
  51. package/dist/client/assets/{dashboard-view-DbaRE8Ma.js → dashboard-view-PRCWCSLm.js} +1 -1
  52. package/dist/client/assets/{diagram-2AECGRRQ-B6TT1NWU.js → diagram-2AECGRRQ-PpqLbVUA.js} +1 -1
  53. package/dist/client/assets/{diagram-5GNKFQAL-DpRS2yRw.js → diagram-5GNKFQAL-9rkGmTwh.js} +1 -1
  54. package/dist/client/assets/{diagram-KO2AKTUF-BVbZr02C.js → diagram-KO2AKTUF-BT-efOMo.js} +1 -1
  55. package/dist/client/assets/{diagram-LMA3HP47-DzENbfal.js → diagram-LMA3HP47-w79OWFxg.js} +1 -1
  56. package/dist/client/assets/{diagram-OG6HWLK6-BIePG5SY.js → diagram-OG6HWLK6-Bye9I5IO.js} +1 -1
  57. package/dist/client/assets/{erDiagram-TEJ5UH35-CQo3WBwo.js → erDiagram-TEJ5UH35-aodREgDf.js} +1 -1
  58. package/dist/client/assets/{flowDiagram-I6XJVG4X-Ct2H4jYo.js → flowDiagram-I6XJVG4X-D0DKItY3.js} +1 -1
  59. package/dist/client/assets/{folder-open-DAh8mpTX.js → folder-open-CqvaMJvx.js} +1 -1
  60. package/dist/client/assets/{ganttDiagram-6RSMTGT7-DyOLCG4B.js → ganttDiagram-6RSMTGT7-CZVApkvw.js} +1 -1
  61. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-sC28-su3.js → gitGraphDiagram-PVQCEYII-D_ynwJ4p.js} +1 -1
  62. package/dist/client/assets/index-DWRJyaa3.js +2818 -0
  63. package/dist/client/assets/{infoDiagram-5YYISTIA-Q81_5aBZ.js → infoDiagram-5YYISTIA-pJG6zxjk.js} +1 -1
  64. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-Cwkjs0z5.js → ishikawaDiagram-YF4QCWOH-nFZ5laUo.js} +1 -1
  65. package/dist/client/assets/{journeyDiagram-JHISSGLW-BXcBV1Bc.js → journeyDiagram-JHISSGLW-CWpCaAIe.js} +1 -1
  66. package/dist/client/assets/{kanban-definition-UN3LZRKU-BI7hW892.js → kanban-definition-UN3LZRKU-ATkPspKa.js} +1 -1
  67. package/dist/client/assets/{mermaid.core-B8oDA6jj.js → mermaid.core-CDXPNs7a.js} +4 -4
  68. package/dist/client/assets/{mindmap-definition-RKZ34NQL-COG6_9eD.js → mindmap-definition-RKZ34NQL-BkqS9tpe.js} +1 -1
  69. package/dist/client/assets/{pieDiagram-4H26LBE5-D11brZ_N.js → pieDiagram-4H26LBE5-DEUyVLs-.js} +1 -1
  70. package/dist/client/assets/{puzzle-D3_Z_rlW.js → puzzle-DQ0y1-XK.js} +1 -1
  71. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-jmhDVZcv.js → quadrantDiagram-W4KKPZXB-ESBJNK5c.js} +1 -1
  72. package/dist/client/assets/{requirementDiagram-4Y6WPE33-BKCUWI1E.js → requirementDiagram-4Y6WPE33-CqPs7zcv.js} +1 -1
  73. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-HsZdEl2t.js → sankeyDiagram-5OEKKPKP-CkFN0m14.js} +1 -1
  74. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-CsDf7Fup.js → sequenceDiagram-3UESZ5HK-Dx2nDuMO.js} +1 -1
  75. package/dist/client/assets/{shield-alert-C16k8wNu.js → shield-alert-BS05s4RM.js} +1 -1
  76. package/dist/client/assets/{standing-instructions-template-BqAyftqe.js → standing-instructions-template-xprxYNHm.js} +1 -1
  77. package/dist/client/assets/{stateDiagram-AJRCARHV-fvzWhltB.js → stateDiagram-AJRCARHV-EUPmRFGd.js} +1 -1
  78. package/dist/client/assets/{stateDiagram-v2-BHNVJYJU-cnt42Sr_.js → stateDiagram-v2-BHNVJYJU-DcQ2mhi5.js} +1 -1
  79. package/dist/client/assets/{timeline-definition-PNZ67QCA-DsZFCSMb.js → timeline-definition-PNZ67QCA-D4YO_3V-.js} +1 -1
  80. package/dist/client/assets/{upload-_s5sL5Pq.js → upload-BjyBtxo7.js} +1 -1
  81. package/dist/client/assets/{users-DH1U5ISc.js → users-D5ogZ7WQ.js} +1 -1
  82. package/dist/client/assets/{vennDiagram-CIIHVFJN-B3KDWS-e.js → vennDiagram-CIIHVFJN-BT5_XuQL.js} +1 -1
  83. package/dist/client/assets/{wardley-L42UT6IY-BKs5MtQS.js → wardley-L42UT6IY-X_ZMW457.js} +1 -1
  84. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-CNsEoXVB.js → wardleyDiagram-YWT4CUSO-GK9nONHU.js} +1 -1
  85. package/dist/client/assets/{xychartDiagram-2RQKCTM6-kq_gW4QC.js → xychartDiagram-2RQKCTM6-Dw3zXHAq.js} +1 -1
  86. package/dist/client/index.html +1 -1
  87. package/dist/client/version.json +1 -1
  88. package/dist/droid-cli/package.json +1 -1
  89. package/dist/extension.js +647 -207
  90. package/dist/migrations/0057_fn_9004_project_ownership_default_reconciliation.sql +13 -0
  91. package/dist/migrations/0058_fn_9014_message_archive.sql +13 -0
  92. package/dist/pi-claude-cli/package.json +5 -5
  93. package/dist/plugin-sdk/index.js +69 -23
  94. package/dist/plugins/fusion-plugin-acp-runtime/bundled.js +69 -23
  95. package/dist/plugins/fusion-plugin-acp-runtime/package.json +1 -1
  96. package/dist/plugins/fusion-plugin-claude-runtime/bundled.js +69 -23
  97. package/dist/plugins/fusion-plugin-claude-runtime/package.json +1 -1
  98. package/dist/plugins/fusion-plugin-cli-printing-press/bundled.js +69 -23
  99. package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
  100. package/dist/plugins/fusion-plugin-compound-engineering/bundled.js +69 -23
  101. package/dist/plugins/fusion-plugin-compound-engineering/package.json +1 -1
  102. package/dist/plugins/fusion-plugin-cursor-runtime/bundled.js +69 -23
  103. package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
  104. package/dist/plugins/fusion-plugin-dependency-graph/bundled.js +69 -23
  105. package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
  106. package/dist/plugins/fusion-plugin-droid-runtime/bundled.js +71 -25
  107. package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
  108. package/dist/plugins/fusion-plugin-grok-runtime/bundled.js +69 -23
  109. package/dist/plugins/fusion-plugin-grok-runtime/package.json +1 -1
  110. package/dist/plugins/fusion-plugin-hermes-runtime/bundled.js +69 -23
  111. package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
  112. package/dist/plugins/fusion-plugin-linear-import/bundled.js +69 -23
  113. package/dist/plugins/fusion-plugin-linear-import/package.json +1 -1
  114. package/dist/plugins/fusion-plugin-omp-runtime/bundled.js +69 -23
  115. package/dist/plugins/fusion-plugin-omp-runtime/package.json +1 -1
  116. package/dist/plugins/fusion-plugin-openclaw-runtime/bundled.js +69 -23
  117. package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
  118. package/dist/plugins/fusion-plugin-paperclip-runtime/bundled.js +69 -23
  119. package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
  120. package/dist/plugins/fusion-plugin-quality/bundled.js +69 -23
  121. package/dist/plugins/fusion-plugin-quality/package.json +1 -1
  122. package/dist/plugins/fusion-plugin-reports/bundled.js +69 -23
  123. package/dist/plugins/fusion-plugin-reports/package.json +1 -1
  124. package/dist/plugins/fusion-plugin-roadmap/bundled.js +69 -23
  125. package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
  126. package/dist/plugins/fusion-plugin-todos/bundled.js +69 -23
  127. package/dist/plugins/fusion-plugin-todos/package.json +1 -1
  128. package/dist/plugins/fusion-plugin-whatsapp-chat/bundled.js +69 -23
  129. package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
  130. package/package.json +3 -3
  131. package/skill/fusion/SKILL.md +1 -1
  132. package/skill/fusion/references/extension-tools.md +22 -0
  133. package/skill/fusion/references/fusion-capabilities.md +2 -0
  134. package/dist/client/assets/ChatView-DcM-ARpZ.js +0 -13
  135. package/dist/client/assets/channel-Cwl9FefC.js +0 -1
  136. package/dist/client/assets/classDiagram-4FO5ZUOK-BZtWCoHC.js +0 -1
  137. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BZtWCoHC.js +0 -1
  138. package/dist/client/assets/index-BlGpMJSZ.js +0 -2818
@@ -6116,9 +6116,14 @@ var config = projectSchema.table("config", {
6116
6116
  // now keyed per-project on `project_id` (the effective PK). `id` is retained
6117
6117
  // for column-shape parity (always 1) but is no longer the PK and no longer
6118
6118
  // CHECK-constrained. Single-project / SQLite-parity callers leave project_id
6119
- // at its '' default (one row), preserving the pre-isolation behavior.
6119
+ // through the database ownership trigger, preserving the pre-isolation behavior.
6120
+ /*
6121
+ FNXC:MultiProjectIsolation 2026-08-12-15:43:
6122
+ Migration 0006 owns config's project_id default and leaves its catalog PK as (project_id).
6123
+ Drizzle emits DEFAULT while the database GUC/trigger selects the effective ownership partition.
6124
+ */
6120
6125
  id: integer("id").default(1),
6121
- projectId: text("project_id").notNull().default("").primaryKey(),
6126
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`).primaryKey(),
6122
6127
  nextId: integer("next_id").default(1),
6123
6128
  nextWorkflowStepId: integer("next_workflow_step_id").default(1),
6124
6129
  // FNXC:SqliteFinalRemoval 2026-06-28:
@@ -6512,9 +6517,13 @@ var taskCommitAssociations = projectSchema.table("task_commit_associations", {
6512
6517
  var automations = projectSchema.table("automations", {
6513
6518
  /*
6514
6519
  * FNXC:AutomationIsolation 2026-07-13-22:37:
6515
- * Automations are partitioned by the AsyncDataLayer's project ID because embedded PostgreSQL consolidates the per-project SQLite files into one table. The composite key deliberately permits the same automation ID in two projects without allowing either project's CRUD or cron-claim path to address the other row. The empty default preserves an explicit partition for legacy and project-agnostic callers until startup stamps migrated rows.
6520
+ * Automations are partitioned by the AsyncDataLayer's project ID because embedded PostgreSQL consolidates the per-project SQLite files into one table. The composite key deliberately permits the same automation ID in two projects without allowing either project's CRUD or cron-claim path to address the other row.
6521
+ *
6522
+ * FNXC:MultiProjectIsolation 2026-08-12-15:43:
6523
+ * Migration 0006 owns the default through the database GUC/trigger; Drizzle emits DEFAULT
6524
+ * without replacing the physical legacy fallback or the fail-closed bound writer contract.
6516
6525
  */
6517
- projectId: text("project_id").notNull().default(""),
6526
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
6518
6527
  id: text("id").notNull(),
6519
6528
  name: text("name").notNull(),
6520
6529
  description: text("description"),
@@ -6813,7 +6822,8 @@ var taskDocuments = projectSchema.table("task_documents", {
6813
6822
  index("idxTaskDocumentsTaskId").on(t.taskId)
6814
6823
  ]);
6815
6824
  var artifacts = projectSchema.table("artifacts", {
6816
- id: text("id").primaryKey(),
6825
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
6826
+ id: text("id").notNull(),
6817
6827
  type: text("type").notNull(),
6818
6828
  title: text("title").notNull(),
6819
6829
  description: text("description"),
@@ -6828,7 +6838,8 @@ var artifacts = projectSchema.table("artifacts", {
6828
6838
  createdAt: text("created_at").notNull(),
6829
6839
  updatedAt: text("updated_at").notNull()
6830
6840
  }, (t) => [
6831
- foreignKey({ columns: [t.taskId], foreignColumns: [tasks.id] }).onDelete("cascade"),
6841
+ primaryKey({ columns: [t.projectId, t.id] }),
6842
+ foreignKey({ name: "artifacts_task_id_fkey", columns: [t.projectId, t.taskId], foreignColumns: [tasks.projectId, tasks.id] }).onDelete("cascade"),
6832
6843
  index("idxArtifactsTaskId").on(t.taskId),
6833
6844
  index("idxArtifactsAuthorId").on(t.authorId),
6834
6845
  index("idxArtifactsType").on(t.type),
@@ -7018,7 +7029,8 @@ var evalRunEvents = projectSchema.table("eval_run_events", {
7018
7029
  index("idxEvalRunEventsRunIdSeq").on(t.runId, t.seq)
7019
7030
  ]);
7020
7031
  var secrets = projectSchema.table("secrets", {
7021
- id: text("id").primaryKey(),
7032
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7033
+ id: text("id").notNull(),
7022
7034
  key: text("key").notNull(),
7023
7035
  valueCiphertext: bytea("value_ciphertext").notNull(),
7024
7036
  nonce: bytea("nonce").notNull(),
@@ -7031,7 +7043,8 @@ var secrets = projectSchema.table("secrets", {
7031
7043
  lastReadAt: text("last_read_at"),
7032
7044
  lastReadBy: text("last_read_by")
7033
7045
  }, (t) => [
7034
- unique("secrets_key_unique").on(t.key),
7046
+ primaryKey({ columns: [t.projectId, t.id] }),
7047
+ unique("secrets_key_unique").on(t.projectId, t.key),
7035
7048
  check("secrets_access_policy_check", sql`${t.accessPolicy} IN ('auto', 'prompt', 'deny')`),
7036
7049
  check("secrets_env_exportable_check", sql`${t.envExportable} IN (0, 1)`)
7037
7050
  ]);
@@ -7073,10 +7086,11 @@ var missions = projectSchema.table("missions", {
7073
7086
  updatedAt: text("updated_at").notNull()
7074
7087
  }, (t) => [primaryKey({ columns: [t.projectId, t.id] })]);
7075
7088
  var branchGroups = projectSchema.table("branch_groups", {
7076
- id: text("id").primaryKey(),
7089
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7090
+ id: text("id").notNull(),
7077
7091
  sourceType: text("source_type").notNull(),
7078
7092
  sourceId: text("source_id").notNull(),
7079
- branchName: text("branch_name").notNull().unique(),
7093
+ branchName: text("branch_name").notNull(),
7080
7094
  worktreePath: text("worktree_path"),
7081
7095
  autoMerge: integer("auto_merge").notNull().default(0),
7082
7096
  prState: text("pr_state").notNull().default("none"),
@@ -7092,6 +7106,8 @@ var branchGroups = projectSchema.table("branch_groups", {
7092
7106
  updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
7093
7107
  closedAt: bigint("closed_at", { mode: "number" })
7094
7108
  }, (t) => [
7109
+ primaryKey({ columns: [t.projectId, t.id] }),
7110
+ unique("branch_groups_branch_name_key").on(t.projectId, t.branchName),
7095
7111
  check("branch_groups_source_type_check", sql`${t.sourceType} IN ('mission','planning','new-task')`),
7096
7112
  check("branch_groups_pr_state_check", sql`${t.prState} IN ('none','open','merged','closed')`),
7097
7113
  check("branch_groups_status_check", sql`${t.status} IN ('open','finalized','abandoned')`),
@@ -7493,12 +7509,14 @@ var usageEvents = projectSchema.table("usage_events", {
7493
7509
  index("idxUsageEventsKindTs").on(t.kind, t.ts)
7494
7510
  ]);
7495
7511
  var pluginActivations = projectSchema.table("plugin_activations", {
7496
- id: integer("id").generatedAlwaysAsIdentity().primaryKey(),
7512
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7513
+ id: integer("id").generatedAlwaysAsIdentity().notNull(),
7497
7514
  pluginId: text("plugin_id").notNull(),
7498
7515
  source: text("source").notNull(),
7499
7516
  pluginVersion: text("plugin_version"),
7500
7517
  activatedAt: text("activated_at").notNull()
7501
7518
  }, (t) => [
7519
+ primaryKey({ columns: [t.projectId, t.id] }),
7502
7520
  index("idxPluginActivationsActivatedAt").on(t.activatedAt),
7503
7521
  index("idxPluginActivationsPluginId").on(t.pluginId)
7504
7522
  ]);
@@ -7523,8 +7541,13 @@ var knowledgePages = projectSchema.table("knowledge_pages", {
7523
7541
  index("idxKnowledgePagesUpdatedAt").on(t.updatedAt)
7524
7542
  ]);
7525
7543
  var deployments = projectSchema.table("deployments", {
7526
- id: integer("id").generatedAlwaysAsIdentity().primaryKey(),
7527
- projectId: text("project_id").notNull().default(""),
7544
+ id: integer("id").generatedAlwaysAsIdentity().notNull(),
7545
+ /*
7546
+ FNXC:MultiProjectIsolation 2026-08-12-15:43:
7547
+ Migration 0006 rebuilt deployments_pkey as (project_id, id). Drizzle emits DEFAULT while the
7548
+ database GUC/trigger keeps ownership stamping and the physical legacy fallback authoritative.
7549
+ */
7550
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7528
7551
  deploymentId: text("deployment_id").notNull(),
7529
7552
  service: text("service"),
7530
7553
  environment: text("environment"),
@@ -7535,6 +7558,7 @@ var deployments = projectSchema.table("deployments", {
7535
7558
  meta: jsonb("meta"),
7536
7559
  createdAt: text("created_at").notNull()
7537
7560
  }, (t) => [
7561
+ primaryKey({ columns: [t.projectId, t.id], name: "deployments_pkey" }),
7538
7562
  uniqueIndex("idxDeploymentsProjectDeploymentId").on(t.projectId, t.deploymentId),
7539
7563
  index("idxDeploymentsProjectDeployedAt").on(t.projectId, t.deployedAt),
7540
7564
  index("idxDeploymentsDeployedAt").on(t.deployedAt),
@@ -7542,7 +7566,12 @@ var deployments = projectSchema.table("deployments", {
7542
7566
  ]);
7543
7567
  var githubCheckStates = projectSchema.table("github_check_states", {
7544
7568
  id: integer("id").generatedAlwaysAsIdentity().notNull(),
7545
- projectId: text("project_id").notNull().default(""),
7569
+ /*
7570
+ FNXC:MultiProjectIsolation 2026-08-12-15:43:
7571
+ Migration 0048 post-dated 0006, so FN-9004 reconciles its physical default to the ownership
7572
+ expression. Drizzle emits DEFAULT while the database GUC/trigger remains the stamping authority.
7573
+ */
7574
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7546
7575
  repo: text("repo").notNull(),
7547
7576
  headSha: text("head_sha").notNull(),
7548
7577
  checkName: text("check_name").notNull(),
@@ -7562,9 +7591,14 @@ var githubCheckStates = projectSchema.table("github_check_states", {
7562
7591
  index("idxGithubCheckStatesProjectReceived").on(t.projectId, t.receivedAt)
7563
7592
  ]);
7564
7593
  var incidents = projectSchema.table("incidents", {
7565
- id: integer("id").generatedAlwaysAsIdentity().primaryKey(),
7566
- projectId: text("project_id").notNull().default(""),
7567
- incidentId: text("incident_id").notNull().unique(),
7594
+ id: integer("id").generatedAlwaysAsIdentity().notNull(),
7595
+ /*
7596
+ FNXC:MultiProjectIsolation 2026-08-12-15:43:
7597
+ Migration 0006 rebuilt incident keys with project_id first. Drizzle emits DEFAULT while the
7598
+ database GUC/trigger retains ownership stamping and its physical legacy fallback.
7599
+ */
7600
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7601
+ incidentId: text("incident_id").notNull(),
7568
7602
  groupingKey: text("grouping_key").notNull(),
7569
7603
  title: text("title").notNull(),
7570
7604
  severity: text("severity"),
@@ -7578,6 +7612,8 @@ var incidents = projectSchema.table("incidents", {
7578
7612
  createdAt: text("created_at").notNull(),
7579
7613
  updatedAt: text("updated_at").notNull()
7580
7614
  }, (t) => [
7615
+ primaryKey({ columns: [t.projectId, t.id], name: "incidents_pkey" }),
7616
+ unique("incidents_incident_id_key").on(t.projectId, t.incidentId),
7581
7617
  index("idxIncidentsProjectOpenedAt").on(t.projectId, t.openedAt),
7582
7618
  index("idxIncidentsProjectStatus").on(t.projectId, t.status),
7583
7619
  index("idxIncidentsGroupingKey").on(t.groupingKey),
@@ -7632,12 +7668,14 @@ var messages = projectSchema.table("messages", {
7632
7668
  content: text("content").notNull(),
7633
7669
  type: text("type").notNull(),
7634
7670
  read: integer("read").default(0),
7671
+ archived: integer("archived").default(0),
7635
7672
  metadata: jsonb("metadata"),
7636
7673
  createdAt: text("created_at").notNull(),
7637
7674
  updatedAt: text("updated_at").notNull()
7638
7675
  }, (t) => [
7639
7676
  primaryKey({ columns: [t.projectId, t.id] }),
7640
7677
  index("idxMessagesTo").on(t.toId, t.toType, t.read),
7678
+ index("idxMessagesToArchived").on(t.toId, t.toType, t.archived),
7641
7679
  index("idxMessagesFrom").on(t.fromId, t.fromType),
7642
7680
  index("idxMessagesCreatedAt").on(t.createdAt)
7643
7681
  ]);
@@ -7738,7 +7776,8 @@ var cliSessions = projectSchema.table("cli_sessions", {
7738
7776
  index("idx_cli_sessions_project_state").on(t.projectId, t.agentState)
7739
7777
  ]);
7740
7778
  var chatMessages = projectSchema.table("chat_messages", {
7741
- id: text("id").primaryKey(),
7779
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7780
+ id: text("id").notNull(),
7742
7781
  sessionId: text("session_id").notNull(),
7743
7782
  role: text("role").notNull(),
7744
7783
  content: text("content").notNull(),
@@ -7747,6 +7786,7 @@ var chatMessages = projectSchema.table("chat_messages", {
7747
7786
  createdAt: text("created_at").notNull(),
7748
7787
  attachments: jsonb("attachments")
7749
7788
  }, (t) => [
7789
+ primaryKey({ columns: [t.projectId, t.id] }),
7750
7790
  index("idxChatMessagesSessionId").on(t.sessionId),
7751
7791
  index("idxChatMessagesCreatedAt").on(t.createdAt)
7752
7792
  ]);
@@ -7772,7 +7812,8 @@ var chatTokenUsage = projectSchema.table("chat_token_usage", {
7772
7812
  index("idxChatTokenUsageCreatedAt").on(t.createdAt)
7773
7813
  ]);
7774
7814
  var runAuditEvents = projectSchema.table("run_audit_events", {
7775
- id: text("id").primaryKey(),
7815
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7816
+ id: text("id").notNull(),
7776
7817
  timestamp: text("timestamp").notNull(),
7777
7818
  taskId: text("task_id"),
7778
7819
  agentId: text("agent_id").notNull(),
@@ -7782,6 +7823,7 @@ var runAuditEvents = projectSchema.table("run_audit_events", {
7782
7823
  target: text("target").notNull(),
7783
7824
  metadata: jsonb("metadata")
7784
7825
  }, (t) => [
7826
+ primaryKey({ columns: [t.projectId, t.id] }),
7785
7827
  index("idxRunAuditEventsRunIdTimestamp").on(t.runId, t.timestamp),
7786
7828
  index("idxRunAuditEventsTaskIdTimestamp").on(t.taskId, t.timestamp),
7787
7829
  index("idxRunAuditEventsTimestamp").on(t.timestamp)
@@ -7882,13 +7924,14 @@ var missionLineageStops = projectSchema.table("mission_lineage_stops", {
7882
7924
  index("idxMissionLineageStopsMissionId").on(t.projectId, t.missionId)
7883
7925
  ]);
7884
7926
  var verificationCache = projectSchema.table("verification_cache", {
7927
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7885
7928
  treeSha: text("tree_sha").notNull(),
7886
7929
  testCommand: text("test_command").notNull().default(""),
7887
7930
  buildCommand: text("build_command").notNull().default(""),
7888
7931
  recordedAt: text("recorded_at").notNull(),
7889
7932
  taskId: text("task_id")
7890
7933
  }, (t) => [
7891
- primaryKey({ columns: [t.treeSha, t.testCommand, t.buildCommand] }),
7934
+ primaryKey({ columns: [t.projectId, t.treeSha, t.testCommand, t.buildCommand] }),
7892
7935
  index("idxVerificationCacheRecordedAt").on(t.recordedAt)
7893
7936
  ]);
7894
7937
  var importTranslationCache = projectSchema.table("import_translation_cache", {
@@ -7921,7 +7964,8 @@ var importTranslationCache = projectSchema.table("import_translation_cache", {
7921
7964
  index("idxImportTranslationCacheRecordedAt").on(t.recordedAt)
7922
7965
  ]);
7923
7966
  var approvalRequests = projectSchema.table("approval_requests", {
7924
- id: text("id").primaryKey(),
7967
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7968
+ id: text("id").notNull(),
7925
7969
  status: text("status").notNull(),
7926
7970
  requesterActorId: text("requester_actor_id").notNull(),
7927
7971
  requesterActorType: text("requester_actor_type").notNull(),
@@ -7940,13 +7984,14 @@ var approvalRequests = projectSchema.table("approval_requests", {
7940
7984
  createdAt: text("created_at").notNull(),
7941
7985
  updatedAt: text("updated_at").notNull()
7942
7986
  }, (t) => [
7987
+ primaryKey({ columns: [t.projectId, t.id] }),
7943
7988
  index("idxApprovalRequestsStatusCreatedAt").on(t.status, t.createdAt),
7944
7989
  index("idxApprovalRequestsRequesterCreatedAt").on(t.requesterActorId, t.createdAt),
7945
7990
  index("idxApprovalRequestsTaskCreatedAt").on(t.taskId, t.createdAt)
7946
7991
  ]);
7947
7992
  var approvalRequestAuditEvents = projectSchema.table("approval_request_audit_events", {
7948
- projectId: text("project_id").notNull().default(""),
7949
- id: text("id").primaryKey(),
7993
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7994
+ id: text("id").notNull(),
7950
7995
  requestId: text("request_id").notNull(),
7951
7996
  eventType: text("event_type").notNull(),
7952
7997
  actorId: text("actor_id").notNull(),
@@ -7955,6 +8000,7 @@ var approvalRequestAuditEvents = projectSchema.table("approval_request_audit_eve
7955
8000
  note: text("note"),
7956
8001
  createdAt: text("created_at").notNull()
7957
8002
  }, (t) => [
8003
+ primaryKey({ columns: [t.projectId, t.id] }),
7958
8004
  index("idxApprovalRequestAuditRequestCreatedAt").on(t.requestId, t.createdAt, t.id),
7959
8005
  index("idxApprovalRequestAuditProjectCreatedAt").on(t.projectId, t.createdAt)
7960
8006
  ]);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusion-plugin-examples/quality",
3
- "version": "0.1.10-beta.1",
3
+ "version": "0.1.10-beta.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -6141,9 +6141,14 @@ var config = projectSchema.table("config", {
6141
6141
  // now keyed per-project on `project_id` (the effective PK). `id` is retained
6142
6142
  // for column-shape parity (always 1) but is no longer the PK and no longer
6143
6143
  // CHECK-constrained. Single-project / SQLite-parity callers leave project_id
6144
- // at its '' default (one row), preserving the pre-isolation behavior.
6144
+ // through the database ownership trigger, preserving the pre-isolation behavior.
6145
+ /*
6146
+ FNXC:MultiProjectIsolation 2026-08-12-15:43:
6147
+ Migration 0006 owns config's project_id default and leaves its catalog PK as (project_id).
6148
+ Drizzle emits DEFAULT while the database GUC/trigger selects the effective ownership partition.
6149
+ */
6145
6150
  id: integer("id").default(1),
6146
- projectId: text("project_id").notNull().default("").primaryKey(),
6151
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`).primaryKey(),
6147
6152
  nextId: integer("next_id").default(1),
6148
6153
  nextWorkflowStepId: integer("next_workflow_step_id").default(1),
6149
6154
  // FNXC:SqliteFinalRemoval 2026-06-28:
@@ -6537,9 +6542,13 @@ var taskCommitAssociations = projectSchema.table("task_commit_associations", {
6537
6542
  var automations = projectSchema.table("automations", {
6538
6543
  /*
6539
6544
  * FNXC:AutomationIsolation 2026-07-13-22:37:
6540
- * Automations are partitioned by the AsyncDataLayer's project ID because embedded PostgreSQL consolidates the per-project SQLite files into one table. The composite key deliberately permits the same automation ID in two projects without allowing either project's CRUD or cron-claim path to address the other row. The empty default preserves an explicit partition for legacy and project-agnostic callers until startup stamps migrated rows.
6545
+ * Automations are partitioned by the AsyncDataLayer's project ID because embedded PostgreSQL consolidates the per-project SQLite files into one table. The composite key deliberately permits the same automation ID in two projects without allowing either project's CRUD or cron-claim path to address the other row.
6546
+ *
6547
+ * FNXC:MultiProjectIsolation 2026-08-12-15:43:
6548
+ * Migration 0006 owns the default through the database GUC/trigger; Drizzle emits DEFAULT
6549
+ * without replacing the physical legacy fallback or the fail-closed bound writer contract.
6541
6550
  */
6542
- projectId: text("project_id").notNull().default(""),
6551
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
6543
6552
  id: text("id").notNull(),
6544
6553
  name: text("name").notNull(),
6545
6554
  description: text("description"),
@@ -6838,7 +6847,8 @@ var taskDocuments = projectSchema.table("task_documents", {
6838
6847
  index("idxTaskDocumentsTaskId").on(t.taskId)
6839
6848
  ]);
6840
6849
  var artifacts = projectSchema.table("artifacts", {
6841
- id: text("id").primaryKey(),
6850
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
6851
+ id: text("id").notNull(),
6842
6852
  type: text("type").notNull(),
6843
6853
  title: text("title").notNull(),
6844
6854
  description: text("description"),
@@ -6853,7 +6863,8 @@ var artifacts = projectSchema.table("artifacts", {
6853
6863
  createdAt: text("created_at").notNull(),
6854
6864
  updatedAt: text("updated_at").notNull()
6855
6865
  }, (t) => [
6856
- foreignKey({ columns: [t.taskId], foreignColumns: [tasks.id] }).onDelete("cascade"),
6866
+ primaryKey({ columns: [t.projectId, t.id] }),
6867
+ foreignKey({ name: "artifacts_task_id_fkey", columns: [t.projectId, t.taskId], foreignColumns: [tasks.projectId, tasks.id] }).onDelete("cascade"),
6857
6868
  index("idxArtifactsTaskId").on(t.taskId),
6858
6869
  index("idxArtifactsAuthorId").on(t.authorId),
6859
6870
  index("idxArtifactsType").on(t.type),
@@ -7043,7 +7054,8 @@ var evalRunEvents = projectSchema.table("eval_run_events", {
7043
7054
  index("idxEvalRunEventsRunIdSeq").on(t.runId, t.seq)
7044
7055
  ]);
7045
7056
  var secrets = projectSchema.table("secrets", {
7046
- id: text("id").primaryKey(),
7057
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7058
+ id: text("id").notNull(),
7047
7059
  key: text("key").notNull(),
7048
7060
  valueCiphertext: bytea("value_ciphertext").notNull(),
7049
7061
  nonce: bytea("nonce").notNull(),
@@ -7056,7 +7068,8 @@ var secrets = projectSchema.table("secrets", {
7056
7068
  lastReadAt: text("last_read_at"),
7057
7069
  lastReadBy: text("last_read_by")
7058
7070
  }, (t) => [
7059
- unique("secrets_key_unique").on(t.key),
7071
+ primaryKey({ columns: [t.projectId, t.id] }),
7072
+ unique("secrets_key_unique").on(t.projectId, t.key),
7060
7073
  check("secrets_access_policy_check", sql`${t.accessPolicy} IN ('auto', 'prompt', 'deny')`),
7061
7074
  check("secrets_env_exportable_check", sql`${t.envExportable} IN (0, 1)`)
7062
7075
  ]);
@@ -7098,10 +7111,11 @@ var missions = projectSchema.table("missions", {
7098
7111
  updatedAt: text("updated_at").notNull()
7099
7112
  }, (t) => [primaryKey({ columns: [t.projectId, t.id] })]);
7100
7113
  var branchGroups = projectSchema.table("branch_groups", {
7101
- id: text("id").primaryKey(),
7114
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7115
+ id: text("id").notNull(),
7102
7116
  sourceType: text("source_type").notNull(),
7103
7117
  sourceId: text("source_id").notNull(),
7104
- branchName: text("branch_name").notNull().unique(),
7118
+ branchName: text("branch_name").notNull(),
7105
7119
  worktreePath: text("worktree_path"),
7106
7120
  autoMerge: integer("auto_merge").notNull().default(0),
7107
7121
  prState: text("pr_state").notNull().default("none"),
@@ -7117,6 +7131,8 @@ var branchGroups = projectSchema.table("branch_groups", {
7117
7131
  updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
7118
7132
  closedAt: bigint("closed_at", { mode: "number" })
7119
7133
  }, (t) => [
7134
+ primaryKey({ columns: [t.projectId, t.id] }),
7135
+ unique("branch_groups_branch_name_key").on(t.projectId, t.branchName),
7120
7136
  check("branch_groups_source_type_check", sql`${t.sourceType} IN ('mission','planning','new-task')`),
7121
7137
  check("branch_groups_pr_state_check", sql`${t.prState} IN ('none','open','merged','closed')`),
7122
7138
  check("branch_groups_status_check", sql`${t.status} IN ('open','finalized','abandoned')`),
@@ -7518,12 +7534,14 @@ var usageEvents = projectSchema.table("usage_events", {
7518
7534
  index("idxUsageEventsKindTs").on(t.kind, t.ts)
7519
7535
  ]);
7520
7536
  var pluginActivations = projectSchema.table("plugin_activations", {
7521
- id: integer("id").generatedAlwaysAsIdentity().primaryKey(),
7537
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7538
+ id: integer("id").generatedAlwaysAsIdentity().notNull(),
7522
7539
  pluginId: text("plugin_id").notNull(),
7523
7540
  source: text("source").notNull(),
7524
7541
  pluginVersion: text("plugin_version"),
7525
7542
  activatedAt: text("activated_at").notNull()
7526
7543
  }, (t) => [
7544
+ primaryKey({ columns: [t.projectId, t.id] }),
7527
7545
  index("idxPluginActivationsActivatedAt").on(t.activatedAt),
7528
7546
  index("idxPluginActivationsPluginId").on(t.pluginId)
7529
7547
  ]);
@@ -7548,8 +7566,13 @@ var knowledgePages = projectSchema.table("knowledge_pages", {
7548
7566
  index("idxKnowledgePagesUpdatedAt").on(t.updatedAt)
7549
7567
  ]);
7550
7568
  var deployments = projectSchema.table("deployments", {
7551
- id: integer("id").generatedAlwaysAsIdentity().primaryKey(),
7552
- projectId: text("project_id").notNull().default(""),
7569
+ id: integer("id").generatedAlwaysAsIdentity().notNull(),
7570
+ /*
7571
+ FNXC:MultiProjectIsolation 2026-08-12-15:43:
7572
+ Migration 0006 rebuilt deployments_pkey as (project_id, id). Drizzle emits DEFAULT while the
7573
+ database GUC/trigger keeps ownership stamping and the physical legacy fallback authoritative.
7574
+ */
7575
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7553
7576
  deploymentId: text("deployment_id").notNull(),
7554
7577
  service: text("service"),
7555
7578
  environment: text("environment"),
@@ -7560,6 +7583,7 @@ var deployments = projectSchema.table("deployments", {
7560
7583
  meta: jsonb("meta"),
7561
7584
  createdAt: text("created_at").notNull()
7562
7585
  }, (t) => [
7586
+ primaryKey({ columns: [t.projectId, t.id], name: "deployments_pkey" }),
7563
7587
  uniqueIndex("idxDeploymentsProjectDeploymentId").on(t.projectId, t.deploymentId),
7564
7588
  index("idxDeploymentsProjectDeployedAt").on(t.projectId, t.deployedAt),
7565
7589
  index("idxDeploymentsDeployedAt").on(t.deployedAt),
@@ -7567,7 +7591,12 @@ var deployments = projectSchema.table("deployments", {
7567
7591
  ]);
7568
7592
  var githubCheckStates = projectSchema.table("github_check_states", {
7569
7593
  id: integer("id").generatedAlwaysAsIdentity().notNull(),
7570
- projectId: text("project_id").notNull().default(""),
7594
+ /*
7595
+ FNXC:MultiProjectIsolation 2026-08-12-15:43:
7596
+ Migration 0048 post-dated 0006, so FN-9004 reconciles its physical default to the ownership
7597
+ expression. Drizzle emits DEFAULT while the database GUC/trigger remains the stamping authority.
7598
+ */
7599
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7571
7600
  repo: text("repo").notNull(),
7572
7601
  headSha: text("head_sha").notNull(),
7573
7602
  checkName: text("check_name").notNull(),
@@ -7587,9 +7616,14 @@ var githubCheckStates = projectSchema.table("github_check_states", {
7587
7616
  index("idxGithubCheckStatesProjectReceived").on(t.projectId, t.receivedAt)
7588
7617
  ]);
7589
7618
  var incidents = projectSchema.table("incidents", {
7590
- id: integer("id").generatedAlwaysAsIdentity().primaryKey(),
7591
- projectId: text("project_id").notNull().default(""),
7592
- incidentId: text("incident_id").notNull().unique(),
7619
+ id: integer("id").generatedAlwaysAsIdentity().notNull(),
7620
+ /*
7621
+ FNXC:MultiProjectIsolation 2026-08-12-15:43:
7622
+ Migration 0006 rebuilt incident keys with project_id first. Drizzle emits DEFAULT while the
7623
+ database GUC/trigger retains ownership stamping and its physical legacy fallback.
7624
+ */
7625
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7626
+ incidentId: text("incident_id").notNull(),
7593
7627
  groupingKey: text("grouping_key").notNull(),
7594
7628
  title: text("title").notNull(),
7595
7629
  severity: text("severity"),
@@ -7603,6 +7637,8 @@ var incidents = projectSchema.table("incidents", {
7603
7637
  createdAt: text("created_at").notNull(),
7604
7638
  updatedAt: text("updated_at").notNull()
7605
7639
  }, (t) => [
7640
+ primaryKey({ columns: [t.projectId, t.id], name: "incidents_pkey" }),
7641
+ unique("incidents_incident_id_key").on(t.projectId, t.incidentId),
7606
7642
  index("idxIncidentsProjectOpenedAt").on(t.projectId, t.openedAt),
7607
7643
  index("idxIncidentsProjectStatus").on(t.projectId, t.status),
7608
7644
  index("idxIncidentsGroupingKey").on(t.groupingKey),
@@ -7657,12 +7693,14 @@ var messages = projectSchema.table("messages", {
7657
7693
  content: text("content").notNull(),
7658
7694
  type: text("type").notNull(),
7659
7695
  read: integer("read").default(0),
7696
+ archived: integer("archived").default(0),
7660
7697
  metadata: jsonb("metadata"),
7661
7698
  createdAt: text("created_at").notNull(),
7662
7699
  updatedAt: text("updated_at").notNull()
7663
7700
  }, (t) => [
7664
7701
  primaryKey({ columns: [t.projectId, t.id] }),
7665
7702
  index("idxMessagesTo").on(t.toId, t.toType, t.read),
7703
+ index("idxMessagesToArchived").on(t.toId, t.toType, t.archived),
7666
7704
  index("idxMessagesFrom").on(t.fromId, t.fromType),
7667
7705
  index("idxMessagesCreatedAt").on(t.createdAt)
7668
7706
  ]);
@@ -7763,7 +7801,8 @@ var cliSessions = projectSchema.table("cli_sessions", {
7763
7801
  index("idx_cli_sessions_project_state").on(t.projectId, t.agentState)
7764
7802
  ]);
7765
7803
  var chatMessages = projectSchema.table("chat_messages", {
7766
- id: text("id").primaryKey(),
7804
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7805
+ id: text("id").notNull(),
7767
7806
  sessionId: text("session_id").notNull(),
7768
7807
  role: text("role").notNull(),
7769
7808
  content: text("content").notNull(),
@@ -7772,6 +7811,7 @@ var chatMessages = projectSchema.table("chat_messages", {
7772
7811
  createdAt: text("created_at").notNull(),
7773
7812
  attachments: jsonb("attachments")
7774
7813
  }, (t) => [
7814
+ primaryKey({ columns: [t.projectId, t.id] }),
7775
7815
  index("idxChatMessagesSessionId").on(t.sessionId),
7776
7816
  index("idxChatMessagesCreatedAt").on(t.createdAt)
7777
7817
  ]);
@@ -7797,7 +7837,8 @@ var chatTokenUsage = projectSchema.table("chat_token_usage", {
7797
7837
  index("idxChatTokenUsageCreatedAt").on(t.createdAt)
7798
7838
  ]);
7799
7839
  var runAuditEvents = projectSchema.table("run_audit_events", {
7800
- id: text("id").primaryKey(),
7840
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7841
+ id: text("id").notNull(),
7801
7842
  timestamp: text("timestamp").notNull(),
7802
7843
  taskId: text("task_id"),
7803
7844
  agentId: text("agent_id").notNull(),
@@ -7807,6 +7848,7 @@ var runAuditEvents = projectSchema.table("run_audit_events", {
7807
7848
  target: text("target").notNull(),
7808
7849
  metadata: jsonb("metadata")
7809
7850
  }, (t) => [
7851
+ primaryKey({ columns: [t.projectId, t.id] }),
7810
7852
  index("idxRunAuditEventsRunIdTimestamp").on(t.runId, t.timestamp),
7811
7853
  index("idxRunAuditEventsTaskIdTimestamp").on(t.taskId, t.timestamp),
7812
7854
  index("idxRunAuditEventsTimestamp").on(t.timestamp)
@@ -7907,13 +7949,14 @@ var missionLineageStops = projectSchema.table("mission_lineage_stops", {
7907
7949
  index("idxMissionLineageStopsMissionId").on(t.projectId, t.missionId)
7908
7950
  ]);
7909
7951
  var verificationCache = projectSchema.table("verification_cache", {
7952
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7910
7953
  treeSha: text("tree_sha").notNull(),
7911
7954
  testCommand: text("test_command").notNull().default(""),
7912
7955
  buildCommand: text("build_command").notNull().default(""),
7913
7956
  recordedAt: text("recorded_at").notNull(),
7914
7957
  taskId: text("task_id")
7915
7958
  }, (t) => [
7916
- primaryKey({ columns: [t.treeSha, t.testCommand, t.buildCommand] }),
7959
+ primaryKey({ columns: [t.projectId, t.treeSha, t.testCommand, t.buildCommand] }),
7917
7960
  index("idxVerificationCacheRecordedAt").on(t.recordedAt)
7918
7961
  ]);
7919
7962
  var importTranslationCache = projectSchema.table("import_translation_cache", {
@@ -7946,7 +7989,8 @@ var importTranslationCache = projectSchema.table("import_translation_cache", {
7946
7989
  index("idxImportTranslationCacheRecordedAt").on(t.recordedAt)
7947
7990
  ]);
7948
7991
  var approvalRequests = projectSchema.table("approval_requests", {
7949
- id: text("id").primaryKey(),
7992
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
7993
+ id: text("id").notNull(),
7950
7994
  status: text("status").notNull(),
7951
7995
  requesterActorId: text("requester_actor_id").notNull(),
7952
7996
  requesterActorType: text("requester_actor_type").notNull(),
@@ -7965,13 +8009,14 @@ var approvalRequests = projectSchema.table("approval_requests", {
7965
8009
  createdAt: text("created_at").notNull(),
7966
8010
  updatedAt: text("updated_at").notNull()
7967
8011
  }, (t) => [
8012
+ primaryKey({ columns: [t.projectId, t.id] }),
7968
8013
  index("idxApprovalRequestsStatusCreatedAt").on(t.status, t.createdAt),
7969
8014
  index("idxApprovalRequestsRequesterCreatedAt").on(t.requesterActorId, t.createdAt),
7970
8015
  index("idxApprovalRequestsTaskCreatedAt").on(t.taskId, t.createdAt)
7971
8016
  ]);
7972
8017
  var approvalRequestAuditEvents = projectSchema.table("approval_request_audit_events", {
7973
- projectId: text("project_id").notNull().default(""),
7974
- id: text("id").primaryKey(),
8018
+ projectId: text("project_id").notNull().default(sql`current_setting('fusion.project_id', true)`),
8019
+ id: text("id").notNull(),
7975
8020
  requestId: text("request_id").notNull(),
7976
8021
  eventType: text("event_type").notNull(),
7977
8022
  actorId: text("actor_id").notNull(),
@@ -7980,6 +8025,7 @@ var approvalRequestAuditEvents = projectSchema.table("approval_request_audit_eve
7980
8025
  note: text("note"),
7981
8026
  createdAt: text("created_at").notNull()
7982
8027
  }, (t) => [
8028
+ primaryKey({ columns: [t.projectId, t.id] }),
7983
8029
  index("idxApprovalRequestAuditRequestCreatedAt").on(t.requestId, t.createdAt, t.id),
7984
8030
  index("idxApprovalRequestAuditProjectCreatedAt").on(t.projectId, t.createdAt)
7985
8031
  ]);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusion-plugin-examples/reports",
3
- "version": "0.1.54-beta.1",
3
+ "version": "0.1.54-beta.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {