chatbase 0.1.1 → 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,30 +1720,105 @@
1716
1720
  "hasDynamicHelp": false,
1717
1721
  "multiple": false,
1718
1722
  "type": "option"
1723
+ },
1724
+ "cursor": {
1725
+ "description": "Opaque cursor from a previous response",
1726
+ "name": "cursor",
1727
+ "hasDynamicHelp": false,
1728
+ "multiple": false,
1729
+ "type": "option"
1730
+ },
1731
+ "limit": {
1732
+ "description": "Items per page (1-20, default 20)",
1733
+ "name": "limit",
1734
+ "hasDynamicHelp": false,
1735
+ "multiple": false,
1736
+ "type": "option"
1737
+ },
1738
+ "all": {
1739
+ "description": "Fetch every page",
1740
+ "name": "all",
1741
+ "allowNo": false,
1742
+ "type": "boolean"
1743
+ },
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"
1751
+ },
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"
1758
+ },
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",
1762
+ "hasDynamicHelp": false,
1763
+ "multiple": false,
1764
+ "type": "option"
1765
+ },
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"
1781
+ ],
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",
1787
+ "hasDynamicHelp": false,
1788
+ "multiple": false,
1789
+ "type": "option"
1719
1790
  }
1720
1791
  },
1721
1792
  "hasDynamicHelp": false,
1722
1793
  "hiddenAliases": [],
1723
- "id": "helpdesk:statuses",
1794
+ "id": "conversations:export",
1724
1795
  "pluginAlias": "chatbase",
1725
1796
  "pluginName": "chatbase",
1726
1797
  "pluginType": "core",
1727
1798
  "strict": true,
1799
+ "summary": "Export conversations from every source, with full message history",
1728
1800
  "enableJsonFlag": false,
1729
1801
  "isESM": true,
1730
1802
  "relativePath": [
1731
1803
  "dist",
1732
1804
  "commands",
1733
- "helpdesk",
1734
- "statuses.js"
1805
+ "conversations",
1806
+ "export.js"
1735
1807
  ]
1736
1808
  },
1737
- "helpdesk:teams": {
1809
+ "conversations:get": {
1738
1810
  "aliases": [],
1739
- "args": {},
1740
- "description": "List helpdesk teams for an agent",
1811
+ "args": {
1812
+ "conversationId": {
1813
+ "description": "Conversation ID (alternative to --conversation)",
1814
+ "name": "conversationId",
1815
+ "required": false
1816
+ }
1817
+ },
1818
+ "description": "Show one conversation",
1741
1819
  "examples": [
1742
- "<%= config.bin %> helpdesk teams -a agt_123"
1820
+ "<%= config.bin %> conversations get conv_123 -a agt_123",
1821
+ "<%= config.bin %> conversations get --conversation conv_123 -a agt_123"
1743
1822
  ],
1744
1823
  "flags": {
1745
1824
  "json": {
@@ -1798,11 +1877,18 @@
1798
1877
  "hasDynamicHelp": false,
1799
1878
  "multiple": false,
1800
1879
  "type": "option"
1880
+ },
1881
+ "conversation": {
1882
+ "description": "Conversation ID",
1883
+ "name": "conversation",
1884
+ "hasDynamicHelp": false,
1885
+ "multiple": false,
1886
+ "type": "option"
1801
1887
  }
1802
1888
  },
1803
1889
  "hasDynamicHelp": false,
1804
1890
  "hiddenAliases": [],
1805
- "id": "helpdesk:teams",
1891
+ "id": "conversations:get",
1806
1892
  "pluginAlias": "chatbase",
1807
1893
  "pluginName": "chatbase",
1808
1894
  "pluginType": "core",
@@ -1812,17 +1898,19 @@
1812
1898
  "relativePath": [
1813
1899
  "dist",
1814
1900
  "commands",
1815
- "helpdesk",
1816
- "teams.js"
1901
+ "conversations",
1902
+ "get.js"
1817
1903
  ]
1818
1904
  },
1819
- "tickets:create": {
1905
+ "conversations:list": {
1820
1906
  "aliases": [],
1821
1907
  "args": {},
1822
- "description": "Create a helpdesk ticket",
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.",
1823
1909
  "examples": [
1824
- "<%= config.bin %> tickets create --subject \"Export failing\" -f description=\"Customer cannot export.\" --customer-email jane@example.com -a agt_123",
1825
- "<%= config.bin %> tickets create --subject \"Export failing\" --data '{\"description\":\"Customer cannot export.\",\"customer\":{\"email\":\"jane@example.com\"}}' -a agt_123"
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"
1826
1914
  ],
1827
1915
  "flags": {
1828
1916
  "json": {
@@ -1882,41 +1970,43 @@
1882
1970
  "multiple": false,
1883
1971
  "type": "option"
1884
1972
  },
1885
- "field": {
1886
- "char": "f",
1887
- "description": "Set a body field: -f key=value (repeatable)",
1888
- "name": "field",
1973
+ "limit": {
1974
+ "description": "Maximum items per page",
1975
+ "name": "limit",
1889
1976
  "hasDynamicHelp": false,
1890
- "multiple": true,
1977
+ "multiple": false,
1891
1978
  "type": "option"
1892
1979
  },
1893
- "subject": {
1894
- "description": "Ticket subject",
1895
- "name": "subject",
1980
+ "cursor": {
1981
+ "description": "Pagination cursor from a previous page",
1982
+ "name": "cursor",
1896
1983
  "hasDynamicHelp": false,
1897
1984
  "multiple": false,
1898
1985
  "type": "option"
1899
1986
  },
1900
- "customer-email": {
1901
- "description": "Customer email — builds the required customer object (alternative to customer in --data)",
1902
- "name": "customer-email",
1987
+ "all": {
1988
+ "description": "Fetch every page",
1989
+ "name": "all",
1990
+ "allowNo": false,
1991
+ "type": "boolean"
1992
+ },
1993
+ "user": {
1994
+ "description": "List conversations for a specific user (uses GET /users/{userId}/conversations)",
1995
+ "name": "user",
1903
1996
  "hasDynamicHelp": false,
1904
1997
  "multiple": false,
1905
1998
  "type": "option"
1906
1999
  },
1907
- "customer-name": {
1908
- "dependsOn": [
1909
- "customer-email"
1910
- ],
1911
- "description": "Customer display name, used only when the email creates a new customer record",
1912
- "name": "customer-name",
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",
1913
2003
  "hasDynamicHelp": false,
1914
2004
  "multiple": false,
1915
2005
  "type": "option"
1916
2006
  },
1917
- "data": {
1918
- "description": "JSON body (@file, @-, or inline). Fields: subject, description, customer, statusId, statusCategory, assigneeId, assigneeEmail, teamId",
1919
- "name": "data",
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",
1920
2010
  "hasDynamicHelp": false,
1921
2011
  "multiple": false,
1922
2012
  "type": "option"
@@ -1924,32 +2014,35 @@
1924
2014
  },
1925
2015
  "hasDynamicHelp": false,
1926
2016
  "hiddenAliases": [],
1927
- "id": "tickets:create",
2017
+ "id": "conversations:list",
1928
2018
  "pluginAlias": "chatbase",
1929
2019
  "pluginName": "chatbase",
1930
2020
  "pluginType": "core",
1931
2021
  "strict": true,
2022
+ "summary": "List an agent’s API-created conversations",
1932
2023
  "enableJsonFlag": false,
1933
2024
  "isESM": true,
1934
2025
  "relativePath": [
1935
2026
  "dist",
1936
2027
  "commands",
1937
- "tickets",
1938
- "create.js"
2028
+ "conversations",
2029
+ "list.js"
1939
2030
  ]
1940
2031
  },
1941
- "tickets:get": {
2032
+ "conversations:tool-result": {
1942
2033
  "aliases": [],
1943
2034
  "args": {
1944
- "ticketNumber": {
1945
- "description": "Ticket number",
1946
- "name": "ticketNumber",
1947
- "required": true
2035
+ "conversationId": {
2036
+ "description": "Conversation ID (alternative to --conversation)",
2037
+ "name": "conversationId",
2038
+ "required": false
1948
2039
  }
1949
2040
  },
1950
- "description": "Show one helpdesk ticket",
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.",
1951
2042
  "examples": [
1952
- "<%= config.bin %> tickets get 42 -a agt_123"
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"
1953
2046
  ],
1954
2047
  "flags": {
1955
2048
  "json": {
@@ -2008,32 +2101,53 @@
2008
2101
  "hasDynamicHelp": false,
2009
2102
  "multiple": false,
2010
2103
  "type": "option"
2104
+ },
2105
+ "conversation": {
2106
+ "description": "Conversation ID",
2107
+ "name": "conversation",
2108
+ "hasDynamicHelp": false,
2109
+ "multiple": false,
2110
+ "type": "option"
2111
+ },
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,
2116
+ "hasDynamicHelp": false,
2117
+ "multiple": false,
2118
+ "type": "option"
2119
+ },
2120
+ "output": {
2121
+ "description": "Result of executing the tool (inline JSON, @file, or @-); a value that is not valid JSON is sent as a plain string",
2122
+ "name": "output",
2123
+ "hasDynamicHelp": false,
2124
+ "multiple": false,
2125
+ "type": "option"
2011
2126
  }
2012
2127
  },
2013
2128
  "hasDynamicHelp": false,
2014
2129
  "hiddenAliases": [],
2015
- "id": "tickets:get",
2130
+ "id": "conversations:tool-result",
2016
2131
  "pluginAlias": "chatbase",
2017
2132
  "pluginName": "chatbase",
2018
2133
  "pluginType": "core",
2019
2134
  "strict": true,
2135
+ "summary": "Submit a client-side tool result to a chat turn",
2020
2136
  "enableJsonFlag": false,
2021
2137
  "isESM": true,
2022
2138
  "relativePath": [
2023
2139
  "dist",
2024
2140
  "commands",
2025
- "tickets",
2026
- "get.js"
2141
+ "conversations",
2142
+ "tool-result.js"
2027
2143
  ]
2028
2144
  },
2029
- "tickets:list": {
2145
+ "helpdesk:statuses": {
2030
2146
  "aliases": [],
2031
2147
  "args": {},
2032
- "description": "List helpdesk tickets for an agent",
2148
+ "description": "List ticket statuses for an agent",
2033
2149
  "examples": [
2034
- "<%= config.bin %> tickets list -a agt_123",
2035
- "<%= config.bin %> tickets list -a agt_123 --status new,on_you",
2036
- "<%= config.bin %> tickets list -a agt_123 --all --json"
2150
+ "<%= config.bin %> helpdesk statuses -a agt_123"
2037
2151
  ],
2038
2152
  "flags": {
2039
2153
  "json": {
@@ -2092,148 +2206,50 @@
2092
2206
  "hasDynamicHelp": false,
2093
2207
  "multiple": false,
2094
2208
  "type": "option"
2209
+ }
2210
+ },
2211
+ "hasDynamicHelp": false,
2212
+ "hiddenAliases": [],
2213
+ "id": "helpdesk:statuses",
2214
+ "pluginAlias": "chatbase",
2215
+ "pluginName": "chatbase",
2216
+ "pluginType": "core",
2217
+ "strict": true,
2218
+ "enableJsonFlag": false,
2219
+ "isESM": true,
2220
+ "relativePath": [
2221
+ "dist",
2222
+ "commands",
2223
+ "helpdesk",
2224
+ "statuses.js"
2225
+ ]
2226
+ },
2227
+ "helpdesk:teams": {
2228
+ "aliases": [],
2229
+ "args": {},
2230
+ "description": "List helpdesk teams for an agent",
2231
+ "examples": [
2232
+ "<%= config.bin %> helpdesk teams -a agt_123"
2233
+ ],
2234
+ "flags": {
2235
+ "json": {
2236
+ "description": "Output raw API JSON",
2237
+ "helpGroup": "OUTPUT",
2238
+ "name": "json",
2239
+ "allowNo": false,
2240
+ "type": "boolean"
2095
2241
  },
2096
- "limit": {
2097
- "description": "Maximum items per page",
2098
- "name": "limit",
2099
- "hasDynamicHelp": false,
2100
- "multiple": false,
2101
- "type": "option"
2102
- },
2103
- "cursor": {
2104
- "description": "Pagination cursor from a previous page",
2105
- "name": "cursor",
2106
- "hasDynamicHelp": false,
2107
- "multiple": false,
2108
- "type": "option"
2242
+ "plain": {
2243
+ "description": "Tab-separated output for scripts",
2244
+ "helpGroup": "OUTPUT",
2245
+ "name": "plain",
2246
+ "allowNo": false,
2247
+ "type": "boolean"
2109
2248
  },
2110
- "all": {
2111
- "description": "Fetch every page",
2112
- "name": "all",
2113
- "allowNo": false,
2114
- "type": "boolean"
2115
- },
2116
- "status": {
2117
- "description": "Filter by status (comma-separated): new, on_you, on_customer, on_hold, closed, cancelled",
2118
- "name": "status",
2119
- "hasDynamicHelp": false,
2120
- "multiple": false,
2121
- "type": "option"
2122
- },
2123
- "channel": {
2124
- "description": "Filter by channel (comma-separated, e.g. email,api)",
2125
- "name": "channel",
2126
- "hasDynamicHelp": false,
2127
- "multiple": false,
2128
- "type": "option"
2129
- },
2130
- "assignee-id": {
2131
- "description": "Filter by assignee UUID, or \"none\" for unassigned",
2132
- "name": "assignee-id",
2133
- "hasDynamicHelp": false,
2134
- "multiple": false,
2135
- "type": "option"
2136
- },
2137
- "team-id": {
2138
- "description": "Filter by team UUID, or \"none\" for no team",
2139
- "name": "team-id",
2140
- "hasDynamicHelp": false,
2141
- "multiple": false,
2142
- "type": "option"
2143
- },
2144
- "created-after": {
2145
- "description": "Only tickets created after this ISO 8601 date",
2146
- "name": "created-after",
2147
- "hasDynamicHelp": false,
2148
- "multiple": false,
2149
- "type": "option"
2150
- },
2151
- "created-before": {
2152
- "description": "Only tickets created before this ISO 8601 date",
2153
- "name": "created-before",
2154
- "hasDynamicHelp": false,
2155
- "multiple": false,
2156
- "type": "option"
2157
- },
2158
- "sort-by": {
2159
- "description": "Sort field",
2160
- "name": "sort-by",
2161
- "hasDynamicHelp": false,
2162
- "multiple": false,
2163
- "options": [
2164
- "createdAt",
2165
- "updatedAt",
2166
- "lastMessageAt"
2167
- ],
2168
- "type": "option"
2169
- },
2170
- "order": {
2171
- "description": "Sort direction",
2172
- "name": "order",
2173
- "hasDynamicHelp": false,
2174
- "multiple": false,
2175
- "options": [
2176
- "asc",
2177
- "desc"
2178
- ],
2179
- "type": "option"
2180
- },
2181
- "include-total": {
2182
- "description": "Include pagination.total in the response",
2183
- "name": "include-total",
2184
- "allowNo": false,
2185
- "type": "boolean"
2186
- }
2187
- },
2188
- "hasDynamicHelp": false,
2189
- "hiddenAliases": [],
2190
- "id": "tickets:list",
2191
- "pluginAlias": "chatbase",
2192
- "pluginName": "chatbase",
2193
- "pluginType": "core",
2194
- "strict": true,
2195
- "enableJsonFlag": false,
2196
- "isESM": true,
2197
- "relativePath": [
2198
- "dist",
2199
- "commands",
2200
- "tickets",
2201
- "list.js"
2202
- ]
2203
- },
2204
- "tickets:messages": {
2205
- "aliases": [],
2206
- "args": {
2207
- "ticketNumber": {
2208
- "description": "Ticket number (alternative to --ticket)",
2209
- "name": "ticketNumber",
2210
- "required": false
2211
- }
2212
- },
2213
- "description": "List a ticket's message thread",
2214
- "examples": [
2215
- "<%= config.bin %> tickets messages 42 -a agt_123",
2216
- "<%= config.bin %> tickets messages 42 -a agt_123 --all --json"
2217
- ],
2218
- "flags": {
2219
- "json": {
2220
- "description": "Output raw API JSON",
2221
- "helpGroup": "OUTPUT",
2222
- "name": "json",
2223
- "allowNo": false,
2224
- "type": "boolean"
2225
- },
2226
- "plain": {
2227
- "description": "Tab-separated output for scripts",
2228
- "helpGroup": "OUTPUT",
2229
- "name": "plain",
2230
- "allowNo": false,
2231
- "type": "boolean"
2232
- },
2233
- "quiet": {
2234
- "char": "q",
2235
- "description": "Suppress non-essential output",
2236
- "name": "quiet",
2249
+ "quiet": {
2250
+ "char": "q",
2251
+ "description": "Suppress non-essential output",
2252
+ "name": "quiet",
2237
2253
  "allowNo": false,
2238
2254
  "type": "boolean"
2239
2255
  },
@@ -2272,56 +2288,11 @@
2272
2288
  "hasDynamicHelp": false,
2273
2289
  "multiple": false,
2274
2290
  "type": "option"
2275
- },
2276
- "limit": {
2277
- "description": "Maximum items per page",
2278
- "name": "limit",
2279
- "hasDynamicHelp": false,
2280
- "multiple": false,
2281
- "type": "option"
2282
- },
2283
- "cursor": {
2284
- "description": "Pagination cursor from a previous page",
2285
- "name": "cursor",
2286
- "hasDynamicHelp": false,
2287
- "multiple": false,
2288
- "type": "option"
2289
- },
2290
- "all": {
2291
- "description": "Fetch every page",
2292
- "name": "all",
2293
- "allowNo": false,
2294
- "type": "boolean"
2295
- },
2296
- "ticket": {
2297
- "description": "Ticket number",
2298
- "name": "ticket",
2299
- "hasDynamicHelp": false,
2300
- "multiple": false,
2301
- "type": "option"
2302
- },
2303
- "types": {
2304
- "description": "Message types to include (comma-separated): reply, note, event (default: reply,note)",
2305
- "name": "types",
2306
- "hasDynamicHelp": false,
2307
- "multiple": false,
2308
- "type": "option"
2309
- },
2310
- "order": {
2311
- "description": "Sort direction",
2312
- "name": "order",
2313
- "hasDynamicHelp": false,
2314
- "multiple": false,
2315
- "options": [
2316
- "asc",
2317
- "desc"
2318
- ],
2319
- "type": "option"
2320
2291
  }
2321
2292
  },
2322
2293
  "hasDynamicHelp": false,
2323
2294
  "hiddenAliases": [],
2324
- "id": "tickets:messages",
2295
+ "id": "helpdesk:teams",
2325
2296
  "pluginAlias": "chatbase",
2326
2297
  "pluginName": "chatbase",
2327
2298
  "pluginType": "core",
@@ -2331,22 +2302,23 @@
2331
2302
  "relativePath": [
2332
2303
  "dist",
2333
2304
  "commands",
2334
- "tickets",
2335
- "messages.js"
2305
+ "helpdesk",
2306
+ "teams.js"
2336
2307
  ]
2337
2308
  },
2338
- "tickets:reply": {
2309
+ "messages:feedback": {
2339
2310
  "aliases": [],
2340
2311
  "args": {
2341
- "ticketNumber": {
2342
- "description": "Ticket number (alternative to --ticket)",
2343
- "name": "ticketNumber",
2312
+ "messageId": {
2313
+ "description": "Message ID (alternative to --message)",
2314
+ "name": "messageId",
2344
2315
  "required": false
2345
2316
  }
2346
2317
  },
2347
- "description": "Post an agent reply to a ticket's message thread",
2318
+ "description": "Set or clear user feedback on an assistant message",
2348
2319
  "examples": [
2349
- "<%= config.bin %> tickets reply 42 -m \"On it\" --author-email sam@example.com -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"
2350
2322
  ],
2351
2323
  "flags": {
2352
2324
  "json": {
@@ -2406,40 +2378,38 @@
2406
2378
  "multiple": false,
2407
2379
  "type": "option"
2408
2380
  },
2409
- "ticket": {
2410
- "description": "Ticket number",
2411
- "name": "ticket",
2381
+ "conversation": {
2382
+ "description": "Conversation ID",
2383
+ "name": "conversation",
2384
+ "required": true,
2412
2385
  "hasDynamicHelp": false,
2413
2386
  "multiple": false,
2414
2387
  "type": "option"
2415
2388
  },
2416
2389
  "message": {
2417
- "char": "m",
2418
- "description": "Reply body as GitHub-flavored Markdown",
2390
+ "description": "Message ID",
2419
2391
  "name": "message",
2420
- "required": true,
2421
- "hasDynamicHelp": false,
2422
- "multiple": false,
2423
- "type": "option"
2424
- },
2425
- "author-id": {
2426
- "description": "Platform user id of the team member the reply is attributed to (exactly one of --author-id/--author-email)",
2427
- "name": "author-id",
2428
2392
  "hasDynamicHelp": false,
2429
2393
  "multiple": false,
2430
2394
  "type": "option"
2431
2395
  },
2432
- "author-email": {
2433
- "description": "Email of the team member the reply is attributed to (exactly one of --author-id/--author-email)",
2434
- "name": "author-email",
2396
+ "rating": {
2397
+ "description": "Feedback value (\"clear\" removes existing feedback)",
2398
+ "name": "rating",
2399
+ "required": true,
2435
2400
  "hasDynamicHelp": false,
2436
2401
  "multiple": false,
2402
+ "options": [
2403
+ "positive",
2404
+ "negative",
2405
+ "clear"
2406
+ ],
2437
2407
  "type": "option"
2438
2408
  }
2439
2409
  },
2440
2410
  "hasDynamicHelp": false,
2441
2411
  "hiddenAliases": [],
2442
- "id": "tickets:reply",
2412
+ "id": "messages:feedback",
2443
2413
  "pluginAlias": "chatbase",
2444
2414
  "pluginName": "chatbase",
2445
2415
  "pluginType": "core",
@@ -2449,23 +2419,17 @@
2449
2419
  "relativePath": [
2450
2420
  "dist",
2451
2421
  "commands",
2452
- "tickets",
2453
- "reply.js"
2422
+ "messages",
2423
+ "feedback.js"
2454
2424
  ]
2455
2425
  },
2456
- "tickets:search": {
2426
+ "messages:list": {
2457
2427
  "aliases": [],
2458
- "args": {
2459
- "query": {
2460
- "description": "Free-text search terms (matched against ticket messages)",
2461
- "name": "query",
2462
- "required": true
2463
- }
2464
- },
2465
- "description": "Search tickets by message content",
2428
+ "args": {},
2429
+ "description": "List messages in a conversation",
2466
2430
  "examples": [
2467
- "<%= config.bin %> tickets search \"refund not received\" -a agt_123",
2468
- "<%= config.bin %> tickets search \"refund\" -a agt_123 --limit 10 --json"
2431
+ "<%= config.bin %> messages list --conversation conv_123 -a agt_123",
2432
+ "<%= config.bin %> messages list --conversation conv_123 -a agt_123 --all --json"
2469
2433
  ],
2470
2434
  "flags": {
2471
2435
  "json": {
@@ -2526,16 +2490,37 @@
2526
2490
  "type": "option"
2527
2491
  },
2528
2492
  "limit": {
2529
- "description": "Number of results (1–50, default 20)",
2493
+ "description": "Maximum items per page",
2530
2494
  "name": "limit",
2531
2495
  "hasDynamicHelp": false,
2532
2496
  "multiple": false,
2533
2497
  "type": "option"
2498
+ },
2499
+ "cursor": {
2500
+ "description": "Pagination cursor from a previous page",
2501
+ "name": "cursor",
2502
+ "hasDynamicHelp": false,
2503
+ "multiple": false,
2504
+ "type": "option"
2505
+ },
2506
+ "all": {
2507
+ "description": "Fetch every page",
2508
+ "name": "all",
2509
+ "allowNo": false,
2510
+ "type": "boolean"
2511
+ },
2512
+ "conversation": {
2513
+ "description": "Conversation ID",
2514
+ "name": "conversation",
2515
+ "required": true,
2516
+ "hasDynamicHelp": false,
2517
+ "multiple": false,
2518
+ "type": "option"
2534
2519
  }
2535
2520
  },
2536
2521
  "hasDynamicHelp": false,
2537
2522
  "hiddenAliases": [],
2538
- "id": "tickets:search",
2523
+ "id": "messages:list",
2539
2524
  "pluginAlias": "chatbase",
2540
2525
  "pluginName": "chatbase",
2541
2526
  "pluginType": "core",
@@ -2545,22 +2530,19 @@
2545
2530
  "relativePath": [
2546
2531
  "dist",
2547
2532
  "commands",
2548
- "tickets",
2549
- "search.js"
2533
+ "messages",
2534
+ "list.js"
2550
2535
  ]
2551
2536
  },
2552
- "tickets:update": {
2537
+ "sources:create": {
2553
2538
  "aliases": [],
2554
- "args": {
2555
- "ticketNumber": {
2556
- "description": "Ticket number",
2557
- "name": "ticketNumber",
2558
- "required": true
2559
- }
2560
- },
2561
- "description": "Update a ticket's status, assignee, and/or team",
2539
+ "args": {},
2540
+ "description": "Create a source: text/qna/link (JSON) or a file upload",
2562
2541
  "examples": [
2563
- "<%= config.bin %> tickets update 42 --data '{\"statusCategory\":\"closed\"}' -a agt_123"
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"
2564
2546
  ],
2565
2547
  "flags": {
2566
2548
  "json": {
@@ -2628,8 +2610,70 @@
2628
2610
  "multiple": true,
2629
2611
  "type": "option"
2630
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
+ },
2631
2675
  "data": {
2632
- "description": "JSON body (@file, @-, or inline). Fields: statusId, statusCategory, assigneeId, assigneeEmail, teamId",
2676
+ "description": "JSON body (@file, @-, or inline); per-type flags override matching keys",
2633
2677
  "name": "data",
2634
2678
  "hasDynamicHelp": false,
2635
2679
  "multiple": false,
@@ -2638,7 +2682,7 @@
2638
2682
  },
2639
2683
  "hasDynamicHelp": false,
2640
2684
  "hiddenAliases": [],
2641
- "id": "tickets:update",
2685
+ "id": "sources:create",
2642
2686
  "pluginAlias": "chatbase",
2643
2687
  "pluginName": "chatbase",
2644
2688
  "pluginType": "core",
@@ -2648,17 +2692,22 @@
2648
2692
  "relativePath": [
2649
2693
  "dist",
2650
2694
  "commands",
2651
- "tickets",
2652
- "update.js"
2695
+ "sources",
2696
+ "create.js"
2653
2697
  ]
2654
2698
  },
2655
- "conversations:export": {
2699
+ "sources:delete": {
2656
2700
  "aliases": [],
2657
- "args": {},
2658
- "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).",
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)",
2659
2709
  "examples": [
2660
- "<%= config.bin %> conversations export -a agt_123",
2661
- "<%= config.bin %> conversations export -a agt_123 --all -o export.json"
2710
+ "<%= config.bin %> sources delete src_1 -a agt_1"
2662
2711
  ],
2663
2712
  "flags": {
2664
2713
  "json": {
@@ -2717,66 +2766,36 @@
2717
2766
  "hasDynamicHelp": false,
2718
2767
  "multiple": false,
2719
2768
  "type": "option"
2720
- },
2721
- "cursor": {
2722
- "description": "Opaque cursor from a previous response",
2723
- "name": "cursor",
2724
- "hasDynamicHelp": false,
2725
- "multiple": false,
2726
- "type": "option"
2727
- },
2728
- "limit": {
2729
- "description": "Items per page (1-20, default 20)",
2730
- "name": "limit",
2731
- "hasDynamicHelp": false,
2732
- "multiple": false,
2733
- "type": "option"
2734
- },
2735
- "all": {
2736
- "description": "Fetch every page",
2737
- "name": "all",
2738
- "allowNo": false,
2739
- "type": "boolean"
2740
- },
2741
- "output": {
2742
- "char": "o",
2743
- "description": "Write export JSON to a file instead of stdout",
2744
- "name": "output",
2745
- "hasDynamicHelp": false,
2746
- "multiple": false,
2747
- "type": "option"
2748
2769
  }
2749
2770
  },
2750
2771
  "hasDynamicHelp": false,
2751
2772
  "hiddenAliases": [],
2752
- "id": "conversations:export",
2773
+ "id": "sources:delete",
2753
2774
  "pluginAlias": "chatbase",
2754
2775
  "pluginName": "chatbase",
2755
2776
  "pluginType": "core",
2756
2777
  "strict": true,
2757
- "summary": "Export conversations from every source, with full message history",
2758
2778
  "enableJsonFlag": false,
2759
2779
  "isESM": true,
2760
2780
  "relativePath": [
2761
2781
  "dist",
2762
2782
  "commands",
2763
- "conversations",
2764
- "export.js"
2783
+ "sources",
2784
+ "delete.js"
2765
2785
  ]
2766
2786
  },
2767
- "conversations:get": {
2787
+ "sources:get": {
2768
2788
  "aliases": [],
2769
2789
  "args": {
2770
- "conversationId": {
2771
- "description": "Conversation ID (alternative to --conversation)",
2772
- "name": "conversationId",
2773
- "required": false
2790
+ "sourceId": {
2791
+ "description": "Source ID",
2792
+ "name": "sourceId",
2793
+ "required": true
2774
2794
  }
2775
2795
  },
2776
- "description": "Show one conversation",
2796
+ "description": "Show one source",
2777
2797
  "examples": [
2778
- "<%= config.bin %> conversations get conv_123 -a agt_123",
2779
- "<%= config.bin %> conversations get --conversation conv_123 -a agt_123"
2798
+ "<%= config.bin %> sources get src_123 -a agt_123"
2780
2799
  ],
2781
2800
  "flags": {
2782
2801
  "json": {
@@ -2835,18 +2854,11 @@
2835
2854
  "hasDynamicHelp": false,
2836
2855
  "multiple": false,
2837
2856
  "type": "option"
2838
- },
2839
- "conversation": {
2840
- "description": "Conversation ID",
2841
- "name": "conversation",
2842
- "hasDynamicHelp": false,
2843
- "multiple": false,
2844
- "type": "option"
2845
2857
  }
2846
2858
  },
2847
2859
  "hasDynamicHelp": false,
2848
2860
  "hiddenAliases": [],
2849
- "id": "conversations:get",
2861
+ "id": "sources:get",
2850
2862
  "pluginAlias": "chatbase",
2851
2863
  "pluginName": "chatbase",
2852
2864
  "pluginType": "core",
@@ -2856,18 +2868,17 @@
2856
2868
  "relativePath": [
2857
2869
  "dist",
2858
2870
  "commands",
2859
- "conversations",
2871
+ "sources",
2860
2872
  "get.js"
2861
2873
  ]
2862
2874
  },
2863
- "conversations:list": {
2875
+ "sources:list": {
2864
2876
  "aliases": [],
2865
2877
  "args": {},
2866
- "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.",
2878
+ "description": "List sources for an agent",
2867
2879
  "examples": [
2868
- "<%= config.bin %> conversations list -a agt_123",
2869
- "<%= config.bin %> conversations list -a agt_123 --user usr_456",
2870
- "<%= config.bin %> conversations list -a agt_123 --all --json"
2880
+ "<%= config.bin %> sources list -a agt_123",
2881
+ "<%= config.bin %> sources list -a agt_123 --all --json"
2871
2882
  ],
2872
2883
  "flags": {
2873
2884
  "json": {
@@ -2947,9 +2958,16 @@
2947
2958
  "allowNo": false,
2948
2959
  "type": "boolean"
2949
2960
  },
2950
- "user": {
2951
- "description": "List conversations for a specific user (uses GET /users/{userId}/conversations)",
2952
- "name": "user",
2961
+ "type": {
2962
+ "description": "Filter by source type",
2963
+ "name": "type",
2964
+ "hasDynamicHelp": false,
2965
+ "multiple": false,
2966
+ "type": "option"
2967
+ },
2968
+ "name": {
2969
+ "description": "Filter by source name",
2970
+ "name": "name",
2953
2971
  "hasDynamicHelp": false,
2954
2972
  "multiple": false,
2955
2973
  "type": "option"
@@ -2957,35 +2975,32 @@
2957
2975
  },
2958
2976
  "hasDynamicHelp": false,
2959
2977
  "hiddenAliases": [],
2960
- "id": "conversations:list",
2978
+ "id": "sources:list",
2961
2979
  "pluginAlias": "chatbase",
2962
2980
  "pluginName": "chatbase",
2963
2981
  "pluginType": "core",
2964
2982
  "strict": true,
2965
- "summary": "List an agent’s API-created conversations",
2966
2983
  "enableJsonFlag": false,
2967
2984
  "isESM": true,
2968
2985
  "relativePath": [
2969
2986
  "dist",
2970
2987
  "commands",
2971
- "conversations",
2988
+ "sources",
2972
2989
  "list.js"
2973
2990
  ]
2974
2991
  },
2975
- "conversations:tool-result": {
2992
+ "sources:restore": {
2976
2993
  "aliases": [],
2977
2994
  "args": {
2978
- "conversationId": {
2979
- "description": "Conversation ID (alternative to --conversation)",
2980
- "name": "conversationId",
2981
- "required": false
2995
+ "sourceId": {
2996
+ "description": "Source ID",
2997
+ "name": "sourceId",
2998
+ "required": true
2982
2999
  }
2983
3000
  },
2984
- "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.",
3001
+ "description": "Restore a deleted source",
2985
3002
  "examples": [
2986
- "<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 --output '{\"temperature\": 72}' -a agt_123",
2987
- "<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 --output @result.json -a agt_123",
2988
- "<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 -a agt_123"
3003
+ "<%= config.bin %> sources restore src_1 -a agt_1"
2989
3004
  ],
2990
3005
  "flags": {
2991
3006
  "json": {
@@ -3044,60 +3059,30 @@
3044
3059
  "hasDynamicHelp": false,
3045
3060
  "multiple": false,
3046
3061
  "type": "option"
3047
- },
3048
- "conversation": {
3049
- "description": "Conversation ID",
3050
- "name": "conversation",
3051
- "hasDynamicHelp": false,
3052
- "multiple": false,
3053
- "type": "option"
3054
- },
3055
- "tool-call-id": {
3056
- "description": "The toolCallId from the tool-call part in the chat response",
3057
- "name": "tool-call-id",
3058
- "required": true,
3059
- "hasDynamicHelp": false,
3060
- "multiple": false,
3061
- "type": "option"
3062
- },
3063
- "output": {
3064
- "description": "Result of executing the tool (inline JSON, @file, or @-); a value that is not valid JSON is sent as a plain string",
3065
- "name": "output",
3066
- "hasDynamicHelp": false,
3067
- "multiple": false,
3068
- "type": "option"
3069
3062
  }
3070
3063
  },
3071
3064
  "hasDynamicHelp": false,
3072
3065
  "hiddenAliases": [],
3073
- "id": "conversations:tool-result",
3066
+ "id": "sources:restore",
3074
3067
  "pluginAlias": "chatbase",
3075
3068
  "pluginName": "chatbase",
3076
3069
  "pluginType": "core",
3077
3070
  "strict": true,
3078
- "summary": "Submit a client-side tool result to a chat turn",
3079
3071
  "enableJsonFlag": false,
3080
3072
  "isESM": true,
3081
3073
  "relativePath": [
3082
3074
  "dist",
3083
3075
  "commands",
3084
- "conversations",
3085
- "tool-result.js"
3076
+ "sources",
3077
+ "restore.js"
3086
3078
  ]
3087
3079
  },
3088
- "messages:feedback": {
3080
+ "sources:summary": {
3089
3081
  "aliases": [],
3090
- "args": {
3091
- "messageId": {
3092
- "description": "Message ID (alternative to --message)",
3093
- "name": "messageId",
3094
- "required": false
3095
- }
3096
- },
3097
- "description": "Set or clear user feedback on an assistant message",
3082
+ "args": {},
3083
+ "description": "Show aggregated source counts and sizes for an agent",
3098
3084
  "examples": [
3099
- "<%= config.bin %> messages feedback msg_1 --conversation conv_123 --rating positive -a agt_123",
3100
- "<%= config.bin %> messages feedback --conversation conv_123 --message msg_1 --rating clear -a agt_123"
3085
+ "<%= config.bin %> sources summary -a agt_123"
3101
3086
  ],
3102
3087
  "flags": {
3103
3088
  "json": {
@@ -3156,39 +3141,11 @@
3156
3141
  "hasDynamicHelp": false,
3157
3142
  "multiple": false,
3158
3143
  "type": "option"
3159
- },
3160
- "conversation": {
3161
- "description": "Conversation ID",
3162
- "name": "conversation",
3163
- "required": true,
3164
- "hasDynamicHelp": false,
3165
- "multiple": false,
3166
- "type": "option"
3167
- },
3168
- "message": {
3169
- "description": "Message ID",
3170
- "name": "message",
3171
- "hasDynamicHelp": false,
3172
- "multiple": false,
3173
- "type": "option"
3174
- },
3175
- "rating": {
3176
- "description": "Feedback value (\"clear\" removes existing feedback)",
3177
- "name": "rating",
3178
- "required": true,
3179
- "hasDynamicHelp": false,
3180
- "multiple": false,
3181
- "options": [
3182
- "positive",
3183
- "negative",
3184
- "clear"
3185
- ],
3186
- "type": "option"
3187
3144
  }
3188
3145
  },
3189
3146
  "hasDynamicHelp": false,
3190
3147
  "hiddenAliases": [],
3191
- "id": "messages:feedback",
3148
+ "id": "sources:summary",
3192
3149
  "pluginAlias": "chatbase",
3193
3150
  "pluginName": "chatbase",
3194
3151
  "pluginType": "core",
@@ -3198,17 +3155,23 @@
3198
3155
  "relativePath": [
3199
3156
  "dist",
3200
3157
  "commands",
3201
- "messages",
3202
- "feedback.js"
3158
+ "sources",
3159
+ "summary.js"
3203
3160
  ]
3204
3161
  },
3205
- "messages:list": {
3162
+ "sources:update": {
3206
3163
  "aliases": [],
3207
- "args": {},
3208
- "description": "List messages in a conversation",
3164
+ "args": {
3165
+ "sourceId": {
3166
+ "description": "Source ID",
3167
+ "name": "sourceId",
3168
+ "required": true
3169
+ }
3170
+ },
3171
+ "description": "Update an existing source (text, qna, link, or file)",
3209
3172
  "examples": [
3210
- "<%= config.bin %> messages list --conversation conv_123 -a agt_123",
3211
- "<%= config.bin %> messages list --conversation conv_123 -a agt_123 --all --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"
3212
3175
  ],
3213
3176
  "flags": {
3214
3177
  "json": {
@@ -3268,30 +3231,31 @@
3268
3231
  "multiple": false,
3269
3232
  "type": "option"
3270
3233
  },
3271
- "limit": {
3272
- "description": "Maximum items per page",
3273
- "name": "limit",
3234
+ "field": {
3235
+ "char": "f",
3236
+ "description": "Set a body field: -f key=value (repeatable)",
3237
+ "name": "field",
3274
3238
  "hasDynamicHelp": false,
3275
- "multiple": false,
3239
+ "multiple": true,
3276
3240
  "type": "option"
3277
3241
  },
3278
- "cursor": {
3279
- "description": "Pagination cursor from a previous page",
3280
- "name": "cursor",
3242
+ "data": {
3243
+ "description": "JSON body for text/qna/link sources (@file, @-, or inline)",
3244
+ "exclusive": [
3245
+ "file"
3246
+ ],
3247
+ "name": "data",
3281
3248
  "hasDynamicHelp": false,
3282
3249
  "multiple": false,
3283
3250
  "type": "option"
3284
3251
  },
3285
- "all": {
3286
- "description": "Fetch every page",
3287
- "name": "all",
3288
- "allowNo": false,
3289
- "type": "boolean"
3290
- },
3291
- "conversation": {
3292
- "description": "Conversation ID",
3293
- "name": "conversation",
3294
- "required": true,
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",
3295
3259
  "hasDynamicHelp": false,
3296
3260
  "multiple": false,
3297
3261
  "type": "option"
@@ -3299,7 +3263,7 @@
3299
3263
  },
3300
3264
  "hasDynamicHelp": false,
3301
3265
  "hiddenAliases": [],
3302
- "id": "messages:list",
3266
+ "id": "sources:update",
3303
3267
  "pluginAlias": "chatbase",
3304
3268
  "pluginName": "chatbase",
3305
3269
  "pluginType": "core",
@@ -3308,24 +3272,18 @@
3308
3272
  "isESM": true,
3309
3273
  "relativePath": [
3310
3274
  "dist",
3311
- "commands",
3312
- "messages",
3313
- "list.js"
3314
- ]
3315
- },
3316
- "whatsapp:send-template": {
3317
- "aliases": [],
3318
- "args": {
3319
- "template": {
3320
- "description": "Name of the approved template",
3321
- "name": "template",
3322
- "required": true
3323
- }
3324
- },
3325
- "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.",
3275
+ "commands",
3276
+ "sources",
3277
+ "update.js"
3278
+ ]
3279
+ },
3280
+ "tickets:create": {
3281
+ "aliases": [],
3282
+ "args": {},
3283
+ "description": "Create a helpdesk ticket",
3326
3284
  "examples": [
3327
- "<%= config.bin %> whatsapp send-template order_update --to 14155552671 -a agt_123",
3328
- "<%= config.bin %> whatsapp send-template order_update --to 14155552671 --language en_US --variables '{\"header\":{\"1\":\"#1042\"},\"body\":{\"1\":\"Jane\",\"2\":\"Friday\"}}' -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"
3329
3287
  ],
3330
3288
  "flags": {
3331
3289
  "json": {
@@ -3385,31 +3343,41 @@
3385
3343
  "multiple": false,
3386
3344
  "type": "option"
3387
3345
  },
3388
- "to": {
3389
- "description": "Recipient phone number in international format (digits with country code)",
3390
- "name": "to",
3391
- "required": true,
3346
+ "field": {
3347
+ "char": "f",
3348
+ "description": "Set a body field: -f key=value (repeatable)",
3349
+ "name": "field",
3350
+ "hasDynamicHelp": false,
3351
+ "multiple": true,
3352
+ "type": "option"
3353
+ },
3354
+ "subject": {
3355
+ "description": "Ticket subject",
3356
+ "name": "subject",
3392
3357
  "hasDynamicHelp": false,
3393
3358
  "multiple": false,
3394
3359
  "type": "option"
3395
3360
  },
3396
- "from": {
3397
- "description": "Which connected WhatsApp number to send from optional when the agent has exactly one",
3398
- "name": "from",
3361
+ "customer-email": {
3362
+ "description": "Customer email builds the required customer object (alternative to customer in --data)",
3363
+ "name": "customer-email",
3399
3364
  "hasDynamicHelp": false,
3400
3365
  "multiple": false,
3401
3366
  "type": "option"
3402
3367
  },
3403
- "language": {
3404
- "description": "Template language code (e.g. en_US) — optional when the template exists in a single language",
3405
- "name": "language",
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",
3406
3374
  "hasDynamicHelp": false,
3407
3375
  "multiple": false,
3408
3376
  "type": "option"
3409
3377
  },
3410
- "variables": {
3411
- "description": "Template variable values as JSON grouped by component (@file, @-, or inline), e.g. '{\"body\":{\"1\":\"Jane\"}}'",
3412
- "name": "variables",
3378
+ "data": {
3379
+ "description": "JSON body (@file, @-, or inline). Fields: subject, description, customer, statusId, statusCategory, assigneeId, assigneeEmail, teamId",
3380
+ "name": "data",
3413
3381
  "hasDynamicHelp": false,
3414
3382
  "multiple": false,
3415
3383
  "type": "option"
@@ -3417,28 +3385,32 @@
3417
3385
  },
3418
3386
  "hasDynamicHelp": false,
3419
3387
  "hiddenAliases": [],
3420
- "id": "whatsapp:send-template",
3388
+ "id": "tickets:create",
3421
3389
  "pluginAlias": "chatbase",
3422
3390
  "pluginName": "chatbase",
3423
3391
  "pluginType": "core",
3424
3392
  "strict": true,
3425
- "summary": "Send an approved WhatsApp template message",
3426
3393
  "enableJsonFlag": false,
3427
3394
  "isESM": true,
3428
3395
  "relativePath": [
3429
3396
  "dist",
3430
3397
  "commands",
3431
- "whatsapp",
3432
- "send-template.js"
3398
+ "tickets",
3399
+ "create.js"
3433
3400
  ]
3434
3401
  },
3435
- "whatsapp:templates": {
3402
+ "tickets:get": {
3436
3403
  "aliases": [],
3437
- "args": {},
3438
- "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.",
3404
+ "args": {
3405
+ "ticketNumber": {
3406
+ "description": "Ticket number",
3407
+ "name": "ticketNumber",
3408
+ "required": true
3409
+ }
3410
+ },
3411
+ "description": "Show one helpdesk ticket",
3439
3412
  "examples": [
3440
- "<%= config.bin %> whatsapp templates -a agt_123",
3441
- "<%= config.bin %> whatsapp templates -a agt_123 --json"
3413
+ "<%= config.bin %> tickets get 42 -a agt_123"
3442
3414
  ],
3443
3415
  "flags": {
3444
3416
  "json": {
@@ -3501,30 +3473,28 @@
3501
3473
  },
3502
3474
  "hasDynamicHelp": false,
3503
3475
  "hiddenAliases": [],
3504
- "id": "whatsapp:templates",
3476
+ "id": "tickets:get",
3505
3477
  "pluginAlias": "chatbase",
3506
3478
  "pluginName": "chatbase",
3507
3479
  "pluginType": "core",
3508
3480
  "strict": true,
3509
- "summary": "List approved WhatsApp templates for an agent",
3510
3481
  "enableJsonFlag": false,
3511
3482
  "isESM": true,
3512
3483
  "relativePath": [
3513
3484
  "dist",
3514
3485
  "commands",
3515
- "whatsapp",
3516
- "templates.js"
3486
+ "tickets",
3487
+ "get.js"
3517
3488
  ]
3518
3489
  },
3519
- "sources:create": {
3490
+ "tickets:list": {
3520
3491
  "aliases": [],
3521
3492
  "args": {},
3522
- "description": "Create a source: text/qna/link (JSON) or a file upload",
3493
+ "description": "List helpdesk tickets for an agent",
3523
3494
  "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"
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"
3528
3498
  ],
3529
3499
  "flags": {
3530
3500
  "json": {
@@ -3584,87 +3554,101 @@
3584
3554
  "multiple": false,
3585
3555
  "type": "option"
3586
3556
  },
3587
- "field": {
3588
- "char": "f",
3589
- "description": "Set a body field: -f key=value (repeatable)",
3590
- "name": "field",
3557
+ "limit": {
3558
+ "description": "Maximum items per page",
3559
+ "name": "limit",
3591
3560
  "hasDynamicHelp": false,
3592
- "multiple": true,
3561
+ "multiple": false,
3593
3562
  "type": "option"
3594
3563
  },
3595
- "type": {
3596
- "description": "JSON source type (mutually exclusive with --file)",
3597
- "exclusive": [
3598
- "file"
3599
- ],
3600
- "name": "type",
3564
+ "cursor": {
3565
+ "description": "Pagination cursor from a previous page",
3566
+ "name": "cursor",
3601
3567
  "hasDynamicHelp": false,
3602
3568
  "multiple": false,
3603
- "options": [
3604
- "text",
3605
- "qna",
3606
- "link"
3607
- ],
3608
3569
  "type": "option"
3609
3570
  },
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",
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",
3620
3580
  "hasDynamicHelp": false,
3621
3581
  "multiple": false,
3622
3582
  "type": "option"
3623
3583
  },
3624
- "name": {
3625
- "description": "Source name (--type text/qna, or a file upload)",
3626
- "name": "name",
3584
+ "channel": {
3585
+ "description": "Filter by channel (comma-separated, e.g. email,api)",
3586
+ "name": "channel",
3627
3587
  "hasDynamicHelp": false,
3628
3588
  "multiple": false,
3629
3589
  "type": "option"
3630
3590
  },
3631
- "content": {
3632
- "description": "Text content for --type text (@file, @-, or inline)",
3633
- "name": "content",
3591
+ "assignee-id": {
3592
+ "description": "Filter by assignee UUID, or \"none\" for unassigned",
3593
+ "name": "assignee-id",
3634
3594
  "hasDynamicHelp": false,
3635
3595
  "multiple": false,
3636
3596
  "type": "option"
3637
3597
  },
3638
- "url": {
3639
- "description": "URL for --type link",
3640
- "name": "url",
3598
+ "team-id": {
3599
+ "description": "Filter by team UUID, or \"none\" for no team",
3600
+ "name": "team-id",
3641
3601
  "hasDynamicHelp": false,
3642
3602
  "multiple": false,
3643
3603
  "type": "option"
3644
3604
  },
3645
- "link-type": {
3646
- "description": "Link crawl mode for --type link",
3647
- "name": "link-type",
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.1.1"
4320
+ "version": "0.3.0"
4264
4321
  }