@amigo-ai/platform-sdk 0.50.0 → 0.51.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
@@ -359,8 +359,6 @@ All workspace-scoped resources also expose `withOptions(options)`.
359
359
  - `gapScanner.update`
360
360
  - `gapScanner.preview`
361
361
  - `gapScanner.scan`
362
- - `scribe.get`
363
- - `scribe.update`
364
362
  - `metrics.get`
365
363
  - `metrics.update`
366
364
  - `environments.get`
@@ -631,6 +629,10 @@ All workspace-scoped resources also expose `withOptions(options)`.
631
629
 
632
630
  ### `workspaceDatabase`
633
631
 
632
+ - `get`
633
+ - `post`
634
+ - `patch`
635
+ - `delete`
634
636
  - `getFork`
635
637
  - `createFork`
636
638
  - `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``.
@@ -3293,19 +3293,6 @@ var SettingsResource = class extends WorkspaceScopedResource {
3293
3293
  })
3294
3294
  )
3295
3295
  };
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
3296
  metrics = {
3310
3297
  get: async () => extractData(
3311
3298
  await this.client.GET("/v1/{workspace_id}/settings/metrics", {
@@ -5682,31 +5669,43 @@ var SessionsResource = class extends WorkspaceScopedResource {
5682
5669
 
5683
5670
  // src/resources/workspace-database.ts
5684
5671
  var WorkspaceDatabaseResource = class extends WorkspaceScopedResource {
5672
+ get(path, init) {
5673
+ return this.client.GET(path, init);
5674
+ }
5675
+ post(path, init) {
5676
+ return this.client.POST(path, init);
5677
+ }
5678
+ patch(path, init) {
5679
+ return this.client.PATCH(path, init);
5680
+ }
5681
+ delete(path, init) {
5682
+ return this.client.DELETE(path, init);
5683
+ }
5685
5684
  // -- Fork lifecycle -------------------------------------------------------
5686
5685
  async getFork() {
5687
5686
  return extractData(
5688
- await this.client.GET("/v1/{workspace_id}/fork", {
5687
+ await this.get("/v1/{workspace_id}/fork", {
5689
5688
  params: { path: { workspace_id: this.workspaceId } }
5690
5689
  })
5691
5690
  );
5692
5691
  }
5693
5692
  async createFork(body) {
5694
5693
  return extractData(
5695
- await this.client.POST("/v1/{workspace_id}/fork", {
5694
+ await this.post("/v1/{workspace_id}/fork", {
5696
5695
  params: { path: { workspace_id: this.workspaceId } },
5697
5696
  body
5698
5697
  })
5699
5698
  );
5700
5699
  }
5701
5700
  async deleteFork() {
5702
- await this.client.DELETE("/v1/{workspace_id}/fork", {
5701
+ await this.delete("/v1/{workspace_id}/fork", {
5703
5702
  params: { path: { workspace_id: this.workspaceId } }
5704
5703
  });
5705
5704
  }
5706
5705
  // -- Query execution ------------------------------------------------------
5707
5706
  async executeQuery(body) {
5708
5707
  return extractData(
5709
- await this.client.POST("/v1/{workspace_id}/lakebase/query", {
5708
+ await this.post("/v1/{workspace_id}/lakebase/query", {
5710
5709
  params: { path: { workspace_id: this.workspaceId } },
5711
5710
  body
5712
5711
  })
@@ -5715,7 +5714,7 @@ var WorkspaceDatabaseResource = class extends WorkspaceScopedResource {
5715
5714
  // -- Query tool CRUD ------------------------------------------------------
5716
5715
  async listQueryTools(params) {
5717
5716
  return extractData(
5718
- await this.client.GET("/v1/{workspace_id}/query-tools", {
5717
+ await this.get("/v1/{workspace_id}/query-tools", {
5719
5718
  params: { path: { workspace_id: this.workspaceId }, query: params }
5720
5719
  })
5721
5720
  );
@@ -5725,7 +5724,7 @@ var WorkspaceDatabaseResource = class extends WorkspaceScopedResource {
5725
5724
  }
5726
5725
  async createQueryTool(body) {
5727
5726
  return extractData(
5728
- await this.client.POST("/v1/{workspace_id}/query-tools", {
5727
+ await this.post("/v1/{workspace_id}/query-tools", {
5729
5728
  params: { path: { workspace_id: this.workspaceId } },
5730
5729
  body
5731
5730
  })
@@ -5733,20 +5732,20 @@ var WorkspaceDatabaseResource = class extends WorkspaceScopedResource {
5733
5732
  }
5734
5733
  async updateQueryTool(toolId, body) {
5735
5734
  return extractData(
5736
- await this.client.PATCH("/v1/{workspace_id}/query-tools/{tool_id}", {
5735
+ await this.patch("/v1/{workspace_id}/query-tools/{tool_id}", {
5737
5736
  params: { path: { workspace_id: this.workspaceId, tool_id: toolId } },
5738
5737
  body
5739
5738
  })
5740
5739
  );
5741
5740
  }
5742
5741
  async deleteQueryTool(toolId) {
5743
- await this.client.DELETE("/v1/{workspace_id}/query-tools/{tool_id}", {
5742
+ await this.delete("/v1/{workspace_id}/query-tools/{tool_id}", {
5744
5743
  params: { path: { workspace_id: this.workspaceId, tool_id: toolId } }
5745
5744
  });
5746
5745
  }
5747
5746
  async testQueryTool(toolId, body) {
5748
5747
  return extractData(
5749
- await this.client.POST("/v1/{workspace_id}/query-tools/{tool_id}/test", {
5748
+ await this.post("/v1/{workspace_id}/query-tools/{tool_id}/test", {
5750
5749
  params: { path: { workspace_id: this.workspaceId, tool_id: toolId } },
5751
5750
  body
5752
5751
  })