@gravity-rail/sdk 0.21.0 → 0.32.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/README.md +57 -8
- package/dist/agui.d.cts +1 -1
- package/dist/agui.d.ts +1 -1
- package/dist/audio.d.cts +1 -1
- package/dist/audio.d.ts +1 -1
- package/dist/{client-B0eh2BEY.d.cts → chat-interaction-BKdImgZ5.d.ts} +8006 -3570
- package/dist/{client-CFz-BGmY.d.ts → chat-interaction-DLfC_h_P.d.cts} +8006 -3570
- package/dist/{chunk-3HAV5XUJ.js → chunk-HRUMZ46V.js} +1 -1
- package/dist/chunk-HRUMZ46V.js.map +1 -0
- package/dist/{chunk-24L4RD4Z.js → chunk-N446FGCT.js} +1247 -203
- package/dist/chunk-N446FGCT.js.map +1 -0
- package/dist/{chunk-7OLBLLV7.js → chunk-P2E6LU7I.js} +57 -7
- package/dist/chunk-P2E6LU7I.js.map +1 -0
- package/dist/helpers.cjs +54 -1
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +3 -2
- package/dist/helpers.d.ts +3 -2
- package/dist/helpers.js +11 -3
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +2302 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +509 -6
- package/dist/index.d.ts +509 -6
- package/dist/index.js +1032 -23
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +1337 -222
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +33 -49
- package/dist/internal.d.ts +33 -49
- package/dist/internal.js +73 -33
- package/dist/internal.js.map +1 -1
- package/dist/realtime.cjs +279 -14
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +169 -17
- package/dist/realtime.d.ts +169 -17
- package/dist/realtime.js +264 -13
- package/dist/realtime.js.map +1 -1
- package/dist/{revision-state-fJ9PM15N.d.cts → revision-state-Bsq5dKwi.d.cts} +236 -5
- package/dist/{revision-state-KfOztBkY.d.ts → revision-state-CQTYcIRG.d.ts} +236 -5
- package/dist/schemas.cjs +3 -1
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +31 -13
- package/dist/schemas.d.ts +31 -13
- package/dist/schemas.js +4 -2
- package/dist/schemas.js.map +1 -1
- package/dist/{tasks-WH_VfzMv.d.cts → tasks-B-31JPuq.d.cts} +298 -114
- package/dist/{tasks-WH_VfzMv.d.ts → tasks-B-31JPuq.d.ts} +298 -114
- package/dist/types-0c6_NGU4.d.cts +90 -0
- package/dist/types-0c6_NGU4.d.ts +90 -0
- package/package.json +3 -3
- package/dist/chunk-24L4RD4Z.js.map +0 -1
- package/dist/chunk-3HAV5XUJ.js.map +0 -1
- package/dist/chunk-7OLBLLV7.js.map +0 -1
- package/dist/types-DkYyrvoC.d.cts +0 -19
- package/dist/types-DkYyrvoC.d.ts +0 -19
package/README.md
CHANGED
|
@@ -197,14 +197,6 @@ await client.upsertDataRecord(workspaceId, dataType.id, {
|
|
|
197
197
|
### Communication Channels
|
|
198
198
|
|
|
199
199
|
```typescript
|
|
200
|
-
// Phone — initiate an outbound AI voice call
|
|
201
|
-
const numbers = await client.getPhoneNumbers(workspaceId);
|
|
202
|
-
await client.initiateCall(workspaceId, {
|
|
203
|
-
phone_number_id: numbers[0].id,
|
|
204
|
-
to_number: '+15551234567',
|
|
205
|
-
workflow_id: workflowId,
|
|
206
|
-
});
|
|
207
|
-
|
|
208
200
|
// Email — manage inboxes and threads
|
|
209
201
|
const inboxes = await client.getInboxes(workspaceId);
|
|
210
202
|
const threads = await client.getInboxThreads(workspaceId, inboxes[0].id);
|
|
@@ -353,6 +345,13 @@ await client.crawlSite(workspaceId, site.id, { url: 'https://docs.example.com' }
|
|
|
353
345
|
### Workspace Management
|
|
354
346
|
|
|
355
347
|
```typescript
|
|
348
|
+
// Workspaces this credential can reach
|
|
349
|
+
const workspaces = await client.getWorkspaces();
|
|
350
|
+
|
|
351
|
+
// Companion-device picker (Lantern): compact rows for only the
|
|
352
|
+
// workspaces a paired device could enter — no device credential needed
|
|
353
|
+
const deviceWorkspaces = await client.getDeviceAdmissibleWorkspaces();
|
|
354
|
+
|
|
356
355
|
// Export/import full workspace configuration
|
|
357
356
|
const config = await client.exportWorkspace(workspaceId);
|
|
358
357
|
const preview = await client.previewWorkspaceImport(targetId, config);
|
|
@@ -480,3 +479,53 @@ configured for that use.
|
|
|
480
479
|
## License
|
|
481
480
|
|
|
482
481
|
MIT
|
|
482
|
+
|
|
483
|
+
### Changing interaction mode within a Chat
|
|
484
|
+
|
|
485
|
+
A Chat retains its transport while an interaction session selects text,
|
|
486
|
+
push-to-talk, or realtime bidirectional voice. Keep one controller per client
|
|
487
|
+
session and Chat; independent devices should use separate controllers.
|
|
488
|
+
|
|
489
|
+
```ts
|
|
490
|
+
import { ChatInteractionController } from '@gravity-rail/sdk';
|
|
491
|
+
|
|
492
|
+
const interaction = new ChatInteractionController(client, workspaceId, chatId);
|
|
493
|
+
const textSession = await interaction.ensure('text');
|
|
494
|
+
const recordedVoiceSession = await interaction.ensure('push_to_talk');
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
Pass the selected session's `id` as `interactionSessionId` and a new UUID as
|
|
498
|
+
`interactionTurnId` on an AG-UI user turn. Send both fields together. The server
|
|
499
|
+
checks the Chat and authenticated actor and derives the mode from the stored
|
|
500
|
+
session. The controller serializes transitions and reuses request IDs after
|
|
501
|
+
uncertain network failures. Session metadata does not itself open a microphone
|
|
502
|
+
or establish a realtime connection.
|
|
503
|
+
|
|
504
|
+
New browser Chat creation accepts `interactionMode: 'realtime'` for an initial
|
|
505
|
+
voice greeting while retaining `channel: 'web-chat'`. `browserChannel` remains a
|
|
506
|
+
deprecated create-only alias. Omit both provenance fields for legacy AG-UI
|
|
507
|
+
clients; historical Messages are not assigned a mode by guessing from channel
|
|
508
|
+
or content. Message responses expose nullable `interactionSessionId`,
|
|
509
|
+
`interactionMode`, and `interactionTurnId` so audio and transcript components
|
|
510
|
+
can follow the same logical turn.
|
|
511
|
+
|
|
512
|
+
### Converting a Start Task opening message
|
|
513
|
+
|
|
514
|
+
The workflow client exposes the conservative, draft-only opening conversion.
|
|
515
|
+
Inspect eligibility first, then pass the reported rule id back as an optimistic
|
|
516
|
+
concurrency guard:
|
|
517
|
+
|
|
518
|
+
```ts
|
|
519
|
+
const report = await client.getWorkflowOpeningTurnConversionReport(workspaceId, workflowId);
|
|
520
|
+
if (report.canConvert && report.convertibleRuleId !== null) {
|
|
521
|
+
await client.convertWorkflowStartTaskOpeningMessage(
|
|
522
|
+
workspaceId,
|
|
523
|
+
workflowId,
|
|
524
|
+
report.convertibleRuleId
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
Conversion refuses multiple emitters, conditional or templated messages,
|
|
530
|
+
direction variants, conflicting Greeting defaults, and other shapes that
|
|
531
|
+
cannot be moved without changing behavior.
|
package/dist/agui.d.cts
CHANGED
package/dist/agui.d.ts
CHANGED
package/dist/audio.d.cts
CHANGED
package/dist/audio.d.ts
CHANGED