@rool-dev/svelte 0.11.3-dev.a6a4bb1 → 0.11.4
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 +91 -122
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/rool.svelte.d.ts +1 -10
- package/dist/rool.svelte.d.ts.map +1 -1
- package/dist/rool.svelte.js +1 -12
- package/dist/space-session.svelte.d.ts +82 -0
- package/dist/space-session.svelte.d.ts.map +1 -0
- package/dist/space-session.svelte.js +191 -0
- package/dist/space.svelte.d.ts +27 -16
- package/dist/space.svelte.d.ts.map +1 -1
- package/dist/space.svelte.js +36 -39
- package/package.json +2 -2
- package/dist/channel.svelte.d.ts +0 -177
- package/dist/channel.svelte.d.ts.map +0 -1
- package/dist/channel.svelte.js +0 -391
package/README.md
CHANGED
|
@@ -14,12 +14,12 @@ npm install @rool-dev/svelte
|
|
|
14
14
|
|
|
15
15
|
```svelte
|
|
16
16
|
<script lang="ts">
|
|
17
|
-
import { createRool, type
|
|
17
|
+
import { createRool, type ReactiveSpace, type ReactiveConversationHandle } from '@rool-dev/svelte';
|
|
18
18
|
|
|
19
19
|
const rool = createRool();
|
|
20
20
|
void rool.init();
|
|
21
21
|
|
|
22
|
-
let
|
|
22
|
+
let space = $state<ReactiveSpace | null>(null);
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
25
|
{#if rool.authenticated === null}
|
|
@@ -30,15 +30,15 @@ npm install @rool-dev/svelte
|
|
|
30
30
|
<h1>My Spaces</h1>
|
|
31
31
|
{#each rool.spaces ?? [] as spaceInfo}
|
|
32
32
|
<button onclick={async () => {
|
|
33
|
-
|
|
34
|
-
channel = await space.openChannel('main');
|
|
33
|
+
space = await rool.openSpace(spaceInfo.id);
|
|
35
34
|
}}>
|
|
36
35
|
{spaceInfo.name}
|
|
37
36
|
</button>
|
|
38
37
|
{/each}
|
|
39
38
|
|
|
40
|
-
{#if
|
|
41
|
-
|
|
39
|
+
{#if space}
|
|
40
|
+
{@const conversation = space.conversation('main')}
|
|
41
|
+
<button onclick={() => void conversation.prompt('Hello')}>Send</button>
|
|
42
42
|
{/if}
|
|
43
43
|
{/if}
|
|
44
44
|
```
|
|
@@ -57,10 +57,9 @@ The Svelte wrapper adds reactive state on top of the SDK:
|
|
|
57
57
|
| `rool.connectionState` | Client SSE connection state |
|
|
58
58
|
| `rool.userStorage` | User storage (cross-device preferences) |
|
|
59
59
|
| `space.fileTree` | Canonical reactive WebDAV tree for `/`, including `/space` objects and `/rool-drive` user files |
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `channel.conversations` | Conversations in this channel (auto-updates on create/delete/rename) |
|
|
60
|
+
| `space.objectPaths` | Object paths derived from `space.fileTree` |
|
|
61
|
+
| `space.collections` | Collection directories derived from `space.fileTree` |
|
|
62
|
+
| `space.conversations` | Conversations in this space (auto-updates on create/delete/rename) |
|
|
64
63
|
| `thread.interactions` | Interactions for a specific conversation (auto-updates) |
|
|
65
64
|
| `watch.objects` | Objects matching a filter (auto-updates) |
|
|
66
65
|
| `watch.loading` | Whether watch is loading |
|
|
@@ -81,7 +80,7 @@ space.fileTree.childrenOf('/rool-drive');
|
|
|
81
80
|
space.fileTree.objectPaths(); // object paths from /space/**/*.json
|
|
82
81
|
```
|
|
83
82
|
|
|
84
|
-
Use this tree when UI needs to react to both files and objects. Object helpers like `
|
|
83
|
+
Use this tree when UI needs to react to both files and objects. Object helpers like `space.object()`, `space.watch()`, `space.objectPaths`, and `space.collections` are backed by this tree.
|
|
85
84
|
|
|
86
85
|
## API
|
|
87
86
|
|
|
@@ -147,17 +146,17 @@ Reactive cross-device storage for user preferences. Synced from server on `init(
|
|
|
147
146
|
</button>
|
|
148
147
|
```
|
|
149
148
|
|
|
150
|
-
### Spaces &
|
|
149
|
+
### Spaces & Conversations
|
|
151
150
|
|
|
152
|
-
Every space has its own SSE subscription. Open a space, then
|
|
151
|
+
Every space has its own SSE subscription. Open a space, then get explicit conversation handles from it. Call `space.close()` when done to stop the subscription.
|
|
153
152
|
|
|
154
153
|
```typescript
|
|
155
154
|
// Open a space — reactive, with SSE
|
|
156
155
|
const space = await rool.openSpace('space-id');
|
|
157
156
|
|
|
158
|
-
//
|
|
159
|
-
const
|
|
160
|
-
const
|
|
157
|
+
// Get explicit conversation handles
|
|
158
|
+
const main = space.conversation('main');
|
|
159
|
+
const research = space.conversation('research');
|
|
161
160
|
|
|
162
161
|
// Space admin
|
|
163
162
|
await space.rename('New Name');
|
|
@@ -166,7 +165,7 @@ await space.setUserRole(userId, 'admin');
|
|
|
166
165
|
|
|
167
166
|
// Create a new space
|
|
168
167
|
const fresh = await rool.createSpace('My New Space');
|
|
169
|
-
const
|
|
168
|
+
const mainConversation = fresh.conversation('main');
|
|
170
169
|
|
|
171
170
|
// Import from a zip archive
|
|
172
171
|
const imported = await rool.importArchive('Imported', archiveBlob);
|
|
@@ -174,40 +173,40 @@ const imported = await rool.importArchive('Imported', archiveBlob);
|
|
|
174
173
|
// Delete a space permanently
|
|
175
174
|
await rool.deleteSpace('space-id');
|
|
176
175
|
|
|
177
|
-
// Clean up — closes
|
|
176
|
+
// Clean up — closes this space and stops its subscription
|
|
178
177
|
space.close();
|
|
179
178
|
```
|
|
180
179
|
|
|
181
|
-
###
|
|
180
|
+
### ReactiveSpace
|
|
182
181
|
|
|
183
|
-
`
|
|
182
|
+
`rool.openSpace()` returns a `ReactiveSpace` with reactive `conversations`, file-tree-backed object helpers, and explicit reactive conversation handles:
|
|
184
183
|
|
|
185
184
|
```svelte
|
|
186
185
|
<script lang="ts">
|
|
187
|
-
import { createRool, type
|
|
186
|
+
import { createRool, type ReactiveSpace, type ReactiveConversationHandle } from '@rool-dev/svelte';
|
|
188
187
|
|
|
189
188
|
const rool = createRool();
|
|
190
189
|
void rool.init();
|
|
191
190
|
|
|
192
191
|
let space = $state<ReactiveSpace | null>(null);
|
|
193
|
-
let
|
|
192
|
+
let conversation = $state<ReactiveConversationHandle | null>(null);
|
|
194
193
|
|
|
195
194
|
async function open(spaceId: string) {
|
|
196
195
|
space = await rool.openSpace(spaceId);
|
|
197
|
-
|
|
196
|
+
conversation = space.conversation('main');
|
|
198
197
|
}
|
|
199
198
|
</script>
|
|
200
199
|
|
|
201
|
-
{#if
|
|
202
|
-
<!-- Reactive: updates when
|
|
203
|
-
{#each
|
|
200
|
+
{#if conversation}
|
|
201
|
+
<!-- Reactive: updates when this conversation changes -->
|
|
202
|
+
{#each conversation.interactions as interaction}
|
|
204
203
|
<div>
|
|
205
204
|
<strong>{interaction.operation}</strong>: {interaction.output ?? ''}
|
|
206
205
|
</div>
|
|
207
206
|
{/each}
|
|
208
207
|
|
|
209
|
-
<!--
|
|
210
|
-
<button onclick={() => void
|
|
208
|
+
<!-- Conversation-scoped SDK methods work directly -->
|
|
209
|
+
<button onclick={() => void conversation.prompt('Hello')}>Send</button>
|
|
211
210
|
{/if}
|
|
212
211
|
```
|
|
213
212
|
|
|
@@ -217,18 +216,17 @@ Track a single object by machine path with auto-updates:
|
|
|
217
216
|
|
|
218
217
|
```svelte
|
|
219
218
|
<script lang="ts">
|
|
220
|
-
import { createRool, type
|
|
219
|
+
import { createRool, type ReactiveSpace, type ReactiveObject } from '@rool-dev/svelte';
|
|
221
220
|
|
|
222
221
|
const rool = createRool();
|
|
223
222
|
void rool.init();
|
|
224
223
|
|
|
225
|
-
let
|
|
224
|
+
let space = $state<ReactiveSpace | null>(null);
|
|
226
225
|
let item = $state<ReactiveObject | null>(null);
|
|
227
226
|
|
|
228
227
|
async function open(spaceId: string, path: string) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
item = channel.object(path); // e.g. '/space/article/welcome.json'
|
|
228
|
+
space = await rool.openSpace(spaceId);
|
|
229
|
+
item = space.object(path); // e.g. '/space/article/welcome.json'
|
|
232
230
|
}
|
|
233
231
|
</script>
|
|
234
232
|
|
|
@@ -253,7 +251,7 @@ item.refresh() // Manual re-fetch
|
|
|
253
251
|
item.close() // Stop listening for updates
|
|
254
252
|
```
|
|
255
253
|
|
|
256
|
-
**Lifecycle:** Reactive objects are tied to their
|
|
254
|
+
**Lifecycle:** Reactive objects are tied to their space. Closing the space stops all updates — existing reactive objects will retain their last data but no longer refresh. Calling `space.object()` after `close()` throws.
|
|
257
255
|
|
|
258
256
|
### Reactive Watches
|
|
259
257
|
|
|
@@ -261,19 +259,18 @@ Create auto-updating watches of objects filtered by field values:
|
|
|
261
259
|
|
|
262
260
|
```svelte
|
|
263
261
|
<script lang="ts">
|
|
264
|
-
import { createRool, type
|
|
262
|
+
import { createRool, type ReactiveSpace, type ReactiveWatch } from '@rool-dev/svelte';
|
|
265
263
|
|
|
266
264
|
const rool = createRool();
|
|
267
265
|
void rool.init();
|
|
268
266
|
|
|
269
267
|
let space = $state<ReactiveSpace | null>(null);
|
|
270
|
-
let channel = $state<ReactiveChannel | null>(null);
|
|
271
268
|
let articles = $state<ReactiveWatch | null>(null);
|
|
269
|
+
|
|
272
270
|
async function open(spaceId: string) {
|
|
273
271
|
space = await rool.openSpace(spaceId);
|
|
274
|
-
channel = await space.openChannel('main');
|
|
275
272
|
// Create a reactive watch of all objects in the 'article' collection
|
|
276
|
-
articles =
|
|
273
|
+
articles = space.watch({ collection: 'article' });
|
|
277
274
|
}
|
|
278
275
|
</script>
|
|
279
276
|
|
|
@@ -290,11 +287,11 @@ Create auto-updating watches of objects filtered by field values:
|
|
|
290
287
|
|
|
291
288
|
Watches automatically re-fetch when matching object files change in `space.fileTree`.
|
|
292
289
|
|
|
293
|
-
**Lifecycle:** Watches are tied to their
|
|
290
|
+
**Lifecycle:** Watches are tied to their space. Closing the space stops all updates — existing watches will retain their last data but no longer refresh. Calling `space.watch()` after `close()` throws.
|
|
294
291
|
|
|
295
292
|
```typescript
|
|
296
293
|
// Watch options
|
|
297
|
-
const articles =
|
|
294
|
+
const articles = space.watch({
|
|
298
295
|
collection: 'article',
|
|
299
296
|
where: { status: 'published' },
|
|
300
297
|
order: 'desc', // by modifiedAt (default)
|
|
@@ -310,9 +307,9 @@ articles.refresh() // Manual re-fetch
|
|
|
310
307
|
articles.close() // Stop listening for updates
|
|
311
308
|
```
|
|
312
309
|
|
|
313
|
-
### Reactive
|
|
310
|
+
### Reactive Space List
|
|
314
311
|
|
|
315
|
-
`
|
|
312
|
+
`rool.spaces` is a reactive `RoolSpaceInfo[]`. Open individual spaces with `rool.openSpace(spaceId)` and close them when done.
|
|
316
313
|
|
|
317
314
|
```svelte
|
|
318
315
|
<script lang="ts">
|
|
@@ -321,45 +318,33 @@ articles.close() // Stop listening for updates
|
|
|
321
318
|
const rool = createRool();
|
|
322
319
|
void rool.init();
|
|
323
320
|
|
|
324
|
-
let
|
|
325
|
-
async function open(spaceId: string) {
|
|
326
|
-
space = await rool.openSpace(spaceId);
|
|
327
|
-
}
|
|
321
|
+
let current = $state<ReactiveSpace | null>(null);
|
|
328
322
|
</script>
|
|
329
323
|
|
|
330
|
-
{#
|
|
331
|
-
{
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
{/
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
```typescript
|
|
338
|
-
const channels = rool.channels(spaceId);
|
|
339
|
-
channels.list; // ChannelInfo[]
|
|
340
|
-
channels.loading; // boolean
|
|
341
|
-
await channels.refresh();
|
|
342
|
-
channels.close();
|
|
324
|
+
{#each rool.spaces ?? [] as space}
|
|
325
|
+
<button onclick={async () => current = await rool.openSpace(space.id)}>
|
|
326
|
+
{space.name}
|
|
327
|
+
</button>
|
|
328
|
+
{/each}
|
|
343
329
|
```
|
|
344
330
|
|
|
345
331
|
### Reactive Conversation Handle
|
|
346
332
|
|
|
347
|
-
For apps with multiple independent interaction threads (e.g., chat with threads), use `
|
|
333
|
+
For apps with multiple independent interaction threads (e.g., chat with threads), use `space.conversation()` to get a handle with reactive interactions:
|
|
348
334
|
|
|
349
335
|
```svelte
|
|
350
336
|
<script lang="ts">
|
|
351
|
-
import { createRool, type
|
|
337
|
+
import { createRool, type ReactiveConversationHandle, type ReactiveSpace } from '@rool-dev/svelte';
|
|
352
338
|
|
|
353
339
|
const rool = createRool();
|
|
354
340
|
void rool.init();
|
|
355
341
|
|
|
356
342
|
let space = $state<ReactiveSpace | null>(null);
|
|
357
|
-
let channel = $state<ReactiveChannel | null>(null);
|
|
358
343
|
let thread = $state<ReactiveConversationHandle | null>(null);
|
|
344
|
+
|
|
359
345
|
async function openThread(spaceId: string, threadId: string) {
|
|
360
346
|
space = await rool.openSpace(spaceId);
|
|
361
|
-
|
|
362
|
-
thread = channel.conversation(threadId);
|
|
347
|
+
thread = space.conversation(threadId);
|
|
363
348
|
}
|
|
364
349
|
</script>
|
|
365
350
|
|
|
@@ -374,7 +359,7 @@ For apps with multiple independent interaction threads (e.g., chat with threads)
|
|
|
374
359
|
|
|
375
360
|
```typescript
|
|
376
361
|
// Reactive state
|
|
377
|
-
thread.interactions // $state<Interaction[]> — updates from space
|
|
362
|
+
thread.interactions // $state<Interaction[]> — updates from space events
|
|
378
363
|
|
|
379
364
|
// Conversation-scoped methods
|
|
380
365
|
await thread.prompt('Hello')
|
|
@@ -390,74 +375,60 @@ thread.getSystemInstruction()
|
|
|
390
375
|
thread.close() // Stop listening for updates
|
|
391
376
|
```
|
|
392
377
|
|
|
393
|
-
Conversations are auto-created when you first write history or settings. Real-time events are owned by the space subscription; conversation handles subscribe to
|
|
378
|
+
Conversations are auto-created when you first write history or settings. Real-time events are owned by the space subscription; conversation handles subscribe to space events locally.
|
|
394
379
|
|
|
395
|
-
###
|
|
380
|
+
### Space Management
|
|
396
381
|
|
|
397
382
|
```typescript
|
|
398
|
-
// Rename
|
|
399
|
-
await space.
|
|
400
|
-
|
|
401
|
-
// Delete a channel
|
|
402
|
-
await space.deleteChannel('channel-id');
|
|
383
|
+
// Rename or delete the open space
|
|
384
|
+
await space.rename('New Name');
|
|
385
|
+
await space.delete();
|
|
403
386
|
|
|
404
|
-
//
|
|
405
|
-
await
|
|
387
|
+
// Or manage spaces from the client
|
|
388
|
+
const created = await rool.createSpace('New Space');
|
|
389
|
+
await rool.deleteSpace(created.id);
|
|
406
390
|
```
|
|
407
391
|
|
|
408
392
|
### Using the SDK
|
|
409
393
|
|
|
410
|
-
|
|
394
|
+
Common `ReactiveSpace` and `ReactiveConversationHandle` methods:
|
|
411
395
|
|
|
412
396
|
```typescript
|
|
413
|
-
//
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
channel.channelId
|
|
397
|
+
// Space properties
|
|
398
|
+
space.id
|
|
399
|
+
space.name
|
|
400
|
+
space.role
|
|
418
401
|
|
|
419
|
-
//
|
|
402
|
+
// Read object data by exact machine path
|
|
420
403
|
const path = '/space/note/welcome.json';
|
|
421
|
-
await
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
await
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
await
|
|
429
|
-
await
|
|
430
|
-
await
|
|
431
|
-
|
|
432
|
-
// Schema
|
|
433
|
-
|
|
434
|
-
await
|
|
404
|
+
await space.getObject(path)
|
|
405
|
+
|
|
406
|
+
// Conversation-scoped writes and AI
|
|
407
|
+
const conversation = space.conversation('thread-42');
|
|
408
|
+
await conversation.putObject(path, { text: 'Hello' })
|
|
409
|
+
await conversation.patchObject(path, { data: { text: 'Updated' } })
|
|
410
|
+
await conversation.moveObject(path, '/space/note/renamed.json')
|
|
411
|
+
await conversation.deleteObjects(['/space/note/renamed.json'])
|
|
412
|
+
await conversation.prompt('Summarize everything')
|
|
413
|
+
await conversation.stop()
|
|
414
|
+
|
|
415
|
+
// Schema/metadata writes are also attributed to a conversation
|
|
416
|
+
space.getSchema()
|
|
417
|
+
await conversation.createCollection('article', [
|
|
435
418
|
{ name: 'title', type: { kind: 'string' } },
|
|
436
419
|
{ name: 'status', type: { kind: 'enum', values: ['draft', 'published'] } },
|
|
437
420
|
])
|
|
438
|
-
await
|
|
439
|
-
await
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
await
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
await
|
|
448
|
-
|
|
449
|
-
channel.getConversations()
|
|
450
|
-
await channel.deleteConversation('old-thread')
|
|
451
|
-
await channel.renameConversation('Research')
|
|
452
|
-
|
|
453
|
-
// Conversation handles (reactive interactions for specific conversations)
|
|
454
|
-
const thread = channel.conversation('thread-42');
|
|
455
|
-
await thread.prompt('Hello'); // Uses thread-42's interaction history
|
|
456
|
-
// thread.interactions is reactive $state — updates from space/channel events
|
|
457
|
-
thread.close(); // Stop listening when done
|
|
458
|
-
|
|
459
|
-
// Channel admin
|
|
460
|
-
await channel.rename('New Name')
|
|
421
|
+
await conversation.alterCollection('article', updatedFields)
|
|
422
|
+
await conversation.dropCollection('article')
|
|
423
|
+
await conversation.setSystemInstruction('You are helpful')
|
|
424
|
+
conversation.getInteractions()
|
|
425
|
+
|
|
426
|
+
// Space history/admin
|
|
427
|
+
await space.checkpoint('Before edit')
|
|
428
|
+
await space.undo()
|
|
429
|
+
await space.redo()
|
|
430
|
+
await space.deleteConversation('old-thread')
|
|
431
|
+
await space.rename('New Name')
|
|
461
432
|
```
|
|
462
433
|
|
|
463
434
|
See the [SDK documentation](../sdk/README.md) for complete API details.
|
|
@@ -474,20 +445,19 @@ machineUri('/space/article/welcome.json');
|
|
|
474
445
|
// 'rool-machine:/space/article/welcome.json'
|
|
475
446
|
|
|
476
447
|
isObjectPath('/space/article/welcome.json'); // true
|
|
477
|
-
generateId(); //
|
|
448
|
+
generateId(); // unique ID suitable for conversation IDs
|
|
478
449
|
```
|
|
479
450
|
|
|
480
451
|
## Exported Types
|
|
481
452
|
|
|
482
453
|
```typescript
|
|
483
454
|
// Package types
|
|
484
|
-
import type { Rool, ReactiveSpace,
|
|
455
|
+
import type { Rool, ReactiveSpace, ReactiveConversationHandle, ReactiveObject, ReactiveWatch, WatchOptions, ReactiveFileTree, ReactiveFileNode, ReactiveFileRoot, ReactiveFileTreeEvent, ReactiveFileTreeSyncResult } from '@rool-dev/svelte';
|
|
485
456
|
|
|
486
457
|
// Re-exported from @rool-dev/sdk
|
|
487
458
|
import type {
|
|
488
459
|
RoolClient,
|
|
489
460
|
RoolClientConfig,
|
|
490
|
-
RoolChannel,
|
|
491
461
|
RoolSpace,
|
|
492
462
|
RoolSpaceInfo,
|
|
493
463
|
RoolObject,
|
|
@@ -495,7 +465,6 @@ import type {
|
|
|
495
465
|
RoolObjectStat,
|
|
496
466
|
RoolUserRole,
|
|
497
467
|
ConnectionState,
|
|
498
|
-
ChannelInfo,
|
|
499
468
|
Conversation,
|
|
500
469
|
ConversationInfo,
|
|
501
470
|
CurrentUser,
|
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,11 @@ export { createRool, generateId } from './rool.svelte.js';
|
|
|
2
2
|
export { isObjectPath, machinePath, machineUri } from '@rool-dev/sdk';
|
|
3
3
|
export { InviteError } from '@rool-dev/sdk';
|
|
4
4
|
export type { InviteErrorCode } from '@rool-dev/sdk';
|
|
5
|
-
export { wrapChannel } from './channel.svelte.js';
|
|
6
5
|
export { wrapSpace } from './space.svelte.js';
|
|
7
6
|
export { ReactiveFileTree } from './file-tree.svelte.js';
|
|
8
7
|
export type { Rool } from './rool.svelte.js';
|
|
9
|
-
export type {
|
|
8
|
+
export type { ReactiveConversationHandle, ReactiveObject, ReactiveWatch, WatchOptions } from './space-session.svelte.js';
|
|
10
9
|
export type { ReactiveSpace } from './space.svelte.js';
|
|
11
10
|
export type { ReactiveFileNode, ReactiveFilePath, ReactiveFileRoot, ReactiveFileTreeEvent, ReactiveFileTreeSyncResult } from './file-tree.svelte.js';
|
|
12
|
-
export type { RoolClientConfig,
|
|
11
|
+
export type { RoolClientConfig, RoolSpace, RoolSpaceInfo, RoolObject, GetObjectsResult, RoolObjectStat, RoolUserRole, ConnectionState, ConversationInfo, Conversation, CurrentUser, Interaction, PromptOptions, PromptAttachment, UpdateObjectOptions, MoveObjectOptions, CollectionOptions, FieldType, FieldDef, CollectionDef, SpaceSchema, SpaceMember, InviteRole, SpaceInvite, SpaceInviteCreated, InviteEmailStatus, InvitePreview, InviteRedeemResult, RoolClient, RoolSpaceEvents, SpaceFileStorageUsage, WebDAVDepth, WebDAVSyncLevel, WebDAVPropName, WebDAVResponse, WebDAVProps, } from '@rool-dev/sdk';
|
|
13
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGtE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGtE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,YAAY,EAAE,0BAA0B,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzH,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAGrJ,YAAY,EACV,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,WAAW,GACZ,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,5 @@ export { isObjectPath, machinePath, machineUri } from '@rool-dev/sdk';
|
|
|
5
5
|
// Invite error — re-exported so apps can match on it without a direct SDK dep
|
|
6
6
|
export { InviteError } from '@rool-dev/sdk';
|
|
7
7
|
// Reactive wrappers
|
|
8
|
-
export { wrapChannel } from './channel.svelte.js';
|
|
9
8
|
export { wrapSpace } from './space.svelte.js';
|
|
10
9
|
export { ReactiveFileTree } from './file-tree.svelte.js';
|
package/dist/rool.svelte.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RoolClient, type RoolSpaceInfo, type ConnectionState, type RoolClientConfig, type CurrentUser } from '@rool-dev/sdk';
|
|
2
|
-
import { type ReactiveChannelList } from './channel.svelte.js';
|
|
3
2
|
import { type ReactiveSpace } from './space.svelte.js';
|
|
4
3
|
/**
|
|
5
4
|
* Rool client with reactive state for Svelte 5.
|
|
@@ -8,7 +7,7 @@ import { type ReactiveSpace } from './space.svelte.js';
|
|
|
8
7
|
* - Reactive auth state (`authenticated`)
|
|
9
8
|
* - Reactive spaces list (`spaces`)
|
|
10
9
|
* - Reactive user storage (`userStorage`)
|
|
11
|
-
* -
|
|
10
|
+
* - Space-level access to conversations, objects, and AI
|
|
12
11
|
*/
|
|
13
12
|
declare class RoolImpl {
|
|
14
13
|
#private;
|
|
@@ -50,7 +49,6 @@ declare class RoolImpl {
|
|
|
50
49
|
logout(): void;
|
|
51
50
|
/**
|
|
52
51
|
* Open a space with a live SSE subscription. Returns a ReactiveSpace.
|
|
53
|
-
* Call `space.openChannel(channelId)` to get a ReactiveChannel.
|
|
54
52
|
* Call `space.close()` when done to stop the subscription.
|
|
55
53
|
*/
|
|
56
54
|
openSpace(spaceId: string): Promise<ReactiveSpace>;
|
|
@@ -126,13 +124,6 @@ declare class RoolImpl {
|
|
|
126
124
|
slug?: string;
|
|
127
125
|
marketingOptIn?: boolean;
|
|
128
126
|
}): Promise<CurrentUser>;
|
|
129
|
-
/**
|
|
130
|
-
* Create a reactive channel list for a space.
|
|
131
|
-
* Auto-updates when channels are created, updated, or deleted.
|
|
132
|
-
* Returns immediately with loading=true; populates once the space is ready.
|
|
133
|
-
* Call close() when done to stop listening.
|
|
134
|
-
*/
|
|
135
|
-
channels(spaceId: string): ReactiveChannelList;
|
|
136
127
|
/**
|
|
137
128
|
* Clean up resources.
|
|
138
129
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rool.svelte.d.ts","sourceRoot":"","sources":["../src/rool.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9H,OAAO,
|
|
1
|
+
{"version":3,"file":"rool.svelte.d.ts","sourceRoot":"","sources":["../src/rool.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,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Space } from './space.svelte.js';
|
|
4
3
|
/**
|
|
5
4
|
* Rool client with reactive state for Svelte 5.
|
|
@@ -8,7 +7,7 @@ import { wrapSpace } from './space.svelte.js';
|
|
|
8
7
|
* - Reactive auth state (`authenticated`)
|
|
9
8
|
* - Reactive spaces list (`spaces`)
|
|
10
9
|
* - Reactive user storage (`userStorage`)
|
|
11
|
-
* -
|
|
10
|
+
* - Space-level access to conversations, objects, and AI
|
|
12
11
|
*/
|
|
13
12
|
class RoolImpl {
|
|
14
13
|
#client;
|
|
@@ -151,7 +150,6 @@ class RoolImpl {
|
|
|
151
150
|
}
|
|
152
151
|
/**
|
|
153
152
|
* Open a space with a live SSE subscription. Returns a ReactiveSpace.
|
|
154
|
-
* Call `space.openChannel(channelId)` to get a ReactiveChannel.
|
|
155
153
|
* Call `space.close()` when done to stop the subscription.
|
|
156
154
|
*/
|
|
157
155
|
async openSpace(spaceId) {
|
|
@@ -276,15 +274,6 @@ class RoolImpl {
|
|
|
276
274
|
this.currentUser = user;
|
|
277
275
|
return user;
|
|
278
276
|
}
|
|
279
|
-
/**
|
|
280
|
-
* Create a reactive channel list for a space.
|
|
281
|
-
* Auto-updates when channels are created, updated, or deleted.
|
|
282
|
-
* Returns immediately with loading=true; populates once the space is ready.
|
|
283
|
-
* Call close() when done to stop listening.
|
|
284
|
-
*/
|
|
285
|
-
channels(spaceId) {
|
|
286
|
-
return createChannelList(this.#client.openSpace(spaceId));
|
|
287
|
-
}
|
|
288
277
|
/**
|
|
289
278
|
* Clean up resources.
|
|
290
279
|
*/
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { RoolSpace, Interaction, RoolObject, ConversationHandle } from '@rool-dev/sdk';
|
|
2
|
+
import { ReactiveFileTree } from './file-tree.svelte.js';
|
|
3
|
+
/**
|
|
4
|
+
* Options for creating a reactive watch.
|
|
5
|
+
* Structured object filter for reactive updates.
|
|
6
|
+
*/
|
|
7
|
+
export interface WatchOptions {
|
|
8
|
+
/** Field requirements for exact matching */
|
|
9
|
+
where?: Record<string, unknown>;
|
|
10
|
+
/** Filter by collection name. */
|
|
11
|
+
collection?: string;
|
|
12
|
+
/** Maximum number of objects */
|
|
13
|
+
limit?: number;
|
|
14
|
+
/** Sort order by modifiedAt: 'asc' or 'desc' (default: 'desc') */
|
|
15
|
+
order?: 'asc' | 'desc';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A reactive watch of objects that auto-updates when matching object files change.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ReactiveWatchImpl {
|
|
21
|
+
#private;
|
|
22
|
+
objects: RoolObject[];
|
|
23
|
+
loading: boolean;
|
|
24
|
+
constructor(space: RoolSpace, fileTree: ReactiveFileTree, options: WatchOptions);
|
|
25
|
+
/** Re-fetch matching objects using the canonical file tree for paths. */
|
|
26
|
+
refresh(): Promise<void>;
|
|
27
|
+
close(): void;
|
|
28
|
+
}
|
|
29
|
+
export type ReactiveWatch = ReactiveWatchImpl;
|
|
30
|
+
/**
|
|
31
|
+
* A reactive single object that auto-updates when the object changes.
|
|
32
|
+
*/
|
|
33
|
+
export declare class ReactiveObjectImpl {
|
|
34
|
+
#private;
|
|
35
|
+
data: RoolObject | undefined;
|
|
36
|
+
loading: boolean;
|
|
37
|
+
constructor(space: RoolSpace, fileTree: ReactiveFileTree, path: string);
|
|
38
|
+
refresh(): Promise<void>;
|
|
39
|
+
close(): void;
|
|
40
|
+
}
|
|
41
|
+
export type ReactiveObject = ReactiveObjectImpl;
|
|
42
|
+
export declare class ReactiveConversationHandleImpl {
|
|
43
|
+
#private;
|
|
44
|
+
interactions: Interaction[];
|
|
45
|
+
constructor(space: RoolSpace, conversationId: string);
|
|
46
|
+
get conversationId(): string;
|
|
47
|
+
getInteractions(): Interaction[];
|
|
48
|
+
getTree(): Record<string, Interaction>;
|
|
49
|
+
get activeLeafId(): string | undefined;
|
|
50
|
+
setActiveLeaf(interactionId: string): void;
|
|
51
|
+
getSystemInstruction(): string | undefined;
|
|
52
|
+
setSystemInstruction(...args: Parameters<ConversationHandle['setSystemInstruction']>): Promise<void>;
|
|
53
|
+
rename(...args: Parameters<ConversationHandle['rename']>): Promise<void>;
|
|
54
|
+
delete(): Promise<void>;
|
|
55
|
+
putObject(...args: Parameters<ConversationHandle['putObject']>): Promise<{
|
|
56
|
+
object: RoolObject;
|
|
57
|
+
message: string;
|
|
58
|
+
}>;
|
|
59
|
+
patchObject(...args: Parameters<ConversationHandle['patchObject']>): Promise<{
|
|
60
|
+
object: RoolObject;
|
|
61
|
+
message: string;
|
|
62
|
+
}>;
|
|
63
|
+
moveObject(...args: Parameters<ConversationHandle['moveObject']>): Promise<{
|
|
64
|
+
object: RoolObject;
|
|
65
|
+
message: string;
|
|
66
|
+
}>;
|
|
67
|
+
deleteObjects(...args: Parameters<ConversationHandle['deleteObjects']>): Promise<void>;
|
|
68
|
+
/** @deprecated Use deleteObjects instead. */
|
|
69
|
+
deletePaths(...args: Parameters<ConversationHandle['deletePaths']>): Promise<void>;
|
|
70
|
+
prompt(...args: Parameters<ConversationHandle['prompt']>): Promise<{
|
|
71
|
+
message: string;
|
|
72
|
+
objects: RoolObject[];
|
|
73
|
+
}>;
|
|
74
|
+
stop(): Promise<boolean>;
|
|
75
|
+
createCollection(...args: Parameters<ConversationHandle['createCollection']>): Promise<import("@rool-dev/sdk").CollectionDef>;
|
|
76
|
+
alterCollection(...args: Parameters<ConversationHandle['alterCollection']>): Promise<import("@rool-dev/sdk").CollectionDef>;
|
|
77
|
+
dropCollection(...args: Parameters<ConversationHandle['dropCollection']>): Promise<void>;
|
|
78
|
+
setMetadata(...args: Parameters<ConversationHandle['setMetadata']>): void;
|
|
79
|
+
close(): void;
|
|
80
|
+
}
|
|
81
|
+
export type ReactiveConversationHandle = ReactiveConversationHandleImpl;
|
|
82
|
+
//# sourceMappingURL=space-session.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space-session.svelte.d.ts","sourceRoot":"","sources":["../src/space-session.svel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