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