@rozenite/storage-plugin 1.13.0 → 2.1.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.
- package/CHANGELOG.md +46 -0
- package/README.md +6 -1
- package/dist/devtools/assets/panel-BlDRXgVW.js +32 -0
- package/dist/devtools/assets/panel-DBweZnW5.css +1 -0
- package/dist/devtools/panel.html +2 -2
- package/dist/react-native/chunks/async-storage.require.cjs +1 -1
- package/dist/react-native/chunks/async-storage.require.js +8 -7
- package/dist/react-native/chunks/index.require.cjs +1 -1
- package/dist/react-native/chunks/index.require.js +70 -66
- package/dist/react-native/chunks/secure-storage.require.cjs +1 -1
- package/dist/react-native/chunks/secure-storage.require.js +17 -13
- package/dist/react-native/chunks/useRozeniteStoragePlugin.require.cjs +1 -1
- package/dist/react-native/chunks/useRozeniteStoragePlugin.require.js +863 -344
- package/dist/react-native/index.d.ts +166 -18
- package/dist/rozenite.json +1 -1
- package/dist/sdk/index.cjs +1 -1
- package/dist/sdk/index.d.ts +13 -5
- package/dist/sdk/index.js +21 -12
- package/package.json +35 -37
- package/react-native.ts +12 -22
- package/rozenite.config.ts +74 -0
- package/sdk.ts +1 -5
- package/src/react-native/__tests__/entry-preview-pagination.test.ts +234 -0
- package/src/react-native/__tests__/export-snapshot.test.ts +138 -0
- package/src/react-native/__tests__/full-entry-request.test.ts +143 -0
- package/src/react-native/__tests__/import.test.ts +174 -11
- package/src/react-native/__tests__/storage-discovery.test.ts +144 -0
- package/src/react-native/__tests__/storage-view.test.ts +172 -0
- package/src/react-native/__tests__/stress-verification.test.ts +140 -0
- package/src/react-native/__tests__/use-storage-agent-tools.test.ts +221 -0
- package/src/react-native/adapters/__tests__/mmkv.test.ts +20 -30
- package/src/react-native/adapters/async-storage.ts +8 -9
- package/src/react-native/adapters/index.ts +2 -8
- package/src/react-native/adapters/mmkv.ts +12 -24
- package/src/react-native/adapters/secure-storage.ts +4 -0
- package/src/react-native/entry-preview-pagination.ts +261 -0
- package/src/react-native/export-snapshot.ts +88 -0
- package/src/react-native/full-entry-request.ts +91 -0
- package/src/react-native/import.ts +179 -16
- package/src/react-native/storage-discovery.ts +92 -0
- package/src/react-native/storage-view.ts +47 -109
- package/src/react-native/useRozeniteStoragePlugin.ts +153 -129
- package/src/react-native/useStorageAgentTools.ts +196 -91
- package/src/shared/__tests__/entry-preview.test.ts +99 -0
- package/src/shared/__tests__/snapshot.test.ts +31 -32
- package/src/shared/agent-tools.ts +33 -38
- package/src/shared/entry-preview.ts +54 -0
- package/src/shared/messaging.ts +140 -21
- package/src/shared/snapshot.ts +12 -18
- package/src/shared/types.ts +21 -4
- package/src/ui/__tests__/binary-value-editor-state.test.ts +16 -13
- package/src/ui/__tests__/binary.test.ts +31 -33
- package/src/ui/__tests__/large-value-viewer-state.test.ts +21 -0
- package/src/ui/__tests__/large-value-viewer.test.tsx +54 -0
- package/src/ui/__tests__/panel.test.tsx +382 -0
- package/src/ui/__tests__/storage-groups.test.ts +88 -0
- package/src/ui/__tests__/type-conversion.test.ts +8 -24
- package/src/ui/__tests__/use-storage-entries.test.tsx +337 -0
- package/src/ui/add-entry-dialog.tsx +66 -117
- package/src/ui/binary-value-editor-state.ts +16 -25
- package/src/ui/binary-value-editor.tsx +59 -47
- package/src/ui/binary.ts +54 -15
- package/src/ui/edit-entry-dialog.tsx +68 -104
- package/src/ui/editor-switcher.tsx +9 -16
- package/src/ui/entry-detail-dialog.tsx +62 -181
- package/src/ui/format-value.tsx +25 -0
- package/src/ui/globals.css +1 -123
- package/src/ui/import-dialog.tsx +72 -109
- package/src/ui/large-value-viewer-state.ts +25 -0
- package/src/ui/large-value-viewer.tsx +65 -0
- package/src/ui/panel.tsx +649 -509
- package/src/ui/query-client.tsx +23 -0
- package/src/ui/storage-groups.ts +66 -0
- package/src/ui/type-conversion.ts +2 -5
- package/src/ui/typed-value-editor.tsx +15 -20
- package/src/ui/use-storage-entries.ts +192 -0
- package/src/ui/utils.ts +1 -4
- package/tsconfig.json +5 -1
- package/dist/devtools/assets/panel-Bm-SWF7d.js +0 -33
- package/dist/devtools/assets/panel-DIqI4WSp.css +0 -1
- package/postcss.config.js +0 -6
- package/src/ui/confirm-dialog.tsx +0 -100
- package/src/ui/editable-table.tsx +0 -300
- package/tailwind.config.ts +0 -94
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MMKV as MMKV_2 } from 'react-native-mmkv-v3';
|
|
2
2
|
import { MMKV as MMKV_3 } from 'react-native-mmkv-v4';
|
|
3
|
-
import {
|
|
3
|
+
import { RozeniteDevToolsRequestClient } from '@rozenite/plugin-bridge';
|
|
4
4
|
|
|
5
5
|
export declare type AsyncStorage = {
|
|
6
6
|
kind: 'async';
|
|
@@ -8,6 +8,7 @@ export declare type AsyncStorage = {
|
|
|
8
8
|
get: (key: string) => Promise<StorageEntry | undefined>;
|
|
9
9
|
set: (entry: StorageEntry) => Promise<void>;
|
|
10
10
|
delete: (key: string) => Promise<void>;
|
|
11
|
+
clear: () => Promise<void>;
|
|
11
12
|
subscribe?: (callback: (key: string) => void) => StorageSubscription;
|
|
12
13
|
};
|
|
13
14
|
|
|
@@ -22,6 +23,7 @@ export declare type AsyncStorageLike = {
|
|
|
22
23
|
getItem: (key: string) => Promise<string | null>;
|
|
23
24
|
setItem: (key: string, value: string) => Promise<void>;
|
|
24
25
|
removeItem: (key: string) => Promise<void>;
|
|
26
|
+
clear: () => Promise<void>;
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
export declare let createAsyncStorageAdapter: typeof createAsyncStorageAdapter_2;
|
|
@@ -64,6 +66,21 @@ export declare type CreateMMKVStorageAdapterOptions = {
|
|
|
64
66
|
blacklist?: MMKVBlacklistConfig;
|
|
65
67
|
};
|
|
66
68
|
|
|
69
|
+
declare type ImportPreview = {
|
|
70
|
+
newKeys: string[];
|
|
71
|
+
overwriteKeys: string[];
|
|
72
|
+
skippedKeys: {
|
|
73
|
+
key: string;
|
|
74
|
+
reason: 'blacklist';
|
|
75
|
+
}[];
|
|
76
|
+
unsupportedTypes: {
|
|
77
|
+
key: string;
|
|
78
|
+
type: StorageEntryType;
|
|
79
|
+
}[];
|
|
80
|
+
acceptedEntryIndexes: number[];
|
|
81
|
+
metadataMismatch: boolean;
|
|
82
|
+
};
|
|
83
|
+
|
|
67
84
|
declare type KeySource = string[] | (() => Promise<string[]>);
|
|
68
85
|
|
|
69
86
|
declare type MMKV = MMKV_2 | MMKV_3;
|
|
@@ -86,11 +103,6 @@ export declare type SecureStorageLike = {
|
|
|
86
103
|
deleteItemAsync: (key: string) => Promise<void>;
|
|
87
104
|
};
|
|
88
105
|
|
|
89
|
-
declare type SerializedBlacklist = {
|
|
90
|
-
source: string;
|
|
91
|
-
flags: string;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
106
|
declare type SingleStorageOptions = {
|
|
95
107
|
storage: AsyncStorageLike;
|
|
96
108
|
adapterId?: string;
|
|
@@ -116,6 +128,36 @@ declare type StorageDeleteEntryEvent = {
|
|
|
116
128
|
key: string;
|
|
117
129
|
};
|
|
118
130
|
|
|
131
|
+
declare type StorageDescriptor = {
|
|
132
|
+
target: StorageTarget;
|
|
133
|
+
adapterName: string;
|
|
134
|
+
storageName: string;
|
|
135
|
+
entryCount: number;
|
|
136
|
+
capabilities: StorageCapabilities;
|
|
137
|
+
supportsSubscriptions: boolean;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Announced by the device once it is listening for panel requests. The panel is
|
|
142
|
+
* recreated on every app reload and asks for storages immediately, which can
|
|
143
|
+
* land before the app's React tree has mounted the plugin; this lets the panel
|
|
144
|
+
* ask again instead of waiting forever on a dropped request.
|
|
145
|
+
*/
|
|
146
|
+
declare type StorageDeviceReadyEvent = {
|
|
147
|
+
type: 'device-ready';
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
declare type StorageDiscoverStoragesRequestEvent = {
|
|
151
|
+
type: 'discover-storages';
|
|
152
|
+
requestId: string;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
declare type StorageDiscoverStoragesResponseEvent = {
|
|
156
|
+
type: 'storage-descriptors';
|
|
157
|
+
requestId: string;
|
|
158
|
+
storages: StorageDescriptor[];
|
|
159
|
+
};
|
|
160
|
+
|
|
119
161
|
export declare type StorageEntry = {
|
|
120
162
|
key: string;
|
|
121
163
|
type: 'string';
|
|
@@ -134,11 +176,19 @@ export declare type StorageEntry = {
|
|
|
134
176
|
value: number[];
|
|
135
177
|
};
|
|
136
178
|
|
|
179
|
+
declare type StorageEntryPreview = {
|
|
180
|
+
key: string;
|
|
181
|
+
type: StorageEntryType;
|
|
182
|
+
preview: string;
|
|
183
|
+
valueSize: number;
|
|
184
|
+
isTruncated: boolean;
|
|
185
|
+
};
|
|
186
|
+
|
|
137
187
|
export declare type StorageEntryType = StorageEntry['type'];
|
|
138
188
|
|
|
139
189
|
export declare type StorageEntryValue = StorageEntry['value'];
|
|
140
190
|
|
|
141
|
-
declare type StorageEvent_2 =
|
|
191
|
+
declare type StorageEvent_2 = StorageSetEntryEvent | StorageDeleteEntryEvent | StoragePurgeEvent | StorageInvalidatedEvent | StorageDeviceReadyEvent | StorageDiscoverStoragesRequestEvent | StorageDiscoverStoragesResponseEvent | StorageListEntryPreviewsRequestEvent | StorageListEntryPreviewsResponseEvent | StorageGetEntryRequestEvent | StorageGetEntryResponseEvent | StorageExportSnapshotRequestEvent | StorageExportSnapshotResponseEvent | StorageImportPreviewRequestEvent | StorageImportPreviewResponseEvent | StorageRequestErrorEvent | StorageImportEntriesEvent | StorageImportProgressEvent | StorageImportResultEvent;
|
|
142
192
|
|
|
143
193
|
declare type StorageEventMap = {
|
|
144
194
|
[K in StorageEvent_2['type']]: Extract<StorageEvent_2, {
|
|
@@ -146,19 +196,65 @@ declare type StorageEventMap = {
|
|
|
146
196
|
}>;
|
|
147
197
|
};
|
|
148
198
|
|
|
149
|
-
declare type
|
|
150
|
-
type: '
|
|
151
|
-
|
|
199
|
+
declare type StorageExportSnapshotRequestEvent = {
|
|
200
|
+
type: 'export-snapshot';
|
|
201
|
+
requestId: string;
|
|
202
|
+
target: StorageTarget;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
declare type StorageExportSnapshotResponseEvent = {
|
|
206
|
+
type: 'export-snapshot-result';
|
|
207
|
+
requestId: string;
|
|
208
|
+
target: StorageTarget;
|
|
209
|
+
snapshot: StorageSnapshotV1;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
declare type StorageGetEntryRequestEvent = {
|
|
213
|
+
type: 'get-entry';
|
|
214
|
+
requestId: string;
|
|
215
|
+
target: StorageTarget;
|
|
216
|
+
key: string;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
declare type StorageGetEntryResponseEvent = {
|
|
220
|
+
type: 'entry';
|
|
221
|
+
requestId: string;
|
|
222
|
+
target: StorageTarget;
|
|
223
|
+
entry: StorageEntry;
|
|
152
224
|
};
|
|
153
225
|
|
|
154
226
|
declare type StorageImportEntriesEvent = {
|
|
155
227
|
type: 'import-entries';
|
|
228
|
+
requestId: string;
|
|
156
229
|
target: StorageTarget;
|
|
157
230
|
entries: StorageEntry[];
|
|
158
231
|
};
|
|
159
232
|
|
|
233
|
+
declare type StorageImportPreviewRequestEvent = {
|
|
234
|
+
type: 'preview-import';
|
|
235
|
+
requestId: string;
|
|
236
|
+
target: StorageTarget;
|
|
237
|
+
snapshot: StorageSnapshotV1;
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
declare type StorageImportPreviewResponseEvent = {
|
|
241
|
+
type: 'import-preview';
|
|
242
|
+
requestId: string;
|
|
243
|
+
target: StorageTarget;
|
|
244
|
+
preview: ImportPreview;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
declare type StorageImportProgressEvent = {
|
|
248
|
+
type: 'import-progress';
|
|
249
|
+
requestId: string;
|
|
250
|
+
target: StorageTarget;
|
|
251
|
+
written: number;
|
|
252
|
+
total: number;
|
|
253
|
+
};
|
|
254
|
+
|
|
160
255
|
declare type StorageImportResultEvent = {
|
|
161
256
|
type: 'import-result';
|
|
257
|
+
requestId: string;
|
|
162
258
|
target: StorageTarget;
|
|
163
259
|
ok: boolean;
|
|
164
260
|
written: number;
|
|
@@ -167,6 +263,37 @@ declare type StorageImportResultEvent = {
|
|
|
167
263
|
error?: string;
|
|
168
264
|
};
|
|
169
265
|
|
|
266
|
+
declare type StorageInvalidatedEvent = {
|
|
267
|
+
type: 'storage-invalidated';
|
|
268
|
+
target: StorageTarget;
|
|
269
|
+
/** Native subscriptions only expose a key, not the operation. */
|
|
270
|
+
key?: string;
|
|
271
|
+
operation?: StorageInvalidationOperation;
|
|
272
|
+
/** Updated entry count for the storage after the invalidation. */
|
|
273
|
+
entryCount: number;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
declare type StorageInvalidationOperation = 'set' | 'delete' | 'import' | 'purge';
|
|
277
|
+
|
|
278
|
+
declare type StorageListEntryPreviewsRequestEvent = {
|
|
279
|
+
type: 'list-entry-previews';
|
|
280
|
+
requestId: string;
|
|
281
|
+
target: StorageTarget;
|
|
282
|
+
search?: string;
|
|
283
|
+
keySortDirection?: 'ascending' | 'descending';
|
|
284
|
+
cursor?: string;
|
|
285
|
+
limit: number;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
declare type StorageListEntryPreviewsResponseEvent = {
|
|
289
|
+
type: 'entry-previews';
|
|
290
|
+
requestId: string;
|
|
291
|
+
target: StorageTarget;
|
|
292
|
+
items: StorageEntryPreview[];
|
|
293
|
+
nextCursor?: string;
|
|
294
|
+
previousCursor?: string;
|
|
295
|
+
};
|
|
296
|
+
|
|
170
297
|
export declare type StorageNode = {
|
|
171
298
|
id: string;
|
|
172
299
|
name: string;
|
|
@@ -176,19 +303,39 @@ export declare type StorageNode = {
|
|
|
176
303
|
shouldFilterKey?: (key: string) => boolean;
|
|
177
304
|
};
|
|
178
305
|
|
|
306
|
+
declare type StoragePurgeEvent = {
|
|
307
|
+
type: 'purge-storage';
|
|
308
|
+
target: StorageTarget;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
declare type StorageRequestError = {
|
|
312
|
+
requestId: string;
|
|
313
|
+
code: 'TARGET_NOT_FOUND' | 'ENTRY_NOT_FOUND' | 'INVALID_CURSOR' | 'INVALID_REQUEST' | 'READ_FAILED' | 'WRITE_FAILED';
|
|
314
|
+
message: string;
|
|
315
|
+
resetPagination?: boolean;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
declare type StorageRequestErrorEvent = StorageRequestError & {
|
|
319
|
+
type: 'storage-request-error';
|
|
320
|
+
};
|
|
321
|
+
|
|
179
322
|
declare type StorageSetEntryEvent = {
|
|
180
323
|
type: 'set-entry';
|
|
181
324
|
target: StorageTarget;
|
|
182
325
|
entry: StorageEntry;
|
|
183
326
|
};
|
|
184
327
|
|
|
185
|
-
declare type
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
328
|
+
declare type StorageSnapshotV1 = {
|
|
329
|
+
version: 1;
|
|
330
|
+
plugin: string;
|
|
331
|
+
createdAt: string;
|
|
332
|
+
storage: {
|
|
333
|
+
adapterId: string;
|
|
334
|
+
storageId: string;
|
|
335
|
+
adapterName: string;
|
|
336
|
+
storageName: string;
|
|
337
|
+
capabilities: StorageCapabilities;
|
|
338
|
+
};
|
|
192
339
|
entries: StorageEntry[];
|
|
193
340
|
};
|
|
194
341
|
|
|
@@ -207,11 +354,12 @@ export declare type SyncStorage = {
|
|
|
207
354
|
get: (key: string) => StorageEntry | undefined;
|
|
208
355
|
set: (entry: StorageEntry) => void;
|
|
209
356
|
delete: (key: string) => void;
|
|
357
|
+
clear: () => void;
|
|
210
358
|
subscribe?: (callback: (key: string) => void) => StorageSubscription;
|
|
211
359
|
};
|
|
212
360
|
|
|
213
361
|
export declare let useRozeniteStoragePlugin: typeof useRozeniteStoragePlugin_2;
|
|
214
362
|
|
|
215
|
-
declare const useRozeniteStoragePlugin_2: ({ storages
|
|
363
|
+
declare const useRozeniteStoragePlugin_2: ({ storages }: RozeniteStoragePluginOptions) => RozeniteDevToolsRequestClient<StorageEventMap> | null;
|
|
216
364
|
|
|
217
365
|
export { }
|
package/dist/rozenite.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@rozenite/storage-plugin","version":"1.
|
|
1
|
+
{"name":"@rozenite/storage-plugin","version":"2.1.0","description":"Generic Storage Inspector for Rozenite.","panels":[{"name":"Storage","source":"/devtools/panel.html"}]}
|
package/dist/sdk/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@rozenite/agent-shared"),t={adapterId:{type:"string",description:"Storage adapter ID. Required when multiple adapters are configured."},storageId:{type:"string",description:"Storage node ID within the adapter. Required when multiple storages are configured."}},n="@rozenite/storage-plugin",r=["string","number","boolean","buffer"],i={listStorages:e.defineAgentToolContract({name:"list-storages",description:"List all storage adapters and their storage nodes currently available on the device, including supported entry types
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@rozenite/agent-shared"),t={adapterId:{type:"string",description:"Storage adapter ID. Required when multiple adapters are configured."},storageId:{type:"string",description:"Storage node ID within the adapter. Required when multiple storages are configured."}},n="@rozenite/storage-plugin",r=["string","number","boolean","buffer"],i={listStorages:e.defineAgentToolContract({name:"list-storages",description:"List all storage adapters and their storage nodes currently available on the device, including supported entry types. Entry counts are omitted to avoid enumerating every storage.",inputSchema:{type:"object",properties:{}}}),listEntries:e.definePaginatedAgentToolContract({name:"list-entries",description:"List keys in a storage. This call intentionally does not return entry values to keep responses token-efficient.",inputSchema:{type:"object",properties:{...t,limit:{type:"number",description:"Pagination size. Defaults to 20 and is capped at 100."},cursor:{type:"string",description:"Opaque pagination cursor from a previous list-entries call."},offset:{type:"number",description:"Deprecated initial pagination offset. Must be a non-negative integer and cannot be combined with cursor."}}},pagination:{kind:"cursor",fields:["key"],defaultFields:["key"]}}),readEntry:e.defineAgentToolContract({name:"read-entry",description:"Read a single storage entry value by key.",inputSchema:{type:"object",properties:{...t,key:{type:"string",description:"Entry key."}},required:["key"]}}),createEntry:e.defineAgentToolContract({name:"create-entry",description:"Create a new storage entry. Fails if the key already exists.",inputSchema:{type:"object",properties:{...t,key:{type:"string",description:"Entry key."},type:{type:"string",enum:[...r],description:"Entry value type. Must be one of the supported types for the target storage (see list-storages)."},value:{description:"Entry value matching the provided type."}},required:["key","type","value"]}}),editEntry:e.defineAgentToolContract({name:"edit-entry",description:"Edit an existing storage entry. Fails if the key does not exist.",inputSchema:{type:"object",properties:{...t,key:{type:"string",description:"Entry key."},type:{type:"string",enum:[...r],description:"Entry value type. Must be one of the supported types for the target storage (see list-storages)."},value:{description:"Entry value matching the provided type."}},required:["key","type","value"]}}),removeEntry:e.defineAgentToolContract({name:"remove-entry",description:"Remove a storage entry by key.",inputSchema:{type:"object",properties:{...t,key:{type:"string",description:"Entry key."}},required:["key"]}})},o=e.defineAgentToolDescriptors(n,i);exports.STORAGE_AGENT_ENTRY_TYPES=r;exports.STORAGE_AGENT_PLUGIN_ID=n;exports.storageToolDefinitions=i;exports.storageTools=o;
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ declare type AsyncStorage = {
|
|
|
7
7
|
get: (key: string) => Promise<StorageEntry | undefined>;
|
|
8
8
|
set: (entry: StorageEntry) => Promise<void>;
|
|
9
9
|
delete: (key: string) => Promise<void>;
|
|
10
|
+
clear: () => Promise<void>;
|
|
10
11
|
subscribe?: (callback: (key: string) => void) => StorageSubscription;
|
|
11
12
|
};
|
|
12
13
|
|
|
@@ -65,17 +66,24 @@ export declare type StorageEntryType = StorageEntry['type'];
|
|
|
65
66
|
export declare type StorageEntryValue = StorageEntry['value'];
|
|
66
67
|
|
|
67
68
|
export declare type StorageListEntriesArgs = StorageSelection & {
|
|
68
|
-
offset?: number;
|
|
69
69
|
limit?: number;
|
|
70
|
+
cursor?: string;
|
|
71
|
+
/** @deprecated Use the opaque cursor returned by a previous page. */
|
|
72
|
+
offset?: number;
|
|
70
73
|
};
|
|
71
74
|
|
|
72
75
|
export declare type StorageListEntriesResult = {
|
|
73
76
|
adapterId: string;
|
|
74
77
|
storageId: string;
|
|
75
78
|
total: number;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
items: Array<{
|
|
80
|
+
key: string;
|
|
81
|
+
}>;
|
|
82
|
+
page: {
|
|
83
|
+
limit: number;
|
|
84
|
+
hasMore: boolean;
|
|
85
|
+
nextCursor?: string;
|
|
86
|
+
};
|
|
79
87
|
};
|
|
80
88
|
|
|
81
89
|
export declare type StorageListStoragesArgs = undefined;
|
|
@@ -85,7 +93,6 @@ export declare type StorageListStoragesItem = {
|
|
|
85
93
|
storageId: string;
|
|
86
94
|
adapterName: string;
|
|
87
95
|
storageName: string;
|
|
88
|
-
entryCount: number;
|
|
89
96
|
supportedTypes: StorageEntryType[];
|
|
90
97
|
};
|
|
91
98
|
|
|
@@ -192,6 +199,7 @@ declare type SyncStorage = {
|
|
|
192
199
|
get: (key: string) => StorageEntry | undefined;
|
|
193
200
|
set: (entry: StorageEntry) => void;
|
|
194
201
|
delete: (key: string) => void;
|
|
202
|
+
clear: () => void;
|
|
195
203
|
subscribe?: (callback: (key: string) => void) => StorageSubscription;
|
|
196
204
|
};
|
|
197
205
|
|
package/dist/sdk/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineAgentToolContract as e,
|
|
1
|
+
import { defineAgentToolContract as e, definePaginatedAgentToolContract as i, defineAgentToolDescriptors as n } from "@rozenite/agent-shared";
|
|
2
2
|
const t = {
|
|
3
3
|
adapterId: {
|
|
4
4
|
type: "string",
|
|
@@ -8,7 +8,7 @@ const t = {
|
|
|
8
8
|
type: "string",
|
|
9
9
|
description: "Storage node ID within the adapter. Required when multiple storages are configured."
|
|
10
10
|
}
|
|
11
|
-
},
|
|
11
|
+
}, o = "@rozenite/storage-plugin", r = [
|
|
12
12
|
"string",
|
|
13
13
|
"number",
|
|
14
14
|
"boolean",
|
|
@@ -16,25 +16,34 @@ const t = {
|
|
|
16
16
|
], s = {
|
|
17
17
|
listStorages: e({
|
|
18
18
|
name: "list-storages",
|
|
19
|
-
description: "List all storage adapters and their storage nodes currently available on the device, including supported entry types
|
|
19
|
+
description: "List all storage adapters and their storage nodes currently available on the device, including supported entry types. Entry counts are omitted to avoid enumerating every storage.",
|
|
20
20
|
inputSchema: { type: "object", properties: {} }
|
|
21
21
|
}),
|
|
22
|
-
listEntries:
|
|
22
|
+
listEntries: i({
|
|
23
23
|
name: "list-entries",
|
|
24
24
|
description: "List keys in a storage. This call intentionally does not return entry values to keep responses token-efficient.",
|
|
25
25
|
inputSchema: {
|
|
26
26
|
type: "object",
|
|
27
27
|
properties: {
|
|
28
28
|
...t,
|
|
29
|
-
|
|
29
|
+
limit: {
|
|
30
30
|
type: "number",
|
|
31
|
-
description: "Pagination
|
|
31
|
+
description: "Pagination size. Defaults to 20 and is capped at 100."
|
|
32
32
|
},
|
|
33
|
-
|
|
33
|
+
cursor: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Opaque pagination cursor from a previous list-entries call."
|
|
36
|
+
},
|
|
37
|
+
offset: {
|
|
34
38
|
type: "number",
|
|
35
|
-
description: "
|
|
39
|
+
description: "Deprecated initial pagination offset. Must be a non-negative integer and cannot be combined with cursor."
|
|
36
40
|
}
|
|
37
41
|
}
|
|
42
|
+
},
|
|
43
|
+
pagination: {
|
|
44
|
+
kind: "cursor",
|
|
45
|
+
fields: ["key"],
|
|
46
|
+
defaultFields: ["key"]
|
|
38
47
|
}
|
|
39
48
|
}),
|
|
40
49
|
readEntry: e({
|
|
@@ -101,13 +110,13 @@ const t = {
|
|
|
101
110
|
required: ["key"]
|
|
102
111
|
}
|
|
103
112
|
})
|
|
104
|
-
},
|
|
105
|
-
|
|
113
|
+
}, p = n(
|
|
114
|
+
o,
|
|
106
115
|
s
|
|
107
116
|
);
|
|
108
117
|
export {
|
|
109
118
|
r as STORAGE_AGENT_ENTRY_TYPES,
|
|
110
|
-
|
|
119
|
+
o as STORAGE_AGENT_PLUGIN_ID,
|
|
111
120
|
s as storageToolDefinitions,
|
|
112
|
-
|
|
121
|
+
p as storageTools
|
|
113
122
|
};
|
package/package.json
CHANGED
|
@@ -1,48 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rozenite/storage-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Generic Storage Inspector for Rozenite.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/react-native/index.cjs",
|
|
7
|
-
"module": "./dist/react-native/index.js",
|
|
8
|
-
"types": "./dist/react-native/index.d.ts",
|
|
9
5
|
"homepage": "https://github.com/callstackincubator/rozenite#readme",
|
|
10
6
|
"bugs": {
|
|
11
7
|
"url": "https://github.com/callstackincubator/rozenite/issues"
|
|
12
8
|
},
|
|
9
|
+
"license": "MIT",
|
|
13
10
|
"repository": {
|
|
14
11
|
"type": "git",
|
|
15
12
|
"url": "https://github.com/callstackincubator/rozenite.git"
|
|
16
13
|
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./dist/react-native/index.cjs",
|
|
16
|
+
"module": "./dist/react-native/index.js",
|
|
17
|
+
"types": "./dist/react-native/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/react-native/index.d.ts",
|
|
21
|
+
"import": "./dist/react-native/index.js",
|
|
22
|
+
"require": "./dist/react-native/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./sdk": {
|
|
25
|
+
"development": "./sdk.ts",
|
|
26
|
+
"types": "./dist/sdk/index.d.ts",
|
|
27
|
+
"import": "./dist/sdk/index.js",
|
|
28
|
+
"require": "./dist/sdk/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
17
35
|
"dependencies": {
|
|
18
|
-
"@rozenite/agent-
|
|
19
|
-
"@rozenite/agent-
|
|
20
|
-
"@rozenite/plugin-bridge": "1.
|
|
36
|
+
"@rozenite/agent-bridge": "2.1.0",
|
|
37
|
+
"@rozenite/agent-shared": "2.1.0",
|
|
38
|
+
"@rozenite/plugin-bridge": "2.1.0",
|
|
39
|
+
"@rozenite/ui": "2.1.0"
|
|
21
40
|
},
|
|
22
41
|
"devDependencies": {
|
|
23
42
|
"@codemirror/commands": "^6.10.3",
|
|
24
43
|
"@codemirror/state": "^6.6.0",
|
|
25
44
|
"@codemirror/view": "^6.40.0",
|
|
45
|
+
"@tanstack/react-query": "^5.0.0",
|
|
26
46
|
"@tanstack/react-table": "^8.21.3",
|
|
27
|
-
"@types/react": "~19.2.
|
|
28
|
-
"autoprefixer": "^10.4.21",
|
|
47
|
+
"@types/react": "~19.2.3",
|
|
29
48
|
"lucide-react": "^0.263.1",
|
|
30
|
-
"
|
|
31
|
-
"react": "19.2.
|
|
32
|
-
"react-
|
|
33
|
-
"react-json-tree": "^0.20.0",
|
|
34
|
-
"react-native": "0.83.1",
|
|
49
|
+
"react": "19.2.3",
|
|
50
|
+
"react-dom": "19.2.3",
|
|
51
|
+
"react-native": "0.86.0",
|
|
35
52
|
"react-native-mmkv": "^3.3.0",
|
|
36
53
|
"react-native-mmkv-v3": "npm:react-native-mmkv@^3.0.0",
|
|
37
54
|
"react-native-mmkv-v4": "npm:react-native-mmkv@^4.0.0",
|
|
38
55
|
"react-native-nitro-modules": "*",
|
|
39
56
|
"react-native-web": "^0.21.2",
|
|
40
|
-
"
|
|
41
|
-
"tailwindcss-animate": "^1.0.7",
|
|
57
|
+
"react-virtuoso": "^4.14.1",
|
|
42
58
|
"typescript": "~5.9.3",
|
|
43
59
|
"vite": "^7.3.1",
|
|
44
|
-
"@rozenite/vite-plugin": "1.
|
|
45
|
-
"rozenite": "1.
|
|
60
|
+
"@rozenite/vite-plugin": "2.1.0",
|
|
61
|
+
"rozenite": "2.1.0"
|
|
46
62
|
},
|
|
47
63
|
"peerDependencies": {
|
|
48
64
|
"@react-native-async-storage/async-storage": "*",
|
|
@@ -62,24 +78,6 @@
|
|
|
62
78
|
"optional": true
|
|
63
79
|
}
|
|
64
80
|
},
|
|
65
|
-
"license": "MIT",
|
|
66
|
-
"exports": {
|
|
67
|
-
".": {
|
|
68
|
-
"types": "./dist/react-native/index.d.ts",
|
|
69
|
-
"import": "./dist/react-native/index.js",
|
|
70
|
-
"require": "./dist/react-native/index.cjs"
|
|
71
|
-
},
|
|
72
|
-
"./sdk": {
|
|
73
|
-
"development": "./sdk.ts",
|
|
74
|
-
"types": "./dist/sdk/index.d.ts",
|
|
75
|
-
"import": "./dist/sdk/index.js",
|
|
76
|
-
"require": "./dist/sdk/index.cjs"
|
|
77
|
-
},
|
|
78
|
-
"./package.json": "./package.json"
|
|
79
|
-
},
|
|
80
|
-
"publishConfig": {
|
|
81
|
-
"access": "public"
|
|
82
|
-
},
|
|
83
81
|
"scripts": {
|
|
84
82
|
"build": "rozenite build",
|
|
85
83
|
"dev": "rozenite dev",
|
package/react-native.ts
CHANGED
|
@@ -25,15 +25,14 @@ export let createExpoSecureStorageAdapter: typeof import('./src/react-native/ada
|
|
|
25
25
|
export let createMMKVStorageAdapter: typeof import('./src/react-native/adapters').createMMKVStorageAdapter;
|
|
26
26
|
export let useRozeniteStoragePlugin: typeof import('./src/react-native/useRozeniteStoragePlugin').useRozeniteStoragePlugin;
|
|
27
27
|
|
|
28
|
-
const isWeb =
|
|
29
|
-
typeof window !== 'undefined' && window.navigator.product !== 'ReactNative';
|
|
28
|
+
const isWeb = typeof window !== 'undefined' && window.navigator.product !== 'ReactNative';
|
|
30
29
|
const isDev = process.env.NODE_ENV !== 'production';
|
|
31
30
|
const isServer = typeof window === 'undefined';
|
|
32
31
|
|
|
33
32
|
const createNoopStorageAdapter = (
|
|
34
33
|
options: { adapterId?: string; adapterName?: string } | undefined,
|
|
35
34
|
defaultId: string,
|
|
36
|
-
defaultName: string
|
|
35
|
+
defaultName: string,
|
|
37
36
|
) => ({
|
|
38
37
|
id: options?.adapterId ?? defaultId,
|
|
39
38
|
name: options?.adapterName ?? defaultName,
|
|
@@ -41,27 +40,21 @@ const createNoopStorageAdapter = (
|
|
|
41
40
|
});
|
|
42
41
|
|
|
43
42
|
if (!isDev || isServer) {
|
|
44
|
-
createAsyncStorageAdapter = ((
|
|
45
|
-
options: { adapterId?: string; adapterName?: string }
|
|
46
|
-
) =>
|
|
43
|
+
createAsyncStorageAdapter = ((options: { adapterId?: string; adapterName?: string }) =>
|
|
47
44
|
createNoopStorageAdapter(
|
|
48
45
|
options,
|
|
49
46
|
'async-storage',
|
|
50
|
-
'AsyncStorage'
|
|
47
|
+
'AsyncStorage',
|
|
51
48
|
)) as typeof createAsyncStorageAdapter;
|
|
52
49
|
createExpoAsyncStorageAdapter = createAsyncStorageAdapter;
|
|
53
|
-
createExpoSecureStorageAdapter = ((options: {
|
|
54
|
-
adapterId?: string;
|
|
55
|
-
adapterName?: string;
|
|
56
|
-
}) =>
|
|
50
|
+
createExpoSecureStorageAdapter = ((options: { adapterId?: string; adapterName?: string }) =>
|
|
57
51
|
createNoopStorageAdapter(
|
|
58
52
|
options,
|
|
59
53
|
'expo-secure-store',
|
|
60
|
-
'Expo SecureStore'
|
|
54
|
+
'Expo SecureStore',
|
|
61
55
|
)) as typeof createExpoSecureStorageAdapter;
|
|
62
|
-
createMMKVStorageAdapter = ((
|
|
63
|
-
options
|
|
64
|
-
) => createNoopStorageAdapter(options, 'mmkv', 'MMKV')) as typeof createMMKVStorageAdapter;
|
|
56
|
+
createMMKVStorageAdapter = ((options: { adapterId?: string; adapterName?: string }) =>
|
|
57
|
+
createNoopStorageAdapter(options, 'mmkv', 'MMKV')) as typeof createMMKVStorageAdapter;
|
|
65
58
|
useRozeniteStoragePlugin = () => null;
|
|
66
59
|
} else if (isWeb) {
|
|
67
60
|
const asyncStorageModule = require('./src/react-native/adapters/async-storage');
|
|
@@ -70,20 +63,17 @@ if (!isDev || isServer) {
|
|
|
70
63
|
createAsyncStorageAdapter = asyncStorageModule.createAsyncStorageAdapter;
|
|
71
64
|
createExpoAsyncStorageAdapter = asyncStorageModule.createExpoAsyncStorageAdapter;
|
|
72
65
|
createExpoSecureStorageAdapter = secureStorageModule.createExpoSecureStorageAdapter;
|
|
73
|
-
createMMKVStorageAdapter = ((
|
|
74
|
-
options
|
|
75
|
-
) => createNoopStorageAdapter(options, 'mmkv', 'MMKV')) as typeof createMMKVStorageAdapter;
|
|
66
|
+
createMMKVStorageAdapter = ((options: { adapterId?: string; adapterName?: string }) =>
|
|
67
|
+
createNoopStorageAdapter(options, 'mmkv', 'MMKV')) as typeof createMMKVStorageAdapter;
|
|
76
68
|
useRozeniteStoragePlugin =
|
|
77
69
|
require('./src/react-native/useRozeniteStoragePlugin').useRozeniteStoragePlugin;
|
|
78
70
|
} else {
|
|
79
|
-
createAsyncStorageAdapter =
|
|
80
|
-
require('./src/react-native/adapters').createAsyncStorageAdapter;
|
|
71
|
+
createAsyncStorageAdapter = require('./src/react-native/adapters').createAsyncStorageAdapter;
|
|
81
72
|
createExpoAsyncStorageAdapter =
|
|
82
73
|
require('./src/react-native/adapters').createExpoAsyncStorageAdapter;
|
|
83
74
|
createExpoSecureStorageAdapter =
|
|
84
75
|
require('./src/react-native/adapters').createExpoSecureStorageAdapter;
|
|
85
|
-
createMMKVStorageAdapter =
|
|
86
|
-
require('./src/react-native/adapters').createMMKVStorageAdapter;
|
|
76
|
+
createMMKVStorageAdapter = require('./src/react-native/adapters').createMMKVStorageAdapter;
|
|
87
77
|
useRozeniteStoragePlugin =
|
|
88
78
|
require('./src/react-native/useRozeniteStoragePlugin').useRozeniteStoragePlugin;
|
|
89
79
|
}
|