@rool-dev/svelte 0.11.3-dev.a6a4bb1 → 0.11.4-dev.e9877cb

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 CHANGED
@@ -14,12 +14,12 @@ npm install @rool-dev/svelte
14
14
 
15
15
  ```svelte
16
16
  <script lang="ts">
17
- import { createRool, type ReactiveChannel } from '@rool-dev/svelte';
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 channel = $state<ReactiveChannel | null>(null);
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
- const space = await rool.openSpace(spaceInfo.id);
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 channel}
41
- <p>Interactions: {channel.interactions.length}</p>
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
- | `channel.interactions` | Current conversation interactions |
61
- | `channel.objectPaths` | Object paths derived from `space.fileTree` |
62
- | `channel.collections` | Collection directories derived from `space.fileTree` |
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 `channel.object()`, `channel.watch()`, `channel.objectPaths`, and `channel.collections` are backed by this tree.
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 & Channels
149
+ ### Spaces & Conversations
151
150
 
152
- Every space has its own SSE subscription. Open a space, then open channels on it. Call `space.close()` when done this closes all open channels and stops the subscription.
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
- // Open channels on the space
159
- const channel = await space.openChannel('my-channel');
160
- const other = await space.openChannel('research'); // Independent channel, same space
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 ch = await fresh.openChannel('main');
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 all open channels AND stops the subscription
176
+ // Clean up — closes this space and stops its subscription
178
177
  space.close();
179
178
  ```
180
179
 
181
- ### ReactiveChannel
180
+ ### ReactiveSpace
182
181
 
183
- `space.openChannel()` returns a `ReactiveChannel` — the SDK's `RoolChannel` with reactive `interactions`, `objectPaths`, `collections`, `conversations`, and file-tree-backed object helpers:
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 ReactiveChannel, type ReactiveSpace } from '@rool-dev/svelte';
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 channel = $state<ReactiveChannel | null>(null);
192
+ let conversation = $state<ReactiveConversationHandle | null>(null);
194
193
 
195
194
  async function open(spaceId: string) {
196
195
  space = await rool.openSpace(spaceId);
197
- channel = await space.openChannel('main');
196
+ conversation = space.conversation('main');
198
197
  }
199
198
  </script>
200
199
 
201
- {#if channel}
202
- <!-- Reactive: updates when the current conversation changes -->
203
- {#each channel.interactions as interaction}
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
- <!-- All SDK methods work directly -->
210
- <button onclick={() => void channel.prompt('Hello')}>Send</button>
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 ReactiveChannel, type ReactiveObject } from '@rool-dev/svelte';
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 channel = $state<ReactiveChannel | null>(null);
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
- const space = await rool.openSpace(spaceId);
230
- channel = await space.openChannel('main');
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 channel. Closing the channel stops all updates — existing reactive objects will retain their last data but no longer refresh. Calling `channel.object()` after `close()` throws.
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 ReactiveChannel, type ReactiveSpace, type ReactiveWatch } from '@rool-dev/svelte';
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 = channel.watch({ collection: 'article' });
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 channel. Closing the channel stops all updates — existing watches will retain their last data but no longer refresh. Calling `channel.watch()` after `close()` throws.
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 = channel.watch({
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 Channel List
310
+ ### Reactive Space List
314
311
 
315
- `space.channels` is a reactive `ChannelInfo[]` on an opened `ReactiveSpace`. If you only need a live channel list without managing a `ReactiveSpace`, use `rool.channels(spaceId)` and call `close()` when done.
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 space = $state<ReactiveSpace | null>(null);
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
- {#if space}
331
- {#each space.channels as ch}
332
- <button onclick={() => void space.openChannel(ch.id)}>{ch.name ?? ch.id}</button>
333
- {/each}
334
- {/if}
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 `channel.conversation()` to get a handle with reactive interactions:
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 ReactiveChannel, type ReactiveConversationHandle, type ReactiveSpace } from '@rool-dev/svelte';
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
- channel = await space.openChannel('main');
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/channel events
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 channel events locally.
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
- ### Channel Management
380
+ ### Space Management
396
381
 
397
382
  ```typescript
398
- // Rename a channel on the space handle
399
- await space.renameChannel('channel-id', 'New Name');
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
- // Rename from within an open channel
405
- await channel.rename('New Name');
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
- All `RoolChannel` methods and properties are available on `ReactiveChannel`:
394
+ Common `ReactiveSpace` and `ReactiveConversationHandle` methods:
411
395
 
412
396
  ```typescript
413
- // Properties
414
- channel.id
415
- channel.name
416
- channel.role
417
- channel.channelId
397
+ // Space properties
398
+ space.id
399
+ space.name
400
+ space.role
418
401
 
419
- // Object operations addressed by exact machine paths
402
+ // Read object data by exact machine path
420
403
  const path = '/space/note/welcome.json';
421
- await channel.getObject(path)
422
- await channel.putObject(path, { text: 'Hello' })
423
- await channel.patchObject(path, { data: { text: 'Updated' } })
424
- await channel.moveObject(path, '/space/note/renamed.json')
425
- await channel.deleteObjects(['/space/note/renamed.json'])
426
-
427
- // AI
428
- await channel.prompt('Summarize everything')
429
- await channel.stop() // Stop the in-flight interaction (false if none)
430
- await channel.stopInteraction(channel.activeLeafId!) // Stop a specific interaction by ID
431
-
432
- // Schema
433
- channel.getSchema()
434
- await channel.createCollection('article', [
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 channel.alterCollection('article', updatedFields)
439
- await channel.dropCollection('article')
440
-
441
- // Undo/Redo
442
- await channel.checkpoint('Before edit')
443
- await channel.undo()
444
- await channel.redo()
445
-
446
- // Interaction history & conversations
447
- await channel.setSystemInstruction('You are helpful')
448
- channel.getInteractions()
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(); // 6-character alphanumeric ID
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, ReactiveChannel, ReactiveConversationHandle, ReactiveObject, ReactiveWatch, WatchOptions, ReactiveChannelList, ReactiveFileTree, ReactiveFileNode, ReactiveFileRoot, ReactiveFileTreeEvent, ReactiveFileTreeSyncResult } from '@rool-dev/svelte';
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 { ReactiveChannel, ReactiveConversationHandle, ReactiveObject, ReactiveWatch, ReactiveChannelList, WatchOptions } from './channel.svelte.js';
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, RoolChannel, RoolSpace, RoolSpaceInfo, RoolObject, GetObjectsResult, RoolObjectStat, RoolUserRole, ConnectionState, ChannelInfo, Conversation, ConversationInfo, 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';
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
@@ -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,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,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,eAAe,EAAE,0BAA0B,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzJ,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAGrJ,YA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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';
@@ -1,5 +1,4 @@
1
- import { RoolClient, type RoolSpaceInfo, type ConnectionState, type RoolClientConfig, type CurrentUser } from '@rool-dev/sdk';
2
- import { type ReactiveChannelList } from './channel.svelte.js';
1
+ import { RoolClient, type RoolSpaceInfo, type ConnectionState, type RoolClientConfig, type CurrentUser, type ServerInfo } from '@rool-dev/sdk';
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
- * - Channel-based access to spaces
10
+ * - Space-level access to conversations, objects, and AI
12
11
  */
13
12
  declare class RoolImpl {
14
13
  #private;
@@ -19,6 +18,8 @@ declare class RoolImpl {
19
18
  connectionState: ConnectionState;
20
19
  userStorage: Record<string, unknown>;
21
20
  currentUser: CurrentUser | null;
21
+ serverInfo: ServerInfo | null;
22
+ unsupported: boolean;
22
23
  constructor(config?: RoolClientConfig);
23
24
  /**
24
25
  * Access the underlying RoolClient for low-level API calls
@@ -50,7 +51,6 @@ declare class RoolImpl {
50
51
  logout(): void;
51
52
  /**
52
53
  * Open a space with a live SSE subscription. Returns a ReactiveSpace.
53
- * Call `space.openChannel(channelId)` to get a ReactiveChannel.
54
54
  * Call `space.close()` when done to stop the subscription.
55
55
  */
56
56
  openSpace(spaceId: string): Promise<ReactiveSpace>;
@@ -126,13 +126,6 @@ declare class RoolImpl {
126
126
  slug?: string;
127
127
  marketingOptIn?: boolean;
128
128
  }): 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
129
  /**
137
130
  * Clean up resources.
138
131
  */
@@ -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,EAAqB,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElE;;;;;;;;GAQG;AACH,cAAM,QAAQ;;IAMZ,aAAa,iBAAgC;IAC7C,MAAM,8BAAkD;IACxD,aAAa,UAAiB;IAC9B,WAAW,eAA8B;IACzC,eAAe,kBAA2C;IAC1D,WAAW,0BAAuC;IAClD,WAAW,qBAAoC;gBAEnC,MAAM,CAAC,EAAE,gBAAgB;IAKrC;;;OAGG;IAC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AIvD;;OAEG;IACH,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAI5C;;;OAGG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAKjD;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI;IAI9C;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM;IAI3B;;;;OAIG;IACG,YAAY,CAAC,KAAK,EAAE,MAAM;IAMhC;;OAEG;IACG,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC;IAOxE;;OAEG;IACH,IAAI,QAAQ,qCAEX;IAED;;OAEG;IACG,cAAc;IAMpB;;OAEG;IACG,iBAAiB,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE;IAQzF;;OAEG;IACH,OAAO,IAAI,IAAI;CAahB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAE1D;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { RoolClient } from '@rool-dev/sdk';
2
- import { createChannelList } from './channel.svelte.js';
3
2
  import { wrapSpace } 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
- * - Channel-based access to spaces
10
+ * - Space-level access to conversations, objects, and AI
12
11
  */
13
12
  class RoolImpl {
14
13
  #client;
@@ -22,6 +21,8 @@ class RoolImpl {
22
21
  connectionState = $state('disconnected');
23
22
  userStorage = $state({});
24
23
  currentUser = $state(null);
24
+ serverInfo = $state(null);
25
+ unsupported = $state(false);
25
26
  constructor(config) {
26
27
  this.#client = new RoolClient(config);
27
28
  this.#setupEventListeners();
@@ -62,6 +63,12 @@ class RoolImpl {
62
63
  };
63
64
  this.#client.on('connectionStateChanged', onConnectionStateChanged);
64
65
  this.#unsubscribers.push(() => this.#client.off('connectionStateChanged', onConnectionStateChanged));
66
+ const onServerInfoChanged = (info) => {
67
+ this.serverInfo = info;
68
+ this.unsupported = info.compatibility === 'unsupported';
69
+ };
70
+ this.#client.on('serverInfoChanged', onServerInfoChanged);
71
+ this.#unsubscribers.push(() => this.#client.off('serverInfoChanged', onServerInfoChanged));
65
72
  const onSpaceAdded = () => this.#refreshSpaces();
66
73
  this.#client.on('spaceAdded', onSpaceAdded);
67
74
  this.#unsubscribers.push(() => this.#client.off('spaceAdded', onSpaceAdded));
@@ -151,7 +158,6 @@ class RoolImpl {
151
158
  }
152
159
  /**
153
160
  * Open a space with a live SSE subscription. Returns a ReactiveSpace.
154
- * Call `space.openChannel(channelId)` to get a ReactiveChannel.
155
161
  * Call `space.close()` when done to stop the subscription.
156
162
  */
157
163
  async openSpace(spaceId) {
@@ -276,15 +282,6 @@ class RoolImpl {
276
282
  this.currentUser = user;
277
283
  return user;
278
284
  }
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
285
  /**
289
286
  * Clean up resources.
290
287
  */