@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.
- package/README.md +75 -0
- package/SPEC.md +60 -0
- package/dist/adapters/index.d.ts +14 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +15 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/bridge/index.d.ts +3 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/index.js +2 -0
- package/dist/bridge/index.js.map +1 -0
- package/dist/bridge/storage-kind-bridge.d.ts +27 -0
- package/dist/bridge/storage-kind-bridge.d.ts.map +1 -0
- package/dist/bridge/storage-kind-bridge.js +110 -0
- package/dist/bridge/storage-kind-bridge.js.map +1 -0
- package/dist/bridge/types.d.ts +45 -0
- package/dist/bridge/types.d.ts.map +1 -0
- package/dist/bridge/types.js +8 -0
- package/dist/bridge/types.js.map +1 -0
- package/dist/cli/commands/list/storage.list.cli-command.descriptor.d.ts +4 -0
- package/dist/cli/commands/list/storage.list.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/commands/list/storage.list.cli-command.descriptor.js +18 -0
- package/dist/cli/commands/list/storage.list.cli-command.descriptor.js.map +1 -0
- package/dist/cli/commands/list/storage.list.cli-command.impl.d.ts +11 -0
- package/dist/cli/commands/list/storage.list.cli-command.impl.d.ts.map +1 -0
- package/dist/cli/commands/list/storage.list.cli-command.impl.js +48 -0
- package/dist/cli/commands/list/storage.list.cli-command.impl.js.map +1 -0
- package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.descriptor.d.ts +4 -0
- package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.descriptor.js +26 -0
- package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.descriptor.js.map +1 -0
- package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.impl.d.ts +13 -0
- package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.impl.d.ts.map +1 -0
- package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.impl.js +136 -0
- package/dist/cli/commands/sync/pull/storage.sync.pull.cli-command.impl.js.map +1 -0
- package/dist/cli/commands/sync/push/storage.sync.push.cli-command.descriptor.d.ts +4 -0
- package/dist/cli/commands/sync/push/storage.sync.push.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/commands/sync/push/storage.sync.push.cli-command.descriptor.js +26 -0
- package/dist/cli/commands/sync/push/storage.sync.push.cli-command.descriptor.js.map +1 -0
- package/dist/cli/commands/sync/push/storage.sync.push.cli-command.impl.d.ts +13 -0
- package/dist/cli/commands/sync/push/storage.sync.push.cli-command.impl.d.ts.map +1 -0
- package/dist/cli/commands/sync/push/storage.sync.push.cli-command.impl.js +165 -0
- package/dist/cli/commands/sync/push/storage.sync.push.cli-command.impl.js.map +1 -0
- package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.descriptor.d.ts +4 -0
- package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.descriptor.js +20 -0
- package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.descriptor.js.map +1 -0
- package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.impl.d.ts +12 -0
- package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.impl.d.ts.map +1 -0
- package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.impl.js +95 -0
- package/dist/cli/commands/sync/resolve/storage.sync.resolve.cli-command.impl.js.map +1 -0
- package/dist/cli/commands/sync/status/storage.sync.status.cli-command.descriptor.d.ts +4 -0
- package/dist/cli/commands/sync/status/storage.sync.status.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/commands/sync/status/storage.sync.status.cli-command.descriptor.js +15 -0
- package/dist/cli/commands/sync/status/storage.sync.status.cli-command.descriptor.js.map +1 -0
- package/dist/cli/commands/sync/status/storage.sync.status.cli-command.impl.d.ts +13 -0
- package/dist/cli/commands/sync/status/storage.sync.status.cli-command.impl.d.ts.map +1 -0
- package/dist/cli/commands/sync/status/storage.sync.status.cli-command.impl.js +150 -0
- package/dist/cli/commands/sync/status/storage.sync.status.cli-command.impl.js.map +1 -0
- package/dist/cli/context.consumer.d.ts +26 -0
- package/dist/cli/context.consumer.d.ts.map +1 -0
- package/dist/cli/context.consumer.js +164 -0
- package/dist/cli/context.consumer.js.map +1 -0
- package/dist/cli/storage.cli-group.descriptor.d.ts +4 -0
- package/dist/cli/storage.cli-group.descriptor.d.ts.map +1 -0
- package/dist/cli/storage.cli-group.descriptor.js +11 -0
- package/dist/cli/storage.cli-group.descriptor.js.map +1 -0
- package/dist/cli/storage.sync.cli-group.descriptor.d.ts +4 -0
- package/dist/cli/storage.sync.cli-group.descriptor.d.ts.map +1 -0
- package/dist/cli/storage.sync.cli-group.descriptor.js +12 -0
- package/dist/cli/storage.sync.cli-group.descriptor.js.map +1 -0
- package/dist/cli/types.d.ts +26 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +11 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/client/index.d.ts +10 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +10 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/list-browsable-adapters.d.ts +31 -0
- package/dist/client/list-browsable-adapters.d.ts.map +1 -0
- package/dist/client/list-browsable-adapters.js +40 -0
- package/dist/client/list-browsable-adapters.js.map +1 -0
- package/dist/daemon/commands/sync.d.ts +23 -0
- package/dist/daemon/commands/sync.d.ts.map +1 -0
- package/dist/daemon/commands/sync.js +169 -0
- package/dist/daemon/commands/sync.js.map +1 -0
- package/dist/docs/adapters.docs.descriptor.d.ts +4 -0
- package/dist/docs/adapters.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/adapters.docs.descriptor.js +223 -0
- package/dist/docs/adapters.docs.descriptor.js.map +1 -0
- package/dist/docs/manifests.docs.descriptor.d.ts +4 -0
- package/dist/docs/manifests.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/manifests.docs.descriptor.js +316 -0
- package/dist/docs/manifests.docs.descriptor.js.map +1 -0
- package/dist/docs/records.docs.descriptor.d.ts +4 -0
- package/dist/docs/records.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/records.docs.descriptor.js +269 -0
- package/dist/docs/records.docs.descriptor.js.map +1 -0
- package/dist/docs/sync.docs.descriptor.d.ts +4 -0
- package/dist/docs/sync.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/sync.docs.descriptor.js +279 -0
- package/dist/docs/sync.docs.descriptor.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/adapter.d.ts +382 -0
- package/dist/interfaces/adapter.d.ts.map +1 -0
- package/dist/interfaces/adapter.js +11 -0
- package/dist/interfaces/adapter.js.map +1 -0
- package/dist/interfaces/document-store.d.ts +62 -0
- package/dist/interfaces/document-store.d.ts.map +1 -0
- package/dist/interfaces/document-store.js +8 -0
- package/dist/interfaces/document-store.js.map +1 -0
- package/dist/interfaces/index.d.ts +17 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +24 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/key-value.d.ts +95 -0
- package/dist/interfaces/key-value.d.ts.map +1 -0
- package/dist/interfaces/key-value.js +8 -0
- package/dist/interfaces/key-value.js.map +1 -0
- package/dist/interfaces/query-builder.d.ts +31 -0
- package/dist/interfaces/query-builder.d.ts.map +1 -0
- package/dist/interfaces/query-builder.js +11 -0
- package/dist/interfaces/query-builder.js.map +1 -0
- package/dist/interfaces/record/index.d.ts +7 -0
- package/dist/interfaces/record/index.d.ts.map +1 -0
- package/dist/interfaces/record/index.js +7 -0
- package/dist/interfaces/record/index.js.map +1 -0
- package/dist/interfaces/record/interface.d.ts +593 -0
- package/dist/interfaces/record/interface.d.ts.map +1 -0
- package/dist/interfaces/record/interface.js +49 -0
- package/dist/interfaces/record/interface.js.map +1 -0
- package/dist/interfaces/repository.d.ts +262 -0
- package/dist/interfaces/repository.d.ts.map +1 -0
- package/dist/interfaces/repository.js +8 -0
- package/dist/interfaces/repository.js.map +1 -0
- package/dist/interfaces/schema/index.d.ts +8 -0
- package/dist/interfaces/schema/index.d.ts.map +1 -0
- package/dist/interfaces/schema/index.js +10 -0
- package/dist/interfaces/schema/index.js.map +1 -0
- package/dist/interfaces/schema/schema-interface.d.ts +516 -0
- package/dist/interfaces/schema/schema-interface.d.ts.map +1 -0
- package/dist/interfaces/schema/schema-interface.js +31 -0
- package/dist/interfaces/schema/schema-interface.js.map +1 -0
- package/dist/interfaces/schema/table-interface.d.ts +250 -0
- package/dist/interfaces/schema/table-interface.d.ts.map +1 -0
- package/dist/interfaces/schema/table-interface.js +31 -0
- package/dist/interfaces/schema/table-interface.js.map +1 -0
- package/dist/interfaces/storage-consumer-fs.d.ts +40 -0
- package/dist/interfaces/storage-consumer-fs.d.ts.map +1 -0
- package/dist/interfaces/storage-consumer-fs.js +42 -0
- package/dist/interfaces/storage-consumer-fs.js.map +1 -0
- package/dist/manifest/base.d.ts +187 -0
- package/dist/manifest/base.d.ts.map +1 -0
- package/dist/manifest/base.js +516 -0
- package/dist/manifest/base.js.map +1 -0
- package/dist/manifest/cloud-sync.consumer.d.ts +7 -0
- package/dist/manifest/cloud-sync.consumer.d.ts.map +1 -0
- package/dist/manifest/cloud-sync.consumer.js +82 -0
- package/dist/manifest/cloud-sync.consumer.js.map +1 -0
- package/dist/manifest/index.d.ts +7 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +7 -0
- package/dist/manifest/index.js.map +1 -0
- package/dist/manifest/source-policy.d.ts +8 -0
- package/dist/manifest/source-policy.d.ts.map +1 -0
- package/dist/manifest/source-policy.js +62 -0
- package/dist/manifest/source-policy.js.map +1 -0
- package/dist/paths.d.ts +6 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +152 -0
- package/dist/paths.js.map +1 -0
- package/dist/policy/context.d.ts +9 -0
- package/dist/policy/context.d.ts.map +1 -0
- package/dist/policy/context.js +29 -0
- package/dist/policy/context.js.map +1 -0
- package/dist/policy/index.d.ts +4 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/index.js +4 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/policy/overrides.d.ts +40 -0
- package/dist/policy/overrides.d.ts.map +1 -0
- package/dist/policy/overrides.js +37 -0
- package/dist/policy/overrides.js.map +1 -0
- package/dist/policy/persistence.d.ts +38 -0
- package/dist/policy/persistence.d.ts.map +1 -0
- package/dist/policy/persistence.js +65 -0
- package/dist/policy/persistence.js.map +1 -0
- package/dist/policy/types.d.ts +21 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +7 -0
- package/dist/policy/types.js.map +1 -0
- package/dist/record/base.d.ts +186 -0
- package/dist/record/base.d.ts.map +1 -0
- package/dist/record/base.js +1437 -0
- package/dist/record/base.js.map +1 -0
- package/dist/record/events.d.ts +71 -0
- package/dist/record/events.d.ts.map +1 -0
- package/dist/record/events.js +52 -0
- package/dist/record/events.js.map +1 -0
- package/dist/record/extensions.d.ts +51 -0
- package/dist/record/extensions.d.ts.map +1 -0
- package/dist/record/extensions.js +222 -0
- package/dist/record/extensions.js.map +1 -0
- package/dist/record/index.d.ts +7 -0
- package/dist/record/index.d.ts.map +1 -0
- package/dist/record/index.js +7 -0
- package/dist/record/index.js.map +1 -0
- package/dist/resolver/storage-backed-resolver.d.ts +23 -0
- package/dist/resolver/storage-backed-resolver.d.ts.map +1 -0
- package/dist/resolver/storage-backed-resolver.js +187 -0
- package/dist/resolver/storage-backed-resolver.js.map +1 -0
- package/dist/schemas/adapter-descriptor.d.ts +108 -0
- package/dist/schemas/adapter-descriptor.d.ts.map +1 -0
- package/dist/schemas/adapter-descriptor.js +101 -0
- package/dist/schemas/adapter-descriptor.js.map +1 -0
- package/dist/schemas/index.d.ts +14 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +12 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/manifest-descriptor.d.ts +110 -0
- package/dist/schemas/manifest-descriptor.d.ts.map +1 -0
- package/dist/schemas/manifest-descriptor.js +114 -0
- package/dist/schemas/manifest-descriptor.js.map +1 -0
- package/dist/schemas/record/descriptor.d.ts +570 -0
- package/dist/schemas/record/descriptor.d.ts.map +1 -0
- package/dist/schemas/record/descriptor.js +389 -0
- package/dist/schemas/record/descriptor.js.map +1 -0
- package/dist/schemas/record/index.d.ts +8 -0
- package/dist/schemas/record/index.d.ts.map +1 -0
- package/dist/schemas/record/index.js +7 -0
- package/dist/schemas/record/index.js.map +1 -0
- package/dist/schemas/record/relation.d.ts +36 -0
- package/dist/schemas/record/relation.d.ts.map +1 -0
- package/dist/schemas/record/relation.js +37 -0
- package/dist/schemas/record/relation.js.map +1 -0
- package/dist/schemas/schema/descriptor.d.ts +231 -0
- package/dist/schemas/schema/descriptor.d.ts.map +1 -0
- package/dist/schemas/schema/descriptor.js +205 -0
- package/dist/schemas/schema/descriptor.js.map +1 -0
- package/dist/schemas/schema/index.d.ts +7 -0
- package/dist/schemas/schema/index.d.ts.map +1 -0
- package/dist/schemas/schema/index.js +7 -0
- package/dist/schemas/schema/index.js.map +1 -0
- package/dist/schemas/sync-bridge-descriptor.d.ts +124 -0
- package/dist/schemas/sync-bridge-descriptor.d.ts.map +1 -0
- package/dist/schemas/sync-bridge-descriptor.js +67 -0
- package/dist/schemas/sync-bridge-descriptor.js.map +1 -0
- package/dist/server/manifest-route.d.ts +92 -0
- package/dist/server/manifest-route.d.ts.map +1 -0
- package/dist/server/manifest-route.js +226 -0
- package/dist/server/manifest-route.js.map +1 -0
- package/dist/storage-policy.context.descriptor.d.ts +16 -0
- package/dist/storage-policy.context.descriptor.d.ts.map +1 -0
- package/dist/storage-policy.context.descriptor.js +16 -0
- package/dist/storage-policy.context.descriptor.js.map +1 -0
- package/dist/storage-policy.context.server.d.ts +14 -0
- package/dist/storage-policy.context.server.d.ts.map +1 -0
- package/dist/storage-policy.context.server.js +27 -0
- package/dist/storage-policy.context.server.js.map +1 -0
- package/dist/storage.plugin.d.ts +38 -0
- package/dist/storage.plugin.d.ts.map +1 -0
- package/dist/storage.plugin.js +204 -0
- package/dist/storage.plugin.js.map +1 -0
- package/dist/sync/cloud-pull.d.ts +15 -0
- package/dist/sync/cloud-pull.d.ts.map +1 -0
- package/dist/sync/cloud-pull.js +130 -0
- package/dist/sync/cloud-pull.js.map +1 -0
- package/dist/sync/cloud-record-crud-config.d.ts +19 -0
- package/dist/sync/cloud-record-crud-config.d.ts.map +1 -0
- package/dist/sync/cloud-record-crud-config.js +22 -0
- package/dist/sync/cloud-record-crud-config.js.map +1 -0
- package/dist/sync/record-sync-bridge.d.ts +5 -0
- package/dist/sync/record-sync-bridge.d.ts.map +1 -0
- package/dist/sync/record-sync-bridge.js +121 -0
- package/dist/sync/record-sync-bridge.js.map +1 -0
- package/dist/sync/resolve-sync-target.d.ts +23 -0
- package/dist/sync/resolve-sync-target.d.ts.map +1 -0
- package/dist/sync/resolve-sync-target.js +45 -0
- package/dist/sync/resolve-sync-target.js.map +1 -0
- package/dist/sync/schemas/cloud-pull.d.ts +25 -0
- package/dist/sync/schemas/cloud-pull.d.ts.map +1 -0
- package/dist/sync/schemas/cloud-pull.js +7 -0
- package/dist/sync/schemas/cloud-pull.js.map +1 -0
- package/dist/sync/schemas/index.d.ts +9 -0
- package/dist/sync/schemas/index.d.ts.map +1 -0
- package/dist/sync/schemas/index.js +9 -0
- package/dist/sync/schemas/index.js.map +1 -0
- package/dist/sync/schemas/sync-helpers.d.ts +17 -0
- package/dist/sync/schemas/sync-helpers.d.ts.map +1 -0
- package/dist/sync/schemas/sync-helpers.js +7 -0
- package/dist/sync/schemas/sync-helpers.js.map +1 -0
- package/dist/sync/schemas/sync-state.d.ts +65 -0
- package/dist/sync/schemas/sync-state.d.ts.map +1 -0
- package/dist/sync/schemas/sync-state.js +32 -0
- package/dist/sync/schemas/sync-state.js.map +1 -0
- package/dist/sync/sync-bridge.d.ts +80 -0
- package/dist/sync/sync-bridge.d.ts.map +1 -0
- package/dist/sync/sync-bridge.js +617 -0
- package/dist/sync/sync-bridge.js.map +1 -0
- package/dist/sync/sync-manifest.d.ts +20 -0
- package/dist/sync/sync-manifest.d.ts.map +1 -0
- package/dist/sync/sync-manifest.js +140 -0
- package/dist/sync/sync-manifest.js.map +1 -0
- package/dist/sync/sync-state.consumer.d.ts +23 -0
- package/dist/sync/sync-state.consumer.d.ts.map +1 -0
- package/dist/sync/sync-state.consumer.js +111 -0
- package/dist/sync/sync-state.consumer.js.map +1 -0
- package/dist/transform/index.d.ts +75 -0
- package/dist/transform/index.d.ts.map +1 -0
- package/dist/transform/index.js +81 -0
- package/dist/transform/index.js.map +1 -0
- package/dist/transform/transform-descriptor.d.ts +51 -0
- package/dist/transform/transform-descriptor.d.ts.map +1 -0
- package/dist/transform/transform-descriptor.js +30 -0
- package/dist/transform/transform-descriptor.js.map +1 -0
- package/dist/tui/storage-explorer.descriptor.d.ts +14 -0
- package/dist/tui/storage-explorer.descriptor.d.ts.map +1 -0
- package/dist/tui/storage-explorer.descriptor.js +29 -0
- package/dist/tui/storage-explorer.descriptor.js.map +1 -0
- package/dist/tui/storage-explorer.impl.consumer.d.ts +11 -0
- package/dist/tui/storage-explorer.impl.consumer.d.ts.map +1 -0
- package/dist/tui/storage-explorer.impl.consumer.js +13 -0
- package/dist/tui/storage-explorer.impl.consumer.js.map +1 -0
- package/dist/tui/storage-open.descriptor.d.ts +14 -0
- package/dist/tui/storage-open.descriptor.d.ts.map +1 -0
- package/dist/tui/storage-open.descriptor.js +28 -0
- package/dist/tui/storage-open.descriptor.js.map +1 -0
- package/dist/tui/storage-open.impl.consumer.d.ts +11 -0
- package/dist/tui/storage-open.impl.consumer.d.ts.map +1 -0
- package/dist/tui/storage-open.impl.consumer.js +13 -0
- package/dist/tui/storage-open.impl.consumer.js.map +1 -0
- package/dist/utils/error-context.d.ts +2 -0
- package/dist/utils/error-context.d.ts.map +1 -0
- package/dist/utils/error-context.js +17 -0
- package/dist/utils/error-context.js.map +1 -0
- package/package.json +241 -0
- package/src/adapters/index.ts +13 -0
- package/src/bridge/index.ts +2 -0
- package/src/bridge/storage-kind-bridge.ts +131 -0
- package/src/bridge/types.ts +46 -0
- package/src/cli/commands/list/storage.list.cli-command.descriptor.ts +20 -0
- package/src/cli/commands/list/storage.list.cli-command.impl.ts +72 -0
- package/src/cli/commands/sync/pull/storage.sync.pull.cli-command.descriptor.ts +28 -0
- package/src/cli/commands/sync/pull/storage.sync.pull.cli-command.impl.ts +171 -0
- package/src/cli/commands/sync/push/storage.sync.push.cli-command.descriptor.ts +28 -0
- package/src/cli/commands/sync/push/storage.sync.push.cli-command.impl.ts +213 -0
- package/src/cli/commands/sync/resolve/storage.sync.resolve.cli-command.descriptor.ts +22 -0
- package/src/cli/commands/sync/resolve/storage.sync.resolve.cli-command.impl.ts +129 -0
- package/src/cli/commands/sync/status/storage.sync.status.cli-command.descriptor.ts +17 -0
- package/src/cli/commands/sync/status/storage.sync.status.cli-command.impl.ts +192 -0
- package/src/cli/context.consumer.ts +195 -0
- package/src/cli/storage.cli-group.descriptor.ts +13 -0
- package/src/cli/storage.sync.cli-group.descriptor.ts +14 -0
- package/src/cli/types.ts +25 -0
- package/src/client/index.ts +10 -0
- package/src/client/list-browsable-adapters.ts +42 -0
- package/src/daemon/commands/sync.ts +225 -0
- package/src/docs/adapters.docs.descriptor.ts +225 -0
- package/src/docs/manifests.docs.descriptor.ts +318 -0
- package/src/docs/records.docs.descriptor.ts +271 -0
- package/src/docs/sync.docs.descriptor.ts +281 -0
- package/src/index.ts +109 -0
- package/src/interfaces/adapter.ts +451 -0
- package/src/interfaces/document-store.ts +74 -0
- package/src/interfaces/index.ts +117 -0
- package/src/interfaces/key-value.ts +112 -0
- package/src/interfaces/query-builder.ts +31 -0
- package/src/interfaces/record/index.ts +58 -0
- package/src/interfaces/record/interface.ts +723 -0
- package/src/interfaces/repository.ts +300 -0
- package/src/interfaces/schema/index.ts +37 -0
- package/src/interfaces/schema/schema-interface.ts +586 -0
- package/src/interfaces/schema/table-interface.ts +314 -0
- package/src/interfaces/storage-consumer-fs.ts +66 -0
- package/src/manifest/base.ts +594 -0
- package/src/manifest/cloud-sync.consumer.ts +120 -0
- package/src/manifest/index.ts +7 -0
- package/src/manifest/source-policy.ts +74 -0
- package/src/paths.ts +171 -0
- package/src/policy/context.ts +30 -0
- package/src/policy/index.ts +20 -0
- package/src/policy/overrides.ts +46 -0
- package/src/policy/persistence.ts +117 -0
- package/src/policy/types.ts +28 -0
- package/src/record/base.ts +1872 -0
- package/src/record/events.ts +56 -0
- package/src/record/extensions.ts +308 -0
- package/src/record/index.ts +7 -0
- package/src/resolver/storage-backed-resolver.ts +255 -0
- package/src/schemas/adapter-descriptor.ts +128 -0
- package/src/schemas/index.ts +104 -0
- package/src/schemas/manifest-descriptor.ts +143 -0
- package/src/schemas/record/descriptor.ts +621 -0
- package/src/schemas/record/index.ts +60 -0
- package/src/schemas/record/relation.ts +49 -0
- package/src/schemas/schema/descriptor.ts +278 -0
- package/src/schemas/schema/index.ts +14 -0
- package/src/schemas/sync-bridge-descriptor.ts +143 -0
- package/src/server/manifest-route.ts +319 -0
- package/src/storage-policy.context.descriptor.ts +17 -0
- package/src/storage-policy.context.server.ts +34 -0
- package/src/storage.plugin.ts +264 -0
- package/src/sync/cloud-pull.ts +202 -0
- package/src/sync/cloud-record-crud-config.ts +41 -0
- package/src/sync/record-sync-bridge.ts +183 -0
- package/src/sync/resolve-sync-target.ts +57 -0
- package/src/sync/schemas/cloud-pull.ts +26 -0
- package/src/sync/schemas/index.ts +18 -0
- package/src/sync/schemas/sync-helpers.ts +18 -0
- package/src/sync/schemas/sync-state.ts +41 -0
- package/src/sync/sync-bridge.ts +763 -0
- package/src/sync/sync-manifest.ts +212 -0
- package/src/sync/sync-state.consumer.ts +144 -0
- package/src/transform/index.ts +130 -0
- package/src/transform/transform-descriptor.ts +53 -0
- package/src/tui/storage-explorer.descriptor.ts +32 -0
- package/src/tui/storage-explorer.impl.consumer.ts +14 -0
- package/src/tui/storage-open.descriptor.ts +31 -0
- package/src/tui/storage-open.impl.consumer.ts +14 -0
- package/src/utils/error-context.ts +19 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync Command Handlers
|
|
3
|
+
*
|
|
4
|
+
* RPC commands for storage sync operations:
|
|
5
|
+
* - sync.status -> Returns sync state for all manifests
|
|
6
|
+
* - sync.trigger -> Enqueues an immediate sync job
|
|
7
|
+
* - sync.resolve -> Resolves a conflict (keep-local or keep-remote)
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type {
|
|
11
|
+
RuntimeCommandDeps,
|
|
12
|
+
RuntimeCommandPayload,
|
|
13
|
+
RuntimeCommandResult
|
|
14
|
+
} from '@vibesdotdev/runtime-plugin-types';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Handle `sync.status` — returns current sync state for all manifests.
|
|
18
|
+
*/
|
|
19
|
+
export async function handleSyncStatus(
|
|
20
|
+
_message: RuntimeCommandPayload,
|
|
21
|
+
deps: RuntimeCommandDeps
|
|
22
|
+
): Promise<RuntimeCommandResult> {
|
|
23
|
+
const { loadSyncState } = await import('../../sync/sync-state.consumer');
|
|
24
|
+
const state = await loadSyncState();
|
|
25
|
+
|
|
26
|
+
// Also check if sync is enabled
|
|
27
|
+
let syncEnabled = false;
|
|
28
|
+
try {
|
|
29
|
+
const manifest = await deps.runtime
|
|
30
|
+
.query('config/manifest')
|
|
31
|
+
.filter((d: { id: string }) => d.id === 'ai.core')
|
|
32
|
+
.resolve();
|
|
33
|
+
|
|
34
|
+
if (manifest) {
|
|
35
|
+
const config = manifest as { load(): Promise<Record<string, unknown> | null> };
|
|
36
|
+
const data = await config.load();
|
|
37
|
+
syncEnabled = data?.syncToCloud === true;
|
|
38
|
+
}
|
|
39
|
+
} catch {
|
|
40
|
+
// Config not available
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
success: true,
|
|
45
|
+
syncEnabled,
|
|
46
|
+
updatedAt: state.updatedAt,
|
|
47
|
+
manifests: state.manifests,
|
|
48
|
+
summary: {
|
|
49
|
+
total: Object.keys(state.manifests).length,
|
|
50
|
+
inSync: Object.values(state.manifests).filter((m) => m.syncStatus === 'in-sync').length,
|
|
51
|
+
localAhead: Object.values(state.manifests).filter((m) => m.syncStatus === 'local-ahead')
|
|
52
|
+
.length,
|
|
53
|
+
remoteAhead: Object.values(state.manifests).filter((m) => m.syncStatus === 'remote-ahead')
|
|
54
|
+
.length,
|
|
55
|
+
conflicts: Object.values(state.manifests).filter((m) => m.syncStatus === 'conflict').length,
|
|
56
|
+
paused: Object.values(state.manifests).filter((m) => m.syncStatus === 'paused').length,
|
|
57
|
+
neverSynced: Object.values(state.manifests).filter((m) => m.syncStatus === 'never-synced')
|
|
58
|
+
.length
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Handle `sync.trigger` — enqueues an immediate storage-sync job.
|
|
65
|
+
*/
|
|
66
|
+
export async function handleSyncTrigger(
|
|
67
|
+
message: RuntimeCommandPayload,
|
|
68
|
+
deps: RuntimeCommandDeps
|
|
69
|
+
): Promise<RuntimeCommandResult> {
|
|
70
|
+
const manifestIds = (message.manifestIds as string[]) ?? [];
|
|
71
|
+
const force = (message.force as boolean) ?? true;
|
|
72
|
+
|
|
73
|
+
// Broadcast that sync was triggered
|
|
74
|
+
deps.subscriptionManager.broadcast?.('activity', {
|
|
75
|
+
type: 'sync-triggered',
|
|
76
|
+
manifestIds,
|
|
77
|
+
force,
|
|
78
|
+
timestamp: new Date().toISOString()
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// Run pull + push inline (for RPC response)
|
|
82
|
+
const { pullFromCloud } = await import('../../sync/cloud-pull');
|
|
83
|
+
const pullResult = await pullFromCloud({ manifestIds, force });
|
|
84
|
+
const { SyncBridge } = await import('../../sync/sync-bridge');
|
|
85
|
+
const { resolveSyncTarget } = await import('../../sync/resolve-sync-target');
|
|
86
|
+
|
|
87
|
+
const bridgeDescriptors = deps.runtime
|
|
88
|
+
.query('storage/sync-bridge')
|
|
89
|
+
.enabled()
|
|
90
|
+
.descriptors() as Array<{ id: string }>;
|
|
91
|
+
const bridgeTargets =
|
|
92
|
+
manifestIds.length > 0
|
|
93
|
+
? bridgeDescriptors.filter((descriptor) => manifestIds.includes(descriptor.id))
|
|
94
|
+
: bridgeDescriptors;
|
|
95
|
+
|
|
96
|
+
const bridgeResults: Array<{
|
|
97
|
+
bridgeId: string;
|
|
98
|
+
pushed: number;
|
|
99
|
+
pulled: number;
|
|
100
|
+
skipped: number;
|
|
101
|
+
conflicts: number;
|
|
102
|
+
errors: number;
|
|
103
|
+
}> = [];
|
|
104
|
+
|
|
105
|
+
if (bridgeTargets.length > 0) {
|
|
106
|
+
const { syncTarget, apiToken } = await resolveSyncTarget();
|
|
107
|
+
if (syncTarget && syncTarget !== 'unknown') {
|
|
108
|
+
for (const descriptor of bridgeTargets) {
|
|
109
|
+
const bridge = new SyncBridge(descriptor as never);
|
|
110
|
+
const result = await bridge.execute(
|
|
111
|
+
syncTarget,
|
|
112
|
+
{ direction: 'both', dryRun: false, force },
|
|
113
|
+
apiToken
|
|
114
|
+
);
|
|
115
|
+
bridgeResults.push({
|
|
116
|
+
bridgeId: result.bridgeId,
|
|
117
|
+
pushed: result.pushed,
|
|
118
|
+
pulled: result.pulled,
|
|
119
|
+
skipped: result.skipped,
|
|
120
|
+
conflicts: result.conflicts,
|
|
121
|
+
errors: result.errors
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
success: true,
|
|
129
|
+
triggered: true,
|
|
130
|
+
pullResult,
|
|
131
|
+
bridgeResults,
|
|
132
|
+
message: `Sync triggered. Pulled: ${pullResult.pulled}, Conflicts: ${pullResult.conflicts}, Bridges: ${bridgeResults.length}`
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Handle `sync.resolve` — resolves a manifest conflict.
|
|
138
|
+
* Accepts { manifestId, resolution: 'keep-local' | 'keep-remote' }
|
|
139
|
+
*/
|
|
140
|
+
export async function handleSyncResolve(
|
|
141
|
+
message: RuntimeCommandPayload,
|
|
142
|
+
deps: RuntimeCommandDeps
|
|
143
|
+
): Promise<RuntimeCommandResult> {
|
|
144
|
+
const manifestId = message.manifestId as string;
|
|
145
|
+
const resolution = message.resolution as 'keep-local' | 'keep-remote';
|
|
146
|
+
|
|
147
|
+
if (!manifestId || !resolution) {
|
|
148
|
+
return { success: false, error: 'Missing manifestId or resolution' };
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const { loadSyncState, saveSyncState, getManifestSyncState, markSynced, computeHash } =
|
|
152
|
+
await import('../../sync/sync-state.consumer');
|
|
153
|
+
|
|
154
|
+
const syncState = await loadSyncState();
|
|
155
|
+
const manifestState = getManifestSyncState(syncState, manifestId);
|
|
156
|
+
|
|
157
|
+
if (manifestState.syncStatus !== 'conflict') {
|
|
158
|
+
return { success: false, error: `Manifest ${manifestId} is not in conflict state` };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (resolution === 'keep-local') {
|
|
162
|
+
// Push local to cloud
|
|
163
|
+
const { StorageManifest } = await import('../../manifest/base');
|
|
164
|
+
const localManifest = new StorageManifest(manifestId);
|
|
165
|
+
const localData = await localManifest.load();
|
|
166
|
+
|
|
167
|
+
if (localData) {
|
|
168
|
+
try {
|
|
169
|
+
const cloudAdapter = await deps.runtime
|
|
170
|
+
.query('storage/adapter')
|
|
171
|
+
.filter((d: { id: string }) => d.id === 'storage.cloud-api')
|
|
172
|
+
.resolve();
|
|
173
|
+
|
|
174
|
+
if (cloudAdapter) {
|
|
175
|
+
const descriptor = deps.runtime
|
|
176
|
+
.query('storage/manifest')
|
|
177
|
+
.filter((d: { id: string }) => d.id === manifestId)
|
|
178
|
+
.firstDescriptor() as unknown as {
|
|
179
|
+
namespace: string;
|
|
180
|
+
schema: unknown;
|
|
181
|
+
config?: Record<string, Record<string, unknown>>;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const adapter = cloudAdapter as {
|
|
185
|
+
configure(config: Record<string, unknown>): void;
|
|
186
|
+
documentStore<T>(ns: string, schema: unknown): { save(data: T): Promise<void> };
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const cloudConfig = descriptor?.config?.['storage.cloud-api'] ?? {};
|
|
190
|
+
adapter.configure(cloudConfig);
|
|
191
|
+
const store = adapter.documentStore<unknown>(descriptor.namespace, descriptor.schema);
|
|
192
|
+
await store.save(localData);
|
|
193
|
+
}
|
|
194
|
+
} catch {
|
|
195
|
+
return { success: false, error: 'Failed to push local data to cloud' };
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const hash = localData ? computeHash(localData) : '';
|
|
200
|
+
markSynced(syncState, manifestId, hash, 'push');
|
|
201
|
+
} else {
|
|
202
|
+
// Pull remote to local
|
|
203
|
+
const { pullFromCloud } = await import('../../sync/cloud-pull');
|
|
204
|
+
await pullFromCloud({ manifestIds: [manifestId], force: true });
|
|
205
|
+
// pullFromCloud updates syncState internally, but we need fresh state
|
|
206
|
+
const freshState = await loadSyncState();
|
|
207
|
+
Object.assign(syncState, freshState);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
await saveSyncState(syncState);
|
|
211
|
+
|
|
212
|
+
deps.subscriptionManager.broadcast?.('activity', {
|
|
213
|
+
type: 'sync-conflict-resolved',
|
|
214
|
+
manifestId,
|
|
215
|
+
resolution,
|
|
216
|
+
timestamp: new Date().toISOString()
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
return {
|
|
220
|
+
success: true,
|
|
221
|
+
manifestId,
|
|
222
|
+
resolution,
|
|
223
|
+
newStatus: getManifestSyncState(syncState, manifestId).syncStatus
|
|
224
|
+
};
|
|
225
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import type { DocsTopicDescriptor } from '@vibesdotdev/docs';
|
|
2
|
+
|
|
3
|
+
const descriptor: DocsTopicDescriptor = {
|
|
4
|
+
kind: 'docs/topic',
|
|
5
|
+
id: 'storage.adapters',
|
|
6
|
+
title: 'Storage Adapters',
|
|
7
|
+
summary: 'Storage adapter interface, adapter implementations (libsql/D1/memory), and registration',
|
|
8
|
+
body: {
|
|
9
|
+
type: 'markdown',
|
|
10
|
+
sourceType: 'raw',
|
|
11
|
+
source: `---
|
|
12
|
+
title: Storage Adapters
|
|
13
|
+
summary: Storage adapter interface, adapter implementations (libsql/D1/memory), and registration
|
|
14
|
+
tags: [storage, adapters, interface, registration]
|
|
15
|
+
parent: storage
|
|
16
|
+
order: 1
|
|
17
|
+
surfaces: [cli, web, in-app]
|
|
18
|
+
hardware: [consumer, cloud]
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Storage Adapters
|
|
22
|
+
|
|
23
|
+
Storage adapters provide the persistence layer for the vibes storage system. The \`storage/adapter\` runtime kind defines the interface that all adapters must implement.
|
|
24
|
+
|
|
25
|
+
## Adapter Interface
|
|
26
|
+
|
|
27
|
+
All adapters implement the \`StorageAdapterInterface\`:
|
|
28
|
+
|
|
29
|
+
\`\`\`ts
|
|
30
|
+
interface StorageAdapterInterface {
|
|
31
|
+
// Document operations
|
|
32
|
+
documentStore<T>(namespace: string, schema: ZodSchema<T>): {
|
|
33
|
+
load(): Promise<T | null>;
|
|
34
|
+
save(data: T): Promise<void>;
|
|
35
|
+
exists(): Promise<boolean>;
|
|
36
|
+
delete(): Promise<void>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// Repository operations
|
|
40
|
+
repository<T>(namespace: string, schema: ZodSchema<T>): {
|
|
41
|
+
find(id: string): Promise<T | null>;
|
|
42
|
+
findAll(query?: Query): Promise<T[]>;
|
|
43
|
+
insert(data: T): Promise<T>;
|
|
44
|
+
update(id: string, data: Partial<T>): Promise<T>;
|
|
45
|
+
delete(id: string): Promise<void>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// Lifecycle
|
|
49
|
+
ensureReady(): Promise<void>;
|
|
50
|
+
close(): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
## Available Adapters
|
|
55
|
+
|
|
56
|
+
### Memory Adapter
|
|
57
|
+
|
|
58
|
+
In-memory storage for testing and ephemeral use:
|
|
59
|
+
|
|
60
|
+
\`\`\`ts
|
|
61
|
+
import { storageAdapterMemoryPlugin } from '@vibesdotdev/storage-adapter-memory';
|
|
62
|
+
await runtime.registerPlugin(storageAdapterMemoryPlugin);
|
|
63
|
+
\`\`\`
|
|
64
|
+
|
|
65
|
+
**Use cases:**
|
|
66
|
+
- Unit and integration tests
|
|
67
|
+
- Development prototyping
|
|
68
|
+
- Caching layers
|
|
69
|
+
|
|
70
|
+
**Limitations:**
|
|
71
|
+
- Data lost on process restart
|
|
72
|
+
- No concurrent access support
|
|
73
|
+
|
|
74
|
+
### LibSQL Adapter
|
|
75
|
+
|
|
76
|
+
Local SQLite storage using libsql:
|
|
77
|
+
|
|
78
|
+
\`\`\`ts
|
|
79
|
+
import { storageAdapterLibsqlPlugin } from '@vibesdotdev/storage-adapter-libsql';
|
|
80
|
+
await runtime.registerPlugin(storageAdapterLibsqlPlugin({
|
|
81
|
+
dbUrl: 'file:local.db'
|
|
82
|
+
}));
|
|
83
|
+
\`\`\`
|
|
84
|
+
|
|
85
|
+
**Use cases:**
|
|
86
|
+
- Single-user desktop apps
|
|
87
|
+
- Local-first applications
|
|
88
|
+
- Edge computing scenarios
|
|
89
|
+
|
|
90
|
+
### D1 Adapter
|
|
91
|
+
|
|
92
|
+
Cloudflare D1 database adapter:
|
|
93
|
+
|
|
94
|
+
\`\`\`ts
|
|
95
|
+
import { storageAdapterD1Plugin } from '@vibesdotdev/storage-adapter-d1';
|
|
96
|
+
await runtime.registerPlugin(storageAdapterD1Plugin({
|
|
97
|
+
binding: env.DB // Cloudflare D1 binding
|
|
98
|
+
}));
|
|
99
|
+
\`\`\`
|
|
100
|
+
|
|
101
|
+
**Use cases:**
|
|
102
|
+
- Cloudflare Workers deployments
|
|
103
|
+
- Serverless applications
|
|
104
|
+
- Multi-tenant SaaS
|
|
105
|
+
|
|
106
|
+
### Drizzle ORM Adapter
|
|
107
|
+
|
|
108
|
+
Database-agnostic adapter via Drizzle ORM:
|
|
109
|
+
|
|
110
|
+
\`\`\`ts
|
|
111
|
+
import { storageAdapterDrizzlePlugin } from '@vibesdotdev/storage-adapter-drizzle';
|
|
112
|
+
import { drizzle } from 'drizzle-orm/postgres-js';
|
|
113
|
+
import postgres from 'postgres';
|
|
114
|
+
|
|
115
|
+
const client = postgres(process.env.DATABASE_URL!);
|
|
116
|
+
const db = drizzle(client);
|
|
117
|
+
|
|
118
|
+
await runtime.registerPlugin(storageAdapterDrizzlePlugin({ db }));
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
**Use cases:**
|
|
122
|
+
- Production PostgreSQL deployments
|
|
123
|
+
- Complex queries and relations
|
|
124
|
+
- Migration management
|
|
125
|
+
|
|
126
|
+
### Cloud-API Adapter
|
|
127
|
+
|
|
128
|
+
Remote storage via HTTP API (used for sync):
|
|
129
|
+
|
|
130
|
+
\`\`\`ts
|
|
131
|
+
import { storageAdapterCloudApiPlugin } from '@vibesdotdev/storage-adapter-cloud-api';
|
|
132
|
+
await runtime.registerPlugin(storageAdapterCloudApiPlugin({
|
|
133
|
+
baseUrl: 'https://storage.vibes.dev',
|
|
134
|
+
authToken: '...'
|
|
135
|
+
}));
|
|
136
|
+
\`\`\`
|
|
137
|
+
|
|
138
|
+
**Use cases:**
|
|
139
|
+
- Cross-app sync (see \`storage.sync\`)
|
|
140
|
+
- Centralized backup
|
|
141
|
+
- Multi-device synchronization
|
|
142
|
+
|
|
143
|
+
## Adapter Registration
|
|
144
|
+
|
|
145
|
+
Adapters register themselves via runtime plugins:
|
|
146
|
+
|
|
147
|
+
\`\`\`ts
|
|
148
|
+
import { getVibesRuntime } from '@vibesdotdev/runtime';
|
|
149
|
+
import { storagePlugin } from '@vibesdotdev/storage';
|
|
150
|
+
import { storageAdapterMemoryPlugin } from '@vibesdotdev/storage-adapter-memory';
|
|
151
|
+
|
|
152
|
+
const runtime = getVibesRuntime();
|
|
153
|
+
|
|
154
|
+
// Register core storage first
|
|
155
|
+
await runtime.registerPlugin(storagePlugin);
|
|
156
|
+
|
|
157
|
+
// Then register adapter
|
|
158
|
+
await runtime.registerPlugin(storageAdapterMemoryPlugin);
|
|
159
|
+
\`\`\`
|
|
160
|
+
|
|
161
|
+
## Adapter Resolution
|
|
162
|
+
|
|
163
|
+
The runtime resolves adapters based on hardware scope:
|
|
164
|
+
|
|
165
|
+
\`\`\`ts
|
|
166
|
+
// Runtime auto-selects based on scope
|
|
167
|
+
const adapter = await runtime.query('storage/adapter')
|
|
168
|
+
.forHardware('consumer')
|
|
169
|
+
.resolve();
|
|
170
|
+
|
|
171
|
+
// Or filter explicitly
|
|
172
|
+
const adapter = await runtime.query('storage/adapter')
|
|
173
|
+
.filter(d => d.id === 'storage.adapter.libsql')
|
|
174
|
+
.resolve();
|
|
175
|
+
\`\`\`
|
|
176
|
+
|
|
177
|
+
**Resolution priority:**
|
|
178
|
+
1. Explicit filter match
|
|
179
|
+
2. Hardware compatibility
|
|
180
|
+
3. Persistent over memory adapters
|
|
181
|
+
4. First registered
|
|
182
|
+
|
|
183
|
+
## Writing Custom Adapters
|
|
184
|
+
|
|
185
|
+
Create a plugin that registers a \`storage/adapter\` descriptor:
|
|
186
|
+
|
|
187
|
+
\`\`\`ts
|
|
188
|
+
import { createRuntimePlugin } from '@vibesdotdev/runtime';
|
|
189
|
+
import type { StorageAdapterDescriptor } from '@vibesdotdev/storage';
|
|
190
|
+
|
|
191
|
+
const descriptor: StorageAdapterDescriptor = {
|
|
192
|
+
kind: 'storage/adapter',
|
|
193
|
+
id: 'storage.adapter.custom',
|
|
194
|
+
title: 'Custom Adapter',
|
|
195
|
+
persistent: true,
|
|
196
|
+
hardware: ['consumer', 'cloud']
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export const customAdapterPlugin = createRuntimePlugin({
|
|
200
|
+
id: 'custom-adapter',
|
|
201
|
+
kinds: [{
|
|
202
|
+
id: 'storage/adapter',
|
|
203
|
+
descriptorSchema: StorageAdapterDescriptorSchema,
|
|
204
|
+
defaultImplementation: CustomAdapterImpl
|
|
205
|
+
}],
|
|
206
|
+
descriptors: [descriptor]
|
|
207
|
+
});
|
|
208
|
+
\`\`\`
|
|
209
|
+
|
|
210
|
+
:::card{title="See also"}
|
|
211
|
+
- [\`storage.manifests\`](storage.manifests) — Manifest declarations
|
|
212
|
+
- [\`storage.records\`](storage.records) — Record CRUD operations
|
|
213
|
+
- [\`storage.sync\`](storage.sync) — Cross-app synchronization
|
|
214
|
+
:::
|
|
215
|
+
`
|
|
216
|
+
},
|
|
217
|
+
parent: 'storage',
|
|
218
|
+
order: 1,
|
|
219
|
+
tags: ['storage', 'adapters', 'interface', 'registration'],
|
|
220
|
+
surfaces: ['cli', 'web', 'in-app'],
|
|
221
|
+
hardware: ['consumer', 'cloud'],
|
|
222
|
+
enabled: true
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export default descriptor;
|