chatbase 0.1.0 → 0.2.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.
- package/README.md +167 -40
- package/dist/base/body-input.js +2 -2
- package/dist/client/pairing.js +1 -2
- package/dist/commands/auth/login.js +5 -2
- package/dist/commands/auth/logout.js +4 -2
- package/dist/commands/auth/status.js +4 -2
- package/dist/commands/conversations/tool-result.js +74 -0
- package/dist/commands/whatsapp/send-template.js +94 -0
- package/dist/commands/whatsapp/templates.js +55 -0
- package/oclif.manifest.json +421 -105
- package/package.json +5 -1
- package/spec/openapi.json +37 -0
package/README.md
CHANGED
|
@@ -56,6 +56,7 @@ calls you invoke.
|
|
|
56
56
|
* [`chatbase conversations export`](#chatbase-conversations-export)
|
|
57
57
|
* [`chatbase conversations get [CONVERSATIONID]`](#chatbase-conversations-get-conversationid)
|
|
58
58
|
* [`chatbase conversations list`](#chatbase-conversations-list)
|
|
59
|
+
* [`chatbase conversations tool-result [CONVERSATIONID]`](#chatbase-conversations-tool-result-conversationid)
|
|
59
60
|
* [`chatbase health`](#chatbase-health)
|
|
60
61
|
* [`chatbase help [COMMAND]`](#chatbase-help-command)
|
|
61
62
|
* [`chatbase helpdesk statuses`](#chatbase-helpdesk-statuses)
|
|
@@ -76,6 +77,8 @@ calls you invoke.
|
|
|
76
77
|
* [`chatbase tickets reply [TICKETNUMBER]`](#chatbase-tickets-reply-ticketnumber)
|
|
77
78
|
* [`chatbase tickets search QUERY`](#chatbase-tickets-search-query)
|
|
78
79
|
* [`chatbase tickets update TICKETNUMBER`](#chatbase-tickets-update-ticketnumber)
|
|
80
|
+
* [`chatbase whatsapp send-template TEMPLATE`](#chatbase-whatsapp-send-template-template)
|
|
81
|
+
* [`chatbase whatsapp templates`](#chatbase-whatsapp-templates)
|
|
79
82
|
|
|
80
83
|
## `chatbase agents auto-retrain [AGENTID]`
|
|
81
84
|
|
|
@@ -112,7 +115,7 @@ EXAMPLES
|
|
|
112
115
|
$ chatbase agents auto-retrain --enabled
|
|
113
116
|
```
|
|
114
117
|
|
|
115
|
-
_See code: [src/commands/agents/auto-retrain.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
118
|
+
_See code: [src/commands/agents/auto-retrain.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/auto-retrain.ts)_
|
|
116
119
|
|
|
117
120
|
## `chatbase agents clone AGENTID`
|
|
118
121
|
|
|
@@ -142,7 +145,7 @@ EXAMPLES
|
|
|
142
145
|
$ chatbase agents clone agt_123
|
|
143
146
|
```
|
|
144
147
|
|
|
145
|
-
_See code: [src/commands/agents/clone.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
148
|
+
_See code: [src/commands/agents/clone.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/clone.ts)_
|
|
146
149
|
|
|
147
150
|
## `chatbase agents create`
|
|
148
151
|
|
|
@@ -177,7 +180,7 @@ EXAMPLES
|
|
|
177
180
|
$ chatbase agents create --data @agent.json
|
|
178
181
|
```
|
|
179
182
|
|
|
180
|
-
_See code: [src/commands/agents/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
183
|
+
_See code: [src/commands/agents/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/create.ts)_
|
|
181
184
|
|
|
182
185
|
## `chatbase agents delete AGENTID`
|
|
183
186
|
|
|
@@ -208,7 +211,7 @@ EXAMPLES
|
|
|
208
211
|
$ chatbase agents delete agt_123 --confirm agt_123
|
|
209
212
|
```
|
|
210
213
|
|
|
211
|
-
_See code: [src/commands/agents/delete.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
214
|
+
_See code: [src/commands/agents/delete.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/delete.ts)_
|
|
212
215
|
|
|
213
216
|
## `chatbase agents get [AGENTID]`
|
|
214
217
|
|
|
@@ -243,7 +246,7 @@ EXAMPLES
|
|
|
243
246
|
$ chatbase agents get
|
|
244
247
|
```
|
|
245
248
|
|
|
246
|
-
_See code: [src/commands/agents/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
249
|
+
_See code: [src/commands/agents/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/get.ts)_
|
|
247
250
|
|
|
248
251
|
## `chatbase agents list`
|
|
249
252
|
|
|
@@ -276,7 +279,7 @@ EXAMPLES
|
|
|
276
279
|
$ chatbase agents list --json
|
|
277
280
|
```
|
|
278
281
|
|
|
279
|
-
_See code: [src/commands/agents/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
282
|
+
_See code: [src/commands/agents/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/list.ts)_
|
|
280
283
|
|
|
281
284
|
## `chatbase agents styles [AGENTID]`
|
|
282
285
|
|
|
@@ -313,7 +316,7 @@ EXAMPLES
|
|
|
313
316
|
$ chatbase agents styles --data @styles.json
|
|
314
317
|
```
|
|
315
318
|
|
|
316
|
-
_See code: [src/commands/agents/styles.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
319
|
+
_See code: [src/commands/agents/styles.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/styles.ts)_
|
|
317
320
|
|
|
318
321
|
## `chatbase agents train [AGENTID]`
|
|
319
322
|
|
|
@@ -348,7 +351,7 @@ EXAMPLES
|
|
|
348
351
|
$ chatbase agents train
|
|
349
352
|
```
|
|
350
353
|
|
|
351
|
-
_See code: [src/commands/agents/train.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
354
|
+
_See code: [src/commands/agents/train.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/train.ts)_
|
|
352
355
|
|
|
353
356
|
## `chatbase agents update [AGENTID]`
|
|
354
357
|
|
|
@@ -390,7 +393,7 @@ EXAMPLES
|
|
|
390
393
|
$ chatbase agents update agt_123 --data @agent.json
|
|
391
394
|
```
|
|
392
395
|
|
|
393
|
-
_See code: [src/commands/agents/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
396
|
+
_See code: [src/commands/agents/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/update.ts)_
|
|
394
397
|
|
|
395
398
|
## `chatbase api METHOD PATH`
|
|
396
399
|
|
|
@@ -431,7 +434,7 @@ EXAMPLES
|
|
|
431
434
|
$ chatbase api PATCH /agents/agt_123 --body @patch.json
|
|
432
435
|
```
|
|
433
436
|
|
|
434
|
-
_See code: [src/commands/api.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
437
|
+
_See code: [src/commands/api.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/api.ts)_
|
|
435
438
|
|
|
436
439
|
## `chatbase auth login`
|
|
437
440
|
|
|
@@ -464,7 +467,7 @@ EXAMPLES
|
|
|
464
467
|
cat key.txt | chatbase auth login --with-token
|
|
465
468
|
```
|
|
466
469
|
|
|
467
|
-
_See code: [src/commands/auth/login.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
470
|
+
_See code: [src/commands/auth/login.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/auth/login.ts)_
|
|
468
471
|
|
|
469
472
|
## `chatbase auth logout`
|
|
470
473
|
|
|
@@ -491,7 +494,7 @@ EXAMPLES
|
|
|
491
494
|
$ chatbase auth logout
|
|
492
495
|
```
|
|
493
496
|
|
|
494
|
-
_See code: [src/commands/auth/logout.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
497
|
+
_See code: [src/commands/auth/logout.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/auth/logout.ts)_
|
|
495
498
|
|
|
496
499
|
## `chatbase auth status`
|
|
497
500
|
|
|
@@ -518,7 +521,7 @@ EXAMPLES
|
|
|
518
521
|
$ chatbase auth status
|
|
519
522
|
```
|
|
520
523
|
|
|
521
|
-
_See code: [src/commands/auth/status.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
524
|
+
_See code: [src/commands/auth/status.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/auth/status.ts)_
|
|
522
525
|
|
|
523
526
|
## `chatbase chat`
|
|
524
527
|
|
|
@@ -560,7 +563,7 @@ EXAMPLES
|
|
|
560
563
|
$ chatbase chat -a agt_123 -m "hi" --json
|
|
561
564
|
```
|
|
562
565
|
|
|
563
|
-
_See code: [src/commands/chat/index.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
566
|
+
_See code: [src/commands/chat/index.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/chat/index.ts)_
|
|
564
567
|
|
|
565
568
|
## `chatbase chat retry`
|
|
566
569
|
|
|
@@ -595,7 +598,7 @@ EXAMPLES
|
|
|
595
598
|
$ chatbase chat retry --conversation c_123 -a agt_123 --message-id msg_456 --no-stream
|
|
596
599
|
```
|
|
597
600
|
|
|
598
|
-
_See code: [src/commands/chat/retry.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
601
|
+
_See code: [src/commands/chat/retry.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/chat/retry.ts)_
|
|
599
602
|
|
|
600
603
|
## `chatbase config get KEY`
|
|
601
604
|
|
|
@@ -627,7 +630,7 @@ EXAMPLES
|
|
|
627
630
|
$ chatbase config get timeout
|
|
628
631
|
```
|
|
629
632
|
|
|
630
|
-
_See code: [src/commands/config/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
633
|
+
_See code: [src/commands/config/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/config/get.ts)_
|
|
631
634
|
|
|
632
635
|
## `chatbase config list`
|
|
633
636
|
|
|
@@ -654,7 +657,7 @@ EXAMPLES
|
|
|
654
657
|
$ chatbase config list
|
|
655
658
|
```
|
|
656
659
|
|
|
657
|
-
_See code: [src/commands/config/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
660
|
+
_See code: [src/commands/config/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/config/list.ts)_
|
|
658
661
|
|
|
659
662
|
## `chatbase config set KEY [VALUE]`
|
|
660
663
|
|
|
@@ -689,7 +692,7 @@ EXAMPLES
|
|
|
689
692
|
$ chatbase config set timeout 60000
|
|
690
693
|
```
|
|
691
694
|
|
|
692
|
-
_See code: [src/commands/config/set.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
695
|
+
_See code: [src/commands/config/set.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/config/set.ts)_
|
|
693
696
|
|
|
694
697
|
## `chatbase conversations export`
|
|
695
698
|
|
|
@@ -733,7 +736,7 @@ EXAMPLES
|
|
|
733
736
|
$ chatbase conversations export -a agt_123 --all -o export.json
|
|
734
737
|
```
|
|
735
738
|
|
|
736
|
-
_See code: [src/commands/conversations/export.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
739
|
+
_See code: [src/commands/conversations/export.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/conversations/export.ts)_
|
|
737
740
|
|
|
738
741
|
## `chatbase conversations get [CONVERSATIONID]`
|
|
739
742
|
|
|
@@ -769,7 +772,7 @@ EXAMPLES
|
|
|
769
772
|
$ chatbase conversations get --conversation conv_123 -a agt_123
|
|
770
773
|
```
|
|
771
774
|
|
|
772
|
-
_See code: [src/commands/conversations/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
775
|
+
_See code: [src/commands/conversations/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/conversations/get.ts)_
|
|
773
776
|
|
|
774
777
|
## `chatbase conversations list`
|
|
775
778
|
|
|
@@ -815,7 +818,51 @@ EXAMPLES
|
|
|
815
818
|
$ chatbase conversations list -a agt_123 --all --json
|
|
816
819
|
```
|
|
817
820
|
|
|
818
|
-
_See code: [src/commands/conversations/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
821
|
+
_See code: [src/commands/conversations/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/conversations/list.ts)_
|
|
822
|
+
|
|
823
|
+
## `chatbase conversations tool-result [CONVERSATIONID]`
|
|
824
|
+
|
|
825
|
+
Submit a client-side tool result to a chat turn
|
|
826
|
+
|
|
827
|
+
```
|
|
828
|
+
USAGE
|
|
829
|
+
$ chatbase conversations tool-result [CONVERSATIONID] --tool-call-id <value> [--json] [--plain] [-q] [--verbose] [--no-input]
|
|
830
|
+
[--no-color] [--agent-name <value> | -a <value>] [--conversation <value>] [--output <value>]
|
|
831
|
+
|
|
832
|
+
ARGUMENTS
|
|
833
|
+
[CONVERSATIONID] Conversation ID (alternative to --conversation)
|
|
834
|
+
|
|
835
|
+
FLAGS
|
|
836
|
+
-a, --agent=<value> Agent ID (or set CHATBASE_AGENT_ID)
|
|
837
|
+
-q, --quiet Suppress non-essential output
|
|
838
|
+
--agent-name=<value> Agent display name (looked up to an ID)
|
|
839
|
+
--conversation=<value> Conversation ID
|
|
840
|
+
--no-color Disable colored output
|
|
841
|
+
--no-input Never prompt; fail instead
|
|
842
|
+
--output=<value> Result of executing the tool (inline JSON, @file, or @-); a value that is not valid JSON
|
|
843
|
+
is sent as a plain string
|
|
844
|
+
--tool-call-id=<value> (required) The toolCallId from the tool-call part in the chat response
|
|
845
|
+
--verbose Verbose diagnostics
|
|
846
|
+
|
|
847
|
+
OUTPUT FLAGS
|
|
848
|
+
--json Output raw API JSON
|
|
849
|
+
--plain Tab-separated output for scripts
|
|
850
|
+
|
|
851
|
+
DESCRIPTION
|
|
852
|
+
Submit a client-side tool result to a chat turn
|
|
853
|
+
|
|
854
|
+
Submit the result of a client-side tool call so the paused chat turn can continue. The tool call ID comes from the
|
|
855
|
+
tool-call part of the chat response that requested the execution.
|
|
856
|
+
|
|
857
|
+
EXAMPLES
|
|
858
|
+
$ chatbase conversations tool-result conv_123 --tool-call-id tc_1 --output '{"temperature": 72}' -a agt_123
|
|
859
|
+
|
|
860
|
+
$ chatbase conversations tool-result conv_123 --tool-call-id tc_1 --output @result.json -a agt_123
|
|
861
|
+
|
|
862
|
+
$ chatbase conversations tool-result conv_123 --tool-call-id tc_1 -a agt_123
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
_See code: [src/commands/conversations/tool-result.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/conversations/tool-result.ts)_
|
|
819
866
|
|
|
820
867
|
## `chatbase health`
|
|
821
868
|
|
|
@@ -844,7 +891,7 @@ EXAMPLES
|
|
|
844
891
|
$ chatbase health --json
|
|
845
892
|
```
|
|
846
893
|
|
|
847
|
-
_See code: [src/commands/health.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
894
|
+
_See code: [src/commands/health.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/health.ts)_
|
|
848
895
|
|
|
849
896
|
## `chatbase help [COMMAND]`
|
|
850
897
|
|
|
@@ -894,7 +941,7 @@ EXAMPLES
|
|
|
894
941
|
$ chatbase helpdesk statuses -a agt_123
|
|
895
942
|
```
|
|
896
943
|
|
|
897
|
-
_See code: [src/commands/helpdesk/statuses.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
944
|
+
_See code: [src/commands/helpdesk/statuses.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/helpdesk/statuses.ts)_
|
|
898
945
|
|
|
899
946
|
## `chatbase helpdesk teams`
|
|
900
947
|
|
|
@@ -924,7 +971,7 @@ EXAMPLES
|
|
|
924
971
|
$ chatbase helpdesk teams -a agt_123
|
|
925
972
|
```
|
|
926
973
|
|
|
927
|
-
_See code: [src/commands/helpdesk/teams.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
974
|
+
_See code: [src/commands/helpdesk/teams.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/helpdesk/teams.ts)_
|
|
928
975
|
|
|
929
976
|
## `chatbase messages feedback [MESSAGEID]`
|
|
930
977
|
|
|
@@ -963,7 +1010,7 @@ EXAMPLES
|
|
|
963
1010
|
$ chatbase messages feedback --conversation conv_123 --message msg_1 --rating clear -a agt_123
|
|
964
1011
|
```
|
|
965
1012
|
|
|
966
|
-
_See code: [src/commands/messages/feedback.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1013
|
+
_See code: [src/commands/messages/feedback.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/messages/feedback.ts)_
|
|
967
1014
|
|
|
968
1015
|
## `chatbase messages list`
|
|
969
1016
|
|
|
@@ -999,7 +1046,7 @@ EXAMPLES
|
|
|
999
1046
|
$ chatbase messages list --conversation conv_123 -a agt_123 --all --json
|
|
1000
1047
|
```
|
|
1001
1048
|
|
|
1002
|
-
_See code: [src/commands/messages/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1049
|
+
_See code: [src/commands/messages/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/messages/list.ts)_
|
|
1003
1050
|
|
|
1004
1051
|
## `chatbase sources create`
|
|
1005
1052
|
|
|
@@ -1046,7 +1093,7 @@ EXAMPLES
|
|
|
1046
1093
|
$ chatbase sources create --file ./guide.pdf -a agt_123
|
|
1047
1094
|
```
|
|
1048
1095
|
|
|
1049
|
-
_See code: [src/commands/sources/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1096
|
+
_See code: [src/commands/sources/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/create.ts)_
|
|
1050
1097
|
|
|
1051
1098
|
## `chatbase sources delete SOURCEID`
|
|
1052
1099
|
|
|
@@ -1079,7 +1126,7 @@ EXAMPLES
|
|
|
1079
1126
|
$ chatbase sources delete src_1 -a agt_1
|
|
1080
1127
|
```
|
|
1081
1128
|
|
|
1082
|
-
_See code: [src/commands/sources/delete.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1129
|
+
_See code: [src/commands/sources/delete.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/delete.ts)_
|
|
1083
1130
|
|
|
1084
1131
|
## `chatbase sources get SOURCEID`
|
|
1085
1132
|
|
|
@@ -1112,7 +1159,7 @@ EXAMPLES
|
|
|
1112
1159
|
$ chatbase sources get src_123 -a agt_123
|
|
1113
1160
|
```
|
|
1114
1161
|
|
|
1115
|
-
_See code: [src/commands/sources/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1162
|
+
_See code: [src/commands/sources/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/get.ts)_
|
|
1116
1163
|
|
|
1117
1164
|
## `chatbase sources list`
|
|
1118
1165
|
|
|
@@ -1149,7 +1196,7 @@ EXAMPLES
|
|
|
1149
1196
|
$ chatbase sources list -a agt_123 --all --json
|
|
1150
1197
|
```
|
|
1151
1198
|
|
|
1152
|
-
_See code: [src/commands/sources/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1199
|
+
_See code: [src/commands/sources/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/list.ts)_
|
|
1153
1200
|
|
|
1154
1201
|
## `chatbase sources restore SOURCEID`
|
|
1155
1202
|
|
|
@@ -1182,7 +1229,7 @@ EXAMPLES
|
|
|
1182
1229
|
$ chatbase sources restore src_1 -a agt_1
|
|
1183
1230
|
```
|
|
1184
1231
|
|
|
1185
|
-
_See code: [src/commands/sources/restore.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1232
|
+
_See code: [src/commands/sources/restore.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/restore.ts)_
|
|
1186
1233
|
|
|
1187
1234
|
## `chatbase sources summary`
|
|
1188
1235
|
|
|
@@ -1212,7 +1259,7 @@ EXAMPLES
|
|
|
1212
1259
|
$ chatbase sources summary -a agt_123
|
|
1213
1260
|
```
|
|
1214
1261
|
|
|
1215
|
-
_See code: [src/commands/sources/summary.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1262
|
+
_See code: [src/commands/sources/summary.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/summary.ts)_
|
|
1216
1263
|
|
|
1217
1264
|
## `chatbase sources update SOURCEID`
|
|
1218
1265
|
|
|
@@ -1250,7 +1297,7 @@ EXAMPLES
|
|
|
1250
1297
|
$ chatbase sources update src_1 --file ./updated.pdf -a agt_1
|
|
1251
1298
|
```
|
|
1252
1299
|
|
|
1253
|
-
_See code: [src/commands/sources/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1300
|
+
_See code: [src/commands/sources/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/update.ts)_
|
|
1254
1301
|
|
|
1255
1302
|
## `chatbase tickets create`
|
|
1256
1303
|
|
|
@@ -1288,7 +1335,7 @@ EXAMPLES
|
|
|
1288
1335
|
$ chatbase tickets create --subject "Export failing" --data '{"description":"Customer cannot export.","customer":{"email":"jane@example.com"}}' -a agt_123
|
|
1289
1336
|
```
|
|
1290
1337
|
|
|
1291
|
-
_See code: [src/commands/tickets/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1338
|
+
_See code: [src/commands/tickets/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/create.ts)_
|
|
1292
1339
|
|
|
1293
1340
|
## `chatbase tickets get TICKETNUMBER`
|
|
1294
1341
|
|
|
@@ -1321,7 +1368,7 @@ EXAMPLES
|
|
|
1321
1368
|
$ chatbase tickets get 42 -a agt_123
|
|
1322
1369
|
```
|
|
1323
1370
|
|
|
1324
|
-
_See code: [src/commands/tickets/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1371
|
+
_See code: [src/commands/tickets/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/get.ts)_
|
|
1325
1372
|
|
|
1326
1373
|
## `chatbase tickets list`
|
|
1327
1374
|
|
|
@@ -1371,7 +1418,7 @@ EXAMPLES
|
|
|
1371
1418
|
$ chatbase tickets list -a agt_123 --all --json
|
|
1372
1419
|
```
|
|
1373
1420
|
|
|
1374
|
-
_See code: [src/commands/tickets/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1421
|
+
_See code: [src/commands/tickets/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/list.ts)_
|
|
1375
1422
|
|
|
1376
1423
|
## `chatbase tickets messages [TICKETNUMBER]`
|
|
1377
1424
|
|
|
@@ -1414,7 +1461,7 @@ EXAMPLES
|
|
|
1414
1461
|
$ chatbase tickets messages 42 -a agt_123 --all --json
|
|
1415
1462
|
```
|
|
1416
1463
|
|
|
1417
|
-
_See code: [src/commands/tickets/messages.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1464
|
+
_See code: [src/commands/tickets/messages.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/messages.ts)_
|
|
1418
1465
|
|
|
1419
1466
|
## `chatbase tickets reply [TICKETNUMBER]`
|
|
1420
1467
|
|
|
@@ -1453,7 +1500,7 @@ EXAMPLES
|
|
|
1453
1500
|
$ chatbase tickets reply 42 -m "On it" --author-email sam@example.com -a agt_123
|
|
1454
1501
|
```
|
|
1455
1502
|
|
|
1456
|
-
_See code: [src/commands/tickets/reply.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1503
|
+
_See code: [src/commands/tickets/reply.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/reply.ts)_
|
|
1457
1504
|
|
|
1458
1505
|
## `chatbase tickets search QUERY`
|
|
1459
1506
|
|
|
@@ -1489,7 +1536,7 @@ EXAMPLES
|
|
|
1489
1536
|
$ chatbase tickets search "refund" -a agt_123 --limit 10 --json
|
|
1490
1537
|
```
|
|
1491
1538
|
|
|
1492
|
-
_See code: [src/commands/tickets/search.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1539
|
+
_See code: [src/commands/tickets/search.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/search.ts)_
|
|
1493
1540
|
|
|
1494
1541
|
## `chatbase tickets update TICKETNUMBER`
|
|
1495
1542
|
|
|
@@ -1525,5 +1572,85 @@ EXAMPLES
|
|
|
1525
1572
|
$ chatbase tickets update 42 --data '{"statusCategory":"closed"}' -a agt_123
|
|
1526
1573
|
```
|
|
1527
1574
|
|
|
1528
|
-
_See code: [src/commands/tickets/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.
|
|
1575
|
+
_See code: [src/commands/tickets/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/update.ts)_
|
|
1576
|
+
|
|
1577
|
+
## `chatbase whatsapp send-template TEMPLATE`
|
|
1578
|
+
|
|
1579
|
+
Send an approved WhatsApp template message
|
|
1580
|
+
|
|
1581
|
+
```
|
|
1582
|
+
USAGE
|
|
1583
|
+
$ chatbase whatsapp send-template TEMPLATE --to <value> [--json] [--plain] [-q] [--verbose] [--no-input] [--no-color]
|
|
1584
|
+
[--agent-name <value> | -a <value>] [--from <value>] [--language <value>] [--variables <value>]
|
|
1585
|
+
|
|
1586
|
+
ARGUMENTS
|
|
1587
|
+
TEMPLATE Name of the approved template
|
|
1588
|
+
|
|
1589
|
+
FLAGS
|
|
1590
|
+
-a, --agent=<value> Agent ID (or set CHATBASE_AGENT_ID)
|
|
1591
|
+
-q, --quiet Suppress non-essential output
|
|
1592
|
+
--agent-name=<value> Agent display name (looked up to an ID)
|
|
1593
|
+
--from=<value> Which connected WhatsApp number to send from — optional when the agent has exactly one
|
|
1594
|
+
--language=<value> Template language code (e.g. en_US) — optional when the template exists in a single language
|
|
1595
|
+
--no-color Disable colored output
|
|
1596
|
+
--no-input Never prompt; fail instead
|
|
1597
|
+
--to=<value> (required) Recipient phone number in international format (digits with country code)
|
|
1598
|
+
--variables=<value> Template variable values as JSON grouped by component (@file, @-, or inline), e.g.
|
|
1599
|
+
'{"body":{"1":"Jane"}}'
|
|
1600
|
+
--verbose Verbose diagnostics
|
|
1601
|
+
|
|
1602
|
+
OUTPUT FLAGS
|
|
1603
|
+
--json Output raw API JSON
|
|
1604
|
+
--plain Tab-separated output for scripts
|
|
1605
|
+
|
|
1606
|
+
DESCRIPTION
|
|
1607
|
+
Send an approved WhatsApp template message
|
|
1608
|
+
|
|
1609
|
+
Send an approved WhatsApp template to a phone number from one of the agent’s connected numbers. No user ID is needed —
|
|
1610
|
+
a Chatbase user is resolved or created from the recipient number, and replies flow through the agent’s regular
|
|
1611
|
+
WhatsApp pipeline. Use `whatsapp templates` to see available templates and the variables each expects.
|
|
1612
|
+
|
|
1613
|
+
EXAMPLES
|
|
1614
|
+
$ chatbase whatsapp send-template order_update --to 14155552671 -a agt_123
|
|
1615
|
+
|
|
1616
|
+
$ chatbase whatsapp send-template order_update --to 14155552671 --language en_US --variables '{"header":{"1":"#1042"},"body":{"1":"Jane","2":"Friday"}}' -a agt_123
|
|
1617
|
+
```
|
|
1618
|
+
|
|
1619
|
+
_See code: [src/commands/whatsapp/send-template.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/whatsapp/send-template.ts)_
|
|
1620
|
+
|
|
1621
|
+
## `chatbase whatsapp templates`
|
|
1622
|
+
|
|
1623
|
+
List approved WhatsApp templates for an agent
|
|
1624
|
+
|
|
1625
|
+
```
|
|
1626
|
+
USAGE
|
|
1627
|
+
$ chatbase whatsapp templates [--json] [--plain] [-q] [--verbose] [--no-input] [--no-color] [--agent-name <value> | -a
|
|
1628
|
+
<value>]
|
|
1629
|
+
|
|
1630
|
+
FLAGS
|
|
1631
|
+
-a, --agent=<value> Agent ID (or set CHATBASE_AGENT_ID)
|
|
1632
|
+
-q, --quiet Suppress non-essential output
|
|
1633
|
+
--agent-name=<value> Agent display name (looked up to an ID)
|
|
1634
|
+
--no-color Disable colored output
|
|
1635
|
+
--no-input Never prompt; fail instead
|
|
1636
|
+
--verbose Verbose diagnostics
|
|
1637
|
+
|
|
1638
|
+
OUTPUT FLAGS
|
|
1639
|
+
--json Output raw API JSON
|
|
1640
|
+
--plain Tab-separated output for scripts
|
|
1641
|
+
|
|
1642
|
+
DESCRIPTION
|
|
1643
|
+
List approved WhatsApp templates for an agent
|
|
1644
|
+
|
|
1645
|
+
List the approved WhatsApp templates available to the agent, across all of its connected WhatsApp Business Accounts. A
|
|
1646
|
+
template can only be sent from a number on its own Business Account — pick a sender whose WABA matches the template’s
|
|
1647
|
+
WABA column.
|
|
1648
|
+
|
|
1649
|
+
EXAMPLES
|
|
1650
|
+
$ chatbase whatsapp templates -a agt_123
|
|
1651
|
+
|
|
1652
|
+
$ chatbase whatsapp templates -a agt_123 --json
|
|
1653
|
+
```
|
|
1654
|
+
|
|
1655
|
+
_See code: [src/commands/whatsapp/templates.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/whatsapp/templates.ts)_
|
|
1529
1656
|
<!-- commandsstop -->
|
package/dist/base/body-input.js
CHANGED
|
@@ -72,6 +72,6 @@ export async function readBodyData(data, fields) {
|
|
|
72
72
|
return { ...base, ...parseFields(fields) };
|
|
73
73
|
}
|
|
74
74
|
/** Resolve a flag value via the same @file/@- indirection, without JSON parsing. */
|
|
75
|
-
export async function readTextInput(value) {
|
|
76
|
-
return resolveInput(value,
|
|
75
|
+
export async function readTextInput(value, flagName = '--content') {
|
|
76
|
+
return resolveInput(value, flagName);
|
|
77
77
|
}
|
package/dist/client/pairing.js
CHANGED
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
* 3. Poll POST /api/cli-pairing/exchange until approved
|
|
6
6
|
* 4. Receive the minted API key + workspace info
|
|
7
7
|
*
|
|
8
|
-
* These endpoints are internal (not under /api/v2) and unauthenticated.
|
|
9
8
|
*/
|
|
10
9
|
import os from 'node:os';
|
|
11
10
|
import { parseErrorResponse, UsageError } from '../errors/errors.js';
|
|
12
11
|
import { rawApiFetch, resolveBaseUrl } from './client.js';
|
|
13
12
|
import { wasInterrupted } from './signals.js';
|
|
14
|
-
function pairingBaseUrl(baseUrl) {
|
|
13
|
+
export function pairingBaseUrl(baseUrl) {
|
|
15
14
|
return new URL(resolveBaseUrl(baseUrl)).origin;
|
|
16
15
|
}
|
|
17
16
|
export async function startPairing(opts) {
|
|
@@ -3,7 +3,7 @@ import { Flags } from '@oclif/core';
|
|
|
3
3
|
import { BaseCommand } from '../../base/base-command.js';
|
|
4
4
|
import { readStdinToEnd } from '../../base/body-input.js';
|
|
5
5
|
import { rawApiFetch } from '../../client/client.js';
|
|
6
|
-
import { pollExchange, startPairing } from '../../client/pairing.js';
|
|
6
|
+
import { pairingBaseUrl, pollExchange, startPairing } from '../../client/pairing.js';
|
|
7
7
|
import { configFile } from '../../config/paths.js';
|
|
8
8
|
import { writeUserConfig } from '../../config/store.js';
|
|
9
9
|
import { parseErrorResponse, UsageError } from '../../errors/errors.js';
|
|
@@ -107,7 +107,10 @@ export default class AuthLogin extends BaseCommand {
|
|
|
107
107
|
this.note(flags, `Saved to ${configFile()}`);
|
|
108
108
|
}
|
|
109
109
|
async verifyAndStore(flags, key) {
|
|
110
|
-
const res = await rawApiFetch('GET', '/me', {
|
|
110
|
+
const res = await rawApiFetch('GET', '/api/cli-pairing/me', {
|
|
111
|
+
apiKey: key,
|
|
112
|
+
baseUrl: pairingBaseUrl()
|
|
113
|
+
});
|
|
111
114
|
if (res.status === 200) {
|
|
112
115
|
const body = res.body;
|
|
113
116
|
writeUserConfig({ apiKey: key });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import { BaseCommand } from '../../base/base-command.js';
|
|
3
3
|
import { rawApiFetch } from '../../client/client.js';
|
|
4
|
+
import { pairingBaseUrl } from '../../client/pairing.js';
|
|
4
5
|
import { configFile } from '../../config/paths.js';
|
|
5
6
|
import { readUserConfig } from '../../config/store.js';
|
|
6
7
|
export default class AuthLogout extends BaseCommand {
|
|
@@ -17,8 +18,9 @@ export default class AuthLogout extends BaseCommand {
|
|
|
17
18
|
}
|
|
18
19
|
if (config.apiKeySource === 'pairing') {
|
|
19
20
|
try {
|
|
20
|
-
const res = await rawApiFetch('DELETE', '/me
|
|
21
|
-
apiKey: config.apiKey
|
|
21
|
+
const res = await rawApiFetch('DELETE', '/api/cli-pairing/me', {
|
|
22
|
+
apiKey: config.apiKey,
|
|
23
|
+
baseUrl: pairingBaseUrl()
|
|
22
24
|
});
|
|
23
25
|
if (res.status >= 200 && res.status < 300) {
|
|
24
26
|
this.note(flags, 'CLI session revoked server-side.');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base/base-command.js';
|
|
2
2
|
import { DEFAULT_BASE_URL, rawApiFetch, resolveBaseUrl } from '../../client/client.js';
|
|
3
|
+
import { pairingBaseUrl } from '../../client/pairing.js';
|
|
3
4
|
import { resolveApiKey } from '../../config/resolve.js';
|
|
4
5
|
export default class AuthStatus extends BaseCommand {
|
|
5
6
|
static description = 'Show the active credential and where it comes from';
|
|
@@ -18,8 +19,9 @@ export default class AuthStatus extends BaseCommand {
|
|
|
18
19
|
}
|
|
19
20
|
const tail = resolved.value.length > 8 ? `…${resolved.value.slice(-4)}` : '…****';
|
|
20
21
|
this.note(flags, `Credential: ${tail} (from ${resolved.source})`);
|
|
21
|
-
const res = await rawApiFetch('GET', '/me', {
|
|
22
|
-
apiKey: resolved.value
|
|
22
|
+
const res = await rawApiFetch('GET', '/api/cli-pairing/me', {
|
|
23
|
+
apiKey: resolved.value,
|
|
24
|
+
baseUrl: pairingBaseUrl()
|
|
23
25
|
});
|
|
24
26
|
if (res.status === 200) {
|
|
25
27
|
this.renderMe(flags, res.body);
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { AgentCommand } from '../../base/agent-command.js';
|
|
3
|
+
import { readTextInput } from '../../base/body-input.js';
|
|
4
|
+
import { throwIfError } from '../../client/client.js';
|
|
5
|
+
import { UsageError } from '../../errors/errors.js';
|
|
6
|
+
export default class ConversationsToolResult extends AgentCommand {
|
|
7
|
+
static summary = 'Submit a client-side tool result to a chat turn';
|
|
8
|
+
static description = 'Submit the result of a client-side tool call so the paused chat ' +
|
|
9
|
+
'turn can continue. The tool call ID comes from the tool-call part ' +
|
|
10
|
+
'of the chat response that requested the execution.';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 --output \'{"temperature": 72}\' -a agt_123',
|
|
13
|
+
'<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 --output @result.json -a agt_123',
|
|
14
|
+
'<%= config.bin %> conversations tool-result conv_123 --tool-call-id tc_1 -a agt_123'
|
|
15
|
+
];
|
|
16
|
+
static args = {
|
|
17
|
+
conversationId: Args.string({
|
|
18
|
+
required: false,
|
|
19
|
+
description: 'Conversation ID (alternative to --conversation)'
|
|
20
|
+
})
|
|
21
|
+
};
|
|
22
|
+
static flags = {
|
|
23
|
+
...AgentCommand.baseFlags,
|
|
24
|
+
conversation: Flags.string({
|
|
25
|
+
description: 'Conversation ID'
|
|
26
|
+
}),
|
|
27
|
+
'tool-call-id': Flags.string({
|
|
28
|
+
required: true,
|
|
29
|
+
description: 'The toolCallId from the tool-call part in the chat response'
|
|
30
|
+
}),
|
|
31
|
+
output: Flags.string({
|
|
32
|
+
description: 'Result of executing the tool (inline JSON, @file, or @-); ' +
|
|
33
|
+
'a value that is not valid JSON is sent as a plain string'
|
|
34
|
+
})
|
|
35
|
+
};
|
|
36
|
+
async run() {
|
|
37
|
+
const { args, flags } = await this.parse(ConversationsToolResult);
|
|
38
|
+
// Positional and flag are alternatives — `agents get <id>` set the
|
|
39
|
+
// positional convention, the flag predates it and stays supported.
|
|
40
|
+
const conversationId = args.conversationId ?? flags.conversation;
|
|
41
|
+
if (!conversationId) {
|
|
42
|
+
throw new UsageError('Missing conversation ID. Pass it positionally (`conversations tool-result <id> ...`) or via --conversation.');
|
|
43
|
+
}
|
|
44
|
+
if (args.conversationId && flags.conversation) {
|
|
45
|
+
throw new UsageError('Pass the conversation ID either positionally or via --conversation, not both.');
|
|
46
|
+
}
|
|
47
|
+
const body = {
|
|
48
|
+
toolCallId: flags['tool-call-id']
|
|
49
|
+
};
|
|
50
|
+
if (flags.output !== undefined) {
|
|
51
|
+
const raw = await readTextInput(flags.output, '--output');
|
|
52
|
+
// Tool outputs are arbitrary values in the spec: parse JSON when
|
|
53
|
+
// it is JSON, otherwise pass the text through as a string.
|
|
54
|
+
try {
|
|
55
|
+
body.output = JSON.parse(raw);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
body.output = raw;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const client = this.apiClient(flags);
|
|
62
|
+
const agentId = await this.agentId(flags, client);
|
|
63
|
+
const { data, error, response } = await client.POST('/agents/{agentId}/conversations/{conversationId}/tool-result', {
|
|
64
|
+
params: { path: { agentId, conversationId } },
|
|
65
|
+
body
|
|
66
|
+
});
|
|
67
|
+
throwIfError(response, error);
|
|
68
|
+
if (flags.json) {
|
|
69
|
+
process.stdout.write(`${JSON.stringify(data, null, 2)}\n`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.success(flags, `Tool result submitted for ${flags['tool-call-id']}`);
|
|
73
|
+
}
|
|
74
|
+
}
|