@rool-dev/sdk 0.3.1-dev.5387348 → 0.3.1-dev.58bbab3
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 +143 -35
- package/dist/apps.d.ts +1 -1
- package/dist/apps.d.ts.map +1 -1
- package/dist/apps.js +1 -5
- package/dist/apps.js.map +1 -1
- package/dist/channel.d.ts +136 -4
- package/dist/channel.d.ts.map +1 -1
- package/dist/channel.js +373 -32
- package/dist/channel.js.map +1 -1
- package/dist/client.d.ts +18 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +22 -1
- package/dist/client.js.map +1 -1
- package/dist/graphql.d.ts +18 -11
- package/dist/graphql.d.ts.map +1 -1
- package/dist/graphql.js +91 -31
- package/dist/graphql.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/subscription.d.ts +6 -0
- package/dist/subscription.d.ts.map +1 -1
- package/dist/subscription.js +45 -0
- package/dist/subscription.js.map +1 -1
- package/dist/types.d.ts +90 -16
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,7 +10,8 @@ Use Rool to programmatically instruct agents to generate content, research topic
|
|
|
10
10
|
|
|
11
11
|
**Core primitives:**
|
|
12
12
|
- **Spaces** — Containers for objects, schema, metadata, and channels
|
|
13
|
-
- **Channels** — Named contexts within a space
|
|
13
|
+
- **Channels** — Named contexts within a space. All object and AI operations go through a channel.
|
|
14
|
+
- **Conversations** — Independent interaction histories within a channel. Most apps use a single `'default'` conversation; multi-conversation apps (e.g., chat with multiple threads) can open additional ones.
|
|
14
15
|
- **Objects** — Key-value records with any fields you define. References between objects are data fields whose values are object IDs.
|
|
15
16
|
- **AI operations** — Create, update, or query objects using natural language and `{{placeholders}}`
|
|
16
17
|
|
|
@@ -84,7 +85,7 @@ channel.close();
|
|
|
84
85
|
|
|
85
86
|
### Spaces and Channels
|
|
86
87
|
|
|
87
|
-
A **space** is a container that holds objects, schema, metadata, and channels. A **channel** is a named context within a space — it's the handle you use for all object and AI operations. Each channel
|
|
88
|
+
A **space** is a container that holds objects, schema, metadata, and channels. A **channel** is a named context within a space — it's the handle you use for all object and AI operations. Each channel contains one or more **conversations**, each with independent interaction history.
|
|
88
89
|
|
|
89
90
|
There are two main handles:
|
|
90
91
|
- **`RoolSpace`** — Lightweight admin handle for user management, link access, channel management, and export. No real-time subscription.
|
|
@@ -111,22 +112,56 @@ The `channelId` is fixed when you open a channel and cannot be changed. To use a
|
|
|
111
112
|
- 1–32 characters
|
|
112
113
|
- Only alphanumeric characters, hyphens (`-`), and underscores (`_`)
|
|
113
114
|
|
|
115
|
+
### Conversations
|
|
116
|
+
|
|
117
|
+
A **conversation** is a named interaction history within a channel. By default, all operations use the `'default'` conversation — most apps never need to think about conversations at all.
|
|
118
|
+
|
|
119
|
+
For apps that need multiple independent interaction threads (e.g., a chat sidebar with multiple threads), use `channel.conversation()` to get a handle scoped to a specific conversation:
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
// Default conversation — most apps use this
|
|
123
|
+
const channel = await client.openChannel('space-id', 'main');
|
|
124
|
+
await channel.prompt('Hello'); // Uses 'default' conversation
|
|
125
|
+
|
|
126
|
+
// Conversation handle — for multi-thread UIs
|
|
127
|
+
const thread = channel.conversation('thread-42');
|
|
128
|
+
await thread.prompt('Hello'); // Uses 'thread-42' conversation
|
|
129
|
+
thread.getInteractions(); // Interactions for thread-42 only
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Each conversation has its own interaction history and optional system instruction. Conversations are auto-created on first interaction — no explicit create step needed. The 50-message cap applies per conversation. All conversations share one SSE connection per channel.
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
// System instructions are per-conversation
|
|
136
|
+
const thread = channel.conversation('research');
|
|
137
|
+
await thread.setSystemInstruction('Respond in haiku');
|
|
138
|
+
|
|
139
|
+
// List all conversations in this channel
|
|
140
|
+
const conversations = channel.getConversations();
|
|
141
|
+
|
|
142
|
+
// Delete a conversation (cannot delete 'default')
|
|
143
|
+
await channel.deleteConversation('old-thread');
|
|
144
|
+
|
|
145
|
+
// Rename a conversation
|
|
146
|
+
await thread.rename('Research Thread');
|
|
147
|
+
```
|
|
148
|
+
|
|
114
149
|
### Objects & References
|
|
115
150
|
|
|
116
151
|
**Objects** are plain key-value records. The `id` field is reserved; everything else is application-defined.
|
|
117
152
|
|
|
118
153
|
```typescript
|
|
119
|
-
{ id: 'abc123',
|
|
154
|
+
{ id: 'abc123', title: 'Hello World', status: 'draft' }
|
|
120
155
|
```
|
|
121
156
|
|
|
122
157
|
**References** between objects are data fields whose values are object IDs. The system detects these statistically — any string field whose value matches an existing object ID is recognized as a reference.
|
|
123
158
|
|
|
124
159
|
```typescript
|
|
125
160
|
// A planet references a star via the 'orbits' field
|
|
126
|
-
{ id: 'earth',
|
|
161
|
+
{ id: 'earth', name: 'Earth', orbits: 'sun-01' }
|
|
127
162
|
|
|
128
163
|
// An array of references
|
|
129
|
-
{ id: 'team-a',
|
|
164
|
+
{ id: 'team-a', name: 'Alpha', members: ['user-1', 'user-2', 'user-3'] }
|
|
130
165
|
```
|
|
131
166
|
|
|
132
167
|
References are just data — no special API is needed to create or remove them. Set a field to an object ID to create a reference; clear it to remove it.
|
|
@@ -139,7 +174,6 @@ Use `{{description}}` in field values to have AI generate content:
|
|
|
139
174
|
// Create with AI-generated content
|
|
140
175
|
await channel.createObject({
|
|
141
176
|
data: {
|
|
142
|
-
type: 'article',
|
|
143
177
|
headline: '{{catchy headline about coffee}}',
|
|
144
178
|
body: '{{informative paragraph}}'
|
|
145
179
|
}
|
|
@@ -235,7 +269,7 @@ await channel.createObject({ data: { id: 'article-42', title: 'The Meaning of Li
|
|
|
235
269
|
```typescript
|
|
236
270
|
// Fire-and-forget: create and reference without waiting
|
|
237
271
|
const id = RoolClient.generateId();
|
|
238
|
-
channel.createObject({ data: { id,
|
|
272
|
+
channel.createObject({ data: { id, text: '{{expand this idea}}' } });
|
|
239
273
|
channel.updateObject(parentId, { data: { notes: [...existingNotes, id] } }); // Add reference immediately
|
|
240
274
|
```
|
|
241
275
|
|
|
@@ -558,6 +592,19 @@ client.on('userStorageChanged', ({ key, value, source }) => {
|
|
|
558
592
|
});
|
|
559
593
|
```
|
|
560
594
|
|
|
595
|
+
### Apps
|
|
596
|
+
|
|
597
|
+
Publish, manage, and discover apps. See [`@rool-dev/app`](/app/) for building apps.
|
|
598
|
+
|
|
599
|
+
| Method | Description |
|
|
600
|
+
|--------|-------------|
|
|
601
|
+
| `publishApp(appId, options): Promise<PublishedAppInfo>` | Publish or update an app (`options.bundle`: zip with `index.html` and `rool-app.json`) |
|
|
602
|
+
| `unpublishApp(appId): Promise<void>` | Unpublish an app |
|
|
603
|
+
| `listApps(): Promise<PublishedAppInfo[]>` | List your own published apps |
|
|
604
|
+
| `getAppInfo(appId): Promise<PublishedAppInfo \| null>` | Get info for a specific app |
|
|
605
|
+
| `findApps(options?): Promise<PublishedAppInfo[]>` | Search public apps. Options: `query` (semantic search string), `limit` (default 20, max 100). Omit `query` to browse all. |
|
|
606
|
+
| `installApp(spaceId, appId, channelId?): Promise<string>` | Install an app into a space. Creates/updates a channel with the app's manifest settings (name, system instruction, collections). Returns the channel ID. Defaults `channelId` to `appId`. |
|
|
607
|
+
|
|
561
608
|
### Utilities
|
|
562
609
|
|
|
563
610
|
| Method | Description |
|
|
@@ -638,6 +685,7 @@ A channel is a named context within a space. All object operations, AI prompts,
|
|
|
638
685
|
| `userId: string` | Current user's ID |
|
|
639
686
|
| `channelId: string` | Channel ID (read-only, fixed at open time) |
|
|
640
687
|
| `isReadOnly: boolean` | True if viewer role |
|
|
688
|
+
| `appUrl: string \| null` | URL of the installed app, or null if this is a plain channel |
|
|
641
689
|
|
|
642
690
|
### Lifecycle
|
|
643
691
|
|
|
@@ -645,6 +693,7 @@ A channel is a named context within a space. All object operations, AI prompts,
|
|
|
645
693
|
|--------|-------------|
|
|
646
694
|
| `close(): void` | Clean up resources and stop receiving updates |
|
|
647
695
|
| `rename(name): Promise<void>` | Rename this channel |
|
|
696
|
+
| `conversation(conversationId): ConversationHandle` | Get a handle scoped to a specific conversation (see [Conversations](#conversations)) |
|
|
648
697
|
|
|
649
698
|
### Object Operations
|
|
650
699
|
|
|
@@ -680,12 +729,14 @@ Objects are plain key/value records. `id` is the only reserved field; everything
|
|
|
680
729
|
Find objects using structured filters and/or natural language.
|
|
681
730
|
|
|
682
731
|
- **`where` only** — exact-match filtering, no AI, no credits.
|
|
732
|
+
- **`collection` only** — filter by collection name (shape-based matching), no AI, no credits.
|
|
683
733
|
- **`prompt` only** — AI-powered semantic query over all objects.
|
|
684
734
|
- **`where` + `prompt`** — `where` (and `objectIds`) narrow the data set first, then the AI queries within the constrained set.
|
|
685
735
|
|
|
686
736
|
| Option | Description |
|
|
687
737
|
|--------|-------------|
|
|
688
|
-
| `where` | Exact-match field filter (e.g. `{
|
|
738
|
+
| `where` | Exact-match field filter (e.g. `{ status: 'published' }`). Values must match literally — no operators or `{{placeholders}}`. When combined with `prompt`, constrains which objects the AI can see. |
|
|
739
|
+
| `collection` | Filter by collection name. Only returns objects whose shape matches the named collection. |
|
|
689
740
|
| `prompt` | Natural language query. Triggers AI evaluation (uses credits). |
|
|
690
741
|
| `limit` | Maximum number of results. |
|
|
691
742
|
| `objectIds` | Scope to specific object IDs. Constrains the candidate set in both structured and AI queries. |
|
|
@@ -695,9 +746,20 @@ Find objects using structured filters and/or natural language.
|
|
|
695
746
|
**Examples:**
|
|
696
747
|
|
|
697
748
|
```typescript
|
|
749
|
+
// Filter by collection (no AI, no credits)
|
|
750
|
+
const { objects } = await channel.findObjects({
|
|
751
|
+
collection: 'article'
|
|
752
|
+
});
|
|
753
|
+
|
|
698
754
|
// Exact field matching (no AI, no credits)
|
|
699
755
|
const { objects } = await channel.findObjects({
|
|
700
|
-
where: {
|
|
756
|
+
where: { status: 'published' }
|
|
757
|
+
});
|
|
758
|
+
|
|
759
|
+
// Combine collection and field filters
|
|
760
|
+
const { objects } = await channel.findObjects({
|
|
761
|
+
collection: 'article',
|
|
762
|
+
where: { status: 'published' }
|
|
701
763
|
});
|
|
702
764
|
|
|
703
765
|
// Pure natural language query (AI interprets)
|
|
@@ -705,9 +767,9 @@ const { objects, message } = await channel.findObjects({
|
|
|
705
767
|
prompt: 'articles about space exploration published this year'
|
|
706
768
|
});
|
|
707
769
|
|
|
708
|
-
// Combined: where
|
|
770
|
+
// Combined: collection + where narrow the data, prompt queries within it
|
|
709
771
|
const { objects } = await channel.findObjects({
|
|
710
|
-
|
|
772
|
+
collection: 'article',
|
|
711
773
|
prompt: 'that discuss climate solutions positively',
|
|
712
774
|
limit: 10
|
|
713
775
|
});
|
|
@@ -862,9 +924,15 @@ channel.on('objectDeleted', ({ objectId, source }) => void)
|
|
|
862
924
|
// Space metadata
|
|
863
925
|
channel.on('metadataUpdated', ({ metadata, source }) => void)
|
|
864
926
|
|
|
865
|
-
//
|
|
927
|
+
// Collection schema changed
|
|
928
|
+
channel.on('schemaUpdated', ({ schema, source }) => void)
|
|
929
|
+
|
|
930
|
+
// Channel metadata updated (name, appUrl)
|
|
866
931
|
channel.on('channelUpdated', ({ channelId, source }) => void)
|
|
867
932
|
|
|
933
|
+
// Conversation interaction history updated
|
|
934
|
+
channel.on('conversationUpdated', ({ conversationId, channelId, source }) => void)
|
|
935
|
+
|
|
868
936
|
// Full state replacement (undo/redo, resync after error)
|
|
869
937
|
channel.on('reset', ({ source }) => void)
|
|
870
938
|
|
|
@@ -890,13 +958,13 @@ try {
|
|
|
890
958
|
|
|
891
959
|
## Interaction History
|
|
892
960
|
|
|
893
|
-
Each channel
|
|
961
|
+
Each channel contains one or more conversations, each with its own interaction history. The history records all meaningful interactions (prompts, object mutations) as self-contained entries, each capturing the request and its result. History is stored in the space data itself and syncs in real-time to all clients.
|
|
894
962
|
|
|
895
963
|
### What the AI Receives
|
|
896
964
|
|
|
897
965
|
AI operations (`prompt`, `createObject`, `updateObject`, `findObjects`) automatically receive:
|
|
898
966
|
|
|
899
|
-
- **Interaction history** — Previous interactions and their results from
|
|
967
|
+
- **Interaction history** — Previous interactions and their results from the current conversation
|
|
900
968
|
- **Recently modified objects** — Objects in the space recently created or changed
|
|
901
969
|
- **Selected objects** — Objects passed via `objectIds` are given primary focus
|
|
902
970
|
|
|
@@ -905,24 +973,27 @@ This context flows automatically — no configuration needed. The AI sees enough
|
|
|
905
973
|
### Accessing History
|
|
906
974
|
|
|
907
975
|
```typescript
|
|
908
|
-
// Get interactions for
|
|
976
|
+
// Get interactions for the current conversation
|
|
909
977
|
const interactions = channel.getInteractions();
|
|
910
978
|
// Returns: Interaction[]
|
|
911
979
|
```
|
|
912
980
|
|
|
913
|
-
###
|
|
981
|
+
### Conversation History Methods
|
|
914
982
|
|
|
915
983
|
| Method | Description |
|
|
916
984
|
|--------|-------------|
|
|
917
|
-
| `getInteractions(): Interaction[]` | Get interactions for
|
|
918
|
-
| `getSystemInstruction(): string \| undefined` | Get system instruction for
|
|
919
|
-
| `setSystemInstruction(instruction): Promise<void>` | Set system instruction for
|
|
985
|
+
| `getInteractions(): Interaction[]` | Get interactions for the default conversation |
|
|
986
|
+
| `getSystemInstruction(): string \| undefined` | Get system instruction for the default conversation |
|
|
987
|
+
| `setSystemInstruction(instruction): Promise<void>` | Set system instruction for the default conversation. Pass `null` to clear. |
|
|
988
|
+
| `getConversations(): ConversationInfo[]` | List all conversations in this channel |
|
|
989
|
+
| `deleteConversation(conversationId): Promise<void>` | Delete a conversation (cannot delete `'default'`) |
|
|
990
|
+
| `renameConversation(name): Promise<void>` | Rename the default conversation |
|
|
920
991
|
|
|
921
992
|
Channel management (listing, renaming, deleting channels) is done via the client — see [Channel Management](#channel-management).
|
|
922
993
|
|
|
923
994
|
### System Instructions
|
|
924
995
|
|
|
925
|
-
System instructions customize how the AI behaves within a
|
|
996
|
+
System instructions customize how the AI behaves within a conversation. The instruction persists across all prompts in that conversation.
|
|
926
997
|
|
|
927
998
|
```typescript
|
|
928
999
|
// Make the AI behave like an SQL interpreter
|
|
@@ -949,19 +1020,25 @@ System instructions are useful for:
|
|
|
949
1020
|
### Listening for Updates
|
|
950
1021
|
|
|
951
1022
|
```typescript
|
|
1023
|
+
// Listen for conversation updates (interaction history changes)
|
|
1024
|
+
channel.on('conversationUpdated', ({ conversationId, channelId, source }) => {
|
|
1025
|
+
const interactions = channel.getInteractions();
|
|
1026
|
+
renderInteractions(interactions);
|
|
1027
|
+
});
|
|
1028
|
+
|
|
1029
|
+
// channelUpdated also fires for the active conversation (backward compat)
|
|
952
1030
|
channel.on('channelUpdated', ({ channelId, source }) => {
|
|
953
|
-
// Channel updated - refresh if needed
|
|
954
1031
|
const interactions = channel.getInteractions();
|
|
955
1032
|
renderInteractions(interactions);
|
|
956
1033
|
});
|
|
957
1034
|
```
|
|
958
1035
|
|
|
959
|
-
### Multiple Channels
|
|
1036
|
+
### Multiple Channels and Conversations
|
|
960
1037
|
|
|
961
|
-
Each channel
|
|
1038
|
+
Each channel contains conversations with independent interaction history. For most apps, a single channel with the default conversation is sufficient. For multi-thread UIs, use conversation handles within one channel:
|
|
962
1039
|
|
|
963
1040
|
```typescript
|
|
964
|
-
//
|
|
1041
|
+
// Multiple channels on the same space
|
|
965
1042
|
const research = await client.openChannel('space-id', 'research');
|
|
966
1043
|
const main = await client.openChannel('space-id', 'main');
|
|
967
1044
|
|
|
@@ -969,19 +1046,27 @@ const main = await client.openChannel('space-id', 'main');
|
|
|
969
1046
|
await research.prompt("Analyze this data");
|
|
970
1047
|
await main.prompt("Summarize findings");
|
|
971
1048
|
|
|
1049
|
+
// Multiple conversations within one channel (shared SSE connection)
|
|
1050
|
+
const channel = await client.openChannel('space-id', 'main');
|
|
1051
|
+
const thread1 = channel.conversation('thread-1');
|
|
1052
|
+
const thread2 = channel.conversation('thread-2');
|
|
1053
|
+
|
|
1054
|
+
await thread1.prompt("Research topic A");
|
|
1055
|
+
await thread2.prompt("Research topic B");
|
|
1056
|
+
|
|
972
1057
|
// Close when done
|
|
973
1058
|
research.close();
|
|
974
1059
|
main.close();
|
|
975
1060
|
```
|
|
976
1061
|
|
|
977
1062
|
**Use cases:**
|
|
978
|
-
- **Chat app with sidebar** — Each sidebar entry is a
|
|
979
|
-
- **Page refresh** — Store the channelId in localStorage to resume
|
|
1063
|
+
- **Chat app with sidebar** — Each sidebar entry is a conversation handle within the same channel
|
|
1064
|
+
- **Page refresh** — Store the channelId and conversationId in localStorage to resume
|
|
980
1065
|
- **Collaborative channels** — Share a channelId between users to enable shared AI interaction history
|
|
981
1066
|
|
|
982
|
-
**Tip:** Use the user's id as
|
|
1067
|
+
**Tip:** Use the user's id as conversationId to give each user their own interaction history within a shared channel.
|
|
983
1068
|
|
|
984
|
-
Note: Interaction history is truncated to the most recent 50 entries
|
|
1069
|
+
Note: Interaction history is truncated to the most recent 50 entries per conversation.
|
|
985
1070
|
|
|
986
1071
|
### The ai Field
|
|
987
1072
|
|
|
@@ -991,7 +1076,7 @@ The `ai` field in interactions distinguishes AI-generated responses from synthet
|
|
|
991
1076
|
|
|
992
1077
|
### Tool Calls
|
|
993
1078
|
|
|
994
|
-
The `toolCalls` array captures what the AI agent did during execution. Use it to build responsive UIs that show progress while the agent works — the `
|
|
1079
|
+
The `toolCalls` array captures what the AI agent did during execution. Use it to build responsive UIs that show progress while the agent works — the `conversationUpdated` event fires when each tool starts and completes. A tool call without a `result` is still running; once `result` is present, the tool has finished.
|
|
995
1080
|
|
|
996
1081
|
## Data Types
|
|
997
1082
|
|
|
@@ -1042,17 +1127,36 @@ interface RoolObjectStat {
|
|
|
1042
1127
|
}
|
|
1043
1128
|
```
|
|
1044
1129
|
|
|
1045
|
-
### Channels
|
|
1130
|
+
### Channels and Conversations
|
|
1046
1131
|
|
|
1047
1132
|
```typescript
|
|
1048
|
-
//
|
|
1133
|
+
// Conversation — holds interaction history and optional system instruction
|
|
1134
|
+
interface Conversation {
|
|
1135
|
+
name?: string; // Conversation name (optional)
|
|
1136
|
+
systemInstruction?: string; // Custom system instruction for AI
|
|
1137
|
+
createdAt: number; // Timestamp when conversation was created
|
|
1138
|
+
createdBy: string; // User ID who created the conversation
|
|
1139
|
+
interactions: Interaction[]; // Interaction history
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
// Conversation summary info (returned by channel.getConversations())
|
|
1143
|
+
interface ConversationInfo {
|
|
1144
|
+
id: string;
|
|
1145
|
+
name: string | null;
|
|
1146
|
+
systemInstruction: string | null;
|
|
1147
|
+
createdAt: number;
|
|
1148
|
+
createdBy: string;
|
|
1149
|
+
interactionCount: number;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
// Channel container with metadata and conversations
|
|
1049
1153
|
interface Channel {
|
|
1050
1154
|
name?: string; // Channel name (optional)
|
|
1051
1155
|
createdAt: number; // Timestamp when channel was created
|
|
1052
1156
|
createdBy: string; // User ID who created the channel
|
|
1053
1157
|
createdByName?: string; // Display name at time of creation
|
|
1054
|
-
|
|
1055
|
-
|
|
1158
|
+
appUrl?: string; // URL of installed app (set by installApp)
|
|
1159
|
+
conversations: Record<string, Conversation>; // Keyed by conversation ID
|
|
1056
1160
|
}
|
|
1057
1161
|
|
|
1058
1162
|
// Channel summary info (returned by client.getChannels)
|
|
@@ -1063,6 +1167,7 @@ interface ChannelInfo {
|
|
|
1063
1167
|
createdBy: string;
|
|
1064
1168
|
createdByName: string | null;
|
|
1065
1169
|
interactionCount: number;
|
|
1170
|
+
appUrl: string | null; // URL of installed app, or null
|
|
1066
1171
|
}
|
|
1067
1172
|
```
|
|
1068
1173
|
|
|
@@ -1074,9 +1179,11 @@ Note: `Channel` and `ChannelInfo` are data types describing the stored channel m
|
|
|
1074
1179
|
interface ToolCall {
|
|
1075
1180
|
name: string; // Tool name (e.g., "create_object", "update_object", "search_web")
|
|
1076
1181
|
input: unknown; // Arguments passed to the tool
|
|
1077
|
-
result
|
|
1182
|
+
result?: string; // Truncated result (absent while tool is running)
|
|
1078
1183
|
}
|
|
1079
1184
|
|
|
1185
|
+
type InteractionStatus = 'pending' | 'streaming' | 'done' | 'error';
|
|
1186
|
+
|
|
1080
1187
|
interface Interaction {
|
|
1081
1188
|
id: string; // Unique ID for this interaction
|
|
1082
1189
|
timestamp: number;
|
|
@@ -1084,7 +1191,8 @@ interface Interaction {
|
|
|
1084
1191
|
userName?: string | null; // Display name at time of interaction
|
|
1085
1192
|
operation: 'prompt' | 'createObject' | 'updateObject' | 'deleteObjects';
|
|
1086
1193
|
input: string; // What the user did: prompt text or action description
|
|
1087
|
-
output: string | null; //
|
|
1194
|
+
output: string | null; // AI response or confirmation message (may be partial when streaming)
|
|
1195
|
+
status: InteractionStatus; // Lifecycle status (pending → streaming → done/error)
|
|
1088
1196
|
ai: boolean; // Whether AI was invoked (vs synthetic confirmation)
|
|
1089
1197
|
modifiedObjectIds: string[]; // Objects affected by this interaction
|
|
1090
1198
|
toolCalls: ToolCall[]; // Tools called during this interaction (for AI prompts)
|
package/dist/apps.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare class AppsClient {
|
|
|
18
18
|
/**
|
|
19
19
|
* Publish or update an app.
|
|
20
20
|
* @param appId - URL-safe identifier for the app
|
|
21
|
-
* @param options -
|
|
21
|
+
* @param options - Bundle zip file (must include index.html and rool-app.json)
|
|
22
22
|
*/
|
|
23
23
|
publish(appId: string, options: PublishAppOptions): Promise<PublishedAppInfo>;
|
|
24
24
|
/**
|
package/dist/apps.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../src/apps.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAmB;gBAErB,MAAM,EAAE,gBAAgB;IAIpC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAkBzC;;OAEG;IACG,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAsB1D;;;;OAIG;IACG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../src/apps.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAmB;gBAErB,MAAM,EAAE,gBAAgB;IAIpC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAkBzC;;OAEG;IACG,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAsB1D;;;;OAIG;IACG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAwBnF;;OAEG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAe9C"}
|
package/dist/apps.js
CHANGED
|
@@ -47,7 +47,7 @@ export class AppsClient {
|
|
|
47
47
|
/**
|
|
48
48
|
* Publish or update an app.
|
|
49
49
|
* @param appId - URL-safe identifier for the app
|
|
50
|
-
* @param options -
|
|
50
|
+
* @param options - Bundle zip file (must include index.html and rool-app.json)
|
|
51
51
|
*/
|
|
52
52
|
async publish(appId, options) {
|
|
53
53
|
const tokens = await this.config.authManager.getTokens();
|
|
@@ -56,10 +56,6 @@ export class AppsClient {
|
|
|
56
56
|
const headers = { Authorization: `Bearer ${tokens.accessToken}`, 'X-Rool-Token': tokens.roolToken };
|
|
57
57
|
const formData = new FormData();
|
|
58
58
|
formData.append('bundle', options.bundle);
|
|
59
|
-
formData.append('name', options.name);
|
|
60
|
-
if (options.spa !== undefined) {
|
|
61
|
-
formData.append('spa', String(options.spa));
|
|
62
|
-
}
|
|
63
59
|
const response = await fetch(`${this.config.appsUrl}/${encodeURIComponent(appId)}`, {
|
|
64
60
|
method: 'POST',
|
|
65
61
|
headers,
|
package/dist/apps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../src/apps.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,cAAc;AACd,2DAA2D;AAC3D,gFAAgF;AAUhF,MAAM,OAAO,UAAU;IACb,MAAM,CAAmB;IAEjC,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;QACzD,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAElD,MAAM,OAAO,GAA2B,EAAE,aAAa,EAAE,UAAU,MAAM,CAAC,WAAW,EAAE,EAAE,cAAc,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;QAE5H,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YAChD,MAAM,EAAE,KAAK;YACb,OAAO;SACR,CAAC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