@talqing/sdk 0.14.0 → 0.15.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.
@@ -1386,9 +1386,9 @@ export type CallBatchResponse = {
1386
1386
  * CallDetailResponse
1387
1387
  */
1388
1388
  export type CallDetailResponse = {
1389
- agent_config?: AgentConfig | null;
1390
- agent_plan?: StoredAgentPlan | null;
1391
- cost?: CostDetailResponse | null;
1389
+ agent_config: AgentConfig | null;
1390
+ agent_plan: StoredAgentPlan | null;
1391
+ cost: CostDetailResponse | null;
1392
1392
  /**
1393
1393
  * Events
1394
1394
  */
@@ -1396,21 +1396,21 @@ export type CallDetailResponse = {
1396
1396
  /**
1397
1397
  * Greeting
1398
1398
  */
1399
- greeting?: string | null;
1399
+ greeting: string | null;
1400
1400
  session: CallSessionResponse;
1401
1401
  snapshot: HealthSnapshotResponse;
1402
1402
  /**
1403
1403
  * Starting Prompt
1404
1404
  */
1405
- starting_prompt?: string;
1405
+ starting_prompt: string;
1406
1406
  /**
1407
1407
  * Team
1408
1408
  */
1409
- team?: Array<CallTeamMemberResponse>;
1409
+ team: Array<TeamMemberResponse>;
1410
1410
  /**
1411
1411
  * Tools
1412
1412
  */
1413
- tools: Array<CallToolResponse>;
1413
+ tools: Array<SessionToolResponse>;
1414
1414
  /**
1415
1415
  * Transcript
1416
1416
  */
@@ -1419,7 +1419,7 @@ export type CallDetailResponse = {
1419
1419
  /**
1420
1420
  * Vars
1421
1421
  */
1422
- vars?: {
1422
+ vars: {
1423
1423
  [key: string]: string;
1424
1424
  };
1425
1425
  };
@@ -1718,25 +1718,6 @@ export type CallSummaryResponse = {
1718
1718
  */
1719
1719
  type: 'WEB' | 'SIP_INBOUND' | 'SIP_OUTBOUND' | 'STREAM' | 'WHATSAPP_INBOUND';
1720
1720
  };
1721
- /**
1722
- * CallTeamMemberResponse
1723
- *
1724
- * One agent on the call's roster. `[0]` is the one that answered.
1725
- */
1726
- export type CallTeamMemberResponse = {
1727
- /**
1728
- * Agent Id
1729
- */
1730
- agent_id?: string | null;
1731
- /**
1732
- * Name
1733
- */
1734
- name: string;
1735
- /**
1736
- * Version
1737
- */
1738
- version?: number | 'draft' | null;
1739
- };
1740
1721
  /**
1741
1722
  * CallTokenResponse
1742
1723
  *
@@ -1760,47 +1741,6 @@ export type CallTokenResponse = {
1760
1741
  */
1761
1742
  warnings: Array<string>;
1762
1743
  };
1763
- /**
1764
- * CallToolResponse
1765
- *
1766
- * A tool the agent could call, as it stood on this call.
1767
- *
1768
- * ``id`` is null for a tool defined inline in the request that started the
1769
- * call: it has no `tools` row, and inventing an id would offer a link to a
1770
- * page that does not exist.
1771
- */
1772
- export type CallToolResponse = {
1773
- /**
1774
- * Description
1775
- */
1776
- description: string;
1777
- /**
1778
- * Disable Interruptions
1779
- */
1780
- disable_interruptions?: boolean;
1781
- /**
1782
- * Id
1783
- */
1784
- id?: string | null;
1785
- /**
1786
- * Json Schema
1787
- */
1788
- json_schema?: {
1789
- [key: string]: unknown;
1790
- };
1791
- /**
1792
- * Long Running Task
1793
- */
1794
- long_running_task?: boolean;
1795
- /**
1796
- * Name
1797
- */
1798
- name: string;
1799
- /**
1800
- * Silent
1801
- */
1802
- silent?: boolean;
1803
- };
1804
1744
  /**
1805
1745
  * CatalogResponse
1806
1746
  */
@@ -1863,16 +1803,52 @@ export type CatalogResponse = {
1863
1803
  /**
1864
1804
  * ChatDetailResponse
1865
1805
  *
1866
- * One chat with what explains it: health, priced lines, vars and trace.
1806
+ * One chat with what explains it: health, priced lines, what it ran, and trace.
1867
1807
  */
1868
1808
  export type ChatDetailResponse = {
1809
+ agent_config: AgentConfig | null;
1810
+ agent_plan: StoredAgentPlan | null;
1811
+ /**
1812
+ * Agent Version
1813
+ */
1814
+ agent_version: number | 'draft' | null;
1815
+ /**
1816
+ * Billed At
1817
+ */
1818
+ billed_at: string | null;
1819
+ /**
1820
+ * Billing Status
1821
+ */
1822
+ billing_status: string;
1869
1823
  chat: ChatResponse;
1824
+ /**
1825
+ * Contact Userdata
1826
+ */
1827
+ contact_userdata: {
1828
+ [key: string]: unknown;
1829
+ };
1870
1830
  cost: CostDetailResponse | null;
1871
1831
  /**
1872
1832
  * Events
1873
1833
  */
1874
1834
  events: Array<SessionEventResponse>;
1835
+ /**
1836
+ * Phone Number Id
1837
+ */
1838
+ phone_number_id: string | null;
1875
1839
  snapshot: HealthSnapshotResponse;
1840
+ /**
1841
+ * Starting Prompt
1842
+ */
1843
+ starting_prompt: string;
1844
+ /**
1845
+ * Team
1846
+ */
1847
+ team: Array<TeamMemberResponse>;
1848
+ /**
1849
+ * Tools
1850
+ */
1851
+ tools: Array<SessionToolResponse>;
1876
1852
  /**
1877
1853
  * Vars
1878
1854
  */
@@ -3562,8 +3538,34 @@ export type CreateWebhookRequest = {
3562
3538
  };
3563
3539
  /**
3564
3540
  * CreateWhatsAppBatchRequest
3541
+ *
3542
+ * The agent fields choose who answers replies; omit them for the number's agent.
3565
3543
  */
3566
3544
  export type CreateWhatsAppBatchRequest = {
3545
+ /**
3546
+ * A complete agent definition, run for this call and stored nowhere. Mutually exclusive with `agent_id`.
3547
+ */
3548
+ agent?: AgentConfig | null;
3549
+ /**
3550
+ * Agent Id
3551
+ *
3552
+ * An agent in this workspace. Mutually exclusive with `agent`.
3553
+ */
3554
+ agent_id?: string | null;
3555
+ /**
3556
+ * Changes layered on top of whichever base was named. Absent keys keep the base value, an explicit null clears the field, objects deep-merge and lists replace.
3557
+ */
3558
+ agent_override?: AgentOverride | null;
3559
+ /**
3560
+ * Run several agents on this call, defined here. Mutually exclusive with `agent_id` / `agent` / `agent_version` / `agent_override`.
3561
+ */
3562
+ agent_team?: AgentTeam | null;
3563
+ /**
3564
+ * Agent Version
3565
+ *
3566
+ * Which version of `agent_id` to run. Omit for the published one. `"draft"` runs the unpublished working copy — validated and tool-pinned at request time, and refused with the publish errors if it does not hold together.
3567
+ */
3568
+ agent_version?: number | 'draft' | null;
3567
3569
  /**
3568
3570
  * Delivery Attempts
3569
3571
  *
@@ -3626,6 +3628,14 @@ export type CreateWhatsAppBatchRequest = {
3626
3628
  variable_map: {
3627
3629
  [key: string]: string;
3628
3630
  };
3631
+ /**
3632
+ * Vars
3633
+ *
3634
+ * Values for the variables the agents on this session declare, read as {{vars.name}} in a prompt, a greeting and a tool. They override each agent's declared default and reach every agent the session runs, including a handoff target. Unlike `userdata`, which describes the PERSON and is kept on their contact record, these describe THIS session and are gone with it. Strings only; an empty string is a deliberate blank, not a request for the default. The model can see them, so credentials go in `secrets` (this session's own, where the request takes them) or a workspace secret, read as {{secrets.NAME}} by a tool.
3635
+ */
3636
+ vars?: {
3637
+ [key: string]: string;
3638
+ } | null;
3629
3639
  window?: TimeWindow | null;
3630
3640
  };
3631
3641
  /**
@@ -8507,8 +8517,35 @@ export type PatchWebhookRequest = {
8507
8517
  * PatchWhatsAppBatchRequest
8508
8518
  *
8509
8519
  * Edits. ``window``, ``start_at`` and ``send_daily_cap`` take ``null`` to clear.
8520
+ *
8521
+ * Any agent field replaces the batch's agent wholesale; all of them null returns
8522
+ * replies to the number's agent.
8510
8523
  */
8511
8524
  export type PatchWhatsAppBatchRequest = {
8525
+ /**
8526
+ * A complete agent definition, run for this call and stored nowhere. Mutually exclusive with `agent_id`.
8527
+ */
8528
+ agent?: AgentConfig | null;
8529
+ /**
8530
+ * Agent Id
8531
+ *
8532
+ * An agent in this workspace. Mutually exclusive with `agent`.
8533
+ */
8534
+ agent_id?: string | null;
8535
+ /**
8536
+ * Changes layered on top of whichever base was named. Absent keys keep the base value, an explicit null clears the field, objects deep-merge and lists replace.
8537
+ */
8538
+ agent_override?: AgentOverride | null;
8539
+ /**
8540
+ * Run several agents on this call, defined here. Mutually exclusive with `agent_id` / `agent` / `agent_version` / `agent_override`.
8541
+ */
8542
+ agent_team?: AgentTeam | null;
8543
+ /**
8544
+ * Agent Version
8545
+ *
8546
+ * Which version of `agent_id` to run. Omit for the published one. `"draft"` runs the unpublished working copy — validated and tool-pinned at request time, and refused with the publish errors if it does not hold together.
8547
+ */
8548
+ agent_version?: number | 'draft' | null;
8512
8549
  /**
8513
8550
  * Delivery Attempts
8514
8551
  *
@@ -8551,6 +8588,14 @@ export type PatchWhatsAppBatchRequest = {
8551
8588
  variable_map?: {
8552
8589
  [key: string]: string;
8553
8590
  };
8591
+ /**
8592
+ * Vars
8593
+ *
8594
+ * Values for the variables the agents on this session declare, read as {{vars.name}} in a prompt, a greeting and a tool. They override each agent's declared default and reach every agent the session runs, including a handoff target. Unlike `userdata`, which describes the PERSON and is kept on their contact record, these describe THIS session and are gone with it. Strings only; an empty string is a deliberate blank, not a request for the default. The model can see them, so credentials go in `secrets` (this session's own, where the request takes them) or a workspace secret, read as {{secrets.NAME}} by a tool.
8595
+ */
8596
+ vars?: {
8597
+ [key: string]: string;
8598
+ } | null;
8554
8599
  window?: TimeWindow | null;
8555
8600
  };
8556
8601
  /**
@@ -8678,8 +8723,34 @@ export type PlatformFeePerMinute = {
8678
8723
  };
8679
8724
  /**
8680
8725
  * PostItemRequest
8726
+ *
8727
+ * The agent fields make that agent answer this person; omit them to continue whatever runs.
8681
8728
  */
8682
8729
  export type PostItemRequest = {
8730
+ /**
8731
+ * A complete agent definition, run for this call and stored nowhere. Mutually exclusive with `agent_id`.
8732
+ */
8733
+ agent?: AgentConfig | null;
8734
+ /**
8735
+ * Agent Id
8736
+ *
8737
+ * An agent in this workspace. Mutually exclusive with `agent`.
8738
+ */
8739
+ agent_id?: string | null;
8740
+ /**
8741
+ * Changes layered on top of whichever base was named. Absent keys keep the base value, an explicit null clears the field, objects deep-merge and lists replace.
8742
+ */
8743
+ agent_override?: AgentOverride | null;
8744
+ /**
8745
+ * Run several agents on this call, defined here. Mutually exclusive with `agent_id` / `agent` / `agent_version` / `agent_override`.
8746
+ */
8747
+ agent_team?: AgentTeam | null;
8748
+ /**
8749
+ * Agent Version
8750
+ *
8751
+ * Which version of `agent_id` to run. Omit for the published one. `"draft"` runs the unpublished working copy — validated and tool-pinned at request time, and refused with the publish errors if it does not hold together.
8752
+ */
8753
+ agent_version?: number | 'draft' | null;
8683
8754
  /**
8684
8755
  * Who at your business posted this; shown in transcripts, never sent to the person or shown to the agent.
8685
8756
  */
@@ -8694,6 +8765,14 @@ export type PostItemRequest = {
8694
8765
  * fail refuses free text outside WhatsApp's 24h window; an opener sends that template and holds the message until they reply.
8695
8766
  */
8696
8767
  on_window_closed?: 'fail' | OpenerPolicy;
8768
+ /**
8769
+ * Secrets
8770
+ *
8771
+ * Secrets for this session only, read by tools as {{secrets.NAME}}; a name here overrides the workspace secret. Never shown to the model or returned.
8772
+ */
8773
+ secrets?: {
8774
+ [key: string]: string;
8775
+ } | null;
8697
8776
  /**
8698
8777
  * For `template` only.
8699
8778
  */
@@ -8722,6 +8801,14 @@ export type PostItemRequest = {
8722
8801
  userdata?: {
8723
8802
  [key: string]: unknown;
8724
8803
  } | null;
8804
+ /**
8805
+ * Vars
8806
+ *
8807
+ * Values for the variables the agents on this session declare, read as {{vars.name}} in a prompt, a greeting and a tool. They override each agent's declared default and reach every agent the session runs, including a handoff target. Unlike `userdata`, which describes the PERSON and is kept on their contact record, these describe THIS session and are gone with it. Strings only; an empty string is a deliberate blank, not a request for the default. The model can see them, so credentials go in `secrets` (this session's own, where the request takes them) or a workspace secret, read as {{secrets.NAME}} by a tool.
8808
+ */
8809
+ vars?: {
8810
+ [key: string]: string;
8811
+ } | null;
8725
8812
  };
8726
8813
  /**
8727
8814
  * PostTarget
@@ -10384,6 +10471,47 @@ export type SessionMetrics = {
10384
10471
  */
10385
10472
  usage_reported?: boolean;
10386
10473
  };
10474
+ /**
10475
+ * SessionToolResponse
10476
+ *
10477
+ * A tool the agent could call, as it stood on this session.
10478
+ *
10479
+ * ``id`` is null for a tool defined inline in the request that started the
10480
+ * session: it has no `tools` row, and inventing an id would offer a link to a
10481
+ * page that does not exist.
10482
+ */
10483
+ export type SessionToolResponse = {
10484
+ /**
10485
+ * Description
10486
+ */
10487
+ description: string;
10488
+ /**
10489
+ * Disable Interruptions
10490
+ */
10491
+ disable_interruptions?: boolean;
10492
+ /**
10493
+ * Id
10494
+ */
10495
+ id?: string | null;
10496
+ /**
10497
+ * Json Schema
10498
+ */
10499
+ json_schema?: {
10500
+ [key: string]: unknown;
10501
+ };
10502
+ /**
10503
+ * Long Running Task
10504
+ */
10505
+ long_running_task?: boolean;
10506
+ /**
10507
+ * Name
10508
+ */
10509
+ name: string;
10510
+ /**
10511
+ * Silent
10512
+ */
10513
+ silent?: boolean;
10514
+ };
10387
10515
  /**
10388
10516
  * SessionUsage
10389
10517
  *
@@ -11762,6 +11890,25 @@ export type TaskVersionResponse = {
11762
11890
  */
11763
11891
  version: number;
11764
11892
  };
11893
+ /**
11894
+ * TeamMemberResponse
11895
+ *
11896
+ * One agent on the session's roster. `[0]` is the one that answered.
11897
+ */
11898
+ export type TeamMemberResponse = {
11899
+ /**
11900
+ * Agent Id
11901
+ */
11902
+ agent_id?: string | null;
11903
+ /**
11904
+ * Name
11905
+ */
11906
+ name: string;
11907
+ /**
11908
+ * Version
11909
+ */
11910
+ version?: number | 'draft' | null;
11911
+ };
11765
11912
  /**
11766
11913
  * TelephonyAccountResponse
11767
11914
  */
@@ -13198,6 +13345,7 @@ export type WhatsAppBatchResponse = {
13198
13345
  * Agent Name
13199
13346
  */
13200
13347
  agent_name: string | null;
13348
+ agent_plan: StoredAgentPlan | null;
13201
13349
  counts: WhatsAppBatchCounts;
13202
13350
  /**
13203
13351
  * Created At
@@ -13247,6 +13395,10 @@ export type WhatsAppBatchResponse = {
13247
13395
  * Next Send Reason
13248
13396
  */
13249
13397
  next_send_reason: 'start' | 'window' | 'daily_cap' | 'retry' | 'gap' | null;
13398
+ /**
13399
+ * Own Agent
13400
+ */
13401
+ own_agent: boolean;
13250
13402
  /**
13251
13403
  * Send Daily Cap
13252
13404
  */
@@ -13298,6 +13450,12 @@ export type WhatsAppBatchResponse = {
13298
13450
  variable_map: {
13299
13451
  [key: string]: string;
13300
13452
  };
13453
+ /**
13454
+ * Vars
13455
+ */
13456
+ vars: {
13457
+ [key: string]: string;
13458
+ } | null;
13301
13459
  window: TimeWindow | null;
13302
13460
  };
13303
13461
  /**