@talqing/sdk 0.8.0 → 0.9.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.
@@ -1837,58 +1837,6 @@ export class Agents2 extends HeyApiClient {
1837
1837
  });
1838
1838
  }
1839
1839
  }
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
1840
  export class Tasks extends HeyApiClient {
1893
1841
  /**
1894
1842
  * Task Copilot Send Message
@@ -1997,9 +1945,6 @@ export class Copilot extends HeyApiClient {
1997
1945
  get agents() {
1998
1946
  return this._agents ?? (this._agents = new Agents2({ client: this.client }));
1999
1947
  }
2000
- get knowledge() {
2001
- return this._knowledge ?? (this._knowledge = new Knowledge({ client: this.client }));
2002
- }
2003
1948
  get tasks() {
2004
1949
  return this._tasks ?? (this._tasks = new Tasks({ client: this.client }));
2005
1950
  }
@@ -2608,74 +2553,15 @@ export class Email extends HeyApiClient {
2608
2553
  return this._senders ?? (this._senders = new Senders({ client: this.client }));
2609
2554
  }
2610
2555
  }
2611
- export class McpTools extends HeyApiClient {
2556
+ export class Entries extends HeyApiClient {
2612
2557
  /**
2613
- * List Integration Mcp Tools
2614
- *
2615
- * Connect to the integration's MCP server and list every tool it offers.
2558
+ * Create Faq Entries
2616
2559
  *
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 {
2639
- /**
2640
- * List Integration Triggers
2641
- *
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.
2560
+ * Append question/answer entries to an FAQ, all or nothing. Live at once:
2561
+ * agents using the FAQ read them from their next session.
2676
2562
  */
2677
2563
  create(parameters, options) {
2678
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { key: 'createIntegrationTriggerRequest', map: 'body' }] }]);
2564
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'faq_id' }, { key: 'createFaqEntriesRequest', map: 'body' }] }]);
2679
2565
  return (options?.client ?? this.client).post({
2680
2566
  responseStyle: 'data',
2681
2567
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2683,7 +2569,7 @@ export class Triggers extends HeyApiClient {
2683
2569
  name: 'talqing_session',
2684
2570
  type: 'apiKey'
2685
2571
  }],
2686
- url: '/v1/integrations/{integration_id}/triggers',
2572
+ url: '/v1/faqs/{faq_id}/entries',
2687
2573
  ...options,
2688
2574
  ...params,
2689
2575
  headers: {
@@ -2694,12 +2580,12 @@ export class Triggers extends HeyApiClient {
2694
2580
  });
2695
2581
  }
2696
2582
  /**
2697
- * Delete Integration Trigger
2583
+ * Delete Faq Entry
2698
2584
  *
2699
- * Delete a trigger permanently. The agent stops receiving that event.
2585
+ * Delete one entry from an FAQ.
2700
2586
  */
2701
2587
  delete(parameters, options) {
2702
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { in: 'path', key: 'trigger_id' }] }]);
2588
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'faq_id' }, { in: 'path', key: 'entry_id' }] }]);
2703
2589
  return (options?.client ?? this.client).delete({
2704
2590
  responseStyle: 'data',
2705
2591
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2707,25 +2593,21 @@ export class Triggers extends HeyApiClient {
2707
2593
  name: 'talqing_session',
2708
2594
  type: 'apiKey'
2709
2595
  }],
2710
- url: '/v1/integrations/{integration_id}/triggers/{trigger_id}',
2596
+ url: '/v1/faqs/{faq_id}/entries/{entry_id}',
2711
2597
  ...options,
2712
2598
  ...params
2713
2599
  });
2714
2600
  }
2715
2601
  /**
2716
- * Patch Integration Trigger
2717
- *
2718
- * Update a trigger: reassign the agent, change reply mode, enable or
2719
- * disable it.
2602
+ * Update Faq Entry
2720
2603
  *
2721
- * Omitted fields are left unchanged, and enabling one runs the same checks
2722
- * creating it did.
2604
+ * Change one entry's question, answer or both. Live from the next session.
2723
2605
  */
2724
2606
  update(parameters, options) {
2725
2607
  const params = buildClientParams([parameters], [{ args: [
2726
- { in: 'path', key: 'integration_id' },
2727
- { in: 'path', key: 'trigger_id' },
2728
- { key: 'patchIntegrationTriggerRequest', map: 'body' }
2608
+ { in: 'path', key: 'faq_id' },
2609
+ { in: 'path', key: 'entry_id' },
2610
+ { key: 'updateFaqEntryRequest', map: 'body' }
2729
2611
  ] }]);
2730
2612
  return (options?.client ?? this.client).patch({
2731
2613
  responseStyle: 'data',
@@ -2734,7 +2616,7 @@ export class Triggers extends HeyApiClient {
2734
2616
  name: 'talqing_session',
2735
2617
  type: 'apiKey'
2736
2618
  }],
2737
- url: '/v1/integrations/{integration_id}/triggers/{trigger_id}',
2619
+ url: '/v1/faqs/{faq_id}/entries/{entry_id}',
2738
2620
  ...options,
2739
2621
  ...params,
2740
2622
  headers: {
@@ -2745,14 +2627,11 @@ export class Triggers extends HeyApiClient {
2745
2627
  });
2746
2628
  }
2747
2629
  }
2748
- export class Integrations extends HeyApiClient {
2630
+ export class Faqs extends HeyApiClient {
2749
2631
  /**
2750
- * List Integrations
2632
+ * List Faqs
2751
2633
  *
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.
2634
+ * List the workspace's FAQs by name, with how many questions each holds.
2756
2635
  */
2757
2636
  list(parameters, options) {
2758
2637
  const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
@@ -2763,26 +2642,18 @@ export class Integrations extends HeyApiClient {
2763
2642
  name: 'talqing_session',
2764
2643
  type: 'apiKey'
2765
2644
  }],
2766
- url: '/v1/integrations',
2645
+ url: '/v1/faqs',
2767
2646
  ...options,
2768
2647
  ...params
2769
2648
  });
2770
2649
  }
2771
2650
  /**
2772
- * Create Integration
2651
+ * Create Faq
2773
2652
  *
2774
- * Create a manual integration, fully configured.
2775
- *
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.
2653
+ * Create an FAQ, optionally with its first question/answer entries.
2783
2654
  */
2784
2655
  create(parameters, options) {
2785
- const params = buildClientParams([parameters], [{ args: [{ key: 'createIntegrationRequest', map: 'body' }] }]);
2656
+ const params = buildClientParams([parameters], [{ args: [{ key: 'faqDefinition', map: 'body' }] }]);
2786
2657
  return (options?.client ?? this.client).post({
2787
2658
  responseStyle: 'data',
2788
2659
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2790,7 +2661,7 @@ export class Integrations extends HeyApiClient {
2790
2661
  name: 'talqing_session',
2791
2662
  type: 'apiKey'
2792
2663
  }],
2793
- url: '/v1/integrations',
2664
+ url: '/v1/faqs',
2794
2665
  ...options,
2795
2666
  ...params,
2796
2667
  headers: {
@@ -2801,36 +2672,13 @@ export class Integrations extends HeyApiClient {
2801
2672
  });
2802
2673
  }
2803
2674
  /**
2804
- * Integration Catalog
2805
- *
2806
- * List the providers that can be integrated, and how to connect each one.
2675
+ * Delete Faq
2807
2676
  *
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
2829
- *
2830
- * Delete an integration and its triggers permanently.
2677
+ * Delete an FAQ and its entries. Refused with 409 while an agent or task
2678
+ * still attaches it.
2831
2679
  */
2832
2680
  delete(parameters, options) {
2833
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2681
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'faq_id' }] }]);
2834
2682
  return (options?.client ?? this.client).delete({
2835
2683
  responseStyle: 'data',
2836
2684
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2838,19 +2686,18 @@ export class Integrations extends HeyApiClient {
2838
2686
  name: 'talqing_session',
2839
2687
  type: 'apiKey'
2840
2688
  }],
2841
- url: '/v1/integrations/{integration_id}',
2689
+ url: '/v1/faqs/{faq_id}',
2842
2690
  ...options,
2843
2691
  ...params
2844
2692
  });
2845
2693
  }
2846
2694
  /**
2847
- * Get Integration
2695
+ * Get Faq
2848
2696
  *
2849
- * Fetch one integration: provider, status, structured config, trigger
2850
- * capabilities and inbound webhook setup state.
2697
+ * Get one FAQ with every entry, in the order they were added.
2851
2698
  */
2852
2699
  get(parameters, options) {
2853
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2700
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'faq_id' }] }]);
2854
2701
  return (options?.client ?? this.client).get({
2855
2702
  responseStyle: 'data',
2856
2703
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2858,26 +2705,18 @@ export class Integrations extends HeyApiClient {
2858
2705
  name: 'talqing_session',
2859
2706
  type: 'apiKey'
2860
2707
  }],
2861
- url: '/v1/integrations/{integration_id}',
2708
+ url: '/v1/faqs/{faq_id}',
2862
2709
  ...options,
2863
2710
  ...params
2864
2711
  });
2865
2712
  }
2866
2713
  /**
2867
- * Patch Integration
2868
- *
2869
- * Update an integration. Omitted fields are left unchanged.
2714
+ * Update Faq
2870
2715
  *
2871
- * Sending `credentials_ref` rotates the credential. Only `active` integrations
2872
- * can be attached to agents or serve triggers.
2873
- *
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.
2716
+ * Rename an FAQ.
2878
2717
  */
2879
2718
  update(parameters, options) {
2880
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { key: 'patchIntegrationRequest', map: 'body' }] }]);
2719
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'faq_id' }, { key: 'updateFaqRequest', map: 'body' }] }]);
2881
2720
  return (options?.client ?? this.client).patch({
2882
2721
  responseStyle: 'data',
2883
2722
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2885,7 +2724,7 @@ export class Integrations extends HeyApiClient {
2885
2724
  name: 'talqing_session',
2886
2725
  type: 'apiKey'
2887
2726
  }],
2888
- url: '/v1/integrations/{integration_id}',
2727
+ url: '/v1/faqs/{faq_id}',
2889
2728
  ...options,
2890
2729
  ...params,
2891
2730
  headers: {
@@ -2895,45 +2734,52 @@ export class Integrations extends HeyApiClient {
2895
2734
  }
2896
2735
  });
2897
2736
  }
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 }));
2737
+ get entries() {
2738
+ return this._entries ?? (this._entries = new Entries({ client: this.client }));
2903
2739
  }
2904
2740
  }
2905
- export class Nodes extends HeyApiClient {
2741
+ export class McpTools extends HeyApiClient {
2906
2742
  /**
2907
- * Delete Node
2743
+ * List Integration Mcp Tools
2908
2744
  *
2909
- * Drop one entry from the table of contents, permanently.
2745
+ * Connect to the integration's MCP server and list every tool it offers.
2910
2746
  *
2911
- * Its children go with it, and agents can no longer retrieve any of it.
2747
+ * A live call to the provider, so it also proves the connection works. The
2748
+ * list is unfiltered — it is what tool approval is chosen from. Which of these
2749
+ * an attached agent can actually call is the integration's `allowed_tools`
2750
+ * (null there means all of them). Fails if the integration is not active or
2751
+ * the server is unreachable.
2912
2752
  */
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({
2753
+ list(parameters, options) {
2754
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2755
+ return (options?.client ?? this.client).get({
2916
2756
  responseStyle: 'data',
2917
2757
  security: [{ scheme: 'bearer', type: 'http' }, {
2918
2758
  in: 'cookie',
2919
2759
  name: 'talqing_session',
2920
2760
  type: 'apiKey'
2921
2761
  }],
2922
- url: '/v1/knowledge/{kb_id}/nodes/{node_id}',
2762
+ url: '/v1/integrations/{integration_id}/mcp-tools',
2923
2763
  ...options,
2924
2764
  ...params
2925
2765
  });
2926
2766
  }
2767
+ }
2768
+ export class Triggers extends HeyApiClient {
2927
2769
  /**
2928
- * Get Node
2770
+ * List Integration Triggers
2929
2771
  *
2930
- * Read one entry of the table of contents, with its full content.
2772
+ * List the trigger deployments under an integration.
2931
2773
  *
2932
- * This is the text an agent retrieves when it fetches this node. `version` is
2933
- * what `patch_node` needs for a safe edit.
2774
+ * A trigger binds an inbound provider event — a Telegram message — to a
2775
+ * published agent version.
2934
2776
  */
2935
- get(parameters, options) {
2936
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }, { in: 'path', key: 'node_id' }] }]);
2777
+ list(parameters, options) {
2778
+ const params = buildClientParams([parameters], [{ args: [
2779
+ { in: 'path', key: 'integration_id' },
2780
+ { in: 'query', key: 'limit' },
2781
+ { in: 'query', key: 'offset' }
2782
+ ] }]);
2937
2783
  return (options?.client ?? this.client).get({
2938
2784
  responseStyle: 'data',
2939
2785
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -2941,37 +2787,33 @@ export class Nodes extends HeyApiClient {
2941
2787
  name: 'talqing_session',
2942
2788
  type: 'apiKey'
2943
2789
  }],
2944
- url: '/v1/knowledge/{kb_id}/nodes/{node_id}',
2790
+ url: '/v1/integrations/{integration_id}/triggers',
2945
2791
  ...options,
2946
2792
  ...params
2947
2793
  });
2948
2794
  }
2949
2795
  /**
2950
- * Patch Node
2796
+ * Create Integration Trigger
2951
2797
  *
2952
- * Correct one entry's title, summary or content by hand — the way to fix a
2953
- * fact the crawl got wrong without rebuilding.
2798
+ * Deploy an agent to an inbound provider event.
2954
2799
  *
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.
2800
+ * `reply_mode` decides what happens with the agent's answer: `public_reply`
2801
+ * sends it to the customer, `internal_note` posts it privately where the
2802
+ * provider supports that, `none` generates without sending.
2957
2803
  *
2958
- * Send the `version` you read from `get_node`; a mismatch is rejected rather
2959
- * than overwriting someone else's edit.
2804
+ * Enabling validates that the integration is active and the assigned agent is
2805
+ * a published text agent, so create disabled while still wiring things up.
2960
2806
  */
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({
2807
+ create(parameters, options) {
2808
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { key: 'createIntegrationTriggerRequest', map: 'body' }] }]);
2809
+ return (options?.client ?? this.client).post({
2968
2810
  responseStyle: 'data',
2969
2811
  security: [{ scheme: 'bearer', type: 'http' }, {
2970
2812
  in: 'cookie',
2971
2813
  name: 'talqing_session',
2972
2814
  type: 'apiKey'
2973
2815
  }],
2974
- url: '/v1/knowledge/{kb_id}/nodes/{node_id}',
2816
+ url: '/v1/integrations/{integration_id}/triggers',
2975
2817
  ...options,
2976
2818
  ...params,
2977
2819
  headers: {
@@ -2981,80 +2823,48 @@ export class Nodes extends HeyApiClient {
2981
2823
  }
2982
2824
  });
2983
2825
  }
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
2826
  /**
3016
- * List Kbs
3017
- *
3018
- * List the workspace's knowledge bases with their build status.
2827
+ * Delete Integration Trigger
3019
2828
  *
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`.
2829
+ * Delete a trigger permanently. The agent stops receiving that event.
3023
2830
  */
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({
2831
+ delete(parameters, options) {
2832
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { in: 'path', key: 'trigger_id' }] }]);
2833
+ return (options?.client ?? this.client).delete({
3027
2834
  responseStyle: 'data',
3028
2835
  security: [{ scheme: 'bearer', type: 'http' }, {
3029
2836
  in: 'cookie',
3030
2837
  name: 'talqing_session',
3031
2838
  type: 'apiKey'
3032
2839
  }],
3033
- url: '/v1/knowledge',
2840
+ url: '/v1/integrations/{integration_id}/triggers/{trigger_id}',
3034
2841
  ...options,
3035
2842
  ...params
3036
2843
  });
3037
2844
  }
3038
2845
  /**
3039
- * Create Kb
2846
+ * Patch Integration Trigger
3040
2847
  *
3041
- * Start a knowledge base by crawling one or more websites.
2848
+ * Update a trigger: reassign the agent, change reply mode, enable or
2849
+ * disable it.
3042
2850
  *
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.
2851
+ * Omitted fields are left unchanged, and enabling one runs the same checks
2852
+ * creating it did.
3047
2853
  */
3048
- create(parameters, options) {
3049
- const params = buildClientParams([parameters], [{ args: [{ key: 'createKbRequest', map: 'body' }] }]);
3050
- return (options?.client ?? this.client).post({
2854
+ update(parameters, options) {
2855
+ const params = buildClientParams([parameters], [{ args: [
2856
+ { in: 'path', key: 'integration_id' },
2857
+ { in: 'path', key: 'trigger_id' },
2858
+ { key: 'patchIntegrationTriggerRequest', map: 'body' }
2859
+ ] }]);
2860
+ return (options?.client ?? this.client).patch({
3051
2861
  responseStyle: 'data',
3052
2862
  security: [{ scheme: 'bearer', type: 'http' }, {
3053
2863
  in: 'cookie',
3054
2864
  name: 'talqing_session',
3055
2865
  type: 'apiKey'
3056
2866
  }],
3057
- url: '/v1/knowledge',
2867
+ url: '/v1/integrations/{integration_id}/triggers/{trigger_id}',
3058
2868
  ...options,
3059
2869
  ...params,
3060
2870
  headers: {
@@ -3064,115 +2874,113 @@ export class Knowledge2 extends HeyApiClient {
3064
2874
  }
3065
2875
  });
3066
2876
  }
2877
+ }
2878
+ export class Integrations extends HeyApiClient {
3067
2879
  /**
3068
- * Delete Kb
2880
+ * List Integrations
3069
2881
  *
3070
- * Delete a knowledge base and everything crawled into it, permanently.
2882
+ * List the workspace's integrations with their provider, status and config.
3071
2883
  *
3072
- * Rebuilding means crawling the site again. Agents that list it in `kb_ids`
3073
- * lose those grounded answers, so detach it there first.
2884
+ * Secret values are never returned — credential fields come back as
2885
+ * `{{secrets.NAME}}` references.
3074
2886
  */
3075
- delete(parameters, options) {
3076
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
3077
- return (options?.client ?? this.client).delete({
2887
+ list(parameters, options) {
2888
+ const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
2889
+ return (options?.client ?? this.client).get({
3078
2890
  responseStyle: 'data',
3079
2891
  security: [{ scheme: 'bearer', type: 'http' }, {
3080
2892
  in: 'cookie',
3081
2893
  name: 'talqing_session',
3082
2894
  type: 'apiKey'
3083
2895
  }],
3084
- url: '/v1/knowledge/{kb_id}',
2896
+ url: '/v1/integrations',
3085
2897
  ...options,
3086
2898
  ...params
3087
2899
  });
3088
2900
  }
3089
2901
  /**
3090
- * Get Kb
2902
+ * Create Integration
3091
2903
  *
3092
- * Read one knowledge base: build status, progress and content tree.
2904
+ * Create a manual integration, fully configured.
2905
+ *
2906
+ * Which of `credentials_ref`, `provider_account_info`, `mcp_config` and
2907
+ * `webhook_config` a provider needs is described by its `setup_fields` in the
2908
+ * integration catalog. Secret-bearing fields take a plaintext value — stored
2909
+ * as a workspace secret — or an existing `{{secrets.NAME}}` reference.
3093
2910
  *
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.
2911
+ * Leave `allowed_tools` unset to expose every tool the server lists. OAuth
2912
+ * providers are connected from the dashboard instead.
3098
2913
  */
3099
- get(parameters, options) {
3100
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
3101
- return (options?.client ?? this.client).get({
2914
+ create(parameters, options) {
2915
+ const params = buildClientParams([parameters], [{ args: [{ key: 'createIntegrationRequest', map: 'body' }] }]);
2916
+ return (options?.client ?? this.client).post({
3102
2917
  responseStyle: 'data',
3103
2918
  security: [{ scheme: 'bearer', type: 'http' }, {
3104
2919
  in: 'cookie',
3105
2920
  name: 'talqing_session',
3106
2921
  type: 'apiKey'
3107
2922
  }],
3108
- url: '/v1/knowledge/{kb_id}',
2923
+ url: '/v1/integrations',
3109
2924
  ...options,
3110
- ...params
2925
+ ...params,
2926
+ headers: {
2927
+ 'Content-Type': 'application/json',
2928
+ ...options?.headers,
2929
+ ...params.headers
2930
+ }
3111
2931
  });
3112
2932
  }
3113
2933
  /**
3114
- * Build Kb
2934
+ * Integration Catalog
3115
2935
  *
3116
- * Index the chosen pages, then write the table of contents.
2936
+ * List the providers that can be integrated, and how to connect each one.
3117
2937
  *
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.
2938
+ * `auth_type` says which path a provider takes: `manual` through this API,
2939
+ * `oauth` from the dashboard. `setup_fields` is the authoritative list of what
2940
+ * each manual provider requires — read it rather than guessing. `capabilities`
2941
+ * says whether it serves tools (MCP) or a messaging channel (triggers).
3122
2942
  */
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({
2943
+ catalog(parameters, options) {
2944
+ const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
2945
+ return (options?.client ?? this.client).get({
3126
2946
  responseStyle: 'data',
3127
2947
  security: [{ scheme: 'bearer', type: 'http' }, {
3128
2948
  in: 'cookie',
3129
2949
  name: 'talqing_session',
3130
2950
  type: 'apiKey'
3131
2951
  }],
3132
- url: '/v1/knowledge/{kb_id}/build',
2952
+ url: '/v1/integrations/catalog',
3133
2953
  ...options,
3134
- ...params,
3135
- headers: {
3136
- 'Content-Type': 'application/json',
3137
- ...options?.headers,
3138
- ...params.headers
3139
- }
2954
+ ...params
3140
2955
  });
3141
2956
  }
3142
2957
  /**
3143
- * Events
3144
- *
3145
- * Watch one knowledge base build: `snapshot` first, then `progress` and `status`.
2958
+ * Delete Integration
3146
2959
  *
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.
2960
+ * Delete an integration and its triggers permanently.
3150
2961
  */
3151
- events(parameters, options) {
3152
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
3153
- return (options?.client ?? this.client).sse.get({
2962
+ delete(parameters, options) {
2963
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2964
+ return (options?.client ?? this.client).delete({
3154
2965
  responseStyle: 'data',
3155
2966
  security: [{ scheme: 'bearer', type: 'http' }, {
3156
2967
  in: 'cookie',
3157
2968
  name: 'talqing_session',
3158
2969
  type: 'apiKey'
3159
2970
  }],
3160
- url: '/v1/knowledge/{kb_id}/events',
2971
+ url: '/v1/integrations/{integration_id}',
3161
2972
  ...options,
3162
2973
  ...params
3163
2974
  });
3164
2975
  }
3165
2976
  /**
3166
- * Get Kb Prompt
3167
- *
3168
- * The table of contents exactly as an agent using this KB is given it.
2977
+ * Get Integration
3169
2978
  *
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.
2979
+ * Fetch one integration: provider, status, structured config, trigger
2980
+ * capabilities and inbound webhook setup state.
3173
2981
  */
3174
- prompt(parameters, options) {
3175
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
2982
+ get(parameters, options) {
2983
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
3176
2984
  return (options?.client ?? this.client).get({
3177
2985
  responseStyle: 'data',
3178
2986
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -3180,39 +2988,48 @@ export class Knowledge2 extends HeyApiClient {
3180
2988
  name: 'talqing_session',
3181
2989
  type: 'apiKey'
3182
2990
  }],
3183
- url: '/v1/knowledge/{kb_id}/prompt',
2991
+ url: '/v1/integrations/{integration_id}',
3184
2992
  ...options,
3185
2993
  ...params
3186
2994
  });
3187
2995
  }
3188
2996
  /**
3189
- * Regenerate Toc
2997
+ * Patch Integration
3190
2998
  *
3191
- * Rewrite the table of contents from the pages already indexed.
2999
+ * Update an integration. Omitted fields are left unchanged.
3192
3000
  *
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.
3001
+ * Sending `credentials_ref` rotates the credential. Only `active` integrations
3002
+ * can be attached to agents or serve triggers.
3003
+ *
3004
+ * `allowed_tools` replaces the approved list wholesale: exactly those tools
3005
+ * become callable by every agent this integration is attached to. It cannot be
3006
+ * emptied — an agent that should call nothing is an integration that should be
3007
+ * disabled.
3196
3008
  */
3197
- regenerateToc(parameters, options) {
3198
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
3199
- return (options?.client ?? this.client).post({
3009
+ update(parameters, options) {
3010
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { key: 'patchIntegrationRequest', map: 'body' }] }]);
3011
+ return (options?.client ?? this.client).patch({
3200
3012
  responseStyle: 'data',
3201
3013
  security: [{ scheme: 'bearer', type: 'http' }, {
3202
3014
  in: 'cookie',
3203
3015
  name: 'talqing_session',
3204
3016
  type: 'apiKey'
3205
3017
  }],
3206
- url: '/v1/knowledge/{kb_id}/toc',
3018
+ url: '/v1/integrations/{integration_id}',
3207
3019
  ...options,
3208
- ...params
3020
+ ...params,
3021
+ headers: {
3022
+ 'Content-Type': 'application/json',
3023
+ ...options?.headers,
3024
+ ...params.headers
3025
+ }
3209
3026
  });
3210
3027
  }
3211
- get nodes() {
3212
- return this._nodes ?? (this._nodes = new Nodes({ client: this.client }));
3028
+ get mcpTools() {
3029
+ return this._mcpTools ?? (this._mcpTools = new McpTools({ client: this.client }));
3213
3030
  }
3214
- get pages() {
3215
- return this._pages ?? (this._pages = new Pages({ client: this.client }));
3031
+ get triggers() {
3032
+ return this._triggers ?? (this._triggers = new Triggers({ client: this.client }));
3216
3033
  }
3217
3034
  }
3218
3035
  export class Observability extends HeyApiClient {
@@ -5100,12 +4917,12 @@ export class TalqingApi extends HeyApiClient {
5100
4917
  get email() {
5101
4918
  return this._email ?? (this._email = new Email({ client: this.client }));
5102
4919
  }
4920
+ get faqs() {
4921
+ return this._faqs ?? (this._faqs = new Faqs({ client: this.client }));
4922
+ }
5103
4923
  get integrations() {
5104
4924
  return this._integrations ?? (this._integrations = new Integrations({ client: this.client }));
5105
4925
  }
5106
- get knowledge() {
5107
- return this._knowledge ?? (this._knowledge = new Knowledge2({ client: this.client }));
5108
- }
5109
4926
  get observability() {
5110
4927
  return this._observability ?? (this._observability = new Observability({ client: this.client }));
5111
4928
  }