@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.
Files changed (55) hide show
  1. package/README.md +57 -8
  2. package/dist/agui.d.cts +1 -1
  3. package/dist/agui.d.ts +1 -1
  4. package/dist/audio.d.cts +1 -1
  5. package/dist/audio.d.ts +1 -1
  6. package/dist/{client-B0eh2BEY.d.cts → chat-interaction-BKdImgZ5.d.ts} +8006 -3570
  7. package/dist/{client-CFz-BGmY.d.ts → chat-interaction-DLfC_h_P.d.cts} +8006 -3570
  8. package/dist/{chunk-3HAV5XUJ.js → chunk-HRUMZ46V.js} +1 -1
  9. package/dist/chunk-HRUMZ46V.js.map +1 -0
  10. package/dist/{chunk-24L4RD4Z.js → chunk-N446FGCT.js} +1247 -203
  11. package/dist/chunk-N446FGCT.js.map +1 -0
  12. package/dist/{chunk-7OLBLLV7.js → chunk-P2E6LU7I.js} +57 -7
  13. package/dist/chunk-P2E6LU7I.js.map +1 -0
  14. package/dist/helpers.cjs +54 -1
  15. package/dist/helpers.cjs.map +1 -1
  16. package/dist/helpers.d.cts +3 -2
  17. package/dist/helpers.d.ts +3 -2
  18. package/dist/helpers.js +11 -3
  19. package/dist/helpers.js.map +1 -1
  20. package/dist/index.cjs +2302 -144
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +509 -6
  23. package/dist/index.d.ts +509 -6
  24. package/dist/index.js +1032 -23
  25. package/dist/index.js.map +1 -1
  26. package/dist/internal.cjs +1337 -222
  27. package/dist/internal.cjs.map +1 -1
  28. package/dist/internal.d.cts +33 -49
  29. package/dist/internal.d.ts +33 -49
  30. package/dist/internal.js +73 -33
  31. package/dist/internal.js.map +1 -1
  32. package/dist/realtime.cjs +279 -14
  33. package/dist/realtime.cjs.map +1 -1
  34. package/dist/realtime.d.cts +169 -17
  35. package/dist/realtime.d.ts +169 -17
  36. package/dist/realtime.js +264 -13
  37. package/dist/realtime.js.map +1 -1
  38. package/dist/{revision-state-fJ9PM15N.d.cts → revision-state-Bsq5dKwi.d.cts} +236 -5
  39. package/dist/{revision-state-KfOztBkY.d.ts → revision-state-CQTYcIRG.d.ts} +236 -5
  40. package/dist/schemas.cjs +3 -1
  41. package/dist/schemas.cjs.map +1 -1
  42. package/dist/schemas.d.cts +31 -13
  43. package/dist/schemas.d.ts +31 -13
  44. package/dist/schemas.js +4 -2
  45. package/dist/schemas.js.map +1 -1
  46. package/dist/{tasks-WH_VfzMv.d.cts → tasks-B-31JPuq.d.cts} +298 -114
  47. package/dist/{tasks-WH_VfzMv.d.ts → tasks-B-31JPuq.d.ts} +298 -114
  48. package/dist/types-0c6_NGU4.d.cts +90 -0
  49. package/dist/types-0c6_NGU4.d.ts +90 -0
  50. package/package.json +3 -3
  51. package/dist/chunk-24L4RD4Z.js.map +0 -1
  52. package/dist/chunk-3HAV5XUJ.js.map +0 -1
  53. package/dist/chunk-7OLBLLV7.js.map +0 -1
  54. package/dist/types-DkYyrvoC.d.cts +0 -19
  55. 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
@@ -1,4 +1,4 @@
1
- import { C as ChannelEvent } from './types-DkYyrvoC.cjs';
1
+ import { C as ChannelEvent } from './types-0c6_NGU4.cjs';
2
2
 
3
3
  interface TranscriptMessage {
4
4
  id: string;
package/dist/agui.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as ChannelEvent } from './types-DkYyrvoC.js';
1
+ import { C as ChannelEvent } from './types-0c6_NGU4.js';
2
2
 
3
3
  interface TranscriptMessage {
4
4
  id: string;
package/dist/audio.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as ChannelEvent } from './types-DkYyrvoC.cjs';
1
+ import { C as ChannelEvent } from './types-0c6_NGU4.cjs';
2
2
 
3
3
  /** PCM16 helpers aligned with main-app web voice (24 kHz). */
4
4
  declare const SERVER_SAMPLE_RATE = 24000;
package/dist/audio.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as ChannelEvent } from './types-DkYyrvoC.js';
1
+ import { C as ChannelEvent } from './types-0c6_NGU4.js';
2
2
 
3
3
  /** PCM16 helpers aligned with main-app web voice (24 kHz). */
4
4
  declare const SERVER_SAMPLE_RATE = 24000;