@amigo-ai/platform-sdk 0.5.2 → 0.5.3

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 (52) hide show
  1. package/README.md +81 -7
  2. package/api.md +3 -0
  3. package/dist/index.cjs +42 -10
  4. package/dist/index.cjs.map +2 -2
  5. package/dist/index.mjs +42 -10
  6. package/dist/index.mjs.map +2 -2
  7. package/dist/resources/base.js +7 -2
  8. package/dist/resources/base.js.map +1 -1
  9. package/dist/resources/operators.js.map +1 -1
  10. package/dist/resources/personas.js.map +1 -1
  11. package/dist/resources/webhook-destinations.js.map +1 -1
  12. package/dist/resources/workspaces.js +22 -0
  13. package/dist/resources/workspaces.js.map +1 -1
  14. package/dist/resources/world.js.map +1 -1
  15. package/dist/types/generated/api.d.ts +13373 -13213
  16. package/dist/types/generated/api.d.ts.map +1 -1
  17. package/dist/types/resources/actions.d.ts +166 -166
  18. package/dist/types/resources/agents.d.ts +88 -88
  19. package/dist/types/resources/analytics.d.ts +39 -39
  20. package/dist/types/resources/api-keys.d.ts +29 -29
  21. package/dist/types/resources/audit.d.ts +73 -73
  22. package/dist/types/resources/base.d.ts.map +1 -1
  23. package/dist/types/resources/billing.d.ts +36 -36
  24. package/dist/types/resources/calls.d.ts +106 -106
  25. package/dist/types/resources/compliance.d.ts +17 -17
  26. package/dist/types/resources/context-graphs.d.ts +643 -643
  27. package/dist/types/resources/data-sources.d.ts +81 -81
  28. package/dist/types/resources/functions.d.ts +22 -22
  29. package/dist/types/resources/functions.d.ts.map +1 -1
  30. package/dist/types/resources/integrations.d.ts +258 -258
  31. package/dist/types/resources/memory.d.ts +35 -35
  32. package/dist/types/resources/operators.d.ts +147 -147
  33. package/dist/types/resources/operators.d.ts.map +1 -1
  34. package/dist/types/resources/personas.d.ts +37 -37
  35. package/dist/types/resources/personas.d.ts.map +1 -1
  36. package/dist/types/resources/phone-numbers.d.ts +62 -62
  37. package/dist/types/resources/recordings.d.ts +9 -9
  38. package/dist/types/resources/review-queue.d.ts +331 -331
  39. package/dist/types/resources/safety.d.ts +33 -33
  40. package/dist/types/resources/services.d.ts +142 -142
  41. package/dist/types/resources/settings.d.ts +254 -254
  42. package/dist/types/resources/settings.d.ts.map +1 -1
  43. package/dist/types/resources/simulations.d.ts +73 -73
  44. package/dist/types/resources/skills.d.ts +163 -163
  45. package/dist/types/resources/triggers.d.ts +74 -74
  46. package/dist/types/resources/webhook-destinations.d.ts +57 -57
  47. package/dist/types/resources/webhook-destinations.d.ts.map +1 -1
  48. package/dist/types/resources/workspaces.d.ts +69 -35
  49. package/dist/types/resources/workspaces.d.ts.map +1 -1
  50. package/dist/types/resources/world.d.ts +216 -216
  51. package/dist/types/resources/world.d.ts.map +1 -1
  52. package/package.json +1 -1
package/README.md CHANGED
@@ -36,14 +36,21 @@ The SDK is the typed client boundary between your runtime and the workspace-scop
36
36
 
37
37
  ## Documentation
38
38
 
39
- | Need | Best entry point |
40
- | ------------------------------------------- | -------------------------------------------------------- |
41
- | Product architecture and deployment context | [docs.amigo.ai](https://docs.amigo.ai/) |
39
+ | Need | Best entry point |
40
+ | ------------------------------------------- | ---------------------------------------------------------------------------------- |
41
+ | Product architecture and deployment context | [docs.amigo.ai](https://docs.amigo.ai/) |
42
42
  | Tutorials and integration guidance | [Developer Guide](https://docs.amigo.ai/developer-guide/platform-api/platform-sdk) |
43
- | Endpoint-by-endpoint REST reference | [API Reference](https://docs.amigo.ai/api-reference) |
44
- | Repo-local SDK examples | [examples/README.md](./examples/README.md) |
45
- | Generated package surface | [api.md](./api.md) |
46
- | Published release history | [CHANGELOG.md](./CHANGELOG.md) |
43
+ | Endpoint-by-endpoint REST reference | [API Reference](https://docs.amigo.ai/api-reference) |
44
+ | Repo-local SDK examples | [examples/README.md](./examples/README.md) |
45
+ | Generated package surface | [api.md](./api.md) |
46
+ | Published release history | [CHANGELOG.md](./CHANGELOG.md) |
47
+
48
+ ### Guides
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 |
47
54
 
48
55
  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.
49
56
 
@@ -429,6 +436,73 @@ const memory = await client.settings.memory.get()
429
436
  console.log(memory.dimensions) // list of configured memory dimensions
430
437
  ```
431
438
 
439
+ ### Surfaces (Patient Forms)
440
+
441
+ Surfaces are workspace-scoped form specs for collecting patient data. Create a form, deliver it via SMS or email, and track completion. See the full guide: [Build a Custom Patient Form](./docs/guides/build-a-form.md).
442
+
443
+ ```typescript
444
+ // Create a patient intake form
445
+ const surface = await client.POST('/v1/{workspace_id}/surfaces', {
446
+ body: {
447
+ entity_id: patientId,
448
+ title: 'New Patient Intake',
449
+ channel: 'sms',
450
+ fields: [
451
+ { key: 'full_name', label: 'Full Name', field_type: 'text', required: true },
452
+ { key: 'date_of_birth', label: 'Date of Birth', field_type: 'date', required: true },
453
+ {
454
+ key: 'allergies',
455
+ label: 'Allergies',
456
+ field_type: 'multiselect',
457
+ options: ['Penicillin', 'Sulfa', 'None'],
458
+ },
459
+ ],
460
+ },
461
+ })
462
+ console.log(surface.data.url) // Patient-facing token URL
463
+
464
+ // Deliver via SMS
465
+ await client.POST('/v1/{workspace_id}/surfaces/{surface_id}/deliver', {
466
+ params: { path: { surface_id: surface.data.id } },
467
+ body: { channel_address: '+15551234567' },
468
+ })
469
+
470
+ // Track completion
471
+ const { data: rates } = await client.GET(
472
+ '/v1/{workspace_id}/analytics/surfaces/completion-rates',
473
+ {},
474
+ )
475
+ ```
476
+
477
+ 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.
478
+
479
+ ### Scribe (Clinical Copilot)
480
+
481
+ 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).
482
+
483
+ ```typescript
484
+ // Configure scribe settings
485
+ const settings = await client.settings.scribe.get()
486
+ await client.settings.scribe.update({ enabled: true, soap_style: 'detailed' })
487
+
488
+ // Approve ICD-10 codes after physician review
489
+ await client.POST('/v1/{workspace_id}/scribe/encounters/{encounter_id}/icd10/approve', {
490
+ params: { path: { encounter_id: encounterId } },
491
+ body: { code: 'J06.9' },
492
+ })
493
+
494
+ // Edit SOAP notes
495
+ await client.POST('/v1/{workspace_id}/scribe/encounters/{encounter_id}/soap/edit', {
496
+ params: { path: { encounter_id: encounterId } },
497
+ body: { section: 'assessment', content: 'Acute upper respiratory infection...' },
498
+ })
499
+
500
+ // Finalize for EHR sync
501
+ await client.POST('/v1/{workspace_id}/scribe/encounters/{encounter_id}/finalize', {
502
+ params: { path: { encounter_id: encounterId } },
503
+ })
504
+ ```
505
+
432
506
  ### Billing
433
507
 
434
508
  ```typescript
package/api.md CHANGED
@@ -65,6 +65,9 @@ All workspace-scoped resources also expose `withOptions(options)`.
65
65
  - `get`
66
66
  - `update`
67
67
  - `archive`
68
+ - `provision`
69
+ - `checkEnvironment`
70
+ - `convertEnvironment`
68
71
 
69
72
  ### `apiKeys`
70
73
 
package/dist/index.cjs CHANGED
@@ -744,7 +744,10 @@ var WorkspaceScopedResource = class {
744
744
  if (!page.has_more || page.continuation_token === null || page.continuation_token === void 0) {
745
745
  break;
746
746
  }
747
- nextParams = { ...nextParams, continuation_token: page.continuation_token };
747
+ nextParams = {
748
+ ...nextParams,
749
+ continuation_token: page.continuation_token
750
+ };
748
751
  }
749
752
  }
750
753
  async *iterateOffsetPaginatedList(fetchPage, selectItems, params) {
@@ -890,6 +893,34 @@ var WorkspacesResource = class extends WorkspaceScopedResource {
890
893
  })
891
894
  );
892
895
  }
896
+ /** Provision a workspace (seed integrations, mark as provisioned) */
897
+ async provision(id) {
898
+ return extractData(
899
+ await this.client.POST("/v1/workspaces/{workspace_id}/provision", {
900
+ params: { path: { workspace_id: id ?? this.workspaceId } }
901
+ })
902
+ );
903
+ }
904
+ /** Pre-check environment conversion warnings */
905
+ async checkEnvironment(target, id) {
906
+ return extractData(
907
+ await this.client.GET("/v1/workspaces/{workspace_id}/environment-check", {
908
+ params: {
909
+ path: { workspace_id: id ?? this.workspaceId },
910
+ query: target ? { target } : void 0
911
+ }
912
+ })
913
+ );
914
+ }
915
+ /** Convert workspace between staging and production */
916
+ async convertEnvironment(body, id) {
917
+ return extractData(
918
+ await this.client.POST("/v1/workspaces/{workspace_id}/convert-environment", {
919
+ params: { path: { workspace_id: id ?? this.workspaceId } },
920
+ body
921
+ })
922
+ );
923
+ }
893
924
  };
894
925
 
895
926
  // src/resources/api-keys.ts
@@ -1143,7 +1174,11 @@ var OperatorsResource = class extends WorkspaceScopedResource {
1143
1174
  );
1144
1175
  }
1145
1176
  listAutoPaging(params) {
1146
- return this.iterateOffsetPaginatedList((pageParams) => this.list(pageParams), (page) => page.items, params);
1177
+ return this.iterateOffsetPaginatedList(
1178
+ (pageParams) => this.list(pageParams),
1179
+ (page) => page.items,
1180
+ params
1181
+ );
1147
1182
  }
1148
1183
  async create(body) {
1149
1184
  return extractData(
@@ -2736,15 +2771,12 @@ var WebhookDestinationsResource = class extends WorkspaceScopedResource {
2736
2771
  }
2737
2772
  async listDeliveries(destinationId, params) {
2738
2773
  return extractData(
2739
- await this.client.GET(
2740
- "/v1/{workspace_id}/webhook-destinations/{destination_id}/deliveries",
2741
- {
2742
- params: {
2743
- path: { workspace_id: this.workspaceId, destination_id: destinationId },
2744
- query: params
2745
- }
2774
+ await this.client.GET("/v1/{workspace_id}/webhook-destinations/{destination_id}/deliveries", {
2775
+ params: {
2776
+ path: { workspace_id: this.workspaceId, destination_id: destinationId },
2777
+ query: params
2746
2778
  }
2747
- )
2779
+ })
2748
2780
  );
2749
2781
  }
2750
2782
  listDeliveriesAutoPaging(destinationId, params) {