chatbase 0.2.0 → 0.3.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.
@@ -1652,12 +1652,16 @@
1652
1652
  "set.js"
1653
1653
  ]
1654
1654
  },
1655
- "helpdesk:statuses": {
1655
+ "conversations:export": {
1656
1656
  "aliases": [],
1657
1657
  "args": {},
1658
- "description": "List ticket statuses for an agent",
1658
+ "description": "Export conversations with full message history, newest first.\n\nThis is the only endpoint that returns conversations from every source — the chat bubble and external integrations (Slack, WhatsApp, Instagram, Messenger, and the like) as well as API-created ones. Prefer it over `conversations list` whenever you need real traffic rather than just programmatically created conversations. Each item embeds its own `messages` array, so no follow-up `conversations get` or `messages list` call is needed (and neither works for bubble/integration conversations).",
1659
1659
  "examples": [
1660
- "<%= config.bin %> helpdesk statuses -a agt_123"
1660
+ "<%= config.bin %> conversations export -a agt_123",
1661
+ "<%= config.bin %> conversations export -a agt_123 --all -o export.json",
1662
+ "<%= config.bin %> conversations export -a agt_123 --start-date 2024-01-01 --end-date 2024-01-31",
1663
+ "<%= config.bin %> conversations export -a agt_123 --include summary --source Widget,WhatsApp",
1664
+ "<%= config.bin %> conversations export -a agt_123 --conversation conv_123"
1661
1665
  ],
1662
1666
  "flags": {
1663
1667
  "json": {
@@ -1716,85 +1720,70 @@
1716
1720
  "hasDynamicHelp": false,
1717
1721
  "multiple": false,
1718
1722
  "type": "option"
1719
- }
1720
- },
1721
- "hasDynamicHelp": false,
1722
- "hiddenAliases": [],
1723
- "id": "helpdesk:statuses",
1724
- "pluginAlias": "chatbase",
1725
- "pluginName": "chatbase",
1726
- "pluginType": "core",
1727
- "strict": true,
1728
- "enableJsonFlag": false,
1729
- "isESM": true,
1730
- "relativePath": [
1731
- "dist",
1732
- "commands",
1733
- "helpdesk",
1734
- "statuses.js"
1735
- ]
1736
- },
1737
- "helpdesk:teams": {
1738
- "aliases": [],
1739
- "args": {},
1740
- "description": "List helpdesk teams for an agent",
1741
- "examples": [
1742
- "<%= config.bin %> helpdesk teams -a agt_123"
1743
- ],
1744
- "flags": {
1745
- "json": {
1746
- "description": "Output raw API JSON",
1747
- "helpGroup": "OUTPUT",
1748
- "name": "json",
1749
- "allowNo": false,
1750
- "type": "boolean"
1751
1723
  },
1752
- "plain": {
1753
- "description": "Tab-separated output for scripts",
1754
- "helpGroup": "OUTPUT",
1755
- "name": "plain",
1756
- "allowNo": false,
1757
- "type": "boolean"
1724
+ "cursor": {
1725
+ "description": "Opaque cursor from a previous response",
1726
+ "name": "cursor",
1727
+ "hasDynamicHelp": false,
1728
+ "multiple": false,
1729
+ "type": "option"
1758
1730
  },
1759
- "quiet": {
1760
- "char": "q",
1761
- "description": "Suppress non-essential output",
1762
- "name": "quiet",
1763
- "allowNo": false,
1764
- "type": "boolean"
1731
+ "limit": {
1732
+ "description": "Items per page (1-20, default 20)",
1733
+ "name": "limit",
1734
+ "hasDynamicHelp": false,
1735
+ "multiple": false,
1736
+ "type": "option"
1765
1737
  },
1766
- "verbose": {
1767
- "description": "Verbose diagnostics",
1768
- "name": "verbose",
1738
+ "all": {
1739
+ "description": "Fetch every page",
1740
+ "name": "all",
1769
1741
  "allowNo": false,
1770
1742
  "type": "boolean"
1771
1743
  },
1772
- "no-input": {
1773
- "description": "Never prompt; fail instead",
1774
- "name": "no-input",
1775
- "allowNo": false,
1776
- "type": "boolean"
1744
+ "output": {
1745
+ "char": "o",
1746
+ "description": "Write export JSON to a file instead of stdout",
1747
+ "name": "output",
1748
+ "hasDynamicHelp": false,
1749
+ "multiple": false,
1750
+ "type": "option"
1777
1751
  },
1778
- "no-color": {
1779
- "description": "Disable colored output",
1780
- "name": "no-color",
1781
- "allowNo": false,
1782
- "type": "boolean"
1752
+ "start-date": {
1753
+ "description": "Only conversations created at or after this YYYY-MM-DD date or ISO 8601 date-time",
1754
+ "name": "start-date",
1755
+ "hasDynamicHelp": false,
1756
+ "multiple": false,
1757
+ "type": "option"
1783
1758
  },
1784
- "agent": {
1785
- "char": "a",
1786
- "description": "Agent ID (or set CHATBASE_AGENT_ID)",
1787
- "name": "agent",
1759
+ "end-date": {
1760
+ "description": "Only conversations created at or before this YYYY-MM-DD date (inclusive) or ISO 8601 date-time",
1761
+ "name": "end-date",
1788
1762
  "hasDynamicHelp": false,
1789
1763
  "multiple": false,
1790
1764
  "type": "option"
1791
1765
  },
1792
- "agent-name": {
1793
- "description": "Agent display name (looked up to an ID)",
1794
- "exclusive": [
1795
- "agent"
1766
+ "conversation": {
1767
+ "description": "Export only this conversation ID, from any source (widget, API, WhatsApp, )",
1768
+ "name": "conversation",
1769
+ "hasDynamicHelp": false,
1770
+ "multiple": false,
1771
+ "type": "option"
1772
+ },
1773
+ "include": {
1774
+ "description": "Whether to embed message bodies; summary omits them for a cheaper triage pass",
1775
+ "name": "include",
1776
+ "hasDynamicHelp": false,
1777
+ "multiple": false,
1778
+ "options": [
1779
+ "summary",
1780
+ "messages"
1796
1781
  ],
1797
- "name": "agent-name",
1782
+ "type": "option"
1783
+ },
1784
+ "source": {
1785
+ "description": "Restrict to these conversation sources (comma-separated, e.g. \"Widget or Iframe,WhatsApp\"). Omit for all sources",
1786
+ "name": "source",
1798
1787
  "hasDynamicHelp": false,
1799
1788
  "multiple": false,
1800
1789
  "type": "option"
@@ -1802,33 +1791,34 @@
1802
1791
  },
1803
1792
  "hasDynamicHelp": false,
1804
1793
  "hiddenAliases": [],
1805
- "id": "helpdesk:teams",
1794
+ "id": "conversations:export",
1806
1795
  "pluginAlias": "chatbase",
1807
1796
  "pluginName": "chatbase",
1808
1797
  "pluginType": "core",
1809
1798
  "strict": true,
1799
+ "summary": "Export conversations from every source, with full message history",
1810
1800
  "enableJsonFlag": false,
1811
1801
  "isESM": true,
1812
1802
  "relativePath": [
1813
1803
  "dist",
1814
1804
  "commands",
1815
- "helpdesk",
1816
- "teams.js"
1805
+ "conversations",
1806
+ "export.js"
1817
1807
  ]
1818
1808
  },
1819
- "messages:feedback": {
1809
+ "conversations:get": {
1820
1810
  "aliases": [],
1821
1811
  "args": {
1822
- "messageId": {
1823
- "description": "Message ID (alternative to --message)",
1824
- "name": "messageId",
1812
+ "conversationId": {
1813
+ "description": "Conversation ID (alternative to --conversation)",
1814
+ "name": "conversationId",
1825
1815
  "required": false
1826
1816
  }
1827
1817
  },
1828
- "description": "Set or clear user feedback on an assistant message",
1818
+ "description": "Show one conversation",
1829
1819
  "examples": [
1830
- "<%= config.bin %> messages feedback msg_1 --conversation conv_123 --rating positive -a agt_123",
1831
- "<%= config.bin %> messages feedback --conversation conv_123 --message msg_1 --rating clear -a agt_123"
1820
+ "<%= config.bin %> conversations get conv_123 -a agt_123",
1821
+ "<%= config.bin %> conversations get --conversation conv_123 -a agt_123"
1832
1822
  ],
1833
1823
  "flags": {
1834
1824
  "json": {
@@ -1891,35 +1881,14 @@
1891
1881
  "conversation": {
1892
1882
  "description": "Conversation ID",
1893
1883
  "name": "conversation",
1894
- "required": true,
1895
- "hasDynamicHelp": false,
1896
- "multiple": false,
1897
- "type": "option"
1898
- },
1899
- "message": {
1900
- "description": "Message ID",
1901
- "name": "message",
1902
- "hasDynamicHelp": false,
1903
- "multiple": false,
1904
- "type": "option"
1905
- },
1906
- "rating": {
1907
- "description": "Feedback value (\"clear\" removes existing feedback)",
1908
- "name": "rating",
1909
- "required": true,
1910
1884
  "hasDynamicHelp": false,
1911
1885
  "multiple": false,
1912
- "options": [
1913
- "positive",
1914
- "negative",
1915
- "clear"
1916
- ],
1917
1886
  "type": "option"
1918
1887
  }
1919
1888
  },
1920
1889
  "hasDynamicHelp": false,
1921
1890
  "hiddenAliases": [],
1922
- "id": "messages:feedback",
1891
+ "id": "conversations:get",
1923
1892
  "pluginAlias": "chatbase",
1924
1893
  "pluginName": "chatbase",
1925
1894
  "pluginType": "core",
@@ -1929,17 +1898,19 @@
1929
1898
  "relativePath": [
1930
1899
  "dist",
1931
1900
  "commands",
1932
- "messages",
1933
- "feedback.js"
1901
+ "conversations",
1902
+ "get.js"
1934
1903
  ]
1935
1904
  },
1936
- "messages:list": {
1905
+ "conversations:list": {
1937
1906
  "aliases": [],
1938
1907
  "args": {},
1939
- "description": "List messages in a conversation",
1908
+ "description": "List conversations for an agent, newest first.\n\nScope: the API v2 list endpoint returns only conversations created programmatically through the API. Conversations from the chat bubble and external integrations (Slack, WhatsApp, Instagram, Messenger, and the like) are not accessible here and are not counted in `total`. Use `chatbase conversations export` to read conversations from every source — it also embeds full message history, which `conversations get` and `messages list` cannot retrieve for those conversations.",
1940
1909
  "examples": [
1941
- "<%= config.bin %> messages list --conversation conv_123 -a agt_123",
1942
- "<%= config.bin %> messages list --conversation conv_123 -a agt_123 --all --json"
1910
+ "<%= config.bin %> conversations list -a agt_123",
1911
+ "<%= config.bin %> conversations list -a agt_123 --user usr_456",
1912
+ "<%= config.bin %> conversations list -a agt_123 --start-date 2024-01-01 --end-date 2024-01-31",
1913
+ "<%= config.bin %> conversations list -a agt_123 --all --json"
1943
1914
  ],
1944
1915
  "flags": {
1945
1916
  "json": {
@@ -2019,10 +1990,23 @@
2019
1990
  "allowNo": false,
2020
1991
  "type": "boolean"
2021
1992
  },
2022
- "conversation": {
2023
- "description": "Conversation ID",
2024
- "name": "conversation",
2025
- "required": true,
1993
+ "user": {
1994
+ "description": "List conversations for a specific user (uses GET /users/{userId}/conversations)",
1995
+ "name": "user",
1996
+ "hasDynamicHelp": false,
1997
+ "multiple": false,
1998
+ "type": "option"
1999
+ },
2000
+ "start-date": {
2001
+ "description": "Only conversations created at or after this YYYY-MM-DD date or ISO 8601 date-time",
2002
+ "name": "start-date",
2003
+ "hasDynamicHelp": false,
2004
+ "multiple": false,
2005
+ "type": "option"
2006
+ },
2007
+ "end-date": {
2008
+ "description": "Only conversations created at or before this YYYY-MM-DD date (inclusive) or ISO 8601 date-time",
2009
+ "name": "end-date",
2026
2010
  "hasDynamicHelp": false,
2027
2011
  "multiple": false,
2028
2012
  "type": "option"
@@ -2030,27 +2014,35 @@
2030
2014
  },
2031
2015
  "hasDynamicHelp": false,
2032
2016
  "hiddenAliases": [],
2033
- "id": "messages:list",
2017
+ "id": "conversations:list",
2034
2018
  "pluginAlias": "chatbase",
2035
2019
  "pluginName": "chatbase",
2036
2020
  "pluginType": "core",
2037
2021
  "strict": true,
2022
+ "summary": "List an agent’s API-created conversations",
2038
2023
  "enableJsonFlag": false,
2039
2024
  "isESM": true,
2040
2025
  "relativePath": [
2041
2026
  "dist",
2042
2027
  "commands",
2043
- "messages",
2028
+ "conversations",
2044
2029
  "list.js"
2045
2030
  ]
2046
2031
  },
2047
- "conversations:export": {
2032
+ "conversations:tool-result": {
2048
2033
  "aliases": [],
2049
- "args": {},
2050
- "description": "Export conversations with full message history, newest first.\n\nThis is the only endpoint that returns conversations from every source — the chat bubble and external integrations (Slack, WhatsApp, Instagram, Messenger, and the like) as well as API-created ones. Prefer it over `conversations list` whenever you need real traffic rather than just programmatically created conversations. Each item embeds its own `messages` array, so no follow-up `conversations get` or `messages list` call is needed (and neither works for bubble/integration conversations).",
2034
+ "args": {
2035
+ "conversationId": {
2036
+ "description": "Conversation ID (alternative to --conversation)",
2037
+ "name": "conversationId",
2038
+ "required": false
2039
+ }
2040
+ },
2041
+ "description": "Submit the result of a client-side tool call so the paused chat turn can continue. The tool call ID comes from the tool-call part of the chat response that requested the execution.",
2051
2042
  "examples": [
2052
- "<%= config.bin %> conversations export -a agt_123",
2053
- "<%= config.bin %> conversations export -a agt_123 --all -o export.json"
2043
+ "<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 --output '{\"temperature\": 72}' -a agt_123",
2044
+ "<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 --output @result.json -a agt_123",
2045
+ "<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 -a agt_123"
2054
2046
  ],
2055
2047
  "flags": {
2056
2048
  "json": {
@@ -2110,29 +2102,23 @@
2110
2102
  "multiple": false,
2111
2103
  "type": "option"
2112
2104
  },
2113
- "cursor": {
2114
- "description": "Opaque cursor from a previous response",
2115
- "name": "cursor",
2105
+ "conversation": {
2106
+ "description": "Conversation ID",
2107
+ "name": "conversation",
2116
2108
  "hasDynamicHelp": false,
2117
2109
  "multiple": false,
2118
2110
  "type": "option"
2119
2111
  },
2120
- "limit": {
2121
- "description": "Items per page (1-20, default 20)",
2122
- "name": "limit",
2112
+ "tool-call-id": {
2113
+ "description": "The toolCallId from the tool-call part in the chat response",
2114
+ "name": "tool-call-id",
2115
+ "required": true,
2123
2116
  "hasDynamicHelp": false,
2124
2117
  "multiple": false,
2125
2118
  "type": "option"
2126
2119
  },
2127
- "all": {
2128
- "description": "Fetch every page",
2129
- "name": "all",
2130
- "allowNo": false,
2131
- "type": "boolean"
2132
- },
2133
2120
  "output": {
2134
- "char": "o",
2135
- "description": "Write export JSON to a file instead of stdout",
2121
+ "description": "Result of executing the tool (inline JSON, @file, or @-); a value that is not valid JSON is sent as a plain string",
2136
2122
  "name": "output",
2137
2123
  "hasDynamicHelp": false,
2138
2124
  "multiple": false,
@@ -2141,34 +2127,27 @@
2141
2127
  },
2142
2128
  "hasDynamicHelp": false,
2143
2129
  "hiddenAliases": [],
2144
- "id": "conversations:export",
2130
+ "id": "conversations:tool-result",
2145
2131
  "pluginAlias": "chatbase",
2146
2132
  "pluginName": "chatbase",
2147
2133
  "pluginType": "core",
2148
2134
  "strict": true,
2149
- "summary": "Export conversations from every source, with full message history",
2135
+ "summary": "Submit a client-side tool result to a chat turn",
2150
2136
  "enableJsonFlag": false,
2151
2137
  "isESM": true,
2152
2138
  "relativePath": [
2153
2139
  "dist",
2154
2140
  "commands",
2155
2141
  "conversations",
2156
- "export.js"
2142
+ "tool-result.js"
2157
2143
  ]
2158
2144
  },
2159
- "conversations:get": {
2145
+ "helpdesk:statuses": {
2160
2146
  "aliases": [],
2161
- "args": {
2162
- "conversationId": {
2163
- "description": "Conversation ID (alternative to --conversation)",
2164
- "name": "conversationId",
2165
- "required": false
2166
- }
2167
- },
2168
- "description": "Show one conversation",
2147
+ "args": {},
2148
+ "description": "List ticket statuses for an agent",
2169
2149
  "examples": [
2170
- "<%= config.bin %> conversations get conv_123 -a agt_123",
2171
- "<%= config.bin %> conversations get --conversation conv_123 -a agt_123"
2150
+ "<%= config.bin %> helpdesk statuses -a agt_123"
2172
2151
  ],
2173
2152
  "flags": {
2174
2153
  "json": {
@@ -2227,18 +2206,11 @@
2227
2206
  "hasDynamicHelp": false,
2228
2207
  "multiple": false,
2229
2208
  "type": "option"
2230
- },
2231
- "conversation": {
2232
- "description": "Conversation ID",
2233
- "name": "conversation",
2234
- "hasDynamicHelp": false,
2235
- "multiple": false,
2236
- "type": "option"
2237
2209
  }
2238
2210
  },
2239
2211
  "hasDynamicHelp": false,
2240
2212
  "hiddenAliases": [],
2241
- "id": "conversations:get",
2213
+ "id": "helpdesk:statuses",
2242
2214
  "pluginAlias": "chatbase",
2243
2215
  "pluginName": "chatbase",
2244
2216
  "pluginType": "core",
@@ -2248,18 +2220,16 @@
2248
2220
  "relativePath": [
2249
2221
  "dist",
2250
2222
  "commands",
2251
- "conversations",
2252
- "get.js"
2253
- ]
2223
+ "helpdesk",
2224
+ "statuses.js"
2225
+ ]
2254
2226
  },
2255
- "conversations:list": {
2227
+ "helpdesk:teams": {
2256
2228
  "aliases": [],
2257
2229
  "args": {},
2258
- "description": "List conversations for an agent, newest first.\n\nScope: the API v2 list endpoint returns only conversations created programmatically through the API. Conversations from the chat bubble and external integrations (Slack, WhatsApp, Instagram, Messenger, and the like) are not accessible here and are not counted in `total`. Use `chatbase conversations export` to read conversations from every source — it also embeds full message history, which `conversations get` and `messages list` cannot retrieve for those conversations.",
2230
+ "description": "List helpdesk teams for an agent",
2259
2231
  "examples": [
2260
- "<%= config.bin %> conversations list -a agt_123",
2261
- "<%= config.bin %> conversations list -a agt_123 --user usr_456",
2262
- "<%= config.bin %> conversations list -a agt_123 --all --json"
2232
+ "<%= config.bin %> helpdesk teams -a agt_123"
2263
2233
  ],
2264
2234
  "flags": {
2265
2235
  "json": {
@@ -2318,66 +2288,37 @@
2318
2288
  "hasDynamicHelp": false,
2319
2289
  "multiple": false,
2320
2290
  "type": "option"
2321
- },
2322
- "limit": {
2323
- "description": "Maximum items per page",
2324
- "name": "limit",
2325
- "hasDynamicHelp": false,
2326
- "multiple": false,
2327
- "type": "option"
2328
- },
2329
- "cursor": {
2330
- "description": "Pagination cursor from a previous page",
2331
- "name": "cursor",
2332
- "hasDynamicHelp": false,
2333
- "multiple": false,
2334
- "type": "option"
2335
- },
2336
- "all": {
2337
- "description": "Fetch every page",
2338
- "name": "all",
2339
- "allowNo": false,
2340
- "type": "boolean"
2341
- },
2342
- "user": {
2343
- "description": "List conversations for a specific user (uses GET /users/{userId}/conversations)",
2344
- "name": "user",
2345
- "hasDynamicHelp": false,
2346
- "multiple": false,
2347
- "type": "option"
2348
2291
  }
2349
2292
  },
2350
2293
  "hasDynamicHelp": false,
2351
2294
  "hiddenAliases": [],
2352
- "id": "conversations:list",
2295
+ "id": "helpdesk:teams",
2353
2296
  "pluginAlias": "chatbase",
2354
2297
  "pluginName": "chatbase",
2355
2298
  "pluginType": "core",
2356
2299
  "strict": true,
2357
- "summary": "List an agent’s API-created conversations",
2358
2300
  "enableJsonFlag": false,
2359
2301
  "isESM": true,
2360
2302
  "relativePath": [
2361
2303
  "dist",
2362
2304
  "commands",
2363
- "conversations",
2364
- "list.js"
2305
+ "helpdesk",
2306
+ "teams.js"
2365
2307
  ]
2366
2308
  },
2367
- "conversations:tool-result": {
2309
+ "messages:feedback": {
2368
2310
  "aliases": [],
2369
2311
  "args": {
2370
- "conversationId": {
2371
- "description": "Conversation ID (alternative to --conversation)",
2372
- "name": "conversationId",
2312
+ "messageId": {
2313
+ "description": "Message ID (alternative to --message)",
2314
+ "name": "messageId",
2373
2315
  "required": false
2374
2316
  }
2375
2317
  },
2376
- "description": "Submit the result of a client-side tool call so the paused chat turn can continue. The tool call ID comes from the tool-call part of the chat response that requested the execution.",
2318
+ "description": "Set or clear user feedback on an assistant message",
2377
2319
  "examples": [
2378
- "<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 --output '{\"temperature\": 72}' -a agt_123",
2379
- "<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 --output @result.json -a agt_123",
2380
- "<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 -a agt_123"
2320
+ "<%= config.bin %> messages feedback msg_1 --conversation conv_123 --rating positive -a agt_123",
2321
+ "<%= config.bin %> messages feedback --conversation conv_123 --message msg_1 --rating clear -a agt_123"
2381
2322
  ],
2382
2323
  "flags": {
2383
2324
  "json": {
@@ -2440,56 +2381,55 @@
2440
2381
  "conversation": {
2441
2382
  "description": "Conversation ID",
2442
2383
  "name": "conversation",
2384
+ "required": true,
2443
2385
  "hasDynamicHelp": false,
2444
2386
  "multiple": false,
2445
2387
  "type": "option"
2446
2388
  },
2447
- "tool-call-id": {
2448
- "description": "The toolCallId from the tool-call part in the chat response",
2449
- "name": "tool-call-id",
2450
- "required": true,
2389
+ "message": {
2390
+ "description": "Message ID",
2391
+ "name": "message",
2451
2392
  "hasDynamicHelp": false,
2452
2393
  "multiple": false,
2453
2394
  "type": "option"
2454
2395
  },
2455
- "output": {
2456
- "description": "Result of executing the tool (inline JSON, @file, or @-); a value that is not valid JSON is sent as a plain string",
2457
- "name": "output",
2396
+ "rating": {
2397
+ "description": "Feedback value (\"clear\" removes existing feedback)",
2398
+ "name": "rating",
2399
+ "required": true,
2458
2400
  "hasDynamicHelp": false,
2459
2401
  "multiple": false,
2402
+ "options": [
2403
+ "positive",
2404
+ "negative",
2405
+ "clear"
2406
+ ],
2460
2407
  "type": "option"
2461
2408
  }
2462
2409
  },
2463
2410
  "hasDynamicHelp": false,
2464
2411
  "hiddenAliases": [],
2465
- "id": "conversations:tool-result",
2412
+ "id": "messages:feedback",
2466
2413
  "pluginAlias": "chatbase",
2467
2414
  "pluginName": "chatbase",
2468
2415
  "pluginType": "core",
2469
2416
  "strict": true,
2470
- "summary": "Submit a client-side tool result to a chat turn",
2471
2417
  "enableJsonFlag": false,
2472
2418
  "isESM": true,
2473
2419
  "relativePath": [
2474
2420
  "dist",
2475
2421
  "commands",
2476
- "conversations",
2477
- "tool-result.js"
2422
+ "messages",
2423
+ "feedback.js"
2478
2424
  ]
2479
2425
  },
2480
- "whatsapp:send-template": {
2426
+ "messages:list": {
2481
2427
  "aliases": [],
2482
- "args": {
2483
- "template": {
2484
- "description": "Name of the approved template",
2485
- "name": "template",
2486
- "required": true
2487
- }
2488
- },
2489
- "description": "Send an approved WhatsApp template to a phone number from one of the agent’s connected numbers. No user ID is needed — a Chatbase user is resolved or created from the recipient number, and replies flow through the agent’s regular WhatsApp pipeline. Use `whatsapp templates` to see available templates and the variables each expects.",
2428
+ "args": {},
2429
+ "description": "List messages in a conversation",
2490
2430
  "examples": [
2491
- "<%= config.bin %> whatsapp send-template order_update --to 14155552671 -a agt_123",
2492
- "<%= config.bin %> whatsapp send-template order_update --to 14155552671 --language en_US --variables '{\"header\":{\"1\":\"#1042\"},\"body\":{\"1\":\"Jane\",\"2\":\"Friday\"}}' -a agt_123"
2431
+ "<%= config.bin %> messages list --conversation conv_123 -a agt_123",
2432
+ "<%= config.bin %> messages list --conversation conv_123 -a agt_123 --all --json"
2493
2433
  ],
2494
2434
  "flags": {
2495
2435
  "json": {
@@ -2549,31 +2489,30 @@
2549
2489
  "multiple": false,
2550
2490
  "type": "option"
2551
2491
  },
2552
- "to": {
2553
- "description": "Recipient phone number in international format (digits with country code)",
2554
- "name": "to",
2555
- "required": true,
2492
+ "limit": {
2493
+ "description": "Maximum items per page",
2494
+ "name": "limit",
2556
2495
  "hasDynamicHelp": false,
2557
2496
  "multiple": false,
2558
2497
  "type": "option"
2559
2498
  },
2560
- "from": {
2561
- "description": "Which connected WhatsApp number to send from optional when the agent has exactly one",
2562
- "name": "from",
2499
+ "cursor": {
2500
+ "description": "Pagination cursor from a previous page",
2501
+ "name": "cursor",
2563
2502
  "hasDynamicHelp": false,
2564
2503
  "multiple": false,
2565
2504
  "type": "option"
2566
2505
  },
2567
- "language": {
2568
- "description": "Template language code (e.g. en_US) — optional when the template exists in a single language",
2569
- "name": "language",
2570
- "hasDynamicHelp": false,
2571
- "multiple": false,
2572
- "type": "option"
2506
+ "all": {
2507
+ "description": "Fetch every page",
2508
+ "name": "all",
2509
+ "allowNo": false,
2510
+ "type": "boolean"
2573
2511
  },
2574
- "variables": {
2575
- "description": "Template variable values as JSON grouped by component (@file, @-, or inline), e.g. '{\"body\":{\"1\":\"Jane\"}}'",
2576
- "name": "variables",
2512
+ "conversation": {
2513
+ "description": "Conversation ID",
2514
+ "name": "conversation",
2515
+ "required": true,
2577
2516
  "hasDynamicHelp": false,
2578
2517
  "multiple": false,
2579
2518
  "type": "option"
@@ -2581,28 +2520,29 @@
2581
2520
  },
2582
2521
  "hasDynamicHelp": false,
2583
2522
  "hiddenAliases": [],
2584
- "id": "whatsapp:send-template",
2523
+ "id": "messages:list",
2585
2524
  "pluginAlias": "chatbase",
2586
2525
  "pluginName": "chatbase",
2587
2526
  "pluginType": "core",
2588
2527
  "strict": true,
2589
- "summary": "Send an approved WhatsApp template message",
2590
2528
  "enableJsonFlag": false,
2591
2529
  "isESM": true,
2592
2530
  "relativePath": [
2593
2531
  "dist",
2594
2532
  "commands",
2595
- "whatsapp",
2596
- "send-template.js"
2533
+ "messages",
2534
+ "list.js"
2597
2535
  ]
2598
2536
  },
2599
- "whatsapp:templates": {
2537
+ "sources:create": {
2600
2538
  "aliases": [],
2601
2539
  "args": {},
2602
- "description": "List the approved WhatsApp templates available to the agent, across all of its connected WhatsApp Business Accounts. A template can only be sent from a number on its own Business Account — pick a sender whose WABA matches the template’s WABA column.",
2540
+ "description": "Create a source: text/qna/link (JSON) or a file upload",
2603
2541
  "examples": [
2604
- "<%= config.bin %> whatsapp templates -a agt_123",
2605
- "<%= config.bin %> whatsapp templates -a agt_123 --json"
2542
+ "<%= config.bin %> sources create --type text --name Guide --content \"hello\" -a agt_123",
2543
+ "<%= config.bin %> sources create --type link --url https://example.com --link-type crawl -a agt_123",
2544
+ "<%= config.bin %> sources create --type qna --data '{\"questions\":[\"Q1\"],\"answer\":\"A1\"}' -a agt_123",
2545
+ "<%= config.bin %> sources create --file ./guide.pdf -a agt_123"
2606
2546
  ],
2607
2547
  "flags": {
2608
2548
  "json": {
@@ -2661,32 +2601,113 @@
2661
2601
  "hasDynamicHelp": false,
2662
2602
  "multiple": false,
2663
2603
  "type": "option"
2604
+ },
2605
+ "field": {
2606
+ "char": "f",
2607
+ "description": "Set a body field: -f key=value (repeatable)",
2608
+ "name": "field",
2609
+ "hasDynamicHelp": false,
2610
+ "multiple": true,
2611
+ "type": "option"
2612
+ },
2613
+ "type": {
2614
+ "description": "JSON source type (mutually exclusive with --file)",
2615
+ "exclusive": [
2616
+ "file"
2617
+ ],
2618
+ "name": "type",
2619
+ "hasDynamicHelp": false,
2620
+ "multiple": false,
2621
+ "options": [
2622
+ "text",
2623
+ "qna",
2624
+ "link"
2625
+ ],
2626
+ "type": "option"
2627
+ },
2628
+ "file": {
2629
+ "description": "Path to a file to upload as a source (mutually exclusive with --type)",
2630
+ "exclusive": [
2631
+ "type",
2632
+ "data",
2633
+ "content",
2634
+ "url",
2635
+ "link-type"
2636
+ ],
2637
+ "name": "file",
2638
+ "hasDynamicHelp": false,
2639
+ "multiple": false,
2640
+ "type": "option"
2641
+ },
2642
+ "name": {
2643
+ "description": "Source name (--type text/qna, or a file upload)",
2644
+ "name": "name",
2645
+ "hasDynamicHelp": false,
2646
+ "multiple": false,
2647
+ "type": "option"
2648
+ },
2649
+ "content": {
2650
+ "description": "Text content for --type text (@file, @-, or inline)",
2651
+ "name": "content",
2652
+ "hasDynamicHelp": false,
2653
+ "multiple": false,
2654
+ "type": "option"
2655
+ },
2656
+ "url": {
2657
+ "description": "URL for --type link",
2658
+ "name": "url",
2659
+ "hasDynamicHelp": false,
2660
+ "multiple": false,
2661
+ "type": "option"
2662
+ },
2663
+ "link-type": {
2664
+ "description": "Link crawl mode for --type link",
2665
+ "name": "link-type",
2666
+ "hasDynamicHelp": false,
2667
+ "multiple": false,
2668
+ "options": [
2669
+ "individual",
2670
+ "sitemap",
2671
+ "crawl"
2672
+ ],
2673
+ "type": "option"
2674
+ },
2675
+ "data": {
2676
+ "description": "JSON body (@file, @-, or inline); per-type flags override matching keys",
2677
+ "name": "data",
2678
+ "hasDynamicHelp": false,
2679
+ "multiple": false,
2680
+ "type": "option"
2664
2681
  }
2665
2682
  },
2666
2683
  "hasDynamicHelp": false,
2667
2684
  "hiddenAliases": [],
2668
- "id": "whatsapp:templates",
2685
+ "id": "sources:create",
2669
2686
  "pluginAlias": "chatbase",
2670
2687
  "pluginName": "chatbase",
2671
2688
  "pluginType": "core",
2672
2689
  "strict": true,
2673
- "summary": "List approved WhatsApp templates for an agent",
2674
2690
  "enableJsonFlag": false,
2675
2691
  "isESM": true,
2676
2692
  "relativePath": [
2677
2693
  "dist",
2678
2694
  "commands",
2679
- "whatsapp",
2680
- "templates.js"
2695
+ "sources",
2696
+ "create.js"
2681
2697
  ]
2682
2698
  },
2683
- "tickets:create": {
2699
+ "sources:delete": {
2684
2700
  "aliases": [],
2685
- "args": {},
2686
- "description": "Create a helpdesk ticket",
2701
+ "args": {
2702
+ "sourceId": {
2703
+ "description": "Source ID",
2704
+ "name": "sourceId",
2705
+ "required": true
2706
+ }
2707
+ },
2708
+ "description": "Delete a source (restorable via restore command)",
2687
2709
  "examples": [
2688
- "<%= config.bin %> tickets create --subject \"Export failing\" -f description=\"Customer cannot export.\" --customer-email jane@example.com -a agt_123",
2689
- "<%= config.bin %> tickets create --subject \"Export failing\" --data '{\"description\":\"Customer cannot export.\",\"customer\":{\"email\":\"jane@example.com\"}}' -a agt_123"
2710
+ "<%= config.bin %> sources delete src_1 -a agt_1"
2690
2711
  ],
2691
2712
  "flags": {
2692
2713
  "json": {
@@ -2745,50 +2766,11 @@
2745
2766
  "hasDynamicHelp": false,
2746
2767
  "multiple": false,
2747
2768
  "type": "option"
2748
- },
2749
- "field": {
2750
- "char": "f",
2751
- "description": "Set a body field: -f key=value (repeatable)",
2752
- "name": "field",
2753
- "hasDynamicHelp": false,
2754
- "multiple": true,
2755
- "type": "option"
2756
- },
2757
- "subject": {
2758
- "description": "Ticket subject",
2759
- "name": "subject",
2760
- "hasDynamicHelp": false,
2761
- "multiple": false,
2762
- "type": "option"
2763
- },
2764
- "customer-email": {
2765
- "description": "Customer email — builds the required customer object (alternative to customer in --data)",
2766
- "name": "customer-email",
2767
- "hasDynamicHelp": false,
2768
- "multiple": false,
2769
- "type": "option"
2770
- },
2771
- "customer-name": {
2772
- "dependsOn": [
2773
- "customer-email"
2774
- ],
2775
- "description": "Customer display name, used only when the email creates a new customer record",
2776
- "name": "customer-name",
2777
- "hasDynamicHelp": false,
2778
- "multiple": false,
2779
- "type": "option"
2780
- },
2781
- "data": {
2782
- "description": "JSON body (@file, @-, or inline). Fields: subject, description, customer, statusId, statusCategory, assigneeId, assigneeEmail, teamId",
2783
- "name": "data",
2784
- "hasDynamicHelp": false,
2785
- "multiple": false,
2786
- "type": "option"
2787
2769
  }
2788
2770
  },
2789
2771
  "hasDynamicHelp": false,
2790
2772
  "hiddenAliases": [],
2791
- "id": "tickets:create",
2773
+ "id": "sources:delete",
2792
2774
  "pluginAlias": "chatbase",
2793
2775
  "pluginName": "chatbase",
2794
2776
  "pluginType": "core",
@@ -2798,22 +2780,22 @@
2798
2780
  "relativePath": [
2799
2781
  "dist",
2800
2782
  "commands",
2801
- "tickets",
2802
- "create.js"
2783
+ "sources",
2784
+ "delete.js"
2803
2785
  ]
2804
2786
  },
2805
- "tickets:get": {
2787
+ "sources:get": {
2806
2788
  "aliases": [],
2807
2789
  "args": {
2808
- "ticketNumber": {
2809
- "description": "Ticket number",
2810
- "name": "ticketNumber",
2790
+ "sourceId": {
2791
+ "description": "Source ID",
2792
+ "name": "sourceId",
2811
2793
  "required": true
2812
2794
  }
2813
2795
  },
2814
- "description": "Show one helpdesk ticket",
2796
+ "description": "Show one source",
2815
2797
  "examples": [
2816
- "<%= config.bin %> tickets get 42 -a agt_123"
2798
+ "<%= config.bin %> sources get src_123 -a agt_123"
2817
2799
  ],
2818
2800
  "flags": {
2819
2801
  "json": {
@@ -2876,7 +2858,7 @@
2876
2858
  },
2877
2859
  "hasDynamicHelp": false,
2878
2860
  "hiddenAliases": [],
2879
- "id": "tickets:get",
2861
+ "id": "sources:get",
2880
2862
  "pluginAlias": "chatbase",
2881
2863
  "pluginName": "chatbase",
2882
2864
  "pluginType": "core",
@@ -2886,18 +2868,17 @@
2886
2868
  "relativePath": [
2887
2869
  "dist",
2888
2870
  "commands",
2889
- "tickets",
2871
+ "sources",
2890
2872
  "get.js"
2891
2873
  ]
2892
2874
  },
2893
- "tickets:list": {
2875
+ "sources:list": {
2894
2876
  "aliases": [],
2895
2877
  "args": {},
2896
- "description": "List helpdesk tickets for an agent",
2878
+ "description": "List sources for an agent",
2897
2879
  "examples": [
2898
- "<%= config.bin %> tickets list -a agt_123",
2899
- "<%= config.bin %> tickets list -a agt_123 --status new,on_you",
2900
- "<%= config.bin %> tickets list -a agt_123 --all --json"
2880
+ "<%= config.bin %> sources list -a agt_123",
2881
+ "<%= config.bin %> sources list -a agt_123 --all --json"
2901
2882
  ],
2902
2883
  "flags": {
2903
2884
  "json": {
@@ -2977,81 +2958,24 @@
2977
2958
  "allowNo": false,
2978
2959
  "type": "boolean"
2979
2960
  },
2980
- "status": {
2981
- "description": "Filter by status (comma-separated): new, on_you, on_customer, on_hold, closed, cancelled",
2982
- "name": "status",
2983
- "hasDynamicHelp": false,
2984
- "multiple": false,
2985
- "type": "option"
2986
- },
2987
- "channel": {
2988
- "description": "Filter by channel (comma-separated, e.g. email,api)",
2989
- "name": "channel",
2990
- "hasDynamicHelp": false,
2991
- "multiple": false,
2992
- "type": "option"
2993
- },
2994
- "assignee-id": {
2995
- "description": "Filter by assignee UUID, or \"none\" for unassigned",
2996
- "name": "assignee-id",
2997
- "hasDynamicHelp": false,
2998
- "multiple": false,
2999
- "type": "option"
3000
- },
3001
- "team-id": {
3002
- "description": "Filter by team UUID, or \"none\" for no team",
3003
- "name": "team-id",
3004
- "hasDynamicHelp": false,
3005
- "multiple": false,
3006
- "type": "option"
3007
- },
3008
- "created-after": {
3009
- "description": "Only tickets created after this ISO 8601 date",
3010
- "name": "created-after",
3011
- "hasDynamicHelp": false,
3012
- "multiple": false,
3013
- "type": "option"
3014
- },
3015
- "created-before": {
3016
- "description": "Only tickets created before this ISO 8601 date",
3017
- "name": "created-before",
3018
- "hasDynamicHelp": false,
3019
- "multiple": false,
3020
- "type": "option"
3021
- },
3022
- "sort-by": {
3023
- "description": "Sort field",
3024
- "name": "sort-by",
2961
+ "type": {
2962
+ "description": "Filter by source type",
2963
+ "name": "type",
3025
2964
  "hasDynamicHelp": false,
3026
2965
  "multiple": false,
3027
- "options": [
3028
- "createdAt",
3029
- "updatedAt",
3030
- "lastMessageAt"
3031
- ],
3032
2966
  "type": "option"
3033
2967
  },
3034
- "order": {
3035
- "description": "Sort direction",
3036
- "name": "order",
2968
+ "name": {
2969
+ "description": "Filter by source name",
2970
+ "name": "name",
3037
2971
  "hasDynamicHelp": false,
3038
2972
  "multiple": false,
3039
- "options": [
3040
- "asc",
3041
- "desc"
3042
- ],
3043
2973
  "type": "option"
3044
- },
3045
- "include-total": {
3046
- "description": "Include pagination.total in the response",
3047
- "name": "include-total",
3048
- "allowNo": false,
3049
- "type": "boolean"
3050
2974
  }
3051
2975
  },
3052
2976
  "hasDynamicHelp": false,
3053
2977
  "hiddenAliases": [],
3054
- "id": "tickets:list",
2978
+ "id": "sources:list",
3055
2979
  "pluginAlias": "chatbase",
3056
2980
  "pluginName": "chatbase",
3057
2981
  "pluginType": "core",
@@ -3061,23 +2985,22 @@
3061
2985
  "relativePath": [
3062
2986
  "dist",
3063
2987
  "commands",
3064
- "tickets",
2988
+ "sources",
3065
2989
  "list.js"
3066
2990
  ]
3067
2991
  },
3068
- "tickets:messages": {
2992
+ "sources:restore": {
3069
2993
  "aliases": [],
3070
2994
  "args": {
3071
- "ticketNumber": {
3072
- "description": "Ticket number (alternative to --ticket)",
3073
- "name": "ticketNumber",
3074
- "required": false
2995
+ "sourceId": {
2996
+ "description": "Source ID",
2997
+ "name": "sourceId",
2998
+ "required": true
3075
2999
  }
3076
3000
  },
3077
- "description": "List a ticket's message thread",
3001
+ "description": "Restore a deleted source",
3078
3002
  "examples": [
3079
- "<%= config.bin %> tickets messages 42 -a agt_123",
3080
- "<%= config.bin %> tickets messages 42 -a agt_123 --all --json"
3003
+ "<%= config.bin %> sources restore src_1 -a agt_1"
3081
3004
  ],
3082
3005
  "flags": {
3083
3006
  "json": {
@@ -3136,56 +3059,11 @@
3136
3059
  "hasDynamicHelp": false,
3137
3060
  "multiple": false,
3138
3061
  "type": "option"
3139
- },
3140
- "limit": {
3141
- "description": "Maximum items per page",
3142
- "name": "limit",
3143
- "hasDynamicHelp": false,
3144
- "multiple": false,
3145
- "type": "option"
3146
- },
3147
- "cursor": {
3148
- "description": "Pagination cursor from a previous page",
3149
- "name": "cursor",
3150
- "hasDynamicHelp": false,
3151
- "multiple": false,
3152
- "type": "option"
3153
- },
3154
- "all": {
3155
- "description": "Fetch every page",
3156
- "name": "all",
3157
- "allowNo": false,
3158
- "type": "boolean"
3159
- },
3160
- "ticket": {
3161
- "description": "Ticket number",
3162
- "name": "ticket",
3163
- "hasDynamicHelp": false,
3164
- "multiple": false,
3165
- "type": "option"
3166
- },
3167
- "types": {
3168
- "description": "Message types to include (comma-separated): reply, note, event (default: reply,note)",
3169
- "name": "types",
3170
- "hasDynamicHelp": false,
3171
- "multiple": false,
3172
- "type": "option"
3173
- },
3174
- "order": {
3175
- "description": "Sort direction",
3176
- "name": "order",
3177
- "hasDynamicHelp": false,
3178
- "multiple": false,
3179
- "options": [
3180
- "asc",
3181
- "desc"
3182
- ],
3183
- "type": "option"
3184
3062
  }
3185
3063
  },
3186
3064
  "hasDynamicHelp": false,
3187
3065
  "hiddenAliases": [],
3188
- "id": "tickets:messages",
3066
+ "id": "sources:restore",
3189
3067
  "pluginAlias": "chatbase",
3190
3068
  "pluginName": "chatbase",
3191
3069
  "pluginType": "core",
@@ -3195,22 +3073,16 @@
3195
3073
  "relativePath": [
3196
3074
  "dist",
3197
3075
  "commands",
3198
- "tickets",
3199
- "messages.js"
3076
+ "sources",
3077
+ "restore.js"
3200
3078
  ]
3201
3079
  },
3202
- "tickets:reply": {
3080
+ "sources:summary": {
3203
3081
  "aliases": [],
3204
- "args": {
3205
- "ticketNumber": {
3206
- "description": "Ticket number (alternative to --ticket)",
3207
- "name": "ticketNumber",
3208
- "required": false
3209
- }
3210
- },
3211
- "description": "Post an agent reply to a ticket's message thread",
3082
+ "args": {},
3083
+ "description": "Show aggregated source counts and sizes for an agent",
3212
3084
  "examples": [
3213
- "<%= config.bin %> tickets reply 42 -m \"On it\" --author-email sam@example.com -a agt_123"
3085
+ "<%= config.bin %> sources summary -a agt_123"
3214
3086
  ],
3215
3087
  "flags": {
3216
3088
  "json": {
@@ -3269,41 +3141,11 @@
3269
3141
  "hasDynamicHelp": false,
3270
3142
  "multiple": false,
3271
3143
  "type": "option"
3272
- },
3273
- "ticket": {
3274
- "description": "Ticket number",
3275
- "name": "ticket",
3276
- "hasDynamicHelp": false,
3277
- "multiple": false,
3278
- "type": "option"
3279
- },
3280
- "message": {
3281
- "char": "m",
3282
- "description": "Reply body as GitHub-flavored Markdown",
3283
- "name": "message",
3284
- "required": true,
3285
- "hasDynamicHelp": false,
3286
- "multiple": false,
3287
- "type": "option"
3288
- },
3289
- "author-id": {
3290
- "description": "Platform user id of the team member the reply is attributed to (exactly one of --author-id/--author-email)",
3291
- "name": "author-id",
3292
- "hasDynamicHelp": false,
3293
- "multiple": false,
3294
- "type": "option"
3295
- },
3296
- "author-email": {
3297
- "description": "Email of the team member the reply is attributed to (exactly one of --author-id/--author-email)",
3298
- "name": "author-email",
3299
- "hasDynamicHelp": false,
3300
- "multiple": false,
3301
- "type": "option"
3302
3144
  }
3303
3145
  },
3304
3146
  "hasDynamicHelp": false,
3305
3147
  "hiddenAliases": [],
3306
- "id": "tickets:reply",
3148
+ "id": "sources:summary",
3307
3149
  "pluginAlias": "chatbase",
3308
3150
  "pluginName": "chatbase",
3309
3151
  "pluginType": "core",
@@ -3313,23 +3155,23 @@
3313
3155
  "relativePath": [
3314
3156
  "dist",
3315
3157
  "commands",
3316
- "tickets",
3317
- "reply.js"
3158
+ "sources",
3159
+ "summary.js"
3318
3160
  ]
3319
3161
  },
3320
- "tickets:search": {
3162
+ "sources:update": {
3321
3163
  "aliases": [],
3322
3164
  "args": {
3323
- "query": {
3324
- "description": "Free-text search terms (matched against ticket messages)",
3325
- "name": "query",
3165
+ "sourceId": {
3166
+ "description": "Source ID",
3167
+ "name": "sourceId",
3326
3168
  "required": true
3327
3169
  }
3328
3170
  },
3329
- "description": "Search tickets by message content",
3171
+ "description": "Update an existing source (text, qna, link, or file)",
3330
3172
  "examples": [
3331
- "<%= config.bin %> tickets search \"refund not received\" -a agt_123",
3332
- "<%= config.bin %> tickets search \"refund\" -a agt_123 --limit 10 --json"
3173
+ "<%= config.bin %> sources update src_1 --data '{\"type\":\"text\",\"content\":\"new\"}' -a agt_1",
3174
+ "<%= config.bin %> sources update src_1 --file ./updated.pdf -a agt_1"
3333
3175
  ],
3334
3176
  "flags": {
3335
3177
  "json": {
@@ -3389,9 +3231,31 @@
3389
3231
  "multiple": false,
3390
3232
  "type": "option"
3391
3233
  },
3392
- "limit": {
3393
- "description": "Number of results (1–50, default 20)",
3394
- "name": "limit",
3234
+ "field": {
3235
+ "char": "f",
3236
+ "description": "Set a body field: -f key=value (repeatable)",
3237
+ "name": "field",
3238
+ "hasDynamicHelp": false,
3239
+ "multiple": true,
3240
+ "type": "option"
3241
+ },
3242
+ "data": {
3243
+ "description": "JSON body for text/qna/link sources (@file, @-, or inline)",
3244
+ "exclusive": [
3245
+ "file"
3246
+ ],
3247
+ "name": "data",
3248
+ "hasDynamicHelp": false,
3249
+ "multiple": false,
3250
+ "type": "option"
3251
+ },
3252
+ "file": {
3253
+ "description": "Path to a file to upload as a replacement (mutually exclusive with --data)",
3254
+ "exclusive": [
3255
+ "data",
3256
+ "field"
3257
+ ],
3258
+ "name": "file",
3395
3259
  "hasDynamicHelp": false,
3396
3260
  "multiple": false,
3397
3261
  "type": "option"
@@ -3399,7 +3263,7 @@
3399
3263
  },
3400
3264
  "hasDynamicHelp": false,
3401
3265
  "hiddenAliases": [],
3402
- "id": "tickets:search",
3266
+ "id": "sources:update",
3403
3267
  "pluginAlias": "chatbase",
3404
3268
  "pluginName": "chatbase",
3405
3269
  "pluginType": "core",
@@ -3409,22 +3273,17 @@
3409
3273
  "relativePath": [
3410
3274
  "dist",
3411
3275
  "commands",
3412
- "tickets",
3413
- "search.js"
3276
+ "sources",
3277
+ "update.js"
3414
3278
  ]
3415
3279
  },
3416
- "tickets:update": {
3280
+ "tickets:create": {
3417
3281
  "aliases": [],
3418
- "args": {
3419
- "ticketNumber": {
3420
- "description": "Ticket number",
3421
- "name": "ticketNumber",
3422
- "required": true
3423
- }
3424
- },
3425
- "description": "Update a ticket's status, assignee, and/or team",
3282
+ "args": {},
3283
+ "description": "Create a helpdesk ticket",
3426
3284
  "examples": [
3427
- "<%= config.bin %> tickets update 42 --data '{\"statusCategory\":\"closed\"}' -a agt_123"
3285
+ "<%= config.bin %> tickets create --subject \"Export failing\" -f description=\"Customer cannot export.\" --customer-email jane@example.com -a agt_123",
3286
+ "<%= config.bin %> tickets create --subject \"Export failing\" --data '{\"description\":\"Customer cannot export.\",\"customer\":{\"email\":\"jane@example.com\"}}' -a agt_123"
3428
3287
  ],
3429
3288
  "flags": {
3430
3289
  "json": {
@@ -3492,8 +3351,32 @@
3492
3351
  "multiple": true,
3493
3352
  "type": "option"
3494
3353
  },
3354
+ "subject": {
3355
+ "description": "Ticket subject",
3356
+ "name": "subject",
3357
+ "hasDynamicHelp": false,
3358
+ "multiple": false,
3359
+ "type": "option"
3360
+ },
3361
+ "customer-email": {
3362
+ "description": "Customer email — builds the required customer object (alternative to customer in --data)",
3363
+ "name": "customer-email",
3364
+ "hasDynamicHelp": false,
3365
+ "multiple": false,
3366
+ "type": "option"
3367
+ },
3368
+ "customer-name": {
3369
+ "dependsOn": [
3370
+ "customer-email"
3371
+ ],
3372
+ "description": "Customer display name, used only when the email creates a new customer record",
3373
+ "name": "customer-name",
3374
+ "hasDynamicHelp": false,
3375
+ "multiple": false,
3376
+ "type": "option"
3377
+ },
3495
3378
  "data": {
3496
- "description": "JSON body (@file, @-, or inline). Fields: statusId, statusCategory, assigneeId, assigneeEmail, teamId",
3379
+ "description": "JSON body (@file, @-, or inline). Fields: subject, description, customer, statusId, statusCategory, assigneeId, assigneeEmail, teamId",
3497
3380
  "name": "data",
3498
3381
  "hasDynamicHelp": false,
3499
3382
  "multiple": false,
@@ -3502,7 +3385,7 @@
3502
3385
  },
3503
3386
  "hasDynamicHelp": false,
3504
3387
  "hiddenAliases": [],
3505
- "id": "tickets:update",
3388
+ "id": "tickets:create",
3506
3389
  "pluginAlias": "chatbase",
3507
3390
  "pluginName": "chatbase",
3508
3391
  "pluginType": "core",
@@ -3513,18 +3396,21 @@
3513
3396
  "dist",
3514
3397
  "commands",
3515
3398
  "tickets",
3516
- "update.js"
3399
+ "create.js"
3517
3400
  ]
3518
3401
  },
3519
- "sources:create": {
3402
+ "tickets:get": {
3520
3403
  "aliases": [],
3521
- "args": {},
3522
- "description": "Create a source: text/qna/link (JSON) or a file upload",
3404
+ "args": {
3405
+ "ticketNumber": {
3406
+ "description": "Ticket number",
3407
+ "name": "ticketNumber",
3408
+ "required": true
3409
+ }
3410
+ },
3411
+ "description": "Show one helpdesk ticket",
3523
3412
  "examples": [
3524
- "<%= config.bin %> sources create --type text --name Guide --content \"hello\" -a agt_123",
3525
- "<%= config.bin %> sources create --type link --url https://example.com --link-type crawl -a agt_123",
3526
- "<%= config.bin %> sources create --type qna --data '{\"questions\":[\"Q1\"],\"answer\":\"A1\"}' -a agt_123",
3527
- "<%= config.bin %> sources create --file ./guide.pdf -a agt_123"
3413
+ "<%= config.bin %> tickets get 42 -a agt_123"
3528
3414
  ],
3529
3415
  "flags": {
3530
3416
  "json": {
@@ -3583,88 +3469,186 @@
3583
3469
  "hasDynamicHelp": false,
3584
3470
  "multiple": false,
3585
3471
  "type": "option"
3472
+ }
3473
+ },
3474
+ "hasDynamicHelp": false,
3475
+ "hiddenAliases": [],
3476
+ "id": "tickets:get",
3477
+ "pluginAlias": "chatbase",
3478
+ "pluginName": "chatbase",
3479
+ "pluginType": "core",
3480
+ "strict": true,
3481
+ "enableJsonFlag": false,
3482
+ "isESM": true,
3483
+ "relativePath": [
3484
+ "dist",
3485
+ "commands",
3486
+ "tickets",
3487
+ "get.js"
3488
+ ]
3489
+ },
3490
+ "tickets:list": {
3491
+ "aliases": [],
3492
+ "args": {},
3493
+ "description": "List helpdesk tickets for an agent",
3494
+ "examples": [
3495
+ "<%= config.bin %> tickets list -a agt_123",
3496
+ "<%= config.bin %> tickets list -a agt_123 --status new,on_you",
3497
+ "<%= config.bin %> tickets list -a agt_123 --all --json"
3498
+ ],
3499
+ "flags": {
3500
+ "json": {
3501
+ "description": "Output raw API JSON",
3502
+ "helpGroup": "OUTPUT",
3503
+ "name": "json",
3504
+ "allowNo": false,
3505
+ "type": "boolean"
3586
3506
  },
3587
- "field": {
3588
- "char": "f",
3589
- "description": "Set a body field: -f key=value (repeatable)",
3590
- "name": "field",
3507
+ "plain": {
3508
+ "description": "Tab-separated output for scripts",
3509
+ "helpGroup": "OUTPUT",
3510
+ "name": "plain",
3511
+ "allowNo": false,
3512
+ "type": "boolean"
3513
+ },
3514
+ "quiet": {
3515
+ "char": "q",
3516
+ "description": "Suppress non-essential output",
3517
+ "name": "quiet",
3518
+ "allowNo": false,
3519
+ "type": "boolean"
3520
+ },
3521
+ "verbose": {
3522
+ "description": "Verbose diagnostics",
3523
+ "name": "verbose",
3524
+ "allowNo": false,
3525
+ "type": "boolean"
3526
+ },
3527
+ "no-input": {
3528
+ "description": "Never prompt; fail instead",
3529
+ "name": "no-input",
3530
+ "allowNo": false,
3531
+ "type": "boolean"
3532
+ },
3533
+ "no-color": {
3534
+ "description": "Disable colored output",
3535
+ "name": "no-color",
3536
+ "allowNo": false,
3537
+ "type": "boolean"
3538
+ },
3539
+ "agent": {
3540
+ "char": "a",
3541
+ "description": "Agent ID (or set CHATBASE_AGENT_ID)",
3542
+ "name": "agent",
3591
3543
  "hasDynamicHelp": false,
3592
- "multiple": true,
3544
+ "multiple": false,
3593
3545
  "type": "option"
3594
3546
  },
3595
- "type": {
3596
- "description": "JSON source type (mutually exclusive with --file)",
3547
+ "agent-name": {
3548
+ "description": "Agent display name (looked up to an ID)",
3597
3549
  "exclusive": [
3598
- "file"
3550
+ "agent"
3599
3551
  ],
3600
- "name": "type",
3552
+ "name": "agent-name",
3601
3553
  "hasDynamicHelp": false,
3602
3554
  "multiple": false,
3603
- "options": [
3604
- "text",
3605
- "qna",
3606
- "link"
3607
- ],
3608
3555
  "type": "option"
3609
3556
  },
3610
- "file": {
3611
- "description": "Path to a file to upload as a source (mutually exclusive with --type)",
3612
- "exclusive": [
3613
- "type",
3614
- "data",
3615
- "content",
3616
- "url",
3617
- "link-type"
3618
- ],
3619
- "name": "file",
3557
+ "limit": {
3558
+ "description": "Maximum items per page",
3559
+ "name": "limit",
3620
3560
  "hasDynamicHelp": false,
3621
3561
  "multiple": false,
3622
3562
  "type": "option"
3623
3563
  },
3624
- "name": {
3625
- "description": "Source name (--type text/qna, or a file upload)",
3626
- "name": "name",
3564
+ "cursor": {
3565
+ "description": "Pagination cursor from a previous page",
3566
+ "name": "cursor",
3627
3567
  "hasDynamicHelp": false,
3628
3568
  "multiple": false,
3629
3569
  "type": "option"
3630
3570
  },
3631
- "content": {
3632
- "description": "Text content for --type text (@file, @-, or inline)",
3633
- "name": "content",
3571
+ "all": {
3572
+ "description": "Fetch every page",
3573
+ "name": "all",
3574
+ "allowNo": false,
3575
+ "type": "boolean"
3576
+ },
3577
+ "status": {
3578
+ "description": "Filter by status (comma-separated): new, on_you, on_customer, on_hold, closed, cancelled",
3579
+ "name": "status",
3634
3580
  "hasDynamicHelp": false,
3635
3581
  "multiple": false,
3636
3582
  "type": "option"
3637
3583
  },
3638
- "url": {
3639
- "description": "URL for --type link",
3640
- "name": "url",
3584
+ "channel": {
3585
+ "description": "Filter by channel (comma-separated, e.g. email,api)",
3586
+ "name": "channel",
3641
3587
  "hasDynamicHelp": false,
3642
3588
  "multiple": false,
3643
3589
  "type": "option"
3644
3590
  },
3645
- "link-type": {
3646
- "description": "Link crawl mode for --type link",
3647
- "name": "link-type",
3591
+ "assignee-id": {
3592
+ "description": "Filter by assignee UUID, or \"none\" for unassigned",
3593
+ "name": "assignee-id",
3594
+ "hasDynamicHelp": false,
3595
+ "multiple": false,
3596
+ "type": "option"
3597
+ },
3598
+ "team-id": {
3599
+ "description": "Filter by team UUID, or \"none\" for no team",
3600
+ "name": "team-id",
3601
+ "hasDynamicHelp": false,
3602
+ "multiple": false,
3603
+ "type": "option"
3604
+ },
3605
+ "created-after": {
3606
+ "description": "Only tickets created after this ISO 8601 date",
3607
+ "name": "created-after",
3608
+ "hasDynamicHelp": false,
3609
+ "multiple": false,
3610
+ "type": "option"
3611
+ },
3612
+ "created-before": {
3613
+ "description": "Only tickets created before this ISO 8601 date",
3614
+ "name": "created-before",
3615
+ "hasDynamicHelp": false,
3616
+ "multiple": false,
3617
+ "type": "option"
3618
+ },
3619
+ "sort-by": {
3620
+ "description": "Sort field",
3621
+ "name": "sort-by",
3648
3622
  "hasDynamicHelp": false,
3649
3623
  "multiple": false,
3650
3624
  "options": [
3651
- "individual",
3652
- "sitemap",
3653
- "crawl"
3625
+ "createdAt",
3626
+ "updatedAt",
3627
+ "lastMessageAt"
3654
3628
  ],
3655
3629
  "type": "option"
3656
3630
  },
3657
- "data": {
3658
- "description": "JSON body (@file, @-, or inline); per-type flags override matching keys",
3659
- "name": "data",
3631
+ "order": {
3632
+ "description": "Sort direction",
3633
+ "name": "order",
3660
3634
  "hasDynamicHelp": false,
3661
3635
  "multiple": false,
3636
+ "options": [
3637
+ "asc",
3638
+ "desc"
3639
+ ],
3662
3640
  "type": "option"
3641
+ },
3642
+ "include-total": {
3643
+ "description": "Include pagination.total in the response",
3644
+ "name": "include-total",
3645
+ "allowNo": false,
3646
+ "type": "boolean"
3663
3647
  }
3664
3648
  },
3665
3649
  "hasDynamicHelp": false,
3666
3650
  "hiddenAliases": [],
3667
- "id": "sources:create",
3651
+ "id": "tickets:list",
3668
3652
  "pluginAlias": "chatbase",
3669
3653
  "pluginName": "chatbase",
3670
3654
  "pluginType": "core",
@@ -3674,22 +3658,23 @@
3674
3658
  "relativePath": [
3675
3659
  "dist",
3676
3660
  "commands",
3677
- "sources",
3678
- "create.js"
3661
+ "tickets",
3662
+ "list.js"
3679
3663
  ]
3680
3664
  },
3681
- "sources:delete": {
3665
+ "tickets:messages": {
3682
3666
  "aliases": [],
3683
3667
  "args": {
3684
- "sourceId": {
3685
- "description": "Source ID",
3686
- "name": "sourceId",
3687
- "required": true
3668
+ "ticketNumber": {
3669
+ "description": "Ticket number (alternative to --ticket)",
3670
+ "name": "ticketNumber",
3671
+ "required": false
3688
3672
  }
3689
3673
  },
3690
- "description": "Delete a source (restorable via restore command)",
3674
+ "description": "List a ticket's message thread",
3691
3675
  "examples": [
3692
- "<%= config.bin %> sources delete src_1 -a agt_1"
3676
+ "<%= config.bin %> tickets messages 42 -a agt_123",
3677
+ "<%= config.bin %> tickets messages 42 -a agt_123 --all --json"
3693
3678
  ],
3694
3679
  "flags": {
3695
3680
  "json": {
@@ -3739,20 +3724,65 @@
3739
3724
  "multiple": false,
3740
3725
  "type": "option"
3741
3726
  },
3742
- "agent-name": {
3743
- "description": "Agent display name (looked up to an ID)",
3744
- "exclusive": [
3745
- "agent"
3746
- ],
3747
- "name": "agent-name",
3727
+ "agent-name": {
3728
+ "description": "Agent display name (looked up to an ID)",
3729
+ "exclusive": [
3730
+ "agent"
3731
+ ],
3732
+ "name": "agent-name",
3733
+ "hasDynamicHelp": false,
3734
+ "multiple": false,
3735
+ "type": "option"
3736
+ },
3737
+ "limit": {
3738
+ "description": "Maximum items per page",
3739
+ "name": "limit",
3740
+ "hasDynamicHelp": false,
3741
+ "multiple": false,
3742
+ "type": "option"
3743
+ },
3744
+ "cursor": {
3745
+ "description": "Pagination cursor from a previous page",
3746
+ "name": "cursor",
3747
+ "hasDynamicHelp": false,
3748
+ "multiple": false,
3749
+ "type": "option"
3750
+ },
3751
+ "all": {
3752
+ "description": "Fetch every page",
3753
+ "name": "all",
3754
+ "allowNo": false,
3755
+ "type": "boolean"
3756
+ },
3757
+ "ticket": {
3758
+ "description": "Ticket number",
3759
+ "name": "ticket",
3760
+ "hasDynamicHelp": false,
3761
+ "multiple": false,
3762
+ "type": "option"
3763
+ },
3764
+ "types": {
3765
+ "description": "Message types to include (comma-separated): reply, note, event (default: reply,note)",
3766
+ "name": "types",
3767
+ "hasDynamicHelp": false,
3768
+ "multiple": false,
3769
+ "type": "option"
3770
+ },
3771
+ "order": {
3772
+ "description": "Sort direction",
3773
+ "name": "order",
3748
3774
  "hasDynamicHelp": false,
3749
3775
  "multiple": false,
3776
+ "options": [
3777
+ "asc",
3778
+ "desc"
3779
+ ],
3750
3780
  "type": "option"
3751
3781
  }
3752
3782
  },
3753
3783
  "hasDynamicHelp": false,
3754
3784
  "hiddenAliases": [],
3755
- "id": "sources:delete",
3785
+ "id": "tickets:messages",
3756
3786
  "pluginAlias": "chatbase",
3757
3787
  "pluginName": "chatbase",
3758
3788
  "pluginType": "core",
@@ -3762,22 +3792,22 @@
3762
3792
  "relativePath": [
3763
3793
  "dist",
3764
3794
  "commands",
3765
- "sources",
3766
- "delete.js"
3795
+ "tickets",
3796
+ "messages.js"
3767
3797
  ]
3768
3798
  },
3769
- "sources:get": {
3799
+ "tickets:reply": {
3770
3800
  "aliases": [],
3771
3801
  "args": {
3772
- "sourceId": {
3773
- "description": "Source ID",
3774
- "name": "sourceId",
3775
- "required": true
3802
+ "ticketNumber": {
3803
+ "description": "Ticket number (alternative to --ticket)",
3804
+ "name": "ticketNumber",
3805
+ "required": false
3776
3806
  }
3777
3807
  },
3778
- "description": "Show one source",
3808
+ "description": "Post an agent reply to a ticket's message thread",
3779
3809
  "examples": [
3780
- "<%= config.bin %> sources get src_123 -a agt_123"
3810
+ "<%= config.bin %> tickets reply 42 -m \"On it\" --author-email sam@example.com -a agt_123"
3781
3811
  ],
3782
3812
  "flags": {
3783
3813
  "json": {
@@ -3836,11 +3866,41 @@
3836
3866
  "hasDynamicHelp": false,
3837
3867
  "multiple": false,
3838
3868
  "type": "option"
3869
+ },
3870
+ "ticket": {
3871
+ "description": "Ticket number",
3872
+ "name": "ticket",
3873
+ "hasDynamicHelp": false,
3874
+ "multiple": false,
3875
+ "type": "option"
3876
+ },
3877
+ "message": {
3878
+ "char": "m",
3879
+ "description": "Reply body as GitHub-flavored Markdown",
3880
+ "name": "message",
3881
+ "required": true,
3882
+ "hasDynamicHelp": false,
3883
+ "multiple": false,
3884
+ "type": "option"
3885
+ },
3886
+ "author-id": {
3887
+ "description": "Platform user id of the team member the reply is attributed to (exactly one of --author-id/--author-email)",
3888
+ "name": "author-id",
3889
+ "hasDynamicHelp": false,
3890
+ "multiple": false,
3891
+ "type": "option"
3892
+ },
3893
+ "author-email": {
3894
+ "description": "Email of the team member the reply is attributed to (exactly one of --author-id/--author-email)",
3895
+ "name": "author-email",
3896
+ "hasDynamicHelp": false,
3897
+ "multiple": false,
3898
+ "type": "option"
3839
3899
  }
3840
3900
  },
3841
3901
  "hasDynamicHelp": false,
3842
3902
  "hiddenAliases": [],
3843
- "id": "sources:get",
3903
+ "id": "tickets:reply",
3844
3904
  "pluginAlias": "chatbase",
3845
3905
  "pluginName": "chatbase",
3846
3906
  "pluginType": "core",
@@ -3850,17 +3910,23 @@
3850
3910
  "relativePath": [
3851
3911
  "dist",
3852
3912
  "commands",
3853
- "sources",
3854
- "get.js"
3913
+ "tickets",
3914
+ "reply.js"
3855
3915
  ]
3856
3916
  },
3857
- "sources:list": {
3917
+ "tickets:search": {
3858
3918
  "aliases": [],
3859
- "args": {},
3860
- "description": "List sources for an agent",
3919
+ "args": {
3920
+ "query": {
3921
+ "description": "Free-text search terms (matched against ticket messages)",
3922
+ "name": "query",
3923
+ "required": true
3924
+ }
3925
+ },
3926
+ "description": "Search tickets by message content",
3861
3927
  "examples": [
3862
- "<%= config.bin %> sources list -a agt_123",
3863
- "<%= config.bin %> sources list -a agt_123 --all --json"
3928
+ "<%= config.bin %> tickets search \"refund not received\" -a agt_123",
3929
+ "<%= config.bin %> tickets search \"refund\" -a agt_123 --limit 10 --json"
3864
3930
  ],
3865
3931
  "flags": {
3866
3932
  "json": {
@@ -3921,43 +3987,16 @@
3921
3987
  "type": "option"
3922
3988
  },
3923
3989
  "limit": {
3924
- "description": "Maximum items per page",
3990
+ "description": "Number of results (1–50, default 20)",
3925
3991
  "name": "limit",
3926
3992
  "hasDynamicHelp": false,
3927
3993
  "multiple": false,
3928
3994
  "type": "option"
3929
- },
3930
- "cursor": {
3931
- "description": "Pagination cursor from a previous page",
3932
- "name": "cursor",
3933
- "hasDynamicHelp": false,
3934
- "multiple": false,
3935
- "type": "option"
3936
- },
3937
- "all": {
3938
- "description": "Fetch every page",
3939
- "name": "all",
3940
- "allowNo": false,
3941
- "type": "boolean"
3942
- },
3943
- "type": {
3944
- "description": "Filter by source type",
3945
- "name": "type",
3946
- "hasDynamicHelp": false,
3947
- "multiple": false,
3948
- "type": "option"
3949
- },
3950
- "name": {
3951
- "description": "Filter by source name",
3952
- "name": "name",
3953
- "hasDynamicHelp": false,
3954
- "multiple": false,
3955
- "type": "option"
3956
3995
  }
3957
3996
  },
3958
3997
  "hasDynamicHelp": false,
3959
3998
  "hiddenAliases": [],
3960
- "id": "sources:list",
3999
+ "id": "tickets:search",
3961
4000
  "pluginAlias": "chatbase",
3962
4001
  "pluginName": "chatbase",
3963
4002
  "pluginType": "core",
@@ -3967,22 +4006,22 @@
3967
4006
  "relativePath": [
3968
4007
  "dist",
3969
4008
  "commands",
3970
- "sources",
3971
- "list.js"
4009
+ "tickets",
4010
+ "search.js"
3972
4011
  ]
3973
4012
  },
3974
- "sources:restore": {
4013
+ "tickets:update": {
3975
4014
  "aliases": [],
3976
4015
  "args": {
3977
- "sourceId": {
3978
- "description": "Source ID",
3979
- "name": "sourceId",
4016
+ "ticketNumber": {
4017
+ "description": "Ticket number",
4018
+ "name": "ticketNumber",
3980
4019
  "required": true
3981
4020
  }
3982
4021
  },
3983
- "description": "Restore a deleted source",
4022
+ "description": "Update a ticket's status, assignee, and/or team",
3984
4023
  "examples": [
3985
- "<%= config.bin %> sources restore src_1 -a agt_1"
4024
+ "<%= config.bin %> tickets update 42 --data '{\"statusCategory\":\"closed\"}' -a agt_123"
3986
4025
  ],
3987
4026
  "flags": {
3988
4027
  "json": {
@@ -4041,11 +4080,26 @@
4041
4080
  "hasDynamicHelp": false,
4042
4081
  "multiple": false,
4043
4082
  "type": "option"
4083
+ },
4084
+ "field": {
4085
+ "char": "f",
4086
+ "description": "Set a body field: -f key=value (repeatable)",
4087
+ "name": "field",
4088
+ "hasDynamicHelp": false,
4089
+ "multiple": true,
4090
+ "type": "option"
4091
+ },
4092
+ "data": {
4093
+ "description": "JSON body (@file, @-, or inline). Fields: statusId, statusCategory, assigneeId, assigneeEmail, teamId",
4094
+ "name": "data",
4095
+ "hasDynamicHelp": false,
4096
+ "multiple": false,
4097
+ "type": "option"
4044
4098
  }
4045
4099
  },
4046
4100
  "hasDynamicHelp": false,
4047
4101
  "hiddenAliases": [],
4048
- "id": "sources:restore",
4102
+ "id": "tickets:update",
4049
4103
  "pluginAlias": "chatbase",
4050
4104
  "pluginName": "chatbase",
4051
4105
  "pluginType": "core",
@@ -4055,16 +4109,23 @@
4055
4109
  "relativePath": [
4056
4110
  "dist",
4057
4111
  "commands",
4058
- "sources",
4059
- "restore.js"
4112
+ "tickets",
4113
+ "update.js"
4060
4114
  ]
4061
4115
  },
4062
- "sources:summary": {
4116
+ "whatsapp:send-template": {
4063
4117
  "aliases": [],
4064
- "args": {},
4065
- "description": "Show aggregated source counts and sizes for an agent",
4118
+ "args": {
4119
+ "template": {
4120
+ "description": "Name of the approved template",
4121
+ "name": "template",
4122
+ "required": true
4123
+ }
4124
+ },
4125
+ "description": "Send an approved WhatsApp template to a phone number from one of the agent’s connected numbers. No user ID is needed — a Chatbase user is resolved or created from the recipient number, and replies flow through the agent’s regular WhatsApp pipeline. Use `whatsapp templates` to see available templates and the variables each expects.",
4066
4126
  "examples": [
4067
- "<%= config.bin %> sources summary -a agt_123"
4127
+ "<%= config.bin %> whatsapp send-template order_update --to 14155552671 -a agt_123",
4128
+ "<%= config.bin %> whatsapp send-template order_update --to 14155552671 --language en_US --variables '{\"header\":{\"1\":\"#1042\"},\"body\":{\"1\":\"Jane\",\"2\":\"Friday\"}}' -a agt_123"
4068
4129
  ],
4069
4130
  "flags": {
4070
4131
  "json": {
@@ -4123,37 +4184,61 @@
4123
4184
  "hasDynamicHelp": false,
4124
4185
  "multiple": false,
4125
4186
  "type": "option"
4187
+ },
4188
+ "to": {
4189
+ "description": "Recipient phone number in international format (digits with country code)",
4190
+ "name": "to",
4191
+ "required": true,
4192
+ "hasDynamicHelp": false,
4193
+ "multiple": false,
4194
+ "type": "option"
4195
+ },
4196
+ "from": {
4197
+ "description": "Which connected WhatsApp number to send from — optional when the agent has exactly one",
4198
+ "name": "from",
4199
+ "hasDynamicHelp": false,
4200
+ "multiple": false,
4201
+ "type": "option"
4202
+ },
4203
+ "language": {
4204
+ "description": "Template language code (e.g. en_US) — optional when the template exists in a single language",
4205
+ "name": "language",
4206
+ "hasDynamicHelp": false,
4207
+ "multiple": false,
4208
+ "type": "option"
4209
+ },
4210
+ "variables": {
4211
+ "description": "Template variable values as JSON grouped by component (@file, @-, or inline), e.g. '{\"body\":{\"1\":\"Jane\"}}'",
4212
+ "name": "variables",
4213
+ "hasDynamicHelp": false,
4214
+ "multiple": false,
4215
+ "type": "option"
4126
4216
  }
4127
4217
  },
4128
4218
  "hasDynamicHelp": false,
4129
4219
  "hiddenAliases": [],
4130
- "id": "sources:summary",
4220
+ "id": "whatsapp:send-template",
4131
4221
  "pluginAlias": "chatbase",
4132
4222
  "pluginName": "chatbase",
4133
4223
  "pluginType": "core",
4134
4224
  "strict": true,
4225
+ "summary": "Send an approved WhatsApp template message",
4135
4226
  "enableJsonFlag": false,
4136
4227
  "isESM": true,
4137
4228
  "relativePath": [
4138
4229
  "dist",
4139
4230
  "commands",
4140
- "sources",
4141
- "summary.js"
4231
+ "whatsapp",
4232
+ "send-template.js"
4142
4233
  ]
4143
4234
  },
4144
- "sources:update": {
4235
+ "whatsapp:templates": {
4145
4236
  "aliases": [],
4146
- "args": {
4147
- "sourceId": {
4148
- "description": "Source ID",
4149
- "name": "sourceId",
4150
- "required": true
4151
- }
4152
- },
4153
- "description": "Update an existing source (text, qna, link, or file)",
4237
+ "args": {},
4238
+ "description": "List the approved WhatsApp templates available to the agent, across all of its connected WhatsApp Business Accounts. A template can only be sent from a number on its own Business Account — pick a sender whose WABA matches the template’s WABA column.",
4154
4239
  "examples": [
4155
- "<%= config.bin %> sources update src_1 --data '{\"type\":\"text\",\"content\":\"new\"}' -a agt_1",
4156
- "<%= config.bin %> sources update src_1 --file ./updated.pdf -a agt_1"
4240
+ "<%= config.bin %> whatsapp templates -a agt_123",
4241
+ "<%= config.bin %> whatsapp templates -a agt_123 --json"
4157
4242
  ],
4158
4243
  "flags": {
4159
4244
  "json": {
@@ -4212,53 +4297,25 @@
4212
4297
  "hasDynamicHelp": false,
4213
4298
  "multiple": false,
4214
4299
  "type": "option"
4215
- },
4216
- "field": {
4217
- "char": "f",
4218
- "description": "Set a body field: -f key=value (repeatable)",
4219
- "name": "field",
4220
- "hasDynamicHelp": false,
4221
- "multiple": true,
4222
- "type": "option"
4223
- },
4224
- "data": {
4225
- "description": "JSON body for text/qna/link sources (@file, @-, or inline)",
4226
- "exclusive": [
4227
- "file"
4228
- ],
4229
- "name": "data",
4230
- "hasDynamicHelp": false,
4231
- "multiple": false,
4232
- "type": "option"
4233
- },
4234
- "file": {
4235
- "description": "Path to a file to upload as a replacement (mutually exclusive with --data)",
4236
- "exclusive": [
4237
- "data",
4238
- "field"
4239
- ],
4240
- "name": "file",
4241
- "hasDynamicHelp": false,
4242
- "multiple": false,
4243
- "type": "option"
4244
4300
  }
4245
4301
  },
4246
4302
  "hasDynamicHelp": false,
4247
4303
  "hiddenAliases": [],
4248
- "id": "sources:update",
4304
+ "id": "whatsapp:templates",
4249
4305
  "pluginAlias": "chatbase",
4250
4306
  "pluginName": "chatbase",
4251
4307
  "pluginType": "core",
4252
4308
  "strict": true,
4309
+ "summary": "List approved WhatsApp templates for an agent",
4253
4310
  "enableJsonFlag": false,
4254
4311
  "isESM": true,
4255
4312
  "relativePath": [
4256
4313
  "dist",
4257
4314
  "commands",
4258
- "sources",
4259
- "update.js"
4315
+ "whatsapp",
4316
+ "templates.js"
4260
4317
  ]
4261
4318
  }
4262
4319
  },
4263
- "version": "0.2.0"
4320
+ "version": "0.3.0"
4264
4321
  }