@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.cjs CHANGED
@@ -993,16 +993,27 @@ function resolveScopedPlatformClient(client) {
993
993
  };
994
994
  }
995
995
 
996
- // src/resources/workspaces.ts
997
- var WorkspacesResource = class extends WorkspaceScopedResource {
998
- /** Create a workspace for the authenticated user and attach owner access */
999
- async createSelfService(body) {
996
+ // src/resources/me.ts
997
+ var MeResource = class extends WorkspaceScopedResource {
998
+ /**
999
+ * Create a workspace owned by the authenticated identity.
1000
+ *
1001
+ * The caller is bootstrapped as the workspace's owner. Use this
1002
+ * method anywhere that previously called
1003
+ * ``client.workspaces.createSelfService(body)`` — the request body
1004
+ * shape and response are unchanged; only the URL moved.
1005
+ */
1006
+ async createWorkspace(body) {
1000
1007
  return extractData(
1001
- await this.client.POST("/v1/workspaces/self-service", {
1008
+ await this.client.POST("/v1/me/workspaces", {
1002
1009
  body
1003
1010
  })
1004
1011
  );
1005
1012
  }
1013
+ };
1014
+
1015
+ // src/resources/workspaces.ts
1016
+ var WorkspacesResource = class extends WorkspaceScopedResource {
1006
1017
  /** List workspaces accessible to the current API key */
1007
1018
  async list(params) {
1008
1019
  return extractData(
@@ -1068,6 +1079,35 @@ var WorkspacesResource = class extends WorkspaceScopedResource {
1068
1079
  })
1069
1080
  );
1070
1081
  }
1082
+ /**
1083
+ * Workspace-allowlisted phone numbers that can place test calls into voice
1084
+ * agents. The list is read-mostly; writes overwrite the entire allowlist.
1085
+ *
1086
+ * Always operates on the bound workspace. Use `client.withOptions(...)` or
1087
+ * construct a second `AmigoClient` if you need to act on a different
1088
+ * workspace.
1089
+ */
1090
+ testCallerNumbers = {
1091
+ /** Get the workspace's test caller allowlist */
1092
+ get: async () => extractData(
1093
+ await this.client.GET("/v1/workspaces/{workspace_id}/test-caller-numbers", {
1094
+ params: { path: { workspace_id: this.workspaceId } }
1095
+ })
1096
+ ),
1097
+ /**
1098
+ * Replace the workspace's test caller allowlist.
1099
+ *
1100
+ * **Replace-all semantics:** the request body fully replaces the existing
1101
+ * allowlist; numbers omitted from `body` are removed. Read first, mutate,
1102
+ * then write to add/remove individual entries safely.
1103
+ */
1104
+ update: async (body) => extractData(
1105
+ await this.client.PUT("/v1/workspaces/{workspace_id}/test-caller-numbers", {
1106
+ params: { path: { workspace_id: this.workspaceId } },
1107
+ body
1108
+ })
1109
+ )
1110
+ };
1071
1111
  };
1072
1112
 
1073
1113
  // src/resources/api-keys.ts
@@ -2041,6 +2081,34 @@ var CallsResource = class extends WorkspaceScopedResource {
2041
2081
  })
2042
2082
  );
2043
2083
  }
2084
+ /** List trace analyses across calls (workspace-scoped feed) */
2085
+ async listTraces(params) {
2086
+ return extractData(
2087
+ await this.client.GET("/v1/{workspace_id}/calls/traces", {
2088
+ params: { path: { workspace_id: this.workspaceId }, query: params }
2089
+ })
2090
+ );
2091
+ }
2092
+ /** Get latest Universal Metric Store values scoped to a single call */
2093
+ async getMetrics(callId2, params) {
2094
+ return extractData(
2095
+ await this.client.GET("/v1/{workspace_id}/calls/{call_id}/metrics", {
2096
+ params: {
2097
+ path: { workspace_id: this.workspaceId, call_id: callId2 },
2098
+ query: params
2099
+ }
2100
+ })
2101
+ );
2102
+ }
2103
+ /** Place an outbound call from the workspace's voice pipeline */
2104
+ async createOutbound(body) {
2105
+ return extractData(
2106
+ await this.client.POST("/v1/{workspace_id}/calls/outbound", {
2107
+ params: { path: { workspace_id: this.workspaceId } },
2108
+ body
2109
+ })
2110
+ );
2111
+ }
2044
2112
  };
2045
2113
 
2046
2114
  // src/resources/conversations.ts
@@ -2722,6 +2790,34 @@ var AnalyticsResource = class extends WorkspaceScopedResource {
2722
2790
  })
2723
2791
  );
2724
2792
  }
2793
+ /**
2794
+ * Surfaces analytics — completion rates, channel effectiveness, field
2795
+ * abandonment, and per-entity breakdowns. Used by the developer console's
2796
+ * surfaces analytics tab.
2797
+ */
2798
+ surfaces = {
2799
+ getCompletionRates: async (params) => extractData(
2800
+ await this.client.GET("/v1/{workspace_id}/analytics/surfaces/completion-rates", {
2801
+ params: { path: { workspace_id: this.workspaceId }, query: params }
2802
+ })
2803
+ ),
2804
+ getChannelEffectiveness: async (params) => extractData(
2805
+ await this.client.GET("/v1/{workspace_id}/analytics/surfaces/channel-effectiveness", {
2806
+ params: { path: { workspace_id: this.workspaceId }, query: params }
2807
+ })
2808
+ ),
2809
+ getFieldAbandonment: async (params) => extractData(
2810
+ await this.client.GET("/v1/{workspace_id}/analytics/surfaces/field-abandonment", {
2811
+ params: { path: { workspace_id: this.workspaceId }, query: params }
2812
+ })
2813
+ ),
2814
+ /** Per-entity surfaces analytics (which surfaces a specific entity has seen) */
2815
+ getForEntity: async (entityId2) => extractData(
2816
+ await this.client.GET("/v1/{workspace_id}/analytics/surfaces/entity/{entity_id}", {
2817
+ params: { path: { workspace_id: this.workspaceId, entity_id: entityId2 } }
2818
+ })
2819
+ )
2820
+ };
2725
2821
  };
2726
2822
 
2727
2823
  // src/resources/simulations.ts
@@ -2783,6 +2879,108 @@ var SimulationsResource = class extends WorkspaceScopedResource {
2783
2879
  })
2784
2880
  );
2785
2881
  }
2882
+ /**
2883
+ * Multi-session simulation runs — orchestrate a batch of scenarios against
2884
+ * a service to compute coverage and surface regressions. Use this when you
2885
+ * want to compare branch behavior or measure drift between versions.
2886
+ *
2887
+ * @beta New in this release; surface may evolve.
2888
+ */
2889
+ runs = {
2890
+ /** List simulation runs in the workspace */
2891
+ list: async (params) => extractData(
2892
+ await this.client.GET("/v1/{workspace_id}/simulations/runs", {
2893
+ params: { path: { workspace_id: this.workspaceId }, query: params }
2894
+ })
2895
+ ),
2896
+ /** Create a new simulation run */
2897
+ create: async (body) => extractData(
2898
+ await this.client.POST("/v1/{workspace_id}/simulations/runs", {
2899
+ params: { path: { workspace_id: this.workspaceId } },
2900
+ body
2901
+ })
2902
+ ),
2903
+ /** Get a simulation run with its scenarios + status */
2904
+ get: async (runId) => extractData(
2905
+ await this.client.GET("/v1/{workspace_id}/simulations/runs/{run_id}", {
2906
+ params: { path: { workspace_id: this.workspaceId, run_id: runId } }
2907
+ })
2908
+ ),
2909
+ /** Mark a run as complete (used by the harness once all sessions finish) */
2910
+ complete: async (runId) => extractData(
2911
+ await this.client.POST("/v1/{workspace_id}/simulations/runs/{run_id}/complete", {
2912
+ params: { path: { workspace_id: this.workspaceId, run_id: runId } }
2913
+ })
2914
+ ),
2915
+ /** Spin up a session under a run (single scenario inside the run's batch) */
2916
+ createSession: async (runId, body) => extractData(
2917
+ await this.client.POST("/v1/{workspace_id}/simulations/runs/{run_id}/sessions", {
2918
+ params: { path: { workspace_id: this.workspaceId, run_id: runId } },
2919
+ body
2920
+ })
2921
+ )
2922
+ };
2923
+ /**
2924
+ * Bridge — convert recorded production calls into simulation scenarios so
2925
+ * they can be replayed against a candidate version. ``plan`` returns a
2926
+ * preview of which calls would be selected; ``run`` executes the plan.
2927
+ */
2928
+ bridge = {
2929
+ /** Plan a bridge run — returns the candidate scenarios without executing */
2930
+ plan: async (body) => extractData(
2931
+ await this.client.POST("/v1/{workspace_id}/simulations/bridge/plan", {
2932
+ params: { path: { workspace_id: this.workspaceId } },
2933
+ body
2934
+ })
2935
+ ),
2936
+ /** Execute a bridge run and return the resulting run handle */
2937
+ run: async (body) => extractData(
2938
+ await this.client.POST("/v1/{workspace_id}/simulations/bridge", {
2939
+ params: { path: { workspace_id: this.workspaceId } },
2940
+ body
2941
+ })
2942
+ )
2943
+ };
2944
+ /**
2945
+ * Per-service simulation views — graph of explored conversation paths,
2946
+ * recorded sessions, and per-turn telemetry. Used by the developer console's
2947
+ * coverage tab to visualize what scenarios have been exercised.
2948
+ */
2949
+ services = {
2950
+ /** Get the conversation graph (nodes/edges) for a service */
2951
+ getGraph: async (serviceId2) => extractData(
2952
+ await this.client.GET("/v1/{workspace_id}/simulations/services/{service_id}/graph", {
2953
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
2954
+ })
2955
+ ),
2956
+ /** Reset / delete the service's accumulated graph */
2957
+ deleteGraph: async (serviceId2) => extractData(
2958
+ await this.client.DELETE("/v1/{workspace_id}/simulations/services/{service_id}/graph", {
2959
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
2960
+ })
2961
+ ),
2962
+ /** Get the set of explored conversation paths through the graph */
2963
+ getGraphPaths: async (serviceId2) => extractData(
2964
+ await this.client.GET(
2965
+ "/v1/{workspace_id}/simulations/services/{service_id}/graph/paths",
2966
+ {
2967
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
2968
+ }
2969
+ )
2970
+ ),
2971
+ /** List recorded sessions for the service */
2972
+ listSessions: async (serviceId2) => extractData(
2973
+ await this.client.GET("/v1/{workspace_id}/simulations/services/{service_id}/sessions", {
2974
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
2975
+ })
2976
+ ),
2977
+ /** List per-turn observations for the service */
2978
+ listTurns: async (serviceId2) => extractData(
2979
+ await this.client.GET("/v1/{workspace_id}/simulations/services/{service_id}/turns", {
2980
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
2981
+ })
2982
+ )
2983
+ };
2786
2984
  };
2787
2985
 
2788
2986
  // src/resources/metrics.ts
@@ -2931,6 +3129,27 @@ var SettingsResource = class extends WorkspaceScopedResource {
2931
3129
  params: { path: { workspace_id: this.workspaceId } },
2932
3130
  body
2933
3131
  })
3132
+ ),
3133
+ /**
3134
+ * Preview which calls would be flagged by the current gap-scanner config.
3135
+ *
3136
+ * The spec types the body as `GapScannerPreviewRequest | null`, but the
3137
+ * `null` branch only matters when the caller wants to *explicitly* clear
3138
+ * the body. Modeling as `body?: GapScannerPreviewRequest` keeps the SDK
3139
+ * surface consistent with every other POST wrapper; consumers who need
3140
+ * to send the literal `null` can do so via `client.POST(...)` directly.
3141
+ */
3142
+ preview: async (body) => extractData(
3143
+ await this.client.POST("/v1/{workspace_id}/settings/gap-scanner/preview", {
3144
+ params: { path: { workspace_id: this.workspaceId } },
3145
+ body
3146
+ })
3147
+ ),
3148
+ /** Trigger an on-demand scan with the current gap-scanner config */
3149
+ scan: async () => extractData(
3150
+ await this.client.POST("/v1/{workspace_id}/settings/gap-scanner/scan", {
3151
+ params: { path: { workspace_id: this.workspaceId } }
3152
+ })
2934
3153
  )
2935
3154
  };
2936
3155
  scribe = {
@@ -4397,6 +4616,810 @@ function parseObserverFrame(data) {
4397
4616
  return obj;
4398
4617
  }
4399
4618
 
4619
+ // src/resources/fhir.ts
4620
+ var FhirResource = class extends WorkspaceScopedResource {
4621
+ /** Get current FHIR sync status (server identity, last sync, counts) */
4622
+ async getStatus() {
4623
+ return extractData(
4624
+ await this.client.GET("/v1/{workspace_id}/fhir/status", {
4625
+ params: { path: { workspace_id: this.workspaceId } }
4626
+ })
4627
+ );
4628
+ }
4629
+ /** List recent FHIR sync failures (for triage) */
4630
+ async getSyncFailures(params) {
4631
+ return extractData(
4632
+ await this.client.GET("/v1/{workspace_id}/fhir/sync-failures", {
4633
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4634
+ })
4635
+ );
4636
+ }
4637
+ /** Trigger a FHIR import (full or partial, depending on request) */
4638
+ async import(body) {
4639
+ return extractData(
4640
+ await this.client.POST("/v1/{workspace_id}/fhir/import", {
4641
+ params: { path: { workspace_id: this.workspaceId } },
4642
+ body
4643
+ })
4644
+ );
4645
+ }
4646
+ /** Search patients by demographics or identifiers */
4647
+ async searchPatients(params) {
4648
+ return extractData(
4649
+ await this.client.GET("/v1/{workspace_id}/fhir/patients", {
4650
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4651
+ })
4652
+ );
4653
+ }
4654
+ /** Get a patient summary (canonical demographics + active conditions/meds) */
4655
+ async getPatientSummary(patientId) {
4656
+ return extractData(
4657
+ await this.client.GET("/v1/{workspace_id}/fhir/patients/{patient_id}/summary", {
4658
+ params: { path: { workspace_id: this.workspaceId, patient_id: patientId } }
4659
+ })
4660
+ );
4661
+ }
4662
+ /** Get a patient's longitudinal clinical timeline */
4663
+ async getPatientTimeline(patientId) {
4664
+ return extractData(
4665
+ await this.client.GET("/v1/{workspace_id}/fhir/patients/{patient_id}/timeline", {
4666
+ params: { path: { workspace_id: this.workspaceId, patient_id: patientId } }
4667
+ })
4668
+ );
4669
+ }
4670
+ resources = {
4671
+ /** Search FHIR resources of a given type (passes search params through to FHIR) */
4672
+ search: async (resourceType, params) => extractData(
4673
+ await this.client.GET("/v1/{workspace_id}/fhir/resources/{resource_type}", {
4674
+ params: {
4675
+ path: { workspace_id: this.workspaceId, resource_type: resourceType },
4676
+ query: params
4677
+ }
4678
+ })
4679
+ ),
4680
+ /** Create a FHIR resource of the given type */
4681
+ create: async (resourceType, body) => extractData(
4682
+ await this.client.POST("/v1/{workspace_id}/fhir/resources/{resource_type}", {
4683
+ params: { path: { workspace_id: this.workspaceId, resource_type: resourceType } },
4684
+ body
4685
+ })
4686
+ ),
4687
+ /** Get a single FHIR resource by type + id */
4688
+ get: async (resourceType, resourceId) => extractData(
4689
+ await this.client.GET(
4690
+ "/v1/{workspace_id}/fhir/resources/{resource_type}/{resource_id}",
4691
+ {
4692
+ params: {
4693
+ path: {
4694
+ workspace_id: this.workspaceId,
4695
+ resource_type: resourceType,
4696
+ resource_id: resourceId
4697
+ }
4698
+ }
4699
+ }
4700
+ )
4701
+ ),
4702
+ /** Update a FHIR resource by type + id */
4703
+ update: async (resourceType, resourceId, body) => extractData(
4704
+ await this.client.PUT(
4705
+ "/v1/{workspace_id}/fhir/resources/{resource_type}/{resource_id}",
4706
+ {
4707
+ params: {
4708
+ path: {
4709
+ workspace_id: this.workspaceId,
4710
+ resource_type: resourceType,
4711
+ resource_id: resourceId
4712
+ }
4713
+ },
4714
+ body
4715
+ }
4716
+ )
4717
+ ),
4718
+ /** Get the version history for a FHIR resource */
4719
+ getHistory: async (resourceType, resourceId) => extractData(
4720
+ await this.client.GET(
4721
+ "/v1/{workspace_id}/fhir/resources/{resource_type}/{resource_id}/history",
4722
+ {
4723
+ params: {
4724
+ path: {
4725
+ workspace_id: this.workspaceId,
4726
+ resource_type: resourceType,
4727
+ resource_id: resourceId
4728
+ }
4729
+ }
4730
+ }
4731
+ )
4732
+ )
4733
+ };
4734
+ views = {
4735
+ /** List patients (typed view with computed display fields) */
4736
+ patients: async (params) => extractData(
4737
+ await this.client.GET("/v1/{workspace_id}/fhir/views/patients", {
4738
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4739
+ })
4740
+ ),
4741
+ /** List appointments */
4742
+ appointments: async (params) => extractData(
4743
+ await this.client.GET("/v1/{workspace_id}/fhir/views/appointments", {
4744
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4745
+ })
4746
+ ),
4747
+ /** List practitioners */
4748
+ practitioners: async (params) => extractData(
4749
+ await this.client.GET("/v1/{workspace_id}/fhir/views/practitioners", {
4750
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4751
+ })
4752
+ ),
4753
+ /** List organizations */
4754
+ organizations: async (params) => extractData(
4755
+ await this.client.GET("/v1/{workspace_id}/fhir/views/organizations", {
4756
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4757
+ })
4758
+ ),
4759
+ /** List locations */
4760
+ locations: async (params) => extractData(
4761
+ await this.client.GET("/v1/{workspace_id}/fhir/views/locations", {
4762
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4763
+ })
4764
+ ),
4765
+ /**
4766
+ * List schedule slots — supports richer filtering than the other views
4767
+ * (status, date window, provider, specialty, service_type, facility_id).
4768
+ */
4769
+ slots: async (params) => extractData(
4770
+ await this.client.GET("/v1/{workspace_id}/fhir/views/slots", {
4771
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4772
+ })
4773
+ )
4774
+ };
4775
+ };
4776
+
4777
+ // src/resources/insights.ts
4778
+ var InsightsResource = class extends WorkspaceScopedResource {
4779
+ /** Get the periodic insights digest for the workspace */
4780
+ async getDigest() {
4781
+ return extractData(
4782
+ await this.client.GET("/v1/{workspace_id}/insights/digest", {
4783
+ params: { path: { workspace_id: this.workspaceId } }
4784
+ })
4785
+ );
4786
+ }
4787
+ /** Fetch the queryable schema (tables, columns, joins) the assistant uses */
4788
+ async getSchema() {
4789
+ return extractData(
4790
+ await this.client.GET("/v1/{workspace_id}/insights/schema", {
4791
+ params: { path: { workspace_id: this.workspaceId } }
4792
+ })
4793
+ );
4794
+ }
4795
+ /** Get curated query suggestions for the workspace */
4796
+ async getSuggestions() {
4797
+ return extractData(
4798
+ await this.client.GET("/v1/{workspace_id}/insights/suggestions", {
4799
+ params: { path: { workspace_id: this.workspaceId } }
4800
+ })
4801
+ );
4802
+ }
4803
+ /** Run an ad-hoc SQL query against the insights warehouse */
4804
+ async runSql(body) {
4805
+ return extractData(
4806
+ await this.client.POST("/v1/{workspace_id}/insights/sql", {
4807
+ params: { path: { workspace_id: this.workspaceId } },
4808
+ body
4809
+ })
4810
+ );
4811
+ }
4812
+ sessions = {
4813
+ /** Start a new insights chat session */
4814
+ create: async () => extractData(
4815
+ await this.client.POST("/v1/{workspace_id}/insights/sessions", {
4816
+ params: { path: { workspace_id: this.workspaceId } }
4817
+ })
4818
+ ),
4819
+ /** Get a session and its full history */
4820
+ get: async (sessionId) => extractData(
4821
+ await this.client.GET("/v1/{workspace_id}/insights/sessions/{session_id}", {
4822
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } }
4823
+ })
4824
+ ),
4825
+ /** Send a chat message and get the assistant's response (with any generated SQL/results) */
4826
+ chat: async (sessionId, body) => extractData(
4827
+ await this.client.POST("/v1/{workspace_id}/insights/sessions/{session_id}/chat", {
4828
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } },
4829
+ body
4830
+ })
4831
+ )
4832
+ };
4833
+ };
4834
+
4835
+ // src/resources/monitor-concepts.ts
4836
+ var MonitorConceptsResource = class extends WorkspaceScopedResource {
4837
+ /** Create a new monitor concept */
4838
+ async create(body) {
4839
+ return extractData(
4840
+ await this.client.POST("/v1/{workspace_id}/monitor-concepts", {
4841
+ params: { path: { workspace_id: this.workspaceId } },
4842
+ body
4843
+ })
4844
+ );
4845
+ }
4846
+ /** List monitor concepts in the workspace */
4847
+ async list(params) {
4848
+ return extractData(
4849
+ await this.client.GET("/v1/{workspace_id}/monitor-concepts", {
4850
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4851
+ })
4852
+ );
4853
+ }
4854
+ listAutoPaging(params) {
4855
+ return this.iteratePaginatedList((pageParams) => this.list(pageParams), params);
4856
+ }
4857
+ /** Get a single monitor concept */
4858
+ async get(conceptId) {
4859
+ return extractData(
4860
+ await this.client.GET("/v1/{workspace_id}/monitor-concepts/{concept_id}", {
4861
+ params: { path: { workspace_id: this.workspaceId, concept_id: conceptId } }
4862
+ })
4863
+ );
4864
+ }
4865
+ /** Update a monitor concept */
4866
+ async update(conceptId, body) {
4867
+ return extractData(
4868
+ await this.client.PATCH("/v1/{workspace_id}/monitor-concepts/{concept_id}", {
4869
+ params: { path: { workspace_id: this.workspaceId, concept_id: conceptId } },
4870
+ body
4871
+ })
4872
+ );
4873
+ }
4874
+ /** Delete a monitor concept */
4875
+ async delete(conceptId) {
4876
+ return extractData(
4877
+ await this.client.DELETE("/v1/{workspace_id}/monitor-concepts/{concept_id}", {
4878
+ params: { path: { workspace_id: this.workspaceId, concept_id: conceptId } }
4879
+ })
4880
+ );
4881
+ }
4882
+ };
4883
+
4884
+ // src/resources/unification-rules.ts
4885
+ var UnificationRulesResource = class extends WorkspaceScopedResource {
4886
+ /** Create a new unification rule */
4887
+ async create(body) {
4888
+ return extractData(
4889
+ await this.client.POST("/v1/{workspace_id}/unification-rules", {
4890
+ params: { path: { workspace_id: this.workspaceId } },
4891
+ body
4892
+ })
4893
+ );
4894
+ }
4895
+ /** List unification rules in the workspace */
4896
+ async list(params) {
4897
+ return extractData(
4898
+ await this.client.GET("/v1/{workspace_id}/unification-rules", {
4899
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4900
+ })
4901
+ );
4902
+ }
4903
+ listAutoPaging(params) {
4904
+ return this.iteratePaginatedList((pageParams) => this.list(pageParams), params);
4905
+ }
4906
+ /** Get a single unification rule */
4907
+ async get(ruleId) {
4908
+ return extractData(
4909
+ await this.client.GET("/v1/{workspace_id}/unification-rules/{rule_id}", {
4910
+ params: { path: { workspace_id: this.workspaceId, rule_id: ruleId } }
4911
+ })
4912
+ );
4913
+ }
4914
+ /** Update a unification rule */
4915
+ async update(ruleId, body) {
4916
+ return extractData(
4917
+ await this.client.PATCH("/v1/{workspace_id}/unification-rules/{rule_id}", {
4918
+ params: { path: { workspace_id: this.workspaceId, rule_id: ruleId } },
4919
+ body
4920
+ })
4921
+ );
4922
+ }
4923
+ /** Delete a unification rule */
4924
+ async delete(ruleId) {
4925
+ return extractData(
4926
+ await this.client.DELETE("/v1/{workspace_id}/unification-rules/{rule_id}", {
4927
+ params: { path: { workspace_id: this.workspaceId, rule_id: ruleId } }
4928
+ })
4929
+ );
4930
+ }
4931
+ };
4932
+
4933
+ // src/resources/crm.ts
4934
+ var CrmResource = class extends WorkspaceScopedResource {
4935
+ /** Health/status of the workspace's CRM integration sync */
4936
+ async getStatus() {
4937
+ return extractData(
4938
+ await this.client.GET("/v1/{workspace_id}/crm/status", {
4939
+ params: { path: { workspace_id: this.workspaceId } }
4940
+ })
4941
+ );
4942
+ }
4943
+ contacts = {
4944
+ list: async (params) => extractData(
4945
+ await this.client.GET("/v1/{workspace_id}/crm/contacts", {
4946
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4947
+ })
4948
+ ),
4949
+ get: async (contactId) => extractData(
4950
+ await this.client.GET("/v1/{workspace_id}/crm/contacts/{contact_id}", {
4951
+ params: { path: { workspace_id: this.workspaceId, contact_id: contactId } }
4952
+ })
4953
+ ),
4954
+ /** Per-contact activity timeline (calls, emails, deal events) */
4955
+ getTimeline: async (contactId) => extractData(
4956
+ await this.client.GET("/v1/{workspace_id}/crm/contacts/{contact_id}/timeline", {
4957
+ params: { path: { workspace_id: this.workspaceId, contact_id: contactId } }
4958
+ })
4959
+ )
4960
+ };
4961
+ companies = {
4962
+ list: async (params) => extractData(
4963
+ await this.client.GET("/v1/{workspace_id}/crm/companies", {
4964
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4965
+ })
4966
+ ),
4967
+ get: async (companyId) => extractData(
4968
+ await this.client.GET("/v1/{workspace_id}/crm/companies/{company_id}", {
4969
+ params: { path: { workspace_id: this.workspaceId, company_id: companyId } }
4970
+ })
4971
+ )
4972
+ };
4973
+ deals = {
4974
+ list: async (params) => extractData(
4975
+ await this.client.GET("/v1/{workspace_id}/crm/deals", {
4976
+ params: { path: { workspace_id: this.workspaceId }, query: params }
4977
+ })
4978
+ ),
4979
+ get: async (dealId) => extractData(
4980
+ await this.client.GET("/v1/{workspace_id}/crm/deals/{deal_id}", {
4981
+ params: { path: { workspace_id: this.workspaceId, deal_id: dealId } }
4982
+ })
4983
+ ),
4984
+ /** Aggregated pipeline view: deals grouped by stage with rolled-up totals */
4985
+ getPipeline: async () => extractData(
4986
+ await this.client.GET("/v1/{workspace_id}/crm/deals/pipeline", {
4987
+ params: { path: { workspace_id: this.workspaceId } }
4988
+ })
4989
+ )
4990
+ };
4991
+ };
4992
+
4993
+ // src/resources/command-center.ts
4994
+ var CommandCenterResource = class extends WorkspaceScopedResource {
4995
+ /** Get the current command-center snapshot */
4996
+ async get() {
4997
+ return extractData(
4998
+ await this.client.GET("/v1/{workspace_id}/command-center", {
4999
+ params: { path: { workspace_id: this.workspaceId } }
5000
+ })
5001
+ );
5002
+ }
5003
+ };
5004
+
5005
+ // src/resources/sensorium.ts
5006
+ var SensoriumResource = class extends WorkspaceScopedResource {
5007
+ /** Per-connector health snapshot (status + latency) */
5008
+ async getConnectorHealth() {
5009
+ return extractData(
5010
+ await this.client.GET("/v1/{workspace_id}/sensorium/connector-health", {
5011
+ params: { path: { workspace_id: this.workspaceId } }
5012
+ })
5013
+ );
5014
+ }
5015
+ /** End-to-end agent loop latency breakdown (per-stage timings) */
5016
+ async getLoopLatency() {
5017
+ return extractData(
5018
+ await this.client.GET("/v1/{workspace_id}/sensorium/loop-latency", {
5019
+ params: { path: { workspace_id: this.workspaceId } }
5020
+ })
5021
+ );
5022
+ }
5023
+ };
5024
+
5025
+ // src/resources/data-query.ts
5026
+ var DataQueryResource = class extends WorkspaceScopedResource {
5027
+ /** Run a tabular query against a workspace dataset */
5028
+ async run(schema, table, params) {
5029
+ return extractData(
5030
+ await this.client.GET("/v1/{workspace_id}/query/{schema}/{table}", {
5031
+ params: {
5032
+ path: { workspace_id: this.workspaceId, schema, table },
5033
+ query: params
5034
+ }
5035
+ })
5036
+ );
5037
+ }
5038
+ };
5039
+
5040
+ // src/resources/briefs.ts
5041
+ var BriefsResource = class extends WorkspaceScopedResource {
5042
+ /** Get the workspace-level brief */
5043
+ async get() {
5044
+ return extractData(
5045
+ await this.client.GET("/v1/{workspace_id}/brief", {
5046
+ params: { path: { workspace_id: this.workspaceId } }
5047
+ })
5048
+ );
5049
+ }
5050
+ /** Regenerate the workspace-level brief */
5051
+ async regenerate() {
5052
+ return extractData(
5053
+ await this.client.POST("/v1/{workspace_id}/brief", {
5054
+ params: { path: { workspace_id: this.workspaceId } }
5055
+ })
5056
+ );
5057
+ }
5058
+ /** Get the brief for a specific entity */
5059
+ async getForEntity(entityId2) {
5060
+ return extractData(
5061
+ await this.client.GET("/v1/{workspace_id}/entities/{entity_id}/brief", {
5062
+ params: { path: { workspace_id: this.workspaceId, entity_id: entityId2 } }
5063
+ })
5064
+ );
5065
+ }
5066
+ /** Regenerate the brief for a specific entity */
5067
+ async regenerateForEntity(entityId2) {
5068
+ return extractData(
5069
+ await this.client.POST("/v1/{workspace_id}/entities/{entity_id}/brief", {
5070
+ params: { path: { workspace_id: this.workspaceId, entity_id: entityId2 } }
5071
+ })
5072
+ );
5073
+ }
5074
+ };
5075
+
5076
+ // src/resources/desktop-sessions.ts
5077
+ var DesktopSessionsResource = class extends WorkspaceScopedResource {
5078
+ /** Spin up a new desktop session */
5079
+ async create(body) {
5080
+ return extractData(
5081
+ await this.client.POST("/v1/{workspace_id}/desktop-sessions", {
5082
+ params: { path: { workspace_id: this.workspaceId } },
5083
+ body
5084
+ })
5085
+ );
5086
+ }
5087
+ /** Disconnect / tear down a desktop session */
5088
+ async disconnect(sessionId) {
5089
+ return extractData(
5090
+ await this.client.DELETE("/v1/{workspace_id}/desktop-sessions/{session_id}", {
5091
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } }
5092
+ })
5093
+ );
5094
+ }
5095
+ /** Drive a click / type / scroll action against the session */
5096
+ async sendAction(sessionId, body) {
5097
+ return extractData(
5098
+ await this.client.POST("/v1/{workspace_id}/desktop-sessions/{session_id}/action", {
5099
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } },
5100
+ body
5101
+ })
5102
+ );
5103
+ }
5104
+ /** Get the latest screenshot for a session */
5105
+ async getScreenshot(sessionId) {
5106
+ return extractData(
5107
+ await this.client.GET("/v1/{workspace_id}/desktop-sessions/{session_id}/screenshot", {
5108
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } }
5109
+ })
5110
+ );
5111
+ }
5112
+ /** Get the session's current connection + activity status */
5113
+ async getStatus(sessionId) {
5114
+ return extractData(
5115
+ await this.client.GET("/v1/{workspace_id}/desktop-sessions/{session_id}/status", {
5116
+ params: { path: { workspace_id: this.workspaceId, session_id: sessionId } }
5117
+ })
5118
+ );
5119
+ }
5120
+ };
5121
+
5122
+ // src/resources/intake.ts
5123
+ var IntakeResource = class extends WorkspaceScopedResource {
5124
+ links = {
5125
+ list: async (params) => extractData(
5126
+ await this.client.GET("/v1/{workspace_id}/intake/links", {
5127
+ params: { path: { workspace_id: this.workspaceId }, query: params }
5128
+ })
5129
+ ),
5130
+ create: async (body) => extractData(
5131
+ await this.client.POST("/v1/{workspace_id}/intake/links", {
5132
+ params: { path: { workspace_id: this.workspaceId } },
5133
+ body
5134
+ })
5135
+ ),
5136
+ delete: async (linkId) => extractData(
5137
+ await this.client.DELETE("/v1/{workspace_id}/intake/links/{link_id}", {
5138
+ params: { path: { workspace_id: this.workspaceId, link_id: linkId } }
5139
+ })
5140
+ ),
5141
+ /** List uploads received against a link */
5142
+ listUploads: async (linkId) => extractData(
5143
+ await this.client.GET("/v1/{workspace_id}/intake/links/{link_id}/uploads", {
5144
+ params: { path: { workspace_id: this.workspaceId, link_id: linkId } }
5145
+ })
5146
+ ),
5147
+ /** Get a download URL/payload for a single upload */
5148
+ downloadUpload: async (linkId, uploadId) => extractData(
5149
+ await this.client.GET(
5150
+ "/v1/{workspace_id}/intake/links/{link_id}/uploads/{upload_id}/download",
5151
+ {
5152
+ params: {
5153
+ path: {
5154
+ workspace_id: this.workspaceId,
5155
+ link_id: linkId,
5156
+ upload_id: uploadId
5157
+ }
5158
+ }
5159
+ }
5160
+ )
5161
+ )
5162
+ };
5163
+ };
5164
+
5165
+ // src/resources/network.ts
5166
+ var NetworkResource = class extends WorkspaceScopedResource {
5167
+ /** Get the platform's egress IPs the workspace's outbound traffic uses */
5168
+ async getEgressIps() {
5169
+ return extractData(
5170
+ await this.client.GET("/v1/{workspace_id}/network/egress-ips", {
5171
+ params: { path: { workspace_id: this.workspaceId } }
5172
+ })
5173
+ );
5174
+ }
5175
+ };
5176
+
5177
+ // src/resources/pipeline.ts
5178
+ var PipelineResource = class extends WorkspaceScopedResource {
5179
+ /** Overall pipeline status (sources up/down, last successful run, etc.) */
5180
+ async getStatus() {
5181
+ return extractData(
5182
+ await this.client.GET("/v1/{workspace_id}/pipeline/status", {
5183
+ params: { path: { workspace_id: this.workspaceId } }
5184
+ })
5185
+ );
5186
+ }
5187
+ /** Throughput buckets over the recent window */
5188
+ async getThroughput() {
5189
+ return extractData(
5190
+ await this.client.GET("/v1/{workspace_id}/pipeline/throughput", {
5191
+ params: { path: { workspace_id: this.workspaceId } }
5192
+ })
5193
+ );
5194
+ }
5195
+ /** Review backlog metrics (pending merges, pending escalations) */
5196
+ async getReview() {
5197
+ return extractData(
5198
+ await this.client.GET("/v1/{workspace_id}/pipeline/review", {
5199
+ params: { path: { workspace_id: this.workspaceId } }
5200
+ })
5201
+ );
5202
+ }
5203
+ /** Entity resolution metrics (merge rate, candidate rate, false-positive rate) */
5204
+ async getEntityResolution() {
5205
+ return extractData(
5206
+ await this.client.GET("/v1/{workspace_id}/pipeline/entity-resolution", {
5207
+ params: { path: { workspace_id: this.workspaceId } }
5208
+ })
5209
+ );
5210
+ }
5211
+ outbound = {
5212
+ /** List recent outbound deliveries */
5213
+ list: async () => extractData(
5214
+ await this.client.GET("/v1/{workspace_id}/pipeline/outbound", {
5215
+ params: { path: { workspace_id: this.workspaceId } }
5216
+ })
5217
+ ),
5218
+ /** Get the delivery log for a specific outbound data source */
5219
+ getLog: async (dataSourceId2, params) => extractData(
5220
+ await this.client.GET(
5221
+ "/v1/{workspace_id}/pipeline/outbound/{data_source_id}/log",
5222
+ {
5223
+ params: {
5224
+ path: { workspace_id: this.workspaceId, data_source_id: dataSourceId2 },
5225
+ query: params
5226
+ }
5227
+ }
5228
+ )
5229
+ )
5230
+ };
5231
+ sources = {
5232
+ /** List all configured pipeline sources */
5233
+ list: async (params) => extractData(
5234
+ await this.client.GET("/v1/{workspace_id}/pipeline/sources", {
5235
+ params: { path: { workspace_id: this.workspaceId }, query: params }
5236
+ })
5237
+ ),
5238
+ /** Get a per-source overview (last sync, error counts, deltas) */
5239
+ getOverview: async (sourceId) => extractData(
5240
+ await this.client.GET("/v1/{workspace_id}/pipeline/sources/{source_id}/overview", {
5241
+ params: { path: { workspace_id: this.workspaceId, source_id: sourceId } }
5242
+ })
5243
+ ),
5244
+ /** Stream the source's recent events */
5245
+ listEvents: async (sourceId, params) => extractData(
5246
+ await this.client.GET("/v1/{workspace_id}/pipeline/sources/{source_id}/events", {
5247
+ params: {
5248
+ path: { workspace_id: this.workspaceId, source_id: sourceId },
5249
+ query: params
5250
+ }
5251
+ })
5252
+ ),
5253
+ /** Per-source historical timeline */
5254
+ getHistory: async (sourceId) => extractData(
5255
+ await this.client.GET("/v1/{workspace_id}/pipeline/sources/{source_id}/history", {
5256
+ params: { path: { workspace_id: this.workspaceId, source_id: sourceId } }
5257
+ })
5258
+ )
5259
+ };
5260
+ };
5261
+
5262
+ // src/resources/tasks.ts
5263
+ var TasksResource = class extends WorkspaceScopedResource {
5264
+ /** Get the current state of a single task */
5265
+ async get(taskId) {
5266
+ return extractData(
5267
+ await this.client.GET("/v1/{workspace_id}/tasks/{task_id}", {
5268
+ params: { path: { workspace_id: this.workspaceId, task_id: taskId } }
5269
+ })
5270
+ );
5271
+ }
5272
+ /** List every task associated with a call (by Twilio call sid) */
5273
+ async listByCall(callSid) {
5274
+ return extractData(
5275
+ await this.client.GET("/v1/{workspace_id}/tasks/by-call/{call_sid}", {
5276
+ params: { path: { workspace_id: this.workspaceId, call_sid: callSid } }
5277
+ })
5278
+ );
5279
+ }
5280
+ };
5281
+
5282
+ // src/resources/tools.ts
5283
+ var ToolsResource = class extends WorkspaceScopedResource {
5284
+ /** Manually execute a tool call against the workspace's integrations */
5285
+ async execute(body) {
5286
+ return extractData(
5287
+ await this.client.POST("/v1/{workspace_id}/tools/execute", {
5288
+ params: { path: { workspace_id: this.workspaceId } },
5289
+ body
5290
+ })
5291
+ );
5292
+ }
5293
+ /** Resolve the bound tool implementations for a service */
5294
+ async resolveForService(serviceId2) {
5295
+ return extractData(
5296
+ await this.client.GET("/v1/{workspace_id}/services/{service_id}/tools/resolve", {
5297
+ params: { path: { workspace_id: this.workspaceId, service_id: serviceId2 } }
5298
+ })
5299
+ );
5300
+ }
5301
+ };
5302
+
5303
+ // src/resources/surfaces.ts
5304
+ var SurfacesResource = class extends WorkspaceScopedResource {
5305
+ /** List surfaces in the workspace */
5306
+ async list(params) {
5307
+ return extractData(
5308
+ await this.client.GET("/v1/{workspace_id}/surfaces", {
5309
+ params: { path: { workspace_id: this.workspaceId }, query: params }
5310
+ })
5311
+ );
5312
+ }
5313
+ listAutoPaging(params) {
5314
+ return this.iteratePaginatedList((pageParams) => this.list(pageParams), params);
5315
+ }
5316
+ /** Surfaces awaiting review (pending approval / rejection) */
5317
+ async listForReview(params) {
5318
+ return extractData(
5319
+ await this.client.GET("/v1/{workspace_id}/surfaces/review", {
5320
+ params: { path: { workspace_id: this.workspaceId }, query: params }
5321
+ })
5322
+ );
5323
+ }
5324
+ /** Create a surface (form definition + delivery config) */
5325
+ async create(body) {
5326
+ return extractData(
5327
+ await this.client.POST("/v1/{workspace_id}/surfaces", {
5328
+ params: { path: { workspace_id: this.workspaceId } },
5329
+ body
5330
+ })
5331
+ );
5332
+ }
5333
+ /** Get a single surface */
5334
+ async get(surfaceId) {
5335
+ return extractData(
5336
+ await this.client.GET("/v1/{workspace_id}/surfaces/{surface_id}", {
5337
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } }
5338
+ })
5339
+ );
5340
+ }
5341
+ /** Update surface metadata or fields */
5342
+ async update(surfaceId, body) {
5343
+ return extractData(
5344
+ await this.client.PATCH("/v1/{workspace_id}/surfaces/{surface_id}", {
5345
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } },
5346
+ body
5347
+ })
5348
+ );
5349
+ }
5350
+ /** Archive (soft-delete) a surface */
5351
+ async archive(surfaceId) {
5352
+ return extractData(
5353
+ await this.client.DELETE("/v1/{workspace_id}/surfaces/{surface_id}", {
5354
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } }
5355
+ })
5356
+ );
5357
+ }
5358
+ /** Deliver the surface to the recipient (SMS/email/etc.) */
5359
+ async deliver(surfaceId, body) {
5360
+ return extractData(
5361
+ await this.client.POST("/v1/{workspace_id}/surfaces/{surface_id}/deliver", {
5362
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } },
5363
+ body
5364
+ })
5365
+ );
5366
+ }
5367
+ /** Get fill / completion progress for a surface */
5368
+ async getProgress(surfaceId) {
5369
+ return extractData(
5370
+ await this.client.GET("/v1/{workspace_id}/surfaces/{surface_id}/progress", {
5371
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } }
5372
+ })
5373
+ );
5374
+ }
5375
+ /** Approve a pending-review surface */
5376
+ async approve(surfaceId) {
5377
+ return extractData(
5378
+ await this.client.POST("/v1/{workspace_id}/surfaces/{surface_id}/approve", {
5379
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } }
5380
+ })
5381
+ );
5382
+ }
5383
+ /** Reject a pending-review surface */
5384
+ async reject(surfaceId, body) {
5385
+ return extractData(
5386
+ await this.client.POST("/v1/{workspace_id}/surfaces/{surface_id}/reject", {
5387
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } },
5388
+ body
5389
+ })
5390
+ );
5391
+ }
5392
+ /** Reshape — clone the surface with refined fields (review redirect) */
5393
+ async reshape(surfaceId) {
5394
+ return extractData(
5395
+ await this.client.POST("/v1/{workspace_id}/surfaces/{surface_id}/reshape", {
5396
+ params: { path: { workspace_id: this.workspaceId, surface_id: surfaceId } }
5397
+ })
5398
+ );
5399
+ }
5400
+ };
5401
+
5402
+ // src/resources/sessions.ts
5403
+ var SessionsResource = class extends WorkspaceScopedResource {
5404
+ /** List currently active sessions across the workspace */
5405
+ async listActive() {
5406
+ return extractData(
5407
+ await this.client.GET("/v1/{workspace_id}/sessions/active", {
5408
+ params: { path: { workspace_id: this.workspaceId } }
5409
+ })
5410
+ );
5411
+ }
5412
+ /** Inject a one-shot directive (text/audio) into a live call session */
5413
+ async inject(callSid, body) {
5414
+ return extractData(
5415
+ await this.client.POST("/v1/{workspace_id}/sessions/{call_sid}/inject", {
5416
+ params: { path: { workspace_id: this.workspaceId, call_sid: callSid } },
5417
+ body
5418
+ })
5419
+ );
5420
+ }
5421
+ };
5422
+
4400
5423
  // src/core/branded-types.ts
4401
5424
  var workspaceId = (id) => id;
4402
5425
  var apiKeyId = (id) => id;
@@ -5030,6 +6053,7 @@ var AmigoClient = class _AmigoClient {
5030
6053
  baseUrl;
5031
6054
  agentBaseUrl;
5032
6055
  workspaces;
6056
+ me;
5033
6057
  apiKeys;
5034
6058
  agents;
5035
6059
  /** @deprecated Use `actions` instead */
@@ -5066,6 +6090,40 @@ var AmigoClient = class _AmigoClient {
5066
6090
  * {@link ObserversResource}.
5067
6091
  */
5068
6092
  observers;
6093
+ /** FHIR / EHR data interop — sync status, imports, resources, patient views */
6094
+ fhir;
6095
+ /** Natural-language insights — schema, suggestions, SQL, chat sessions */
6096
+ insights;
6097
+ /** Workspace monitor concepts (semantic patterns watched across calls) */
6098
+ monitorConcepts;
6099
+ /** Entity unification rules (declarative deduplication of world-model entities) */
6100
+ unificationRules;
6101
+ /** CRM — contacts, companies, deals, pipeline (sync from connected CRM integration) */
6102
+ crm;
6103
+ /** Command Center — rolled-up workspace homepage snapshot */
6104
+ commandCenter;
6105
+ /** Sensorium — operator-facing live agent loop observability */
6106
+ sensorium;
6107
+ /** Generic data query against whitelisted workspace datasets */
6108
+ dataQuery;
6109
+ /** AI-generated entity briefs (workspace-level + per-entity) */
6110
+ briefs;
6111
+ /** Remote-controlled desktop sessions for driving GUI-only third-party apps */
6112
+ desktopSessions;
6113
+ /** Patient intake — signed upload links + uploads */
6114
+ intake;
6115
+ /** Workspace network metadata (egress IP allowlist) */
6116
+ network;
6117
+ /** Data ingestion pipeline observability (sources, throughput, review backlog) */
6118
+ pipeline;
6119
+ /** Long-running async tasks (poll by id or list by call) */
6120
+ tasks;
6121
+ /** Manual tool execution + per-service tool resolution */
6122
+ tools;
6123
+ /** Surfaces — short-lived form/intake experiences (lifecycle: create→deliver→review→approve) */
6124
+ surfaces;
6125
+ /** Live agent sessions — list active calls + inject mid-call directives */
6126
+ sessions;
5069
6127
  /** @internal — exposed for path-level type inference in GET/POST/PUT/etc. */
5070
6128
  api;
5071
6129
  constructor(config) {
@@ -5137,6 +6195,7 @@ var AmigoClient = class _AmigoClient {
5137
6195
  mutable.agentBaseUrl = agentBaseUrl;
5138
6196
  target.api = client;
5139
6197
  mutable.workspaces = new WorkspacesResource(client, workspaceId2);
6198
+ mutable.me = new MeResource(client, "_account");
5140
6199
  mutable.apiKeys = new ApiKeysResource(client, workspaceId2);
5141
6200
  mutable.agents = new AgentsResource(client, workspaceId2);
5142
6201
  mutable.skills = new SkillsResource(client, workspaceId2);
@@ -5167,6 +6226,23 @@ var AmigoClient = class _AmigoClient {
5167
6226
  mutable.events = new EventsResource(client, workspaceId2);
5168
6227
  mutable.functions = new FunctionsResource(client, workspaceId2);
5169
6228
  mutable.observers = new ObserversResource(client, workspaceId2, agentBaseUrl);
6229
+ mutable.fhir = new FhirResource(client, workspaceId2);
6230
+ mutable.insights = new InsightsResource(client, workspaceId2);
6231
+ mutable.monitorConcepts = new MonitorConceptsResource(client, workspaceId2);
6232
+ mutable.unificationRules = new UnificationRulesResource(client, workspaceId2);
6233
+ mutable.crm = new CrmResource(client, workspaceId2);
6234
+ mutable.commandCenter = new CommandCenterResource(client, workspaceId2);
6235
+ mutable.sensorium = new SensoriumResource(client, workspaceId2);
6236
+ mutable.dataQuery = new DataQueryResource(client, workspaceId2);
6237
+ mutable.briefs = new BriefsResource(client, workspaceId2);
6238
+ mutable.desktopSessions = new DesktopSessionsResource(client, workspaceId2);
6239
+ mutable.intake = new IntakeResource(client, workspaceId2);
6240
+ mutable.network = new NetworkResource(client, workspaceId2);
6241
+ mutable.pipeline = new PipelineResource(client, workspaceId2);
6242
+ mutable.tasks = new TasksResource(client, workspaceId2);
6243
+ mutable.tools = new ToolsResource(client, workspaceId2);
6244
+ mutable.surfaces = new SurfacesResource(client, workspaceId2);
6245
+ mutable.sessions = new SessionsResource(client, workspaceId2);
5170
6246
  }
5171
6247
  async resolveApiRequest(path, method, init) {
5172
6248
  const { baseClient, options } = resolveScopedPlatformClient(this.api);