better-supabase 0.30.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/dist/{adapter-D4aNBxhm.js → adapter-BTbj5N9C.js} +2 -52
  2. package/dist/ai-sdk/agents/index.d.ts +2 -2
  3. package/dist/{app-tables-yyVncXEt.d.ts → app-tables-B2mKMNRQ.d.ts} +1 -1
  4. package/dist/astro/index.js +2 -2
  5. package/dist/{authorization-CDU9tYA_.d.ts → authorization-DfEkyFt_.d.ts} +10 -3
  6. package/dist/{bind-p7asfI6H.d.ts → bind-DAx0bMSi.d.ts} +2 -2
  7. package/dist/{block-env-B8wG3xeh.d.ts → block-env-Dz7Caxk0.d.ts} +3 -3
  8. package/dist/blocks/ai-chat/index.d.ts +3 -3
  9. package/dist/blocks/announcements/index.d.ts +3 -3
  10. package/dist/blocks/api-keys/index.d.ts +1 -1
  11. package/dist/blocks/attachments/index.d.ts +1 -1
  12. package/dist/blocks/audit/index.d.ts +2 -2
  13. package/dist/blocks/automations/index.d.ts +1 -1
  14. package/dist/blocks/billing/index.d.ts +1 -1
  15. package/dist/blocks/bookings/index.d.ts +1 -1
  16. package/dist/blocks/calendar/index.d.ts +7 -3
  17. package/dist/blocks/calendar/index.js +5 -1
  18. package/dist/blocks/comments/index.d.ts +4 -4
  19. package/dist/blocks/employees/index.js +1 -4
  20. package/dist/blocks/entitlements/index.d.ts +2 -2
  21. package/dist/blocks/forms/index.d.ts +1 -1
  22. package/dist/blocks/inbox/index.d.ts +4 -4
  23. package/dist/blocks/index.d.ts +1 -1
  24. package/dist/blocks/messaging/index.d.ts +4 -4
  25. package/dist/blocks/mfa/index.d.ts +1 -1
  26. package/dist/blocks/notifications/index.d.ts +3 -3
  27. package/dist/blocks/notifications/index.js +5 -43
  28. package/dist/blocks/onboarding/index.d.ts +1 -1
  29. package/dist/blocks/organizations/index.d.ts +34 -21
  30. package/dist/blocks/organizations/index.js +5 -1
  31. package/dist/blocks/permissions/index.d.ts +32 -3
  32. package/dist/blocks/permissions/index.js +23 -2
  33. package/dist/blocks/push/index.d.ts +10 -2
  34. package/dist/blocks/push/index.js +23 -7
  35. package/dist/blocks/reactions/index.d.ts +3 -3
  36. package/dist/blocks/saved-views/index.d.ts +1 -1
  37. package/dist/blocks/search/index.d.ts +2 -2
  38. package/dist/blocks/sessions/index.d.ts +1 -1
  39. package/dist/blocks/settings/index.d.ts +1 -1
  40. package/dist/blocks/subjects/index.d.ts +1 -1
  41. package/dist/blocks/tags/index.d.ts +1 -1
  42. package/dist/blocks/tasks/index.js +1 -1
  43. package/dist/blocks/teams/index.d.ts +7 -1
  44. package/dist/blocks/teams/index.js +8 -7
  45. package/dist/blocks/undo/index.d.ts +1 -1
  46. package/dist/blocks/usage/index.d.ts +1 -1
  47. package/dist/blocks/workflow-editor/index.d.ts +3 -3
  48. package/dist/blocks/workflows/index.d.ts +3 -3
  49. package/dist/cli/{add-Dggyehsy.js → add-B9wP0YGU.js} +2 -2
  50. package/dist/cli/{add-D4w-Axib.js → add-DjZXKd7X.js} +10 -10
  51. package/dist/cli/add-ZcEOEK23.js +1 -0
  52. package/dist/cli/{app-table-files-CiGuwLkO.js → app-table-files-mtvjHa48.js} +2 -2
  53. package/dist/cli/{backfill-DjVjXW_P.js → backfill-Coshdvh_.js} +2 -2
  54. package/dist/cli/bin.js +1 -1
  55. package/dist/cli/{blocks-jRL9K1R8.js → blocks-BWCuA0nq.js} +2 -2
  56. package/dist/cli/{blocks-Bbmb6W_F.js → blocks-hiSazThw.js} +1 -1
  57. package/dist/cli/{cache-BuoIFlUJ.js → cache-x2wWAy0h.js} +1 -1
  58. package/dist/cli/{codemod-DRavXBCb.js → codemod-BnjV7BpC.js} +210 -11
  59. package/dist/cli/{command-DIPmo0wh.js → command-CCAwhiOh.js} +6 -0
  60. package/dist/cli/{completion-DxPxMtyP.js → completion-BJaB84Pe.js} +2 -2
  61. package/dist/cli/{completion-DyLMSjOD.js → completion-BkUhs1ms.js} +1 -1
  62. package/dist/cli/{completion-FUgqm2-N.js → completion-DmUVsUVQ.js} +2 -2
  63. package/dist/cli/{config-BfapErxs.js → config-zId1jkLx.js} +1 -1
  64. package/dist/cli/{content-mapper-BCtyfKXl.js → content-mapper-DvOSOdTE.js} +2 -2
  65. package/dist/cli/{db-CWvH1_46.js → db-DXKyVEDF.js} +1 -1
  66. package/dist/cli/{doctor-Di2ZekfN.js → doctor-Ywy8oJEU.js} +41 -16
  67. package/dist/cli/env-CNjT_uOV.js +1 -0
  68. package/dist/cli/{env-B2CbnbzD.js → env-XMiKvhtV.js} +1 -1
  69. package/dist/cli/{gen-STKC9vkK.js → gen-B-FbQmG1.js} +14 -14
  70. package/dist/cli/index.d.ts +1 -1
  71. package/dist/cli/index.js +7 -7
  72. package/dist/cli/{init-DW6_nIwj.js → init-fb9e1BKX.js} +9 -9
  73. package/dist/cli/{keys-V-HcO-21.js → keys-ORiPz1sM.js} +1 -1
  74. package/dist/cli/{live-0G4Plw3K.js → live-DIt7TP-N.js} +2 -2
  75. package/dist/cli/{mcp-flKS8iU5.js → mcp-CVWwraga.js} +3 -3
  76. package/dist/cli/{metadata-VARUbXEe.js → metadata-CannIjel.js} +3 -3
  77. package/dist/cli/{migrate-Bkq07XcT.js → migrate-Ht2TzIQF.js} +2 -2
  78. package/dist/cli/{migration-safety-BfVeza5j.js → migration-safety-nNyB05I-.js} +1 -1
  79. package/dist/cli/{migrations-BCq7Zs2E.js → migrations-bAd7dpk1.js} +2 -2
  80. package/dist/cli/{module-migration-lbeUrsYv.js → module-migration-CkNux8dr.js} +2 -2
  81. package/dist/cli/{moved-DNOtp9LA.js → moved-C3WyRHkA.js} +1 -1
  82. package/dist/cli/{parse-BPf3kGnc.js → parse-DjHbTaFI.js} +1 -1
  83. package/dist/cli/{powersync-B15CfH5Y.js → powersync-B2v0tDwp.js} +100 -7
  84. package/dist/cli/powersync-D3mAQ6QE.js +1 -0
  85. package/dist/cli/{print-DjxpBRnv.js → print-CxQ0rBKT.js} +2 -2
  86. package/dist/cli/{providers-dyxcHQY3.js → providers-DtI90lSw.js} +1 -1
  87. package/dist/cli/{remove-BLq5gbal.js → remove-DYtE4IZ4.js} +6 -6
  88. package/dist/cli/{render-CizUf3RW.js → render-QGWfEoiB.js} +3 -3
  89. package/dist/cli/{run-ChEjR7yw.js → run-B5aMwErM.js} +2 -2
  90. package/dist/cli/{run-MwM__teL.js → run-BNoJKf5I.js} +40 -39
  91. package/dist/cli/{run-ChOY6s4o.js → run-DiYX1XEa.js} +8 -8
  92. package/dist/cli/{seed-CDnL4Tnc.js → seed-C-Hu2n_E.js} +1 -1
  93. package/dist/cli/seed-Cm-c0BDd.js +1 -0
  94. package/dist/cli/{shared-DV5wIv-7.js → shared-D_CFi5di.js} +1 -1
  95. package/dist/cli/{skills-DM3oeIxY.js → skills-D98y0bSB.js} +1 -1
  96. package/dist/cli/{snapshot-B5LXkVMC.js → snapshot-BlQ4DDcJ.js} +9 -4
  97. package/dist/cli/{source-BoLNG_2A.js → source-CelMBQMj.js} +1 -1
  98. package/dist/cli/{spec-D6QeE2Zx.js → spec-BxcoGE0h.js} +1 -1
  99. package/dist/cli/{spec-Dz-PGCaM.js → spec-iBx1LcYO.js} +3 -3
  100. package/dist/cli/{sql-layout-zo02f3Dm.js → sql-layout-Dp4Rottt.js} +2 -2
  101. package/dist/cli/{stack-ClESAZYf.js → stack-B2slzrYH.js} +1 -1
  102. package/dist/cli/{sync-m-oZ_SyI.js → sync-BnORI43S.js} +4 -4
  103. package/dist/cli/{table-dyKddjwo.js → table-D6HUECKI.js} +1 -1
  104. package/dist/cli/{upgrade-C9sgVZ5z.js → upgrade-CR6-WmIc.js} +5 -5
  105. package/dist/cli/{upgrade-WwEJaX3i.js → upgrade-fz92aCnh.js} +3 -3
  106. package/dist/cli/{version-D2BQuqta.js → version-Dz8ZlOuh.js} +1 -1
  107. package/dist/client/index.d.ts +5 -5
  108. package/dist/client/native/index.d.ts +4 -4
  109. package/dist/{composite-CBRbvn5j.js → composite-B4qB6k31.js} +2 -2
  110. package/dist/config/index.d.ts +2 -2
  111. package/dist/config/index.js +4 -4
  112. package/dist/{config-r7njjNgh.js → config-B7g-HDis.js} +3 -3
  113. package/dist/{config-bqKaPjst.js → config-R0m0fBiD.js} +1 -1
  114. package/dist/{context-nbYYjv7U.d.ts → context-DWWoP1wK.d.ts} +1 -1
  115. package/dist/{controller-TRocodqG.d.ts → controller-Br9dGKGe.d.ts} +1 -1
  116. package/dist/{controller-qG-B1eDn.js → controller-W97g2WGG.js} +1 -1
  117. package/dist/create/index.d.ts +3 -3
  118. package/dist/create/index.js +3 -3
  119. package/dist/create/lite/index.d.ts +3 -3
  120. package/dist/create/lite/index.js +3 -3
  121. package/dist/delivery-events-DbL8IHIY.js +53 -0
  122. package/dist/edge/index.js +3 -3
  123. package/dist/{entitlements-B1i1-wfe.d.ts → entitlements-CBjm2lvD.d.ts} +1 -1
  124. package/dist/eve/index.js +1 -1
  125. package/dist/expo/index.js +3 -2
  126. package/dist/{field-errors-tJvehEFc.d.ts → field-errors-CEjsMAgd.d.ts} +4 -4
  127. package/dist/{framework-DYEUraqt.js → framework-CqiZk89W.js} +1 -1
  128. package/dist/hono/index.js +2 -2
  129. package/dist/{index-BkzXwuIN.d.ts → index-Clyd2Goi.d.ts} +1 -1
  130. package/dist/{index-zsgNmE8m.d.ts → index-D98bQs8a.d.ts} +7 -7
  131. package/dist/{index-BKrxynq9.d.ts → index-DIdPoQtO.d.ts} +2 -2
  132. package/dist/{index-CWAQRWY8.d.ts → index-I8YLxKq8.d.ts} +2 -2
  133. package/dist/{index-8US7qlvW.d.ts → index-eRBuKtMt.d.ts} +2 -2
  134. package/dist/{index-BM6NmKSc.d.ts → index-uIU65iEn.d.ts} +6 -6
  135. package/dist/{instances-C7qUTjhJ.js → instances-DY_ORk5g.js} +2 -0
  136. package/dist/mapper/bin.js +5 -5
  137. package/dist/mcp/index.d.ts +1 -1
  138. package/dist/mcp/index.js +1 -1
  139. package/dist/mcp/sdk/index.js +1 -1
  140. package/dist/next/index.d.ts +73 -6
  141. package/dist/next/index.js +88 -35
  142. package/dist/{operations-CB9atU2e.d.ts → operations-hm1Isvvs.d.ts} +1 -1
  143. package/dist/{options-BKBy5wM_.js → options-CF6EVF_G.js} +2 -1
  144. package/dist/{options-COo7_3MX.js → options-DSCW40_5.js} +3 -1
  145. package/dist/orpc/index.js +2 -1
  146. package/dist/otel/index.js +4 -4
  147. package/dist/{ports-hpbyMySO.d.ts → ports-DOrPTJzl.d.ts} +1 -1
  148. package/dist/powersync/index.d.ts +204 -4
  149. package/dist/powersync/index.js +361 -4
  150. package/dist/preset/index.d.ts +3 -3
  151. package/dist/preset/index.js +3 -3
  152. package/dist/{preset-DCdEnJj9.js → preset-CXhpPmPV.js} +2 -2
  153. package/dist/{project-B32wb5J6.js → project-DJ9Uo0sT.js} +5 -5
  154. package/dist/{push-token-DQ1ycFPU.d.ts → push-token-B4vcIU4s.d.ts} +1 -1
  155. package/dist/query/index.d.ts +1 -1
  156. package/dist/query/index.js +1 -1
  157. package/dist/react/index.d.ts +5 -5
  158. package/dist/react/index.js +1 -1
  159. package/dist/react/native/index.d.ts +1 -1
  160. package/dist/react/server.d.ts +5 -5
  161. package/dist/react/server.js +1 -1
  162. package/dist/{react-CcrQQl0_.js → react-mdVjpewL.js} +2 -2
  163. package/dist/react-router/index.js +2 -2
  164. package/dist/realtime/index.d.ts +3 -3
  165. package/dist/{record-type-DRbnlj5q.js → record-type-BEUyEsFx.js} +2 -2
  166. package/dist/records/index.d.ts +5 -5
  167. package/dist/records/index.js +3 -3
  168. package/dist/{replicas-Dyoh3CEg.js → refresh-DLBgnxjL.js} +51 -1
  169. package/dist/{resolved-names-iLBOUaib.js → resolved-names-kMRjmSIy.js} +1 -1
  170. package/dist/{runtime-CoKxZibd.js → runtime-LRJM7UqY.js} +19 -20
  171. package/dist/server/index.d.ts +1 -1
  172. package/dist/server/index.js +4 -4
  173. package/dist/{sign-in-Cyj3ZlFX.js → sign-in-CuZ1Ag7O.js} +17 -2
  174. package/dist/solid/index.d.ts +5 -5
  175. package/dist/solid-start/index.js +2 -2
  176. package/dist/spec/index.js +1 -1
  177. package/dist/sql/index.d.ts +4 -4
  178. package/dist/sql/index.js +3 -3
  179. package/dist/{sql-CyeDg3Yh.js → sql-DHp0L7zK.js} +404 -165
  180. package/dist/ssr/index.d.ts +1 -1
  181. package/dist/svelte/index.d.ts +5 -5
  182. package/dist/sveltekit/index.js +2 -2
  183. package/dist/tanstack-start/index.js +2 -2
  184. package/dist/{tenant-C9YE_kqK.d.ts → tenant-FfgNhd5x.d.ts} +1 -1
  185. package/dist/testing/index.d.ts +13 -4
  186. package/dist/testing/index.js +17 -15
  187. package/dist/{timeline-DvXtXq5q.d.ts → timeline-DqEoD8bb.d.ts} +1 -1
  188. package/dist/{timeline--VU3A1e4.js → timeline-Dz3hO2I6.js} +1 -1
  189. package/dist/{topic-breZqx_4.d.ts → topic-BaUElNw2.d.ts} +1 -1
  190. package/dist/{types-C3I7S51U.d.ts → types-CMN0h_Ix.d.ts} +2 -2
  191. package/dist/vue/index.d.ts +5 -5
  192. package/dist/{watch-topic-ItO3dz8m.d.ts → watch-topic-BabDTZ-L.d.ts} +1 -1
  193. package/dist/workflow-sdk/world/index.js +2 -2
  194. package/dist/{workflow-sdk-BWPsdzVK.js → workflow-sdk-DJJkP0dT.js} +12 -1
  195. package/dist/yjs/index.d.ts +1 -1
  196. package/package.json +1 -1
  197. package/schemas/config-v1.json +9 -1
  198. package/schemas/doctor-report-v1.json +1 -0
  199. package/skills/better-supabase/references/ui-recipes.md +524 -295
  200. package/skills/better-supabase-api/references/powersync.md +16 -0
  201. package/skills/better-supabase-auth/SKILL.md +4 -1
  202. package/dist/cli/add-BdhGOwkB.js +0 -1
  203. package/dist/cli/env-CynGCICL.js +0 -1
  204. package/dist/cli/powersync-DnBsDchT.js +0 -1
  205. package/dist/cli/seed-BOun22-k.js +0 -1
@@ -1,18 +1,18 @@
1
- import { a as list, m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
1
+ import { a as list, m as commandMeta, r as defineCliCommand } from "./command-CCAwhiOh.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
3
  import { n as CliError } from "./errors-BTe6A15O.js";
4
4
  import { r as readIfExists } from "./io-DH1kcmmP.js";
5
- import { l as TYPEGEN_VERSION } from "./cache-BuoIFlUJ.js";
6
- import { a as serializeSnapshot, t as loadSnapshot } from "./snapshot-B5LXkVMC.js";
7
- import { a as toCatalog } from "./source-BoLNG_2A.js";
5
+ import { l as TYPEGEN_VERSION } from "./cache-x2wWAy0h.js";
6
+ import { a as serializeSnapshot, t as loadSnapshot } from "./snapshot-BlQ4DDcJ.js";
7
+ import { a as toCatalog } from "./source-CelMBQMj.js";
8
8
  import { a as findConfig, s as loadConfig } from "./config-Cskysxp-.js";
9
- import { r as contentMapperFiles } from "./content-mapper-BCtyfKXl.js";
9
+ import { r as contentMapperFiles } from "./content-mapper-DvOSOdTE.js";
10
10
  import { c as insideRoot, i as changeLines, n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
11
- import { C as promptConventions, S as hasConventionFlags, _ as templatePlan, b as conventionFlags, c as AUTHZ_NOTE, d as chooseIntegrations, f as integrationFiles, g as templateContextFor, h as parseIntegrations, i as blocksWiringPath, l as createUrlParam, m as packagesFor, o as writeDesign, p as overwrite, r as blockConfigImport, s as readPresetInput, u as CANCELLED, v as CONVENTION_ARGS, w as withConventions, x as defaultConventions, y as CONVENTION_COMPLETIONS } from "./add-D4w-Axib.js";
12
- import { a as wiringFiles, c as baseFiles, f as needsLib, i as wiringChecklist, m as suggestedIntegrations, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, r as configInstances, s as TEMPLATES } from "./migration-safety-BfVeza5j.js";
11
+ import { C as promptConventions, S as hasConventionFlags, _ as templatePlan, b as conventionFlags, c as AUTHZ_NOTE, d as chooseIntegrations, f as integrationFiles, g as templateContextFor, h as parseIntegrations, i as blocksWiringPath, l as createUrlParam, m as packagesFor, o as writeDesign, p as overwrite, r as blockConfigImport, s as readPresetInput, u as CANCELLED, v as CONVENTION_ARGS, w as withConventions, x as defaultConventions, y as CONVENTION_COMPLETIONS } from "./add-DjZXKd7X.js";
12
+ import { a as wiringFiles, c as baseFiles, f as needsLib, i as wiringChecklist, m as suggestedIntegrations, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, r as configInstances, s as TEMPLATES } from "./migration-safety-nNyB05I-.js";
13
13
  import { n as installCommand, t as detectProject } from "./detect-D9JaAX20.js";
14
- import { s as enablePgDelta, t as syncModules } from "./sync-m-oZ_SyI.js";
15
- import { t as appTablePlan } from "./app-table-files-CiGuwLkO.js";
14
+ import { s as enablePgDelta, t as syncModules } from "./sync-BnORI43S.js";
15
+ import { t as appTablePlan } from "./app-table-files-mtvjHa48.js";
16
16
  import { existsSync } from "node:fs";
17
17
  import { join, posix, resolve } from "node:path";
18
18
  import { glob, readFile, readdir } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-CCAwhiOh.js";
2
2
  import { t as display } from "./io-DH1kcmmP.js";
3
3
  import { m as supabaseDir } from "./supabase-toml-CncmQbO0.js";
4
4
  import { i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
@@ -1,6 +1,6 @@
1
1
  import { r as errorText } from "./errors-BTe6A15O.js";
2
- import "./source-BoLNG_2A.js";
3
- import { l as tableObject, n as exposed, s as qualified, t as catalogOf } from "./shared-DV5wIv-7.js";
2
+ import "./source-CelMBQMj.js";
3
+ import { l as tableObject, n as exposed, s as qualified, t as catalogOf } from "./shared-D_CFi5di.js";
4
4
  //#region src/cli/doctor/reserved-roles.ts
5
5
  /**
6
6
  * Supautils' `reserved_roles` on Supabase. Nobody but a superuser may alter,
@@ -1,6 +1,6 @@
1
- import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
- import { a as envelope, i as run } from "./run-MwM__teL.js";
3
- import { t as VERSION } from "./version-D2BQuqta.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-CCAwhiOh.js";
2
+ import { a as envelope, i as run } from "./run-BNoJKf5I.js";
3
+ import { t as VERSION } from "./version-Dz8ZlOuh.js";
4
4
  import { n as CliError } from "./errors-BTe6A15O.js";
5
5
  import { n as consentToken } from "./agent-CbuPvI2x.js";
6
6
  import { C as optional, D as record, N as unknown, a as array, d as is, j as string$1, k as safeParse, t as PROCESS_ENV, x as object } from "./env-BK0xKMeU.js";
@@ -1,8 +1,8 @@
1
1
  import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
2
2
  import { i as readStdin } from "./io-DH1kcmmP.js";
3
- import { m as parseMetadataDocument, u as MetadataRejectedError } from "./snapshot-B5LXkVMC.js";
4
- import { c as metaPaths, n as render } from "./render-CizUf3RW.js";
5
- import { i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-ChOY6s4o.js";
3
+ import { m as parseMetadataDocument, u as MetadataRejectedError } from "./snapshot-BlQ4DDcJ.js";
4
+ import { c as metaPaths, n as render } from "./render-QGWfEoiB.js";
5
+ import { i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-DiYX1XEa.js";
6
6
  import { basename, join, relative, resolve, sep } from "node:path";
7
7
  import { readFile } from "node:fs/promises";
8
8
  import { jsonSchema, standardSchema, valibot, zod } from "better-supabase/config";
@@ -1,7 +1,7 @@
1
- import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-CCAwhiOh.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
3
  import { n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
4
- import { t as appTablePlan } from "./app-table-files-CiGuwLkO.js";
4
+ import { t as appTablePlan } from "./app-table-files-mtvjHa48.js";
5
5
  //#region src/cli/commands/migrate.ts
6
6
  const MIGRATE_ARGS = {};
7
7
  /**
@@ -1,5 +1,5 @@
1
1
  import { f as INTEGRATIONS } from "./config-Cskysxp-.js";
2
- import { c as splitStatements } from "./shared-DV5wIv-7.js";
2
+ import { c as splitStatements } from "./shared-D_CFi5di.js";
3
3
  import { dirname, join, posix } from "node:path";
4
4
  import { readdir } from "node:fs/promises";
5
5
  import { INTEGRATION_INFO, groupEntries } from "better-supabase/config";
@@ -1,7 +1,7 @@
1
- import { r as layoutFor } from "./providers-dyxcHQY3.js";
1
+ import { r as layoutFor } from "./providers-DtI90lSw.js";
2
2
  import { d as readSupabaseToml, p as sqlWorkflow } from "./supabase-toml-CncmQbO0.js";
3
3
  import { i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
4
- import { a as sqlPlan, n as migrationsDir } from "./sql-layout-zo02f3Dm.js";
4
+ import { a as sqlPlan, n as migrationsDir } from "./sql-layout-Dp4Rottt.js";
5
5
  import { resolve } from "node:path";
6
6
  import { readFile, readdir } from "node:fs/promises";
7
7
  import { moduleSchemaExtensions, renderBlocks } from "better-supabase/sql";
@@ -1,7 +1,7 @@
1
1
  import { d as readSupabaseToml, p as sqlWorkflow } from "./supabase-toml-CncmQbO0.js";
2
2
  import { i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
3
- import { a as sqlPlan, n as migrationsDir } from "./sql-layout-zo02f3Dm.js";
4
- import { i as stampAfter } from "./migrations-BCq7Zs2E.js";
3
+ import { a as sqlPlan, n as migrationsDir } from "./sql-layout-Dp4Rottt.js";
4
+ import { i as stampAfter } from "./migrations-bAd7dpk1.js";
5
5
  import { resolve } from "node:path";
6
6
  import { readFile, readdir } from "node:fs/promises";
7
7
  import { moduleSchemaExtensions } from "better-supabase/sql";
@@ -1,5 +1,5 @@
1
1
  import { n as CliError } from "./errors-BTe6A15O.js";
2
- import { s as positionalIndex } from "./parse-BPf3kGnc.js";
2
+ import { s as positionalIndex } from "./parse-DjHbTaFI.js";
3
3
  //#region src/cli/core/moved.ts
4
4
  const API_REPLACEMENT = "defineApi includes every table and block instance, and createOrpc(betterSupabase).router(api) serves it: https://bettersupabase.com/docs/frameworks/orpc#serve-the-api";
5
5
  /** Commands removed in 0.15, with what replaces them, longest path first. */
@@ -1,5 +1,5 @@
1
1
  import { r as __toESM } from "./rolldown-runtime-kJ_i4yPo.js";
2
- import { t as GLOBAL_ARGS } from "./command-DIPmo0wh.js";
2
+ import { t as GLOBAL_ARGS } from "./command-CCAwhiOh.js";
3
3
  import { n as CliError } from "./errors-BTe6A15O.js";
4
4
  //#region src/cli/core/parse.ts
5
5
  /**
@@ -1,8 +1,8 @@
1
- import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
- import { r as layoutFor } from "./providers-dyxcHQY3.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-CCAwhiOh.js";
2
+ import { r as layoutFor } from "./providers-DtI90lSw.js";
3
3
  import { n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
4
- import { n as migrationsDir } from "./sql-layout-zo02f3Dm.js";
5
- import { i as stampAfter } from "./migrations-BCq7Zs2E.js";
4
+ import { n as migrationsDir } from "./sql-layout-Dp4Rottt.js";
5
+ import { i as stampAfter } from "./migrations-bAd7dpk1.js";
6
6
  import { existsSync } from "node:fs";
7
7
  import { join, resolve } from "node:path";
8
8
  import { readFile, readdir } from "node:fs/promises";
@@ -10,7 +10,13 @@ import { declaredColumnTypes, renderBlocks } from "better-supabase/sql";
10
10
  import { SPEC_PINS } from "better-supabase";
11
11
  //#region src/cli/powersync/streams.ts
12
12
  /** The blocks `gen.powersync` can sync. */
13
- const POWERSYNC_BLOCKS = ["notifications", "attachments"];
13
+ const POWERSYNC_BLOCKS = [
14
+ "notifications",
15
+ "attachments",
16
+ "memberships",
17
+ "teams",
18
+ "profiles"
19
+ ];
14
20
  const isPowerSyncBlock = (value) => POWERSYNC_BLOCKS.some((block) => block === value);
15
21
  const GENERATED = "@generated by better-supabase gen";
16
22
  const SAFE_IDENT = /^[a-z_][a-z0-9_]*$/;
@@ -68,13 +74,97 @@ function notificationTables(input, instance) {
68
74
  columns: eventColumns
69
75
  }];
70
76
  }
77
+ /** The memberships table: the one with `user_id` and `role`. */
78
+ function membershipsTable(input, key) {
79
+ return [...tablesOf(input, key)].find(([, declared]) => declared.has("user_id") && declared.has("role"));
80
+ }
81
+ /** The tenant column of the memberships table: its `*_id` besides `user_id`. */
82
+ function membershipTenant(columns, what) {
83
+ const tenant = [...columns.keys()].find((column) => column.endsWith("_id") && column !== "user_id");
84
+ if (tenant === void 0) throw new Error(`gen.powersync: ${what} has no organization column`);
85
+ return tenant;
86
+ }
87
+ /**
88
+ * Only `names` of `columns`, for a stream that selects them. PowerSync
89
+ * replicates past the column grants, so a stream lists what it may expose.
90
+ */
91
+ function only(columns, names) {
92
+ return new Map([...columns].filter(([column]) => names.includes(column)));
93
+ }
94
+ function membershipTables(input, instance) {
95
+ const found = membershipsTable(input, instance.key);
96
+ if (found === void 0) throw new Error(`gen.powersync: found no ${instance.key} memberships table`);
97
+ const [memberships, columns] = found;
98
+ const tenant = membershipTenant(columns, `${instance.key} memberships`);
99
+ const mine = `SELECT ${ident(tenant)} FROM ${qualifiedIdent(memberships)} WHERE user_id = auth.user_id()`;
100
+ const synced = [{
101
+ qualified: memberships,
102
+ name: baseName(memberships),
103
+ stream: `${instance.key}_memberships`,
104
+ query: `SELECT ${ident(tenant)} || ':' || user_id AS id, * FROM ${qualifiedIdent(memberships)} WHERE user_id = auth.user_id()`,
105
+ columns
106
+ }];
107
+ const organizations = [...tablesOf(input, "organizations")].find(([, declared]) => declared.has("id") && declared.has("name") && !declared.has("user_id"));
108
+ if (organizations !== void 0) {
109
+ const [table, declared] = organizations;
110
+ const selected = [
111
+ "id",
112
+ "name",
113
+ "slug",
114
+ "disabled_at",
115
+ "deleted_at"
116
+ ].filter((column) => declared.has(column));
117
+ synced.push({
118
+ qualified: table,
119
+ name: baseName(table),
120
+ stream: `${instance.key}_organizations`,
121
+ query: `SELECT ${selected.map(ident).join(", ")} FROM ${qualifiedIdent(table)} WHERE id IN (${mine})`,
122
+ columns: only(declared, selected)
123
+ });
124
+ }
125
+ return synced;
126
+ }
127
+ function teamTables(input, instance) {
128
+ const tables = tablesOf(input, instance.key);
129
+ const [members, memberColumns] = tableWith(tables, ["team_id", "user_id"], `${instance.key} team members`);
130
+ const [teams, teamColumns] = tableWith(tables, [
131
+ "id",
132
+ "name",
133
+ "slug",
134
+ "status"
135
+ ], `${instance.key} teams`);
136
+ const myTeams = `SELECT team_id FROM ${qualifiedIdent(members)} WHERE user_id = auth.user_id()`;
137
+ return [{
138
+ qualified: teams,
139
+ name: baseName(teams),
140
+ stream: `${instance.key}_teams`,
141
+ query: `SELECT * FROM ${qualifiedIdent(teams)} WHERE id IN (${myTeams})`,
142
+ columns: teamColumns
143
+ }, {
144
+ qualified: members,
145
+ name: baseName(members),
146
+ stream: `${instance.key}_members`,
147
+ query: `SELECT team_id || ':' || user_id AS id, * FROM ${qualifiedIdent(members)} WHERE team_id IN (${myTeams})`,
148
+ columns: memberColumns
149
+ }];
150
+ }
151
+ function profileTables(input, instance) {
152
+ const [profiles, columns] = tableWith(tablesOf(input, instance.key), ["id"], `${instance.key} profiles`);
153
+ return [{
154
+ qualified: profiles,
155
+ name: baseName(profiles),
156
+ stream: instance.key,
157
+ query: `SELECT * FROM ${qualifiedIdent(profiles)} WHERE id = auth.user_id()`,
158
+ columns
159
+ }];
160
+ }
71
161
  function attachmentTables(input, instance) {
72
162
  const [attachments, columns] = tableWith(tablesOf(input, instance.key), [
73
163
  "bucket",
74
164
  "object_path",
75
165
  "uploaded_by"
76
166
  ], `${instance.key} attachments`);
77
- const memberships = [...tablesOf(input, "memberships")].find(([, declared]) => declared.has("user_id") && declared.has("role"));
167
+ const memberships = membershipsTable(input, "memberships");
78
168
  if (memberships === void 0) throw new Error(`gen.powersync: ${instance.key} syncs the files of the user's organizations, which needs the memberships block`);
79
169
  const [membershipTable, membershipColumns] = memberships;
80
170
  const tenant = [...columns.keys()].find((column) => column.endsWith("_id") && column !== "user_id" && membershipColumns.has(column));
@@ -91,6 +181,9 @@ function syncedTables(input, instance) {
91
181
  switch (instance.block) {
92
182
  case "notifications": return notificationTables(input, instance);
93
183
  case "attachments": return attachmentTables(input, instance);
184
+ case "memberships": return membershipTables(input, instance);
185
+ case "teams": return teamTables(input, instance);
186
+ case "profiles": return profileTables(input, instance);
94
187
  default: {
95
188
  const unknown = instance.block;
96
189
  throw new Error(`gen.powersync: ${String(unknown)} can't sync`);
@@ -195,7 +288,7 @@ function instancesOf(config, keys) {
195
288
  for (const key of keys) {
196
289
  const block = config.instances[key]?.block;
197
290
  if (block === void 0) return `${key} is not a block in the config.`;
198
- if (!isPowerSyncBlock(block)) return `${key} installs ${block}, which can't sync yet. PowerSync syncs ${POWERSYNC_BLOCKS.join(" and ")}.`;
291
+ if (!isPowerSyncBlock(block)) return `${key} installs ${block}, which can't sync yet. PowerSync syncs ${POWERSYNC_BLOCKS.slice(0, -1).join(", ")} and ${POWERSYNC_BLOCKS.at(-1)}.`;
199
292
  instances.push({
200
293
  key,
201
294
  block
@@ -0,0 +1 @@
1
+ export { t as powersyncStreamsCommand } from "./powersync-B2v0tDwp.js";
@@ -1,6 +1,6 @@
1
1
  import { n as CliError } from "./errors-BTe6A15O.js";
2
- import { n as layout } from "./providers-dyxcHQY3.js";
3
- import { o as migrationModules, r as latestMigration, u as writesMigrations } from "./module-migration-lbeUrsYv.js";
2
+ import { n as layout } from "./providers-DtI90lSw.js";
3
+ import { o as migrationModules, r as latestMigration, u as writesMigrations } from "./module-migration-CkNux8dr.js";
4
4
  import { existsSync } from "node:fs";
5
5
  import { resolve } from "node:path";
6
6
  import { SQL_MODULES, contractSignature, customContracts, moduleBody, moduleFilePaths } from "better-supabase/sql";
@@ -1,6 +1,6 @@
1
1
  import { n as CliError } from "./errors-BTe6A15O.js";
2
2
  import { t as importFresh } from "./fresh-import-DzgsGHkX.js";
3
- import { i as schemasDirOf, r as moduleLayoutFor } from "./sql-layout-zo02f3Dm.js";
3
+ import { i as schemasDirOf, r as moduleLayoutFor } from "./sql-layout-Dp4Rottt.js";
4
4
  import { resolve } from "node:path";
5
5
  import { MODULE_ID_TYPES, compileReadSets, moduleIdType, moduleLayout, modulePermissionKeys, resolveBlocks, scopeProblems, templateFunctions } from "better-supabase/sql";
6
6
  import { isReadSet } from "better-supabase";
@@ -1,16 +1,16 @@
1
- import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-CCAwhiOh.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
3
  import { n as CliError } from "./errors-BTe6A15O.js";
4
4
  import { r as readIfExists, t as display } from "./io-DH1kcmmP.js";
5
- import { r as layoutFor } from "./providers-dyxcHQY3.js";
5
+ import { r as layoutFor } from "./providers-DtI90lSw.js";
6
6
  import { i as changeLines, n as PLAN_ARGS, r as applyPlan, t as HAND_EDITED, u as planResult } from "./files-CX71yBm8.js";
7
- import { a as sqlPlan } from "./sql-layout-zo02f3Dm.js";
8
- import { g as templateContextFor, i as blocksWiringPath, n as blockClients } from "./add-D4w-Axib.js";
7
+ import { a as sqlPlan } from "./sql-layout-Dp4Rottt.js";
8
+ import { g as templateContextFor, i as blocksWiringPath, n as blockClients } from "./add-DjZXKd7X.js";
9
9
  import { t as detectProject } from "./detect-D9JaAX20.js";
10
10
  import { _ as wiringBlocks, a as configObject, c as mask, i as closingIndex, l as properties } from "./config-edit-CrWfk8s3.js";
11
- import { n as guardedRemoval } from "./sync-m-oZ_SyI.js";
11
+ import { n as guardedRemoval } from "./sync-BnORI43S.js";
12
12
  import { t as SQL_ARGS } from "./args-UEwg0l-N.js";
13
- import { t as blockNames } from "./blocks-jRL9K1R8.js";
13
+ import { t as blockNames } from "./blocks-BWCuA0nq.js";
14
14
  import { i as tidyInline, t as cutRange } from "./config-group-CP-B9uRt.js";
15
15
  import { existsSync } from "node:fs";
16
16
  import { resolve } from "node:path";
@@ -1,10 +1,10 @@
1
1
  import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
2
2
  import { n as importPath } from "./io-DH1kcmmP.js";
3
- import { i as cachedTypesModule, n as cachedDatabaseTypes, s as typesModuleKey } from "./cache-BuoIFlUJ.js";
3
+ import { i as cachedTypesModule, n as cachedDatabaseTypes, s as typesModuleKey } from "./cache-x2wWAy0h.js";
4
4
  import { t as byCodePoint } from "./compare-BmIWVEui.js";
5
- import { f as generateDatabaseTypes, h as restrictSchemas, p as oxfmtInstalled, v as tsTypeOf } from "./snapshot-B5LXkVMC.js";
5
+ import { f as generateDatabaseTypes, h as restrictSchemas, p as oxfmtInstalled, v as tsTypeOf } from "./snapshot-BlQ4DDcJ.js";
6
6
  import { t as isRecord$1 } from "./guards-CUlDNYZs.js";
7
- import { a as toCatalog } from "./source-BoLNG_2A.js";
7
+ import { a as toCatalog } from "./source-CelMBQMj.js";
8
8
  import { m as withTableTags } from "./config-Cskysxp-.js";
9
9
  import { basename, dirname, isAbsolute, join, posix, relative, resolve } from "node:path";
10
10
  import { entityNames } from "better-supabase/blocks";
@@ -1,9 +1,9 @@
1
- import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-CCAwhiOh.js";
2
2
  import { n as CliError } from "./errors-BTe6A15O.js";
3
3
  import { t as PROCESS_ENV } from "./env-BK0xKMeU.js";
4
4
  import { n as spawnInherited } from "./exec-Ca5s-ygi.js";
5
5
  import { a as staleVariables } from "./stack-env-3ziggrU3.js";
6
- import { i as readStackEnv } from "./env-B2CbnbzD.js";
6
+ import { i as readStackEnv } from "./env-XMiKvhtV.js";
7
7
  //#region src/cli/commands/run.ts
8
8
  const ARGS = {
9
9
  prefix: {
@@ -1,10 +1,10 @@
1
- import { c as runsWithInvalidConfig, d as DOCS_ORIGIN, f as GROUPS, g as runCommand, h as parseArgs$2, i as joinRepeated, l as COMMANDS, o as listArgs, p as RESERVED_NAMES, s as readsLegacyTables, t as GLOBAL_ARGS } from "./command-DIPmo0wh.js";
1
+ import { c as runsWithInvalidConfig, d as DOCS_ORIGIN, f as GROUPS, g as runCommand, h as parseArgs$2, i as joinRepeated, l as COMMANDS, o as listArgs, p as RESERVED_NAMES, s as readsLegacyTables, t as GLOBAL_ARGS } from "./command-CCAwhiOh.js";
2
2
  import { n as highlight, r as painter } from "./style-Bm2X5JrN.js";
3
- import { t as VERSION } from "./version-D2BQuqta.js";
3
+ import { t as VERSION } from "./version-Dz8ZlOuh.js";
4
4
  import { n as CliError, o as toCliError } from "./errors-BTe6A15O.js";
5
5
  import { a as missingInputNext, o as resolveAgent, t as checkConsent } from "./agent-CbuPvI2x.js";
6
- import { a as globalFlags, c as resolveCommand, i as commandTree, n as closestName, o as isVariadic, r as commandArgs, t as checkArgs } from "./parse-BPf3kGnc.js";
7
- import { n as movedCommand, r as movedFlag } from "./moved-DNOtp9LA.js";
6
+ import { a as globalFlags, c as resolveCommand, i as commandTree, n as closestName, o as isVariadic, r as commandArgs, t as checkArgs } from "./parse-DjHbTaFI.js";
7
+ import { n as movedCommand, r as movedFlag } from "./moved-C3WyRHkA.js";
8
8
  import { n as HTTP_CHANNEL, t as EXEC_CHANNEL } from "./trace-VbdO6bcN.js";
9
9
  import { stripVTControlCharacters } from "node:util";
10
10
  import { subscribe, unsubscribe } from "node:diagnostics_channel";
@@ -16,40 +16,41 @@ import { resolve } from "node:path";
16
16
  * loads on demand, so `--version` and `--help` import no command.
17
17
  */
18
18
  const LOADERS = [
19
- ["init", () => import("./init-DW6_nIwj.js").then((m) => m.initCommand)],
20
- ["add", () => import("./add-BdhGOwkB.js").then((m) => m.addCommand)],
21
- ["remove", () => import("./remove-BLq5gbal.js").then((m) => m.removeCommand)],
22
- ["upgrade", () => import("./upgrade-WwEJaX3i.js").then((m) => m.upgradeCommand)],
23
- ["table", () => import("./table-dyKddjwo.js").then((m) => m.tableCommand)],
24
- ["migrate schema-first", () => import("./migrate-Bkq07XcT.js").then((m) => m.migrateSchemaFirstCommand)],
25
- ["gen", () => import("./gen-STKC9vkK.js").then((m) => m.genCommand)],
26
- ["doctor", () => import("./doctor-Di2ZekfN.js").then((m) => m.doctorCommand)],
27
- ["db query", () => import("./db-CWvH1_46.js").then((m) => m.dbQueryCommand)],
28
- ["db diff", () => import("./db-CWvH1_46.js").then((m) => m.dbDiffCommand)],
29
- ["db seed", () => import("./seed-BOun22-k.js").then((m) => m.seedCommand)],
30
- ["db backfill", () => import("./backfill-DjVjXW_P.js").then((m) => m.dbBackfillCommand)],
31
- ["dev env", () => import("./env-CynGCICL.js").then((m) => m.envCommand)],
32
- ["dev run", () => import("./run-ChEjR7yw.js").then((m) => m.runCommand)],
33
- ["dev keys", () => import("./keys-V-HcO-21.js").then((m) => m.keysCommand)],
34
- ["dev stack ls", () => import("./stack-ClESAZYf.js").then((m) => m.stackLsCommand)],
35
- ["dev stack prune", () => import("./stack-ClESAZYf.js").then((m) => m.stackPruneCommand)],
36
- ["blocks list", () => import("./blocks-Bbmb6W_F.js").then((m) => m.blocksListCommand)],
37
- ["blocks view", () => import("./blocks-Bbmb6W_F.js").then((m) => m.blocksViewCommand)],
38
- ["blocks search", () => import("./blocks-Bbmb6W_F.js").then((m) => m.blocksSearchCommand)],
39
- ["powersync streams", () => import("./powersync-DnBsDchT.js").then((m) => m.powersyncStreamsCommand)],
40
- ["spec emit", () => import("./spec-D6QeE2Zx.js").then((m) => m.specEmitCommand)],
41
- ["spec validate", () => import("./spec-D6QeE2Zx.js").then((m) => m.specValidateCommand)],
42
- ["mcp", () => import("./mcp-flKS8iU5.js").then((m) => m.mcpCommand)],
43
- ["skills list", () => import("./skills-DM3oeIxY.js").then((m) => m.skillsListCommand)],
44
- ["skills install", () => import("./skills-DM3oeIxY.js").then((m) => m.skillsInstallCommand)],
45
- ["codemod 0.4", () => import("./codemod-DRavXBCb.js").then((m) => m.codemodCommand("0.4"))],
46
- ["codemod 0.5", () => import("./codemod-DRavXBCb.js").then((m) => m.codemodCommand("0.5"))],
47
- ["codemod 0.6", () => import("./codemod-DRavXBCb.js").then((m) => m.codemodCommand("0.6"))],
48
- ["codemod 0.9", () => import("./codemod-DRavXBCb.js").then((m) => m.codemodCommand("0.9"))],
49
- ["codemod 0.11", () => import("./codemod-DRavXBCb.js").then((m) => m.codemodCommand("0.11"))],
50
- ["codemod 0.15", () => import("./codemod-DRavXBCb.js").then((m) => m.codemodCommand("0.15"))],
51
- ["completion", () => import("./completion-FUgqm2-N.js").then((m) => m.completionCommand)],
52
- ["config", () => import("./config-BfapErxs.js").then((m) => m.configCommand)]
19
+ ["init", () => import("./init-fb9e1BKX.js").then((m) => m.initCommand)],
20
+ ["add", () => import("./add-ZcEOEK23.js").then((m) => m.addCommand)],
21
+ ["remove", () => import("./remove-DYtE4IZ4.js").then((m) => m.removeCommand)],
22
+ ["upgrade", () => import("./upgrade-fz92aCnh.js").then((m) => m.upgradeCommand)],
23
+ ["table", () => import("./table-D6HUECKI.js").then((m) => m.tableCommand)],
24
+ ["migrate schema-first", () => import("./migrate-Ht2TzIQF.js").then((m) => m.migrateSchemaFirstCommand)],
25
+ ["gen", () => import("./gen-B-FbQmG1.js").then((m) => m.genCommand)],
26
+ ["doctor", () => import("./doctor-Ywy8oJEU.js").then((m) => m.doctorCommand)],
27
+ ["db query", () => import("./db-DXKyVEDF.js").then((m) => m.dbQueryCommand)],
28
+ ["db diff", () => import("./db-DXKyVEDF.js").then((m) => m.dbDiffCommand)],
29
+ ["db seed", () => import("./seed-Cm-c0BDd.js").then((m) => m.seedCommand)],
30
+ ["db backfill", () => import("./backfill-Coshdvh_.js").then((m) => m.dbBackfillCommand)],
31
+ ["dev env", () => import("./env-CNjT_uOV.js").then((m) => m.envCommand)],
32
+ ["dev run", () => import("./run-B5aMwErM.js").then((m) => m.runCommand)],
33
+ ["dev keys", () => import("./keys-ORiPz1sM.js").then((m) => m.keysCommand)],
34
+ ["dev stack ls", () => import("./stack-B2slzrYH.js").then((m) => m.stackLsCommand)],
35
+ ["dev stack prune", () => import("./stack-B2slzrYH.js").then((m) => m.stackPruneCommand)],
36
+ ["blocks list", () => import("./blocks-hiSazThw.js").then((m) => m.blocksListCommand)],
37
+ ["blocks view", () => import("./blocks-hiSazThw.js").then((m) => m.blocksViewCommand)],
38
+ ["blocks search", () => import("./blocks-hiSazThw.js").then((m) => m.blocksSearchCommand)],
39
+ ["powersync streams", () => import("./powersync-D3mAQ6QE.js").then((m) => m.powersyncStreamsCommand)],
40
+ ["spec emit", () => import("./spec-BxcoGE0h.js").then((m) => m.specEmitCommand)],
41
+ ["spec validate", () => import("./spec-BxcoGE0h.js").then((m) => m.specValidateCommand)],
42
+ ["mcp", () => import("./mcp-CVWwraga.js").then((m) => m.mcpCommand)],
43
+ ["skills list", () => import("./skills-D98y0bSB.js").then((m) => m.skillsListCommand)],
44
+ ["skills install", () => import("./skills-D98y0bSB.js").then((m) => m.skillsInstallCommand)],
45
+ ["codemod 0.4", () => import("./codemod-BnjV7BpC.js").then((m) => m.codemodCommand("0.4"))],
46
+ ["codemod 0.5", () => import("./codemod-BnjV7BpC.js").then((m) => m.codemodCommand("0.5"))],
47
+ ["codemod 0.6", () => import("./codemod-BnjV7BpC.js").then((m) => m.codemodCommand("0.6"))],
48
+ ["codemod 0.9", () => import("./codemod-BnjV7BpC.js").then((m) => m.codemodCommand("0.9"))],
49
+ ["codemod 0.11", () => import("./codemod-BnjV7BpC.js").then((m) => m.codemodCommand("0.11"))],
50
+ ["codemod 0.15", () => import("./codemod-BnjV7BpC.js").then((m) => m.codemodCommand("0.15"))],
51
+ ["codemod 0.29", () => import("./codemod-BnjV7BpC.js").then((m) => m.codemodCommand("0.29"))],
52
+ ["completion", () => import("./completion-DmUVsUVQ.js").then((m) => m.completionCommand)],
53
+ ["config", () => import("./config-zId1jkLx.js").then((m) => m.configCommand)]
53
54
  ];
54
55
  /** The built-in commands, for `createCli`. */
55
56
  function builtinCommands() {
@@ -468,7 +469,7 @@ function cliFromTree(init, extra = {}) {
468
469
  };
469
470
  if (argv[0] === "__complete") {
470
471
  const words = argv[1] === "--" ? argv.slice(2) : argv.slice(1);
471
- const lines = await import("./completion-DyLMSjOD.js").then(async ({ complete, completionLines }) => completionLines(await complete(tree, words))).catch(() => "");
472
+ const lines = await import("./completion-BkUhs1ms.js").then(async ({ complete, completionLines }) => completionLines(await complete(tree, words))).catch(() => "");
472
473
  if (lines !== "") out(lines);
473
474
  return {
474
475
  code: 0,
@@ -1,15 +1,15 @@
1
1
  import { r as errorText } from "./errors-BTe6A15O.js";
2
2
  import { a as sameText, t as display } from "./io-DH1kcmmP.js";
3
- import { c as writeAtomic, o as storeTypesModule, s as typesModuleKey, t as CACHE_DIR } from "./cache-BuoIFlUJ.js";
3
+ import { c as writeAtomic, o as storeTypesModule, s as typesModuleKey, t as CACHE_DIR } from "./cache-x2wWAy0h.js";
4
4
  import { t as byCodePoint } from "./compare-BmIWVEui.js";
5
- import { _ as stabilizeMetadata, b as typegenVersionNotice, p as oxfmtInstalled, t as loadSnapshot, y as typegenVersion } from "./snapshot-B5LXkVMC.js";
6
- import { n as render } from "./render-CizUf3RW.js";
7
- import { a as compiledReadSets, c as entitlementRequirements, d as providerLabel, f as unsafeKey, l as entitlementsMode, o as accessProviderMode, s as accessRequirements, u as moduleKeyProblems } from "./providers-dyxcHQY3.js";
8
- import { s as schemaStampPath } from "./content-mapper-BCtyfKXl.js";
5
+ import { _ as stabilizeMetadata, b as typegenVersionNotice, p as oxfmtInstalled, t as loadSnapshot, y as typegenVersion } from "./snapshot-BlQ4DDcJ.js";
6
+ import { n as render } from "./render-QGWfEoiB.js";
7
+ import { a as compiledReadSets, c as entitlementRequirements, d as providerLabel, f as unsafeKey, l as entitlementsMode, o as accessProviderMode, s as accessRequirements, u as moduleKeyProblems } from "./providers-DtI90lSw.js";
8
+ import { s as schemaStampPath } from "./content-mapper-DvOSOdTE.js";
9
9
  import { a as changedFiles, d as fileDiff, i as changeLines, r as applyPlan, s as hasConflicts } from "./files-CX71yBm8.js";
10
- import { n as migrationsDir, o as writtenByBlocks } from "./sql-layout-zo02f3Dm.js";
11
- import { l as tableObject, n as exposed, o as policyObject, s as qualified, t as catalogOf } from "./shared-DV5wIv-7.js";
12
- import { c as sameModuleMigration, l as writeLatestMigration, n as READ_SETS_SUFFIX, r as latestMigration, u as writesMigrations } from "./module-migration-lbeUrsYv.js";
10
+ import { n as migrationsDir, o as writtenByBlocks } from "./sql-layout-Dp4Rottt.js";
11
+ import { l as tableObject, n as exposed, o as policyObject, s as qualified, t as catalogOf } from "./shared-D_CFi5di.js";
12
+ import { c as sameModuleMigration, l as writeLatestMigration, n as READ_SETS_SUFFIX, r as latestMigration, u as writesMigrations } from "./module-migration-CkNux8dr.js";
13
13
  import { existsSync } from "node:fs";
14
14
  import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
15
15
  import { readFile } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-CCAwhiOh.js";
2
2
  import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-CbuPvI2x.js";
3
3
  import { t as display } from "./io-DH1kcmmP.js";
4
4
  import { l as stdinDatabaseUrl, n as databaseUrl, o as importExport } from "./config-Cskysxp-.js";
@@ -0,0 +1 @@
1
+ export { n as seedCommand } from "./seed-C-Hu2n_E.js";
@@ -1,4 +1,4 @@
1
- import { a as toCatalog } from "./source-BoLNG_2A.js";
1
+ import { a as toCatalog } from "./source-CelMBQMj.js";
2
2
  import { h as tomlGet, p as sqlWorkflow, r as detectWorkflow } from "./supabase-toml-CncmQbO0.js";
3
3
  //#region src/cli/doctor/shared.ts
4
4
  const catalogs = /* @__PURE__ */ new WeakMap();
@@ -1,4 +1,4 @@
1
- import { a as list, m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
1
+ import { a as list, m as commandMeta, r as defineCliCommand } from "./command-CCAwhiOh.js";
2
2
  import { n as CliError } from "./errors-BTe6A15O.js";
3
3
  import { t as byCodePoint } from "./compare-BmIWVEui.js";
4
4
  import { n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
@@ -1,7 +1,7 @@
1
1
  import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
2
- import { d as readExtras, l as TYPEGEN_VERSION, r as cachedIntrospect } from "./cache-BuoIFlUJ.js";
2
+ import { d as readExtras, l as TYPEGEN_VERSION, r as cachedIntrospect } from "./cache-x2wWAy0h.js";
3
3
  import { t as byCodePoint } from "./compare-BmIWVEui.js";
4
- import { n as managementSource, r as pgSource } from "./source-BoLNG_2A.js";
4
+ import { n as managementSource, r as pgSource } from "./source-CelMBQMj.js";
5
5
  import { n as databaseUrl, u as accessToken } from "./config-Cskysxp-.js";
6
6
  import { d as readSupabaseToml, f as schemaPaths, h as tomlGet, u as pgFunctionHooks } from "./supabase-toml-CncmQbO0.js";
7
7
  import { t as connect } from "./db-CQCLx7cx.js";
@@ -156,13 +156,18 @@ async function declaredPeers() {
156
156
  if (typeof peers !== "object" || peers === null) return {};
157
157
  return Object.fromEntries(Object.entries(peers).filter((entry) => typeof entry[1] === "string"));
158
158
  }
159
- /** Every declared peer with the version `root` resolves. */
159
+ /**
160
+ * Every declared peer with the version `root` resolves, or else the version the
161
+ * better-supabase package resolves: lazy imports load from there, so a peer
162
+ * installed only next to the package (a pnpm workspace) still loads.
163
+ */
160
164
  async function peerVersions(root) {
161
165
  const peers = await declaredPeers();
166
+ const packageDir = dirname(fileURLToPath(import.meta.resolve("better-supabase/package.json")));
162
167
  return Promise.all(Object.entries(peers).map(async ([name, range]) => ({
163
168
  name,
164
169
  range,
165
- installed: await installedVersion(name, root)
170
+ installed: await installedVersion(name, root) ?? await installedVersion(name, packageDir)
166
171
  })));
167
172
  }
168
173
  //#endregion
@@ -1,4 +1,4 @@
1
- import { t as VERSION } from "./version-D2BQuqta.js";
1
+ import { t as VERSION } from "./version-Dz8ZlOuh.js";
2
2
  import { n as CliError } from "./errors-BTe6A15O.js";
3
3
  import { r as redactUrl } from "./redact-KGAk2Ul9.js";
4
4
  import { n as HTTP_CHANNEL } from "./trace-VbdO6bcN.js";
@@ -1 +1 @@
1
- export { n as specEmitCommand, i as specValidateCommand } from "./spec-Dz-PGCaM.js";
1
+ export { n as specEmitCommand, i as specValidateCommand } from "./spec-iBx1LcYO.js";
@@ -1,9 +1,9 @@
1
1
  import { n as __require, t as __commonJSMin } from "./rolldown-runtime-kJ_i4yPo.js";
2
- import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
3
- import { t as VERSION } from "./version-D2BQuqta.js";
2
+ import { m as commandMeta, r as defineCliCommand } from "./command-CCAwhiOh.js";
3
+ import { t as VERSION } from "./version-Dz8ZlOuh.js";
4
4
  import { i as failedResult, n as CliError, r as errorText } from "./errors-BTe6A15O.js";
5
5
  import { t as display } from "./io-DH1kcmmP.js";
6
- import { c as writeAtomic, t as CACHE_DIR } from "./cache-BuoIFlUJ.js";
6
+ import { c as writeAtomic, t as CACHE_DIR } from "./cache-x2wWAy0h.js";
7
7
  import { t as isRecord } from "./guards-CUlDNYZs.js";
8
8
  import { t as importFresh } from "./fresh-import-DzgsGHkX.js";
9
9
  import { a as changedFiles, i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
@@ -1,5 +1,5 @@
1
- import { d as TypegenMissingError, i as parseSnapshot } from "./snapshot-B5LXkVMC.js";
2
- import { a as toCatalog } from "./source-BoLNG_2A.js";
1
+ import { d as TypegenMissingError, i as parseSnapshot } from "./snapshot-BlQ4DDcJ.js";
2
+ import { a as toCatalog } from "./source-CelMBQMj.js";
3
3
  import { d as readSupabaseToml, f as schemaPaths, n as declarativeSchemasDir, p as sqlWorkflow } from "./supabase-toml-CncmQbO0.js";
4
4
  import { existsSync } from "node:fs";
5
5
  import { dirname, join, relative, resolve, sep } from "node:path";
@@ -1,4 +1,4 @@
1
- import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-CCAwhiOh.js";
2
2
  import { r as supabaseCli } from "./exec-Ca5s-ygi.js";
3
3
  import { a as readSharedMemory, i as reportStacks, n as listStacks, r as prunePlan, t as branchName } from "./stacks-CiDBH1dB.js";
4
4
  //#region src/cli/commands/stack.ts
@@ -1,11 +1,11 @@
1
1
  import { n as CliError } from "./errors-BTe6A15O.js";
2
2
  import { t as display } from "./io-DH1kcmmP.js";
3
- import { r as layoutFor } from "./providers-dyxcHQY3.js";
3
+ import { r as layoutFor } from "./providers-DtI90lSw.js";
4
4
  import { d as readSupabaseToml, f as schemaPaths, h as tomlGet, i as diffEngine, l as migrationCommand, o as findSupabaseRoot, p as sqlWorkflow, t as PGDELTA_TABLE } from "./supabase-toml-CncmQbO0.js";
5
5
  import { d as fileDiff, i as changeLines, l as keepHandEdit, o as handEditedError, r as applyPlan, t as HAND_EDITED, u as planResult } from "./files-CX71yBm8.js";
6
- import { a as sqlPlan, n as migrationsDir } from "./sql-layout-zo02f3Dm.js";
7
- import { a as writeExtensionsMigration, t as DATA_NEXT } from "./migrations-BCq7Zs2E.js";
8
- import { c as sameModuleMigration, l as writeLatestMigration, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-lbeUrsYv.js";
6
+ import { a as sqlPlan, n as migrationsDir } from "./sql-layout-Dp4Rottt.js";
7
+ import { a as writeExtensionsMigration, t as DATA_NEXT } from "./migrations-bAd7dpk1.js";
8
+ import { c as sameModuleMigration, l as writeLatestMigration, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-CkNux8dr.js";
9
9
  import { t as loadTopics } from "./topics-BpdnYmWb.js";
10
10
  import { t as orphanedBlockFiles } from "./orphans-BAboqyVM.js";
11
11
  import { dirname, join, resolve } from "node:path";