@amigo-ai/platform-sdk 0.50.0 → 0.52.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 CHANGED
@@ -47,10 +47,9 @@ The SDK is the typed client boundary between your runtime and the workspace-scop
47
47
 
48
48
  ### Guides
49
49
 
50
- | Guide | Description |
51
- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
52
- | [Build a Custom Patient Form](./docs/guides/build-a-form.md) | Create, deliver, and render patient intake forms using surfaces |
53
- | [Build a Custom Clinical Copilot](./docs/guides/build-a-scribe.md) | Real-time ambient documentation with encounter review and voiceprint enrollment |
50
+ | Guide | Description |
51
+ | ------------------------------------------------------------ | --------------------------------------------------------------- |
52
+ | [Build a Custom Patient Form](./docs/guides/build-a-form.md) | Create, deliver, and render patient intake forms using surfaces |
54
53
 
55
54
  The docs site remains the primary reference. The repo-local examples stay close to the shipped package surface and are typechecked in CI to reduce drift.
56
55
 
@@ -454,8 +453,12 @@ For workspace-wide events (calls, surfaces, pipeline, operators, channels), use
454
453
  const handle = client.events.subscribeToWorkspace({
455
454
  onEvent: (event) => {
456
455
  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
456
+ case 'call.started':
457
+ console.log('call started:', event.call_sid)
458
+ break
459
+ case 'pipeline.error':
460
+ console.error('pipeline error:', event)
461
+ break
459
462
  }
460
463
  },
461
464
  onError: (err) => console.error('terminal:', err),
@@ -493,8 +496,12 @@ const observerHandle = client.observers.subscribe({
493
496
  token: bearerToken,
494
497
  onEvent: (event) => {
495
498
  switch (event.type) {
496
- case 'agent_transcript_delta': renderAgentDelta(event.delta); break
497
- case 'session_end': showSummary(event); break
499
+ case 'agent_transcript_delta':
500
+ renderAgentDelta(event.delta)
501
+ break
502
+ case 'session_end':
503
+ showSummary(event)
504
+ break
498
505
  }
499
506
  },
500
507
  onError: (err) => console.error('observer terminal:', err.reason, err.closeCode),
@@ -624,39 +631,6 @@ const { data: rates } = await client.GET(
624
631
 
625
632
  Public token routes (`/s/{token}/spec`, `/s/{token}/submit`, etc.) require no API key -- use `openapi-fetch` with the SDK's `paths` type for full type safety on unauthenticated endpoints.
626
633
 
627
- ### Scribe (Clinical Copilot)
628
-
629
- Build ambient clinical documentation tools. The SDK covers encounter review actions and scribe settings. The real-time copilot WebSocket (`/copilot-stream`) is documented in the full guide: [Build a Custom Clinical Copilot](./docs/guides/build-a-scribe.md).
630
-
631
- ```typescript
632
- // Configure scribe settings
633
- const settings = await client.settings.scribe.get()
634
- await client.settings.scribe.update({
635
- enabled: true,
636
- soap_style: 'detailed',
637
- language: 'es',
638
- keyterms: ['metformin', 'Ozempic', 'Dr. Ramirez'],
639
- specialty: 'Primary care',
640
- })
641
-
642
- // Approve ICD-10 codes after physician review
643
- await client.POST('/v1/{workspace_id}/scribe/encounters/{encounter_id}/icd10/approve', {
644
- params: { path: { encounter_id: encounterId } },
645
- body: { code: 'J06.9' },
646
- })
647
-
648
- // Edit SOAP notes
649
- await client.POST('/v1/{workspace_id}/scribe/encounters/{encounter_id}/soap/edit', {
650
- params: { path: { encounter_id: encounterId } },
651
- body: { section: 'assessment', content: 'Acute upper respiratory infection...' },
652
- })
653
-
654
- // Finalize for EHR sync
655
- await client.POST('/v1/{workspace_id}/scribe/encounters/{encounter_id}/finalize', {
656
- params: { path: { encounter_id: encounterId } },
657
- })
658
- ```
659
-
660
634
  ### Billing
661
635
 
662
636
  ```typescript
package/api.md CHANGED
@@ -349,8 +349,6 @@ All workspace-scoped resources also expose `withOptions(options)`.
349
349
  - `outreach.update`
350
350
  - `memory.get`
351
351
  - `memory.update`
352
- - `security.get`
353
- - `security.update`
354
352
  - `retention.get`
355
353
  - `retention.update`
356
354
  - `behaviors.get`
@@ -359,8 +357,6 @@ All workspace-scoped resources also expose `withOptions(options)`.
359
357
  - `gapScanner.update`
360
358
  - `gapScanner.preview`
361
359
  - `gapScanner.scan`
362
- - `scribe.get`
363
- - `scribe.update`
364
360
  - `metrics.get`
365
361
  - `metrics.update`
366
362
  - `environments.get`
@@ -631,6 +627,10 @@ All workspace-scoped resources also expose `withOptions(options)`.
631
627
 
632
628
  ### `workspaceDatabase`
633
629
 
630
+ - `get`
631
+ - `post`
632
+ - `patch`
633
+ - `delete`
634
634
  - `getFork`
635
635
  - `createFork`
636
636
  - `deleteFork`
@@ -29,8 +29,8 @@
29
29
  <text x="152" y="121" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">Phone, text, simulation</text>
30
30
 
31
31
  <rect x="268" y="78" width="200" height="60" rx="8" fill="white" fill-opacity="0.1" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
32
- <text x="368" y="103" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Clinical Copilot</text>
33
- <text x="368" y="121" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">SOAP, ICD-10, CDS</text>
32
+ <text x="368" y="103" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Clinical Data</text>
33
+ <text x="368" y="121" text-anchor="middle" font-family="Inter, sans-serif" font-size="12" fill="white" fill-opacity="0.7">FHIR, encounters, CDS</text>
34
34
 
35
35
  <rect x="484" y="78" width="200" height="60" rx="8" fill="white" fill-opacity="0.08" stroke="url(#strokeGradSubtle)" stroke-width="0.75"/>
36
36
  <text x="584" y="103" text-anchor="middle" font-family="'Flecha S', Georgia, serif" font-size="16" fill="white" fill-opacity="0.95">Emotion Engine</text>
package/dist/index.cjs CHANGED
@@ -1528,7 +1528,7 @@ var PromptLogsResource = class extends WorkspaceScopedResource {
1528
1528
  *
1529
1529
  * When ``params.conversation_id`` is supplied, the response surfaces
1530
1530
  * ``resolved_call_sid`` (the call_sid the lookup mapped to) and
1531
- * ``resolved_conversation_kind`` (``"call"`` for voice/sim/scribe,
1531
+ * ``resolved_conversation_kind`` (``"call"`` for voice/sim,
1532
1532
  * ``"conversation"`` for text/sms/whatsapp/email) so you can drill
1533
1533
  * into per-call surfaces afterward without re-querying
1534
1534
  * ``world.entities``.
@@ -3220,19 +3220,6 @@ var SettingsResource = class extends WorkspaceScopedResource {
3220
3220
  })
3221
3221
  )
3222
3222
  };
3223
- security = {
3224
- get: async () => extractData(
3225
- await this.client.GET("/v1/{workspace_id}/settings/security", {
3226
- params: { path: { workspace_id: this.workspaceId } }
3227
- })
3228
- ),
3229
- update: async (body) => extractData(
3230
- await this.client.PUT("/v1/{workspace_id}/settings/security", {
3231
- params: { path: { workspace_id: this.workspaceId } },
3232
- body
3233
- })
3234
- )
3235
- };
3236
3223
  retention = {
3237
3224
  get: async () => extractData(
3238
3225
  await this.client.GET("/v1/{workspace_id}/settings/retention", {
@@ -3293,19 +3280,6 @@ var SettingsResource = class extends WorkspaceScopedResource {
3293
3280
  })
3294
3281
  )
3295
3282
  };
3296
- scribe = {
3297
- get: async () => extractData(
3298
- await this.client.GET("/v1/{workspace_id}/settings/scribe", {
3299
- params: { path: { workspace_id: this.workspaceId } }
3300
- })
3301
- ),
3302
- update: async (body) => extractData(
3303
- await this.client.PUT("/v1/{workspace_id}/settings/scribe", {
3304
- params: { path: { workspace_id: this.workspaceId } },
3305
- body
3306
- })
3307
- )
3308
- };
3309
3283
  metrics = {
3310
3284
  get: async () => extractData(
3311
3285
  await this.client.GET("/v1/{workspace_id}/settings/metrics", {
@@ -5682,31 +5656,43 @@ var SessionsResource = class extends WorkspaceScopedResource {
5682
5656
 
5683
5657
  // src/resources/workspace-database.ts
5684
5658
  var WorkspaceDatabaseResource = class extends WorkspaceScopedResource {
5659
+ get(path, init) {
5660
+ return this.client.GET(path, init);
5661
+ }
5662
+ post(path, init) {
5663
+ return this.client.POST(path, init);
5664
+ }
5665
+ patch(path, init) {
5666
+ return this.client.PATCH(path, init);
5667
+ }
5668
+ delete(path, init) {
5669
+ return this.client.DELETE(path, init);
5670
+ }
5685
5671
  // -- Fork lifecycle -------------------------------------------------------
5686
5672
  async getFork() {
5687
5673
  return extractData(
5688
- await this.client.GET("/v1/{workspace_id}/fork", {
5674
+ await this.get("/v1/{workspace_id}/fork", {
5689
5675
  params: { path: { workspace_id: this.workspaceId } }
5690
5676
  })
5691
5677
  );
5692
5678
  }
5693
5679
  async createFork(body) {
5694
5680
  return extractData(
5695
- await this.client.POST("/v1/{workspace_id}/fork", {
5681
+ await this.post("/v1/{workspace_id}/fork", {
5696
5682
  params: { path: { workspace_id: this.workspaceId } },
5697
5683
  body
5698
5684
  })
5699
5685
  );
5700
5686
  }
5701
5687
  async deleteFork() {
5702
- await this.client.DELETE("/v1/{workspace_id}/fork", {
5688
+ await this.delete("/v1/{workspace_id}/fork", {
5703
5689
  params: { path: { workspace_id: this.workspaceId } }
5704
5690
  });
5705
5691
  }
5706
5692
  // -- Query execution ------------------------------------------------------
5707
5693
  async executeQuery(body) {
5708
5694
  return extractData(
5709
- await this.client.POST("/v1/{workspace_id}/lakebase/query", {
5695
+ await this.post("/v1/{workspace_id}/lakebase/query", {
5710
5696
  params: { path: { workspace_id: this.workspaceId } },
5711
5697
  body
5712
5698
  })
@@ -5715,7 +5701,7 @@ var WorkspaceDatabaseResource = class extends WorkspaceScopedResource {
5715
5701
  // -- Query tool CRUD ------------------------------------------------------
5716
5702
  async listQueryTools(params) {
5717
5703
  return extractData(
5718
- await this.client.GET("/v1/{workspace_id}/query-tools", {
5704
+ await this.get("/v1/{workspace_id}/query-tools", {
5719
5705
  params: { path: { workspace_id: this.workspaceId }, query: params }
5720
5706
  })
5721
5707
  );
@@ -5725,7 +5711,7 @@ var WorkspaceDatabaseResource = class extends WorkspaceScopedResource {
5725
5711
  }
5726
5712
  async createQueryTool(body) {
5727
5713
  return extractData(
5728
- await this.client.POST("/v1/{workspace_id}/query-tools", {
5714
+ await this.post("/v1/{workspace_id}/query-tools", {
5729
5715
  params: { path: { workspace_id: this.workspaceId } },
5730
5716
  body
5731
5717
  })
@@ -5733,20 +5719,20 @@ var WorkspaceDatabaseResource = class extends WorkspaceScopedResource {
5733
5719
  }
5734
5720
  async updateQueryTool(toolId, body) {
5735
5721
  return extractData(
5736
- await this.client.PATCH("/v1/{workspace_id}/query-tools/{tool_id}", {
5722
+ await this.patch("/v1/{workspace_id}/query-tools/{tool_id}", {
5737
5723
  params: { path: { workspace_id: this.workspaceId, tool_id: toolId } },
5738
5724
  body
5739
5725
  })
5740
5726
  );
5741
5727
  }
5742
5728
  async deleteQueryTool(toolId) {
5743
- await this.client.DELETE("/v1/{workspace_id}/query-tools/{tool_id}", {
5729
+ await this.delete("/v1/{workspace_id}/query-tools/{tool_id}", {
5744
5730
  params: { path: { workspace_id: this.workspaceId, tool_id: toolId } }
5745
5731
  });
5746
5732
  }
5747
5733
  async testQueryTool(toolId, body) {
5748
5734
  return extractData(
5749
- await this.client.POST("/v1/{workspace_id}/query-tools/{tool_id}/test", {
5735
+ await this.post("/v1/{workspace_id}/query-tools/{tool_id}/test", {
5750
5736
  params: { path: { workspace_id: this.workspaceId, tool_id: toolId } },
5751
5737
  body
5752
5738
  })