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