@amigo-ai/platform-sdk 0.26.0 → 0.29.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 (110) hide show
  1. package/README.md +62 -0
  2. package/api.md +170 -1
  3. package/dist/index.cjs +1081 -5
  4. package/dist/index.cjs.map +4 -4
  5. package/dist/index.js +78 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +1081 -5
  8. package/dist/index.mjs.map +4 -4
  9. package/dist/resources/analytics.js +20 -0
  10. package/dist/resources/analytics.js.map +1 -1
  11. package/dist/resources/briefs.js +34 -0
  12. package/dist/resources/briefs.js.map +1 -0
  13. package/dist/resources/calls.js +22 -0
  14. package/dist/resources/calls.js.map +1 -1
  15. package/dist/resources/command-center.js +17 -0
  16. package/dist/resources/command-center.js.map +1 -0
  17. package/dist/resources/crm.js +52 -0
  18. package/dist/resources/crm.js.map +1 -0
  19. package/dist/resources/data-query.js +22 -0
  20. package/dist/resources/data-query.js.map +1 -0
  21. package/dist/resources/desktop-sessions.js +43 -0
  22. package/dist/resources/desktop-sessions.js.map +1 -0
  23. package/dist/resources/fhir.js +130 -0
  24. package/dist/resources/fhir.js.map +1 -0
  25. package/dist/resources/insights.js +53 -0
  26. package/dist/resources/insights.js.map +1 -0
  27. package/dist/resources/intake.js +42 -0
  28. package/dist/resources/intake.js.map +1 -0
  29. package/dist/resources/me.js +46 -0
  30. package/dist/resources/me.js.map +1 -0
  31. package/dist/resources/monitor-concepts.js +47 -0
  32. package/dist/resources/monitor-concepts.js.map +1 -0
  33. package/dist/resources/network.js +17 -0
  34. package/dist/resources/network.js.map +1 -0
  35. package/dist/resources/pipeline.js +69 -0
  36. package/dist/resources/pipeline.js.map +1 -0
  37. package/dist/resources/sensorium.js +25 -0
  38. package/dist/resources/sensorium.js.map +1 -0
  39. package/dist/resources/sessions.js +29 -0
  40. package/dist/resources/sessions.js.map +1 -0
  41. package/dist/resources/settings.js +17 -0
  42. package/dist/resources/settings.js.map +1 -1
  43. package/dist/resources/simulations.js +75 -0
  44. package/dist/resources/simulations.js.map +1 -1
  45. package/dist/resources/surfaces.js +85 -0
  46. package/dist/resources/surfaces.js.map +1 -0
  47. package/dist/resources/tasks.js +23 -0
  48. package/dist/resources/tasks.js.map +1 -0
  49. package/dist/resources/tools.js +24 -0
  50. package/dist/resources/tools.js.map +1 -0
  51. package/dist/resources/unification-rules.js +46 -0
  52. package/dist/resources/unification-rules.js.map +1 -0
  53. package/dist/resources/workspaces.js +33 -10
  54. package/dist/resources/workspaces.js.map +1 -1
  55. package/dist/types/generated/api.d.ts +172 -118
  56. package/dist/types/generated/api.d.ts.map +1 -1
  57. package/dist/types/index.d.cts +53 -0
  58. package/dist/types/index.d.cts.map +1 -1
  59. package/dist/types/index.d.ts +53 -0
  60. package/dist/types/index.d.ts.map +1 -1
  61. package/dist/types/resources/analytics.d.ts +26 -0
  62. package/dist/types/resources/analytics.d.ts.map +1 -1
  63. package/dist/types/resources/briefs.d.ts +79 -0
  64. package/dist/types/resources/briefs.d.ts.map +1 -0
  65. package/dist/types/resources/calls.d.ts +93 -9
  66. package/dist/types/resources/calls.d.ts.map +1 -1
  67. package/dist/types/resources/command-center.d.ts +55 -0
  68. package/dist/types/resources/command-center.d.ts.map +1 -0
  69. package/dist/types/resources/crm.d.ts +207 -0
  70. package/dist/types/resources/crm.d.ts.map +1 -0
  71. package/dist/types/resources/data-query.d.ts +23 -0
  72. package/dist/types/resources/data-query.d.ts.map +1 -0
  73. package/dist/types/resources/desktop-sessions.d.ts +38 -0
  74. package/dist/types/resources/desktop-sessions.d.ts.map +1 -0
  75. package/dist/types/resources/fhir.d.ts +350 -0
  76. package/dist/types/resources/fhir.d.ts.map +1 -0
  77. package/dist/types/resources/functions.d.ts.map +1 -1
  78. package/dist/types/resources/insights.d.ts +56 -0
  79. package/dist/types/resources/insights.d.ts.map +1 -0
  80. package/dist/types/resources/intake.d.ts +59 -0
  81. package/dist/types/resources/intake.d.ts.map +1 -0
  82. package/dist/types/resources/me.d.ts +54 -0
  83. package/dist/types/resources/me.d.ts.map +1 -0
  84. package/dist/types/resources/metrics.d.ts.map +1 -1
  85. package/dist/types/resources/monitor-concepts.d.ts +115 -0
  86. package/dist/types/resources/monitor-concepts.d.ts.map +1 -0
  87. package/dist/types/resources/network.d.ts +17 -0
  88. package/dist/types/resources/network.d.ts.map +1 -0
  89. package/dist/types/resources/operators.d.ts.map +1 -1
  90. package/dist/types/resources/pipeline.d.ts +183 -0
  91. package/dist/types/resources/pipeline.d.ts.map +1 -0
  92. package/dist/types/resources/sensorium.d.ts +40 -0
  93. package/dist/types/resources/sensorium.d.ts.map +1 -0
  94. package/dist/types/resources/sessions.d.ts +33 -0
  95. package/dist/types/resources/sessions.d.ts.map +1 -0
  96. package/dist/types/resources/settings.d.ts +16 -0
  97. package/dist/types/resources/settings.d.ts.map +1 -1
  98. package/dist/types/resources/simulations.d.ts +186 -3
  99. package/dist/types/resources/simulations.d.ts.map +1 -1
  100. package/dist/types/resources/surfaces.d.ts +240 -0
  101. package/dist/types/resources/surfaces.d.ts.map +1 -0
  102. package/dist/types/resources/tasks.d.ts +55 -0
  103. package/dist/types/resources/tasks.d.ts.map +1 -0
  104. package/dist/types/resources/tools.d.ts +53 -0
  105. package/dist/types/resources/tools.d.ts.map +1 -0
  106. package/dist/types/resources/unification-rules.d.ts +129 -0
  107. package/dist/types/resources/unification-rules.d.ts.map +1 -0
  108. package/dist/types/resources/workspaces.d.ts +32 -17
  109. package/dist/types/resources/workspaces.d.ts.map +1 -1
  110. package/package.json +1 -1
package/README.md CHANGED
@@ -446,6 +446,68 @@ const url = client.conversations.textStreamUrl({ serviceId: 'service-id', token:
446
446
  const socket = new WebSocket(url)
447
447
  ```
448
448
 
449
+ ### Real-time event streams
450
+
451
+ For workspace-wide events (calls, surfaces, pipeline, operators, channels), use the typed SSE consumer:
452
+
453
+ ```typescript
454
+ const handle = client.events.subscribeToWorkspace({
455
+ onEvent: (event) => {
456
+ switch (event.event_type) {
457
+ case 'call.started': console.log('call started:', event.call_sid); break
458
+ case 'pipeline.error': console.error('pipeline error:', event); break
459
+ }
460
+ },
461
+ onError: (err) => console.error('terminal:', err),
462
+ onReconnect: (attempt) => console.warn(`reconnect #${attempt}`),
463
+ })
464
+
465
+ // Later: handle.unsubscribe(); await handle.done
466
+ ```
467
+
468
+ The helper handles automatic reconnect (exp backoff with jitter, server-sent
469
+ `retry:` honored), gapless replay via `Last-Event-ID`, and discriminated-union
470
+ dispatch. Server emits a structured `error` frame with a stable `code` on
471
+ terminal failures — narrow with the typed error guard:
472
+
473
+ ```typescript
474
+ import { isWorkspaceEventStreamError } from '@amigo-ai/platform-sdk'
475
+
476
+ onError: (err) => {
477
+ if (isWorkspaceEventStreamError(err)) {
478
+ if (err.code === 'too_many_streams') {
479
+ // workspace has too many open streams; close another tab
480
+ } else if (err.retryable) {
481
+ // SDK already retried up to maxReconnects; safe to try again later
482
+ }
483
+ }
484
+ }
485
+ ```
486
+
487
+ For per-call voice observation (`agent_transcript_delta`, `latency`, `session_*`,
488
+ `participant_*`, etc.), use the WebSocket-based observer helper:
489
+
490
+ ```typescript
491
+ const observerHandle = client.observers.subscribe({
492
+ callSid: 'CAxxx',
493
+ token: bearerToken,
494
+ onEvent: (event) => {
495
+ switch (event.type) {
496
+ case 'agent_transcript_delta': renderAgentDelta(event.delta); break
497
+ case 'session_end': showSummary(event); break
498
+ }
499
+ },
500
+ onError: (err) => console.error('observer terminal:', err.reason, err.closeCode),
501
+ })
502
+ ```
503
+
504
+ Both helpers are built on the shared `ReconnectingWebSocket` primitive, which
505
+ maps platform-specific WebSocket close codes (4001 client error, 4029 rate
506
+ limit, 4403 auth, 4100 token expired) to a typed reason taxonomy and applies an
507
+ idle watchdog (default 45s) so a half-dead socket forces a reconnect rather
508
+ than hanging indefinitely. Compose it directly via `createReconnectingWebSocket`
509
+ when you need a managed WebSocket outside these resources.
510
+
449
511
  ### Analytics
450
512
 
451
513
  ```typescript
package/api.md CHANGED
@@ -66,7 +66,6 @@ All workspace-scoped resources also expose `withOptions(options)`.
66
66
 
67
67
  ### `workspaces`
68
68
 
69
- - `createSelfService`
70
69
  - `list`
71
70
  - `listAutoPaging`
72
71
  - `get`
@@ -75,6 +74,12 @@ All workspace-scoped resources also expose `withOptions(options)`.
75
74
  - `provision`
76
75
  - `checkEnvironment`
77
76
  - `convertEnvironment`
77
+ - `testCallerNumbers.get`
78
+ - `testCallerNumbers.update`
79
+
80
+ ### `me`
81
+
82
+ - `createWorkspace`
78
83
 
79
84
  ### `apiKeys`
80
85
 
@@ -230,6 +235,9 @@ All workspace-scoped resources also expose `withOptions(options)`.
230
235
  - `getBenchmarks`
231
236
  - `getPhoneVolume`
232
237
  - `getTraceAnalysis`
238
+ - `listTraces`
239
+ - `getMetrics`
240
+ - `createOutbound`
233
241
 
234
242
  ### `conversations`
235
243
 
@@ -282,6 +290,10 @@ All workspace-scoped resources also expose `withOptions(options)`.
282
290
  - `getOperatorPerformance`
283
291
  - `getAdvancedCallStats`
284
292
  - `compareCallPeriods`
293
+ - `surfaces.getCompletionRates`
294
+ - `surfaces.getChannelEffectiveness`
295
+ - `surfaces.getFieldAbandonment`
296
+ - `surfaces.getForEntity`
285
297
 
286
298
  ### `simulations`
287
299
 
@@ -291,6 +303,18 @@ All workspace-scoped resources also expose `withOptions(options)`.
291
303
  - `step`
292
304
  - `recommend`
293
305
  - `getIntelligence`
306
+ - `runs.list`
307
+ - `runs.create`
308
+ - `runs.get`
309
+ - `runs.complete`
310
+ - `runs.createSession`
311
+ - `bridge.plan`
312
+ - `bridge.run`
313
+ - `services.getGraph`
314
+ - `services.deleteGraph`
315
+ - `services.getGraphPaths`
316
+ - `services.listSessions`
317
+ - `services.listTurns`
294
318
 
295
319
  ### `metrics`
296
320
 
@@ -317,6 +341,8 @@ All workspace-scoped resources also expose `withOptions(options)`.
317
341
  - `behaviors.update`
318
342
  - `gapScanner.get`
319
343
  - `gapScanner.update`
344
+ - `gapScanner.preview`
345
+ - `gapScanner.scan`
320
346
  - `scribe.get`
321
347
  - `scribe.update`
322
348
  - `metrics.get`
@@ -434,4 +460,147 @@ All workspace-scoped resources also expose `withOptions(options)`.
434
460
 
435
461
  - `subscribe`
436
462
 
463
+ ### `fhir`
464
+
465
+ - `getStatus`
466
+ - `getSyncFailures`
467
+ - `import`
468
+ - `searchPatients`
469
+ - `getPatientSummary`
470
+ - `getPatientTimeline`
471
+ - `resources.search`
472
+ - `resources.create`
473
+ - `resources.get`
474
+ - `resources.update`
475
+ - `resources.getHistory`
476
+ - `views.patients`
477
+ - `views.appointments`
478
+ - `views.practitioners`
479
+ - `views.organizations`
480
+ - `views.locations`
481
+ - `views.slots`
482
+
483
+ ### `insights`
484
+
485
+ - `getDigest`
486
+ - `getSchema`
487
+ - `getSuggestions`
488
+ - `runSql`
489
+ - `sessions.create`
490
+ - `sessions.get`
491
+ - `sessions.chat`
492
+
493
+ ### `monitorConcepts`
494
+
495
+ - `create`
496
+ - `list`
497
+ - `listAutoPaging`
498
+ - `get`
499
+ - `update`
500
+ - `delete`
501
+
502
+ ### `unificationRules`
503
+
504
+ - `create`
505
+ - `list`
506
+ - `listAutoPaging`
507
+ - `get`
508
+ - `update`
509
+ - `delete`
510
+
511
+ ### `crm`
512
+
513
+ - `getStatus`
514
+ - `contacts.list`
515
+ - `contacts.get`
516
+ - `contacts.getTimeline`
517
+ - `companies.list`
518
+ - `companies.get`
519
+ - `deals.list`
520
+ - `deals.get`
521
+ - `deals.getPipeline`
522
+
523
+ ### `commandCenter`
524
+
525
+ - `get`
526
+
527
+ ### `sensorium`
528
+
529
+ - `getConnectorHealth`
530
+ - `getLoopLatency`
531
+
532
+ ### `dataQuery`
533
+
534
+ - `run`
535
+
536
+ ### `briefs`
537
+
538
+ - `get`
539
+ - `regenerate`
540
+ - `getForEntity`
541
+ - `regenerateForEntity`
542
+
543
+ ### `desktopSessions`
544
+
545
+ - `create`
546
+ - `disconnect`
547
+ - `sendAction`
548
+ - `getScreenshot`
549
+ - `getStatus`
550
+
551
+ ### `intake`
552
+
553
+ - `links.list`
554
+ - `links.create`
555
+ - `links.delete`
556
+ - `links.listUploads`
557
+ - `links.downloadUpload`
558
+
559
+ ### `network`
560
+
561
+ - `getEgressIps`
562
+
563
+ ### `pipeline`
564
+
565
+ - `getStatus`
566
+ - `getThroughput`
567
+ - `getReview`
568
+ - `getEntityResolution`
569
+ - `outbound.list`
570
+ - `outbound.getLog`
571
+ - `sources.list`
572
+ - `sources.getOverview`
573
+ - `sources.listEvents`
574
+ - `sources.getHistory`
575
+
576
+ ### `tasks`
577
+
578
+ - `get`
579
+ - `listByCall`
580
+
581
+ ### `tools`
582
+
583
+ - `execute`
584
+ - `resolveForService`
585
+
586
+ ### `surfaces`
587
+
588
+ - `list`
589
+ - `listAutoPaging`
590
+ - `listForReview`
591
+ - `create`
592
+ - `get`
593
+ - `update`
594
+ - `archive`
595
+ - `deliver`
596
+ - `getProgress`
597
+ - `approve`
598
+ - `reject`
599
+ - `reshape`
600
+
601
+ ### `sessions`
602
+
603
+ - `listActive`
604
+ - `inject`
605
+
437
606
  ### `api`