@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/dist/index.mjs CHANGED
@@ -885,16 +885,27 @@ function resolveScopedPlatformClient(client) {
885
885
  };
886
886
  }
887
887
 
888
- // src/resources/workspaces.ts
889
- var WorkspacesResource = class extends WorkspaceScopedResource {
890
- /** Create a workspace for the authenticated user and attach owner access */
891
- async createSelfService(body) {
888
+ // src/resources/me.ts
889
+ var MeResource = class extends WorkspaceScopedResource {
890
+ /**
891
+ * Create a workspace owned by the authenticated identity.
892
+ *
893
+ * The caller is bootstrapped as the workspace's owner. Use this
894
+ * method anywhere that previously called
895
+ * ``client.workspaces.createSelfService(body)`` — the request body
896
+ * shape and response are unchanged; only the URL moved.
897
+ */
898
+ async createWorkspace(body) {
892
899
  return extractData(
893
- await this.client.POST("/v1/workspaces/self-service", {
900
+ await this.client.POST("/v1/me/workspaces", {
894
901
  body
895
902
  })
896
903
  );
897
904
  }
905
+ };
906
+
907
+ // src/resources/workspaces.ts
908
+ var WorkspacesResource = class extends WorkspaceScopedResource {
898
909
  /** List workspaces accessible to the current API key */
899
910
  async list(params) {
900
911
  return extractData(
@@ -960,6 +971,35 @@ var WorkspacesResource = class extends WorkspaceScopedResource {
960
971
  })
961
972
  );
962
973
  }
974
+ /**
975
+ * Workspace-allowlisted phone numbers that can place test calls into voice
976
+ * agents. The list is read-mostly; writes overwrite the entire allowlist.
977
+ *
978
+ * Always operates on the bound workspace. Use `client.withOptions(...)` or
979
+ * construct a second `AmigoClient` if you need to act on a different
980
+ * workspace.
981
+ */
982
+ testCallerNumbers = {
983
+ /** Get the workspace's test caller allowlist */
984
+ get: async () => extractData(
985
+ await this.client.GET("/v1/workspaces/{workspace_id}/test-caller-numbers", {
986
+ params: { path: { workspace_id: this.workspaceId } }
987
+ })
988
+ ),
989
+ /**
990
+ * Replace the workspace's test caller allowlist.
991
+ *
992
+ * **Replace-all semantics:** the request body fully replaces the existing
993
+ * allowlist; numbers omitted from `body` are removed. Read first, mutate,
994
+ * then write to add/remove individual entries safely.
995
+ */
996
+ update: async (body) => extractData(
997
+ await this.client.PUT("/v1/workspaces/{workspace_id}/test-caller-numbers", {
998
+ params: { path: { workspace_id: this.workspaceId } },
999
+ body
1000
+ })
1001
+ )
1002
+ };
963
1003
  };
964
1004
 
965
1005
  // src/resources/api-keys.ts
@@ -1933,6 +1973,34 @@ var CallsResource = class extends WorkspaceScopedResource {
1933
1973
  })
1934
1974
  );
1935
1975
  }
1976
+ /** List trace analyses across calls (workspace-scoped feed) */
1977
+ async listTraces(params) {
1978
+ return extractData(
1979
+ await this.client.GET("/v1/{workspace_id}/calls/traces", {
1980
+ params: { path: { workspace_id: this.workspaceId }, query: params }
1981
+ })
1982
+ );
1983
+ }
1984
+ /** Get latest Universal Metric Store values scoped to a single call */
1985
+ async getMetrics(callId2, params) {
1986
+ return extractData(
1987
+ await this.client.GET("/v1/{workspace_id}/calls/{call_id}/metrics", {
1988
+ params: {
1989
+ path: { workspace_id: this.workspaceId, call_id: callId2 },
1990
+ query: params
1991
+ }
1992
+ })
1993
+ );
1994
+ }
1995
+ /** Place an outbound call from the workspace's voice pipeline */
1996
+ async createOutbound(body) {
1997
+ return extractData(
1998
+ await this.client.POST("/v1/{workspace_id}/calls/outbound", {
1999
+ params: { path: { workspace_id: this.workspaceId } },
2000
+ body
2001
+ })
2002
+ );
2003
+ }
1936
2004
  };
1937
2005
 
1938
2006
  // src/resources/conversations.ts
@@ -2614,6 +2682,34 @@ var AnalyticsResource = class extends WorkspaceScopedResource {
2614
2682
  })
2615
2683
  );
2616
2684
  }
2685
+ /**
2686
+ * Surfaces analytics — completion rates, channel effectiveness, field
2687
+ * abandonment, and per-entity breakdowns. Used by the developer console's
2688
+ * surfaces analytics tab.
2689
+ */
2690
+ surfaces = {
2691
+ getCompletionRates: async (params) => extractData(
2692
+ await this.client.GET("/v1/{workspace_id}/analytics/surfaces/completion-rates", {
2693
+ params: { path: { workspace_id: this.workspaceId }, query: params }
2694
+ })
2695
+ ),
2696
+ getChannelEffectiveness: async (params) => extractData(
2697
+ await this.client.GET("/v1/{workspace_id}/analytics/surfaces/channel-effectiveness", {
2698
+ params: { path: { workspace_id: this.workspaceId }, query: params }
2699
+ })
2700
+ ),
2701
+ getFieldAbandonment: async (params) => extractData(
2702
+ await this.client.GET("/v1/{workspace_id}/analytics/surfaces/field-abandonment", {
2703
+ params: { path: { workspace_id: this.workspaceId }, query: params }
2704
+ })
2705
+ ),
2706
+ /** Per-entity surfaces analytics (which surfaces a specific entity has seen) */
2707
+ getForEntity: async (entityId2) => extractData(
2708
+ await this.client.GET("/v1/{workspace_id}/analytics/surfaces/entity/{entity_id}", {
2709
+ params: { path: { workspace_id: this.workspaceId, entity_id: entityId2 } }
2710
+ })
2711
+ )
2712
+ };
2617
2713
  };
2618
2714
 
2619
2715
  // src/resources/simulations.ts
@@ -2675,6 +2771,108 @@ var SimulationsResource = class extends WorkspaceScopedResource {
2675
2771
  })
2676
2772
  );
2677
2773
  }
2774
+ /**
2775
+ * Multi-session simulation runs — orchestrate a batch of scenarios against
2776
+ * a service to compute coverage and surface regressions. Use this when you
2777
+ * want to compare branch behavior or measure drift between versions.
2778
+ *
2779
+ * @beta New in this release; surface may evolve.
2780
+ */
2781
+ runs = {
2782
+ /** List simulation runs in the workspace */
2783
+ list: async (params) => extractData(
2784
+ await this.client.GET("/v1/{workspace_id}/simulations/runs", {
2785
+ params: { path: { workspace_id: this.workspaceId }, query: params }
2786
+ })
2787
+ ),
2788
+ /** Create a new simulation run */
2789
+ create: async (body) => extractData(
2790
+ await this.client.POST("/v1/{workspace_id}/simulations/runs", {
2791
+ params: { path: { workspace_id: this.workspaceId } },
2792
+ body
2793
+ })
2794
+ ),
2795
+ /** Get a simulation run with its scenarios + status */
2796
+ get: async (runId) => extractData(
2797
+ await this.client.GET("/v1/{workspace_id}/simulations/runs/{run_id}", {
2798
+ params: { path: { workspace_id: this.workspaceId, run_id: runId } }
2799
+ })
2800
+ ),
2801
+ /** Mark a run as complete (used by the harness once all sessions finish) */
2802
+ complete: async (runId) => extractData(
2803
+ await this.client.POST("/v1/{workspace_id}/simulations/runs/{run_id}/complete", {
2804
+ params: { path: { workspace_id: this.workspaceId, run_id: runId } }
2805
+ })
2806
+ ),
2807
+ /** Spin up a session under a run (single scenario inside the run's batch) */
2808
+ createSession: async (runId, body) => extractData(
2809
+ await this.client.POST("/v1/{workspace_id}/simulations/runs/{run_id}/sessions", {
2810
+ params: { path: { workspace_id: this.workspaceId, run_id: runId } },
2811
+ body
2812
+ })
2813
+ )
2814
+ };
2815
+ /**
2816
+ * Bridge — convert recorded production calls into simulation scenarios so
2817
+ * they can be replayed against a candidate version. ``plan`` returns a
2818
+ * preview of which calls would be selected; ``run`` executes the plan.
2819
+ */
2820
+ bridge = {
2821
+ /** Plan a bridge run — returns the candidate scenarios without executing */
2822
+ plan: async (body) => extractData(
2823
+ await this.client.POST("/v1/{workspace_id}/simulations/bridge/plan", {
2824
+ params: { path: { workspace_id: this.workspaceId } },
2825
+ body
2826
+ })
2827
+ ),
2828
+ /** Execute a bridge run and return the resulting run handle */
2829
+ run: async (body) => extractData(
2830
+ await this.client.POST("/v1/{workspace_id}/simulations/bridge", {
2831
+ params: { path: { workspace_id: this.workspaceId } },
2832
+ body
2833
+ })
2834
+ )
2835
+ };
2836
+ /**
2837
+ * Per-service simulation views — graph of explored conversation paths,
2838
+ * recorded sessions, and per-turn telemetry. Used by the developer console's
2839
+ * coverage tab to visualize what scenarios have been exercised.
2840
+ */
2841
+ services = {
2842
+ /** Get the conversation graph (nodes/edges) for a service */
2843
+ getGraph: async (serviceId2) => extractData(
2844
+ await this.client.GET("/v1/{workspace_id}/simulations/services/{service_id}/graph", {
2845
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
2846
+ })
2847
+ ),
2848
+ /** Reset / delete the service's accumulated graph */
2849
+ deleteGraph: async (serviceId2) => extractData(
2850
+ await this.client.DELETE("/v1/{workspace_id}/simulations/services/{service_id}/graph", {
2851
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
2852
+ })
2853
+ ),
2854
+ /** Get the set of explored conversation paths through the graph */
2855
+ getGraphPaths: async (serviceId2) => extractData(
2856
+ await this.client.GET(
2857
+ "/v1/{workspace_id}/simulations/services/{service_id}/graph/paths",
2858
+ {
2859
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
2860
+ }
2861
+ )
2862
+ ),
2863
+ /** List recorded sessions for the service */
2864
+ listSessions: async (serviceId2) => extractData(
2865
+ await this.client.GET("/v1/{workspace_id}/simulations/services/{service_id}/sessions", {
2866
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
2867
+ })
2868
+ ),
2869
+ /** List per-turn observations for the service */
2870
+ listTurns: async (serviceId2) => extractData(
2871
+ await this.client.GET("/v1/{workspace_id}/simulations/services/{service_id}/turns", {
2872
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
2873
+ })
2874
+ )
2875
+ };
2678
2876
  };
2679
2877
 
2680
2878
  // src/resources/metrics.ts
@@ -2823,6 +3021,27 @@ var SettingsResource = class extends WorkspaceScopedResource {
2823
3021
  params: { path: { workspace_id: this.workspaceId } },
2824
3022
  body
2825
3023
  })
3024
+ ),
3025
+ /**
3026
+ * Preview which calls would be flagged by the current gap-scanner config.
3027
+ *
3028
+ * The spec types the body as `GapScannerPreviewRequest | null`, but the
3029
+ * `null` branch only matters when the caller wants to *explicitly* clear
3030
+ * the body. Modeling as `body?: GapScannerPreviewRequest` keeps the SDK
3031
+ * surface consistent with every other POST wrapper; consumers who need
3032
+ * to send the literal `null` can do so via `client.POST(...)` directly.
3033
+ */
3034
+ preview: async (body) => extractData(
3035
+ await this.client.POST("/v1/{workspace_id}/settings/gap-scanner/preview", {
3036
+ params: { path: { workspace_id: this.workspaceId } },
3037
+ body
3038
+ })
3039
+ ),
3040
+ /** Trigger an on-demand scan with the current gap-scanner config */
3041
+ scan: async () => extractData(
3042
+ await this.client.POST("/v1/{workspace_id}/settings/gap-scanner/scan", {
3043
+ params: { path: { workspace_id: this.workspaceId } }
3044
+ })
2826
3045
  )
2827
3046
  };
2828
3047
  scribe = {
@@ -4289,6 +4508,810 @@ function parseObserverFrame(data) {
4289
4508
  return obj;
4290
4509
  }
4291
4510
 
4511
+ // src/resources/fhir.ts
4512
+ var FhirResource = class extends WorkspaceScopedResource {
4513
+ /** Get current FHIR sync status (server identity, last sync, counts) */
4514
+ async getStatus() {
4515
+ return extractData(
4516
+ await this.client.GET("/v1/{workspace_id}/fhir/status", {
4517
+ params: { path: { workspace_id: this.workspaceId } }
4518
+ })
4519
+ );
4520
+ }
4521
+ /** List recent FHIR sync failures (for triage) */
4522
+ async getSyncFailures(params) {
4523
+ return extractData(
4524
+ await this.client.GET("/v1/{workspace_id}/fhir/sync-failures", {
4525
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4526
+ })
4527
+ );
4528
+ }
4529
+ /** Trigger a FHIR import (full or partial, depending on request) */
4530
+ async import(body) {
4531
+ return extractData(
4532
+ await this.client.POST("/v1/{workspace_id}/fhir/import", {
4533
+ params: { path: { workspace_id: this.workspaceId } },
4534
+ body
4535
+ })
4536
+ );
4537
+ }
4538
+ /** Search patients by demographics or identifiers */
4539
+ async searchPatients(params) {
4540
+ return extractData(
4541
+ await this.client.GET("/v1/{workspace_id}/fhir/patients", {
4542
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4543
+ })
4544
+ );
4545
+ }
4546
+ /** Get a patient summary (canonical demographics + active conditions/meds) */
4547
+ async getPatientSummary(patientId) {
4548
+ return extractData(
4549
+ await this.client.GET("/v1/{workspace_id}/fhir/patients/{patient_id}/summary", {
4550
+ params: { path: { workspace_id: this.workspaceId, patient_id: patientId } }
4551
+ })
4552
+ );
4553
+ }
4554
+ /** Get a patient's longitudinal clinical timeline */
4555
+ async getPatientTimeline(patientId) {
4556
+ return extractData(
4557
+ await this.client.GET("/v1/{workspace_id}/fhir/patients/{patient_id}/timeline", {
4558
+ params: { path: { workspace_id: this.workspaceId, patient_id: patientId } }
4559
+ })
4560
+ );
4561
+ }
4562
+ resources = {
4563
+ /** Search FHIR resources of a given type (passes search params through to FHIR) */
4564
+ search: async (resourceType, params) => extractData(
4565
+ await this.client.GET("/v1/{workspace_id}/fhir/resources/{resource_type}", {
4566
+ params: {
4567
+ path: { workspace_id: this.workspaceId, resource_type: resourceType },
4568
+ query: params
4569
+ }
4570
+ })
4571
+ ),
4572
+ /** Create a FHIR resource of the given type */
4573
+ create: async (resourceType, body) => extractData(
4574
+ await this.client.POST("/v1/{workspace_id}/fhir/resources/{resource_type}", {
4575
+ params: { path: { workspace_id: this.workspaceId, resource_type: resourceType } },
4576
+ body
4577
+ })
4578
+ ),
4579
+ /** Get a single FHIR resource by type + id */
4580
+ get: async (resourceType, resourceId) => extractData(
4581
+ await this.client.GET(
4582
+ "/v1/{workspace_id}/fhir/resources/{resource_type}/{resource_id}",
4583
+ {
4584
+ params: {
4585
+ path: {
4586
+ workspace_id: this.workspaceId,
4587
+ resource_type: resourceType,
4588
+ resource_id: resourceId
4589
+ }
4590
+ }
4591
+ }
4592
+ )
4593
+ ),
4594
+ /** Update a FHIR resource by type + id */
4595
+ update: async (resourceType, resourceId, body) => extractData(
4596
+ await this.client.PUT(
4597
+ "/v1/{workspace_id}/fhir/resources/{resource_type}/{resource_id}",
4598
+ {
4599
+ params: {
4600
+ path: {
4601
+ workspace_id: this.workspaceId,
4602
+ resource_type: resourceType,
4603
+ resource_id: resourceId
4604
+ }
4605
+ },
4606
+ body
4607
+ }
4608
+ )
4609
+ ),
4610
+ /** Get the version history for a FHIR resource */
4611
+ getHistory: async (resourceType, resourceId) => extractData(
4612
+ await this.client.GET(
4613
+ "/v1/{workspace_id}/fhir/resources/{resource_type}/{resource_id}/history",
4614
+ {
4615
+ params: {
4616
+ path: {
4617
+ workspace_id: this.workspaceId,
4618
+ resource_type: resourceType,
4619
+ resource_id: resourceId
4620
+ }
4621
+ }
4622
+ }
4623
+ )
4624
+ )
4625
+ };
4626
+ views = {
4627
+ /** List patients (typed view with computed display fields) */
4628
+ patients: async (params) => extractData(
4629
+ await this.client.GET("/v1/{workspace_id}/fhir/views/patients", {
4630
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4631
+ })
4632
+ ),
4633
+ /** List appointments */
4634
+ appointments: async (params) => extractData(
4635
+ await this.client.GET("/v1/{workspace_id}/fhir/views/appointments", {
4636
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4637
+ })
4638
+ ),
4639
+ /** List practitioners */
4640
+ practitioners: async (params) => extractData(
4641
+ await this.client.GET("/v1/{workspace_id}/fhir/views/practitioners", {
4642
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4643
+ })
4644
+ ),
4645
+ /** List organizations */
4646
+ organizations: async (params) => extractData(
4647
+ await this.client.GET("/v1/{workspace_id}/fhir/views/organizations", {
4648
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4649
+ })
4650
+ ),
4651
+ /** List locations */
4652
+ locations: async (params) => extractData(
4653
+ await this.client.GET("/v1/{workspace_id}/fhir/views/locations", {
4654
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4655
+ })
4656
+ ),
4657
+ /**
4658
+ * List schedule slots — supports richer filtering than the other views
4659
+ * (status, date window, provider, specialty, service_type, facility_id).
4660
+ */
4661
+ slots: async (params) => extractData(
4662
+ await this.client.GET("/v1/{workspace_id}/fhir/views/slots", {
4663
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4664
+ })
4665
+ )
4666
+ };
4667
+ };
4668
+
4669
+ // src/resources/insights.ts
4670
+ var InsightsResource = class extends WorkspaceScopedResource {
4671
+ /** Get the periodic insights digest for the workspace */
4672
+ async getDigest() {
4673
+ return extractData(
4674
+ await this.client.GET("/v1/{workspace_id}/insights/digest", {
4675
+ params: { path: { workspace_id: this.workspaceId } }
4676
+ })
4677
+ );
4678
+ }
4679
+ /** Fetch the queryable schema (tables, columns, joins) the assistant uses */
4680
+ async getSchema() {
4681
+ return extractData(
4682
+ await this.client.GET("/v1/{workspace_id}/insights/schema", {
4683
+ params: { path: { workspace_id: this.workspaceId } }
4684
+ })
4685
+ );
4686
+ }
4687
+ /** Get curated query suggestions for the workspace */
4688
+ async getSuggestions() {
4689
+ return extractData(
4690
+ await this.client.GET("/v1/{workspace_id}/insights/suggestions", {
4691
+ params: { path: { workspace_id: this.workspaceId } }
4692
+ })
4693
+ );
4694
+ }
4695
+ /** Run an ad-hoc SQL query against the insights warehouse */
4696
+ async runSql(body) {
4697
+ return extractData(
4698
+ await this.client.POST("/v1/{workspace_id}/insights/sql", {
4699
+ params: { path: { workspace_id: this.workspaceId } },
4700
+ body
4701
+ })
4702
+ );
4703
+ }
4704
+ sessions = {
4705
+ /** Start a new insights chat session */
4706
+ create: async () => extractData(
4707
+ await this.client.POST("/v1/{workspace_id}/insights/sessions", {
4708
+ params: { path: { workspace_id: this.workspaceId } }
4709
+ })
4710
+ ),
4711
+ /** Get a session and its full history */
4712
+ get: async (sessionId) => extractData(
4713
+ await this.client.GET("/v1/{workspace_id}/insights/sessions/{session_id}", {
4714
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } }
4715
+ })
4716
+ ),
4717
+ /** Send a chat message and get the assistant's response (with any generated SQL/results) */
4718
+ chat: async (sessionId, body) => extractData(
4719
+ await this.client.POST("/v1/{workspace_id}/insights/sessions/{session_id}/chat", {
4720
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } },
4721
+ body
4722
+ })
4723
+ )
4724
+ };
4725
+ };
4726
+
4727
+ // src/resources/monitor-concepts.ts
4728
+ var MonitorConceptsResource = class extends WorkspaceScopedResource {
4729
+ /** Create a new monitor concept */
4730
+ async create(body) {
4731
+ return extractData(
4732
+ await this.client.POST("/v1/{workspace_id}/monitor-concepts", {
4733
+ params: { path: { workspace_id: this.workspaceId } },
4734
+ body
4735
+ })
4736
+ );
4737
+ }
4738
+ /** List monitor concepts in the workspace */
4739
+ async list(params) {
4740
+ return extractData(
4741
+ await this.client.GET("/v1/{workspace_id}/monitor-concepts", {
4742
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4743
+ })
4744
+ );
4745
+ }
4746
+ listAutoPaging(params) {
4747
+ return this.iteratePaginatedList((pageParams) => this.list(pageParams), params);
4748
+ }
4749
+ /** Get a single monitor concept */
4750
+ async get(conceptId) {
4751
+ return extractData(
4752
+ await this.client.GET("/v1/{workspace_id}/monitor-concepts/{concept_id}", {
4753
+ params: { path: { workspace_id: this.workspaceId, concept_id: conceptId } }
4754
+ })
4755
+ );
4756
+ }
4757
+ /** Update a monitor concept */
4758
+ async update(conceptId, body) {
4759
+ return extractData(
4760
+ await this.client.PATCH("/v1/{workspace_id}/monitor-concepts/{concept_id}", {
4761
+ params: { path: { workspace_id: this.workspaceId, concept_id: conceptId } },
4762
+ body
4763
+ })
4764
+ );
4765
+ }
4766
+ /** Delete a monitor concept */
4767
+ async delete(conceptId) {
4768
+ return extractData(
4769
+ await this.client.DELETE("/v1/{workspace_id}/monitor-concepts/{concept_id}", {
4770
+ params: { path: { workspace_id: this.workspaceId, concept_id: conceptId } }
4771
+ })
4772
+ );
4773
+ }
4774
+ };
4775
+
4776
+ // src/resources/unification-rules.ts
4777
+ var UnificationRulesResource = class extends WorkspaceScopedResource {
4778
+ /** Create a new unification rule */
4779
+ async create(body) {
4780
+ return extractData(
4781
+ await this.client.POST("/v1/{workspace_id}/unification-rules", {
4782
+ params: { path: { workspace_id: this.workspaceId } },
4783
+ body
4784
+ })
4785
+ );
4786
+ }
4787
+ /** List unification rules in the workspace */
4788
+ async list(params) {
4789
+ return extractData(
4790
+ await this.client.GET("/v1/{workspace_id}/unification-rules", {
4791
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4792
+ })
4793
+ );
4794
+ }
4795
+ listAutoPaging(params) {
4796
+ return this.iteratePaginatedList((pageParams) => this.list(pageParams), params);
4797
+ }
4798
+ /** Get a single unification rule */
4799
+ async get(ruleId) {
4800
+ return extractData(
4801
+ await this.client.GET("/v1/{workspace_id}/unification-rules/{rule_id}", {
4802
+ params: { path: { workspace_id: this.workspaceId, rule_id: ruleId } }
4803
+ })
4804
+ );
4805
+ }
4806
+ /** Update a unification rule */
4807
+ async update(ruleId, body) {
4808
+ return extractData(
4809
+ await this.client.PATCH("/v1/{workspace_id}/unification-rules/{rule_id}", {
4810
+ params: { path: { workspace_id: this.workspaceId, rule_id: ruleId } },
4811
+ body
4812
+ })
4813
+ );
4814
+ }
4815
+ /** Delete a unification rule */
4816
+ async delete(ruleId) {
4817
+ return extractData(
4818
+ await this.client.DELETE("/v1/{workspace_id}/unification-rules/{rule_id}", {
4819
+ params: { path: { workspace_id: this.workspaceId, rule_id: ruleId } }
4820
+ })
4821
+ );
4822
+ }
4823
+ };
4824
+
4825
+ // src/resources/crm.ts
4826
+ var CrmResource = class extends WorkspaceScopedResource {
4827
+ /** Health/status of the workspace's CRM integration sync */
4828
+ async getStatus() {
4829
+ return extractData(
4830
+ await this.client.GET("/v1/{workspace_id}/crm/status", {
4831
+ params: { path: { workspace_id: this.workspaceId } }
4832
+ })
4833
+ );
4834
+ }
4835
+ contacts = {
4836
+ list: async (params) => extractData(
4837
+ await this.client.GET("/v1/{workspace_id}/crm/contacts", {
4838
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4839
+ })
4840
+ ),
4841
+ get: async (contactId) => extractData(
4842
+ await this.client.GET("/v1/{workspace_id}/crm/contacts/{contact_id}", {
4843
+ params: { path: { workspace_id: this.workspaceId, contact_id: contactId } }
4844
+ })
4845
+ ),
4846
+ /** Per-contact activity timeline (calls, emails, deal events) */
4847
+ getTimeline: async (contactId) => extractData(
4848
+ await this.client.GET("/v1/{workspace_id}/crm/contacts/{contact_id}/timeline", {
4849
+ params: { path: { workspace_id: this.workspaceId, contact_id: contactId } }
4850
+ })
4851
+ )
4852
+ };
4853
+ companies = {
4854
+ list: async (params) => extractData(
4855
+ await this.client.GET("/v1/{workspace_id}/crm/companies", {
4856
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4857
+ })
4858
+ ),
4859
+ get: async (companyId) => extractData(
4860
+ await this.client.GET("/v1/{workspace_id}/crm/companies/{company_id}", {
4861
+ params: { path: { workspace_id: this.workspaceId, company_id: companyId } }
4862
+ })
4863
+ )
4864
+ };
4865
+ deals = {
4866
+ list: async (params) => extractData(
4867
+ await this.client.GET("/v1/{workspace_id}/crm/deals", {
4868
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4869
+ })
4870
+ ),
4871
+ get: async (dealId) => extractData(
4872
+ await this.client.GET("/v1/{workspace_id}/crm/deals/{deal_id}", {
4873
+ params: { path: { workspace_id: this.workspaceId, deal_id: dealId } }
4874
+ })
4875
+ ),
4876
+ /** Aggregated pipeline view: deals grouped by stage with rolled-up totals */
4877
+ getPipeline: async () => extractData(
4878
+ await this.client.GET("/v1/{workspace_id}/crm/deals/pipeline", {
4879
+ params: { path: { workspace_id: this.workspaceId } }
4880
+ })
4881
+ )
4882
+ };
4883
+ };
4884
+
4885
+ // src/resources/command-center.ts
4886
+ var CommandCenterResource = class extends WorkspaceScopedResource {
4887
+ /** Get the current command-center snapshot */
4888
+ async get() {
4889
+ return extractData(
4890
+ await this.client.GET("/v1/{workspace_id}/command-center", {
4891
+ params: { path: { workspace_id: this.workspaceId } }
4892
+ })
4893
+ );
4894
+ }
4895
+ };
4896
+
4897
+ // src/resources/sensorium.ts
4898
+ var SensoriumResource = class extends WorkspaceScopedResource {
4899
+ /** Per-connector health snapshot (status + latency) */
4900
+ async getConnectorHealth() {
4901
+ return extractData(
4902
+ await this.client.GET("/v1/{workspace_id}/sensorium/connector-health", {
4903
+ params: { path: { workspace_id: this.workspaceId } }
4904
+ })
4905
+ );
4906
+ }
4907
+ /** End-to-end agent loop latency breakdown (per-stage timings) */
4908
+ async getLoopLatency() {
4909
+ return extractData(
4910
+ await this.client.GET("/v1/{workspace_id}/sensorium/loop-latency", {
4911
+ params: { path: { workspace_id: this.workspaceId } }
4912
+ })
4913
+ );
4914
+ }
4915
+ };
4916
+
4917
+ // src/resources/data-query.ts
4918
+ var DataQueryResource = class extends WorkspaceScopedResource {
4919
+ /** Run a tabular query against a workspace dataset */
4920
+ async run(schema, table, params) {
4921
+ return extractData(
4922
+ await this.client.GET("/v1/{workspace_id}/query/{schema}/{table}", {
4923
+ params: {
4924
+ path: { workspace_id: this.workspaceId, schema, table },
4925
+ query: params
4926
+ }
4927
+ })
4928
+ );
4929
+ }
4930
+ };
4931
+
4932
+ // src/resources/briefs.ts
4933
+ var BriefsResource = class extends WorkspaceScopedResource {
4934
+ /** Get the workspace-level brief */
4935
+ async get() {
4936
+ return extractData(
4937
+ await this.client.GET("/v1/{workspace_id}/brief", {
4938
+ params: { path: { workspace_id: this.workspaceId } }
4939
+ })
4940
+ );
4941
+ }
4942
+ /** Regenerate the workspace-level brief */
4943
+ async regenerate() {
4944
+ return extractData(
4945
+ await this.client.POST("/v1/{workspace_id}/brief", {
4946
+ params: { path: { workspace_id: this.workspaceId } }
4947
+ })
4948
+ );
4949
+ }
4950
+ /** Get the brief for a specific entity */
4951
+ async getForEntity(entityId2) {
4952
+ return extractData(
4953
+ await this.client.GET("/v1/{workspace_id}/entities/{entity_id}/brief", {
4954
+ params: { path: { workspace_id: this.workspaceId, entity_id: entityId2 } }
4955
+ })
4956
+ );
4957
+ }
4958
+ /** Regenerate the brief for a specific entity */
4959
+ async regenerateForEntity(entityId2) {
4960
+ return extractData(
4961
+ await this.client.POST("/v1/{workspace_id}/entities/{entity_id}/brief", {
4962
+ params: { path: { workspace_id: this.workspaceId, entity_id: entityId2 } }
4963
+ })
4964
+ );
4965
+ }
4966
+ };
4967
+
4968
+ // src/resources/desktop-sessions.ts
4969
+ var DesktopSessionsResource = class extends WorkspaceScopedResource {
4970
+ /** Spin up a new desktop session */
4971
+ async create(body) {
4972
+ return extractData(
4973
+ await this.client.POST("/v1/{workspace_id}/desktop-sessions", {
4974
+ params: { path: { workspace_id: this.workspaceId } },
4975
+ body
4976
+ })
4977
+ );
4978
+ }
4979
+ /** Disconnect / tear down a desktop session */
4980
+ async disconnect(sessionId) {
4981
+ return extractData(
4982
+ await this.client.DELETE("/v1/{workspace_id}/desktop-sessions/{session_id}", {
4983
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } }
4984
+ })
4985
+ );
4986
+ }
4987
+ /** Drive a click / type / scroll action against the session */
4988
+ async sendAction(sessionId, body) {
4989
+ return extractData(
4990
+ await this.client.POST("/v1/{workspace_id}/desktop-sessions/{session_id}/action", {
4991
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } },
4992
+ body
4993
+ })
4994
+ );
4995
+ }
4996
+ /** Get the latest screenshot for a session */
4997
+ async getScreenshot(sessionId) {
4998
+ return extractData(
4999
+ await this.client.GET("/v1/{workspace_id}/desktop-sessions/{session_id}/screenshot", {
5000
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } }
5001
+ })
5002
+ );
5003
+ }
5004
+ /** Get the session's current connection + activity status */
5005
+ async getStatus(sessionId) {
5006
+ return extractData(
5007
+ await this.client.GET("/v1/{workspace_id}/desktop-sessions/{session_id}/status", {
5008
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } }
5009
+ })
5010
+ );
5011
+ }
5012
+ };
5013
+
5014
+ // src/resources/intake.ts
5015
+ var IntakeResource = class extends WorkspaceScopedResource {
5016
+ links = {
5017
+ list: async (params) => extractData(
5018
+ await this.client.GET("/v1/{workspace_id}/intake/links", {
5019
+ params: { path: { workspace_id: this.workspaceId }, query: params }
5020
+ })
5021
+ ),
5022
+ create: async (body) => extractData(
5023
+ await this.client.POST("/v1/{workspace_id}/intake/links", {
5024
+ params: { path: { workspace_id: this.workspaceId } },
5025
+ body
5026
+ })
5027
+ ),
5028
+ delete: async (linkId) => extractData(
5029
+ await this.client.DELETE("/v1/{workspace_id}/intake/links/{link_id}", {
5030
+ params: { path: { workspace_id: this.workspaceId, link_id: linkId } }
5031
+ })
5032
+ ),
5033
+ /** List uploads received against a link */
5034
+ listUploads: async (linkId) => extractData(
5035
+ await this.client.GET("/v1/{workspace_id}/intake/links/{link_id}/uploads", {
5036
+ params: { path: { workspace_id: this.workspaceId, link_id: linkId } }
5037
+ })
5038
+ ),
5039
+ /** Get a download URL/payload for a single upload */
5040
+ downloadUpload: async (linkId, uploadId) => extractData(
5041
+ await this.client.GET(
5042
+ "/v1/{workspace_id}/intake/links/{link_id}/uploads/{upload_id}/download",
5043
+ {
5044
+ params: {
5045
+ path: {
5046
+ workspace_id: this.workspaceId,
5047
+ link_id: linkId,
5048
+ upload_id: uploadId
5049
+ }
5050
+ }
5051
+ }
5052
+ )
5053
+ )
5054
+ };
5055
+ };
5056
+
5057
+ // src/resources/network.ts
5058
+ var NetworkResource = class extends WorkspaceScopedResource {
5059
+ /** Get the platform's egress IPs the workspace's outbound traffic uses */
5060
+ async getEgressIps() {
5061
+ return extractData(
5062
+ await this.client.GET("/v1/{workspace_id}/network/egress-ips", {
5063
+ params: { path: { workspace_id: this.workspaceId } }
5064
+ })
5065
+ );
5066
+ }
5067
+ };
5068
+
5069
+ // src/resources/pipeline.ts
5070
+ var PipelineResource = class extends WorkspaceScopedResource {
5071
+ /** Overall pipeline status (sources up/down, last successful run, etc.) */
5072
+ async getStatus() {
5073
+ return extractData(
5074
+ await this.client.GET("/v1/{workspace_id}/pipeline/status", {
5075
+ params: { path: { workspace_id: this.workspaceId } }
5076
+ })
5077
+ );
5078
+ }
5079
+ /** Throughput buckets over the recent window */
5080
+ async getThroughput() {
5081
+ return extractData(
5082
+ await this.client.GET("/v1/{workspace_id}/pipeline/throughput", {
5083
+ params: { path: { workspace_id: this.workspaceId } }
5084
+ })
5085
+ );
5086
+ }
5087
+ /** Review backlog metrics (pending merges, pending escalations) */
5088
+ async getReview() {
5089
+ return extractData(
5090
+ await this.client.GET("/v1/{workspace_id}/pipeline/review", {
5091
+ params: { path: { workspace_id: this.workspaceId } }
5092
+ })
5093
+ );
5094
+ }
5095
+ /** Entity resolution metrics (merge rate, candidate rate, false-positive rate) */
5096
+ async getEntityResolution() {
5097
+ return extractData(
5098
+ await this.client.GET("/v1/{workspace_id}/pipeline/entity-resolution", {
5099
+ params: { path: { workspace_id: this.workspaceId } }
5100
+ })
5101
+ );
5102
+ }
5103
+ outbound = {
5104
+ /** List recent outbound deliveries */
5105
+ list: async () => extractData(
5106
+ await this.client.GET("/v1/{workspace_id}/pipeline/outbound", {
5107
+ params: { path: { workspace_id: this.workspaceId } }
5108
+ })
5109
+ ),
5110
+ /** Get the delivery log for a specific outbound data source */
5111
+ getLog: async (dataSourceId2, params) => extractData(
5112
+ await this.client.GET(
5113
+ "/v1/{workspace_id}/pipeline/outbound/{data_source_id}/log",
5114
+ {
5115
+ params: {
5116
+ path: { workspace_id: this.workspaceId, data_source_id: dataSourceId2 },
5117
+ query: params
5118
+ }
5119
+ }
5120
+ )
5121
+ )
5122
+ };
5123
+ sources = {
5124
+ /** List all configured pipeline sources */
5125
+ list: async (params) => extractData(
5126
+ await this.client.GET("/v1/{workspace_id}/pipeline/sources", {
5127
+ params: { path: { workspace_id: this.workspaceId }, query: params }
5128
+ })
5129
+ ),
5130
+ /** Get a per-source overview (last sync, error counts, deltas) */
5131
+ getOverview: async (sourceId) => extractData(
5132
+ await this.client.GET("/v1/{workspace_id}/pipeline/sources/{source_id}/overview", {
5133
+ params: { path: { workspace_id: this.workspaceId, source_id: sourceId } }
5134
+ })
5135
+ ),
5136
+ /** Stream the source's recent events */
5137
+ listEvents: async (sourceId, params) => extractData(
5138
+ await this.client.GET("/v1/{workspace_id}/pipeline/sources/{source_id}/events", {
5139
+ params: {
5140
+ path: { workspace_id: this.workspaceId, source_id: sourceId },
5141
+ query: params
5142
+ }
5143
+ })
5144
+ ),
5145
+ /** Per-source historical timeline */
5146
+ getHistory: async (sourceId) => extractData(
5147
+ await this.client.GET("/v1/{workspace_id}/pipeline/sources/{source_id}/history", {
5148
+ params: { path: { workspace_id: this.workspaceId, source_id: sourceId } }
5149
+ })
5150
+ )
5151
+ };
5152
+ };
5153
+
5154
+ // src/resources/tasks.ts
5155
+ var TasksResource = class extends WorkspaceScopedResource {
5156
+ /** Get the current state of a single task */
5157
+ async get(taskId) {
5158
+ return extractData(
5159
+ await this.client.GET("/v1/{workspace_id}/tasks/{task_id}", {
5160
+ params: { path: { workspace_id: this.workspaceId, task_id: taskId } }
5161
+ })
5162
+ );
5163
+ }
5164
+ /** List every task associated with a call (by Twilio call sid) */
5165
+ async listByCall(callSid) {
5166
+ return extractData(
5167
+ await this.client.GET("/v1/{workspace_id}/tasks/by-call/{call_sid}", {
5168
+ params: { path: { workspace_id: this.workspaceId, call_sid: callSid } }
5169
+ })
5170
+ );
5171
+ }
5172
+ };
5173
+
5174
+ // src/resources/tools.ts
5175
+ var ToolsResource = class extends WorkspaceScopedResource {
5176
+ /** Manually execute a tool call against the workspace's integrations */
5177
+ async execute(body) {
5178
+ return extractData(
5179
+ await this.client.POST("/v1/{workspace_id}/tools/execute", {
5180
+ params: { path: { workspace_id: this.workspaceId } },
5181
+ body
5182
+ })
5183
+ );
5184
+ }
5185
+ /** Resolve the bound tool implementations for a service */
5186
+ async resolveForService(serviceId2) {
5187
+ return extractData(
5188
+ await this.client.GET("/v1/{workspace_id}/services/{service_id}/tools/resolve", {
5189
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
5190
+ })
5191
+ );
5192
+ }
5193
+ };
5194
+
5195
+ // src/resources/surfaces.ts
5196
+ var SurfacesResource = class extends WorkspaceScopedResource {
5197
+ /** List surfaces in the workspace */
5198
+ async list(params) {
5199
+ return extractData(
5200
+ await this.client.GET("/v1/{workspace_id}/surfaces", {
5201
+ params: { path: { workspace_id: this.workspaceId }, query: params }
5202
+ })
5203
+ );
5204
+ }
5205
+ listAutoPaging(params) {
5206
+ return this.iteratePaginatedList((pageParams) => this.list(pageParams), params);
5207
+ }
5208
+ /** Surfaces awaiting review (pending approval / rejection) */
5209
+ async listForReview(params) {
5210
+ return extractData(
5211
+ await this.client.GET("/v1/{workspace_id}/surfaces/review", {
5212
+ params: { path: { workspace_id: this.workspaceId }, query: params }
5213
+ })
5214
+ );
5215
+ }
5216
+ /** Create a surface (form definition + delivery config) */
5217
+ async create(body) {
5218
+ return extractData(
5219
+ await this.client.POST("/v1/{workspace_id}/surfaces", {
5220
+ params: { path: { workspace_id: this.workspaceId } },
5221
+ body
5222
+ })
5223
+ );
5224
+ }
5225
+ /** Get a single surface */
5226
+ async get(surfaceId) {
5227
+ return extractData(
5228
+ await this.client.GET("/v1/{workspace_id}/surfaces/{surface_id}", {
5229
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } }
5230
+ })
5231
+ );
5232
+ }
5233
+ /** Update surface metadata or fields */
5234
+ async update(surfaceId, body) {
5235
+ return extractData(
5236
+ await this.client.PATCH("/v1/{workspace_id}/surfaces/{surface_id}", {
5237
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } },
5238
+ body
5239
+ })
5240
+ );
5241
+ }
5242
+ /** Archive (soft-delete) a surface */
5243
+ async archive(surfaceId) {
5244
+ return extractData(
5245
+ await this.client.DELETE("/v1/{workspace_id}/surfaces/{surface_id}", {
5246
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } }
5247
+ })
5248
+ );
5249
+ }
5250
+ /** Deliver the surface to the recipient (SMS/email/etc.) */
5251
+ async deliver(surfaceId, body) {
5252
+ return extractData(
5253
+ await this.client.POST("/v1/{workspace_id}/surfaces/{surface_id}/deliver", {
5254
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } },
5255
+ body
5256
+ })
5257
+ );
5258
+ }
5259
+ /** Get fill / completion progress for a surface */
5260
+ async getProgress(surfaceId) {
5261
+ return extractData(
5262
+ await this.client.GET("/v1/{workspace_id}/surfaces/{surface_id}/progress", {
5263
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } }
5264
+ })
5265
+ );
5266
+ }
5267
+ /** Approve a pending-review surface */
5268
+ async approve(surfaceId) {
5269
+ return extractData(
5270
+ await this.client.POST("/v1/{workspace_id}/surfaces/{surface_id}/approve", {
5271
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } }
5272
+ })
5273
+ );
5274
+ }
5275
+ /** Reject a pending-review surface */
5276
+ async reject(surfaceId, body) {
5277
+ return extractData(
5278
+ await this.client.POST("/v1/{workspace_id}/surfaces/{surface_id}/reject", {
5279
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } },
5280
+ body
5281
+ })
5282
+ );
5283
+ }
5284
+ /** Reshape — clone the surface with refined fields (review redirect) */
5285
+ async reshape(surfaceId) {
5286
+ return extractData(
5287
+ await this.client.POST("/v1/{workspace_id}/surfaces/{surface_id}/reshape", {
5288
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } }
5289
+ })
5290
+ );
5291
+ }
5292
+ };
5293
+
5294
+ // src/resources/sessions.ts
5295
+ var SessionsResource = class extends WorkspaceScopedResource {
5296
+ /** List currently active sessions across the workspace */
5297
+ async listActive() {
5298
+ return extractData(
5299
+ await this.client.GET("/v1/{workspace_id}/sessions/active", {
5300
+ params: { path: { workspace_id: this.workspaceId } }
5301
+ })
5302
+ );
5303
+ }
5304
+ /** Inject a one-shot directive (text/audio) into a live call session */
5305
+ async inject(callSid, body) {
5306
+ return extractData(
5307
+ await this.client.POST("/v1/{workspace_id}/sessions/{call_sid}/inject", {
5308
+ params: { path: { workspace_id: this.workspaceId, call_sid: callSid } },
5309
+ body
5310
+ })
5311
+ );
5312
+ }
5313
+ };
5314
+
4292
5315
  // src/core/branded-types.ts
4293
5316
  var workspaceId = (id) => id;
4294
5317
  var apiKeyId = (id) => id;
@@ -4922,6 +5945,7 @@ var AmigoClient = class _AmigoClient {
4922
5945
  baseUrl;
4923
5946
  agentBaseUrl;
4924
5947
  workspaces;
5948
+ me;
4925
5949
  apiKeys;
4926
5950
  agents;
4927
5951
  /** @deprecated Use `actions` instead */
@@ -4958,6 +5982,40 @@ var AmigoClient = class _AmigoClient {
4958
5982
  * {@link ObserversResource}.
4959
5983
  */
4960
5984
  observers;
5985
+ /** FHIR / EHR data interop — sync status, imports, resources, patient views */
5986
+ fhir;
5987
+ /** Natural-language insights — schema, suggestions, SQL, chat sessions */
5988
+ insights;
5989
+ /** Workspace monitor concepts (semantic patterns watched across calls) */
5990
+ monitorConcepts;
5991
+ /** Entity unification rules (declarative deduplication of world-model entities) */
5992
+ unificationRules;
5993
+ /** CRM — contacts, companies, deals, pipeline (sync from connected CRM integration) */
5994
+ crm;
5995
+ /** Command Center — rolled-up workspace homepage snapshot */
5996
+ commandCenter;
5997
+ /** Sensorium — operator-facing live agent loop observability */
5998
+ sensorium;
5999
+ /** Generic data query against whitelisted workspace datasets */
6000
+ dataQuery;
6001
+ /** AI-generated entity briefs (workspace-level + per-entity) */
6002
+ briefs;
6003
+ /** Remote-controlled desktop sessions for driving GUI-only third-party apps */
6004
+ desktopSessions;
6005
+ /** Patient intake — signed upload links + uploads */
6006
+ intake;
6007
+ /** Workspace network metadata (egress IP allowlist) */
6008
+ network;
6009
+ /** Data ingestion pipeline observability (sources, throughput, review backlog) */
6010
+ pipeline;
6011
+ /** Long-running async tasks (poll by id or list by call) */
6012
+ tasks;
6013
+ /** Manual tool execution + per-service tool resolution */
6014
+ tools;
6015
+ /** Surfaces — short-lived form/intake experiences (lifecycle: create→deliver→review→approve) */
6016
+ surfaces;
6017
+ /** Live agent sessions — list active calls + inject mid-call directives */
6018
+ sessions;
4961
6019
  /** @internal — exposed for path-level type inference in GET/POST/PUT/etc. */
4962
6020
  api;
4963
6021
  constructor(config) {
@@ -5029,6 +6087,7 @@ var AmigoClient = class _AmigoClient {
5029
6087
  mutable.agentBaseUrl = agentBaseUrl;
5030
6088
  target.api = client;
5031
6089
  mutable.workspaces = new WorkspacesResource(client, workspaceId2);
6090
+ mutable.me = new MeResource(client, "_account");
5032
6091
  mutable.apiKeys = new ApiKeysResource(client, workspaceId2);
5033
6092
  mutable.agents = new AgentsResource(client, workspaceId2);
5034
6093
  mutable.skills = new SkillsResource(client, workspaceId2);
@@ -5059,6 +6118,23 @@ var AmigoClient = class _AmigoClient {
5059
6118
  mutable.events = new EventsResource(client, workspaceId2);
5060
6119
  mutable.functions = new FunctionsResource(client, workspaceId2);
5061
6120
  mutable.observers = new ObserversResource(client, workspaceId2, agentBaseUrl);
6121
+ mutable.fhir = new FhirResource(client, workspaceId2);
6122
+ mutable.insights = new InsightsResource(client, workspaceId2);
6123
+ mutable.monitorConcepts = new MonitorConceptsResource(client, workspaceId2);
6124
+ mutable.unificationRules = new UnificationRulesResource(client, workspaceId2);
6125
+ mutable.crm = new CrmResource(client, workspaceId2);
6126
+ mutable.commandCenter = new CommandCenterResource(client, workspaceId2);
6127
+ mutable.sensorium = new SensoriumResource(client, workspaceId2);
6128
+ mutable.dataQuery = new DataQueryResource(client, workspaceId2);
6129
+ mutable.briefs = new BriefsResource(client, workspaceId2);
6130
+ mutable.desktopSessions = new DesktopSessionsResource(client, workspaceId2);
6131
+ mutable.intake = new IntakeResource(client, workspaceId2);
6132
+ mutable.network = new NetworkResource(client, workspaceId2);
6133
+ mutable.pipeline = new PipelineResource(client, workspaceId2);
6134
+ mutable.tasks = new TasksResource(client, workspaceId2);
6135
+ mutable.tools = new ToolsResource(client, workspaceId2);
6136
+ mutable.surfaces = new SurfacesResource(client, workspaceId2);
6137
+ mutable.sessions = new SessionsResource(client, workspaceId2);
5062
6138
  }
5063
6139
  async resolveApiRequest(path, method, init) {
5064
6140
  const { baseClient, options } = resolveScopedPlatformClient(this.api);