@talqing/sdk 0.8.0 → 0.9.1

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.
@@ -255,20 +255,10 @@ export class Credits extends HeyApiClient {
255
255
  /**
256
256
  * Get Credits
257
257
  *
258
- * This workspace's credit balance in this region, what it buys, and what a
259
- * top-up costs.
258
+ * This workspace's credit balance, what it buys, and what a top-up costs.
260
259
  *
261
260
  * Readable by every role: a VIEWER can start a web call, so a VIEWER must be
262
261
  * able to see why one was refused.
263
- *
264
- * This is also where credit the control plane could not deliver lands. Anything
265
- * it has issued for this workspace here — a purchase, a signup grant, a
266
- * reversal — that this region has not written yet is applied before the balance
267
- * is read. That is the backstop for a failed push, and it is a reconcile on
268
- * demand rather than a timer: the moment someone cares is the moment this page
269
- * loads, whether they arrived from the payment processor or from the "out of
270
- * credits" banner. It costs nothing when there is nothing to apply, which is
271
- * almost always.
272
262
  */
273
263
  get(parameters, options) {
274
264
  const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'topup' }] }]);
@@ -291,11 +281,6 @@ export class Credits extends HeyApiClient {
291
281
  *
292
282
  * Organization admins only — spending the workspace's money is an admin act,
293
283
  * the same as storing a secret or a provider key.
294
- *
295
- * The credit lands in THIS region, and that is decided by which region's API
296
- * you called rather than by anything in the request. A slug in a body could be
297
- * pointed at the other region, where the money would then be stuck: balances
298
- * are per region and there is no transfer between them.
299
284
  */
300
285
  checkout(parameters, options) {
301
286
  const params = buildClientParams([parameters], [{ args: [{ key: 'creditCheckoutRequest', map: 'body' }] }]);
@@ -319,7 +304,7 @@ export class Credits extends HeyApiClient {
319
304
  /**
320
305
  * List Credit Ledger
321
306
  *
322
- * Every movement of this region's balance, newest first, with what caused each.
307
+ * Every movement of this workspace's balance, newest first, with what caused each.
323
308
  */
324
309
  ledger(parameters, options) {
325
310
  const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
@@ -533,6 +518,30 @@ export class Recipients extends HeyApiClient {
533
518
  }
534
519
  });
535
520
  }
521
+ /**
522
+ * Delete Call Batch Recipients
523
+ *
524
+ * Remove rows that were never dialled. Not reversible; a dialled row is refused in `rejected`.
525
+ */
526
+ delete(parameters, options) {
527
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'deleteRecipientsRequest', map: 'body' }] }]);
528
+ return (options?.client ?? this.client).post({
529
+ responseStyle: 'data',
530
+ security: [{ scheme: 'bearer', type: 'http' }, {
531
+ in: 'cookie',
532
+ name: 'talqing_session',
533
+ type: 'apiKey'
534
+ }],
535
+ url: '/v1/calls/batches/{batch_id}/recipients/delete',
536
+ ...options,
537
+ ...params,
538
+ headers: {
539
+ 'Content-Type': 'application/json',
540
+ ...options?.headers,
541
+ ...params.headers
542
+ }
543
+ });
544
+ }
536
545
  }
537
546
  export class Batches extends HeyApiClient {
538
547
  /**
@@ -1837,58 +1846,6 @@ export class Agents2 extends HeyApiClient {
1837
1846
  });
1838
1847
  }
1839
1848
  }
1840
- export class Knowledge extends HeyApiClient {
1841
- /**
1842
- * Knowledge Copilot Send Message
1843
- *
1844
- * Say something to KnowledgeCoPilot. The reply arrives on the stream, not here.
1845
- *
1846
- * Returns as soon as the turn is queued; watch `turn` and `message` frames
1847
- * on the matching `/stream` for what it does.
1848
- */
1849
- send(parameters, options) {
1850
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }, { key: 'sendMessageRequest', map: 'body' }] }]);
1851
- return (options?.client ?? this.client).post({
1852
- responseStyle: 'data',
1853
- security: [{ scheme: 'bearer', type: 'http' }, {
1854
- in: 'cookie',
1855
- name: 'talqing_session',
1856
- type: 'apiKey'
1857
- }],
1858
- url: '/v1/copilot/knowledge/{kb_id}/messages',
1859
- ...options,
1860
- ...params,
1861
- headers: {
1862
- 'Content-Type': 'application/json',
1863
- ...options?.headers,
1864
- ...params.headers
1865
- }
1866
- });
1867
- }
1868
- /**
1869
- * Knowledge Copilot Stream
1870
- *
1871
- * KnowledgeCoPilot's curation chat for one knowledge base.
1872
- *
1873
- * Frames: `snapshot` (the whole conversation, sent first and on every
1874
- * reconnect), `message` (one new message), `turn` (that turn's lifecycle —
1875
- * `running`, `done`, `error`, `canceled`).
1876
- */
1877
- stream(parameters, options) {
1878
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
1879
- return (options?.client ?? this.client).sse.get({
1880
- responseStyle: 'data',
1881
- security: [{ scheme: 'bearer', type: 'http' }, {
1882
- in: 'cookie',
1883
- name: 'talqing_session',
1884
- type: 'apiKey'
1885
- }],
1886
- url: '/v1/copilot/knowledge/{kb_id}/stream',
1887
- ...options,
1888
- ...params
1889
- });
1890
- }
1891
- }
1892
1849
  export class Tasks extends HeyApiClient {
1893
1850
  /**
1894
1851
  * Task Copilot Send Message
@@ -1997,9 +1954,6 @@ export class Copilot extends HeyApiClient {
1997
1954
  get agents() {
1998
1955
  return this._agents ?? (this._agents = new Agents2({ client: this.client }));
1999
1956
  }
2000
- get knowledge() {
2001
- return this._knowledge ?? (this._knowledge = new Knowledge({ client: this.client }));
2002
- }
2003
1957
  get tasks() {
2004
1958
  return this._tasks ?? (this._tasks = new Tasks({ client: this.client }));
2005
1959
  }
@@ -2064,6 +2018,30 @@ export class Recipients2 extends HeyApiClient {
2064
2018
  }
2065
2019
  });
2066
2020
  }
2021
+ /**
2022
+ * Delete Email Batch Recipients
2023
+ *
2024
+ * Remove rows that were never sent. Not reversible; a sent row is refused in `rejected`.
2025
+ */
2026
+ delete(parameters, options) {
2027
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'deleteRecipientsRequest', map: 'body' }] }]);
2028
+ return (options?.client ?? this.client).post({
2029
+ responseStyle: 'data',
2030
+ security: [{ scheme: 'bearer', type: 'http' }, {
2031
+ in: 'cookie',
2032
+ name: 'talqing_session',
2033
+ type: 'apiKey'
2034
+ }],
2035
+ url: '/v1/email/batches/{batch_id}/recipients/delete',
2036
+ ...options,
2037
+ ...params,
2038
+ headers: {
2039
+ 'Content-Type': 'application/json',
2040
+ ...options?.headers,
2041
+ ...params.headers
2042
+ }
2043
+ });
2044
+ }
2067
2045
  /**
2068
2046
  * Patch Email Batch Recipient
2069
2047
  *
@@ -2131,58 +2109,6 @@ export class Recipients2 extends HeyApiClient {
2131
2109
  }
2132
2110
  });
2133
2111
  }
2134
- /**
2135
- * Restore Email Batch Recipients
2136
- *
2137
- * Put skipped rows back. `selection: "all_eligible"` means every row a person
2138
- * skipped; an `unfillable` row is restored by filling in its cell instead.
2139
- */
2140
- restore(parameters, options) {
2141
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
2142
- return (options?.client ?? this.client).post({
2143
- responseStyle: 'data',
2144
- security: [{ scheme: 'bearer', type: 'http' }, {
2145
- in: 'cookie',
2146
- name: 'talqing_session',
2147
- type: 'apiKey'
2148
- }],
2149
- url: '/v1/email/batches/{batch_id}/restore',
2150
- ...options,
2151
- ...params,
2152
- headers: {
2153
- 'Content-Type': 'application/json',
2154
- ...options?.headers,
2155
- ...params.headers
2156
- }
2157
- });
2158
- }
2159
- /**
2160
- * Skip Email Batch Recipients
2161
- *
2162
- * Take rows out of consideration. Reversible with `restore`.
2163
- *
2164
- * Accepts drafted rows and rows whose drafting failed. Takes either
2165
- * `recipient_ids` or `selection: "all_eligible"`, which here means both.
2166
- */
2167
- skip(parameters, options) {
2168
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
2169
- return (options?.client ?? this.client).post({
2170
- responseStyle: 'data',
2171
- security: [{ scheme: 'bearer', type: 'http' }, {
2172
- in: 'cookie',
2173
- name: 'talqing_session',
2174
- type: 'apiKey'
2175
- }],
2176
- url: '/v1/email/batches/{batch_id}/skip',
2177
- ...options,
2178
- ...params,
2179
- headers: {
2180
- 'Content-Type': 'application/json',
2181
- ...options?.headers,
2182
- ...params.headers
2183
- }
2184
- });
2185
- }
2186
2112
  }
2187
2113
  export class Sends extends HeyApiClient {
2188
2114
  /**
@@ -2608,74 +2534,15 @@ export class Email extends HeyApiClient {
2608
2534
  return this._senders ?? (this._senders = new Senders({ client: this.client }));
2609
2535
  }
2610
2536
  }
2611
- export class McpTools extends HeyApiClient {
2612
- /**
2613
- * List Integration Mcp Tools
2614
- *
2615
- * Connect to the integration's MCP server and list every tool it offers.
2616
- *
2617
- * A live call to the provider, so it also proves the connection works. The
2618
- * list is unfiltered — it is what tool approval is chosen from. Which of these
2619
- * an attached agent can actually call is the integration's `allowed_tools`
2620
- * (null there means all of them). Fails if the integration is not active or
2621
- * the server is unreachable.
2622
- */
2623
- list(parameters, options) {
2624
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2625
- return (options?.client ?? this.client).get({
2626
- responseStyle: 'data',
2627
- security: [{ scheme: 'bearer', type: 'http' }, {
2628
- in: 'cookie',
2629
- name: 'talqing_session',
2630
- type: 'apiKey'
2631
- }],
2632
- url: '/v1/integrations/{integration_id}/mcp-tools',
2633
- ...options,
2634
- ...params
2635
- });
2636
- }
2637
- }
2638
- export class Triggers extends HeyApiClient {
2537
+ export class Entries extends HeyApiClient {
2639
2538
  /**
2640
- * List Integration Triggers
2539
+ * Create Faq Entries
2641
2540
  *
2642
- * List the trigger deployments under an integration.
2643
- *
2644
- * A trigger binds an inbound provider event — a Telegram message — to a
2645
- * published agent version.
2646
- */
2647
- list(parameters, options) {
2648
- const params = buildClientParams([parameters], [{ args: [
2649
- { in: 'path', key: 'integration_id' },
2650
- { in: 'query', key: 'limit' },
2651
- { in: 'query', key: 'offset' }
2652
- ] }]);
2653
- return (options?.client ?? this.client).get({
2654
- responseStyle: 'data',
2655
- security: [{ scheme: 'bearer', type: 'http' }, {
2656
- in: 'cookie',
2657
- name: 'talqing_session',
2658
- type: 'apiKey'
2659
- }],
2660
- url: '/v1/integrations/{integration_id}/triggers',
2661
- ...options,
2662
- ...params
2663
- });
2664
- }
2665
- /**
2666
- * Create Integration Trigger
2667
- *
2668
- * Deploy an agent to an inbound provider event.
2669
- *
2670
- * `reply_mode` decides what happens with the agent's answer: `public_reply`
2671
- * sends it to the customer, `internal_note` posts it privately where the
2672
- * provider supports that, `none` generates without sending.
2673
- *
2674
- * Enabling validates that the integration is active and the assigned agent is
2675
- * a published text agent, so create disabled while still wiring things up.
2541
+ * Append question/answer entries to an FAQ, all or nothing. Live at once:
2542
+ * agents using the FAQ read them from their next session.
2676
2543
  */
2677
2544
  create(parameters, options) {
2678
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { key: 'createIntegrationTriggerRequest', map: 'body' }] }]);
2545
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'faq_id' }, { key: 'createFaqEntriesRequest', map: 'body' }] }]);
2679
2546
  return (options?.client ?? this.client).post({
2680
2547
  responseStyle: 'data',
2681
2548
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2683,7 +2550,7 @@ export class Triggers extends HeyApiClient {
2683
2550
  name: 'talqing_session',
2684
2551
  type: 'apiKey'
2685
2552
  }],
2686
- url: '/v1/integrations/{integration_id}/triggers',
2553
+ url: '/v1/faqs/{faq_id}/entries',
2687
2554
  ...options,
2688
2555
  ...params,
2689
2556
  headers: {
@@ -2694,12 +2561,12 @@ export class Triggers extends HeyApiClient {
2694
2561
  });
2695
2562
  }
2696
2563
  /**
2697
- * Delete Integration Trigger
2564
+ * Delete Faq Entry
2698
2565
  *
2699
- * Delete a trigger permanently. The agent stops receiving that event.
2566
+ * Delete one entry from an FAQ.
2700
2567
  */
2701
2568
  delete(parameters, options) {
2702
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { in: 'path', key: 'trigger_id' }] }]);
2569
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'faq_id' }, { in: 'path', key: 'entry_id' }] }]);
2703
2570
  return (options?.client ?? this.client).delete({
2704
2571
  responseStyle: 'data',
2705
2572
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2707,25 +2574,21 @@ export class Triggers extends HeyApiClient {
2707
2574
  name: 'talqing_session',
2708
2575
  type: 'apiKey'
2709
2576
  }],
2710
- url: '/v1/integrations/{integration_id}/triggers/{trigger_id}',
2577
+ url: '/v1/faqs/{faq_id}/entries/{entry_id}',
2711
2578
  ...options,
2712
2579
  ...params
2713
2580
  });
2714
2581
  }
2715
2582
  /**
2716
- * Patch Integration Trigger
2583
+ * Update Faq Entry
2717
2584
  *
2718
- * Update a trigger: reassign the agent, change reply mode, enable or
2719
- * disable it.
2720
- *
2721
- * Omitted fields are left unchanged, and enabling one runs the same checks
2722
- * creating it did.
2585
+ * Change one entry's question, answer or both. Live from the next session.
2723
2586
  */
2724
2587
  update(parameters, options) {
2725
2588
  const params = buildClientParams([parameters], [{ args: [
2726
- { in: 'path', key: 'integration_id' },
2727
- { in: 'path', key: 'trigger_id' },
2728
- { key: 'patchIntegrationTriggerRequest', map: 'body' }
2589
+ { in: 'path', key: 'faq_id' },
2590
+ { in: 'path', key: 'entry_id' },
2591
+ { key: 'updateFaqEntryRequest', map: 'body' }
2729
2592
  ] }]);
2730
2593
  return (options?.client ?? this.client).patch({
2731
2594
  responseStyle: 'data',
@@ -2734,7 +2597,7 @@ export class Triggers extends HeyApiClient {
2734
2597
  name: 'talqing_session',
2735
2598
  type: 'apiKey'
2736
2599
  }],
2737
- url: '/v1/integrations/{integration_id}/triggers/{trigger_id}',
2600
+ url: '/v1/faqs/{faq_id}/entries/{entry_id}',
2738
2601
  ...options,
2739
2602
  ...params,
2740
2603
  headers: {
@@ -2745,14 +2608,11 @@ export class Triggers extends HeyApiClient {
2745
2608
  });
2746
2609
  }
2747
2610
  }
2748
- export class Integrations extends HeyApiClient {
2611
+ export class Faqs extends HeyApiClient {
2749
2612
  /**
2750
- * List Integrations
2613
+ * List Faqs
2751
2614
  *
2752
- * List the workspace's integrations with their provider, status and config.
2753
- *
2754
- * Secret values are never returned — credential fields come back as
2755
- * `{{secrets.NAME}}` references.
2615
+ * List the workspace's FAQs by name, with how many questions each holds.
2756
2616
  */
2757
2617
  list(parameters, options) {
2758
2618
  const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
@@ -2763,26 +2623,18 @@ export class Integrations extends HeyApiClient {
2763
2623
  name: 'talqing_session',
2764
2624
  type: 'apiKey'
2765
2625
  }],
2766
- url: '/v1/integrations',
2626
+ url: '/v1/faqs',
2767
2627
  ...options,
2768
2628
  ...params
2769
2629
  });
2770
2630
  }
2771
2631
  /**
2772
- * Create Integration
2773
- *
2774
- * Create a manual integration, fully configured.
2632
+ * Create Faq
2775
2633
  *
2776
- * Which of `credentials_ref`, `provider_account_info`, `mcp_config` and
2777
- * `webhook_config` a provider needs is described by its `setup_fields` in the
2778
- * integration catalog. Secret-bearing fields take a plaintext value — stored
2779
- * as a workspace secret — or an existing `{{secrets.NAME}}` reference.
2780
- *
2781
- * Leave `allowed_tools` unset to expose every tool the server lists. OAuth
2782
- * providers are connected from the dashboard instead.
2634
+ * Create an FAQ, optionally with its first question/answer entries.
2783
2635
  */
2784
2636
  create(parameters, options) {
2785
- const params = buildClientParams([parameters], [{ args: [{ key: 'createIntegrationRequest', map: 'body' }] }]);
2637
+ const params = buildClientParams([parameters], [{ args: [{ key: 'faqDefinition', map: 'body' }] }]);
2786
2638
  return (options?.client ?? this.client).post({
2787
2639
  responseStyle: 'data',
2788
2640
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2790,7 +2642,7 @@ export class Integrations extends HeyApiClient {
2790
2642
  name: 'talqing_session',
2791
2643
  type: 'apiKey'
2792
2644
  }],
2793
- url: '/v1/integrations',
2645
+ url: '/v1/faqs',
2794
2646
  ...options,
2795
2647
  ...params,
2796
2648
  headers: {
@@ -2801,36 +2653,13 @@ export class Integrations extends HeyApiClient {
2801
2653
  });
2802
2654
  }
2803
2655
  /**
2804
- * Integration Catalog
2805
- *
2806
- * List the providers that can be integrated, and how to connect each one.
2807
- *
2808
- * `auth_type` says which path a provider takes: `manual` through this API,
2809
- * `oauth` from the dashboard. `setup_fields` is the authoritative list of what
2810
- * each manual provider requires — read it rather than guessing. `capabilities`
2811
- * says whether it serves tools (MCP) or a messaging channel (triggers).
2812
- */
2813
- catalog(parameters, options) {
2814
- const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
2815
- return (options?.client ?? this.client).get({
2816
- responseStyle: 'data',
2817
- security: [{ scheme: 'bearer', type: 'http' }, {
2818
- in: 'cookie',
2819
- name: 'talqing_session',
2820
- type: 'apiKey'
2821
- }],
2822
- url: '/v1/integrations/catalog',
2823
- ...options,
2824
- ...params
2825
- });
2826
- }
2827
- /**
2828
- * Delete Integration
2656
+ * Delete Faq
2829
2657
  *
2830
- * Delete an integration and its triggers permanently.
2658
+ * Delete an FAQ and its entries. Refused with 409 while an agent or task
2659
+ * still attaches it.
2831
2660
  */
2832
2661
  delete(parameters, options) {
2833
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2662
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'faq_id' }] }]);
2834
2663
  return (options?.client ?? this.client).delete({
2835
2664
  responseStyle: 'data',
2836
2665
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2838,19 +2667,18 @@ export class Integrations extends HeyApiClient {
2838
2667
  name: 'talqing_session',
2839
2668
  type: 'apiKey'
2840
2669
  }],
2841
- url: '/v1/integrations/{integration_id}',
2670
+ url: '/v1/faqs/{faq_id}',
2842
2671
  ...options,
2843
2672
  ...params
2844
2673
  });
2845
2674
  }
2846
2675
  /**
2847
- * Get Integration
2676
+ * Get Faq
2848
2677
  *
2849
- * Fetch one integration: provider, status, structured config, trigger
2850
- * capabilities and inbound webhook setup state.
2678
+ * Get one FAQ with every entry, in the order they were added.
2851
2679
  */
2852
2680
  get(parameters, options) {
2853
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2681
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'faq_id' }] }]);
2854
2682
  return (options?.client ?? this.client).get({
2855
2683
  responseStyle: 'data',
2856
2684
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2858,26 +2686,18 @@ export class Integrations extends HeyApiClient {
2858
2686
  name: 'talqing_session',
2859
2687
  type: 'apiKey'
2860
2688
  }],
2861
- url: '/v1/integrations/{integration_id}',
2689
+ url: '/v1/faqs/{faq_id}',
2862
2690
  ...options,
2863
2691
  ...params
2864
2692
  });
2865
2693
  }
2866
2694
  /**
2867
- * Patch Integration
2868
- *
2869
- * Update an integration. Omitted fields are left unchanged.
2870
- *
2871
- * Sending `credentials_ref` rotates the credential. Only `active` integrations
2872
- * can be attached to agents or serve triggers.
2695
+ * Update Faq
2873
2696
  *
2874
- * `allowed_tools` replaces the approved list wholesale: exactly those tools
2875
- * become callable by every agent this integration is attached to. It cannot be
2876
- * emptied — an agent that should call nothing is an integration that should be
2877
- * disabled.
2697
+ * Rename an FAQ.
2878
2698
  */
2879
2699
  update(parameters, options) {
2880
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { key: 'patchIntegrationRequest', map: 'body' }] }]);
2700
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'faq_id' }, { key: 'updateFaqRequest', map: 'body' }] }]);
2881
2701
  return (options?.client ?? this.client).patch({
2882
2702
  responseStyle: 'data',
2883
2703
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2885,7 +2705,7 @@ export class Integrations extends HeyApiClient {
2885
2705
  name: 'talqing_session',
2886
2706
  type: 'apiKey'
2887
2707
  }],
2888
- url: '/v1/integrations/{integration_id}',
2708
+ url: '/v1/faqs/{faq_id}',
2889
2709
  ...options,
2890
2710
  ...params,
2891
2711
  headers: {
@@ -2895,45 +2715,52 @@ export class Integrations extends HeyApiClient {
2895
2715
  }
2896
2716
  });
2897
2717
  }
2898
- get mcpTools() {
2899
- return this._mcpTools ?? (this._mcpTools = new McpTools({ client: this.client }));
2900
- }
2901
- get triggers() {
2902
- return this._triggers ?? (this._triggers = new Triggers({ client: this.client }));
2718
+ get entries() {
2719
+ return this._entries ?? (this._entries = new Entries({ client: this.client }));
2903
2720
  }
2904
2721
  }
2905
- export class Nodes extends HeyApiClient {
2722
+ export class McpTools extends HeyApiClient {
2906
2723
  /**
2907
- * Delete Node
2724
+ * List Integration Mcp Tools
2908
2725
  *
2909
- * Drop one entry from the table of contents, permanently.
2726
+ * Connect to the integration's MCP server and list every tool it offers.
2910
2727
  *
2911
- * Its children go with it, and agents can no longer retrieve any of it.
2728
+ * A live call to the provider, so it also proves the connection works. The
2729
+ * list is unfiltered — it is what tool approval is chosen from. Which of these
2730
+ * an attached agent can actually call is the integration's `allowed_tools`
2731
+ * (null there means all of them). Fails if the integration is not active or
2732
+ * the server is unreachable.
2912
2733
  */
2913
- delete(parameters, options) {
2914
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }, { in: 'path', key: 'node_id' }] }]);
2915
- return (options?.client ?? this.client).delete({
2734
+ list(parameters, options) {
2735
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2736
+ return (options?.client ?? this.client).get({
2916
2737
  responseStyle: 'data',
2917
2738
  security: [{ scheme: 'bearer', type: 'http' }, {
2918
2739
  in: 'cookie',
2919
2740
  name: 'talqing_session',
2920
2741
  type: 'apiKey'
2921
2742
  }],
2922
- url: '/v1/knowledge/{kb_id}/nodes/{node_id}',
2743
+ url: '/v1/integrations/{integration_id}/mcp-tools',
2923
2744
  ...options,
2924
2745
  ...params
2925
2746
  });
2926
2747
  }
2748
+ }
2749
+ export class Triggers extends HeyApiClient {
2927
2750
  /**
2928
- * Get Node
2751
+ * List Integration Triggers
2929
2752
  *
2930
- * Read one entry of the table of contents, with its full content.
2753
+ * List the trigger deployments under an integration.
2931
2754
  *
2932
- * This is the text an agent retrieves when it fetches this node. `version` is
2933
- * what `patch_node` needs for a safe edit.
2755
+ * A trigger binds an inbound provider event — a Telegram message — to a
2756
+ * published agent version.
2934
2757
  */
2935
- get(parameters, options) {
2936
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }, { in: 'path', key: 'node_id' }] }]);
2758
+ list(parameters, options) {
2759
+ const params = buildClientParams([parameters], [{ args: [
2760
+ { in: 'path', key: 'integration_id' },
2761
+ { in: 'query', key: 'limit' },
2762
+ { in: 'query', key: 'offset' }
2763
+ ] }]);
2937
2764
  return (options?.client ?? this.client).get({
2938
2765
  responseStyle: 'data',
2939
2766
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2941,37 +2768,33 @@ export class Nodes extends HeyApiClient {
2941
2768
  name: 'talqing_session',
2942
2769
  type: 'apiKey'
2943
2770
  }],
2944
- url: '/v1/knowledge/{kb_id}/nodes/{node_id}',
2771
+ url: '/v1/integrations/{integration_id}/triggers',
2945
2772
  ...options,
2946
2773
  ...params
2947
2774
  });
2948
2775
  }
2949
2776
  /**
2950
- * Patch Node
2777
+ * Create Integration Trigger
2951
2778
  *
2952
- * Correct one entry's title, summary or content by hand — the way to fix a
2953
- * fact the crawl got wrong without rebuilding.
2779
+ * Deploy an agent to an inbound provider event.
2954
2780
  *
2955
- * `title` and `summary` are what the agent sees in the table of contents and
2956
- * decide whether it ever fetches this node, so keep them accurate.
2781
+ * `reply_mode` decides what happens with the agent's answer: `public_reply`
2782
+ * sends it to the customer, `internal_note` posts it privately where the
2783
+ * provider supports that, `none` generates without sending.
2957
2784
  *
2958
- * Send the `version` you read from `get_node`; a mismatch is rejected rather
2959
- * than overwriting someone else's edit.
2785
+ * Enabling validates that the integration is active and the assigned agent is
2786
+ * a published text agent, so create disabled while still wiring things up.
2960
2787
  */
2961
- update(parameters, options) {
2962
- const params = buildClientParams([parameters], [{ args: [
2963
- { in: 'path', key: 'kb_id' },
2964
- { in: 'path', key: 'node_id' },
2965
- { key: 'patchNodeRequest', map: 'body' }
2966
- ] }]);
2967
- return (options?.client ?? this.client).patch({
2788
+ create(parameters, options) {
2789
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { key: 'createIntegrationTriggerRequest', map: 'body' }] }]);
2790
+ return (options?.client ?? this.client).post({
2968
2791
  responseStyle: 'data',
2969
2792
  security: [{ scheme: 'bearer', type: 'http' }, {
2970
2793
  in: 'cookie',
2971
2794
  name: 'talqing_session',
2972
2795
  type: 'apiKey'
2973
2796
  }],
2974
- url: '/v1/knowledge/{kb_id}/nodes/{node_id}',
2797
+ url: '/v1/integrations/{integration_id}/triggers',
2975
2798
  ...options,
2976
2799
  ...params,
2977
2800
  headers: {
@@ -2981,80 +2804,48 @@ export class Nodes extends HeyApiClient {
2981
2804
  }
2982
2805
  });
2983
2806
  }
2984
- }
2985
- export class Pages extends HeyApiClient {
2986
- /**
2987
- * List Pages
2988
- *
2989
- * List the crawled pages and how each one transcribed.
2990
- *
2991
- * Where you look when a knowledge base is missing something: a page with a
2992
- * non-`done` status and an `error` never made it in, and `content_len` of 0
2993
- * means the URL yielded nothing worth indexing.
2994
- */
2995
- list(parameters, options) {
2996
- const params = buildClientParams([parameters], [{ args: [
2997
- { in: 'path', key: 'kb_id' },
2998
- { in: 'query', key: 'limit' },
2999
- { in: 'query', key: 'offset' }
3000
- ] }]);
3001
- return (options?.client ?? this.client).get({
3002
- responseStyle: 'data',
3003
- security: [{ scheme: 'bearer', type: 'http' }, {
3004
- in: 'cookie',
3005
- name: 'talqing_session',
3006
- type: 'apiKey'
3007
- }],
3008
- url: '/v1/knowledge/{kb_id}/pages',
3009
- ...options,
3010
- ...params
3011
- });
3012
- }
3013
- }
3014
- export class Knowledge2 extends HeyApiClient {
3015
2807
  /**
3016
- * List Kbs
3017
- *
3018
- * List the workspace's knowledge bases with their build status.
2808
+ * Delete Integration Trigger
3019
2809
  *
3020
- * A knowledge base gives an agent grounded answers over crawled content. Only
3021
- * one with status `ready` can be attached to an agent, through the agent
3022
- * config's `kb_ids`.
2810
+ * Delete a trigger permanently. The agent stops receiving that event.
3023
2811
  */
3024
- list(parameters, options) {
3025
- const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3026
- return (options?.client ?? this.client).get({
2812
+ delete(parameters, options) {
2813
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { in: 'path', key: 'trigger_id' }] }]);
2814
+ return (options?.client ?? this.client).delete({
3027
2815
  responseStyle: 'data',
3028
2816
  security: [{ scheme: 'bearer', type: 'http' }, {
3029
2817
  in: 'cookie',
3030
2818
  name: 'talqing_session',
3031
2819
  type: 'apiKey'
3032
2820
  }],
3033
- url: '/v1/knowledge',
2821
+ url: '/v1/integrations/{integration_id}/triggers/{trigger_id}',
3034
2822
  ...options,
3035
2823
  ...params
3036
2824
  });
3037
2825
  }
3038
2826
  /**
3039
- * Create Kb
2827
+ * Patch Integration Trigger
3040
2828
  *
3041
- * Start a knowledge base by crawling one or more websites.
2829
+ * Update a trigger: reassign the agent, change reply mode, enable or
2830
+ * disable it.
3042
2831
  *
3043
- * Returns immediately with `status: discovering` — crawling takes minutes.
3044
- * Poll `get_kb` until `review`, then pass the URLs worth indexing to
3045
- * `build_kb`. `max_pages` caps how many discovery may find (default 1000) and
3046
- * `notes` guides how the content is transcribed and organized.
2832
+ * Omitted fields are left unchanged, and enabling one runs the same checks
2833
+ * creating it did.
3047
2834
  */
3048
- create(parameters, options) {
3049
- const params = buildClientParams([parameters], [{ args: [{ key: 'createKbRequest', map: 'body' }] }]);
3050
- return (options?.client ?? this.client).post({
2835
+ update(parameters, options) {
2836
+ const params = buildClientParams([parameters], [{ args: [
2837
+ { in: 'path', key: 'integration_id' },
2838
+ { in: 'path', key: 'trigger_id' },
2839
+ { key: 'patchIntegrationTriggerRequest', map: 'body' }
2840
+ ] }]);
2841
+ return (options?.client ?? this.client).patch({
3051
2842
  responseStyle: 'data',
3052
2843
  security: [{ scheme: 'bearer', type: 'http' }, {
3053
2844
  in: 'cookie',
3054
2845
  name: 'talqing_session',
3055
2846
  type: 'apiKey'
3056
2847
  }],
3057
- url: '/v1/knowledge',
2848
+ url: '/v1/integrations/{integration_id}/triggers/{trigger_id}',
3058
2849
  ...options,
3059
2850
  ...params,
3060
2851
  headers: {
@@ -3064,115 +2855,113 @@ export class Knowledge2 extends HeyApiClient {
3064
2855
  }
3065
2856
  });
3066
2857
  }
2858
+ }
2859
+ export class Integrations extends HeyApiClient {
3067
2860
  /**
3068
- * Delete Kb
2861
+ * List Integrations
3069
2862
  *
3070
- * Delete a knowledge base and everything crawled into it, permanently.
2863
+ * List the workspace's integrations with their provider, status and config.
3071
2864
  *
3072
- * Rebuilding means crawling the site again. Agents that list it in `kb_ids`
3073
- * lose those grounded answers, so detach it there first.
2865
+ * Secret values are never returned — credential fields come back as
2866
+ * `{{secrets.NAME}}` references.
3074
2867
  */
3075
- delete(parameters, options) {
3076
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
3077
- return (options?.client ?? this.client).delete({
2868
+ list(parameters, options) {
2869
+ const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
2870
+ return (options?.client ?? this.client).get({
3078
2871
  responseStyle: 'data',
3079
2872
  security: [{ scheme: 'bearer', type: 'http' }, {
3080
2873
  in: 'cookie',
3081
2874
  name: 'talqing_session',
3082
2875
  type: 'apiKey'
3083
2876
  }],
3084
- url: '/v1/knowledge/{kb_id}',
2877
+ url: '/v1/integrations',
3085
2878
  ...options,
3086
2879
  ...params
3087
2880
  });
3088
2881
  }
3089
2882
  /**
3090
- * Get Kb
2883
+ * Create Integration
2884
+ *
2885
+ * Create a manual integration, fully configured.
3091
2886
  *
3092
- * Read one knowledge base: build status, progress and content tree.
2887
+ * Which of `credentials_ref`, `provider_account_info`, `mcp_config` and
2888
+ * `webhook_config` a provider needs is described by its `setup_fields` in the
2889
+ * integration catalog. Secret-bearing fields take a plaintext value — stored
2890
+ * as a workspace secret — or an existing `{{secrets.NAME}}` reference.
3093
2891
  *
3094
- * `status` walks `discovering` -> `review` -> `transcribing` -> `generating`
3095
- * -> `ready`, with `error` set if it stopped. At `review`, `discovered` holds
3096
- * the crawled URLs awaiting your selection; once ready, `tree` is the table of
3097
- * contents. This is the endpoint to poll while a build runs.
2892
+ * Leave `allowed_tools` unset to expose every tool the server lists. OAuth
2893
+ * providers are connected from the dashboard instead.
3098
2894
  */
3099
- get(parameters, options) {
3100
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
3101
- return (options?.client ?? this.client).get({
2895
+ create(parameters, options) {
2896
+ const params = buildClientParams([parameters], [{ args: [{ key: 'createIntegrationRequest', map: 'body' }] }]);
2897
+ return (options?.client ?? this.client).post({
3102
2898
  responseStyle: 'data',
3103
2899
  security: [{ scheme: 'bearer', type: 'http' }, {
3104
2900
  in: 'cookie',
3105
2901
  name: 'talqing_session',
3106
2902
  type: 'apiKey'
3107
2903
  }],
3108
- url: '/v1/knowledge/{kb_id}',
2904
+ url: '/v1/integrations',
3109
2905
  ...options,
3110
- ...params
2906
+ ...params,
2907
+ headers: {
2908
+ 'Content-Type': 'application/json',
2909
+ ...options?.headers,
2910
+ ...params.headers
2911
+ }
3111
2912
  });
3112
2913
  }
3113
2914
  /**
3114
- * Build Kb
2915
+ * Integration Catalog
3115
2916
  *
3116
- * Index the chosen pages, then write the table of contents.
2917
+ * List the providers that can be integrated, and how to connect each one.
3117
2918
  *
3118
- * Call this once the knowledge base reaches `review`, passing the subset of
3119
- * `discovered` URLs worth indexing — the KB is only as good as that choice.
3120
- * Returns as soon as the work is queued; poll `get_kb` until `ready`, which is
3121
- * when it can be attached to an agent.
2919
+ * `auth_type` says which path a provider takes: `manual` through this API,
2920
+ * `oauth` from the dashboard. `setup_fields` is the authoritative list of what
2921
+ * each manual provider requires — read it rather than guessing. `capabilities`
2922
+ * says whether it serves tools (MCP) or a messaging channel (triggers).
3122
2923
  */
3123
- build(parameters, options) {
3124
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }, { key: 'buildKbRequest', map: 'body' }] }]);
3125
- return (options?.client ?? this.client).post({
2924
+ catalog(parameters, options) {
2925
+ const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
2926
+ return (options?.client ?? this.client).get({
3126
2927
  responseStyle: 'data',
3127
2928
  security: [{ scheme: 'bearer', type: 'http' }, {
3128
2929
  in: 'cookie',
3129
2930
  name: 'talqing_session',
3130
2931
  type: 'apiKey'
3131
2932
  }],
3132
- url: '/v1/knowledge/{kb_id}/build',
2933
+ url: '/v1/integrations/catalog',
3133
2934
  ...options,
3134
- ...params,
3135
- headers: {
3136
- 'Content-Type': 'application/json',
3137
- ...options?.headers,
3138
- ...params.headers
3139
- }
2935
+ ...params
3140
2936
  });
3141
2937
  }
3142
2938
  /**
3143
- * Events
3144
- *
3145
- * Watch one knowledge base build: `snapshot` first, then `progress` and `status`.
2939
+ * Delete Integration
3146
2940
  *
3147
- * `progress` carries the per-stage counts, `status` the terminal verdict
3148
- * (`ready`, or an `error`). The same state is readable at any time with
3149
- * `get_kb`; this is the live view of it.
2941
+ * Delete an integration and its triggers permanently.
3150
2942
  */
3151
- events(parameters, options) {
3152
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
3153
- return (options?.client ?? this.client).sse.get({
2943
+ delete(parameters, options) {
2944
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2945
+ return (options?.client ?? this.client).delete({
3154
2946
  responseStyle: 'data',
3155
2947
  security: [{ scheme: 'bearer', type: 'http' }, {
3156
2948
  in: 'cookie',
3157
2949
  name: 'talqing_session',
3158
2950
  type: 'apiKey'
3159
2951
  }],
3160
- url: '/v1/knowledge/{kb_id}/events',
2952
+ url: '/v1/integrations/{integration_id}',
3161
2953
  ...options,
3162
2954
  ...params
3163
2955
  });
3164
2956
  }
3165
2957
  /**
3166
- * Get Kb Prompt
3167
- *
3168
- * The table of contents exactly as an agent using this KB is given it.
2958
+ * Get Integration
3169
2959
  *
3170
- * Read it to judge what the agent can actually find — if a topic reads
3171
- * vaguely here, the agent will not know to fetch it. `chars` is how much of
3172
- * the agent's context this KB occupies.
2960
+ * Fetch one integration: provider, status, structured config, trigger
2961
+ * capabilities and inbound webhook setup state.
3173
2962
  */
3174
- prompt(parameters, options) {
3175
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
2963
+ get(parameters, options) {
2964
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
3176
2965
  return (options?.client ?? this.client).get({
3177
2966
  responseStyle: 'data',
3178
2967
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -3180,39 +2969,48 @@ export class Knowledge2 extends HeyApiClient {
3180
2969
  name: 'talqing_session',
3181
2970
  type: 'apiKey'
3182
2971
  }],
3183
- url: '/v1/knowledge/{kb_id}/prompt',
2972
+ url: '/v1/integrations/{integration_id}',
3184
2973
  ...options,
3185
2974
  ...params
3186
2975
  });
3187
2976
  }
3188
2977
  /**
3189
- * Regenerate Toc
2978
+ * Patch Integration
2979
+ *
2980
+ * Update an integration. Omitted fields are left unchanged.
3190
2981
  *
3191
- * Rewrite the table of contents from the pages already indexed.
2982
+ * Sending `credentials_ref` rotates the credential. Only `active` integrations
2983
+ * can be attached to agents or serve triggers.
3192
2984
  *
3193
- * The repair for a knowledge base whose structure came out wrong, or whose
3194
- * build failed at the last stage: it re-runs only that stage, so the site is
3195
- * not crawled or transcribed again.
2985
+ * `allowed_tools` replaces the approved list wholesale: exactly those tools
2986
+ * become callable by every agent this integration is attached to. It cannot be
2987
+ * emptied — an agent that should call nothing is an integration that should be
2988
+ * disabled.
3196
2989
  */
3197
- regenerateToc(parameters, options) {
3198
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
3199
- return (options?.client ?? this.client).post({
2990
+ update(parameters, options) {
2991
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { key: 'patchIntegrationRequest', map: 'body' }] }]);
2992
+ return (options?.client ?? this.client).patch({
3200
2993
  responseStyle: 'data',
3201
2994
  security: [{ scheme: 'bearer', type: 'http' }, {
3202
2995
  in: 'cookie',
3203
2996
  name: 'talqing_session',
3204
2997
  type: 'apiKey'
3205
2998
  }],
3206
- url: '/v1/knowledge/{kb_id}/toc',
2999
+ url: '/v1/integrations/{integration_id}',
3207
3000
  ...options,
3208
- ...params
3001
+ ...params,
3002
+ headers: {
3003
+ 'Content-Type': 'application/json',
3004
+ ...options?.headers,
3005
+ ...params.headers
3006
+ }
3209
3007
  });
3210
3008
  }
3211
- get nodes() {
3212
- return this._nodes ?? (this._nodes = new Nodes({ client: this.client }));
3009
+ get mcpTools() {
3010
+ return this._mcpTools ?? (this._mcpTools = new McpTools({ client: this.client }));
3213
3011
  }
3214
- get pages() {
3215
- return this._pages ?? (this._pages = new Pages({ client: this.client }));
3012
+ get triggers() {
3013
+ return this._triggers ?? (this._triggers = new Triggers({ client: this.client }));
3216
3014
  }
3217
3015
  }
3218
3016
  export class Observability extends HeyApiClient {
@@ -4706,36 +4504,12 @@ export class Recipients3 extends HeyApiClient {
4706
4504
  });
4707
4505
  }
4708
4506
  /**
4709
- * Restore Whatsapp Batch Recipients
4507
+ * Delete Whatsapp Batch Recipients
4710
4508
  *
4711
- * Put rows a person skipped back. A row skipped for its cells returns when they are fixed.
4509
+ * Remove rows that were never sent. Not reversible; a sent row is refused in `rejected`.
4712
4510
  */
4713
- restore(parameters, options) {
4714
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
4715
- return (options?.client ?? this.client).post({
4716
- responseStyle: 'data',
4717
- security: [{ scheme: 'bearer', type: 'http' }, {
4718
- in: 'cookie',
4719
- name: 'talqing_session',
4720
- type: 'apiKey'
4721
- }],
4722
- url: '/v1/whatsapp/batches/{batch_id}/recipients/restore',
4723
- ...options,
4724
- ...params,
4725
- headers: {
4726
- 'Content-Type': 'application/json',
4727
- ...options?.headers,
4728
- ...params.headers
4729
- }
4730
- });
4731
- }
4732
- /**
4733
- * Skip Whatsapp Batch Recipients
4734
- *
4735
- * Take ready rows out of the send. Reversible with restore.
4736
- */
4737
- skip(parameters, options) {
4738
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
4511
+ delete(parameters, options) {
4512
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'deleteRecipientsRequest', map: 'body' }] }]);
4739
4513
  return (options?.client ?? this.client).post({
4740
4514
  responseStyle: 'data',
4741
4515
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -4743,7 +4517,7 @@ export class Recipients3 extends HeyApiClient {
4743
4517
  name: 'talqing_session',
4744
4518
  type: 'apiKey'
4745
4519
  }],
4746
- url: '/v1/whatsapp/batches/{batch_id}/recipients/skip',
4520
+ url: '/v1/whatsapp/batches/{batch_id}/recipients/delete',
4747
4521
  ...options,
4748
4522
  ...params,
4749
4523
  headers: {
@@ -5100,12 +4874,12 @@ export class TalqingApi extends HeyApiClient {
5100
4874
  get email() {
5101
4875
  return this._email ?? (this._email = new Email({ client: this.client }));
5102
4876
  }
4877
+ get faqs() {
4878
+ return this._faqs ?? (this._faqs = new Faqs({ client: this.client }));
4879
+ }
5103
4880
  get integrations() {
5104
4881
  return this._integrations ?? (this._integrations = new Integrations({ client: this.client }));
5105
4882
  }
5106
- get knowledge() {
5107
- return this._knowledge ?? (this._knowledge = new Knowledge2({ client: this.client }));
5108
- }
5109
4883
  get observability() {
5110
4884
  return this._observability ?? (this._observability = new Observability({ client: this.client }));
5111
4885
  }