@vibesdotdev/storage 0.0.1

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 (423) hide show
  1. package/README.md +75 -0
  2. package/SPEC.md +60 -0
  3. package/dist/adapters/index.d.ts +14 -0
  4. package/dist/adapters/index.d.ts.map +1 -0
  5. package/dist/adapters/index.js +15 -0
  6. package/dist/adapters/index.js.map +1 -0
  7. package/dist/bridge/index.d.ts +3 -0
  8. package/dist/bridge/index.d.ts.map +1 -0
  9. package/dist/bridge/index.js +2 -0
  10. package/dist/bridge/index.js.map +1 -0
  11. package/dist/bridge/storage-kind-bridge.d.ts +27 -0
  12. package/dist/bridge/storage-kind-bridge.d.ts.map +1 -0
  13. package/dist/bridge/storage-kind-bridge.js +110 -0
  14. package/dist/bridge/storage-kind-bridge.js.map +1 -0
  15. package/dist/bridge/types.d.ts +45 -0
  16. package/dist/bridge/types.d.ts.map +1 -0
  17. package/dist/bridge/types.js +8 -0
  18. package/dist/bridge/types.js.map +1 -0
  19. package/dist/cli/commands/list/storage.list.cli-command.descriptor.d.ts +4 -0
  20. package/dist/cli/commands/list/storage.list.cli-command.descriptor.d.ts.map +1 -0
  21. package/dist/cli/commands/list/storage.list.cli-command.descriptor.js +18 -0
  22. package/dist/cli/commands/list/storage.list.cli-command.descriptor.js.map +1 -0
  23. package/dist/cli/commands/list/storage.list.cli-command.impl.d.ts +11 -0
  24. package/dist/cli/commands/list/storage.list.cli-command.impl.d.ts.map +1 -0
  25. package/dist/cli/commands/list/storage.list.cli-command.impl.js +48 -0
  26. package/dist/cli/commands/list/storage.list.cli-command.impl.js.map +1 -0
  27. package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.descriptor.d.ts +4 -0
  28. package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.descriptor.d.ts.map +1 -0
  29. package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.descriptor.js +26 -0
  30. package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.descriptor.js.map +1 -0
  31. package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.impl.d.ts +13 -0
  32. package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.impl.d.ts.map +1 -0
  33. package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.impl.js +136 -0
  34. package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.impl.js.map +1 -0
  35. package/dist/cli/commands/sync/push/storage.sync.push.cli-command.descriptor.d.ts +4 -0
  36. package/dist/cli/commands/sync/push/storage.sync.push.cli-command.descriptor.d.ts.map +1 -0
  37. package/dist/cli/commands/sync/push/storage.sync.push.cli-command.descriptor.js +26 -0
  38. package/dist/cli/commands/sync/push/storage.sync.push.cli-command.descriptor.js.map +1 -0
  39. package/dist/cli/commands/sync/push/storage.sync.push.cli-command.impl.d.ts +13 -0
  40. package/dist/cli/commands/sync/push/storage.sync.push.cli-command.impl.d.ts.map +1 -0
  41. package/dist/cli/commands/sync/push/storage.sync.push.cli-command.impl.js +165 -0
  42. package/dist/cli/commands/sync/push/storage.sync.push.cli-command.impl.js.map +1 -0
  43. package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.descriptor.d.ts +4 -0
  44. package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.descriptor.d.ts.map +1 -0
  45. package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.descriptor.js +20 -0
  46. package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.descriptor.js.map +1 -0
  47. package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.impl.d.ts +12 -0
  48. package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.impl.d.ts.map +1 -0
  49. package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.impl.js +95 -0
  50. package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.impl.js.map +1 -0
  51. package/dist/cli/commands/sync/status/storage.sync.status.cli-command.descriptor.d.ts +4 -0
  52. package/dist/cli/commands/sync/status/storage.sync.status.cli-command.descriptor.d.ts.map +1 -0
  53. package/dist/cli/commands/sync/status/storage.sync.status.cli-command.descriptor.js +15 -0
  54. package/dist/cli/commands/sync/status/storage.sync.status.cli-command.descriptor.js.map +1 -0
  55. package/dist/cli/commands/sync/status/storage.sync.status.cli-command.impl.d.ts +13 -0
  56. package/dist/cli/commands/sync/status/storage.sync.status.cli-command.impl.d.ts.map +1 -0
  57. package/dist/cli/commands/sync/status/storage.sync.status.cli-command.impl.js +150 -0
  58. package/dist/cli/commands/sync/status/storage.sync.status.cli-command.impl.js.map +1 -0
  59. package/dist/cli/context.consumer.d.ts +26 -0
  60. package/dist/cli/context.consumer.d.ts.map +1 -0
  61. package/dist/cli/context.consumer.js +164 -0
  62. package/dist/cli/context.consumer.js.map +1 -0
  63. package/dist/cli/storage.cli-group.descriptor.d.ts +4 -0
  64. package/dist/cli/storage.cli-group.descriptor.d.ts.map +1 -0
  65. package/dist/cli/storage.cli-group.descriptor.js +11 -0
  66. package/dist/cli/storage.cli-group.descriptor.js.map +1 -0
  67. package/dist/cli/storage.sync.cli-group.descriptor.d.ts +4 -0
  68. package/dist/cli/storage.sync.cli-group.descriptor.d.ts.map +1 -0
  69. package/dist/cli/storage.sync.cli-group.descriptor.js +12 -0
  70. package/dist/cli/storage.sync.cli-group.descriptor.js.map +1 -0
  71. package/dist/cli/types.d.ts +26 -0
  72. package/dist/cli/types.d.ts.map +1 -0
  73. package/dist/cli/types.js +11 -0
  74. package/dist/cli/types.js.map +1 -0
  75. package/dist/client/index.d.ts +10 -0
  76. package/dist/client/index.d.ts.map +1 -0
  77. package/dist/client/index.js +10 -0
  78. package/dist/client/index.js.map +1 -0
  79. package/dist/client/list-browsable-adapters.d.ts +31 -0
  80. package/dist/client/list-browsable-adapters.d.ts.map +1 -0
  81. package/dist/client/list-browsable-adapters.js +40 -0
  82. package/dist/client/list-browsable-adapters.js.map +1 -0
  83. package/dist/daemon/commands/sync.d.ts +23 -0
  84. package/dist/daemon/commands/sync.d.ts.map +1 -0
  85. package/dist/daemon/commands/sync.js +169 -0
  86. package/dist/daemon/commands/sync.js.map +1 -0
  87. package/dist/docs/adapters.docs.descriptor.d.ts +4 -0
  88. package/dist/docs/adapters.docs.descriptor.d.ts.map +1 -0
  89. package/dist/docs/adapters.docs.descriptor.js +223 -0
  90. package/dist/docs/adapters.docs.descriptor.js.map +1 -0
  91. package/dist/docs/manifests.docs.descriptor.d.ts +4 -0
  92. package/dist/docs/manifests.docs.descriptor.d.ts.map +1 -0
  93. package/dist/docs/manifests.docs.descriptor.js +316 -0
  94. package/dist/docs/manifests.docs.descriptor.js.map +1 -0
  95. package/dist/docs/records.docs.descriptor.d.ts +4 -0
  96. package/dist/docs/records.docs.descriptor.d.ts.map +1 -0
  97. package/dist/docs/records.docs.descriptor.js +269 -0
  98. package/dist/docs/records.docs.descriptor.js.map +1 -0
  99. package/dist/docs/sync.docs.descriptor.d.ts +4 -0
  100. package/dist/docs/sync.docs.descriptor.d.ts.map +1 -0
  101. package/dist/docs/sync.docs.descriptor.js +279 -0
  102. package/dist/docs/sync.docs.descriptor.js.map +1 -0
  103. package/dist/index.d.ts +27 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +29 -0
  106. package/dist/index.js.map +1 -0
  107. package/dist/interfaces/adapter.d.ts +382 -0
  108. package/dist/interfaces/adapter.d.ts.map +1 -0
  109. package/dist/interfaces/adapter.js +11 -0
  110. package/dist/interfaces/adapter.js.map +1 -0
  111. package/dist/interfaces/document-store.d.ts +62 -0
  112. package/dist/interfaces/document-store.d.ts.map +1 -0
  113. package/dist/interfaces/document-store.js +8 -0
  114. package/dist/interfaces/document-store.js.map +1 -0
  115. package/dist/interfaces/index.d.ts +17 -0
  116. package/dist/interfaces/index.d.ts.map +1 -0
  117. package/dist/interfaces/index.js +24 -0
  118. package/dist/interfaces/index.js.map +1 -0
  119. package/dist/interfaces/key-value.d.ts +95 -0
  120. package/dist/interfaces/key-value.d.ts.map +1 -0
  121. package/dist/interfaces/key-value.js +8 -0
  122. package/dist/interfaces/key-value.js.map +1 -0
  123. package/dist/interfaces/query-builder.d.ts +31 -0
  124. package/dist/interfaces/query-builder.d.ts.map +1 -0
  125. package/dist/interfaces/query-builder.js +11 -0
  126. package/dist/interfaces/query-builder.js.map +1 -0
  127. package/dist/interfaces/record/index.d.ts +7 -0
  128. package/dist/interfaces/record/index.d.ts.map +1 -0
  129. package/dist/interfaces/record/index.js +7 -0
  130. package/dist/interfaces/record/index.js.map +1 -0
  131. package/dist/interfaces/record/interface.d.ts +593 -0
  132. package/dist/interfaces/record/interface.d.ts.map +1 -0
  133. package/dist/interfaces/record/interface.js +49 -0
  134. package/dist/interfaces/record/interface.js.map +1 -0
  135. package/dist/interfaces/repository.d.ts +262 -0
  136. package/dist/interfaces/repository.d.ts.map +1 -0
  137. package/dist/interfaces/repository.js +8 -0
  138. package/dist/interfaces/repository.js.map +1 -0
  139. package/dist/interfaces/schema/index.d.ts +8 -0
  140. package/dist/interfaces/schema/index.d.ts.map +1 -0
  141. package/dist/interfaces/schema/index.js +10 -0
  142. package/dist/interfaces/schema/index.js.map +1 -0
  143. package/dist/interfaces/schema/schema-interface.d.ts +516 -0
  144. package/dist/interfaces/schema/schema-interface.d.ts.map +1 -0
  145. package/dist/interfaces/schema/schema-interface.js +31 -0
  146. package/dist/interfaces/schema/schema-interface.js.map +1 -0
  147. package/dist/interfaces/schema/table-interface.d.ts +250 -0
  148. package/dist/interfaces/schema/table-interface.d.ts.map +1 -0
  149. package/dist/interfaces/schema/table-interface.js +31 -0
  150. package/dist/interfaces/schema/table-interface.js.map +1 -0
  151. package/dist/interfaces/storage-consumer-fs.d.ts +40 -0
  152. package/dist/interfaces/storage-consumer-fs.d.ts.map +1 -0
  153. package/dist/interfaces/storage-consumer-fs.js +42 -0
  154. package/dist/interfaces/storage-consumer-fs.js.map +1 -0
  155. package/dist/manifest/base.d.ts +187 -0
  156. package/dist/manifest/base.d.ts.map +1 -0
  157. package/dist/manifest/base.js +516 -0
  158. package/dist/manifest/base.js.map +1 -0
  159. package/dist/manifest/cloud-sync.consumer.d.ts +7 -0
  160. package/dist/manifest/cloud-sync.consumer.d.ts.map +1 -0
  161. package/dist/manifest/cloud-sync.consumer.js +82 -0
  162. package/dist/manifest/cloud-sync.consumer.js.map +1 -0
  163. package/dist/manifest/index.d.ts +7 -0
  164. package/dist/manifest/index.d.ts.map +1 -0
  165. package/dist/manifest/index.js +7 -0
  166. package/dist/manifest/index.js.map +1 -0
  167. package/dist/manifest/source-policy.d.ts +8 -0
  168. package/dist/manifest/source-policy.d.ts.map +1 -0
  169. package/dist/manifest/source-policy.js +62 -0
  170. package/dist/manifest/source-policy.js.map +1 -0
  171. package/dist/paths.d.ts +6 -0
  172. package/dist/paths.d.ts.map +1 -0
  173. package/dist/paths.js +152 -0
  174. package/dist/paths.js.map +1 -0
  175. package/dist/policy/context.d.ts +9 -0
  176. package/dist/policy/context.d.ts.map +1 -0
  177. package/dist/policy/context.js +29 -0
  178. package/dist/policy/context.js.map +1 -0
  179. package/dist/policy/index.d.ts +4 -0
  180. package/dist/policy/index.d.ts.map +1 -0
  181. package/dist/policy/index.js +4 -0
  182. package/dist/policy/index.js.map +1 -0
  183. package/dist/policy/overrides.d.ts +40 -0
  184. package/dist/policy/overrides.d.ts.map +1 -0
  185. package/dist/policy/overrides.js +37 -0
  186. package/dist/policy/overrides.js.map +1 -0
  187. package/dist/policy/persistence.d.ts +38 -0
  188. package/dist/policy/persistence.d.ts.map +1 -0
  189. package/dist/policy/persistence.js +65 -0
  190. package/dist/policy/persistence.js.map +1 -0
  191. package/dist/policy/types.d.ts +21 -0
  192. package/dist/policy/types.d.ts.map +1 -0
  193. package/dist/policy/types.js +7 -0
  194. package/dist/policy/types.js.map +1 -0
  195. package/dist/record/base.d.ts +186 -0
  196. package/dist/record/base.d.ts.map +1 -0
  197. package/dist/record/base.js +1437 -0
  198. package/dist/record/base.js.map +1 -0
  199. package/dist/record/events.d.ts +71 -0
  200. package/dist/record/events.d.ts.map +1 -0
  201. package/dist/record/events.js +52 -0
  202. package/dist/record/events.js.map +1 -0
  203. package/dist/record/extensions.d.ts +51 -0
  204. package/dist/record/extensions.d.ts.map +1 -0
  205. package/dist/record/extensions.js +222 -0
  206. package/dist/record/extensions.js.map +1 -0
  207. package/dist/record/index.d.ts +7 -0
  208. package/dist/record/index.d.ts.map +1 -0
  209. package/dist/record/index.js +7 -0
  210. package/dist/record/index.js.map +1 -0
  211. package/dist/resolver/storage-backed-resolver.d.ts +23 -0
  212. package/dist/resolver/storage-backed-resolver.d.ts.map +1 -0
  213. package/dist/resolver/storage-backed-resolver.js +187 -0
  214. package/dist/resolver/storage-backed-resolver.js.map +1 -0
  215. package/dist/schemas/adapter-descriptor.d.ts +108 -0
  216. package/dist/schemas/adapter-descriptor.d.ts.map +1 -0
  217. package/dist/schemas/adapter-descriptor.js +101 -0
  218. package/dist/schemas/adapter-descriptor.js.map +1 -0
  219. package/dist/schemas/index.d.ts +14 -0
  220. package/dist/schemas/index.d.ts.map +1 -0
  221. package/dist/schemas/index.js +12 -0
  222. package/dist/schemas/index.js.map +1 -0
  223. package/dist/schemas/manifest-descriptor.d.ts +110 -0
  224. package/dist/schemas/manifest-descriptor.d.ts.map +1 -0
  225. package/dist/schemas/manifest-descriptor.js +114 -0
  226. package/dist/schemas/manifest-descriptor.js.map +1 -0
  227. package/dist/schemas/record/descriptor.d.ts +570 -0
  228. package/dist/schemas/record/descriptor.d.ts.map +1 -0
  229. package/dist/schemas/record/descriptor.js +389 -0
  230. package/dist/schemas/record/descriptor.js.map +1 -0
  231. package/dist/schemas/record/index.d.ts +8 -0
  232. package/dist/schemas/record/index.d.ts.map +1 -0
  233. package/dist/schemas/record/index.js +7 -0
  234. package/dist/schemas/record/index.js.map +1 -0
  235. package/dist/schemas/record/relation.d.ts +36 -0
  236. package/dist/schemas/record/relation.d.ts.map +1 -0
  237. package/dist/schemas/record/relation.js +37 -0
  238. package/dist/schemas/record/relation.js.map +1 -0
  239. package/dist/schemas/schema/descriptor.d.ts +231 -0
  240. package/dist/schemas/schema/descriptor.d.ts.map +1 -0
  241. package/dist/schemas/schema/descriptor.js +205 -0
  242. package/dist/schemas/schema/descriptor.js.map +1 -0
  243. package/dist/schemas/schema/index.d.ts +7 -0
  244. package/dist/schemas/schema/index.d.ts.map +1 -0
  245. package/dist/schemas/schema/index.js +7 -0
  246. package/dist/schemas/schema/index.js.map +1 -0
  247. package/dist/schemas/sync-bridge-descriptor.d.ts +124 -0
  248. package/dist/schemas/sync-bridge-descriptor.d.ts.map +1 -0
  249. package/dist/schemas/sync-bridge-descriptor.js +67 -0
  250. package/dist/schemas/sync-bridge-descriptor.js.map +1 -0
  251. package/dist/server/manifest-route.d.ts +92 -0
  252. package/dist/server/manifest-route.d.ts.map +1 -0
  253. package/dist/server/manifest-route.js +226 -0
  254. package/dist/server/manifest-route.js.map +1 -0
  255. package/dist/storage-policy.context.descriptor.d.ts +16 -0
  256. package/dist/storage-policy.context.descriptor.d.ts.map +1 -0
  257. package/dist/storage-policy.context.descriptor.js +16 -0
  258. package/dist/storage-policy.context.descriptor.js.map +1 -0
  259. package/dist/storage-policy.context.server.d.ts +14 -0
  260. package/dist/storage-policy.context.server.d.ts.map +1 -0
  261. package/dist/storage-policy.context.server.js +27 -0
  262. package/dist/storage-policy.context.server.js.map +1 -0
  263. package/dist/storage.plugin.d.ts +38 -0
  264. package/dist/storage.plugin.d.ts.map +1 -0
  265. package/dist/storage.plugin.js +204 -0
  266. package/dist/storage.plugin.js.map +1 -0
  267. package/dist/sync/cloud-pull.d.ts +15 -0
  268. package/dist/sync/cloud-pull.d.ts.map +1 -0
  269. package/dist/sync/cloud-pull.js +130 -0
  270. package/dist/sync/cloud-pull.js.map +1 -0
  271. package/dist/sync/cloud-record-crud-config.d.ts +19 -0
  272. package/dist/sync/cloud-record-crud-config.d.ts.map +1 -0
  273. package/dist/sync/cloud-record-crud-config.js +22 -0
  274. package/dist/sync/cloud-record-crud-config.js.map +1 -0
  275. package/dist/sync/record-sync-bridge.d.ts +5 -0
  276. package/dist/sync/record-sync-bridge.d.ts.map +1 -0
  277. package/dist/sync/record-sync-bridge.js +121 -0
  278. package/dist/sync/record-sync-bridge.js.map +1 -0
  279. package/dist/sync/resolve-sync-target.d.ts +23 -0
  280. package/dist/sync/resolve-sync-target.d.ts.map +1 -0
  281. package/dist/sync/resolve-sync-target.js +45 -0
  282. package/dist/sync/resolve-sync-target.js.map +1 -0
  283. package/dist/sync/schemas/cloud-pull.d.ts +25 -0
  284. package/dist/sync/schemas/cloud-pull.d.ts.map +1 -0
  285. package/dist/sync/schemas/cloud-pull.js +7 -0
  286. package/dist/sync/schemas/cloud-pull.js.map +1 -0
  287. package/dist/sync/schemas/index.d.ts +9 -0
  288. package/dist/sync/schemas/index.d.ts.map +1 -0
  289. package/dist/sync/schemas/index.js +9 -0
  290. package/dist/sync/schemas/index.js.map +1 -0
  291. package/dist/sync/schemas/sync-helpers.d.ts +17 -0
  292. package/dist/sync/schemas/sync-helpers.d.ts.map +1 -0
  293. package/dist/sync/schemas/sync-helpers.js +7 -0
  294. package/dist/sync/schemas/sync-helpers.js.map +1 -0
  295. package/dist/sync/schemas/sync-state.d.ts +65 -0
  296. package/dist/sync/schemas/sync-state.d.ts.map +1 -0
  297. package/dist/sync/schemas/sync-state.js +32 -0
  298. package/dist/sync/schemas/sync-state.js.map +1 -0
  299. package/dist/sync/sync-bridge.d.ts +80 -0
  300. package/dist/sync/sync-bridge.d.ts.map +1 -0
  301. package/dist/sync/sync-bridge.js +617 -0
  302. package/dist/sync/sync-bridge.js.map +1 -0
  303. package/dist/sync/sync-manifest.d.ts +20 -0
  304. package/dist/sync/sync-manifest.d.ts.map +1 -0
  305. package/dist/sync/sync-manifest.js +140 -0
  306. package/dist/sync/sync-manifest.js.map +1 -0
  307. package/dist/sync/sync-state.consumer.d.ts +23 -0
  308. package/dist/sync/sync-state.consumer.d.ts.map +1 -0
  309. package/dist/sync/sync-state.consumer.js +111 -0
  310. package/dist/sync/sync-state.consumer.js.map +1 -0
  311. package/dist/transform/index.d.ts +75 -0
  312. package/dist/transform/index.d.ts.map +1 -0
  313. package/dist/transform/index.js +81 -0
  314. package/dist/transform/index.js.map +1 -0
  315. package/dist/transform/transform-descriptor.d.ts +51 -0
  316. package/dist/transform/transform-descriptor.d.ts.map +1 -0
  317. package/dist/transform/transform-descriptor.js +30 -0
  318. package/dist/transform/transform-descriptor.js.map +1 -0
  319. package/dist/tui/storage-explorer.descriptor.d.ts +14 -0
  320. package/dist/tui/storage-explorer.descriptor.d.ts.map +1 -0
  321. package/dist/tui/storage-explorer.descriptor.js +29 -0
  322. package/dist/tui/storage-explorer.descriptor.js.map +1 -0
  323. package/dist/tui/storage-explorer.impl.consumer.d.ts +11 -0
  324. package/dist/tui/storage-explorer.impl.consumer.d.ts.map +1 -0
  325. package/dist/tui/storage-explorer.impl.consumer.js +13 -0
  326. package/dist/tui/storage-explorer.impl.consumer.js.map +1 -0
  327. package/dist/tui/storage-open.descriptor.d.ts +14 -0
  328. package/dist/tui/storage-open.descriptor.d.ts.map +1 -0
  329. package/dist/tui/storage-open.descriptor.js +28 -0
  330. package/dist/tui/storage-open.descriptor.js.map +1 -0
  331. package/dist/tui/storage-open.impl.consumer.d.ts +11 -0
  332. package/dist/tui/storage-open.impl.consumer.d.ts.map +1 -0
  333. package/dist/tui/storage-open.impl.consumer.js +13 -0
  334. package/dist/tui/storage-open.impl.consumer.js.map +1 -0
  335. package/dist/utils/error-context.d.ts +2 -0
  336. package/dist/utils/error-context.d.ts.map +1 -0
  337. package/dist/utils/error-context.js +17 -0
  338. package/dist/utils/error-context.js.map +1 -0
  339. package/package.json +241 -0
  340. package/src/adapters/index.ts +13 -0
  341. package/src/bridge/index.ts +2 -0
  342. package/src/bridge/storage-kind-bridge.ts +131 -0
  343. package/src/bridge/types.ts +46 -0
  344. package/src/cli/commands/list/storage.list.cli-command.descriptor.ts +20 -0
  345. package/src/cli/commands/list/storage.list.cli-command.impl.ts +72 -0
  346. package/src/cli/commands/sync/pull/storage.sync.pull.cli-command.descriptor.ts +28 -0
  347. package/src/cli/commands/sync/pull/storage.sync.pull.cli-command.impl.ts +171 -0
  348. package/src/cli/commands/sync/push/storage.sync.push.cli-command.descriptor.ts +28 -0
  349. package/src/cli/commands/sync/push/storage.sync.push.cli-command.impl.ts +213 -0
  350. package/src/cli/commands/sync/resolve/storage.sync.resolve.cli-command.descriptor.ts +22 -0
  351. package/src/cli/commands/sync/resolve/storage.sync.resolve.cli-command.impl.ts +129 -0
  352. package/src/cli/commands/sync/status/storage.sync.status.cli-command.descriptor.ts +17 -0
  353. package/src/cli/commands/sync/status/storage.sync.status.cli-command.impl.ts +192 -0
  354. package/src/cli/context.consumer.ts +195 -0
  355. package/src/cli/storage.cli-group.descriptor.ts +13 -0
  356. package/src/cli/storage.sync.cli-group.descriptor.ts +14 -0
  357. package/src/cli/types.ts +25 -0
  358. package/src/client/index.ts +10 -0
  359. package/src/client/list-browsable-adapters.ts +42 -0
  360. package/src/daemon/commands/sync.ts +225 -0
  361. package/src/docs/adapters.docs.descriptor.ts +225 -0
  362. package/src/docs/manifests.docs.descriptor.ts +318 -0
  363. package/src/docs/records.docs.descriptor.ts +271 -0
  364. package/src/docs/sync.docs.descriptor.ts +281 -0
  365. package/src/index.ts +109 -0
  366. package/src/interfaces/adapter.ts +451 -0
  367. package/src/interfaces/document-store.ts +74 -0
  368. package/src/interfaces/index.ts +117 -0
  369. package/src/interfaces/key-value.ts +112 -0
  370. package/src/interfaces/query-builder.ts +31 -0
  371. package/src/interfaces/record/index.ts +58 -0
  372. package/src/interfaces/record/interface.ts +723 -0
  373. package/src/interfaces/repository.ts +300 -0
  374. package/src/interfaces/schema/index.ts +37 -0
  375. package/src/interfaces/schema/schema-interface.ts +586 -0
  376. package/src/interfaces/schema/table-interface.ts +314 -0
  377. package/src/interfaces/storage-consumer-fs.ts +66 -0
  378. package/src/manifest/base.ts +594 -0
  379. package/src/manifest/cloud-sync.consumer.ts +120 -0
  380. package/src/manifest/index.ts +7 -0
  381. package/src/manifest/source-policy.ts +74 -0
  382. package/src/paths.ts +171 -0
  383. package/src/policy/context.ts +30 -0
  384. package/src/policy/index.ts +20 -0
  385. package/src/policy/overrides.ts +46 -0
  386. package/src/policy/persistence.ts +117 -0
  387. package/src/policy/types.ts +28 -0
  388. package/src/record/base.ts +1872 -0
  389. package/src/record/events.ts +56 -0
  390. package/src/record/extensions.ts +308 -0
  391. package/src/record/index.ts +7 -0
  392. package/src/resolver/storage-backed-resolver.ts +255 -0
  393. package/src/schemas/adapter-descriptor.ts +128 -0
  394. package/src/schemas/index.ts +104 -0
  395. package/src/schemas/manifest-descriptor.ts +143 -0
  396. package/src/schemas/record/descriptor.ts +621 -0
  397. package/src/schemas/record/index.ts +60 -0
  398. package/src/schemas/record/relation.ts +49 -0
  399. package/src/schemas/schema/descriptor.ts +278 -0
  400. package/src/schemas/schema/index.ts +14 -0
  401. package/src/schemas/sync-bridge-descriptor.ts +143 -0
  402. package/src/server/manifest-route.ts +319 -0
  403. package/src/storage-policy.context.descriptor.ts +17 -0
  404. package/src/storage-policy.context.server.ts +34 -0
  405. package/src/storage.plugin.ts +264 -0
  406. package/src/sync/cloud-pull.ts +202 -0
  407. package/src/sync/cloud-record-crud-config.ts +41 -0
  408. package/src/sync/record-sync-bridge.ts +183 -0
  409. package/src/sync/resolve-sync-target.ts +57 -0
  410. package/src/sync/schemas/cloud-pull.ts +26 -0
  411. package/src/sync/schemas/index.ts +18 -0
  412. package/src/sync/schemas/sync-helpers.ts +18 -0
  413. package/src/sync/schemas/sync-state.ts +41 -0
  414. package/src/sync/sync-bridge.ts +763 -0
  415. package/src/sync/sync-manifest.ts +212 -0
  416. package/src/sync/sync-state.consumer.ts +144 -0
  417. package/src/transform/index.ts +130 -0
  418. package/src/transform/transform-descriptor.ts +53 -0
  419. package/src/tui/storage-explorer.descriptor.ts +32 -0
  420. package/src/tui/storage-explorer.impl.consumer.ts +14 -0
  421. package/src/tui/storage-open.descriptor.ts +31 -0
  422. package/src/tui/storage-open.impl.consumer.ts +14 -0
  423. package/src/utils/error-context.ts +19 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-explorer.impl.consumer.js","sourceRoot":"","sources":["../../src/tui/storage-explorer.impl.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,cAAc,GAA4B;IAC/C,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,uCAAuC,EAAE,CAAC;CACzF,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Storage Open — tui/command descriptor
3
+ *
4
+ * Navigates to the Storage Explorer.
5
+ * Triggered via /storage slash command or keybinding.
6
+ *
7
+ * NOTE: The actual TUI types (TuiCommandDescriptor) live in @vibesdotdev/tui, but
8
+ * storage must not depend on tui in production (that would re-create the cycle).
9
+ * We declare the shape inline here using the base RuntimeDescriptor-compatible fields.
10
+ */
11
+ import type { RuntimeDescriptor } from '@vibesdotdev/runtime';
12
+ declare const descriptor: RuntimeDescriptor & Record<string, unknown>;
13
+ export default descriptor;
14
+ //# sourceMappingURL=storage-open.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-open.descriptor.d.ts","sourceRoot":"","sources":["../../src/tui/storage-open.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,QAAA,MAAM,UAAU,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAeZ,CAAC;AAEjD,eAAe,UAAU,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Storage Open — tui/command descriptor
3
+ *
4
+ * Navigates to the Storage Explorer.
5
+ * Triggered via /storage slash command or keybinding.
6
+ *
7
+ * NOTE: The actual TUI types (TuiCommandDescriptor) live in @vibesdotdev/tui, but
8
+ * storage must not depend on tui in production (that would re-create the cycle).
9
+ * We declare the shape inline here using the base RuntimeDescriptor-compatible fields.
10
+ */
11
+ const descriptor = {
12
+ kind: 'tui/command',
13
+ id: 'storage.open',
14
+ title: 'Open Storage Explorer',
15
+ name: 'Open Storage Explorer',
16
+ description: 'Navigate to the Storage Explorer',
17
+ tags: ['navigation'],
18
+ // TUI-specific fields passed through as opaque data
19
+ trigger: '/storage',
20
+ aliases: ['/store', '/db'],
21
+ category: 'Navigation',
22
+ keybinding: 'g then d',
23
+ acceptsArgs: false,
24
+ order: 5,
25
+ enabled: true
26
+ };
27
+ export default descriptor;
28
+ //# sourceMappingURL=storage-open.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-open.descriptor.js","sourceRoot":"","sources":["../../src/tui/storage-open.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,UAAU,GAAgD;IAC/D,IAAI,EAAE,aAAa;IACnB,EAAE,EAAE,cAAc;IAClB,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,kCAAkC;IAC/C,IAAI,EAAE,CAAC,YAAY,CAAC;IACpB,oDAAoD;IACpD,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC;IAC1B,QAAQ,EAAE,YAAY;IACtB,UAAU,EAAE,UAAU;IACtB,WAAW,EAAE,KAAK;IAClB,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,IAAI;CACkC,CAAC;AAEjD,eAAe,UAAU,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Storage Open TUI command implementation (consumer stub).
3
+ *
4
+ * The actual implementation requires @vibesdotdev/tui components.
5
+ * This stub is loaded at runtime only when the TUI stack is present.
6
+ * When TUI is not available, the onRegister hook in storage.plugin.ts
7
+ * skips registration entirely via runtime.hasKind('tui/command').
8
+ */
9
+ declare const implementation: Record<string, unknown>;
10
+ export default implementation;
11
+ //# sourceMappingURL=storage-open.impl.consumer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-open.impl.consumer.d.ts","sourceRoot":"","sources":["../../src/tui/storage-open.impl.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,QAAA,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAE3C,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Storage Open TUI command implementation (consumer stub).
3
+ *
4
+ * The actual implementation requires @vibesdotdev/tui components.
5
+ * This stub is loaded at runtime only when the TUI stack is present.
6
+ * When TUI is not available, the onRegister hook in storage.plugin.ts
7
+ * skips registration entirely via runtime.hasKind('tui/command').
8
+ */
9
+ const implementation = {
10
+ execute: () => ({ type: 'navigate', route: '/storage' })
11
+ };
12
+ export default implementation;
13
+ //# sourceMappingURL=storage-open.impl.consumer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-open.impl.consumer.js","sourceRoot":"","sources":["../../src/tui/storage-open.impl.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,cAAc,GAA4B;IAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;CACxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function toErrorContext(error: unknown): Record<string, unknown> | undefined;
2
+ //# sourceMappingURL=error-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-context.d.ts","sourceRoot":"","sources":["../../src/utils/error-context.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAkBlF"}
@@ -0,0 +1,17 @@
1
+ export function toErrorContext(error) {
2
+ if (error instanceof Error) {
3
+ return {
4
+ error: error.message,
5
+ name: error.name,
6
+ stack: error.stack
7
+ };
8
+ }
9
+ if (typeof error === 'object' && error !== null && !Array.isArray(error)) {
10
+ return error;
11
+ }
12
+ if (error === undefined) {
13
+ return undefined;
14
+ }
15
+ return { error: String(error) };
16
+ }
17
+ //# sourceMappingURL=error-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-context.js","sourceRoot":"","sources":["../../src/utils/error-context.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,KAAc;IAC5C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO;YACN,KAAK,EAAE,KAAK,CAAC,OAAO;YACpB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK;SAClB,CAAC;IACH,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1E,OAAO,KAAgC,CAAC;IACzC,CAAC;IAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACjC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,241 @@
1
+ {
2
+ "name": "@vibesdotdev/storage",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "bun": "./src/index.ts",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./manifest": {
15
+ "types": "./dist/manifest/index.d.ts",
16
+ "bun": "./src/manifest/index.ts",
17
+ "import": "./dist/manifest/index.js",
18
+ "default": "./dist/manifest/index.js"
19
+ },
20
+ "./manifest/*": {
21
+ "types": "./dist/manifest/*.d.ts",
22
+ "bun": "./src/manifest/*.ts",
23
+ "import": "./dist/manifest/*.js",
24
+ "default": "./dist/manifest/*.js"
25
+ },
26
+ "./interfaces": {
27
+ "types": "./dist/interfaces/index.d.ts",
28
+ "bun": "./src/interfaces/index.ts",
29
+ "import": "./dist/interfaces/index.js",
30
+ "default": "./dist/interfaces/index.js"
31
+ },
32
+ "./interfaces/record": {
33
+ "types": "./dist/interfaces/record/index.d.ts",
34
+ "bun": "./src/interfaces/record/index.ts",
35
+ "import": "./dist/interfaces/record/index.js",
36
+ "default": "./dist/interfaces/record/index.js"
37
+ },
38
+ "./interfaces/schema": {
39
+ "types": "./dist/interfaces/schema/index.d.ts",
40
+ "bun": "./src/interfaces/schema/index.ts",
41
+ "import": "./dist/interfaces/schema/index.js",
42
+ "default": "./dist/interfaces/schema/index.js"
43
+ },
44
+ "./interfaces/*": {
45
+ "types": "./dist/interfaces/*.d.ts",
46
+ "bun": "./src/interfaces/*.ts",
47
+ "import": "./dist/interfaces/*.js",
48
+ "default": "./dist/interfaces/*.js"
49
+ },
50
+ "./schemas": {
51
+ "types": "./dist/schemas/index.d.ts",
52
+ "bun": "./src/schemas/index.ts",
53
+ "import": "./dist/schemas/index.js",
54
+ "default": "./dist/schemas/index.js"
55
+ },
56
+ "./schemas/record": {
57
+ "types": "./dist/schemas/record/index.d.ts",
58
+ "bun": "./src/schemas/record/index.ts",
59
+ "import": "./dist/schemas/record/index.js",
60
+ "default": "./dist/schemas/record/index.js"
61
+ },
62
+ "./schemas/schema": {
63
+ "types": "./dist/schemas/schema/index.d.ts",
64
+ "bun": "./src/schemas/schema/index.ts",
65
+ "import": "./dist/schemas/schema/index.js",
66
+ "default": "./dist/schemas/schema/index.js"
67
+ },
68
+ "./schemas/*": {
69
+ "types": "./dist/schemas/*.d.ts",
70
+ "bun": "./src/schemas/*.ts",
71
+ "import": "./dist/schemas/*.js",
72
+ "default": "./dist/schemas/*.js"
73
+ },
74
+ "./sync": {
75
+ "types": "./dist/sync/sync-bridge.d.ts",
76
+ "bun": "./src/sync/sync-bridge.ts",
77
+ "import": "./dist/sync/sync-bridge.js",
78
+ "default": "./dist/sync/sync-bridge.js"
79
+ },
80
+ "./sync/*": {
81
+ "types": "./dist/sync/*.d.ts",
82
+ "bun": "./src/sync/*.ts",
83
+ "import": "./dist/sync/*.js",
84
+ "default": "./dist/sync/*.js"
85
+ },
86
+ "./record": {
87
+ "types": "./dist/record/index.d.ts",
88
+ "bun": "./src/record/index.ts",
89
+ "import": "./dist/record/index.js",
90
+ "default": "./dist/record/index.js"
91
+ },
92
+ "./record/base": {
93
+ "types": "./dist/record/base.d.ts",
94
+ "bun": "./src/record/base.ts",
95
+ "import": "./dist/record/base.js",
96
+ "default": "./dist/record/base.js"
97
+ },
98
+ "./record/*": {
99
+ "types": "./dist/record/*.d.ts",
100
+ "bun": "./src/record/*.ts",
101
+ "import": "./dist/record/*.js",
102
+ "default": "./dist/record/*.js"
103
+ },
104
+ "./bridge": {
105
+ "types": "./dist/bridge/index.d.ts",
106
+ "bun": "./src/bridge/index.ts",
107
+ "import": "./dist/bridge/index.js",
108
+ "default": "./dist/bridge/index.js"
109
+ },
110
+ "./bridge/types": {
111
+ "types": "./dist/bridge/types.d.ts",
112
+ "bun": "./src/bridge/types.ts",
113
+ "import": "./dist/bridge/types.js",
114
+ "default": "./dist/bridge/types.js"
115
+ },
116
+ "./client": {
117
+ "types": "./dist/client/index.d.ts",
118
+ "bun": "./src/client/index.ts",
119
+ "import": "./dist/client/index.js",
120
+ "default": "./dist/client/index.js"
121
+ },
122
+ "./client/*": {
123
+ "types": "./dist/client/*.d.ts",
124
+ "bun": "./src/client/*.ts",
125
+ "import": "./dist/client/*.js",
126
+ "default": "./dist/client/*.js"
127
+ },
128
+ "./resolver/*": {
129
+ "types": "./dist/resolver/*.d.ts",
130
+ "bun": "./src/resolver/*.ts",
131
+ "import": "./dist/resolver/*.js",
132
+ "default": "./dist/resolver/*.js"
133
+ },
134
+ "./cli/*": {
135
+ "types": "./dist/cli/*.d.ts",
136
+ "bun": "./src/cli/*.ts",
137
+ "import": "./dist/cli/*.js",
138
+ "default": "./dist/cli/*.js"
139
+ },
140
+ "./tui/*": {
141
+ "types": "./dist/tui/*.d.ts",
142
+ "bun": "./src/tui/*.ts",
143
+ "import": "./dist/tui/*.js",
144
+ "default": "./dist/tui/*.js"
145
+ },
146
+ "./daemon/commands/*": {
147
+ "types": "./dist/daemon/commands/*.d.ts",
148
+ "bun": "./src/daemon/commands/*.ts",
149
+ "import": "./dist/daemon/commands/*.js",
150
+ "default": "./dist/daemon/commands/*.js"
151
+ },
152
+ "./paths": {
153
+ "types": "./dist/paths.d.ts",
154
+ "bun": "./src/paths.ts",
155
+ "import": "./dist/paths.js",
156
+ "default": "./dist/paths.js"
157
+ },
158
+ "./plugin": {
159
+ "types": "./dist/storage.plugin.d.ts",
160
+ "bun": "./src/storage.plugin.ts",
161
+ "import": "./dist/storage.plugin.js",
162
+ "default": "./dist/storage.plugin.js"
163
+ },
164
+ "./storage.plugin": {
165
+ "types": "./dist/storage.plugin.d.ts",
166
+ "bun": "./src/storage.plugin.ts",
167
+ "import": "./dist/storage.plugin.js",
168
+ "default": "./dist/storage.plugin.js"
169
+ },
170
+ "./server/manifest-route": {
171
+ "types": "./dist/server/manifest-route.d.ts",
172
+ "bun": "./src/server/manifest-route.ts",
173
+ "import": "./dist/server/manifest-route.js",
174
+ "default": "./dist/server/manifest-route.js"
175
+ },
176
+ "./transform": {
177
+ "types": "./dist/transform/index.d.ts",
178
+ "bun": "./src/transform/index.ts",
179
+ "import": "./dist/transform/index.js",
180
+ "default": "./dist/transform/index.js"
181
+ },
182
+ "./transform/*": {
183
+ "types": "./dist/transform/*.d.ts",
184
+ "bun": "./src/transform/*.ts",
185
+ "import": "./dist/transform/*.js",
186
+ "default": "./dist/transform/*.js"
187
+ }
188
+ },
189
+ "publishConfig": {
190
+ "registry": "https://registry.npmjs.org",
191
+ "access": "public"
192
+ },
193
+ "repository": {
194
+ "type": "git",
195
+ "url": "git+https://github.com/vibesdotdev/monorepo.git",
196
+ "directory": "packages/storage"
197
+ },
198
+ "peerDependencies": {
199
+ "@vibesdotdev/runtime": "0.0.1"
200
+ },
201
+ "dependencies": {
202
+ "@vibesdotdev/logging": "0.0.1",
203
+ "@vibesdotdev/runtime-plugin-types": "0.0.1",
204
+ "zod": "^4.3.6"
205
+ },
206
+ "scripts": {
207
+ "test:isolated": "bun test src/__tests_isolated__",
208
+ "test:main": "bun test src/__tests__ src/manifest src/policy src/record src/resolver src/schemas src/sync src/tui",
209
+ "test": "bun run test:isolated && bun run test:main",
210
+ "check": "bun --bun tsc -p tsconfig.json --noEmit",
211
+ "build": "tsc -p tsconfig.json"
212
+ },
213
+ "license": "MIT",
214
+ "files": [
215
+ "dist",
216
+ "src",
217
+ "bin",
218
+ "README.md",
219
+ "SPEC.md",
220
+ "LICENSE",
221
+ "!src/**/__tests__/**",
222
+ "!src/**/__stubs__/**",
223
+ "!src/**/*.test.ts",
224
+ "!src/**/*.test.tsx",
225
+ "!src/**/*.spec.ts",
226
+ "!src/**/*.spec.tsx",
227
+ "!dist/**/__tests__/**",
228
+ "!dist/**/__stubs__/**",
229
+ "!dist/**/*.test.js",
230
+ "!dist/**/*.test.js.map",
231
+ "!dist/**/*.test.d.ts",
232
+ "!dist/**/*.test.d.ts.map",
233
+ "!dist/**/*.spec.js",
234
+ "!dist/**/*.spec.js.map",
235
+ "!dist/**/*.spec.d.ts",
236
+ "!dist/**/*.spec.d.ts.map"
237
+ ],
238
+ "vibes": {
239
+ "visibility": "public-framework"
240
+ }
241
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Storage Adapters
3
+ *
4
+ * Concrete adapter implementations are resolved through the vibes runtime.
5
+ * Feature packages must NEVER import adapter packages directly.
6
+ *
7
+ * Adapters register themselves via runtime plugins; consumers query them
8
+ * through `runtime.query('storage/adapter')` or use the StorageManifest
9
+ * abstraction which handles adapter resolution internally.
10
+ *
11
+ * External integrations (SharePoint, etc.) live in their owning integration
12
+ * package (e.g. `@vibesdotdev/integrations-microsoft/sharepoint`).
13
+ */
@@ -0,0 +1,2 @@
1
+ export { bridgeStorageKinds } from './storage-kind-bridge';
2
+ export type { StorageKindBridgeConfig } from './types';
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Storage Kind Bridge
3
+ *
4
+ * Hydrates runtime kind registries from storage manifest data.
5
+ * Storage manifests that declare `providesRuntimeKinds` will have their
6
+ * stored items loaded and registered as runtime descriptors (and optionally
7
+ * implementation loaders) so they are discoverable via `runtime.query()`.
8
+ *
9
+ * This runs at boot after discovery completes and storage adapters are available.
10
+ */
11
+
12
+ import type { VibesRuntime } from '@vibesdotdev/runtime/api/runtime';
13
+ import type { StorageManifestDescriptor } from '../schemas/manifest-descriptor';
14
+ import { StorageManifest } from '../manifest/base';
15
+ import type { StorageKindBridgeConfig } from './types';
16
+ import { createTracer } from '@vibesdotdev/runtime/debug';
17
+
18
+ /**
19
+ * Bridge storage manifest items into runtime kind registries.
20
+ *
21
+ * For each storage manifest with `providesRuntimeKinds`:
22
+ * 1. Loads stored data via the manifest's resolved adapter
23
+ * 2. Transforms each item into a runtime descriptor
24
+ * 3. Registers the descriptor (makes it queryable)
25
+ * 4. Optionally registers an implementation loader
26
+ *
27
+ * @returns Count of bridged items and any errors encountered
28
+ */
29
+ export async function bridgeStorageKinds(
30
+ runtime: VibesRuntime
31
+ ): Promise<{ bridged: number; errors: string[] }> {
32
+ const bridgeTracer = createTracer('bridgeStorageKinds');
33
+ bridgeTracer.start();
34
+
35
+ if (!runtime.hasKind('storage/manifest')) {
36
+ bridgeTracer.end('no storage/manifest kind');
37
+ return { bridged: 0, errors: [] };
38
+ }
39
+
40
+ const manifests = runtime.assets('storage/manifest').descriptors();
41
+ let bridged = 0;
42
+ const errors: string[] = [];
43
+
44
+ // Process manifests in parallel to reduce I/O wait time
45
+ const manifestPromises = (manifests as StorageManifestDescriptor[]).map(async (manifest) => {
46
+ const storageManifest = manifest;
47
+ const bridgeConfig = storageManifest.providesRuntimeKinds;
48
+ if (!bridgeConfig) return { bridged: 0, errors: [] as string[] };
49
+
50
+ const manifestTracer = createTracer(`manifest:${manifest.id}`);
51
+ manifestTracer.start();
52
+
53
+ let items: unknown[];
54
+ try {
55
+ const storage = StorageManifest.fromId(manifest.id);
56
+ const data = await storage.load();
57
+ if (!data) {
58
+ manifestTracer.end('no data');
59
+ return { bridged: 0, errors: [] as string[] };
60
+ }
61
+ if (Array.isArray(data)) {
62
+ items = data;
63
+ } else if (typeof data === 'object' && data !== null) {
64
+ // Record/object storage: extract values as individual items
65
+ items = Object.values(data);
66
+ } else {
67
+ items = [data];
68
+ }
69
+ manifestTracer.end(`loaded ${items.length} items`);
70
+ } catch (err) {
71
+ manifestTracer.end('failed');
72
+ return {
73
+ bridged: 0,
74
+ errors: [
75
+ `Failed to load storage '${manifest.id}': ${err instanceof Error ? err.message : String(err)}`
76
+ ]
77
+ };
78
+ }
79
+
80
+ let manifestBridged = 0;
81
+ const manifestErrors: string[] = [];
82
+
83
+ for (const [kindId, rawConfig] of Object.entries(bridgeConfig)) {
84
+ if (!runtime.hasKind(kindId)) {
85
+ manifestErrors.push(
86
+ `Storage '${manifest.id}' declares providesRuntimeKinds for unregistered kind '${kindId}'`
87
+ );
88
+ continue;
89
+ }
90
+
91
+ const config = rawConfig as StorageKindBridgeConfig;
92
+
93
+ for (const item of items) {
94
+ try {
95
+ if (config.filter && !config.filter(item)) continue;
96
+
97
+ const descriptor = config.toDescriptor(item);
98
+
99
+ runtime.registerDescriptor(kindId, descriptor);
100
+
101
+ if (config.implementation) {
102
+ const ImplClass = config.implementation;
103
+ runtime.registerLoader(kindId, descriptor.id, async () => ({
104
+ meta: { id: descriptor.id, kind: kindId, priority: 0 },
105
+ impl: ImplClass
106
+ }));
107
+ }
108
+
109
+ manifestBridged++;
110
+ } catch (err) {
111
+ manifestErrors.push(
112
+ `Failed to bridge item from '${manifest.id}' to '${kindId}': ${err instanceof Error ? err.message : String(err)}`
113
+ );
114
+ }
115
+ }
116
+ }
117
+
118
+ return { bridged: manifestBridged, errors: manifestErrors };
119
+ });
120
+
121
+ // Wait for all manifest processing to complete
122
+ const results = await Promise.all(manifestPromises);
123
+
124
+ for (const result of results) {
125
+ bridged += result.bridged;
126
+ errors.push(...result.errors);
127
+ }
128
+
129
+ bridgeTracer.end(`bridged ${bridged} items`);
130
+ return { bridged, errors };
131
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Storage Kind Bridge Types
3
+ *
4
+ * Type-safe configuration for bridging storage manifest items
5
+ * into runtime kind queries.
6
+ */
7
+
8
+ import type { RuntimeDescriptor } from '@vibesdotdev/runtime/schemas/descriptor';
9
+
10
+ /**
11
+ * Configuration for bridging stored items to a runtime kind.
12
+ *
13
+ * Declared on a StorageManifestDescriptor via `providesRuntimeKinds`.
14
+ * The bridge utility reads this config to register descriptors and
15
+ * optional implementation loaders with the runtime.
16
+ *
17
+ * @template TStored - The shape of individual stored items
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const config: StorageKindBridgeConfig<AgentConfig> = {
22
+ * toDescriptor: (item) => createAIAgentDescriptor({ ... }),
23
+ * implementation: ReactAgent,
24
+ * filter: (item) => item.enabled !== false
25
+ * };
26
+ * ```
27
+ */
28
+ export interface StorageKindBridgeConfig<TStored = unknown> {
29
+ /** Transform a stored item into a runtime descriptor for this kind */
30
+ toDescriptor: (item: TStored) => RuntimeDescriptor;
31
+
32
+ /**
33
+ * Implementation class to register as a loader.
34
+ * If provided, the runtime will instantiate it with (descriptor, context)
35
+ * when the asset is resolved. If omitted, the kind's defaultImplementation
36
+ * is used instead.
37
+ */
38
+ implementation?: new (descriptor: RuntimeDescriptor, context: { runtime: unknown }) => unknown;
39
+
40
+ /**
41
+ * Filter which stored items to bridge.
42
+ * Return true to include the item, false to skip.
43
+ * If omitted, all items are bridged.
44
+ */
45
+ filter?: (item: TStored) => boolean;
46
+ }
@@ -0,0 +1,20 @@
1
+ import type { CLICommandAssetDescriptor } from '@vibesdotdev/runtime/schemas/asset';
2
+
3
+ const descriptor: CLICommandAssetDescriptor = {
4
+ kind: 'cli/command',
5
+ id: 'storage.list',
6
+ name: 'list',
7
+ description: 'List all registered storage manifests',
8
+ group: 'storage',
9
+ arguments: [],
10
+ options: [
11
+ { flags: '--json', description: 'Output as JSON' },
12
+ { flags: '--sync-only', description: 'Only show manifests with cloud sync enabled' }
13
+ ],
14
+ aliases: ['ls'],
15
+ surfaces: ['cli'],
16
+ hardware: ['consumer'],
17
+ enabled: true
18
+ };
19
+
20
+ export default descriptor;
@@ -0,0 +1,72 @@
1
+ /**
2
+ * vibes storage list
3
+ *
4
+ * Lists all registered storage manifests with their adapter configuration,
5
+ * custom table status, and sync eligibility.
6
+ */
7
+
8
+ import { getVibesRuntime } from '@vibesdotdev/runtime';
9
+ import type { StorageCliUIContext as UIContext } from '../../types';
10
+
11
+ interface ManifestDescriptor {
12
+ id: string;
13
+ namespace: string;
14
+ name?: string;
15
+ defaultAdapter?: string;
16
+ allowedAdapters?: string[];
17
+ customTables?: boolean;
18
+ scope?: string;
19
+ enabled?: boolean;
20
+ }
21
+
22
+ export default {
23
+ async execute(_args: Record<string, unknown>, opts: Record<string, unknown>): Promise<void> {
24
+ const runtime = getVibesRuntime();
25
+ const ui = (await runtime.context('cli/ui')) as UIContext;
26
+
27
+ try {
28
+ const descriptors = runtime.query('storage/manifest').descriptors() as unknown as ManifestDescriptor[];
29
+
30
+ let manifests = descriptors.filter((d) => d.enabled !== false);
31
+
32
+ if (opts.syncOnly) {
33
+ manifests = manifests.filter((d) => d.allowedAdapters?.includes('storage.cloud-api'));
34
+ }
35
+
36
+ if (opts.json) {
37
+ ui.render(
38
+ manifests.map((d) => ({
39
+ id: d.id,
40
+ namespace: d.namespace,
41
+ defaultAdapter: d.defaultAdapter,
42
+ customTables: d.customTables ?? false,
43
+ syncEnabled: d.allowedAdapters?.includes('storage.cloud-api') ?? false,
44
+ scope: d.scope ?? 'global'
45
+ })),
46
+ { format: 'json' }
47
+ );
48
+ return;
49
+ }
50
+
51
+ if (manifests.length === 0) {
52
+ ui.info('No storage manifests registered.');
53
+ return;
54
+ }
55
+
56
+ ui.table(
57
+ manifests.map((d) => ({
58
+ ID: d.id,
59
+ Namespace: d.namespace,
60
+ Adapter: d.defaultAdapter ?? '—',
61
+ 'Custom Tables': d.customTables ? 'yes' : 'no',
62
+ 'Cloud Sync': d.allowedAdapters?.includes('storage.cloud-api') ? 'yes' : 'no',
63
+ Scope: d.scope ?? 'global'
64
+ })),
65
+ ['ID', 'Namespace', 'Adapter', 'Custom Tables', 'Cloud Sync', 'Scope']
66
+ );
67
+ } catch (e) {
68
+ ui.error(`Failed to list manifests: ${e}`);
69
+ process.exit(1);
70
+ }
71
+ }
72
+ };